Hey guys, Yoshifanatic here. It's C3 again and I've got some interesting stuff to show off. I've been working on my ASM skills these past few months in preparation for my future SMW hacks. Unlike the previous two C3s I attended, I don't have anything to release, but in the future, I might release a couple of these things depending on how usable they are to the average SMW hacker.
Also, I made a video the other day with my younger brother (known as Burrito Man2000 on Youtube) showing off these things, but I'm debating on whether I should upload it or not. It's a 41 minute long video where I attempted to do live commentary with my brother and we talked about the stuff I'm showing off here as well as some things I'm planning on doing for my next SMW hack, but I'm not exactly that good at live commentary at the moment. If you guys what to see it anyway, I'll upload it, but be warned that I stutter a bit and I had a little trouble thinking of what I wanted to say every once in a while. XD
Without further ado, here is what I've been coding:
(Also, some of these .gifs show glitches in them. I haven't fully polished the stuff I've coded yet. XD)
Dynamic Level Loading

Note: The dynamic level loading won't be as obvious when I start making actual levels using this.
First off, the biggest thing I've done ASM wise for my future SMW hacks is that I've coded a routine that lets me load new level data mid level without any sort of screen transition.
However, it isn't quite done because it currently doesn't load new layer 3 graphics or tilemap or HDMA effects (which you can see in the cave section in the .gif) and it doesn't preserve sprites except for sprites Mario is holding or Yoshi if he is riding him. Also, because I haven't touched the layer 1 tilemap uploading code during V-Blank, I have to make sure that the old and the new level line up perfectly or else the ground will be cutoff when the screen scrolls around.
So, with this, I'll be able to create levels that seamlessly blend into one another and psuedo-NGHE levels (which for those of you that don't know, the NGHE patch was a patch made by Alcaro that allows you to have SMW levels that are different dimensions than what SMW normally allows for. Unfortunately, it's buggy and hard to use since Lunar Magic doesn't support it).
As a fun fact, did you guys know that SMW's level loading code is very badly optimized? I made a much more optimized version of it to use as the level loading code for my routine in order to make the level loading as seamless as possible (currently, most of the lag is due to decompressing the graphics that aren't already loaded). Here's an example of how badly it's unoptimized: There is a routine that buffers the BG data to the RAM for later. For some inexplicable reason, the code keeps switch between 8-bit and 16-bit mode for the accumulator, yet only the value stored in Y ever changes when A is 16-bit and not once is the value of A transferred into Y either directly or indirectly in that routine. Why is it like that? It's especially silly because this is in the middle of a loop, so this ends up wasting lots of cycles for no reason when the game runs this routine.
I Wanna Be The Guy Style Death Routine

You gotta love those munchers that appear out of nowhere when you least expect it.
Since my next SMW hack is going to be inspired by IWBTG in a lot of ways, I figured I'd attempt to recreate that game's death animation into SMW, but with a few differences so I could make it a little more over the top and for it to work within the SNES's limitations (ex. only 8 blood particles spawn instead of 100s). After Mario dies, a sprite representing his head spawns and it goes flying and rolls along the ground. Due to the way it's coded, the camera scrolls with it and it can interact with some sprites the same way Mario does (ex. landing on a koopa will stomp it). Pressing R currently resets the current level, but I'll eventually make it work similar to IWBTG where you'll reset back to your last save or to the beginning of the game if you haven't saved yet (I'll be implementing a similar save system as the one in IWBTG).
I Wanna Be The Guy Style Trigger Spikes

You know how in IWBTG, there are spikes, delicious fruit and other things that fly at the kid if it means killing him, even defying gravity to do so? Well, that's exactly what these are. These are cluster sprites that spawn when an invisible trigger block is touched, and they can be customized on a per level basis. For each individual one, I can set the speed they travel at, what sprite tile they use, the properties of that tile, where the sprite initially spawns, what tile they generate when they initially spawn and when they "deactivate" (which occurs if they touch a specific block), and how they interact with Mario (ex. instead of killing him, I could make them act like a solid block), as well as any special properties they may have (ex. I could set it so that the spike deletes tiles that it passes by).
I plan on releasing these at some point when I finish all the coding for them. The obvious use for them would be for traps, but they can be used for other things to such as a one time moving platform.
Dynamic Sprite Routine (my version)

Note: This is currently a little buggy. For starters, this routine doesn't account for sprite tiles that are offscreen.
Jan 6 Edit: Here is a better .gif:

