I did as you suggested and inserted the two new routines into a safe area - $E030 and $E037 - just to test them, and the relative jumps at $C028 and $C037, so that the code now looks like this:
C027 CA 30 E0 JP Z,$E030
C02A 3A 11 C2 LD A,($C211)
C02D 3C INC A
C02E C8 RET Z
C02F 21 13 C2 LD HL,$C213
C032 35 DEC (HL)
C033 7E LD A,(HL)
C034 FE 00 CP $00
C036 CA 37 E0 JP Z,$E037
C039 3A 0C C2 LD A,($C20C)
C02D 3C INC A
C02E C8 RET Z
and this:
E030 C0 RET NZ
E031 3E FF LD A,$FF
E033 32 0C C2 LD ($C20C),A
E036 C9 RET
E037 C0 RET NZ
E038 3E FF LD A,$FF
E03A 32 11 C2 LD ($C211),A
E03D C9 RET
A quick test from within AGD shows that the bonuses are now behaving correctly.
However, when the game is exported, the new code is not written - the area where the new routines should be shows nothing instead. I guess the new routines should be added to the end of the finalized game code, which should in turn be saved again including the new code.
Update. Just tried this on my partially developed title, saved as a finalized game. It worked by inserting the new routines after the end of the game code and re-saving it all again :-D
Comments
I did as you suggested and inserted the two new routines into a safe area - $E030 and $E037 - just to test them, and the relative jumps at $C028 and $C037, so that the code now looks like this:
and this:
A quick test from within AGD shows that the bonuses are now behaving correctly.
However, when the game is exported, the new code is not written - the area where the new routines should be shows nothing instead. I guess the new routines should be added to the end of the finalized game code, which should in turn be saved again including the new code.
Thanks a lot, once more!!