alexsteb / tetris_disassembly

Disassembly of Tetris (Gameboy)
MIT License
39 stars 12 forks source link

Wrong labels in func_6d67 #1

Closed Rodrigodd closed 3 years ago

Rodrigodd commented 3 years ago

I was comparing my disassembly with the disassembly in this repo, and I noticed that the tags l_6d89 and l_6d8b are ahead by 2, probably because of a wrong Program Counter value. This causes multiple wrong sections of code to emerge below that section. I don't check if these are the only labels that are wrong.

https://github.com/alexsteb/tetris_disassembly/blob/21424a16755b83100cb8a259cafc57b09714c93f/main.asm#L22733-L22751

Rodrigodd commented 3 years ago

After work a bit more in my disassembly, I notice that I have decode the relative jumps wrong, so the labels are fine.

What caused the multiple wrong sections of code was the last jr in the section at l_6d8b, because, as far as I know, that cp $03 and jr .l_6da1 are unreachable after the jr .l_6da6 instruction.