Language…
22 users online:  AmperSam,  Anorakun, apache, B2De, caioskii, Dennsen86, Ekimnoid, GamesInTweed, GRIMMKIN, Heitor Porfirio, JudithPrietht, krizeth, LightAligns, mario90, Rykon-V73, SMW Magic,  Tahixham,  Teyla, The_Uber_Camper,  Thomas, VSmario90, Yuvi - Guests: 278 - Bots: 380
Users: 64,795 (2,374 active)
Latest user: mathew

Re-engineering sprites in SMW

I'm currently working on fixing an old SMW hack so that it can work properly on accurate emulators. It's a surprisingly fun task, but since the hack uses a lot of ASM trickery, there are some things the hack does that I still have to figure out the purpose behind.

In particular, some levels use sprites that I'll need to recreate, or at least figure out how they were done. Is there a tool I can use, or maybe some other ASM/hex editor trickery I can use to figure out what the sprite is supposed to do, or even what its ASM code is? Or is there no easier way to do what I'm asking other than "use some creativity to figure out my own way to accomplish what the hack does"?
Twitter
The handomest people in the world are ones who follow my Twitch


You could try your hand at disassembling the sprite. Disassembling can be done most easily with either an emulator that has a debugger (such as Mesen-S or bsnes-plus), or via SHex, which is a hex editor that features disassembling capabilities.

As an example, here's how Mesen-S's debugger looks:

As you play the game, Mesen-S will log what code has been executed and format it in the debugger accordingly. White blocks are known code, yellow blocks are known data, green blocks are suspected code that hasn't been executed yet, and red blocks are places that the debugger hasn't seen executed yet. By playing around with the sprite you want to debug enough, you can eventually get what would essentially be the full source code this way.

With that, you'll want to then start by just finding the location of the sprite's code. Here's a couple of options for this part:
- With a debugger, you could set a breakpoint on writes to a RAM address that you know the sprite uses, so that when that RAM address gets modified, the code will break on it. From there you can just look at the surrounding code to find the rest of the sprite's code.
- Break/disassemble at the place in the ROM where sprite INIT/MAIN pointers actually gets jumped to. Generally, INIT is at $018172 ($818172 on fastrom), and MAIN is at $0185C3 ($8185C3 on fastrom). Then just follow the code to find when the custom sprite's code actually gets jumped to.

Professional frame-by-frame time wizard. YouTube - Twitter - SMW Glitch List - SMW Randomizer