Language…
10 users online: Dan2point5, fsvgm777, Gasterus155, JPhanto, kirsvantas, nonamelol1, reevebarusadar8, signature_steve, Sokobansolver, tOaO - Guests: 254 - Bots: 287
Users: 64,795 (2,377 active)
Latest user: mathew

SMW Sprite disassembly project

Originally posted by KilloZapit

Woah, that has a lot of data tables. Honestly though, you seem to disassemble a heck of a lot of stuff that I would think would be better left to the original code, like the powerup stuff in the yoshi disassembly. But it is a full disassembly, so yeah.


The goal was to fully disassemble the sprites, so shortcuts were not on my to do list. Almost none of this code is useful to spriters other than maybe some yoshi routines. Beyond that these are just for show so to speak to say that we have them.

EDIT: Finished the bonus game. bonus.asm is sprite 82. This one is fully commented and I will probably submit it later today.
EDIT2: disassembled the bubble sprite. bubble.asm is sprite 9D. This one is not yet commented.
So this is what the mysterious new empty forum section is for... (right?)

Anyway, how do I disassemble a sprite? Do I just take a good look at the ROM in a hex editor, wait for the light bulb to turn on, and start playing with it? (JK) What program do I use?
Re-registered as Roadsguy.
Get all.log from the Tools section, find the code for the sprite you want to disassemble, and fix up the syntax so that it can be assembled and inserted with Spritetool. Commenting the code is optional, but very much preferred.
My YouTube channel
Get the official ASMT resource pack here!

1. How do I find the code? I have no idea what I'm looking for other than the fact that it forms sprites F6 to FF (yeah, I want to do them for my practice even though they crash the game).
2. How do I fix up the syntax too? Do I just copy the code out and isolate it?
Re-registered as Roadsguy.
Originally posted by Roads1
1. How do I find the code?

Originally posted by all.log
CallSpriteInit: A9 08 LDA.B #$08 ; \ Sprite status = Normal
CODE_018174: 9D C8 14 STA.W $14C8,X ; /
CODE_018177: B5 9E LDA RAM_SpriteNum,X
CODE_018179: 22 DF 86 00 JSL.L ExecutePtr

SpriteInitPtr: 75 85 .dw InitStandardSprite ; 00 - Green Koopa, no shell
75 85 .dw InitStandardSprite ; 01 - Red Koopa, no shell
75 85 .dw InitStandardSprite ; 02 - Blue Koopa, no shell
75 85 .dw InitStandardSprite ; 03 - Yellow Koopa, no shell
75 85 .dw InitStandardSprite ; 04 - Green Koopa

[...]
CallSpriteMain: 9C 91 14 STZ.W $1491 ; CallSpriteMain
CODE_0185C6: B5 9E LDA RAM_SpriteNum,X
CODE_0185C8: 22 DF 86 00 JSL.L ExecutePtr

SpriteMainPtr: 04 89 .dw ShellessKoopas ; 00 - Green Koopa, no shell
04 89 .dw ShellessKoopas ; 01 - Red Koopa, no shell
04 89 .dw ShellessKoopas ; 02 - Blue Koopa, no shell
04 89 .dw ShellessKoopas ; 03 - Yellow Koopa, no shell
FC 8A .dw Spr0to13Start ; 04 - Green Koopa

Here's the pointers.

Quote
sprites F6 to FF (yeah, I want to do them for my practice even though they crash the game)

There is no code for them. Using sprite F4 tries reading outside some random table, jumps to a location that is not code, and crashes. Disassemble sprites 12 or 36 instead; they have code pointers.

Quote
2. How do I fix up the syntax too? Do I just copy the code out and isolate it?

Edit it until it assembles.
<blm> zsnes users are the flatearthers of emulation
Does anybody know the what the sprite numbers are for red, blue, and yellow Yoshi's?
They are all 35. You need to set the sprite palette manually.

----------------

I'm working on a hack! Check it out here. Progress: 64/95 levels.
Originally posted by imamelia
They are all 35. You need to set the sprite palette manually.


Like this?:

Code
LDA #$08 ;make yoshi red
STA $13C7


And will this also give the Yoshi's their special powers (red yoshi spits fire if he eats shells, blue yoshi flies when he eats shells, etc.)?
No, you need to set $15F6,x. And it should, but I'm not sure. I've never tried to spawn a Yoshi. There might be more, but I can't seem to find exactly where the original Yoshi-spawning code is. You might look into the code around $01A2BB.

----------------

I'm working on a hack! Check it out here. Progress: 64/95 levels.
Originally posted by imamelia
No, you need to set $15F6,x. And it should, but I'm not sure. I've never tried to spawn a Yoshi. There might be more, but I can't seem to find exactly where the original Yoshi-spawning code is. You might look into the code around $01A2BB.


ROM address $01A2BB is not specified on the ROM map. It is between ROM address $01A2AD and $01A2BC. So where do I go to look into address $01A2BB if it isn't specified on the ROM map?
look at the actual smw source instead of the rom map

aka all.log
In lunar magic, Green Yoshi is included with the Standard Sprites in SP1 and SP2.

But what about the other 3 (red, blue and yellow) Yoshi's? I'm sure anybody could just select a different palette to change Yoshi's color, but what about their special powers (Blue Yoshi can fly when he has a shell in his mouth, Red Yoshi can spit fire when he has a shell in his mouth, Yellow Yoshi can stomp the ground and stun enemies when he has a shell in his mouth)?

Do those other 3 Yoshi's have a sprite number (where both his color and special powers are bundled together) that I could point to to spawn that Yoshi?

Or would I have to manually select that specific Yoshi's palette and attach the ASM for his special powers to the Green Yoshi before I can properly spawn that Yoshi?
Every Yoshi sprite have got the same sprite number. They have only different abilities because the game checks their palette.
^ this

once you set the yoshi's palette you should be good to go regarding abilities.
Why are you even asking this in the disassembly thread in the first place? The ASM help thread would be a much better place for it.
My YouTube channel
Get the official ASMT resource pack here!

Originally posted by yoshicookiezeus
Why are you even asking this in the disassembly thread in the first place? The ASM help thread would be a much better place for it.


Well, I already did here. I just figured maybe this thread would know more about how the assembly (special Yoshi powers ASM, the correct palette to use, etc.) of a Yoshi sprite works.
Well, it's not like people who check this thread are mutually exclusive to people who check the ASM help thread. And besides, by that logic, any question regarding the coding of a sprite in the original game would belong in this thread, which most definitely isn't the case; this thread was just made to organize the claiming of sprites for disassembly.
My YouTube channel
Get the official ASMT resource pack here!

When I try to download 4C Exploding Block, fish/goomba/Koopa/Koopa with shell (X&3), it downloads keyhole instead. Please fix this.
Fixed. I couldn't find the real link, so I just freed it.

I also switched all those direct download links to the description pages, except two broken links which I left alone.
<blm> zsnes users are the flatearthers of emulation