Forums

Sega Master System / Mark III / Game Gear
SG-1000 / SC-3000 / SF-7000 / OMV
Home - Forums - Games - Scans - Maps - Cheats - Credits
Music - Videos - Development - Hacks - Translations - Homebrew

View topic - Alex Kidd in Miracle World modifications for Switch

Reply to topic
Author Message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13278
  • Location: London
Reply with quote
Alex Kidd in Miracle World modifications for Switch
Post 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.

  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13278
  • Location: London
Reply with quote
Post Posted: Sat Jun 13, 2020 4:11 pm
Un-BIOSing:


00000003: 31 C3
00000004: F0 96
00000005: DF 7D

      di
      im 1
      jp _LABEL_7D96_
      jr _LABEL_85_
to
      di
      im 1
      ld sp, $DFF0
      jr _LABEL_85_


Memory initialisation 1:

0000075A: C0 F3
0000075B: BF 9D


      call _LABEL_9DF3_
to
      call _LABEL_BFC0_

_LABEL_BFC0_:
      ld hl, _RAM_DFF0_
      ld de, _RAM_DFF0_ + 1
      ld bc, $0008
      ld (hl), $00
      ldir
      jp _LABEL_9DF3_


Memory initialisation 2:

00001AF4: B0 5C
00001AF5: BF 26

      call _LABEL_265C_
to
      call _LABEL_BFB0_

_LABEL_BFB0_:
      ld hl, _RAM_DFF0_
      ld de, _RAM_DFF0_ + 1
      ld bc, $0008
      ld (hl), $00
      ldir
      jp _LABEL_265C_


SFX hook 1:

      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
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13278
  • Location: London
Reply with quote
Post Posted: Sat Jun 13, 2020 4:26 pm
The V0 patch also adds some data at $1ffc0, but it doesn't seem to be referenced.
  View user's profile Send private message Visit poster's website
  • Joined: 14 Apr 2013
  • Posts: 526
Reply with quote
Post Posted: Sat Jun 13, 2020 5:43 pm
Maxim wrote
- 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.

Can you also provide the patches as ips patches?
  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13278
  • Location: London
Reply with quote
Post Posted: Sat Jun 13, 2020 6:18 pm
Updated the first post's attachment to add IPS versions of the patches.

The level data patch is in here:

; 1st entry of Pointer Table from 1AF5D (indexed by unknown)   
; Data from 1B1BD to 1B208 (76 bytes)   
_DATA_1B1BD_:   
   .db $81 $4D $0D $00 $02 $50 $81 $4D $0D $00 $02 $50 $84 $4D $00 $0B
   .db $0C $0A $00 $02 $50 $81 $4D $0E $00 $82 $50 $4D $0E $00 $82 $50
   .db $4D $0E $00 $82 $50 $4D $0E $00 $82 $5B $4D $0D $00 $83 $5B $00
   .db $4D $0C $00 $84 $5B $00 $00 $4D $0B $00 $81 $5B $03 $00 $81 $4D
   .db $0A $00 $81 $5B $04 $00 $0A $50 $06 $5A $00 $00
  View user's profile Send private message Visit poster's website
  • Joined: 14 Apr 2013
  • Posts: 526
Reply with quote
Post Posted: Sat Jun 13, 2020 6:34 pm
Maxim wrote
Updated the first post's attachment to add IPS versions of the patches.

The level data patch is in here:

; 1st entry of Pointer Table from 1AF5D (indexed by unknown)   
; Data from 1B1BD to 1B208 (76 bytes)   
_DATA_1B1BD_:   
   .db $81 $4D $0D $00 $02 $50 $81 $4D $0D $00 $02 $50 $84 $4D $00 $0B
   .db $0C $0A $00 $02 $50 $81 $4D $0E $00 $82 $50 $4D $0E $00 $82 $50
   .db $4D $0E $00 $82 $50 $4D $0E $00 $82 $5B $4D $0D $00 $83 $5B $00
   .db $4D $0C $00 $84 $5B $00 $00 $4D $0B $00 $81 $5B $03 $00 $81 $4D
   .db $0A $00 $81 $5B $04 $00 $0A $50 $06 $5A $00 $00

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:


ages.png (43.08 KB)
Ages patched screen
ages.png
original.png (51.1 KB)
Original unpatched screen
original.png

  View user's profile Send private message Visit poster's website
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13278
  • Location: London
Reply with quote
Post Posted: Sat Jun 13, 2020 7:30 pm
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.
  View user's profile Send private message Visit poster's website
  • Joined: 06 Aug 2015
  • Posts: 12
  • Location: Brasília
Reply with quote
Post Posted: Sun Jun 14, 2020 1:15 pm
Maxim wrote
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?
  View user's profile Send private message
  • Site Admin
  • Joined: 19 Oct 1999
  • Posts: 13278
  • Location: London
Reply with quote
Post Posted: Sun Jun 14, 2020 1:24 pm
Only by rearranging it from scratch.
  View user's profile Send private message Visit poster's website
  • Joined: 25 Nov 2015
  • Posts: 86
Reply with quote
Post Posted: Sun Jun 14, 2020 5:21 pm
FANTASTIC discoveries ! Thank you !!!
  View user's profile Send private message
Reply to topic



Back to the top of this page

Back to SMS Power!