This page contains notes for the game The Magical Quest starring Mickey Mouse.
All hex offsets correspond to US version unless noted.
Debug Functions#
|
|
To do: |
$02/CFC3 AD C9 02 LDA $02C9 [$00:02C9] //P1 controller
$02/CFC6 29 30 AND #$30 //Start + Select
$02/CFC8 C9 30 CMP #$30
$02/CFCA D0 41 BNE $41 [$D00D] //Skip to $D00D if both not pressed
$02/CFCC AD CB 02 LDA $02CB [$00:02CB] //P2 controller
$02/CFCF 29 30 AND #$30 //Start + Select
$02/CFD1 C9 30 CMP #$30
$02/CFD3 D0 38 BNE $38 [$D00D] //Skip to $D00D if both not pressed
$02/CFD5 A9 0A LDA #$0A
$02/CFD7 8D B0 02 STA $02B0 [$00:02B0] //Max 10 health
$02/CFDA 8D B1 02 STA $02B1 [$00:02B1] //Current 10 health
$02/CFDD A9 09 LDA #$09
$02/CFDF 8D 72 03 STA $0372 [$00:0372] //9 lives
$02/CFE2 8D A8 02 STA $02A8 [$00:02A8] //Coins 900 (hundreds digit)
$02/CFE5 8D A9 02 STA $02A9 [$00:02A9] //Coins 90 (tens digit)
$02/CFE8 8D 5D 03 STA $035D [$00:035D] //Time 900 (hundreds digit)
$02/CFEB 8D 5E 03 STA $035E [$00:035E] //Time 90 (tens digit)
$02/CFEE A9 01 LDA #$01
$02/CFF0 8D B5 02 STA $02B5 [$00:02B5] //?
$02/CFF3 8D B6 02 STA $02B6 [$00:02B6] //?
$02/CFF6 EE 79 03 INC $0379 [$00:0379] //?
$02/CFF9 EE 7A 03 INC $037A [$00:037A] //?
$02/CFFC EE 7E 03 INC $037E [$00:037E] //?
$02/CFFF EE 78 03 INC $0378 [$00:0378] //?
$02/D002 EE 7B 03 INC $037B [$00:037B] //?
$02/D005 A9 40 LDA #$40 //Capcom music index
$02/D007 22 FD 97 01 JSL $0197FD[$01:97FD] //Play music
$02/D00B 80 3E BRA $3E [$D04B]
Stage Select Menu#
To load the text it would need to load hardcoded value $0C into the accumulator followed by a jump to subroutine $0199E6. But no pattern matches found in a hex editor for A90C22E69901.
Controller Input Recorder#
Check if controller input recorder is enabled
$01/BBD5 AD 8A 02 LDA $028A [$00:028A]
$01/BBD8 3A DEC A
$01/BBD9 D0 03 BNE $03 [$BBDE] //Skip to $BBDE if $7E028A != $00 (was $01 before DEC)
$01/BBDB 20 62 BC JSR $BC62 [$01:BC62] //Controller input recorder ON
$01/BBDE 20 01 BC JSR $BC01 [$01:BC01]
...
Controller input recorder entry point
$01/BC62 AD 8D 02 LDA $028D [$00:028D] //$00 = Init. log, $01 = Resume log
$01/BC65 0A ASL A
$01/BC66 AA TAX
$01/BC67 7C 6A BC JMP ($BC6A,x)
Pointers
BC6E - Init. log
BC87 - Resume log
Controller input recorder
Init. log
$01/BC6E A2 00 LDX #$00
$01/BC70 8A TXA
$01/BC71 9F 00 00 70 STA $700000,x[$70:0000]
$01/BC75 CA DEX
$01/BC76 D0 F9 BNE $F9 [$BC71] //Loop until $700000-7000FF cleared
$01/BC78 9C 8E 02 STZ $028E [$00:028E] //Current position in log
$01/BC7B 9C 8F 02 STZ $028F [$00:028F]
$01/BC7E 9C C8 02 STZ $02C8 [$00:02C8]
$01/BC81 9C C9 02 STZ $02C9 [$00:02C9] //P1 button press
$01/BC84 EE 8D 02 INC $028D [$00:028D] //Switch to resume log mode
Resume log
$01/BC87 AE 8E 02 LDX $028E [$00:028E] //Current position in log
$01/BC8A AD C9 02 LDA $02C9 [$00:02C9] //P1 button press
$01/BC8D DF 00 00 70 CMP $700000,x[$70:0000] //Compare button press to what's stored at current position in log
$01/BC91 D0 12 BNE $12 [$BCA5] //Skip to $BCA5 if it's a different button press
$01/BC93 A8 TAY //Make a temporary copy of current button press to Y reg
$01/BC94 BF 01 00 70 LDA $700001,x[$70:0001]
$01/BC98 1A INC A //Increment frame counter
$01/BC99 9F 01 00 70 STA $700001,x[$70:0001]
$01/BC9D D0 1C BNE $1C [$BCBB] //Skip to $BCBB if no rollover
$01/BC9F 3A DEC A //Rollover, decrease frame counter back to its original value (frame counter increment will be handled starting at $BCA9 instead)
$01/BCA0 9F 01 00 70 STA $700001,x[$70:0001] //Restores to original value (ie, what it was when $BC94 executed)
$01/BCA4 98 TYA //Restore temporary copy of current button press from Y reg
$01/BCA5 9F 02 00 70 STA $700002,x[$70:0002] //Store the new button press (or same button press that had rollover) to next spot in log...
$01/BCA9 BF 03 00 70 LDA $700003,x[$70:0003]
$01/BCAD 1A INC A //...and increment its frame count
$01/BCAE 9F 03 00 70 STA $700003,x[$70:0003]
$01/BCB2 E8 INX //Increment current position in log (once for the button press byte...)
$01/BCB3 E8 INX //Increment current position in log (...and once for the frame count byte)
$01/BCB4 E0 FE CPX #$FE //RAM full
$01/BCB6 F0 04 BEQ $04 [$BCBC] //Skip to $BCBC if RAM full
$01/BCB8 8E 8E 02 STX $028E [$00:028E] //Store current position in log
$01/BCBB 60 RTS
$01/BCBC 8E 92 02 STX $0292 [$00:0292]
$01/BCBF 20 E4 BB JSR $BBE4 [$01:BBE4] //Read controller registers
$01/BCC2 AD C9 02 LDA $02C9 [$00:02C9] //P1 button press
$01/BCC5 89 04 BIT #$04 //D-pad down
$01/BCC7 F0 F6 BEQ $F6 [$BCBF] //If D-pad down not pressed, enter wait loop until it is
$01/BCC9 9C 8D 02 STZ $028D [$00:028D] //Reset log mode
$01/BCCC 60 RTS