Banner
Views: 944,640,722
Time:
18 users online:  Anorakun, AntiDuck,  DeppySlide, E-man38, Infinity, Kevin,  Lazy, LordDarkScythe, lx5, Mirann, nobletofu, Paperdomo101, Para_0, Raymondsze, Runic_Rain, StackDino, TheRestingBird, Ultima - Guests: 108 - Bots: 73 Users: 52,521 (2,010 active)
Latest: hype366
Tip: If you're patching a BPS/IPS file to a ROM, make sure that your ROM is clean (unmodified) before you patch it. If it's not clean, use ROMclean to fix it.
Not logged in.
help with a 32X32 carryable sprite
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - help with a 32X32 carryable sprite
Pages: « 1 » Link
I'm working in a gimmick that involves a 32x32 carryable sprite, but when Mario takes it from the right, it appears that he takes it from the middle instead. From the left is fine though, I'm not sure what's going on here.

Here's a video so you can see better what happens:

https://www.youtube.com/watch?v=yKOoE2OsTVk

And here's the code I'm using:

Code
dcb "INIT"
LDA #$09			;\ hace al sprite carryable
STA $14C8,x			;/
STZ $1510,x
LDA #$11
STA $C2,x
RTL

dcb "MAIN"

PHB		;\
PHK		; | Change the data bank to the one our code is running from.
PLB		; | This is a good practice.
JSR SPRITECODE	; | Jump to the sprite's function.
PLB		; | Restore old data bank.
RTL		;/ And RETURN.

;===================================
;Sprite Function
;===================================

RETURN: RTS

SPRITECODE:
	JSR GRAPHICS

	LDA $9D				;\
	BNE RETURN			;/ If locked, RETURN.

	JSR SUB_OFF_SCREEN_X0		; Handle offscreen.
	
	;utilizo para cosas internas
	LDA #$11
	STA $C2,x
	
	LDA $14C8,x			
	CMP #$0B			; | revisa si esta siendo carriado
	BEQ Carriado
	
	;si no es carriado la velocidad es 0
	STZ $B6,x
	LDA $AA,x
	CMP #$80
	BMI continuar

	STZ $AA,x
continuar:	
	JSL $01A7DC
			;\ Are we touching Mario
	BCC seguir
	
	LDA $15 ;vemos si esta apretando X o Y
	AND #$40
	BEQ seguir
	
	LDY #$0B			
CheckCarry:			
	LDA $14C8,y			; | revisamos si no esta tomando ningun otro sprite
	CMP #$0B			; |
	BEQ seguir			; |
	DEY				; |
	BPL CheckCarry
	
	LDA #$0B
	STA $14C8,x
	LDA #$01
	STA $1510,x
	
	
seguir:
	
	RTS
	
Carriado:
	;si es carriado y esta tocando piso la velocidad en y
	;de mario es 0
	
	LDA $13EF
	BEQ seguir
	STZ $7D

	JMP seguir

;continue graphics and not important code...


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

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
Did you set the sprite clipping in the .cfg file to be for a 32x32 sprite?
I guess 21 would be a good value

--------------------
Anime statistic on MyAnimeList:
400 animes completed ✓
6000 episodes completed ✓
100 Days completed ✓
... what even am I doing with my life?
I tried, but changing the clipping offset did not work

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

Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
Pages: « 1 » Link
Forum Index - SMW Hacking - SMW Hacking Help - ASM & Related Topics - help with a 32X32 carryable sprite

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

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


Menu

Follow Us On

  • YouTube
  • Twitch
  • Twitter

Affiliates

  • Super Mario Bros. X Community
  • ROMhacking.net
  • Mario Fan Games Galaxy
  • sm64romhacks