dsr_shape: more

This commit is contained in:
Vince Weaver 2020-06-13 22:56:29 -04:00
parent c887b91db8
commit 76efe95c3d

View File

@ -36,62 +36,65 @@ dsr_demo:
;========================================= ;=========================================
lda #$20 ; clear HGR page0 to white lda #$20 ; 2 ; set HGR page0
sta HGR_PAGE sta HGR_PAGE ; 2
sta XPOS ; 2 ; setup XPOS for future
lda #$ff lda #$ff ; 2
jsr HCLR_COLOR jsr HCLR_COLOR ; 3 ; clear HGR page0 to white
jsr HGR2 ; clear HGR page1 to black jsr HGR2 ; 3 ; set/clear HGR page1 to black
; Hi-res graphics, no text at bottom ; Hi-res graphics, no text at bottom
; Y=0, A=$60 after this call ; Y=0, A=$60 after this call
ldx #1 sty XPOSH ; 2
stx HGR_SCALE sty FRAME ; 2
ldx #30 iny ; 1 ; set shape table scale to 1
stx XPOS sty HGR_SCALE ; 2
lda #0
sta XPOSH ;=========================
sta FRAME ; draw crowd
lda #180 ;=========================
sta YPOS
; XPOS already 32 from earlier
lda #180 ; 2
sta YPOS ; 2
crowd_loop: crowd_loop:
jsr xdraw ; draw jsr xdraw ; 3 ; xdraw on page1
lsr HGR_PAGE ; $40 -> $20 lsr HGR_PAGE ; 2 ; switch to page0 ($40 -> $20)
jsr xdraw ; draw jsr xdraw ; 3 ; xdraw on page 0
asl HGR_PAGE ; $20 -> $40 asl HGR_PAGE ; 2 ; switch back to page1 $20 -> $40
clc ; clc ; carry should always be 0 from asl
lda XPOS lda XPOS ; 2
adc #20 adc #16 ; 2
sta XPOS sta XPOS ; 2
cmp #250 cmp #240 ; 2
bne crowd_loop bcc crowd_loop ; 2
; get ready for DSR loop ; get ready for DSR loop
ldx #<shape_dsr ; point to our shape ldx #<shape_dsr ; 2 ; point to dSr shape
stx shape_smc+1 stx shape_smc+1 ; 3 ; update self-modify code
;========================================= ;=========================================
; OFFSCREEN RESET ; OFFSCREEN RESET
;========================================= ;=========================================
reset_loop: reset_loop:
lda #10 lda #10 ; 2 ; set initial x,y
sta XPOS sta XPOS ; 2
sta YPOS sta YPOS ; 2
lda #2 inc HGR_SCALE ; 2 ; increment scale to 2
sta HGR_SCALE
;========================================= ;=========================================
; MAIN LOOP ; MAIN LOOP
@ -99,19 +102,22 @@ reset_loop:
main_loop: main_loop:
inc rot_smc+1 ; 3
inc rot_smc+1 ; 3
; increment FRAME ; increment FRAME
inc FRAME inc FRAME ; 2
lda FRAME lda FRAME ; 2
and #$f and #$1f ; 2
beq long_frame beq long_frame ; 2
jsr draw_beep jsr draw_beep ; 3
done_frame: done_frame:
inc rot_smc+1
;======================== ;========================
; move dSr ; move dSr
@ -184,10 +190,6 @@ draw_beep:
jmp xdraw ; draw jmp xdraw ; draw
scale_lookup:
;.byte 1,2,3,4,5,4,3,2
shape_person: shape_person:
; Person, shoulders up ; Person, shoulders up