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:
------------------------------------------------------
Youtube
Twitter
SMWControlLibX GitHub
My Discord Server
Snestorage where you can download my resources
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
SMWControlLibX GitHub
My Discord Server
Snestorage where you can download my resources