Banner
Views: 838,069,599
Time:
16 users online: ageVerrly, AnasMario130, blaze800000, Carter, Gary, Hayashi Neru, JonnyManjiro, LOLRyan2006 the Goombud, Lotica, Louizz, Lumy, RetroJunky.T, SheePSeff, Super Maks 64, Synergic, Zenomalous - Guests: 59 - Bots: 62 Users: 45,839 (3,403 active)
Latest: hernique
Summer C3 2020 Content Spotlight
E-man38's Graphics Showcase!
Not logged in.
Details for Yoshi Swallow Timer Fix
SMW Patches - Yoshi Swallow Timer Fix Show random
File Name: Yoshi Swallow Timer Fix
Added:
Authors: HammerBrother
Tool: Asar
Requires Free Space: Yes
Bug Fix: Yes
Featured: No
Description: Like the star fix patch, Nintendo made a similar mistake with the yoshi swallow timer: if the freezable frame counter ($7E0014) is divisible by 4 (that MOD 4 = 0), AND the lock flag ($7E009D) is set, will cause the timer to decrement every frame rather than every 4th and freezing with it.

In the image below, the hex value in the heads-up display's item box represents the frame counter, and next to the coin is the yoshi swallow timer. Since #$2C is divisible by 4 (4*11 = 44 or 44/4 = 11, R = 0), the swallow timer decrements each frame.
Tags: lorom, needs remoderation, sa-1, timer, yoshi, yoshi swallow
Download: Download - 983 bytes
191 downloads
Screenshots
Image
HammerBrother
You mean this:
Code
if read1($00FFD5) == $23
	sa1rom
	!SA1 = 1
	!Base1 = $3000		;>$0000-$00FF -> $3000-$30FF
	!Base2 = $6000		;>$0100-$0FFF -> $6100-$6FFF and $1000-$1FFF -> $7000-$7FFF
else
	lorom
	!SA1 = 0
	!Base1 = $0000
	!Base2 = $0000
endif
Posted by: HammerBrother - | Link
JackTheSpades
Well, the patch works, so there's that.
However, in the patch this line is complettely unneccessary.

Code
	LDA $18AC+!Base2	;>Load the "before decrement" into A


Why? Because you use DEC on the same address afterwards which changes the zero flag in the processor register, which is later checked with BNE.
You then use JML to return to two possible codes, one being $01F1B2 which runs into an LDA #$00 before ever making use of A and the other ($01F1C6) begins with an LDA $18AC itself.

I didn't test to see if, for some magic that only the coding gods know reason, the code doesn't work if you remove the LDA, but, if you ever submit an update, check the possibility.
NOTE!!! I'm not saying you have to submit an update. IF you make an update.

Also, on another side note, I see this in all your patches with sa-1 support (which are literally ALL your patches (which is good btw)), that you use an if to check if the ROM is sa-1, then set a define, and then later use an if to check the define. You can just throw it all in one. It has no actual impact on the assembled code size, but it makes the ASM file a little shorter :>

Code
if read1($00FFD5) == $23
	sa1rom
	!Base1 = $3000		;>$0000-$00FF -> $3000-$30FF
	!Base2 = $6000		;>$0100-$0FFF -> $6100-$6FFF and $1000-$1FFF -> $7000-$7FFF
else
	lorom
	!Base1 = $0000
	!Base2 = $0000
endif
Posted by: JackTheSpades - | Link

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

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


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy