For use only on NTSC Genesis Systems.
Avatar image by CyanSorcery!


Tumblr (inactive)
tumblokami.tumblr.com/
Twitter (inactive)
twitter.com/Techokami

xkeeper
@xkeeper

here's a fun one. this is mighty bomb jack.

a lot of this game's code exhibits a strange quirk; it still works as you'd expect, but something about it is rather unusual ... can you spot it?

transcript
ROM:8420          GameState_5:
ROM:8420 20 89 87     JSR     sub_8789
ROM:8423 AD 40 00     LDA     byte_40
ROM:8426 29 20        AND     #$20
ROM:8428 D0 1F        BNE     locret_8449
ROM:842A 20 45 88     JSR     sub_8845
ROM:842D AD 17 03     LDA     byte_317
ROM:8430 F0 0B        BEQ     loc_843D
ROM:8432 20 74 84     JSR     GameState_7
ROM:8435 AD A8 00     LDA     byte_A8
ROM:8438 09 40        ORA     #$40
ROM:843A 8D A8 00     STA     byte_A8
ROM:843D
ROM:843D          loc_843D:
ROM:843D 20 A9 87     JSR     sub_87A9
ROM:8440 20 0E A4     JSR     sub_A40E
ROM:8443 20 B8 97     JSR     sub_97B8
ROM:8446 20 6A 8B     JSR     sub_8B6A
ROM:8449
ROM:8449          locret_8449:
ROM:8449 60           RTS
hint the opcode bytes are important here. if you only use the disassembly, you won't see it.

answer the code does not use the more efficient opcodes for interacting with the zero page.

for example, "AD 40 00" should be "A5 40".

it saves a byte and a cpu cycle each time. it does add up!

bonus fun facts once you know the answer atlantis no nazo is another game that doesn't use zero-page opcodes (for the most part). super mario bros 2 uses zero-page opcodes most of the time, but absolute ones show up in a few spots.

the assembler i use doesn't (didn't?) support forcing direct addresses for zero-page, so the disassembly has compatibility macros to fix it.


You must log in to comment.