Language…
4 users online: DimeR, Firstnamebutt, monkey03297, thefoxx87 - Guests: 63 - Bots: 119
Users: 67,562 (2,002 active)
Latest user: Dilshacking

More Extended Sprites

SMW Patches → More Extended Sprites

Submission Details

Name: More Extended Sprites
Author: Isikoro
Added:
Version History: View
Tool: Asar
Requires Free Space: No
Bug Fix: Yes
Featured: No
Description: Up to 16 extended sprites, excluding fireballs, can coexist in the screen.
If minimalist status bars are used or the item box is disabled, up to 18 items can be served.
Lava splash are used as Minor Sprite 04 (same as Flame from Podoboo), and
The spin-jump star is used as minor sprite 09 (overwrites the address of the note that moves to the left). (Extended sprites 07 and 10 will be erased.)
(Notes that move to the left can be used by using minor sprite 08 and setting $7820,x to $01 or higher. If it is $00, it will move to the right.)

Routine to spawn spin jump stars. : JSL $07FC3B|!bank
Routine to spawn Lava drops. : JSL $028528|!bank

Bubbles in water will disappear in a certain amount of time without touching the ceiling or the air.

In the original, the Boo Stream row is also used as a minor sprite, so I recommend using it with this one.
To insert a sprite in PIXI, download here one, copy the contents of the included "pixi" folder into it, and overwrite it.

This patch is for SA-1ROM only, and cannot be used for LoROM.

Some of the extended sprite usage RAM will be changed.
The OAM index used for score sprites and the OAM index used for bounce sprites will be changed.


Please save the level in Lunar Magic at least once before applying this patch.

To make your resources compatible with this patch, you need to map them to the extended sprite usage RAM using the supplied Converter and add this code.
It is necessary to manually replace "LD? #$07" to "LD?.b #!ExSprSize" and "LD? #$09" to "LD?.b #!FireballSprSize" in the extended sprite index.

Code
	!More_ExSprite = 0
	!ExSprSize = $07
if read2($029B39) == $0000
	!More_ExSprite = 1
	!ExSprSize = read01(00FAD5)
endif
	!FireballSprSize = !ExSprSize+2

macro define_ram_exsp(name, name2, exsp, exsp_more)
if !More_ExSprite == 0
    !<name> = <exsp>
else
    !<name> = <exsp_more>
endif
    !<name2> = !<name>
endmacro

%define_ram_exsp(ex_sprite_num, "170B", $170B|!addr, $770B)
%define_ram_exsp(ex_sprite_y_low, "1715", $1715|!addr, $3426)
%define_ram_exsp(ex_sprite_x_low, "171F", $171F|!addr, $343A)
%define_ram_exsp(ex_sprite_y_high, "1729", $1729|!addr, $771F)
%define_ram_exsp(ex_sprite_x_high, "1733", $1733|!addr, $7733)
%define_ram_exsp(ex_sprite_speed_y, "173D", $173D|!addr, $344E)
%define_ram_exsp(ex_sprite_speed_x, "1747", $1747|!addr, $3462)
%define_ram_exsp(ex_sprite_speed_y_frac, "1751", $1751|!addr, $7747)
%define_ram_exsp(ex_sprite_speed_x_frac, "175B", $175B|!addr, $775B)
%define_ram_exsp(ex_sprite_inc, "1765", $1765|!addr, $3476)
%define_ram_exsp(ex_sprite_misc, "176F", $176F|!addr, $776F)
%define_ram_exsp(ex_sprite_layer, "1779", $1779|!addr, $348A)
%define_ram_exsp(ex_sprite_table1, "1765", $1765|!addr, $3476)
%define_ram_exsp(ex_sprite_table2, "198C", $198C|!addr, $798C)
%define_ram_exsp(ex_sprite_table3, "1996", $1996|!addr, $349E)
%define_ram_exsp(ex_sprite_table4, "19A0", $19A0|!addr, $79A0)
%define_ram_exsp(ex_sprite_table5, "19AA", $19AA|!addr, $34B2)


Update 1
- Added documentation of OAM index after patching.

Update 2
- Added the ability to fix the Sumo bro Lightning Flame bug.(Extended No Sprite Limits patch is no longer required.)
- Fixed a bug that prevented Yoshi's flame from animating.
- Edited sa1def.asm
Tags: extended sprites minor sprites oam sa-1 thunder
Comments: 47 (jump to comments)
Download 22.44 KiB | 383 downloads

Screenshots

View all

Comments (47)

 MarioFanGamer Link
