Name: | Lunar Magic's "VRAM Patch" Optimization |
Author: | Kevin |
Added: | |
Tool: | Asar |
Requires Free Space: | Yes |
Bug Fix: | No |
Featured: | Essential |
Description: | Welcome! This is SMW Hacking Land. In this strange land we find that NMI time is missing again! Looks like Fusoya is at it again! Jokes aside, this patch aims at fixing a major issue with Lunar Magic's VRAM patch: using a lot of NMI cycles to modify the stripe image table, which causes blank overflows to be much more likely than vanilla. The issue is fixed by moving said code to outside of NMI, at the end of the game loop. This allows you, for example, to change multiple blocks in a frame without black bars appearing and HDMA gradients breaking, and any kind of resource that uses stripe image in a level or in the title screen (like messages, file select menu, ...) should behave better as well in this sense. Before applying it, make sure to have saved a level in Lunar Magic (with the "Install VRAM patch" option turned on, of course, but you'd probably never turn it off anyway). It's highly recommended that you also have FastROM turned on, as it helps with this problem (and with slowdown in general) as well. Note that the patch uses 8 bytes of free ROM space in bank 0, which are usually not used: if you're using the same space for something else, you can change it with the define in the asm file. NOTE: if you upgrade to Lunar Magic 3.31+, you'll need to repatch this the first time. P.S.: In the first 2 GIFs there's 4 pairs of Mushroom Scales stacked on top of each other, to clearly show the effect. |
Tags: | lorom sa-1 |
Comments: | 18 (jump to comments) |
Download
2.11 KiB | 1,177 downloads
Comments (18)
also works!
You can try this.
• Lunar Magic 3.31
• SA-1 Pack v1.40
• Asar v1.81
• Snes9x v1.60
• bsnes v115
Also used in testing:
• Dynamic Sprites Patch (DSX)
• Dynamic Spriteset System (DSS)
• PIXI v1.32
• Atari2.0 & lx5's PIXI preview build
• UberASMTool v1.4
Very nice! NMI overflows are eliminated/reduced in many situations, and no adverse effects were found, so, accepted. An essential for anyone making use of HDMA, exanimations, dynamic uploads for sprites (DSS benefits greatly from this), or just frequently using tile-changing effects.
Obviously not, you're still limited by the hardware, but you just have more leniency than before. With FastROM (in a clean ROM) the limit seems to be around 10 blocks on the same frame, more than that and you get small flickering. Of course, if you have a lot of exanimations, or other stuff that uses NMI time, the limit will be lower.
The heck, what? Of course, BG1 and BG2 use a different tilemap location but Lunar Magic doesn't adjust the stripe image generation code when changing blocks. Nonetheless, such a large code definitively shouldn't have been in NMI.
It's a magic stick not an atomic bomb.
In a serious note, it greatly decreases the load during the game's NMI while changing blocks and whatever ese uses the stripe image table (possibly everything related to layer 3). It seems to have the same purpose as imamelia's patch but it also has a completely different approach to solve the problem.
Also, reminds me of DMA Queue and Block Change Optimize.