CPCWiki forum

General Category => Programming => Topic started by: l12n on 13:57, 05 June 24

Title: Catching when a color is changed in the debugger
Post by: l12n on 13:57, 05 June 24
I'm trying to learn how are CPC games implementing their animation and drawing in the WinApe debugger.

However, for Head over Heels, it sets all the colors to black between screens. Where can I find where that code is? I tried searching for the address which changes the ink color but couldn't find it in the code
Title: Re: Catching when a color is changed in the debugger
Post by: Jean-Marie on 14:27, 05 June 24
First you need to understand how the Gate Array is programmed to select the colors :
 Gate Array - CPCWiki (https://www.cpcwiki.eu/index.php/Gate_Array)
Sometimes a program might use the Firmware rather than programming the Gate Array directly (call &BC32), but that's quite uncommon.
A quick search using WinApe with the term ld bc,#7F00 returns the code setting the colors, at offset 053Ah. The value in HL register is the address of the 4 colors of the room to be drawn.
 
Title: Re: Catching when a color is changed in the debugger
Post by: l12n on 14:40, 05 June 24
Cool, thanks, I'll give it a try 
Powered by SMFPacks Menu Editor Mod