Jump to content

Terminal control/Inverse video: Difference between revisions

m
Line 82:
 
=={{header|ARM Assembly}}==
This is ana exampleslightly ofdifferent take on the age-old XOR technique to flip the colors of a monochrome graphic. While the Game Boy Advance uses 16 bits per pixel, we'll canuse simplya applymonochrome thebitmap XORfont, priorwhere each bit that's a 1 is an instruction to unpackingfill in a pixel and each bit that's a 0 is an instruction to leave it blank. By flipping the textbits of the font itself, we can create the "inverse video" graphicseffect. The bitmapARM's font<code>EOR</code> andinstruction printcan't routinesbe createdused byto Keithwrite ofto [http:/memory directly; you would have to load from memory into a register first, apply the <code>EOR</wwwcode> operation with the desired value, and write back.chibiakumas.com ChibiAkumas]Our method of flipping the bits of the font will save time.
 
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.
1,489

edits

Cookies help us deliver our services. By using our services, you agree to our use of cookies.