Terminal control/Inverse video: Difference between revisions

Content added Content deleted
m (→‎{{header|ARM Assembly}}: added Works With)
Line 82: Line 82:


=={{header|ARM Assembly}}==
=={{header|ARM Assembly}}==
{{works with|https://akkit.org/info/gbatek.htm Game Boy Advance}}
This is a slightly different 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 use a monochrome bitmap font, where each bit that's a 1 is an instruction to fill in a pixel and each bit that's a 0 is an instruction to leave it blank. By flipping the bits of the font itself, we can create the "inverse video" effect. The ARM's <code>EOR</code> instruction can't be used to write to memory directly; you would have to load from memory into a register first, apply the <code>EOR</code> operation with the desired value, and write back. Our method of flipping the bits of the font will save time.
This is a slightly different 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 use a monochrome bitmap font, where each bit that's a 1 is an instruction to fill in a pixel and each bit that's a 0 is an instruction to leave it blank. By flipping the bits of the font itself, we can create the "inverse video" effect. The ARM's <code>EOR</code> instruction can't be used to write to memory directly; you would have to load from memory into a register first, apply the <code>EOR</code> operation with the desired value, and write back. Our method of flipping the bits of the font will save time.