dlowres: got sprites sorta working

This commit is contained in:
Vince Weaver 2017-12-06 14:40:21 -05:00
parent ff4f5d4f0c
commit f46567562d
3 changed files with 217 additions and 6 deletions

View File

@ -355,12 +355,16 @@ speed_loop:
;============ ;============
; 45 ; 45
;==================== ;=============================
; Draw the background ; Draw the background_standard
;==================== ;=============================
draw_background: draw_background:
jsr draw_background_mode7_standard ; 6 jsr draw_background_mode7_standard ; 6
jsr draw_background_mode7_aux ; 6
;=============================
; Draw the ship, standard
;=============================
check_over_water: check_over_water:
; See if we are over water ; See if we are over water
@ -544,6 +548,160 @@ no_left_splash:
; 48 ; 48
draw_ship: draw_ship:
lda #CONST_SHIPX ; 2
sta XPOS ; 3
lda SHIPY ; 3
sta YPOS ; 3
jsr put_sprite ; 6
;===========================
; Draw the background, AUX
;===========================
jsr draw_background_mode7_aux ; 6
check_over_water_aux:
no_splash_aux:
;==============
; Draw the ship
;==============
clv ; 2
lda TURNING ; 3
beq draw_ship_forward_aux ; 2nt/3
bpl draw_ship_right_aux ; 2nt/3
bmi draw_ship_left_aux ;; FIXME: optimize order ; 2nt/3
draw_ship_forward_aux:
lda DRAW_SPLASH ; 2
beq no_forward_splash_aux ; 2nt/3
; Draw Splash
lda #>splash_forward_aux ; 2
sta INH ; 3
lda #<splash_forward_aux ; 2
sta INL ; 3
lda #(CONST_SHIPX+1) ; 2
sta XPOS ; 3
clc ; 2
lda SHIPY ; 3
adc #9 ; 2
and #$fe ; make sure it's even ; 2
sta YPOS ; 3
jsr put_sprite ; 6
;==========
; 33
no_forward_splash_aux:
; Draw Shadow
lda #>shadow_forward_aux ; 2
sta INH ; 3
lda #<shadow_forward_aux ; 2
sta INL ; 3
lda #(CONST_SHIPX+3) ; 2
sta XPOS ; 3
clc ; 2
lda SPACEZ_I ; 3
adc #31 ; 2
and #$fe ; make sure it's even ; 2
sta YPOS ; 3
jsr put_sprite ; 6
lda #>ship_forward_aux ; 2
sta INH ; 3
lda #<ship_forward_aux ; 2
sta INL ; 3
bvc draw_ship_aux ; 3
;===========
; 46
draw_ship_right_aux:
lda DRAW_SPLASH ; 3
beq no_right_splash_aux ; 2nt/3
; Draw Splash
lda #>splash_right_aux ; 2
sta INH ; 3
lda #<splash_right_aux ; 2
sta INL ; 3
lda #(CONST_SHIPX+1) ; 2
sta XPOS ; 3
clc ; 2
lda #36 ; 2
sta YPOS ; 3
jsr put_sprite ; 6
;===========
; 28
no_right_splash_aux:
; Draw Shadow
lda #>shadow_right_aux ; 2
sta INH ; 3
lda #<shadow_right_aux ; 2
sta INL ; 3
lda #(CONST_SHIPX+3) ; 2
sta XPOS ; 3
clc ; 2
lda SPACEZ_I ; 3
adc #31 ; 2
and #$fe ; make sure it's even ; 2
sta YPOS ; 3
jsr put_sprite ; 6
lda #>ship_right_aux ; 2
sta INH ; 3
lda #<ship_right_aux ; 2
sta INL ; 3
dec TURNING ; 5
bvc draw_ship_aux ; 3
;==========
; 51
draw_ship_left_aux:
lda DRAW_SPLASH ; 3
beq no_left_splash_aux ; 2nt/3
; Draw Splash
lda #>splash_left_aux ; 2
sta INH ; 3
lda #<splash_left_aux ; 2
sta INL ; 3
lda #(CONST_SHIPX+1) ; 2
sta XPOS ; 3
clc ; 2
lda #36 ; 2
sta YPOS ; 3
jsr put_sprite ; 6
;===========
; 28
no_left_splash_aux:
; Draw Shadow
lda #>shadow_left_aux ; 2
sta INH ; 3
lda #<shadow_left_aux ; 2
sta INL ; 3
lda #(CONST_SHIPX+3) ; 2
sta XPOS ; 3
clc ; 2
lda SPACEZ_I ; 3
adc #31 ; 2
and #$fe ; make sure it's even ; 2
sta YPOS ; 3
jsr put_sprite ; 6
lda #>ship_left_aux ; 2
sta INH ; 3
lda #<ship_left_aux ; 2
sta INL ; 3
inc TURNING ; 5
;==========
; 48
draw_ship_aux:
lda #CONST_SHIPX ; 2 lda #CONST_SHIPX ; 2
sta XPOS ; 3 sta XPOS ; 3
lda SHIPY ; 3 lda SHIPY ; 3

View File

