mirror of
https://github.com/deater/dos33fsprogs.git
synced 2024-06-27 07:29:29 +00:00
dsr_shape: more work
This commit is contained in:
parent
5cdfe2067e
commit
d1968bbe21
|
@ -2,6 +2,8 @@
|
||||||
; by Deater for -=dSr=-
|
; by Deater for -=dSr=-
|
||||||
; @party 2020
|
; @party 2020
|
||||||
|
|
||||||
|
; 252 bytes
|
||||||
|
|
||||||
; zero page locations
|
; zero page locations
|
||||||
HGR_SHAPE = $1A
|
HGR_SHAPE = $1A
|
||||||
SEEDL = $4E
|
SEEDL = $4E
|
||||||
|
@ -118,7 +120,7 @@ main_loop:
|
||||||
and #$1f ; 2
|
and #$1f ; 2
|
||||||
beq long_frame ; 2
|
beq long_frame ; 2
|
||||||
|
|
||||||
ldy #15 ; 2
|
lda #15 ; 2
|
||||||
jsr draw_and_beep ; 3
|
jsr draw_and_beep ; 3
|
||||||
|
|
||||||
done_frame:
|
done_frame:
|
||||||
|
@ -127,18 +129,38 @@ done_frame:
|
||||||
; move dSr
|
; move dSr
|
||||||
;========================
|
;========================
|
||||||
|
|
||||||
lda YPOS
|
inc YPOS ; 2
|
||||||
adc #2
|
inc YPOS ; 2
|
||||||
sta YPOS
|
inc YPOS ; 2
|
||||||
|
|
||||||
|
lda XPOS ; 2
|
||||||
|
adc #5 ; 2
|
||||||
|
sta XPOS ; 2
|
||||||
|
|
||||||
lda XPOS
|
|
||||||
adc #5
|
|
||||||
sta XPOS
|
|
||||||
cmp #250
|
cmp #250
|
||||||
bcs reset_loop
|
bcs reset_loop
|
||||||
bcc main_loop
|
bcc main_loop
|
||||||
|
|
||||||
|
|
||||||
|
shape_person:
|
||||||
|
; Person, shoulders up
|
||||||
|
|
||||||
|
;.byte $01,$00,$04,$00,
|
||||||
|
.byte $2d,$25,$3c,$24
|
||||||
|
.byte $2c,$2c,$35,$37,$6f,$25,$16,$3f
|
||||||
|
.byte $77,$2d,$1e,$37,$2d,$2d,$15,$3f
|
||||||
|
.byte $3f,$3f,$3f,$3f,$07,$00
|
||||||
|
|
||||||
|
shape_arm:
|
||||||
|
.byte $49,$49,$49,$24
|
||||||
|
.byte $24,$24,$ac,$36,$36,$36,$00
|
||||||
|
|
||||||
|
shape_dsr:
|
||||||
|
.byte $2d,$36,$ff,$3f
|
||||||
|
.byte $24,$ad,$22,$24,$94,$21,$2c,$4d
|
||||||
|
.byte $91,$3f,$36,$00
|
||||||
|
|
||||||
|
|
||||||
;===========================
|
;===========================
|
||||||
; long frame
|
; long frame
|
||||||
;===========================
|
;===========================
|
||||||
|
@ -177,7 +199,7 @@ skip_arm:
|
||||||
asl ; 1 ; make twice as big
|
asl ; 1 ; make twice as big
|
||||||
sta HGR_SCALE ; 2
|
sta HGR_SCALE ; 2
|
||||||
|
|
||||||
ldy #85 ; 2 ; long tone
|
lda #85 ; 2 ; long tone
|
||||||
jsr draw_and_beep ; 3 ; draw and beep
|
jsr draw_and_beep ; 3 ; draw and beep
|
||||||
|
|
||||||
bit PAGE1 ; 3 ; display page back to page1
|
bit PAGE1 ; 3 ; display page back to page1
|
||||||
|
@ -187,8 +209,7 @@ skip_arm:
|
||||||
asl HGR_PAGE ; 2 ; switch draw page to page1
|
asl HGR_PAGE ; 2 ; switch draw page to page1
|
||||||
|
|
||||||
|
|
||||||
bpl done_frame ; 2 ; return (can make 2 if can guarantee)
|
bpl done_frame ; 2 ; return
|
||||||
; a flag value?
|
|
||||||
|
|
||||||
|
|
||||||
;=======================
|
;=======================
|
||||||
|
@ -216,60 +237,50 @@ rot_smc:
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
shape_person:
|
|
||||||
; Person, shoulders up
|
|
||||||
|
|
||||||
;.byte $01,$00,$04,$00,
|
|
||||||
.byte $2d,$25,$3c,$24
|
|
||||||
.byte $2c,$2c,$35,$37,$6f,$25,$16,$3f
|
|
||||||
.byte $77,$2d,$1e,$37,$2d,$2d,$15,$3f
|
|
||||||
.byte $3f,$3f,$3f,$3f,$07,$00
|
|
||||||
|
|
||||||
shape_arm:
|
|
||||||
.byte $49,$49,$49,$24
|
|
||||||
.byte $24,$24,$ac,$36,$36,$36,$00
|
|
||||||
|
|
||||||
shape_dsr:
|
|
||||||
.byte $2d,$36,$ff,$3f
|
|
||||||
.byte $24,$ad,$22,$24,$94,$21,$2c,$4d
|
|
||||||
.byte $91,$3f,$36,$00
|
|
||||||
|
|
||||||
;==========================
|
;==========================
|
||||||
; draw/beep/undraw
|
; draw/beep/undraw
|
||||||
;==========================
|
;==========================
|
||||||
draw_and_beep:
|
draw_and_beep:
|
||||||
|
|
||||||
sty tone_smc+1 ; 3
|
pha
|
||||||
|
|
||||||
|
; sty tone_smc+1 ; 3
|
||||||
|
|
||||||
jsr xdraw ; 3
|
jsr xdraw ; 3
|
||||||
|
|
||||||
|
; check for keypress
|
||||||
|
lda KEYPRESS ; 3 ; see if key pressed
|
||||||
|
bmi exit_to_prompt ; 2 ; loop if not
|
||||||
|
|
||||||
;===========================
|
;===========================
|
||||||
; BEEP (inlined)
|
; BEEP (inlined)
|
||||||
;===========================
|
;===========================
|
||||||
beep:
|
beep:
|
||||||
lda FRAME ; 2 ; only play tone every 4th frame
|
|
||||||
and #$3 ; 2
|
|
||||||
beq actual_beep ; 2
|
|
||||||
|
|
||||||
nobeep:
|
|
||||||
lda #100 ; 2
|
|
||||||
jsr WAIT ; 3
|
|
||||||
beq check_finished ; 2 (A always 0 after WAIT)
|
|
||||||
|
|
||||||
actual_beep:
|
actual_beep:
|
||||||
; BEEP
|
; BEEP
|
||||||
; repeat 30 times
|
; repeat 30 times
|
||||||
ldx #30 ; 2
|
ldx #30 ; 2
|
||||||
|
pla
|
||||||
|
tay
|
||||||
|
|
||||||
tone1_loop:
|
tone1_loop:
|
||||||
|
|
||||||
tone_smc:
|
tone_smc:
|
||||||
|
|
||||||
lda #15
|
; lda #15
|
||||||
|
tya
|
||||||
jsr WAIT ; 3 ; not as accurate as the cycle count
|
jsr WAIT ; 3 ; not as accurate as the cycle count
|
||||||
; method before, but saves a few bytes
|
; method before, but saves a few bytes
|
||||||
|
|
||||||
bit SPEAKER ; 3 ; click speaker
|
lda FRAME ; 2 ; only play tone every 4th frame
|
||||||
|
and #$3 ; 2
|
||||||
|
bne no_click ; 2
|
||||||
|
|
||||||
|
bit SPEAKER ; 3 ; click speaker
|
||||||
|
no_click:
|
||||||
dex ; 1
|
dex ; 1
|
||||||
bne tone1_loop ; 2
|
bne tone1_loop ; 2
|
||||||
|
|
||||||
|
@ -283,14 +294,14 @@ tone_smc:
|
||||||
|
|
||||||
check_finished:
|
check_finished:
|
||||||
lda FRAME ; 2 ; end with big dSr
|
lda FRAME ; 2 ; end with big dSr
|
||||||
bne xdraw ; 2 ; draw
|
bne xdraw ; 2 ; xdraw
|
||||||
|
|
||||||
;==================================
|
;==================================
|
||||||
; exit to basic
|
; exit to basic
|
||||||
wait_until_keypress:
|
wait_until_keypress:
|
||||||
lda KEYPRESS ; 3 ; see if key pressed
|
lda KEYPRESS ; 3 ; see if key pressed
|
||||||
bpl wait_until_keypress ; 2 ; loop if not
|
bpl wait_until_keypress ; 2 ; loop if not
|
||||||
; bit KEYRESET
|
; bit KEYRESET ; clear keyboard buffer
|
||||||
exit_to_prompt:
|
exit_to_prompt:
|
||||||
jsr TEXT ; 3 ; return to text mode
|
jsr TEXT ; 3 ; return to text mode
|
||||||
jmp $3D0 ; 3 ; return to Applesoft prompt
|
jmp $3D0 ; 3 ; return to Applesoft prompt
|
||||||
|
|
Loading…
Reference in New Issue
Block a user