mirror of
https://github.com/robmcmullen/asmgen.git
synced 2025-01-14 09:30:50 +00:00
Added some keyboard debug checking & added debug flag for quicker startup
This commit is contained in:
parent
527cd2226c
commit
83b57cbf7a
@ -43,7 +43,7 @@ cpbg-sprite-driver.s: HiSprite.py $(BWSPRITE)
|
|||||||
python HiSprite.py -a mac65 -p 6502 -s hgrbw -m -k -d -g -f fatfont128.dat -o cpbg $(BWSPRITE) $(COLORSPRITE)
|
python HiSprite.py -a mac65 -p 6502 -s hgrbw -m -k -d -g -f fatfont128.dat -o cpbg $(BWSPRITE) $(COLORSPRITE)
|
||||||
|
|
||||||
cpbg.dsk: HiSprite.py cpbg.s cpbg-sprite-driver.s
|
cpbg.dsk: HiSprite.py cpbg.s cpbg-sprite-driver.s
|
||||||
atasm -ocpbg.xex cpbg.s -Lcpbg.var -gcpbg.lst
|
atasm -mae -ocpbg.xex cpbg.s -Lcpbg.var -gcpbg.lst
|
||||||
#atrcopy cpbg.dsk boot -d partycrasher-software.hgr@2000 player-missile.hgr@4000 -b cpbg.xex --brun 6000 -f
|
#atrcopy cpbg.dsk boot -d partycrasher-software.hgr@2000 player-missile.hgr@4000 -b cpbg.xex --brun 6000 -f
|
||||||
atrcopy cpbg.dsk boot -b cpbg.xex --brun 6000 -f
|
atrcopy cpbg.dsk boot -b cpbg.xex --brun 6000 -f
|
||||||
|
|
||||||
|
67
cpbg.s
67
cpbg.s
@ -1,4 +1,6 @@
|
|||||||
; os memory map
|
; os memory map
|
||||||
|
KEYBOARD = $c000
|
||||||
|
KBDSTROBE = $c010
|
||||||
CLRTEXT = $c050
|
CLRTEXT = $c050
|
||||||
SETTEXT = $c051
|
SETTEXT = $c051
|
||||||
CLRMIXED = $c052
|
CLRMIXED = $c052
|
||||||
@ -31,6 +33,7 @@ scratch_ptr .ds 2
|
|||||||
scratch_0 .ds 1
|
scratch_0 .ds 1
|
||||||
scratch_1 .ds 1
|
scratch_1 .ds 1
|
||||||
scratch_index .ds 1
|
scratch_index .ds 1
|
||||||
|
scratch_count .ds 1
|
||||||
scratch_col .ds 1
|
scratch_col .ds 1
|
||||||
|
|
||||||
*= $0020
|
*= $0020
|
||||||
@ -59,13 +62,16 @@ temprow .ds 1
|
|||||||
tempcol .ds 1
|
tempcol .ds 1
|
||||||
|
|
||||||
|
|
||||||
DAMAGEPAGE1 = $bf ; page number of first byte beyond top of backing store stack
|
|
||||||
DAMAGEPAGE2 = $be
|
|
||||||
|
|
||||||
; constants
|
; constants
|
||||||
|
|
||||||
|
DAMAGEPAGE1 = $bf ; page number of damage list for screen 1
|
||||||
|
DAMAGEPAGE2 = $be ; "" for screen 2
|
||||||
MAXPOSX = 250
|
MAXPOSX = 250
|
||||||
MAXPOSY = 192 - 16
|
MAXPOSY = 192 - 16
|
||||||
|
|
||||||
|
; debug flags
|
||||||
|
DEBUG_BACKGROUND = 0
|
||||||
|
|
||||||
|
|
||||||
*= $6000
|
*= $6000
|
||||||
|
|
||||||
@ -75,7 +81,6 @@ start
|
|||||||
bit TXTPAGE2
|
bit TXTPAGE2
|
||||||
bit SETHIRES
|
bit SETHIRES
|
||||||
|
|
||||||
jsr clrscr
|
|
||||||
jsr initonce
|
jsr initonce
|
||||||
jsr initsprites
|
jsr initsprites
|
||||||
jsr initbackground
|
jsr initbackground
|
||||||
@ -83,20 +88,51 @@ start
|
|||||||
gameloop
|
gameloop
|
||||||
jsr renderstart
|
jsr renderstart
|
||||||
jsr pageflip
|
jsr pageflip
|
||||||
|
jsr userinput
|
||||||
jsr movestart
|
jsr movestart
|
||||||
dec fasttoggle
|
|
||||||
bpl gofast
|
|
||||||
jsr wait
|
|
||||||
gofast
|
|
||||||
jsr restorebg_driver
|
jsr restorebg_driver
|
||||||
jmp gameloop
|
jmp gameloop
|
||||||
|
|
||||||
fasttoggle
|
userinput
|
||||||
.byte 0
|
lda KEYBOARD
|
||||||
|
bmi ?1
|
||||||
|
rts
|
||||||
|
?1
|
||||||
|
sta KBDSTROBE
|
||||||
|
cmp #$80 + 32
|
||||||
|
beq input_space
|
||||||
|
cmp #$80 + '.'
|
||||||
|
beq input_period
|
||||||
|
cmp #$80 + 'P'
|
||||||
|
beq input_period
|
||||||
|
rts
|
||||||
|
|
||||||
|
input_space
|
||||||
|
jmp debugflipscreens
|
||||||
|
|
||||||
|
input_period
|
||||||
|
lda KEYBOARD
|
||||||
|
bpl input_period
|
||||||
|
cmp #$80 + 'P'
|
||||||
|
beq input_period
|
||||||
|
rts
|
||||||
|
|
||||||
|
debugflipscreens
|
||||||
|
lda #20
|
||||||
|
sta scratch_count
|
||||||
|
debugloop
|
||||||
|
jsr pageflip
|
||||||
|
jsr wait
|
||||||
|
jsr pageflip
|
||||||
|
jsr wait
|
||||||
|
dec scratch_count
|
||||||
|
bne debugloop
|
||||||
|
rts
|
||||||
|
|
||||||
|
|
||||||
initonce
|
initonce
|
||||||
lda #0
|
lda #0
|
||||||
|
sta KBDSTROBE
|
||||||
sta drawpage
|
sta drawpage
|
||||||
sta damageindex1
|
sta damageindex1
|
||||||
sta damageindex2
|
sta damageindex2
|
||||||
@ -116,6 +152,7 @@ initsprites
|
|||||||
|
|
||||||
initbackground
|
initbackground
|
||||||
jsr filltext
|
jsr filltext
|
||||||
|
.if DEBUG_BACKGROUND
|
||||||
jsr pageflip
|
jsr pageflip
|
||||||
bit TXTPAGE1
|
bit TXTPAGE1
|
||||||
jsr copytexthgr
|
jsr copytexthgr
|
||||||
@ -124,6 +161,7 @@ initbackground
|
|||||||
jsr copytexthgrslow
|
jsr copytexthgrslow
|
||||||
jsr copytexthgr
|
jsr copytexthgr
|
||||||
jsr pageflip
|
jsr pageflip
|
||||||
|
.endif
|
||||||
jsr copytexthgr
|
jsr copytexthgr
|
||||||
rts
|
rts
|
||||||
|
|
||||||
@ -257,6 +295,7 @@ restorebg_init
|
|||||||
|
|
||||||
restorebg_driver
|
restorebg_driver
|
||||||
; copy damaged characters back to screen
|
; copy damaged characters back to screen
|
||||||
|
jsr copytexthgr
|
||||||
rts
|
rts
|
||||||
|
|
||||||
|
|
||||||
@ -444,6 +483,7 @@ clr2
|
|||||||
cpx #$40
|
cpx #$40
|
||||||
bcc clr1
|
bcc clr1
|
||||||
|
|
||||||
|
.if DEBUG_BACKGROUND
|
||||||
; put the same info on both screens
|
; put the same info on both screens
|
||||||
clrscr2
|
clrscr2
|
||||||
ldy #1
|
ldy #1
|
||||||
@ -496,6 +536,9 @@ bothalf
|
|||||||
.byte $88, ~11010101, ~10101010, ~11010101, ~10101010, ~11010101
|
.byte $88, ~11010101, ~10101010, ~11010101, ~10101010, ~11010101
|
||||||
.byte $08, ~10101010, ~11010101, ~10101010, ~11010101, ~10101010
|
.byte $08, ~10101010, ~11010101, ~10101010, ~11010101, ~10101010
|
||||||
|
|
||||||
|
.else ; !DEBUG_BACKGROUND
|
||||||
|
rts
|
||||||
|
.endif
|
||||||
|
|
||||||
|
|
||||||
; Sprite data is interleaved so a simple indexed mode can be used. This is not
|
; Sprite data is interleaved so a simple indexed mode can be used. This is not
|
||||||
@ -522,13 +565,13 @@ sprite_y
|
|||||||
.byte 116, 126, 40, 60, 80, 100, 120, 140
|
.byte 116, 126, 40, 60, 80, 100, 120, 140
|
||||||
|
|
||||||
sprite_dx
|
sprite_dx
|
||||||
.byte 1, 2, 3, 4, 1, 2, 3, 4
|
.byte 1, 2, 3, 4, 1, 2, 0, 1
|
||||||
|
|
||||||
sprite_dirx
|
sprite_dirx
|
||||||
.byte -1, -1, -1, -1, 1, 1, 1, 1
|
.byte -1, -1, -1, -1, 1, 1, 1, 1
|
||||||
|
|
||||||
sprite_dy
|
sprite_dy
|
||||||
.byte 4, 3, 2, 1, 4, 3, 2, 1
|
.byte 4, 3, 2, 1, 4, 3, 1, 0
|
||||||
|
|
||||||
sprite_diry
|
sprite_diry
|
||||||
.byte 1, 1, 1, 1, -1, -1, -1, -1
|
.byte 1, 1, 1, 1, -1, -1, -1, -1
|
||||||
|
Loading…
x
Reference in New Issue
Block a user