Banner
Views: 992,710,419
Time:
20 users online: AsiagoPizza,  BeeKaay, Bluremii, BrandonBlank, Caracc, CosmicTiff, dacin, Dispace, Ezosky22, Francium, Gamet2004, George, GiraffeKiller, Golden Yoshi, Infinity, Nameless, NBKevin98, Rudi_Schrausch, scratch, SilentSnake20 - Guests: 64 - Bots: 111 Users: 54,448 (2,088 active)
Latest: Qamic59
Tip: $5.27
Not logged in.
Details for Lunar Magic's "VRAM Patch" Optimization
SMW Patches - Lunar Magic's "VRAM Patch" Optimization Link - Show random
File Name: Lunar Magic's "VRAM Patch" Optimization
Added:
Authors: Kevin
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
Download: Download - 2.11 KiB
331 downloads
Screenshots
Previous 
 Next
Francium
Originally posted by AppleBoy54321
Can I please use the gradient from the Last Two images?

You can try this.
Posted by: Francium - | Link
JamesD28
Tested with:

• 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.
Posted by:  JamesD28 - | Link
AppleBoy54321
Can I please use the gradient from the Last Two images?
Posted by: AppleBoy54321 - | Link
Moltz
So that's why the upper screen flickers with some hacks... fascinating.
Posted by: Moltz - | Link
Kevin
Originally posted by simon.caio
I think that this patch substitute the pixelation effect with a plain fade in/out? Is that intentional and part of the patch?
It doesn't happen on my end. It's definitely not caused by this patch.
Posted by:  Kevin - | Link
Kevin
Originally posted by Anas
Excellent patch! I tested it so far and found no bugs at all. I even checked the OW event fade effect and castle destruction cutscenes just in case. Additionally, it works well with the mushroom scale fix patch.
Nice, although the Overworld isn't affected (Lunar Magic's modifications only acts in levels and on the title screen) so no need to test in those cases.
Posted by:  Kevin - | Link
Anas
Excellent patch! I tested it so far and found no bugs at all. I even checked the OW event fade effect and castle destruction cutscenes just in case. Additionally, it works well with the mushroom scale fix patch.
Posted by: Anas - | Link
Kevin
Originally posted by HammerBrother
Does this mean I can change an unlimited number of blocks onscreen (COMPLETELY removing the limit), or is it that the maximum number of blocks without black bars possibly appearing is increased?

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.
Posted by:  Kevin - | Link
MarioFanGamer
Quote
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.

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.
Posted by:  MarioFanGamer - | Link
lx5
Quote
Does this mean I can change an unlimited number of blocks onscreen (COMPLETELY removing the limit), or is it that the maximum number of blocks without black bars possibly appearing is increased?

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.
Posted by: lx5 - | Link
HammerBrother
Does this mean I can change an unlimited number of blocks onscreen (COMPLETELY removing the limit), or is it that the maximum number of blocks without black bars possibly appearing is increased?

Also, reminds me of DMA Queue and Block Change Optimize.
Posted by: HammerBrother - | Link
Heraga
This is going to revolutionize SMW Hacking, hope this gets integrated into LM proper in the next release!
Posted by:  Heraga - | Link
Kevin
I've updated the file with a new freespace address since I didn't realize the previous one is used for the FastROM patch. If you downloaded it before redownload it or change !freespace_bank0 to $00BA56 (if using FastROM, otherwise it doesn't matter).
Posted by:  Kevin - | Link
lx5
chad
Posted by: lx5 - | Link

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

Copyright © 2005 - 2022 - 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
  • sm64romhacks