initial commit
This commit is contained in:
@@ -0,0 +1,111 @@
|
||||
; -----------------------------------------------------------
|
||||
; main.asm - RABBIT SCOOTER for the C64
|
||||
; port of the rabbitroller Game & Watch style LCD game:
|
||||
; rabbits hop toward you on a five-lane road, dodge them
|
||||
; on your scooter - a rabbit reaching your lane is a miss,
|
||||
; one passing in another lane is a point; 3 misses = over
|
||||
;
|
||||
; Files:
|
||||
; defs.asm - constants, zero page, macros
|
||||
; title.asm - title screen: demo rabbits + press fire
|
||||
; play.asm - the game itself
|
||||
; over.asm - game over box + retry
|
||||
; common.asm - shared routines, input, rabbit positioning
|
||||
; tables.asm - perspective / speed tables (assembly-time)
|
||||
; sprites.asm - sprite art (scooter, small + big rabbits)
|
||||
;
|
||||
; Build: acme -f cbm -o rabbit.prg main.asm
|
||||
; -----------------------------------------------------------
|
||||
|
||||
!to "rabbit.prg", cbm
|
||||
|
||||
* = $0801
|
||||
|
||||
; ---- BASIC stub: 10 SYS 2064 ----
|
||||
; so after LOAD"*",8,1 it's enough to type RUN
|
||||
!byte $0c, $08 ; address of next line
|
||||
!byte $0a, $00 ; line number: 10
|
||||
!byte $9e ; SYS token
|
||||
!byte $20, $32, $30, $36, $34 ; " 2064"
|
||||
!byte $00 ; end of line
|
||||
!byte $00, $00 ; end of program
|
||||
|
||||
* = $0810 ; = 2064 in decimal
|
||||
|
||||
!src "defs.asm"
|
||||
|
||||
start:
|
||||
sei ; no KERNAL IRQ - raster polling must not jitter
|
||||
|
||||
; LCD look: black bezel border, pale screen, black artwork
|
||||
lda #BLACK
|
||||
sta BORDER
|
||||
lda #LGREY
|
||||
sta BG
|
||||
|
||||
; sprites: all black, hires, in front of the characters
|
||||
ldx #7
|
||||
sprcol:
|
||||
lda #BLACK
|
||||
sta SPR_COL,x
|
||||
dex
|
||||
bpl sprcol
|
||||
lda #0
|
||||
sta SPR_EN
|
||||
sta SPR_MC
|
||||
sta SPR_PRIO
|
||||
sta SPR_MSBX
|
||||
sta SPR_XEX
|
||||
sta SPR_YEX
|
||||
sta framectr
|
||||
sta fheld
|
||||
|
||||
!ifdef AUTOPLAY { ; test builds boot straight into the game
|
||||
jsr play_init
|
||||
} else {
|
||||
jsr title_init
|
||||
}
|
||||
|
||||
; ============================================================
|
||||
; main loop - one state update per PAL frame, synced to the
|
||||
; raster beam in the lower border
|
||||
; ============================================================
|
||||
main:
|
||||
jsr wait_frame
|
||||
inc framectr
|
||||
jsr rand8 ; stir the RNG once per frame
|
||||
jsr call_update
|
||||
jmp main
|
||||
|
||||
call_update:
|
||||
jmp (updvec) ; each update runs exactly one frame, ends with rts
|
||||
|
||||
; ---- wait for raster line RAS_SYNC (leave it first, so a
|
||||
; fast update cannot run twice in the same frame) ----
|
||||
wait_frame:
|
||||
lda RASTER
|
||||
cmp #RAS_SYNC
|
||||
beq wait_frame
|
||||
wf_hit:
|
||||
lda RASTER
|
||||
cmp #RAS_SYNC
|
||||
bne wf_hit
|
||||
rts
|
||||
|
||||
; ============================================================
|
||||
; sprite art first: it must stay below $1000, where the VIC
|
||||
; would see the character ROM shadow instead of our RAM
|
||||
; ============================================================
|
||||
!src "sprites.asm"
|
||||
!if * > $1000 {
|
||||
!error "sprite data ran into the char ROM shadow at $1000"
|
||||
}
|
||||
|
||||
; ============================================================
|
||||
; the states and everything they share
|
||||
; ============================================================
|
||||
!src "title.asm"
|
||||
!src "play.asm"
|
||||
!src "over.asm"
|
||||
!src "common.asm"
|
||||
!src "tables.asm"
|
||||
Reference in New Issue
Block a user