A simple update which includes some bugfixes.
Anas From older version: More Extended Sprites Link
Originally posted by MarioFanGamer
@Anas: Basically, the fireballs load the frame counter to determine the frame and then load the extended sprite's OAM index. This normally isn't a problem because the get OAM index code is to simply read from a table into Y (which preserves the frame index) but More Extended Sprites replaces it into a routine which cobbles the frame index.

A fix for that is to replace the $029F76 hijack to:
Code
org $029F71
    JSR $A34F
    LDA $14
    LSR #3


#smw{:TUP:}
 MarioFanGamer From older version: More Extended Sprites Link
A small bug slipped through the moderation: The Yoshi fireballs don't animate because getting the OAM index overrides A which is used for the fireball palette. Of course, that one can be fixed by rearranging the opcodes but it nonetheless is a bug to fix.

Edit: In hindsight, there is an update submitted already which fixes this bug, it just is waiting right now.
Anas From older version: More Extended Sprites Link
What opcodes exactly should be changed?
 MarioFanGamer From older version: More Extended Sprites Link
@Anas: Basically, the fireballs load the frame counter to determine the frame and then load the extended sprite's OAM index. This normally isn't a problem because the get OAM index code is to simply read from a table into Y (which preserves the frame index) but More Extended Sprites replaces it into a routine which cobbles the frame index.

A fix for that is to replace the $029F76 hijack to:
Code
org $029F71
    JSR $A34F
    LDA $14
    LSR #3
Anas Link
What exactly are the OAM indexes in M7 boss rooms? Just asking.
Anas Link
Originally posted by MarkVD100
I tried that and the pollen suddenly doesn't spawn even with extension values and extended sprite number set! (Volcano Lotus + Pollen custom sprite)


That’s odd, because I’m using this version of the patch and all my custom extended sprites work fine after conversion. Please make sure you’re properly converting both the pollen ext. sprite and the custom lotus itself. Run the whole code through the converter and make sure to hold Enter for at least 3-4 secs after pressing the ‘Convert’ button. You should also change any relevant instance of ‘LD? #$07’ to ‘LD?.b #!ExSprSize’ and use the provided routines with the patch. I would suggest leaving your code here for someone to check it out and see the issue. Otherwise, this must be bizarre.
MarkVD100 Link
While the collision fix for the Sumo Bro flame lightning works other than it doesn't hurt Mario regardless, it doesn't apply to custom sprites like the fire pilliar.
Anas Link
If the fire pillar is a custom sprite, I doubt it actually spawns the vanilla sumo flame sprite. Plus, you can spin-jump on that sprite IIRC. So this patch doesn’t fix that sadly.
Isikoro Author Link
Originally posted by MarkVD100
Still the same problem, and it's because it doesn't like where there is no !addr. Hence why the previous sa1def works fine. This time, it's working just fine now without needing to re-insert the patch.


Can you show me the error screen?
MarkVD100 Link
Showed it in your DMs.
Isikoro Author Link
Originally posted by MarkVD100
The new sa1def didn't work with the "Define 170B to 176F wasn't found", but the current one I have still does, but now I'm seeing that the PIXI lotus pollen is randomly wrapping around the screen and still not having a hitbox as well as the fire extended sprite from a sprite that spawns fire after a certain amount of time isn't spawning anymore either.


"Define 170B to 176F wasn't found"?
Please download and try this patch again.
MarkVD100 Link
Still the same problem, and it's because it doesn't like where there is no !addr. Hence why the previous sa1def works fine. This time, it's working just fine now without needing to re-insert the patch. Never mind, the original Volcano Lotus sprite works fine, but not the custom one.
Isikoro Author Link
Originally posted by MarkVD100
Does it fix the PIXI custom sprite thing too? Notably the extended sprites not having a hitbox anymore?


The hitbox can be fixed by editing the level and applying the More Extended Sprites patch again.

See Readme for information on Extended Sprites to be inserted in Pixi.
MarkVD100 Link
I tried that, and the pollen suddenly doesn't spawn anymore even with extension values and extended sprite number set! (Volcano Lotus + Pollen custom sprite)
MarkVD100 Link
The new sa1def didn't work with the "Define 170B to 176F wasn't found", but the current one I have still does, but now I'm seeing that the PIXI lotus pollen is randomly wrapping around the screen and still not having a hitbox as well as the fire extended sprite from a sprite that spawns fire after a certain amount of time isn't spawning anymore either.
Isikoro Author From older version: More Extended Sprites Link
Originally posted by MarkVD100
This doesn't correlate well with the Extended No Sprite Limits patch. (After doing the steps, their collision gets disabled, or if not applied the PIXI files, they get stuck in place.)


