Brick Fix patch for Super Mario Collection?

Started by svenge, January 28, 2023, 09:01:48 AM

Previous topic - Next topic

svenge

I tried applying the brick fix patch for Super Mario All-Stars on the ROM of its Japanese counterpart (i.e. Super Mario Collection), but unsurprisingly it didn't work properly.  Is there a way to adapt it for the JP ROM?

KingMike

One would have to figure out what the code change was (such as through hex comparison of the patched and unpatched ROMs, and disassembly) and then find the matching code in Collection and change it.
"My watch says 30 chickens" Google, 2018

shanem

In the ROM "Super Mario Collection (Japan).sfc" go to 0x1BFBE and change $01, $20, $55, $BD to $22, $A0, $FF, $00. Also, 0x6BD83 change $A9, $FE, $85, $A0 to $22, $A0, $FF, $00.


And at 0x7FA0 you'll see a bunch of $FFs. Paste this over it: $A9, $01, $85 $A0, $8D, $00, $16, $6B.


If you are using "Super Mario Collection (Japan) (Rev 1).sfc" then the offsets are  0x1BFC6 and change $01, $20, $55, $BD to $22, $A0, $FF, $00. Also, 0x6BD83 change $A9, $FE, $85, $A0 to $22, $A0, $FF, $00.

And at 0x7FA0 you'll see a bunch of $FFs. Paste this over it: $A9, $01, $85 $A0, $8D, $00, $16, $6B.

SMB2J-2Q

#3
Quote from: shanem on January 30, 2023, 11:39:01 PMIn the ROM "Super Mario Collection (Japan).sfc" go to 0x1BFBE and change $01, $20, $55, $BD to $22, $A0, $FF, $00. Also, 0x6BD83 change $A9, $FE, $85, $A0 to $22, $A0, $FF, $00.


And at 0x7FA0 you'll see a bunch of $FFs. Paste this over it: $A9, $01, $85 $A0, $8D, $00, $16, $6B.


If you are using "Super Mario Collection (Japan) (Rev 1).sfc" then the offsets are  0x1BFC6 and change $01, $20, $55, $BD to $22, $A0, $FF, $00. Also, 0x6BD83 change $A9, $FE, $85, $A0 to $22, $A0, $FF, $00.

And at 0x7FA0 you'll see a bunch of $FFs. Paste this over it: $A9, $01, $85 $A0, $8D, $00, $16, $6B.
Shane,

I too want to do this, but to the US ROM "Super Mario All-Stars (USA).sfc" and the EU ROM "Super Mario All-Stars (Europe).sfc".

In the US ROM, I found the affected byte strings you mention at 0x1B94A for SMB1 and at 0x6BDA4 for SMBLL, and I found the lot of FFs starting at 0x065C4, so if I'm right, at that address, would I replace those first ones with the new bytes you suggest (A9 01 85 A0 8D 00 16 6B)?

UPDATE: ROM locations in the US version are the same as in the Japanese. But, you were one byte off on the address to start the change: it should be at 0x1BFBF to apply the JSL to the first Japanese release, and at 0x1BFC7 for the revised version. Once finished, this is what the fixed instruction should look like:
CODE_03BFB3:
JSR CODE_03BFED         ; $03:BFB3: 20 ED BF
LDA #$FE                ; $03:BFB6: A9 FE
STA $A0                 ; $03:BFB8: 85 A0
LDA #$05                ; $03:BFBA: A9 05
STA $014A               ; $03:BFBC: 8D 4A 01
JSL CODE_00FFA0         ; $03:BFBF: 22 A0 FF 00
BEQ CODE_03BFC9  ; $03:BFC3: F0 03
RTS                     ; $03:BFC5: 60

Thank you,


Ben

erpster2

#4
Quote from: SMB2J-2Q on January 31, 2023, 01:10:17 AMShane,

I too want to do this, but to the US ROM "Super Mario All-Stars (USA).sfc" and the EU ROM "Super Mario All-Stars (Europe).sfc".

