ds: add escape sequence

This commit is contained in:
Vince Weaver 2019-10-08 23:04:26 -04:00
parent e1d18a9213
commit a337813409
11 changed files with 5718 additions and 12 deletions

View File

@ -37,7 +37,8 @@ demosplash.o: demosplash.s \
graphics/sprites/alien.inc graphics/sprites/astronaut.inc \
dya_space_demo.pt3 appleII_40_96.inc \
book.s book_40_48d.inc \
missing.s
missing.s \
escape.s
ca65 -o demosplash.o demosplash.s -l demosplash.lst
#####

24
demosplash/asteroid.inc Normal file
View File

@ -0,0 +1,24 @@
; all hard-coded 3x2
asteroid_lookup:
.word asteroid_p1,explode0_p1,explode1_p1,explode2_p1,void_p1
asteroid_p1:
.byte $50,$85,$80
.byte $05,$88,$08
explode0_p1:
.byte $d0,$95,$d0
.byte $0d,$59,$0d
explode1_p1:
.byte $0d,$90,$0d
.byte $d0,$09,$d0
explode2_p1:
.byte $05,$80,$05
.byte $50,$08,$50
void_p1:
.byte $00,$00,$00
.byte $00,$00,$00

View File

@ -60,7 +60,7 @@ demosplash2019:
; missing scene
;===========================
jsr missing_intro
; jsr missing_intro
;===========================
; starbase scene
@ -68,6 +68,12 @@ demosplash2019:
; jsr starbase
;===========================
; escape scene
;===========================
jsr escape
;===========================
; book scene
;===========================
@ -113,6 +119,9 @@ wait_until_keypressed:
; Starbase
.include "starbase.s"
; escape
.include "escape.s"
; book
.include "book.s"

38
demosplash/earth.inc Normal file
View File

@ -0,0 +1,38 @@
earth_low: .byte $28 ; ysize=48
.byte $A0,$FF,$00, $A0,$FF,$00, $A0,$FF,$00, $A0,$27,$00, $50, $00, $30
.byte $08, $A3,$00, $15, $00,$00, $01, $A4,$11, $10
.byte $18, $D5, $50, $05, $00, $01, $05
.byte $18, $00, $8A, $08, $50,$50, $A7,$00, $70
.byte $50, $58, $75, $27,$27, $75, $22, $A3,$00
.byte $55, $50, $00, $15, $89, $81, $11
.byte $51, $05, $51, $91, $01, $00, $55
.byte $11, $40, $01, $05, $11, $00, $55
.byte $05, $55, $50, $55, $A4,$00, $27, $07
.byte $72,$72, $77, $07, $00, $20, $00,$00, $50
.byte $15, $10, $00, $01, $11, $00, $51
.byte $15, $05,$05, $11,$11, $05, $11, $08, $10
.byte $55,$55, $08, $85, $55,$55, $05, $55, $50
.byte $A4,$00, $07, $22, $72, $70, $22,$22, $A4,$00
.byte $44, $11,$11, $00,$00, $11, $91, $11, $88
.byte $15, $11, $19, $50, $15, $11,$11, $01
.byte $80, $55, $08, $00, $A5,$55, $50, $55,$55, $05
.byte $A1
earth_high: .byte $28 ; ysize=48
.byte $A0,$FF,$00, $A0,$FF,$00, $A0,$FF,$00, $A0,$26,$00, $50,$50, $70, $C5
.byte $7A, $22,$22, $88, $48, $88, $55, $0E
.byte $A4,$44, $45, $4A, $F5, $84, $88, $55
.byte $54, $58, $4A, $88, $5A,$5A, $85, $80
.byte $50, $80, $A5,$00, $D0, $F5, $FF, $8F
.byte $F8,$F8, $8F, $88, $22,$22, $55, $88,$88, $85
.byte $48, $5E, $54, $44, $8E, $58, $84
.byte $EE, $54, $88,$88, $44, $95, $54, $88
.byte $EE, $05, $A6,$88, $80,$80, $00, $88, $78
.byte $8F,$8F, $8A, $78, $77, $87, $22,$22, $88
.byte $48,$48, $58, $54, $44, $5A, $84, $48
.byte $58, $D8, $44,$44, $88, $44, $5A, $45
.byte $88,$88, $5A, $58, $88,$88, $58, $A6,$88, $78
.byte $88, $85, $87, $58, $88, $A4,$22, $77
.byte $44,$44, $88, $55, $44, $E4, $44, $5A
.byte $48, $44, $4E, $80, $48, $D4,$D4, $84
.byte $55, $88, $5A, $58, $A9,$88
.byte $A1