Updated to fix the lightning flame hit detection bug without the Extended No Sprite Limits patch.
New Version
MarkVD100 From older version: More Extended Sprites Link
Does it fix the PIXI custom sprite thing too? Notably the extended sprites not having a hitbox anymore?
MarkVD100 From older version: More Extended Sprites Link
This doesn't correlate well with the Extended No Sprite Limits patch. (After doing the steps, their collision gets disabled, or if not applied the PIXI files, they get stuck in place.)
EDIT: Never mind, the issue I'm having happens regardless of not applying the Extended No Sprite Limits. It's more about the PIXI thing. Forgot to mention that yesterday. I'll see if that above fixes that as well.
 Maarfy From older version: More Extended Sprites Link
This update simply added a text file listing the OAM indices for the various sprite types as used by the patch. All other files including the patch itself are completely unchanged, and as such no further testing has been done.

In the future, you're welcome to ask one of our SMW ASM Section Moderators to edit the file for you in order to avoid adding a minor update and breaking up the comment history.

Users of this patch may wish to check out the "older" version comments to see the moderator approval notes.
Isikoro Author From older version: More Extended Sprites Link
Originally posted by Isikoro
Originally posted by HammerBrother
if you want, you can include this patch (I think modifying it to merge may be needed, hijack likely conflict)

I will make it correspond.


I have applied it to this patch. Here
Isikoro Author From older version: More Extended Sprites Link
Originally posted by HammerBrother
if you want, you can include this patch (I think modifying it to merge may be needed, hijack likely conflict)

I will make it correspond.
HammerBrother From older version: More Extended Sprites Link
if you want, you can include this patch (I think modifying it to merge may be needed, hijack likely conflict)
Anas From older version: More Extended Sprites Link
Thank you for the precise documentation! Now I know what index is safe to use!
anonimzwx From older version: More Extended Sprites Link
Is there a way to identify that the patch was applied to the rom? because if i do an extended sprite i would need to know first if the rom is lorom or sa1 and second i need to know if this patch was applied or not to remap the addresses.
 MarioFanGamer From older version: More Extended Sprites Link
Moderated with:
This certainly is a huge patch and there is a notable chance that it will break your hack should you apply it. In fact, it is likely the second biggest patch you're applying to your ROM (only SA-1 is beaten) thanks to the massive amount of remapping.
Furthermore, I am impressed, how you managed to not use any freespace whatsover for this patch.

It should be noted that it uses some extra freeRAM for certainly sprite tables. These are not cleared and can be seen in the Volcano Lotus I linked where the pollen may randomly start to home the player even when the sprite is set to not shoot aimed pollen (though that one is also an oversight of the original sprite and can happen without this patch).
Anas From older version: More Extended Sprites Link
Originally posted by Isikoro
Originally posted by Anas
I found another issue, but it's a small visual one. If you have an item in the item box and four or more score sprites are on-screen, the item's graphics will temporarily disappear until the score sprites despawn.

Fixed.
However, the default number of possible coexistence is now 16.


Hmm, not a bad tradeoff. But thanks! I'll check it out!
Isikoro Author From older version: More Extended Sprites Link
Originally posted by Anas
I found another issue, but it's a small visual one. If you have an item in the item box and four or more score sprites are on-screen, the item's graphics will temporarily disappear until the score sprites despawn.

Fixed.
However, the default number of possible coexistence is now 16.
Anas From older version: More Extended Sprites Link
I found another issue, but it's a small visual one. If you have an item in the item box and four or more score sprites are on-screen, the item's graphics will temporarily disappear until the score sprites despawn.
Isikoro Author From older version: More Extended Sprites Link
Originally posted by Anas
I found another issue in the Bowser battle room:

You can't shoot fireballs properly. Hopefully this will be fixed sometime.


Fixed.
Anas From older version: More Extended Sprites Link
I found another issue in the Bowser battle room:



You can't shoot fireballs properly. Hopefully this will be fixed sometime.
Anas From older version: More Extended Sprites Link
Okay, I just noticed you mentioned the routine to spawn the spin jump stars. In the numbered platform, there was this:

Code
	LDA #$10
	%SpawnExtended()


Replacing it with 'JSL $07FC3B|!bank' fixed it! Thanks! It would be nice to mention the routine for spawning the lava splashes too. In fact, you should have a readme mentioning the stuff mentioned in the description as LX5 said. Anyways, awesome patch and so far found no issues! If I do find any, I'll let you know.
obersteiner86 From older version: More Extended Sprites Link
@DaMoarbidMan that is not a fatal bug. (Extended sprites 07 and 10 will be erased.)
Anas From older version: More Extended Sprites Link
Alright, now it's fine! Thanks!