In the US ROM, I found the affected byte strings you mention at 0x1B94A for SMB1 and at 0x6BDA4 for SMBLL, and I found the lot of FFs starting at 0x065C4, so if I'm right, at that address, would I replace those first ones with the new bytes you suggest (A9 01 85 A0 8D 00 16 6B)?

UPDATE: ROM locations in the US version are the same as in the Japanese. But, you were one byte off on the address to start the change: it should be at 0x1BFBF to apply the JSL to the first Japanese release, and at 0x1BFC7 for the revised version. Once finished, this is what the fixed instruction should look like:
CODE_03BFB3:
JSR CODE_03BFED        ; $03:BFB3: 20 ED BF
LDA #$FE                ; $03:BFB6: A9 FE
STA $A0                ; $03:BFB8: 85 A0
LDA #$05                ; $03:BFBA: A9 05
STA $014A              ; $03:BFBC: 8D 4A 01
JSL CODE_00FFA0        ; $03:BFBF: 22 A0 FF 00
BEQ CODE_03BFC9  ; $03:BFC3: F0 03
RTS                    ; $03:BFC5: 60

Thank you,


Ben

those addresses you mentioned are assumed for "non-headered" roms or roms without a header.  if they have a header, they could be off by 200h (aka 200 hex)

indeed that there are two versions of Super Mario Collection JP ROMS, v1.0 & v1.1

I also "patched" those JP roms in a hex editor app but non-publicly a few years ago & never got a chance to mention them anywhere

Quote from: svenge on January 28, 2023, 09:01:48 AMI tried applying the brick fix patch for Super Mario All-Stars on the ROM of its Japanese counterpart (i.e. Super Mario Collection), but unsurprisingly it didn't work properly.  Is there a way to adapt it for the JP ROM?

do note that is an old version of the brick fix patch - this is the new version which covers both USA & EUR ROMs

SMB2J-2Q

#5
Could anyone please explain the original faulty logic?

In the original NES version:
BrickShatter:
      jsr CheckTopOfBlock    ;check to see if there's a coin directly above this block
      lda #Sfx_BrickShatter
      sta Block_RepFlag,x    ;set flag for block object to immediately replace metatile
      sta NoiseSoundQueue    ;load brick shatter sound
      jsr SpawnBrickChunks   ;create brick chunk objects
      lda #$fe
      sta Player_Y_Speed     ;set vertical speed for player
      lda #$05
      sta DigitModifier+5    ;set digit modifier to give player 50 points
      jsr AddToScore         ;do sub to update the score
      ldx SprDataOffset_Ctrl ;load control bit and leave
      rts

The SNES version:
CODE_03BFA1:
JSR CODE_03BFC6         ; $03:BFA1: 20 C6 BF
LDA #$01                ; $03:BFA4: A9 01
STA $03EE,x             ; $03:BFA6: 9D EE 03
LDA $1603               ; $03:BFA9: AD 03 16
BNE CODE_03BFB3         ; $03:BFAC: D0 05
LDA #$07                ; $03:BFAE: A9 07

; If there's no SFX playing already
; Shatter bricks sound
STA $1603               ; $03:BFB0: 8D 03 16

CODE_03BFB3:
JSR CODE_03BFED         ; $03:BFB3: 20 ED BF
LDA #$FE                ; $03:BFB6: A9 FE
STA $A0                 ; $03:BFB8: 85 A0
LDA #$05                ; $03:BFBA: A9 05
STA $014A               ; $03:BFBC: 8D 4A 01
JSR CODE_03BD55         ; $03:BFBF: 20 55 BD
LDX $03F0               ; $03:BFC2: AE F0 03
RTS                     ; $03:BFC5: 60

I wonder exactly what is wrong regarding the SNES version?

UPDATE: Problem solved! For the SMB1 portion of the US SMAS ROM, bytes "A9 FE 85 A0" (starting at 0x1BFB6) should be replaced, not "01 20 55 BD" at 0x1BFBD because we have moved the four bytes in question to the new JSL at 0x07FA0. I did this, and the brick shatter and thump sounds are now both restored!

For the European release, the four bytes to change within the SMB1 portion of the ROM start at 0x1C038, while for SMBLL this byte string starts at 0x6BDDA.

~Ben