11 March 2016 - Forum Rules

Main Menu

Advanced SNES ROM Utility

Started by Dom, August 27, 2021, 12:26:47 PM

Previous topic - Next topic


I know I've seen *.xdelta patches for snes games, and I vaguely remember something called a *.bdiff (binary diff?), but I could be mistaken. Do we have tools to apply those patch formats? If we don't, is implementing them prohibitively complex (and of course do you want to make the effort)?


Quote from: Brutapode89 on October 04, 2021, 06:38:48 PM
O.K., Dom. Will not be there glitches if the ROM Final Fantasy IV - Easy Type (J) is into 8,00 Mo?
Especially expanding LoROM + SlowROM with an origin size of more than 16 Mbit to ExLoROM (48 Mbit or more) is causing some troubles at the moment. Final Fantasy IV - Easy Type (J) is only 8 Mbit, so there might be a good chance for it to work without any glitches. Just try it out and do some testing. Would be nice, if you could share your results. I tried and the only method working is expanding with mirroring. Do you really need more than 32 Mbit for your translation? If so, I would take a closer look at it this weekend  8)

Quote from: MysticLord on October 04, 2021, 08:42:08 PM
I know I've seen *.xdelta patches for snes games, and I vaguely remember something called a *.bdiff (binary diff?), but I could be mistaken. Do we have tools to apply those patch formats? If we don't, is implementing them prohibitively complex (and of course do you want to make the effort)?
You're right! I also remember these kind of patches, but I guess they're very rare.

In my tool set, I found a tool called Delta Patcher by SadNES cITy Translations for *.xdelta.
But it seems I've never ran into *.bdiff, though there's a tool called BsPatch.

I managed to get *.bdiff working, but it doesn't seem to have any validation like BPS or UPS. So you easily can mess up your ROM, if you apply the same patch for a second, third or whatever time.

Xdelta is also known as VCDIFF and is a little more complex. But there seems to be a good chance for it, since this is available over NuGet package store  :)

October 08, 2021, 01:49:25 PM - (Auto Merged - Double Posts are not allowed before 7 days.)

New version submitted!

XDELTA and BDF patches are supported now.

@Brutapode89: You now can try to expand your ROM, should work  ;)


Hi, I tried using this utility to inspect a ROM I assembled from scratch with WLA to see how badly I had screwed up the metadata, but got this error:

QuoteROMs cannot be smaller than 128kByte (1Mbit) or larger than 16 MByte (128 Mbit).

bsnes and Mesen-SX loaded this rom fine, and snes9x loaded it and said it had a bad checksum and was corrupt.  Is there any reason this tool can't attempt to import tiny ROMs anyway just so I can see what mistakes I made?  If it could tell me which metadata fields were corrupt and which weren't (or which was the first byte of the ROM that was corrupt) that would be super useful.


When I commented out the if condition at SNESROM.cs:70, I was able to import my ROM and see the fields (several of them being "Unknown") but when I clicked "Expand ROM" the tool crashed:

  Message=Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.
   at System.Buffer.BlockCopy(Array src, Int32 srcOffset, Array dst, Int32 dstOffset, Int32 count)
   at Advanced_SNES_ROM_Utility.Form1.ButtonExpandROM_Click(Object sender, EventArgs e) in E:\Advanced-SNES-ROM-Utility\Advanced_SNES_ROM_Utility\Form1.cs:line 146
   at System.Windows.Forms.Control.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnClick(EventArgs e)
   at System.Windows.Forms.Button.OnMouseUp(MouseEventArgs mevent)
   at System.Windows.Forms.Control.WmMouseUp(Message& m, MouseButtons button, Int32 clicks)
   at System.Windows.Forms.Control.WndProc(Message& m)
   at System.Windows.Forms.ButtonBase.WndProc(Message& m)
   at System.Windows.Forms.Button.WndProc(Message& m)
   at System.Windows.Forms.NativeWindow.DebuggableCallback(IntPtr hWnd, Int32 msg, IntPtr wparam, IntPtr lparam)
   at System.Windows.Forms.UnsafeNativeMethods.DispatchMessageW(MSG& msg)
   at System.Windows.Forms.Application.ComponentManager.System.Windows.Forms.UnsafeNativeMethods.IMsoComponentManager.FPushMessageLoop(IntPtr dwComponentID, Int32 reason, Int32 pvLoopData)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoopInner(Int32 reason, ApplicationContext context)
   at System.Windows.Forms.Application.ThreadContext.RunMessageLoop(Int32 reason, ApplicationContext context)
   at Advanced_SNES_ROM_Utility.Program.Main() in E:\Advanced-SNES-ROM-Utility\Advanced_SNES_ROM_Utility\Program.cs:line 16


Hi Jeff,

there must've been a reason why I did this, but I can't remember it at the moment. I will make some research on this and will edit this post later. But I guess that 1 MBit was the minimum ROM size that was used back in the days for making SNES cartridges.

Your header information should be stored beginning at 0x7FB0 for LoROM or 0xFFB0 for HiROM (without SMC header) and should mostly be well formed, otherwise this tool might have some problems with identifying it. In case the tool isn't able to identiy a header, it takes the LoROM layout as default, because this is the most common one. If the information is scrambled, it shows Unknown.

What you can try is making a new empty file with at least 128 kByte of size an copy the content of your actual ROM into it. If you have problems doing this, you can send me your file, I'll expand it for you and maybe fix some faulty header information.