Edit: I forgot to tell you that 'SpawnExtended' needs to be converted too. Here's the conversion:



Edit 3: I discovered a fatal bug. Resources which spawn ext. sprites 0x07 or 0x10 like this and this will crash while attempting to spawn them. What should be done?
Isikoro Author From older version: More Extended Sprites Link
Originally posted by Anas
Another issue I found is that PIXI's 'ExtendedHurt' and 'ExtendedCapeClipping' don't work with this patch. I converted them myself with the converter.

'ExtendedHurt':


'ExtendedCapeClipping':


Please include these with the patch.

Edit 2: Here we go again, another one... I converted Sonikku's fire bro successfully, following the given instructions. However, when the fireball sprites spawn, I can't shoot any fireballs. There is no 'LD? #$09' present in the code.

Fire bro:


Fireball:


Edit: Actually, I *can* shoot the fireballs but graphically, they don't show up.


"$173D|!Base2,y" has not been rewritten to "!173D,y".
"$1747|!Base2,y" has not been rewritten to "!1747,y".

I will enclose the two routines with the patch file.

Please re-download the patch and overwrite the converter.
obersteiner86 From older version: More Extended Sprites Link
hmmm what should happen on enter press i dont see any changes or i am blind ups now i see it. hmm my extendhurt looks dif then yours
Anas From older version: More Extended Sprites Link
Another issue I found is that PIXI's 'ExtendedHurt' and 'ExtendedCapeClipping' don't work with this patch. I converted them myself with the converter.

'ExtendedHurt':


'ExtendedCapeClipping':


Please include these with the patch.

Edit 2: Here we go again, another one... I converted Sonikku's fire bro successfully, following the given instructions. However, when the fireball sprites spawn, I can't shoot any fireballs. There is no 'LD? #$09' present in the code.

Fire bro:


Fireball:


Edit: Actually, I *can* shoot the fireballs but graphically, they don't show up.
Anas From older version: More Extended Sprites Link
Originally posted by Isikoro
To Anas

Did you hold down Enter for three seconds after clicking the "Converter"?


I believe so, but when I did so, nothing seemed to change. I'll try again.

Edit: Okay, tried again and now it works! Thanks! Is there anything else I should worry about or is this it? Also, what do you mean by 'extended sprite index'?

Edit: Okay, I figured it out. 'Extended sprite index' means the address $170B. Would be nice if you were more specific with that, but at least everyone will know now.
Isikoro Author From older version: More Extended Sprites Link
To Anas

Did you hold down Enter for three seconds after clicking the "Converter"?
Anas From older version: More Extended Sprites Link
Originally posted by Isikoro
Originally posted by Anas
Originally posted by Isikoro
Originally posted by Anas
Cool patch! Definitely opens up a lot of potential! By the way, I suggest you overwrite either minor ext. sprite 08 or 09 with the spin jump star’s code rather than the unused Yoshi smoke because the latter is a somewhat practical detail.

Edit: For specificity's sake (citing Yoshifanatic), sprites 08 and 09 are duplicates of the unused music note that apparently is supposed to be spawned by exploding turn blocks but aren't. They technically lead to the same code, so you should make one of the sprites' code point to the spin jump star's code. That way, you neither sacrifice the Yoshi smoke nor the unused music note. You can see more info here: https://smwc.me/1472167


I left Yoshi's smoke and assigned minor sprite 09 to the spin jump star.


Thanks! Btw, by 'extended sprite index', do you mean $170B? Because I found this in Sonikku's boomerang bro's code:

Code
    LDY #$07
-   LDA $170B|!Base2,y


and I changed the '#$07' to '#!ExSprSize' like you said, but the extended sprite doesn't work properly. However, the boomerang bro throws it normally. I ran both the boomerang bro and the boomerang ext. sprite through the converter. What do I do?

Can you show me a GIF image?




Code for boomerang projectile:


Boomerang bro:
Isikoro Author From older version: More Extended Sprites Link
Originally posted by Anas
Originally posted by Isikoro
Originally posted by Anas
Cool patch! Definitely opens up a lot of potential! By the way, I suggest you overwrite either minor ext. sprite 08 or 09 with the spin jump star’s code rather than the unused Yoshi smoke because the latter is a somewhat practical detail.

