Alex Kidd in Miracle World modifications for Switch
Posted: Sat Jun 13, 2020 4:05 pm Last edited by Maxim on Sat Jun 13, 2020 6:18 pm; edited 3 times in total
Attached files convert original ROMs to the Switch modified versions. They apply to the V0, Japanese and BIOS ROMs.
Some observations based on the BIOS version (as that had the largest diff):
- The major change is to a chunk at $1b1d4. The wiki tells me it's level data and Emulicious tells me it's the first entry in a lookup table, but I didn't figure out the effect yet.
- There are hooks using unused ROM at $bfb0-$bfff, each aligned to a 16B boundary. These seem to be manually placed, not using an assembler to auto-locate things.
- These do some RAM initialisation in the otherwise-unused $dff0-7 region, and then manipulate data in that region based on in-game events:
- $dff0 (byte) counts how many times sound effect $95 (octopus killed?) is played
- $dff1 (byte) seems to be a copy of $c048, i.e. $ff when you have the Telepathy Ball
- $dff2-3 (word) counts how many times sound effect $8c (block break) is played
I guess these inform some stats in the emulator.
- It also un-BIOSes the game quite nicely by restoring bytes 3-5.
ld a, $95 ; SFX
ld (_RAM_C110_), a
to
ld a, $95
call _LABEL_BFD0_
_LABEL_BFD0_:
ld (_RAM_C110_), a ; Sound Control Variable
ld a, (_RAM_DFF0_)
inc a
ld (_RAM_DFF0_), a
ret
SFX hook 2:
00005BCD: CD 32
00005BCE: F0 10
00005BCF: BF C1
ld a, $8c ; SFX
ld (_RAM_C110_), a
to
ld a, $8c
call _LABEL_BFF0_
_LABEL_BFF0_:
ld (_RAM_C110_), a ; Sound Control Variable
ld hl, (_RAM_DFF2_)
inc hl
ld (_RAM_DFF2_), hl
ret
Telepathy Ball hook:
000072B6: CD 21
000072B7: E0 A6
000072B8: BF C2
ld hl, $C2A6
to
jp _LABEL_BFE0_
_LABEL_BFE0_:
; Set a flag in _RAM_DFF1_ when _RAM_C048_ is non-zero
ld hl, $C2A6
ld a, (_RAM_C048_) ; Telepathy Ball owned
and a
ret z
ld a, $FF
ld (_RAM_DFF1_), a
ret
- The major change is to a chunk at $1b1d4. The wiki tells me it's level data and Emulicious tells me it's the first entry in a lookup table, but I didn't figure out the effect yet.
I just compared the original v0, v1 and bios. In all three versions there is level data at $1b1d4. More specifically it's somewhere around the middle of the level layout of the starting screen of Janken's Castle.
Where is the lookup table located?
Maxim wrote
- $dff0 (byte) counts how many times sound effect $95 (octopus killed?) is played
It's the sound effect that is played for every kill of a boss. I.e. also for defeating the ox, the grizzly and for Janken his henchmen.
Maxim wrote
- $dff1 (byte) seems to be a copy of $c048, i.e. $ff when you have the Telepathy Ball
Not exactly a copy of it. When the telepathy ball is collected, only bit 0 of $c048 is set. So its values are 0 or 1 while their code maps 1 to $ff. But interpreting it as boolean it's equivalent anyways.
Maxim wrote
- $dff2-3 (word) counts how many times sound effect $8c (block break) is played
Indeed that's the sound effect for breaking blocks.
Yes, that's the level layout data of the starting screen of Janken's castle. They fix the bug in the layout there, i.e., they put a solid metatile in the bottom left corner. (And removed a cloud)
I have attached screenshots for comparison.
The bug is abused in this video to skip to the Janken match against Janken:
It seems that the notable changes to the game - FM-ish soundtrack and graphics on the level map screen - are inserted by the emulator, not added to the game.
I guess the cloud was removed to allow the modified data to fit in the space.
It seems that the notable changes to the game - FM-ish soundtrack and graphics on the level map screen - are inserted by the emulator, not added to the game.
I guess the cloud was removed to allow the modified data to fit in the space.
no chance to turn it into FM sound and put it in the rom?