@ -7,32 +7,61 @@ splash_forward:
.byte $00,$ee,$00,$00,$00,$ee,$00 .byte $00,$ee,$00,$00,$00,$ee,$00
.byte $ee,$00,$00,$00,$00,$00,$ee .byte $ee,$00,$00,$00,$00,$00,$ee
splash_forward_aux:
.byte $7,$2
.byte $00,$ee,$00,$00,$00,$ee,$00
.byte $ee,$00,$00,$00,$00,$00,$ee
splash_right: splash_right:
.byte $7,$2 .byte $7,$2
.byte $00,$00,$00,$00,$00,$ee,$00 .byte $00,$00,$00,$00,$00,$ee,$00
.byte $00,$00,$00,$00,$00,$00,$ee .byte $00,$00,$00,$00,$00,$00,$ee
splash_right_aux:
.byte $7,$2
.byte $00,$00,$00,$00,$00,$ee,$00
.byte $00,$00,$00,$00,$00,$00,$ee
splash_left: splash_left:
.byte $7,$2 .byte $7,$2
.byte $00,$ee,$00,$00,$00,$00,$00 .byte $00,$ee,$00,$00,$00,$00,$00
.byte $ee,$00,$00,$00,$00,$00,$00 .byte $ee,$00,$00,$00,$00,$00,$00
splash_left_aux:
.byte $7,$2
.byte $00,$ee,$00,$00,$00,$00,$00
.byte $ee,$00,$00,$00,$00,$00,$00
shadow_forward: shadow_forward:
.byte $3,$2 .byte $3,$2
.byte $00,$aa,$00 .byte $00,$aa,$00
.byte $a0,$aa,$a0 .byte $a0,$aa,$a0
shadow_forward_aux:
.byte $3,$2
.byte $00,$aa,$00
.byte $a0,$aa,$a0
shadow_right: shadow_right:
.byte $3,$2 .byte $3,$2
.byte $a0,$00,$aa .byte $a0,$00,$aa
.byte $00,$0a,$a0 .byte $00,$0a,$a0
shadow_right_aux:
.byte $3,$2
.byte $a0,$00,$aa
.byte $00,$0a,$a0
shadow_left: shadow_left:
.byte $3,$2 .byte $3,$2
.byte $aa,$00,$a0 .byte $aa,$00,$a0
.byte $a0,$0a,$00 .byte $a0,$0a,$00
shadow_left_aux:
.byte $3,$2
.byte $aa,$00,$a0
.byte $a0,$0a,$00
ship_forward: ship_forward:
.byte $9,$5 .byte $9,$5
.byte $00,$00,$00,$00,$ff,$00,$00,$00,$00 .byte $00,$00,$00,$00,$ff,$00,$00,$00,$00
@ -41,6 +70,15 @@ ship_forward:
.byte $f0,$f7,$f7,$f2,$d9,$f2,$f7,$f7,$f0 .byte $f0,$f7,$f7,$f2,$d9,$f2,$f7,$f7,$f0
.byte $00,$00,$00,$00,$0d,$00,$00,$00,$00 .byte $00,$00,$00,$00,$0d,$00,$00,$00,$00
ship_forward_aux:
.byte $9,$5
.byte $00,$00,$00,$00,$ff,$00,$00,$00,$00
.byte $00,$00,$00,$44,$ff,$44,$00,$00,$00
.byte $00,$00,$b0,$1f,$81,$1f,$b0,$00,$00
.byte $f0,$fb,$fb,$f1,$dc,$f1,$fb,$fb,$f0
.byte $00,$00,$00,$00,$0e,$00,$00,$00,$00
ship_right: ship_right:
.byte $9,$5 .byte $9,$5
.byte $00,$00,$00,$00,$00,$60,$60,$f0,$00 .byte $00,$00,$00,$00,$00,$60,$60,$f0,$00
@ -49,6 +87,14 @@ ship_right:
.byte $00,$00,$00,$dd,$d9,$f2,$77,$00,$00 .byte $00,$00,$00,$dd,$d9,$f2,$77,$00,$00
.byte $00,$00,$00,$00,$00,$0f,$ff,$70,$00 .byte $00,$00,$00,$00,$00,$0f,$ff,$70,$00
ship_right_aux:
.byte $9,$5
.byte $00,$00,$00,$00,$00,$60,$60,$f0,$00
.byte $00,$f0,$70,$70,$f6,$f6,$6f,$66,$00
.byte $00,$07,$ff,$2f,$12,$27,$f6,$00,$00
.byte $00,$00,$00,$dd,$d9,$f2,$77,$00,$00
.byte $00,$00,$00,$00,$00,$0f,$ff,$70,$00
ship_left: ship_left:
.byte $9,$5 .byte $9,$5
.byte $00,$f0,$60,$60,$00,$00,$00,$00,$00 .byte $00,$f0,$60,$60,$00,$00,$00,$00,$00
@ -57,4 +103,10 @@ ship_left:
.byte $00,$00,$77,$f2,$d9,$dd,$00,$00,$00 .byte $00,$00,$77,$f2,$d9,$dd,$00,$00,$00
.byte $00,$70,$ff,$0f,$00,$00,$00,$00,$00 .byte $00,$70,$ff,$0f,$00,$00,$00,$00,$00
ship_left_aux:
.byte $9,$5
.byte $00,$f0,$60,$60,$00,$00,$00,$00,$00
.byte $00,$66,$6f,$f6,$f6,$70,$70,$f0,$00
.byte $00,$00,$f6,$27,$12,$2f,$ff,$07,$00
.byte $00,$00,$77,$f2,$d9,$dd,$00,$00,$00
.byte $00,$70,$ff,$0f,$00,$00,$00,$00,$00

View File

@ -376,7 +376,8 @@ put_sprite_loop:
adc XPOS ; add in xpos ; 3 adc XPOS ; add in xpos ; 3
sta OUTL ; store out low byte of addy ; 3 sta OUTL ; store out low byte of addy ; 3
lda gr_offsets+1,Y ; look up high byte ; 5 lda gr_offsets+1,Y ; look up high byte ; 5
adc DRAW_PAGE ; ; 3 adc #0
; adc DRAW_PAGE ; ; 3
sta OUTH ; and store it out ; 3 sta OUTH ; and store it out ; 3
ldy TEMP ; restore sprite pointer ; 3 ldy TEMP ; restore sprite pointer ; 3