Terminal control/Inverse video: Difference between revisions

Content added Content deleted
Line 84: Line 84:
This is an example of the age-old XOR technique to flip the colors of a monochrome graphic. While the Game Boy Advance uses 16 bits per pixel, we can simply apply the XOR prior to unpacking the text graphics. The bitmap font and print routines created by Keith of [http://www.chibiakumas.com ChibiAkumas].
This is an example of the age-old XOR technique to flip the colors of a monochrome graphic. While the Game Boy Advance uses 16 bits per pixel, we can simply apply the XOR prior to unpacking the text graphics. The bitmap font and print routines created by Keith of [http://www.chibiakumas.com ChibiAkumas].


The Game Boy Advance's video memory is very simple, an two-dimensional array of 16-bit values ranging from memory locations <code>0x06000000</code> to <code>0x06012BFF</code> represents each pixel of the screen. Write a 15-bit hex color value to an element of the array to turn the corresponding pixel to that color value.
The Game Boy Advance's video memory is very simple, a two-dimensional array of 16-bit values ranging from memory locations <code>0x06000000</code> to <code>0x06012BFF</code> represents each pixel of the screen. Write a 15-bit hex color value to an element of the array to turn the corresponding pixel to that color value.


<lang ARM Assembly>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
<lang ARM Assembly>;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;