looks like this is going nowhere productive, so let me try and ask something else. I made this special version of the creating eating block that not only allows me to choose what direction to go in but also what tile to generate. The structure of it looks more or less like this:
Code: Select all
MAP16_NUMY db $03,$04,$05,$06,$00,$03,$04,$05,$06
X_SPEED dcb $10,$F0,$00,$00,$00,$10,$F0,$00,$00
Y_SPEED dcb $00,$00,$10,$F0,$00,$00,$00,$10,$F0
DIRECTION dcb $00,$00,$01,$00,$02,$00,$00,$00,$03,$00,$00[/size]
Code: Select all
LDA X_SPEED,y ; \ set x speed
STA $B6,x ; /
LDA Y_SPEED,y ; \ set y speed
STA $AA,x ; /
LDA MAP16_NUMY,y ; \ set direction-based tile-gen table
STA $185E ; / for Block1 code later (done while y is still correct)
Code: Select all
BLOCK1 ;block chosen to gen already selected when sprite speed was set
LDA $185E ;choosing tile to generate from table
STA $9C ;
LDA $E4,x ;sprite xpos low (table)
STA $9A ;blockgen xpos of contact low
LDA $14E0,x ;sprite xpos high (table)
STA $9B ;blockgen xpos of contact high
LDA $D8,x ;sprite ypos low (table)
STA $98 ;blockgen ypos of contact low
LDA $14D4,x ;sprite ypos high (table)
STA $99 ;blockgen ypos of contact high
JSL $00BEB0 ; generate Map16 tile routine
RTS
BLOCK2 LDA #$02 ;
STA $185E ; tile from map16
LDA $185E ;choosing tile to generate from table
STA $9C ;
LDA $E4,x ;sprite xpos low (table)
STA $9A ;blockgen xpos of contact low
LDA $14E0,x ;sprite xpos high (table)
STA $9B ;blockgen xpos of contact high
LDA $D8,x ;sprite ypos low (table)
STA $98 ;blockgen ypos of contact low
LDA $14D4,x ;sprite ypos high (table)
STA $99 ;blockgen ypos of contact high
JSL $00BEB0 ; generate Map16 tile routine
RTS
and that doesn't work with what I did at all. how do I fix this?GENERATE ARBITRARY MAP16 TILE
Code: Select all
LDA.b #$FF STA.b $9C ;;STORE YOUR 16-BIT BLOCK NUMBER into $0660/1 JSL $00BEB0