Yes, I know that there is already DynamicZ, but when I was attempting to convert many of the existing SMW sprites so that they'd be dynamic, I found DynamicZ to be too inflexible (I wasn't sure if it was possible to have sprite sizes other than 32x32, 48x48 and 64x64) and inefficient when it comes to speed. So, I created my own dynamic routine that is faster and is adaptable no matter how many sprite tiles a given sprite uses. It uploads a max of 3 KB of data (24 tiles) per frame (though I'll likely reduce it to 2 since 3 sometimes causes V-blank overflow), but the way it's coded allows it to address a maximum 8 KB of data (64 tiles) depending on how many tiles need to be updated on a given frame (most sprites in SMW don't animate faster than 15 FPS so I can easily take advantage of that).
I'm not going to be converting some sprites to use this routine though, mostly for performance reasons or because I'm not going to be using the sprite to begin with (ex. Peach, Sumo Bro. Lightning, etc). For those sprites, I reserved SP3 and SP4 for their graphics.
In addition, I made this routine tie into the OAM index for the sprites that use the second half of the OAM, which means I'll have a more efficient version of the "No Sprite Tile Limits" patch running. Of course, it's a little buggy as you can see in the .gif when that puntin' chuck disappears and has his head replaced with a football, but I think the latter is because the football isn't dynamic yet.
Screen Scrolling Pipes (my version)

Yes, I know there is a patch for this, but they didn't look like they'd be that hard to code myself. And sure enough, I was able to do it without much issue.
Re-coded Yoshi

Note: The only reason Mario is below Yoshi when riding him is because I need to be able to see Yoshi's animations while I'm working on them.
When I tried to convert Yoshi to use my dynamic sprite routine, I ran into some issues. Yoshi's coding is really confusing and seems needlessly complicated. So, I've decided to re-code how the game handles Yoshi for my next SMW hack. In the original SMW, Yoshi and Mario are separate entities no matter what. In my code, they're separate entities when Mario isn't riding Yoshi and the same entity when Mario is on Yoshi. So basically, Mario turns into Yoshi and then I tack on an image of Mario onto Yoshi's back.

Note: Jimmy52905's Yoshi Player patch was used to add the tongue functionality to Yoshi. I currently haven't ported over any of the other abilities that patch adds to SMW.
One thing I've been working on with Yoshi is his animations. Since Mario's graphics routine now has to handle drawing Yoshi, I had to code a new animation routine for when Mario is riding Yoshi. The way I coded it is interesting. Basically, it works similar to the original Mario GFX routine, but I made it so that Yoshi's head tiles can be modified depending on certain actions he is doing at the moment. For example, if you hold up, Yoshi will look up no matter what pose he is doing (even ducking if you hold up and down at the same time). If Yoshi has something in his mouth, he will show that, and same if he is sticking his tongue out. With the exception of his "mouth full" and "extend tongue" states (which are mutually exclusive), these states can stack, so Yoshi can be looking up with something in his mouth and he will have a head for that. With this animation system, I'll be saving myself a lot of work, saving lots of ROM space, and have Yoshi be more flexible with some of his animations.
Another thing I've been doing, which I can't really show in a .gif is that I've been using galaxyhaxz's SMW source code as a base for my next SMW hack. Yep, you heard that right. I've decided to go this route because it's more flexible compared to doing things the normal way (ex. I can move things around in the ROM for the most part and most of the pointers to that data will automatically update themselves) and it will allow me to do things that would likely be really hard to do normally or would be inefficient (ex. my dynamic sprite routine as well as some of the bigger optimizations I made to speed up SMW's code, which is important since I'm not going to be using the SA-1 patch). I can also easily integrate patches and my custom code into the existing code to save ROM space and cycles depending on what I'm trying to integrate and where and I can more easily replace stuff that I don't care about and won't be using, like the Princess Peach sprite and the end credits related stuff.
Of course, this isn't without issues, but I've worked around them. The biggest one being Lunar Magic compatibility, which I got around by disassembling most of the code LM inserts/changes in a clean ROM (with the exception of things like level and map16 data, which I can just reinsert at any time) and being careful of what I do in certain banks where LM expects certain things to be. If Lunar Magic had a function where you could tell it where certain things are and where to apply its hijacks, I'd have full control over SMW's code, but even without that, I can still do a lot using the source code as long as I'm careful.
Anyway, that's it for what I'm going to be showing this C3. I hope you guys found it interesting.
Jan 6 Edit: Here's an IPS patch showing off these things if you'd like to see them in game:
Link
Go to this post I made for some information regarding this IPS patch:
Link
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 (7/8/2022 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.
Also, I made a video the other day with my younger brother (known as Burrito Man2000 on Youtube) showing off these things, but I'm debating on whether I should upload it or not. It's a 41 minute long video where I attempted to do live commentary with my brother and we talked about the stuff I'm showing off here as well as some things I'm planning on doing for my next SMW hack, but I'm not exactly that good at live commentary at the moment. If you guys what to see it anyway, I'll upload it, but be warned that I stutter a bit and I had a little trouble thinking of what I wanted to say every once in a while. XD
Without further ado, here is what I've been coding:
(Also, some of these .gifs show glitches in them. I haven't fully polished the stuff I've coded yet. XD)
Dynamic Level Loading

Note: The dynamic level loading won't be as obvious when I start making actual levels using this.
First off, the biggest thing I've done ASM wise for my future SMW hacks is that I've coded a routine that lets me load new level data mid level without any sort of screen transition.
However, it isn't quite done because it currently doesn't load new layer 3 graphics or tilemap or HDMA effects (which you can see in the cave section in the .gif) and it doesn't preserve sprites except for sprites Mario is holding or Yoshi if he is riding him. Also, because I haven't touched the layer 1 tilemap uploading code during V-Blank, I have to make sure that the old and the new level line up perfectly or else the ground will be cutoff when the screen scrolls around.
So, with this, I'll be able to create levels that seamlessly blend into one another and psuedo-NGHE levels (which for those of you that don't know, the NGHE patch was a patch made by Alcaro that allows you to have SMW levels that are different dimensions than what SMW normally allows for. Unfortunately, it's buggy and hard to use since Lunar Magic doesn't support it).
As a fun fact, did you guys know that SMW's level loading code is very badly optimized? I made a much more optimized version of it to use as the level loading code for my routine in order to make the level loading as seamless as possible (currently, most of the lag is due to decompressing the graphics that aren't already loaded). Here's an example of how badly it's unoptimized: There is a routine that buffers the BG data to the RAM for later. For some inexplicable reason, the code keeps switch between 8-bit and 16-bit mode for the accumulator, yet only the value stored in Y ever changes when A is 16-bit and not once is the value of A transferred into Y either directly or indirectly in that routine. Why is it like that? It's especially silly because this is in the middle of a loop, so this ends up wasting lots of cycles for no reason when the game runs this routine.
I Wanna Be The Guy Style Death Routine

You gotta love those munchers that appear out of nowhere when you least expect it.
Since my next SMW hack is going to be inspired by IWBTG in a lot of ways, I figured I'd attempt to recreate that game's death animation into SMW, but with a few differences so I could make it a little more over the top and for it to work within the SNES's limitations (ex. only 8 blood particles spawn instead of 100s). After Mario dies, a sprite representing his head spawns and it goes flying and rolls along the ground. Due to the way it's coded, the camera scrolls with it and it can interact with some sprites the same way Mario does (ex. landing on a koopa will stomp it). Pressing R currently resets the current level, but I'll eventually make it work similar to IWBTG where you'll reset back to your last save or to the beginning of the game if you haven't saved yet (I'll be implementing a similar save system as the one in IWBTG).
I Wanna Be The Guy Style Trigger Spikes

