How are graphics done with the eZ80? I'm rather new to assembly, and the only thing I can understand is filling the screen with a getKey call.
There is a ram area referred to as "VRAM". When you write to VRAM, the calc's hardware transfers the data to the screen, making the screen's pixels change color. The operating system uses 16 bits per pixel mode. That means that every pixel takes up 2 bytes (or 16 bits) of VRAM. These two bytes hold the rgb color value of the pixel. Most games use 8 bits per pixel mode. Here, each pixel takes up 1 byte of vram, but the value does not represent the rpg value of the pixel. Instead it is an index to a pallet color. So for example if the value is 25, the hardware will get the 26th color in the palate, and set the pixel to that color. The palate holds 256 colors, where each color is a 2 byte rgb value.

If i set byte 0-319 bytes of vram to the value 20, for instance, this will set the first row of the LCD to the 20th palate color. 320-639, will set the second row, etc.

In 8 bit-per-pixel mode, pixel (x,y) is at memory address VRAM+Y*320+X
  
Register to Join the Conversation
Have your own thoughts to add to this or any other topic? Want to ask a question, offer a suggestion, share your own programs and projects, upload a file to the file archives, get help with calculator and computer programming, or simply chat with like-minded coders and tech and calculator enthusiasts via the site-wide AJAX SAX widget? Registration for a free Cemetech account only takes a minute.

» Go to Registration page
Page 1 of 1
» All times are UTC - 5 Hours
 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum

 

Advertisement