Tests with the "Motion blur" activity of 144p Test Suite show that flickering is an effective way to create intermediate gray levels on the slow LCD of a Game Boy (DMG) or Game Boy pocket (MGB). We can use this for fading or for distinguishing Libbet's skin tone from her clothes.
For each of ten palette entries (four in BGP and three each in OBP0 and OBP1), store a target density from 0 (white) to 6 (black) and a residue from 0 to 63. Also store a single screen-wide fade level from 0 to 32.
Each frame, calculate the 2-bit hardware density for each palette entry with these steps:
Multiply the target density by the fade level, producing a result in 0 to 192. (Can be done with unrolled A=B*C loop.)
Add the residue.
Copy bits 7-6 of the result to the hardware bit density.
Write bits 5-0 back to the residue.
Currently the fade routine uses a scale of 0 to 248. This will first need to be changed to 0 to 32.
Tests with the "Motion blur" activity of 144p Test Suite show that flickering is an effective way to create intermediate gray levels on the slow LCD of a Game Boy (DMG) or Game Boy pocket (MGB). We can use this for fading or for distinguishing Libbet's skin tone from her clothes.
For each of ten palette entries (four in BGP and three each in OBP0 and OBP1), store a target density from 0 (white) to 6 (black) and a residue from 0 to 63. Also store a single screen-wide fade level from 0 to 32.
Each frame, calculate the 2-bit hardware density for each palette entry with these steps:
Currently the fade routine uses a scale of 0 to 248. This will first need to be changed to 0 to 32.