The Overworld Design Contest ends in
13 DAYS, 19 HOURS, 38 MINUTES AND 2 SECONDS
 Views: 904,129,260Time: 2021-06-14 12:21:58 AM 14 users online: Alice3173, , , Beeteebee, buckaroodle610, buggy789, Burst Man, chickaDEE Magazine, FYRE150, Hooded Edge, l337f00l, Mario2n3e, MarioSonic4life, TheRealCatsup - Guests: 64 - Bots: 87 Users: 50,688 (2,130 active)Latest: Konecro
 Tip: You can edit the properties of the original sprites using Tweaker. Not logged in.
I need some help finding something in the asm for a sprite
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - I need some help finding something in the asm for a sprite
Where does it determin how many tiles the sliding koopa () will slide before he get's up and starts walking?

http://bin.smwcentral.net/u/20176/Sliding%2BKoopa.asm
That's usually expressed as the number of frames (i.e. a timer), not the number of tiles.

My best guess is this:
Code
```			LDA #\$20		;\ set timer for turning into blue shelless Koopa
STA \$1558,X		;/```

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

Originally posted by WhiteYoshiEgg
That's usually expressed as the number of frames (i.e. a timer), not the number of tiles.

My best guess is this:
Code
```			LDA #\$20		;\ set timer for turning into blue shelless Koopa
STA \$1558,X		;/```

What does LDA and STA mean?
Wow, ok.
STA means Store Accu

You load a value and store it to an address. The sprite later checks that address (timer) and if it's zero, it will turn into a normal koopa.

You just wan to change the value after the LDA #\$ to something else from 00-FF (in hex)
If you don't know what hexadecimal values are, check google or wikipedia.

--------------------
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
I'm pretty sure that timer is how long to wait after it's stopped moving.

This is probably what you want to modify:
Code
```CODE_0389E3:
BPL CODE_0389E9		;\ decelerate sprite
INC !RAM_SpriteSpeedX,x	; |
INC !RAM_SpriteSpeedX,x	; |
CODE_0389E9:
DEC !RAM_SpriteSpeedX,x	;/
RTS```

Deleting the INCs and DECs should make it slide indefinitely. To make it slide longer, you'll probably want to only execute that code on certain frames. This should double it:

Code
```CODE_0389E3:
BPL CODE_0389E9		;\ decelerate sprite
LDA \$14
AND #\$01
BEQ NO_ACCELERATE
INC !RAM_SpriteSpeedX,x	; |
INC !RAM_SpriteSpeedX,x	; |
CODE_0389E9:
LDA \$14
AND #\$01
BEQ NO_ACCELERATE
DEC !RAM_SpriteSpeedX,x	;/
NO_ACCELERATE:
RTS```

As a side note, this sprite has a lot of shenanigans in it. Why would you INC twice and use the DEC to offset that instead of just putting an RTS after the first INC?
Originally posted by Kaijyuu
As a side note, this sprite has a lot of shenanigans in it. Why would you INC twice and use the DEC to offset that instead of just putting an RTS after the first INC?

The code will branch to the DEC if moving a certain direction, but the DEC nullifies one of the INCs in any other case. I do it from time to time if my code doesn't return after the incrementing/decrementing is done, but in this situation where it always returns afterwards, it is a bit of an odd method to use.