1420
demosplash/escape.s Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,75 @@
;=============================================
; put_sprite_fast
;=============================================
; Sprite to display in INH,INL
; Assumes sprite size is 3x2
; Location is SPRITE_XPOS,SPRITE_YPOS
; Note, only works if SPRITE_YPOS is multiple of two
; NO TRANSPARENCY
; 13+ Y*(33+17+X*(18+13) + 5
; 18 + Y*(50+31*X)
; so if 3*2 = 304 cycles??
put_sprite_fast:
ldy #0 ; 2
lda #2 ; ysize is 2 ; 2
sta CV ; ysize is in CV ; 3
lda SPRITE_YPOS ; make a copy of ypos ; 3
sta TEMPY ; as we modify it ; 3
;===========
; 13
put_sprite_loop_fast:
sty TEMP ; save sprite pointer ; 3
ldy TEMPY ; 3
lda gr_offsets,Y ; lookup low-res memory address ; 4
clc ; 2
adc SPRITE_XPOS ; add in xpos ; 3
sta OUTL ; store out low byte of addy ; 3
lda gr_offsets+1,Y ; look up high byte ; 4
adc DRAW_PAGE ; ; 3
sta OUTH ; and store it out ; 3
ldy TEMP ; restore sprite pointer ; 3
; OUTH:OUTL now points at right place
ldx #3 ; load xsize into x ; 2
;===========
; 33
put_sprite_pixel_fast:
lda (INL),Y ; get sprite colors ; 5
iny ; increment sprite pointer ; 2
sty TEMP ; save sprite pointer ; 3
ldy #$0 ; 2
sta (OUTL),Y ; and write it out ; 6
;============
; 18
put_sprite_done_draw_fast:
ldy TEMP ; restore sprite pointer ; 3
inc OUTL ; increment output pointer ; 5
dex ; decrement x counter ; 2
bne put_sprite_pixel_fast ; if not done, keep looping ; 3
;==============
; 13
; -1
inc TEMPY ; each line has two y vars ; 5
inc TEMPY ; 5
dec CV ; decemenet total y count ; 5
bne put_sprite_loop_fast ; loop if not done ; 3
;==============
; 17
; -1
rts ; return ; 6

BIN
demosplash/random.data Normal file

Binary file not shown.

4031
demosplash/sprites_screen.s Normal file

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,34 @@
y_lookup_h:
.byte >(smc032+1),>(smc033+1),>(smc034+1),>(smc035+1),>(smc036+1),>(smc037+1),>(smc038+1),>(smc039+1)
.byte >(smc040+1),>(smc041+1),>(smc042+1),>(smc043+1),>(smc044+1),>(smc045+1),>(smc046+1),>(smc047+1)
.byte >(smc048+1),>(smc049+1),>(smc050+1),>(smc051+1),>(smc052+1),>(smc053+1),>(smc054+1),>(smc055+1)
.byte >(smc056+1),>(smc057+1),>(smc058+1),>(smc059+1),>(smc060+1),>(smc061+1),>(smc062+1),>(smc063+1)
.byte >(smc064+1),>(smc065+1),>(smc066+1),>(smc067+1),>(smc068+1),>(smc069+1),>(smc070+1),>(smc071+1)
.byte >(smc072+1),>(smc073+1),>(smc074+1),>(smc075+1),>(smc076+1),>(smc077+1),>(smc078+1),>(smc079+1)
.byte >(smc080+1),>(smc081+1),>(smc082+1),>(smc083+1),>(smc084+1),>(smc085+1),>(smc086+1),>(smc087+1)
.byte >(smc088+1),>(smc089+1),>(smc090+1),>(smc091+1),>(smc092+1),>(smc093+1),>(smc094+1),>(smc095+1)
.byte >(smc096+1),>(smc097+1),>(smc098+1),>(smc099+1),>(smc100+1),>(smc101+1),>(smc102+1),>(smc103+1)
.byte >(smc104+1),>(smc105+1),>(smc106+1),>(smc107+1),>(smc108+1),>(smc109+1),>(smc110+1),>(smc111+1)
.byte >(smc112+1),>(smc113+1),>(smc114+1),>(smc115+1),>(smc116+1),>(smc117+1),>(smc118+1),>(smc119+1)
.byte >(smc120+1),>(smc121+1),>(smc122+1),>(smc123+1),>(smc124+1),>(smc125+1),>(smc126+1),>(smc127+1)
.byte >(smc128+1),>(smc129+1),>(smc130+1),>(smc131+1),>(smc132+1),>(smc133+1),>(smc134+1),>(smc135+1)
.byte >(smc136+1),>(smc137+1),>(smc138+1),>(smc139+1),>(smc140+1),>(smc141+1),>(smc142+1),>(smc143+1)
.byte >(smc144+1),>(smc145+1),>(smc146+1),>(smc147+1),>(smc148+1),>(smc149+1),>(smc150+1),>(smc151+1)
.byte >(smc152+1),>(smc153+1),>(smc154+1),>(smc155+1),>(smc156+1),>(smc157+1),>(smc158+1),>(smc159+1)
y_lookup_l:
.byte <(smc032+1),<(smc033+1),<(smc034+1),<(smc035+1),<(smc036+1),<(smc037+1),<(smc038+1),<(smc039+1)
.byte <(smc040+1),<(smc041+1),<(smc042+1),<(smc043+1),<(smc044+1),<(smc045+1),<(smc046+1),<(smc047+1)
.byte <(smc048+1),<(smc049+1),<(smc050+1),<(smc051+1),<(smc052+1),<(smc053+1),<(smc054+1),<(smc055+1)
.byte <(smc056+1),<(smc057+1),<(smc058+1),<(smc059+1),<(smc060+1),<(smc061+1),<(smc062+1),<(smc063+1)
.byte <(smc064+1),<(smc065+1),<(smc066+1),<(smc067+1),<(smc068+1),<(smc069+1),<(smc070+1),<(smc071+1)
.byte <(smc072+1),<(smc073+1),<(smc074+1),<(smc075+1),<(smc076+1),<(smc077+1),<(smc078+1),<(smc079+1)
.byte <(smc080+1),<(smc081+1),<(smc082+1),<(smc083+1),<(smc084+1),<(smc085+1),<(smc086+1),<(smc087+1)
.byte <(smc088+1),<(smc089+1),<(smc090+1),<(smc091+1),<(smc092+1),<(smc093+1),<(smc094+1),<(smc095+1)
.byte <(smc096+1),<(smc097+1),<(smc098+1),<(smc099+1),<(smc100+1),<(smc101+1),<(smc102+1),<(smc103+1)
.byte <(smc104+1),<(smc105+1),<(smc106+1),<(smc107+1),<(smc108+1),<(smc109+1),<(smc110+1),<(smc111+1)
.byte <(smc112+1),<(smc113+1),<(smc114+1),<(smc115+1),<(smc116+1),<(smc117+1),<(smc118+1),<(smc119+1)
.byte <(smc120+1),<(smc121+1),<(smc122+1),<(smc123+1),<(smc124+1),<(smc125+1),<(smc126+1),<(smc127+1)
.byte <(smc128+1),<(smc129+1),<(smc130+1),<(smc131+1),<(smc132+1),<(smc133+1),<(smc134+1),<(smc135+1)
.byte <(smc136+1),<(smc137+1),<(smc138+1),<(smc139+1),<(smc140+1),<(smc141+1),<(smc142+1),<(smc143+1)
.byte <(smc144+1),<(smc145+1),<(smc146+1),<(smc147+1),<(smc148+1),<(smc149+1),<(smc150+1),<(smc151+1)
.byte <(smc152+1),<(smc153+1),<(smc154+1),<(smc155+1),<(smc156+1),<(smc157+1),<(smc158+1),<(smc159+1)

59
demosplash/text_print.s Normal file
View File

@ -0,0 +1,59 @@
;================================
; move_and_print
;================================
; get X,Y from OUTL/OUTH
; then print following string to that address
; stop at NUL
; convert to APPLE ASCII (or with 0x80)
; leave OUTL/OUTH pointing to next string
move_and_print:
ldy #0
lda (OUTL),Y
sta CH
iny
lda (OUTL),Y
asl
tay
lda gr_offsets,Y ; lookup low-res memory address
clc
adc CH ; add in xpos
sta BASL ; store out low byte of addy
lda gr_offsets+1,Y ; look up high byte
adc DRAW_PAGE ;
sta BASH ; and store it out
; BASH:BASL now points at right place
clc
lda OUTL
adc #2
sta OUTL
lda OUTH
adc #0
sta OUTH
;================================
; print_string
;================================
print_string:
ldy #0
print_string_loop:
lda (OUTL),Y
beq done_print_string
ora #$80
sta (BASL),Y
iny
bne print_string_loop
done_print_string:
iny
clc
tya
adc OUTL
sta OUTL
lda OUTH
adc #0
sta OUTH
rts

View File

@ -31,16 +31,31 @@ COLOR = $30
SEEDL = $4e
SEEDH = $4f
XMAX = $50
; BEAST_X = $51 ; L1
; BEAST_Y = $52 ; L1
; BEAST_GAIT = $53 ; L1
; BEAST_COUNT = $54 ; L1
; BEAST_STATE = $55
; B_STANDING = $00
; B_RUNNING = $01
; B_FALLING = $02
; B_DEAD = $03
; BEAST_DIRECTION = $56 ; L1
; escape
FRAME = $51
ASTEROID_SPEED = $52
ASTEROID_X = $53
ASTEROID_Y = $54
RANDOM_PTR = $55
GREEN0 = $56
GREEN1 = $57
GREEN2 = $58
GREEN3 = $59
GREEN4 = $5A
FIRE_Y = $5B
SPRITE_XPOS = $5C
SPRITE_YPOS = $5D
BLAST1 = $5E
BLAST2 = $5F
FIRE = $6A
ASTEROID_EXPLODE = $6B
ASTEROID_SUBX = $6C
FIRE_X = $6D
LEVEL_DONE = $6E
YADD = $6F
ZERO = $B0