Omnimaga: The Coders Of Tomorrow
Welcome, Guest. Please login or register.
 
Omnimaga: The Coders Of Tomorrow
21 May, 2013, 16:44:37 *
Welcome, Guest. Please login or register.

Login with username, password and session length
 
   home   news downloads projects tutorials misc forums rules new posts irc about Login Register  
+-OmnomIRC

You must Register, be logged in and have at least 40 posts to use this shout-box! If it still doesn't show up afterward, it might be that OmnomIRC is disabled for your group or under maintenance.

Note: You can also use an IRC client like mIRC, X-Chat or Mibbit to connect to an EFnet server and #omnimaga.

Pages: [1]   Go Down
  Print  
Author Topic: Grayscale in Grammer -  (Read 349 times) Bookmark and Share
0 Members and 1 Guest are viewing this topic.
Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Online Online

Last Login: Today at 16:30:15
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3749


Topic starter
Total Post Ratings: +600

View Profile
« on: 11 January, 2012, 18:49:10 »
+3

I finally learned how to do grayscale properly and now I want to pass on that knowledge for Grammer programmers. This has been possible with Grammer for a while, I just never understood the theory behind making it flickerless and beautiful looking. So here goes:

For three level grayscale, we have it very easy. You have a gray buffer and a black buffer In the gray buffer, you set any gray pixels to on and leave the rest alone. In the black buffer, you set the black pixels on and leave the rest alone. Now you need to display it and this is where it gets fun.

Normally, you would have flicker and if you have ever attempted and failed grayscale like me, you know what I am talking about. So how do you get around this? You set any gray pixels on an alternating cycle. How is this achieved? You use a checkerboard pattern and use AND logic on the buffer. So every other cycle, a gray pixel is displayed, but you want to display black pixels every cycle. So you OR the black buffer with that buffer, too. So here is an example using a tilemap:

