Sorry for the bump, but I figured out how to fix this incompatibility between the VWF Dialogues patch and the SMB3 Status Bar patch. I've already PM'ed DPBOX about this, but I'm posting this here so anyone else who has this issue will know how to fix it.
Here is what needs to be done:
- Comment out the hijack I mentioned in my previous post in this thread. You don't necessarily have to do it, but you won't be forced to reapply VWFdialogues.asm each time you apply SMB3_status.asm.
- Go into vwfdialogues.asm, scroll down to VBlank, then comment out the lines shown here:
Code.End
plp ; Return
plb
pla
ply
plx
;lda !vwfmode ; Skip Status Bar in dialogues
;bne .SkipStatusBar
;lda $0D9B
;lsr
;bcs .SkipStatusBar
;phk ; Display Status Bar
;per $0006
;pea $84CE
;jml $008DAC|$800000
.SkipStatusBar
jml $0081F7|$800000
This was causing the crash because $008DAC is called in the routine at $05BE8A instead of where it's normally called in SMW. This routine has a bank wrapper at the start of it, which meant that the new routine at $008DAC needed to put a PLB before returning. Because the VWF dialogues code was built with the original status bar in mind, which didn't have a bank wrapper, this PLB messes up the stack, causing the CPU to jump somewhere where it will crash.
- Go into VWFdialogues.asm, then scroll down to this routine:
CodeNMIHijack:
phx
lda !vwfmode
tax
lda.l .NMITable,x
bne .SpecialNMI ; If NMITable = $00 load regular NMI
sty $4209
stz $420A
stz $11
lda #$A1
sta $4200
stz $2111
stz $2111
stz $2112
stz $2112
plx
jml $0082A4
;bra .End
Add the plx and the jml $0082A4 here. Normally, this routine JMLs to $0082B0 at the end, but that's an issue with the SMB3 Status Bar because that patch inserts a hijack at $0082A4. This fix allows PreStatusBar in SMB3_Status.asm to run like it's supposed to, but only when a VWF message isn't running.
- Go into PostStatusBar in SMB3_status.asm and add these 4 lines between the BNE - and the PHD:
CodePostStatusBar:
BNE -
LDA $702000 ; Set this to whatever !varram is set to in vwfdialogues.asm
BEQ +
JML $0083B2
+
PHD
This prevents the status bar tilemap from being updated while a VWF message is displaying. Otherwise, the VWF won't display correctly.
- If you've applied levelheight.asm, you'll need to go into levelheight.asm and change the value in !offset to $10. When the VWF message displays, the status bar will disappear temporarily, which means that you'll see a row of blank tiles if the camera is at its lowest point unless you change the value in !offset to something lower than the defualt $20.
And that's about it. Everything should be working fine:
However, if you're using ZSNES, Mario's graphics are glitched a little bit while the status bar is visible, and I don't know why. However, this doesn't happen in SNES9x, BSNES, or on a real SNES (tested with an SD2SNES flashcart), so fixing that isn't a priority unless you really care about keping your hack compatible with ZSNES.
--------------------
My Hacks:
Mario's Strange Quest V1.6
Yoshi's Inside Story (on hold)
Yoshi's Strange Quest V1.3 /
V1.3.1 Beta 4.6 /
Latest Test Build (Mario & Yoshi's Strange Quests)
Other stuff:
My SMW/SMAS/SMAS+W disassembly
Yoshifanatic's Discord Server: A place for fans of my stuff and/or Yoshi to chat with others.
Follow Us On