Language…
16 users online: Batata Douce, CalHal, crocodileman94, DasFueller,  Deeke, Dzing, fanfan21, Hammerer, isaix, MegacesarCG, RZRider, sheeptitan,  shovda, TheBourgyman, underway, Ziz - Guests: 289 - Bots: 288
Users: 64,795 (2,378 active)
Latest user: mathew

Apparent incompatibility issue with "Overworld speed changer" and "Overworld Counters" patches

The patches being referred to in the title are found here and here.

And here is a video showing the apparent issue (Yellow Switch Palace and Yoshi's House aren't supposed to have icons). It seems to happen all the time when transferring between sub-maps and occasionally when going from level to level on the same sub-map.

Any idea on what is causing this and how to fix it? I've avoided it so far by just not using the Overworld speed changer patch in my hacks, though I'd like to be able to use both.


The issue is that the overworld counter patch only runs once per frame, and relies on the timing of a specific event during Mario's movement between levels; the speed change patch causes Mario's movement to be updated multiple times per frame, which means this particular event can be skipped over before the next frame.

The "best" solution would be to move the counter patch's hijack inside the speed changer's hijack so that it can run its checks each time Mario's position is actually updated. But the counter patch relies on some things that don't make that work very well, so here's an easier solution.

First, open up the speed changer patch (speed.asm) and find the "JSR .runSpeedRoutine" line. Change that to:

Code
	JSR .runSpeedRoutine
	LDA $13D9
	CMP #$05
	BNE +
	INC !DoneFlag
    +


Next, scroll up a bit and find the "ApplySpeed" label. Add a line after it like this:

Code
ApplySpeed:
	STZ !DoneFlag


Finally, near the top of the file, add:

Code
!DoneFlag	=	$13E6	; Change this value to some unused RAM address. This value works so long as other patches don't use it.



Next, open up the counters patch (owcount.asm). Add the same line as above to the top of the file. Then find this code:

Code
	LDA $13D9
	CMP #$05 : BEQ +
	CMP #$08 : BEQ +
	BRA ++

And change that to:

Code
	LDA !DoneFlag : BNE +
	LDA $13D9
	CMP #$05 : BEQ +
	CMP #$08 : BEQ +
	BRA ++


Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer
Originally posted by Thomas
The issue is that the overworld counter patch only runs once per frame, and relies on the timing of a specific event during Mario's movement between levels; the speed change patch causes Mario's movement to be updated multiple times per frame, which means this particular event can be skipped over before the next frame.

I figured it was something like that. When I changed the speed to $FF (basically making it so Mario teleports from level to level instead of walking) it never updated at all rather than just some of the time. Your explanation was very informative, thank you.

I think your fix will probably work. I say "I think" it "will probably work" because half of the time speed.asm crashes the ROM at the overworld. I've gotten it to work sometimes (obviously I had to, to make that video), but I can't seem to get it to work now at all now (even the unmodified one). Judging from the comments on that patch it looks like other people are having the same issue.

Edit: Apparently I have to apply a bunch of other patches first. I don't really get why that's the case but at least it works!