You know how in IWBTG, there are spikes, delicious fruit and other things that fly at the kid if it means killing him, even defying gravity to do so? Well, that's exactly what these are. These are cluster sprites that spawn when an invisible trigger block is touched, and they can be customized on a per level basis. For each individual one, I can set the speed they travel at, what sprite tile they use, the properties of that tile, where the sprite initially spawns, what tile they generate when they initially spawn and when they "deactivate" (which occurs if they touch a specific block), and how they interact with Mario (ex. instead of killing him, I could make them act like a solid block), as well as any special properties they may have (ex. I could set it so that the spike deletes tiles that it passes by).
I plan on releasing these at some point when I finish all the coding for them. The obvious use for them would be for traps, but they can be used for other things to such as a one time moving platform.
Dynamic Sprite Routine (my version)

Note: This is currently a little buggy. For starters, this routine doesn't account for sprite tiles that are offscreen.
Jan 6 Edit: Here is a better .gif:

Yes, I know that there is already DynamicZ, but when I was attempting to convert many of the existing SMW sprites so that they'd be dynamic, I found DynamicZ to be too inflexible (I wasn't sure if it was possible to have sprite sizes other than 32x32, 48x48 and 64x64) and inefficient when it comes to speed. So, I created my own dynamic routine that is faster and is adaptable no matter how many sprite tiles a given sprite uses. It uploads a max of 3 KB of data (24 tiles) per frame (though I'll likely reduce it to 2 since 3 sometimes causes V-blank overflow), but the way it's coded allows it to address a maximum 8 KB of data (64 tiles) depending on how many tiles need to be updated on a given frame (most sprites in SMW don't animate faster than 15 FPS so I can easily take advantage of that).
I'm not going to be converting some sprites to use this routine though, mostly for performance reasons or because I'm not going to be using the sprite to begin with (ex. Peach, Sumo Bro. Lightning, etc). For those sprites, I reserved SP3 and SP4 for their graphics.
In addition, I made this routine tie into the OAM index for the sprites that use the second half of the OAM, which means I'll have a more efficient version of the "No Sprite Tile Limits" patch running. Of course, it's a little buggy as you can see in the .gif when that puntin' chuck disappears and has his head replaced with a football, but I think the latter is because the football isn't dynamic yet.
Screen Scrolling Pipes (my version)

Yes, I know there is a patch for this, but they didn't look like they'd be that hard to code myself. And sure enough, I was able to do it without much issue.
Re-coded Yoshi

Note: The only reason Mario is below Yoshi when riding him is because I need to be able to see Yoshi's animations while I'm working on them.
When I tried to convert Yoshi to use my dynamic sprite routine, I ran into some issues. Yoshi's coding is really confusing and seems needlessly complicated. So, I've decided to re-code how the game handles Yoshi for my next SMW hack. In the original SMW, Yoshi and Mario are separate entities no matter what. In my code, they're separate entities when Mario isn't riding Yoshi and the same entity when Mario is on Yoshi. So basically, Mario turns into Yoshi and then I tack on an image of Mario onto Yoshi's back.

Note: Jimmy52905's Yoshi Player patch was used to add the tongue functionality to Yoshi. I currently haven't ported over any of the other abilities that patch adds to SMW.
One thing I've been working on with Yoshi is his animations. Since Mario's graphics routine now has to handle drawing Yoshi, I had to code a new animation routine for when Mario is riding Yoshi. The way I coded it is interesting. Basically, it works similar to the original Mario GFX routine, but I made it so that Yoshi's head tiles can be modified depending on certain actions he is doing at the moment. For example, if you hold up, Yoshi will look up no matter what pose he is doing (even ducking if you hold up and down at the same time). If Yoshi has something in his mouth, he will show that, and same if he is sticking his tongue out. With the exception of his "mouth full" and "extend tongue" states (which are mutually exclusive), these states can stack, so Yoshi can be looking up with something in his mouth and he will have a head for that. With this animation system, I'll be saving myself a lot of work, saving lots of ROM space, and have Yoshi be more flexible with some of his animations.
Another thing I've been doing, which I can't really show in a .gif is that I've been using galaxyhaxz's SMW source code as a base for my next SMW hack. Yep, you heard that right. I've decided to go this route because it's more flexible compared to doing things the normal way (ex. I can move things around in the ROM for the most part and most of the pointers to that data will automatically update themselves) and it will allow me to do things that would likely be really hard to do normally or would be inefficient (ex. my dynamic sprite routine as well as some of the bigger optimizations I made to speed up SMW's code, which is important since I'm not going to be using the SA-1 patch). I can also easily integrate patches and my custom code into the existing code to save ROM space and cycles depending on what I'm trying to integrate and where and I can more easily replace stuff that I don't care about and won't be using, like the Princess Peach sprite and the end credits related stuff.
Of course, this isn't without issues, but I've worked around them. The biggest one being Lunar Magic compatibility, which I got around by disassembling most of the code LM inserts/changes in a clean ROM (with the exception of things like level and map16 data, which I can just reinsert at any time) and being careful of what I do in certain banks where LM expects certain things to be. If Lunar Magic had a function where you could tell it where certain things are and where to apply its hijacks, I'd have full control over SMW's code, but even without that, I can still do a lot using the source code as long as I'm careful.
Anyway, that's it for what I'm going to be showing this C3. I hope you guys found it interesting.
Jan 6 Edit: Here's an IPS patch showing off these things if you'd like to see them in game:
Link
Go to this post I made for some information regarding this IPS patch:
Link
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 (7/8/2022 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.