Edit: For specificity's sake (citing Yoshifanatic), sprites 08 and 09 are duplicates of the unused music note that apparently is supposed to be spawned by exploding turn blocks but aren't. They technically lead to the same code, so you should make one of the sprites' code point to the spin jump star's code. That way, you neither sacrifice the Yoshi smoke nor the unused music note. You can see more info here: https://smwc.me/1472167


I left Yoshi's smoke and assigned minor sprite 09 to the spin jump star.


Thanks! Btw, by 'extended sprite index', do you mean $170B? Because I found this in Sonikku's boomerang bro's code:

Code
    LDY #$07
-   LDA $170B|!Base2,y


and I changed the '#$07' to '#!ExSprSize' like you said, but the extended sprite doesn't work properly. However, the boomerang bro throws it normally. I ran both the boomerang bro and the boomerang ext. sprite through the converter. What do I do?

Can you show me a GIF image?
Anas From older version: More Extended Sprites Link
Originally posted by Isikoro
Originally posted by Anas
Cool patch! Definitely opens up a lot of potential! By the way, I suggest you overwrite either minor ext. sprite 08 or 09 with the spin jump star’s code rather than the unused Yoshi smoke because the latter is a somewhat practical detail.

Edit: For specificity's sake (citing Yoshifanatic), sprites 08 and 09 are duplicates of the unused music note that apparently is supposed to be spawned by exploding turn blocks but aren't. They technically lead to the same code, so you should make one of the sprites' code point to the spin jump star's code. That way, you neither sacrifice the Yoshi smoke nor the unused music note. You can see more info here: https://smwc.me/1472167


I left Yoshi's smoke and assigned minor sprite 09 to the spin jump star.


Thanks! Btw, by 'extended sprite index', do you mean $170B? Because I found this in Sonikku's boomerang bro's code:

Code
    LDY #$07
-   LDA $170B|!Base2,y


and I changed the '#$07' to '#!ExSprSize' like you said, but the extended sprite doesn't work properly. However, the boomerang bro throws it normally. I ran both the boomerang bro and the boomerang ext. sprite through the converter. What do I do?
obersteiner86 From older version: More Extended Sprites Link
seems to break with the Extended No Sprite Tile Limits v3.1 because:
; This is similar to edit1754's famous No Sprite Tile Limits patch, except that
; this one is for sprites using the other half of OAM. That is, the patch makes it
; so that sprite tiles using OAM addresses $02xx (extended sprites, cluster sprites,
; minor extended sprites, block bounce sprites, smoke images, spinning coins
; from blocks, and Yoshi's tongue), use dynamic OAM indexes instead of hardcoded
; ones, just like normal sprites do when the normal No Sprite Tile Limits patch is
; used. This drastically reduces the risk of any sprite graphics glitching up because
; of an OAM conflict.
; (It also means that Sumo Brothers work properly with the original NSTL patch and sprite memory 10; they didn't before.)
Isikoro Author From older version: More Extended Sprites Link
Originally posted by Anas
Cool patch! Definitely opens up a lot of potential! By the way, I suggest you overwrite either minor ext. sprite 08 or 09 with the spin jump star’s code rather than the unused Yoshi smoke because the latter is a somewhat practical detail.

Edit: For specificity's sake (citing Yoshifanatic), sprites 08 and 09 are duplicates of the unused music note that apparently is supposed to be spawned by exploding turn blocks but aren't. They technically lead to the same code, so you should make one of the sprites' code point to the spin jump star's code. That way, you neither sacrifice the Yoshi smoke nor the unused music note. You can see more info here: https://smwc.me/1472167


I left Yoshi's smoke and assigned minor sprite 09 to the spin jump star.
HammerBrother From older version: More Extended Sprites Link
Predicting bullet hell hacks are comming.
Anas From older version: More Extended Sprites Link
Cool patch! Definitely opens up a lot of potential! By the way, I suggest you overwrite either minor ext. sprite 08 or 09 with the spin jump star’s code rather than the unused Yoshi smoke because the latter is a somewhat practical detail.

Edit: For specificity's sake (citing Yoshifanatic), sprites 08 and 09 are duplicates of the unused music note that apparently is supposed to be spawned by exploding turn blocks but aren't. They technically lead to the same code, so you should make one of the sprites' code point to the spin jump star's code. That way, you neither sacrifice the Yoshi smoke nor the unused music note. You can see more info here: https://smwc.me/1472167
lx5 From older version: More Extended Sprites Link
Cool! I hope people actually read the instructions on this resource.

Also, maybe you could add the patch's description as a standalone readme file? There's none included in the resource and people might not check the instructions you added in this page.