Language…
14 users online: Batata Douce, BlueSheep123, CalHal, crocodileman94, Ekimnoid, Enderdavid_HD,  Fernap, GiraffeKiller, Housemeister, playagmes169, ppp9q, Rhubarb44230, sugarfish456, WalrusLife - Guests: 252 - Bots: 263
Users: 64,795 (2,376 active)
Latest user: mathew

Optimize 1F0

SMW Patches → Optimize 1F0

Submission Details

Name: Optimize 1F0
Author: Fernap
Added:
Tool: Asar
Requires Free Space: Yes
Bug Fix: No
Featured: No
Description: This patch optimizes SMW's handling of interaction of sprites with 1F0 (in fact, all of 1D8-1FF) tiles, mitigating the chance for slowdown. This patch should be SA-1 compatible, but you're much less likely to really need to worry about it in that case.

The screenshots below are in a stock lorom without fastrom enabled, along with the CPU meter patch for a visual indication. The star on the left shows approximately how far into the frame the SNES has gotten to before SMW has finished processing for that frame.

The first shot is a baseline before any sprites have landed. The second shot is without the optimize patch (the star on the left has wrapped back to the top of the screen, indicating a significant amount of slowdown). The last shot is with this patch applied. There's no slowdown nominally, but spikes can occur when the screen is scrolling, and other factors may introduce some (like the No More Sprite Tile Limits patch, layer 2, sprite buoyancy, etc.).
Tags: lorom optimize sa-1 slowdown
Comments: 7 (jump to comments)
Download 690 bytes | 222 downloads

Screenshots

View all

Comments (7)

Burning Loaf Link
Tested with:
* SA-1 Pack 1.40
* Asar 1.81
* Lunar Magic 3.33
* Mesen-S 0.4.0
 Fernap Author Link
Originally posted by TheKazooBloccGosh
Huh, I just found a different behavior:
I'm using this asm for a block:

[...]

makes that it teleports to the top of that block and then acts as 1F0. With the patch, the teleport behavior doesn't work anymore... (it still act as 1F0)
Could you please fix it?


Can you get me the full block (feel free to stash it in your filebin temporarily or DM me on discord if you want) and describe the setup with the sprite? Which sprite is it and how does it touch the block to get inside of it? Thanks.
TheKazooBloccGosh Link
Here is the zip file containing the asm block, the test levels: without and with the 1F0 patch to compare.
spooonsss Link
The "without patch" version is the buggy one, actually. The custom block code is only being run once, then it is skipped and the block acts as $130 (as specified in map16 editor). This makes the sprite bounce up.

Technical description of the problem
TheKazooBloccGosh Link
Huh, I just found a different behavior:
I'm using this asm for a block:

Code
; Map16: #$130 ; Very important! [1]

LDA #$F0	; \ Make this block act like block #$01F0.
STA $1693|!addr	; |
LDY #$01	; /


When a sprite on 1F0 goes inside that block, the map16 setting [1]
makes that it teleports to the top of that block and then acts as 1F0. With the patch, the teleport behavior doesn't work anymore... (it still act as 1F0)
Could you please fix it?
HammerBrother Link
I noticed this with the ground grinder (not the line-guided one) with these tiles.
anonymousbl00dlust Link
I am so glad this is finally fixed, thank you for this important contribution