I've been teaching myself to program custom sprites with the help of the Legacy Sprite Programming tutorial (replacing TRASM syntax and shit for Asar syntax, obviously).
The first practice sprite (a blue mushroom that gives Mario 10 coins, plays the coin sfx, then vanishes) crashes on PIXI, but not in SpriteTool. When I enter the stage that has the custom sprite placed in, the game just crashes.
Here's the code:
Code;=====================
; INIT + MAIN
;=====================
print "INIT ",pc ; Initialization Routine.
RTL ; End Init.
print "MAIN ",pc ; Main routine.
PHB
PHK ; Save old data banks.
PLB ; Load new data bank.
JSR MainCode ; Begin code.
PLB ; Load old data bank.
RTL ; End Main.
;=====================
; CODE
;=====================
Return:
RTS
MainCode:
JSR GFX ; Jump to GFX routine.
LDA $14C8,x
CMP #$08
BNE Return ; If sprite is dead or not in normal state, end code.
LDA $9D
BNE Return ; If sprites are locked, end code.
JSR SUB_OFF_SCREEN_X0 ; Load routine for handling offscreen sprites.
JSL $018032 ; Establish sprite interaction in the sprite.
JSL $01A7DC
BCC NoContact ; If Mario isn't touching the sprite, end code.
LDA #10
STA $13CC ; Add 10 coins
LDA #$01
STA $1DFC ; Play Coin SFX
STZ $14C8,x ; Erase Sprite
NoContact:
RTS ; End Main.
GFX:
JSR GET_DRAW_INFO ; Load routine for graphics drawing.
LDA $00
STA $0300,y
LDA $01
STA $0301,y ; Load Sprite X and Y position into OAM
LDA #$24
STA $0302,y ; Load Mushroom tile
LDA #$06
ORA $64
STA $0303,y ; Load sprite properties
INY
INY
INY
INY
LDY #$02 ; Tile size = 16x16
LDA #$00 ; 1 16x16 tile.
JSL $01B7B3
RTS ; End GFX routine
(GetDrawInfo and SubOffScreen down here)
Also, the new CFG Editor won't let me write anything in the File Pointer other than Hex (00 ~ FF).
I'm not sure if this is from my Win8 install (I have Japanese IME installed and its default language is European Portuguese).
I can circumvent this by proceeding as normal and setting the ASM file name in the .cfg itself or just using an older CFG Editor, but...
I'm gonna stick to SpriteTool for the time being, sorry.
Hack・
Ports・
ASM・
"Uploader"
