Banner
Views: 784,887,863
Time:
4 users online: EddyCartoon, Gamma V,  RussianMan, rvx - Guests: 27 - Bots: 101 Users: 41,042 (1,547 active)
Latest: TouhouShark
Tip: Make a backup of your hack before using any external tools on it.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
Pages: « 1 »
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.
LDA means Load Accumulator
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.



Pages: « 1 »
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - I need some help finding something in the asm for a sprite

The purpose of this site is not to distribute copyrighted material, but to honor one of our favourite games.

Copyright © 2005 - 2019 - SMW Central
Legal Information - Privacy Policy - Link To Us


Total queries: 7

Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Talkhaus
  • SMBX Community
  • GTx0
  • Super Luigi Bros
  • ROMhacking.net
  • MFGG
  • Gaming Reinvented