You are viewing an archive of Victory Road.
Victory Road closed on January 8, 2018. Thank you for making us a part of your lives since 2006! Please read this thread for details if you missed it.
Why isn't this is Mario General? Because ASM hacking is universal for the SNES, even allowing one to make a game from scratch. However, SMW will play a big role in this, with many tools developed for it to make adding things such as sprites and blocks easier, and a majority of the ROM already decoded.
Some general tools you'll need for this tutorial:
A Super Mario World ROM, which I will not link to because linking to ROMs is illegal and you can easily find one yourself.
Xkas v0.08, a patching tool that allows you to patch ASM code to a ROM.
Lunar Magic 1.82, which allows one to edit the levels and overworld of aforementioned ROM. Neccisary if you're creating code that won't normally appear in the game (IE a custom sprite).
SMWDisC, a wonderful disassembly of SMW put together by the kind folks at SMWCentral. Sadly, the project was never completed, but a majority of code was commented that can be used as sort of a testing reference.
SMWCentral's ROM and RAM maps, while also not complete, are being pieced together by the community as we speak, so they're a great reference.
Now that we have all that out of the way, let's get hacking!
To start, we need to understand exactly how the processor works. The 65c816 is a 16-bit processor developed as an extension to the 6502, used to run the NES and Atart 2600, among other things. Because the 65816 was built upon the 6502, most of the basic terminoligy of the 6502 remains intact.
For those that don't even know how assembly works, you're essentially writing EXACTLY how the program runs, at the cost of simplicity. Unfortunately for ambitious ROM hackers, all console games are written in their respective system's assembly language. That's what these tutorials are for.
To get things started, open up SMWDisC and prepare to feel confused. Don't worry, the top of the file is just a bad first impression, made up of the more complex code (setting up sound and graphics, etc.). To start, let's make a minor modification to the ROM, such as I guess making the player start with 69 lives. To start, bring up SMWCentral's ever expanding ROM map, and Ctrl+F related words such as "life" or "lives". Eventually, one will find this:
$00:9E25 1 byte Misc. Amount of lives to start with.
header lorom org $009E25
header ;typing this let's the game know your ROM has a header (which it should by the way, if the ROM isn't 513KiB, it's not the right kind of ROM) lorom ;lorom is essentially the way our ROM is formatted (all SMW ROMs are lorom, don't worry) org $009E25 ;org is a command that jumps straight to an area of the code, in this case area $009E25. Yes the dollar sign is neccisary, as you will see later.
CODE_009E24: A9 04 LDA.B #$04 CODE_009E26: 9D B4 0D STA.W RAM_PlayerLives,X
0, 1, 2, 3 ... 8, 9, A, B, C, D, E, F, 10, 11 ... 18, 19, 1A, 1B, 1C, 1D, 1E, 1F, 20, 21 ... 9D, 9E, 9F, A0, A1, A2 ... FE, FF, 0, 1, 2 ...
CODE_009E24: A9 04 LDA.B #$04 CODE_009E26: 9D B4 0D STA.W RAM_PlayerLives,X
DB $44 ;Remember, the lives are in hexadecimal. To convert a decimal to a hexadecimal, use Windows Calculator under Programmer mode.
DB $44,$B2,$14,$1A ;However, we only need to change one value, so don't add this to your code.
2 – Cat333Pokémon, piexingI figured this was the best place to ask for help.
I made a patch to keep the sprites on screen when you press a button on the title screen. Following instructions on the SMWC ROM Map, I made this code:
header LOROM org $009C9F DB $EA,$EA,$EA,$EA

Rule Number 1: You will ALWAYS get a Checksum fail upon editing a ROM (Lunar Magic automatically fixes the checksum upon game save)
Rule Number 2: NEVER delete the header. EVER.
Checksum fails are actually not a bad thing as long as you're using an emulator anyway so don't worry about it
So I have a couple of issues at the moment. First, I can't get LevelASM to work on a clean ROM. It crashes it when I select a file. When I deleted the default code that came with level 105, the title screen circle doesn't appear and I can't advance. Also, I found a Lakithunder on SMWC, but I don't know enough ASM to turn it into a boss battle. Basically I need a boss finish and then yellow switch blocks to be spat out on the map screen. (and of course the yellow blocks appearing in he levels)
|
I can't get LevelASM to work on a clean ROM. It crashes it when I select a file. When I deleted the default code that came with level 105, the title screen circle doesn't appear and I can't advance.
|
|
Also, I found a Lakithunder on SMWC, but I don't know enough ASM to turn it into a boss battle. Basically I need a boss finish and then yellow switch blocks to be spat out on the map screen. (and of course the yellow blocks appearing in he levels)
|
|
Did you remember to set the freespace at the top of the file? If you didn't, there's a good chance you overwrote another patch's code.
Well, it doesn't seem to do anything in my hack; only on a clean ROM (in which case it crashes). And I left the freespace at the default $1D8000, which I would assume be empty. I don't know how to do that either (and thus I lost 50 peoples' respect) Well, uh, would you know how to make a door or whatever spawn? That works too. |
http://www.smwcentral.net/download.p...239&type=tools
Download this program (instructions in readme.txt) and see if $1D8000 lands there. More importantly, see how much size is allowed in $1D8000. If there isn't about D00 free bytes there, it's not freespace.
ALSO, $1D8000 only exists in a ROM edited by Lunar Magic, so of course it would crash a clean ROM. You should only test patches and programs on ROMs ALREADY EDITED BY LUNAR MAGIC, due to the important upgrades it adds to the ROM.