mirror of
https://github.com/jeremysrand/colourgo.git
synced 2025-01-09 09:33:29 +00:00
Some final cleanup before I break thing thoroughly to try to add some levels with real grid layout.
This commit is contained in:
parent
7871fd9a80
commit
015daf9ac1
@ -14,10 +14,6 @@
|
|||||||
.include "apple2.inc"
|
.include "apple2.inc"
|
||||||
|
|
||||||
|
|
||||||
COUT = $fded
|
|
||||||
KEYBOARD = $c000
|
|
||||||
STROBE = $c010
|
|
||||||
|
|
||||||
MAXY=191
|
MAXY=191
|
||||||
MAXXBYTE=40
|
MAXXBYTE=40
|
||||||
MAXX=280
|
MAXX=280
|
||||||
@ -28,6 +24,10 @@ ZPADDR2=<$84
|
|||||||
ZPADDR3=<$86
|
ZPADDR3=<$86
|
||||||
ZPADDR4=<$88
|
ZPADDR4=<$88
|
||||||
ZPADDR5=<$8a
|
ZPADDR5=<$8a
|
||||||
|
ZPADDR6=<$8c
|
||||||
|
ZPADDR7=<$8e
|
||||||
|
|
||||||
|
LEVELADDR=<$90
|
||||||
|
|
||||||
COL_BLACK=0
|
COL_BLACK=0
|
||||||
COL_VIOLET=1
|
COL_VIOLET=1
|
||||||
@ -37,6 +37,7 @@ COL_WHITE=3
|
|||||||
CHAR_HEIGHT=10
|
CHAR_HEIGHT=10
|
||||||
NUM_CHAR_BITMAPS=3
|
NUM_CHAR_BITMAPS=3
|
||||||
CHAR_MAX_JUMPS=2
|
CHAR_MAX_JUMPS=2
|
||||||
|
CHAR_XPOS=2
|
||||||
|
|
||||||
CHAR_STATE_NONE=0
|
CHAR_STATE_NONE=0
|
||||||
CHAR_STATE_JUMPING=1
|
CHAR_STATE_JUMPING=1
|
||||||
@ -45,7 +46,10 @@ CHAR_STATE_FALLING=2
|
|||||||
JUMP_SPEED=$FF-4
|
JUMP_SPEED=$FF-4
|
||||||
GRAVITY=64
|
GRAVITY=64
|
||||||
|
|
||||||
GRID_YPOS=150
|
GRID_YPOS=140
|
||||||
|
GRID_HEIGHT=5
|
||||||
|
|
||||||
|
LEVEL_GRID_SIZE=5
|
||||||
|
|
||||||
LINE0 = $2000
|
LINE0 = $2000
|
||||||
LINE1 = LINE0 + 1024
|
LINE1 = LINE0 + 1024
|
||||||
@ -429,7 +433,7 @@ lastButtonState: .BYTE $00
|
|||||||
|
|
||||||
|
|
||||||
.proc updateCharacterColour
|
.proc updateCharacterColour
|
||||||
lda KEYBOARD
|
lda KBD
|
||||||
bpl @L1
|
bpl @L1
|
||||||
cmp #$9b ; Compare to Escape
|
cmp #$9b ; Compare to Escape
|
||||||
beq @L2
|
beq @L2
|
||||||
@ -438,7 +442,7 @@ lastButtonState: .BYTE $00
|
|||||||
cmp #$f1 ; Compare to 'q'
|
cmp #$f1 ; Compare to 'q'
|
||||||
beq @L2
|
beq @L2
|
||||||
|
|
||||||
lda STROBE
|
lda KBDSTRB
|
||||||
lda characterColour
|
lda characterColour
|
||||||
cmp #COL_VIOLET
|
cmp #COL_VIOLET
|
||||||
beq @L3
|
beq @L3
|
||||||
@ -451,7 +455,7 @@ lastButtonState: .BYTE $00
|
|||||||
jmp @L1
|
jmp @L1
|
||||||
|
|
||||||
@L2:
|
@L2:
|
||||||
lda STROBE
|
lda KBDSTRB
|
||||||
lda #$01
|
lda #$01
|
||||||
sta shouldQuit
|
sta shouldQuit
|
||||||
|
|
||||||
@ -483,7 +487,7 @@ lastButtonState: .BYTE $00
|
|||||||
lda page1HiAddrs,x
|
lda page1HiAddrs,x
|
||||||
sta ZPADDR0+1
|
sta ZPADDR0+1
|
||||||
|
|
||||||
ldy #2
|
ldy #CHAR_XPOS
|
||||||
lda #0
|
lda #0
|
||||||
sta (ZPADDR0),y
|
sta (ZPADDR0),y
|
||||||
iny
|
iny
|
||||||
@ -503,7 +507,7 @@ lastButtonState: .BYTE $00
|
|||||||
sta ZPADDR0+1
|
sta ZPADDR0+1
|
||||||
sty yPos
|
sty yPos
|
||||||
|
|
||||||
ldy #2
|
ldy #CHAR_XPOS
|
||||||
lda evenVal
|
lda evenVal
|
||||||
and (ZPADDR1,x)
|
and (ZPADDR1,x)
|
||||||
sta (ZPADDR0),y
|
sta (ZPADDR0),y
|
||||||
@ -512,7 +516,7 @@ lastButtonState: .BYTE $00
|
|||||||
inc ZPADDR1+1
|
inc ZPADDR1+1
|
||||||
|
|
||||||
@L2:
|
@L2:
|
||||||
ldy #3
|
iny
|
||||||
lda oddVal
|
lda oddVal
|
||||||
and (ZPADDR1,x)
|
and (ZPADDR1,x)
|
||||||
sta (ZPADDR0),y
|
sta (ZPADDR0),y
|
||||||
@ -537,13 +541,13 @@ yPos: .BYTE $00
|
|||||||
|
|
||||||
|
|
||||||
.proc updateGrid
|
.proc updateGrid
|
||||||
ldx gridXPos
|
ldx gridXShift
|
||||||
inx
|
inx
|
||||||
cpx #7
|
cpx #7
|
||||||
bne @L1
|
bne @L1
|
||||||
ldx #0
|
ldx #0
|
||||||
@L1:
|
@L1:
|
||||||
stx gridXPos
|
stx gridXShift
|
||||||
rts
|
rts
|
||||||
.endproc
|
.endproc
|
||||||
|
|
||||||
@ -585,7 +589,7 @@ yPos: .BYTE $00
|
|||||||
lda page1HiAddrs,y
|
lda page1HiAddrs,y
|
||||||
sta ZPADDR5+1
|
sta ZPADDR5+1
|
||||||
|
|
||||||
ldx gridXPos
|
ldx gridXShift
|
||||||
ldy gridColour
|
ldy gridColour
|
||||||
lda colourEvenLookup,y
|
lda colourEvenLookup,y
|
||||||
sta evenVal
|
sta evenVal
|
||||||
@ -808,7 +812,31 @@ characterYSpeedFrac: .BYTE $00
|
|||||||
|
|
||||||
gridColour: .BYTE COL_VIOLET
|
gridColour: .BYTE COL_VIOLET
|
||||||
gridY: .BYTE GRID_YPOS
|
gridY: .BYTE GRID_YPOS
|
||||||
|
gridXShift: .BYTE $00
|
||||||
gridXPos: .BYTE $00
|
gridXPos: .BYTE $00
|
||||||
|
|
||||||
shouldQuit: .BYTE $00
|
shouldQuit: .BYTE $00
|
||||||
|
|
||||||
|
level: .BYTE $00
|
||||||
|
|
||||||
|
; A level consists of the following for each grid:
|
||||||
|
; Byte 1 - Offset of the start of this grid from the previous grid's start
|
||||||
|
; Byte 2 - Grid width
|
||||||
|
; Byte 3 - Grid top
|
||||||
|
; Byte 4 - Grid bottom
|
||||||
|
; Byte 5 - Grid colour
|
||||||
|
; The end of a level has a grid width of 0
|
||||||
|
level1:
|
||||||
|
.BYTE $00, 100, 140, 140+GRID_HEIGHT, COL_VIOLET
|
||||||
|
.BYTE $00, $00, $00, $00, $00
|
||||||
|
|
||||||
|
level2:
|
||||||
|
.BYTE $00, 100, 140, 140+GRID_HEIGHT, COL_VIOLET
|
||||||
|
.BYTE $00, $00, $00, $00, $00
|
||||||
|
|
||||||
|
levelsLo:
|
||||||
|
.LOBYTES level1, level2, 0
|
||||||
|
|
||||||
|
levelsHi:
|
||||||
|
.HIBYTES level1, level2, 0
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user