Hi guys! It's been a while since I was last on SMWCentral. So, how have you guys been?
Anyway, some of you might be curious about what I've been up to lately, huh? Well, other than a bunch of things unrelated to this thread, I've been taking a break from SMW hacking for a while. Then, about a month ago, I decided to get back into working on my next hack. However, I quickly realized that if I continued with my hack the way it was, it would potentially become unmanageable,due to how messy things were getting. So, I decided to port things over to a new ROM. And by that, I don't mean that I ported over stuff to a clean copy of SMW (which would be impossible to do anyway, due to how my hack is set up). Rather, I'm building a new ROM using code from the old one with some new code to tie things together.
In other words, my hack is more like a homebrew now than it is a SMW hack.
Yep. My hack may look somewhat like SMW on the surface, but with some new additions or omissions, but it's definitely not SMW internally. If any of you think I'm kidding, I can post the source code* or you could step though the code of my hack with a debugger and you'll notice that it barely has anything in common with SMW besides a handful of routines (and even then, those routines use different RAM addresses, are located in a different place, and may have additional code or been shortened). But anyway, by making my hack more like a homebrew, I have far more control over things compared to before. I'm able to change whatever I like to suit my needs as well as optimize stuff further than would be possible otherwise. Of course, this comes at the cost of being able to edit my hack in Lunar Magic, but it's not going to be too big of an issue (plus, LM will still be useful to me for some things, like its map16 editor).
There is still quite a few things I've yet to implement into my hack, but I've got a decent amount done. Here is a few things I've done:
- Changed the level data format to allow me to have much larger levels of various dimensions
- A file select screen, which has an options screen, a name entry screen, a difficulty selection, and a copy file function, in addition to a file select and erase file function.
- A free look camera, allowing you to pan the camera around freely in levels, but only while the game is paused.
- A new NMI routine that is both quick and very flexible (I'll post a link to it, since I'd like to get some feedback on it).
- Ported over various patches, such as the 64x64 Nintendo Presents logo, AddmusicK's engine (+Vitor Vilela's sample streaming), Lunar Magic's VRAM patch, VWF Dialogues, LevelASM, and more.
- Converted Mario into a normal sprite and made his logic and graphics code run on alternating frames.
- Moved the main sprite loop to be within the main program loop and added a few slots reserved for non-sprite related tasks (ex. The game stores the pointer to the level camera routine to this table when loading a level. If I need a different camera routine to be used, I can change the pointer so that the previous camera code is no longer processed at all).
- Mode 3 title screen (I'll likely make it so that a demo will play if you wait on this screen, but that will be for later).
For a full list of all the stuff I implemented, I provided a text file in the download.
Speaking of which, here is a link to my hack if you guys want to see it:
Link
Here is my NMI routine:
Link
And here are a couple .gifs showing some of the stuff in my hack:
Huh, who would have thought that the SNES also had blast processing?
Whoa, slow down Mario! I don't think even Sonic runs that fast!
Yeah, I raised the speed cap in my hack, though not so I could have faster speeds, but rather so that I could speed up the routine that handles that. Me being able to define a greater range of speed for stuff to move at is a side effect. In the first .gif, Mario is moving at 16 pixels a frame (though because Mario is running his logic code at 30 FPS, it's more like 8 pixels visually). In the second .gif, Mario is moving 24 pixels (12 visually). I don't think I'll be using crazy speeds like that though, unless I can think of a different way to handle block collision that can handle high speeds like this.
This is a 4 screen by 4 screen level in all its glory.
I changed how my hack handles level data so that, rather than SMW's rigid way of doing it, my hack uses a more flexible way of doing it, where the game stores the level data based on how many rows and columns it has. So, the first X bytes are the topmost row of the level, the next X bytes are for the row below that, and so on, where X is the number of columns. Since I allocated 16 KB for the level data, the max level sizes are 73.1x0.9 screens, 1x64 screens, and 8x8 screens.
Introducing the free look camera! It lets you see stuff! Mind blowing, ain't it?
This works pretty much like you'd expect. Scroll around with the D-pad, camera won't scroll where it wouldn't normally, press A/Start to snap the camera back to Mario and exit free look mode. Currently it doesn't take sprite loading into account, but I have yet to implement my sprite loading code or any non-Mario sprites in my hack, so that will be for later.
File select 2.0
Here is a quick overview of my file select screen. What you see here is 100% of my code (not counting the stuff that occurs outside the file select game mode, of course).
Fun fact: In my hack, if your save gets corrupted and the backup of that file is fine, then the game will overwrite the corrupt save with the backup file's data. That way, you won't be forced to start over if something went wrong. SMW doesn't do this even though it keeps backup saves.
Also, since I changed how things are handled internally (in addition to how the level data is handled), some of you might be wondering: "Yoshifanatic, how are you going to make levels for your hack when you can't open your hack in Lunar Magic anymore?" Yeah, I realized that that would be an issue when I decided to recode my hack. But to answer this hypothetical question, the answer is pretty simple:
I made my own level editor.
Since creating level data through hex editing would have been too tedious, I decided to use my ASM knowledge to create an SNES ROM that functions as a level editor for my hack. It's currently a beta, but at the moment, it can:
- Place individual map16 blocks on layer 1
- Place sprites
- Place entrance locations
- View the current palette
- Change level settings
It's nothing compared to Lunar Magic, but it gets the job done and it allows me to be able to visualize the levels as I'm making them. There is still a lot of things that I'd like to add to it, though. Specifically:
- Support for controller 2, so I can map more functions to buttons
- A layer 2 editor (only for level data. BG tilemaps will be made with other tools).
- An HDMA editor (if I can figure out how to implement it in an elegant way)
- The ability to edit the palette in the palette editor
- A gradient function for the HDMA and palette editors (assuming I can figure out how to do that)
- Audio
- The ability to place a formation of map16 blocks down so things that require multiple map16 tiles to look/work right like pipes are easier to place.
- Making the cursor change its appearance so it looks like the object you're placing down.
- Make the VWF dialogues update all displayed text instantly when needed.
- Change the UI to make it more intuitive.
- Various bug fixes
Here is a link to my level editor if any of you would like to try it out:
Link
I provided a patch that will let you insert the level you make into my hack, although only a handful of things you can change in the editor are actually implemented in the main hack.
Anyway,I'll likely make a video or two showing off the level editor, but I'll do that later. For now, here is a .gif giving a quick overview of my level editor, plus a video showing off a bit more:
Hey, I found a use for Mode 4!
Video Link
If you're going to change the map16 values you're placing here are some pictures showing what the tiles look like:
Also, there isn't any error checking in place if you try to place something invalid, so I recommend making a savestate before trying to place a new thing down or load a GFX file.
Also, regarding the stuff I showed off last C3, almost none of those things were touched recently. The only things I did touch were the dynamic sprites (made more sprites dynamic and modified my upload routine) and the name entry screen (rewrote it as part of my new file select screen). I was also in the process of converting every sprite into a normal one for the purposes of simplifying how they are handled (extended/coin/minor extended/score/etc. sprites would still get their own slots though, it's just that they would use the same RAM and routines as normal sprites for the most part).
Anyway, I hope you guys liked what I had to show off this C3!
Bonus:
As if the death animation in my hack couldn't get more over the top. XD
Video Link
This is not present in the new version of my hack currently, but it is in the version before I decided to start over. This is a mode 7 cutscene I made a while back that will serve as a special death animation in my hack. It's still a WIP, but it's almost done regardless. The only things missing are an explosion effect and sound, and making Mario's head move differently (the only reason he moves diagnally before moving towards the screen is because I was testing the code that allows me to manipulate a Mode 7 tilemap. It's handled similarly to how SMW's title screen demo is handled)
*Note: The source code has some disassembled LM code in it, which I told FuSoYa I wouldn't post. However, the only LM code present is 2 small routines (one related to the extra map16 pages and one used during loading that delays the loading from finishing until NMI ends (I think that's what it does)). There is also the VRAM patch, but that's technically smkdan's patch, and the I'm not really using the code that LM added to that patch.
My Hacks:
Mario's Strange Quest V1.6
Yoshi's Strange Quest V1.3 / V1.3.1 Beta 4.6
Mario & Yoshi's Strange Quests (2/10/2023 Build)
Other stuff:
My SMW/SMAS/SMAS+W disassembly
Yoshifanatic's Discord Server: A place for fans of my stuff and/or Yoshi to chat with others.
Anyway, some of you might be curious about what I've been up to lately, huh? Well, other than a bunch of things unrelated to this thread, I've been taking a break from SMW hacking for a while. Then, about a month ago, I decided to get back into working on my next hack. However, I quickly realized that if I continued with my hack the way it was, it would potentially become unmanageable,due to how messy things were getting. So, I decided to port things over to a new ROM. And by that, I don't mean that I ported over stuff to a clean copy of SMW (which would be impossible to do anyway, due to how my hack is set up). Rather, I'm building a new ROM using code from the old one with some new code to tie things together.
In other words, my hack is more like a homebrew now than it is a SMW hack.
Yep. My hack may look somewhat like SMW on the surface, but with some new additions or omissions, but it's definitely not SMW internally. If any of you think I'm kidding, I can post the source code* or you could step though the code of my hack with a debugger and you'll notice that it barely has anything in common with SMW besides a handful of routines (and even then, those routines use different RAM addresses, are located in a different place, and may have additional code or been shortened). But anyway, by making my hack more like a homebrew, I have far more control over things compared to before. I'm able to change whatever I like to suit my needs as well as optimize stuff further than would be possible otherwise. Of course, this comes at the cost of being able to edit my hack in Lunar Magic, but it's not going to be too big of an issue (plus, LM will still be useful to me for some things, like its map16 editor).
There is still quite a few things I've yet to implement into my hack, but I've got a decent amount done. Here is a few things I've done:
- Changed the level data format to allow me to have much larger levels of various dimensions
- A file select screen, which has an options screen, a name entry screen, a difficulty selection, and a copy file function, in addition to a file select and erase file function.
- A free look camera, allowing you to pan the camera around freely in levels, but only while the game is paused.
- A new NMI routine that is both quick and very flexible (I'll post a link to it, since I'd like to get some feedback on it).
- Ported over various patches, such as the 64x64 Nintendo Presents logo, AddmusicK's engine (+Vitor Vilela's sample streaming), Lunar Magic's VRAM patch, VWF Dialogues, LevelASM, and more.
- Converted Mario into a normal sprite and made his logic and graphics code run on alternating frames.
- Moved the main sprite loop to be within the main program loop and added a few slots reserved for non-sprite related tasks (ex. The game stores the pointer to the level camera routine to this table when loading a level. If I need a different camera routine to be used, I can change the pointer so that the previous camera code is no longer processed at all).
- Mode 3 title screen (I'll likely make it so that a demo will play if you wait on this screen, but that will be for later).
For a full list of all the stuff I implemented, I provided a text file in the download.
Speaking of which, here is a link to my hack if you guys want to see it:
Link
Here is my NMI routine:
Link
And here are a couple .gifs showing some of the stuff in my hack:
Huh, who would have thought that the SNES also had blast processing?
Whoa, slow down Mario! I don't think even Sonic runs that fast!
Yeah, I raised the speed cap in my hack, though not so I could have faster speeds, but rather so that I could speed up the routine that handles that. Me being able to define a greater range of speed for stuff to move at is a side effect. In the first .gif, Mario is moving at 16 pixels a frame (though because Mario is running his logic code at 30 FPS, it's more like 8 pixels visually). In the second .gif, Mario is moving 24 pixels (12 visually). I don't think I'll be using crazy speeds like that though, unless I can think of a different way to handle block collision that can handle high speeds like this.
This is a 4 screen by 4 screen level in all its glory.
I changed how my hack handles level data so that, rather than SMW's rigid way of doing it, my hack uses a more flexible way of doing it, where the game stores the level data based on how many rows and columns it has. So, the first X bytes are the topmost row of the level, the next X bytes are for the row below that, and so on, where X is the number of columns. Since I allocated 16 KB for the level data, the max level sizes are 73.1x0.9 screens, 1x64 screens, and 8x8 screens.
Introducing the free look camera! It lets you see stuff! Mind blowing, ain't it?
This works pretty much like you'd expect. Scroll around with the D-pad, camera won't scroll where it wouldn't normally, press A/Start to snap the camera back to Mario and exit free look mode. Currently it doesn't take sprite loading into account, but I have yet to implement my sprite loading code or any non-Mario sprites in my hack, so that will be for later.
File select 2.0
Here is a quick overview of my file select screen. What you see here is 100% of my code (not counting the stuff that occurs outside the file select game mode, of course).
Fun fact: In my hack, if your save gets corrupted and the backup of that file is fine, then the game will overwrite the corrupt save with the backup file's data. That way, you won't be forced to start over if something went wrong. SMW doesn't do this even though it keeps backup saves.
Also, since I changed how things are handled internally (in addition to how the level data is handled), some of you might be wondering: "Yoshifanatic, how are you going to make levels for your hack when you can't open your hack in Lunar Magic anymore?" Yeah, I realized that that would be an issue when I decided to recode my hack. But to answer this hypothetical question, the answer is pretty simple:
I made my own level editor.
Since creating level data through hex editing would have been too tedious, I decided to use my ASM knowledge to create an SNES ROM that functions as a level editor for my hack. It's currently a beta, but at the moment, it can:
- Place individual map16 blocks on layer 1
- Place sprites
- Place entrance locations
- View the current palette
- Change level settings
It's nothing compared to Lunar Magic, but it gets the job done and it allows me to be able to visualize the levels as I'm making them. There is still a lot of things that I'd like to add to it, though. Specifically:
- Support for controller 2, so I can map more functions to buttons
- A layer 2 editor (only for level data. BG tilemaps will be made with other tools).
- An HDMA editor (if I can figure out how to implement it in an elegant way)
- The ability to edit the palette in the palette editor
- A gradient function for the HDMA and palette editors (assuming I can figure out how to do that)
- Audio
- The ability to place a formation of map16 blocks down so things that require multiple map16 tiles to look/work right like pipes are easier to place.
- Making the cursor change its appearance so it looks like the object you're placing down.
- Make the VWF dialogues update all displayed text instantly when needed.
- Change the UI to make it more intuitive.
- Various bug fixes
Here is a link to my level editor if any of you would like to try it out:
Link
I provided a patch that will let you insert the level you make into my hack, although only a handful of things you can change in the editor are actually implemented in the main hack.
Anyway,
Hey, I found a use for Mode 4!
Video Link
If you're going to change the map16 values you're placing here are some pictures showing what the tiles look like:
Also, there isn't any error checking in place if you try to place something invalid, so I recommend making a savestate before trying to place a new thing down or load a GFX file.
Also, regarding the stuff I showed off last C3, almost none of those things were touched recently. The only things I did touch were the dynamic sprites (made more sprites dynamic and modified my upload routine) and the name entry screen (rewrote it as part of my new file select screen). I was also in the process of converting every sprite into a normal one for the purposes of simplifying how they are handled (extended/coin/minor extended/score/etc. sprites would still get their own slots though, it's just that they would use the same RAM and routines as normal sprites for the most part).
Anyway, I hope you guys liked what I had to show off this C3!
Bonus:
As if the death animation in my hack couldn't get more over the top. XD
Video Link
This is not present in the new version of my hack currently, but it is in the version before I decided to start over. This is a mode 7 cutscene I made a while back that will serve as a special death animation in my hack. It's still a WIP, but it's almost done regardless. The only things missing are an explosion effect and sound, and making Mario's head move differently (the only reason he moves diagnally before moving towards the screen is because I was testing the code that allows me to manipulate a Mode 7 tilemap. It's handled similarly to how SMW's title screen demo is handled)
*Note: The source code has some disassembled LM code in it, which I told FuSoYa I wouldn't post. However, the only LM code present is 2 small routines (one related to the extra map16 pages and one used during loading that delays the loading from finishing until NMI ends (I think that's what it does)). There is also the VRAM patch, but that's technically smkdan's patch, and the I'm not really using the code that LM added to that patch.
My Hacks:
Mario's Strange Quest V1.6
Yoshi's Strange Quest V1.3 / V1.3.1 Beta 4.6
Mario & Yoshi's Strange Quests (2/10/2023 Build)
Other stuff:
My SMW/SMAS/SMAS+W disassembly
Yoshifanatic's Discord Server: A place for fans of my stuff and/or Yoshi to chat with others.