1
2
3
4
5
6
!E→E                               ;This makes E alternate between 0 and 1. This tells us the cycle we are on.
Fill(+2                              ;This uses one of the checkerboard patterns. It alternates with E
Pt-Change(0,M,G,W,X,Y,1   ;Draws a tilemap using the gray tileset with AND logic
Pt-Change(0,M,B,W,X,Y,3    ;Draws the same tilemap with the blcak tileset with OR logic
DispGraph                         ;Now display
As long as you display it enough, this will make rather beautiful 3 level grayscale. I am currently working on other levels of grayscale as well as additions for grayscale drawing (possibly).

Anyways, here are some programs to play with. I would show a screenie, but WabbitEmu cannot capture it nearly as well as it looks on an actual calculator.

EDIT: Posted a pic and that is pretty accurate with how it look on an actual calc Smiley

* GrayMap.zip (2.19 KB - downloaded 24 times.)

* GrayMap Ex 0.gif (2.41 KB, 192x128 - viewed 96 times.)
« Last Edit: 11 January, 2012, 19:09:36 by Xeda112358 » Logged



Grammer Download (2.29.04.12)
Latest update (possibly incomplete)
My pastebin
Spoiler for FileSyst:
FileSyst is an application that provides a folder and filesystem for the TI-83+/84+ calculators. It is designed to be easy to access and use in BASIC, and it can be used to access game files and save data, or to create a command prompt, among other things:

Spoiler for Graphiti:
This is a graph explorer for graph theory. It will require lots of work to finish. Currently you can:
Add/delete vertices
Add edges (direction not shown, but they are directed)
Arrange vertices in a circle (in the future, you will be able to define levels of rings and the number of nodes in each)
Create complete graphs quickly

Plans:
Add adjacency matrix viewer
Deleting edges
Multiple graphs support
Arrows for directed graphs
Planarity testing
Matrix operations
Weighted edges
Chromatic polynomials
Chromatic numbers

Spoiler for Stats:

Samocal             [o---------]
Virtual Processor   [o---------]
EnG                 [oo--------]
Grammer             [ooo-------]
AsmComp             [ooo-------]
Partex              [oooo------]
BatLib              [oooooooo--]
Grammer82           [----------]
Grammer68000        [----------]


Pseudonyms:  Zeda, Xeda, Thunderbolt
Languages:   English, français
Programming: z80 Assmebly
             Grammer
             TI-BASIC (83/84/+/SE, 89/89t/92)
Known For:   -Creator of the Grammer programming language
              (Winning program of zContest2011)
             -BatLib- One of the most feature packed libraries for BASIC programmers available
              with over 100 functions and a simple programming language
             -Learning to program z80 in hexadecimal before using an assembler (no computer was
              available!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


Art_of_camelot
The matrix has you.. ಠ_ಠ
Support Staff
LV12 Extreme Poster (Next: 5000)
*
Offline Offline

Last Login: Today at 15:04:19
Date Registered: 30 August, 2008, 04:55:55
Location: Dr. Light's Laboratory
Posts: 4391


Total Post Ratings: +149

View Profile WWW
« Reply #1 on: 12 January, 2012, 17:51:34 »
0

Very nice! =)
Logged

Projects:
TBA! Coming to an 83+ near you!

NerdTests.com says I'm a Cool Nerd King.  Click here to take the Nerd Test, get nerdy images and jokes, and write on the nerd forum!


Xeda112358
Xombie. I am it.
Coder Of Tomorrow
LV12 Extreme Poster (Next: 5000)
*
Online Online

Last Login: Today at 16:30:15
Date Registered: 31 October, 2010, 08:46:36
Location: Land of Little Cubes and Tea, NY
Posts: 3749


Topic starter
Total Post Ratings: +600

View Profile
« Reply #2 on: 12 January, 2012, 18:52:58 »
0

Thanks Smiley And I now have a command for grayscale sprites and tilemaps o.o That should help folks, I think Smiley
Logged



Grammer Download (2.29.04.12)
Latest update (possibly incomplete)
My pastebin
Spoiler for FileSyst:
FileSyst is an application that provides a folder and filesystem for the TI-83+/84+ calculators. It is designed to be easy to access and use in BASIC, and it can be used to access game files and save data, or to create a command prompt, among other things:

Spoiler for Graphiti:
This is a graph explorer for graph theory. It will require lots of work to finish. Currently you can:
Add/delete vertices
Add edges (direction not shown, but they are directed)
Arrange vertices in a circle (in the future, you will be able to define levels of rings and the number of nodes in each)
Create complete graphs quickly

Plans:
Add adjacency matrix viewer
Deleting edges
Multiple graphs support
Arrows for directed graphs
Planarity testing
Matrix operations
Weighted edges
Chromatic polynomials
Chromatic numbers

Spoiler for Stats:

Samocal             [o---------]
Virtual Processor   [o---------]
EnG                 [oo--------]
Grammer             [ooo-------]
AsmComp             [ooo-------]
Partex              [oooo------]
BatLib              [oooooooo--]
Grammer82           [----------]
Grammer68000        [----------]


Pseudonyms:  Zeda, Xeda, Thunderbolt
Languages:   English, français
Programming: z80 Assmebly
             Grammer
             TI-BASIC (83/84/+/SE, 89/89t/92)
Known For:   -Creator of the Grammer programming language
              (Winning program of zContest2011)
             -BatLib- One of the most feature packed libraries for BASIC programmers available
              with over 100 functions and a simple programming language
             -Learning to program z80 in hexadecimal before using an assembler (no computer was
              available!)
╔═╦╗░╠═╬╣▒║ ║║▓╚═╩╝█


Sorunome
Muffins
LV11 Super Veteran (Next: 3000)
***********
Offline Offline

Gender: Male
Last Login: Today at 01:55:56
Date Registered: 26 September, 2011, 17:46:38
Location: Ponyville
Posts: 2925


Total Post Ratings: +161

View Profile WWW
« Reply #3 on: 12 January, 2012, 19:03:40 »
0

Cool, greyscale! O.o
Logged

http://z0r.de/4017
http://www.youtube.com/watch?v=BFOoazEx9lU
http://www.sorunome.de
http://reubenquest.net
+++++++[>++++++++++++<-]>.<+++[>----<-]>.---.<++++[>>++++++++<<-]>>.<++.------.++++++++++++.--------.

++++++[>++++++++++<-]>++++++++.<+++[>+++++++++++<-]>.+++++++++++++.--.<+++[>+++<-]>.<+++[>>++++++++++<<-]>>++.<<+++++++[>-------<-]>.<+++[>+++++++++++++<-]>..+++++++.<+++[>-----<-]>--.<++[>++++++<-]>++.

If OmnomIRC is screwed up, blame me Tongue

Save Derpy!(http://www.youtube.com/watch?v=cg-_HeVNYOk)
Spoiler for spoilers:


Spoiler for languages:
- TI-BASIC
 - TI-Highbrid Basic
 - Grammer
 - Axe
 - HTML
 - JavaScript
 - CSS
 - PHP
 - C++
 - lua
 - Python
 - MYSQL
 - Brainf*ck
 - English
 - German
Spoiler for internet:
/image/36691.png[/img]
Gimme internet NOW
Spoiler for me:
Spoiler for my little game:
my little game...my little game..aaaaaahhhhhh...my little game, i used to wonder how to lose the game, my little game, until you shared its losing with me. take the losing and the game, a beutiful game so losable, sharing losing is a easy sweat and losing makes it aweful neat to have my little game togeather with my very best games.
Spoiler for stuff:
Spoiler for derpy:



Pages: [1]   Go Up
  Print  
 
Jump to:  

Powered by EzPortal
Powered by MySQL Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Powered by PHP
Page created in 0.245 seconds with 31 queries.
Skin by DJ Omnimaga edited from SMF default theme with the help of tr1p1ea.
All programs, games and songs avaliable on this website are property of their respective owners.
Best viewed in Opera, Firefox, Chrome and Safari with a resolution of 1024x768 or above.