Banner
Views: 772,973,553
Time:
14 users online: Aeon, caiqueleo, dacin,  Giftshaven, GreenHammerBro, h.carrell, Isikoro, kamekku14, placeholdertest, Ragey, shadowboyultra, shidouri, simon.caio,  Super Maks 64 - Guests: 49 - Bots: 165Users: 40,595 (1,828 active)
Latest: Deluxe Team
Tip: You can use the SMW Customizer to edit tons of misc. features in SMW, including the speed of Bullet Bills, how many points a 3-UP moon gives you, and more!Not logged in.
H:None BG Scroll Reset Patch by Tattletale, edit1754
Forum Index - Valley of Bowser - Moderation Questions - Patches - H:None BG Scroll Reset Patch by Tattletale, edit1754
Pages: « 1 »
File Name: H:None BG Scroll Reset Patch
Submitted: by Tattletale
Obsoletes: H:None BG Scroll Reset Patch
Authors: Tattletale, edit1754
Tool: Asar
Requires Free Space: Yes
Bug Fix: Yes
Featured: No
Description: fixes the glitch in which the BG's X-position isn't reset when the player exits from a level with H:Variable into a level with H:None

v1.1:
----------------
Fixed a bug where this patch wouldn't consider the fact that AXY were in 16bit mode.
Converted to asar format.
Screenshots:
This is a very good catch and while the conversion to Asar and the bug fix are very appreciated, I think it could have been pulled off better from an optimization standpoint. Instead of taking advantage of the 16-bit mode around the hijack, you've just added to the patch code to make it work, which results in rather bloated code.

Analyzing the code, we see that the patch places a subroutine jump at $0580CD. The patch code enters 16-bit mode and returns to $0580D1, which immediately enters 8-bit mode - if you look at the surrounding code, you'll see that 16-bit mode is only used to decrement to $47 and $4B. This is not the only waste; you could easily leverage the 16-bit accumulator in the patch code to zero out $1E and $1466 in two instructions instead of four, which would save both time and space. Of course, you need to do an 8-bit load beforehand, but you can use the X register for that instead (it's overwritten at $0580DD, so you don't have to worry about clobbering it).

To sum up, you can change the REP at $0580CB so it only sets A to 16-bit, then change the JSL hijack to a JML hijack, which would allow you to return directly to $0580D3. In the patch code, you should keep in mind that the size of X/Y isn't guaranteed because of the preceding subroutine calls, so you should account for that either by forcing X/Y to be 8-bit or by analyzing the subroutines and checking if they return with 8-bit X/Y. You can probably think of different functionally equivalent combinations; feel free to experiment and see which one is the cleanest.
Pages: « 1 »
Forum Index - Valley of Bowser - Moderation Questions - Patches - H:None BG Scroll Reset Patch by Tattletale, edit1754

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2019 - SMW Central
Legal Information - Privacy Policy - Link To Us


Total queries: 9

Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • ROMhacking.net
  • MFGG
  • Gaming Reinvented