Skip to content

Commit

Permalink
Fixed compatibility with Remove Status Bar patch
Browse files Browse the repository at this point in the history
  • Loading branch information
RPGHacker committed Feb 18, 2024
1 parent 7f4411d commit 585cf44
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 2 deletions.
8 changes: 7 additions & 1 deletion docs/vwf/manual/index.xhtml
Original file line number Diff line number Diff line change
Expand Up @@ -2606,6 +2606,12 @@ endif</code></pre>
</div>
This happens because the SMB3 Status Bar patch uses an HDMA effect to modify the layer 3 scroll offsets on certain scanlines, which stays active even while a dialogue is open. To eliminate this issue, change the <code>!vwf_enable_smb3_status_bar_layer_3_hdma_fix_hack</code> setting in <code>vwfconfig.cfg</code> to <code>true</code>. Alternatively, changing the <code>!vwf_main_dma_channel_sa1</code> setting to <code>0</code> will also eliminate the issue, since VWF Dialogues now use the same channel for their DMA transfers as the SMB3 Status Bar patch uses for its HDMA effect. However, this might cause some (currently unknown) side effects, so it's recommended to use the <code>!vwf_enable_smb3_status_bar_layer_3_hdma_fix_hack</code> solution instead.
</dd>
<li class="font-weight-bold">Remove Status Bar</li>
<dd>
VWF Dialogues and Remove Status Bar share a hijack at location <code>$008275</code>. If you patch VWF Dialogues before Remove Status Bar, text boxes will glitch up the screen as demonstrated here:
<img class="d-block m-1 my-2" src="screenshots/status-bar-compat-4.png" alt="Screenshot" width="256" height="224" />
In order to make VWF Dialogues work, the patch needs to be applied after Remove Status Bar. This alone seems to already produce the intended behavior, however, certain code in the Remove Status Bar patch will never be called in this case. To work around this issue, you can change the <code>!vwf_enable_remove_status_bar_compatibility_fix_hack</code> setting in <code>vwfconfig.cfg</code> to <code>true</code>, which will make the VWF Dialogues patch execute Remove Status Bar's missing code.
</dd>
</ul>
The following patches have a few compatibility quirks which can be easily worked around:
<ul>
Expand Down Expand Up @@ -2701,7 +2707,7 @@ endif</code></pre>
<li>Added the <a href="#helper-functions-rgb_15_from_24"><code>rgb_15_from_24()</code></a> and <a href="#helper-functions-rgb_15_from_f"><code>rgb_15_from_f()</code></a> helper functions.</li>
<li>Implemented <a href="#header-settings-shared-headers">shared headers</a>, which provide a means of reusing message headers, reducing the size of a message in the process.</li>
<li>Added a version of <code>vwfsharedroutines.asm</code> that's compatible with Asar 1.81 and can be used with NPCs v4.3.</li>
<li>Improved compatibility with several status bar replacement patches. <b>Super Status Bar</b> and <b>Sprite Status Bar</b> are confirmed to work out of the box. <b>DKCR Styled Sprite Status Bar</b> also works out of the box and no longer requires its VWF Dialogues compatibility mode to be enabled. <b>SMB3 Status Bar</b> and <b>Minimalist Status Bars</b> both work out of the box, but produce some graphical glitches that can be eliminated by tweaking certain settings in <code>vwfconfig.cfg</code>. See section <a href="#problem-solving-compatibility">Compatibility With Other Patches</a> for further information.</li>
<li>Improved compatibility with several status bar replacement patches. <b>Super Status Bar</b> and <b>Sprite Status Bar</b> are confirmed to work out of the box. <b>DKCR Styled Sprite Status Bar</b> also works out of the box and no longer requires its VWF Dialogues compatibility mode to be enabled. <b>SMB3 Status Bar</b> and <b>Minimalist Status Bars</b> both work out of the box, but produce some graphical glitches that can be eliminated by tweaking certain settings in <code>vwfconfig.cfg</code>. <b>Remove Status Bar</b> requires a compatibility setting and needs to be patched before VWF Dialogues. See section <a href="#problem-solving-compatibility">Compatibility With Other Patches</a> for further information.</li>
</ul>
</p></dd>

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions patches/vwf_dialogues/data/smw/data/vwfconfig.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,11 @@
; is open.
!vwf_enable_smb3_status_bar_layer_3_hdma_fix_hack ?= false

; Change this setting to true when using the Remove Status Bar patch. Make sure to patch VWF Dialogues
; AFTER Remove Status Bar. Never change this setting to true when not using the Remove Status Bar patch,
; as it will almost certainly crash your ROM.
!vwf_enable_remove_status_bar_compatibility_fix_hack ?= false

; DMA channel to use for DMA transfers in the patch (0 to 7).
; You only really need need to change these if you're getting conflicts with HDMA effects
; in other patches.
Expand Down
2 changes: 1 addition & 1 deletion patches/vwf_dialogues/patch_config.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def main() -> None:
patch_config.actions.append(patching_utility.InsertCustomPalette(os.path.join(os.path.dirname(__file__), 'testing/compatibility/dkcr_sprite_status_bar/paletteF.pal'), 105))
patch_config.actions.append(patching_utility.InsertCustomPalette(os.path.join(os.path.dirname(__file__), 'testing/compatibility/dkcr_sprite_status_bar/paletteF.pal'), 106))
elif compatibility_test == 'nuke':
patch_config.actions.append(patching_utility.Patch(os.path.join(os.path.dirname(__file__), 'testing/compatibility/nuke_statusbar/nuke_statusbar.asm')))
patch_config.actions.insert(0, patching_utility.Patch(os.path.join(os.path.dirname(__file__), 'testing/compatibility/nuke_statusbar/nuke_statusbar.asm')))

patcher.create_rom(patch_config, options)

Expand Down
4 changes: 4 additions & 0 deletions patches/vwf_dialogues/vwf_dialogues.asm
Original file line number Diff line number Diff line change
Expand Up @@ -797,7 +797,11 @@ NMIHijack:
tax
lda.l .NMITable,x
bne .SpecialNMI ; If NMITable = $00 load regular NMI
if !vwf_enable_remove_status_bar_compatibility_fix_hack != false
jml remap_rom($008C81)
else
jml remap_rom($008292)
endif

.SpecialNMI
cmp.b #$02
Expand Down

0 comments on commit 585cf44

Please sign in to comment.