I'm gonna post the final lines of code I've been having issues with below.
Code: Select all
Addr_00F4:
ADD (HL) ; $00f4
INC HL ; $00f5
DEC B ; $00f6
JR NZ, Addr_00F4 ; $00f7
ADD (HL) ; $00f9
JR NZ,$fe ; $00fa ; if $19 + bytes from $0134-$014D don't add to $00
; ... lock up
This really confuses me, as I'm no sure how two positive values added together can result in a 0.
Even if I assigned some values to those memory addresses, the ZERO flag would still not be set, hence it would get stuck in an infinite loop at the last line.
I've debugged and saw that the B register was indeed decrementing fine, and was set to 0 at the last loop, hence it was able to go on to the last `ADD (HL)`
If any of you have any ideas, please let me know! I'm at a total loss.
Here's the link for where I found the disassembled code: http://gbdev.gg8.se/wiki/articles/Gameboy_Bootstrap_ROM