new title and over screens
This commit is contained in:
@@ -22,8 +22,9 @@ in the original.
|
||||
- PAL frame loop synced by polling the raster beam (no interrupts), one
|
||||
state update per frame — intro, menu, play and game over are `updvec`
|
||||
states. Boot shows the giant TTG / Teletype Games logo with the gold
|
||||
color wash from the c64-demo, then the menu with *fire = start game*;
|
||||
losing brings up the final score with *fire = retry*.
|
||||
color wash from the c64-demo; the menu and the game over screens are
|
||||
full-screen cards on black — big block-letter titles, *fire = start
|
||||
game* on the menu, the final score and *fire = retry* after a loss.
|
||||
- The background is raster-split at the horizon: sky above, grass below.
|
||||
The road is a grey wedge of inverse-space characters between painted
|
||||
white edge lines, with trees along both shoulders.
|
||||
@@ -44,9 +45,9 @@ in the original.
|
||||
| `main.asm` | BASIC stub, init, frame loop, state dispatch |
|
||||
| `defs.asm` | registers, constants, zero page, macros |
|
||||
| `intro.asm` | boot screen: giant TTG logo with the gold wash |
|
||||
| `title.asm` | menu screen: logo, start game, demo rabbits |
|
||||
| `title.asm` | full-screen menu: big logo, start game, hopping rabbits |
|
||||
| `play.asm` | gameplay: input, spawning, scoring, HUD |
|
||||
| `over.asm` | game over box + retry |
|
||||
| `over.asm` | full-screen game over: big title, score, retry |
|
||||
| `common.asm` | shared routines: printing, road, input, RNG, rabbit positioning |
|
||||
| `tables.asm` | assembly-time perspective and speed tables |
|
||||
| `sprites.asm` | sprite art (scooter, 4+4 rabbit frames) |
|
||||
|
||||
+2
-1
@@ -533,12 +533,13 @@ bigglyphs:
|
||||
!byte 5, 5, 2, 2, 2 ; 15 Y
|
||||
!byte 3, 4, 5, 5, 7 ; 16 G
|
||||
!byte 6, 5, 6, 5, 6 ; 17 B
|
||||
!byte 5, 5, 5, 5, 2 ; 18 V
|
||||
|
||||
bigmap: ; screen code (a=1..z=26) -> glyph index
|
||||
!byte 0 ; (unused)
|
||||
!byte 1, 17, 2, 3, 4, 5, 16, 0, 6, 0 ; a-j
|
||||
!byte 0, 7, 8, 9, 10, 11, 0, 12, 13, 14 ; k-t
|
||||
!byte 0, 0, 0, 0, 15, 0 ; u-z
|
||||
!byte 0, 18, 0, 0, 15, 0 ; u-z
|
||||
|
||||
; ---- texts (screen codes) ----
|
||||
txt_score: !scr "score"
|
||||
|
||||
@@ -1,122 +1,45 @@
|
||||
; -----------------------------------------------------------
|
||||
; over.asm - game over box over the frozen playfield: final
|
||||
; score + blinking retry prompt, fire restarts the round
|
||||
; over.asm - full-screen game over card: big GAME OVER, the
|
||||
; final score and a blinking retry prompt; fire restarts
|
||||
; -----------------------------------------------------------
|
||||
|
||||
BOXROW = 10 ; box: rows 10-14, columns 12-27
|
||||
BOXCOL = 12
|
||||
BOXW = 16
|
||||
|
||||
over_init:
|
||||
lda en_sh ; the scooter may be mid-blink: show it
|
||||
ora #1
|
||||
lda #BLACK ; clean card, the playfield is gone
|
||||
sta bg_top
|
||||
sta bg_bot
|
||||
lda #0
|
||||
sta SPR_EN
|
||||
jsr clear_screen
|
||||
|
||||
; box interior + frame, drawn over the frozen road
|
||||
ldx #0
|
||||
oi_row:
|
||||
txa
|
||||
clc
|
||||
adc #BOXROW
|
||||
tay
|
||||
lda mul40lo,y
|
||||
clc
|
||||
adc #BOXCOL
|
||||
sta scrlo
|
||||
lda mul40hi,y
|
||||
adc #>SCREEN
|
||||
sta scrhi
|
||||
sta colhi ; color RAM pointer for the same cells
|
||||
lda scrlo
|
||||
sta collo
|
||||
lda colhi
|
||||
clc
|
||||
adc #$d4
|
||||
sta colhi
|
||||
ldy #BOXW-1
|
||||
oi_col:
|
||||
jsr box_char
|
||||
sta (scrlo),y
|
||||
lda #WHITE
|
||||
sta (collo),y
|
||||
dey
|
||||
bpl oi_col
|
||||
inx
|
||||
cpx #5
|
||||
bne oi_row
|
||||
+prbig 4, 2, RED, txt_over, 9
|
||||
|
||||
+prtext BOXROW+1, 15, WHITE, txt_over, 9
|
||||
+prtext BOXROW+2, 15, WHITE, txt_score, 5
|
||||
|
||||
; final score digits next to the label
|
||||
+prtext 12, 15, WHITE, txt_score, 5
|
||||
lda sc_d0
|
||||
ora #48
|
||||
sta SCREEN+(BOXROW+2)*40+21
|
||||
sta SCREEN+12*40+21
|
||||
lda sc_d1
|
||||
ora #48
|
||||
sta SCREEN+(BOXROW+2)*40+22
|
||||
sta SCREEN+12*40+22
|
||||
lda sc_d2
|
||||
ora #48
|
||||
sta SCREEN+(BOXROW+2)*40+23
|
||||
sta SCREEN+12*40+23
|
||||
lda #YELLOW
|
||||
sta COLRAM+(BOXROW+2)*40+21
|
||||
sta COLRAM+(BOXROW+2)*40+22
|
||||
sta COLRAM+(BOXROW+2)*40+23
|
||||
sta COLRAM+12*40+21
|
||||
sta COLRAM+12*40+22
|
||||
sta COLRAM+12*40+23
|
||||
|
||||
+setupd over_update
|
||||
rts
|
||||
|
||||
; pick the frame/fill character for box row X, column Y (keeps Y)
|
||||
box_char:
|
||||
cpx #0
|
||||
beq bc_top
|
||||
cpx #4
|
||||
beq bc_bottom
|
||||
cpy #0
|
||||
beq bc_side
|
||||
cpy #BOXW-1
|
||||
beq bc_side
|
||||
lda #$20 ; interior: erase the road behind the box
|
||||
rts
|
||||
bc_side:
|
||||
lda #$5d ; vertical bar
|
||||
rts
|
||||
bc_top:
|
||||
cpy #0
|
||||
beq bc_tl
|
||||
cpy #BOXW-1
|
||||
beq bc_tr
|
||||
lda #$40 ; horizontal bar
|
||||
rts
|
||||
bc_tl:
|
||||
lda #$55 ; rounded corners
|
||||
rts
|
||||
bc_tr:
|
||||
lda #$49
|
||||
rts
|
||||
bc_bottom:
|
||||
cpy #0
|
||||
beq bc_bl
|
||||
cpy #BOXW-1
|
||||
beq bc_br
|
||||
lda #$40
|
||||
rts
|
||||
bc_bl:
|
||||
lda #$4a
|
||||
rts
|
||||
bc_br:
|
||||
lda #$4b
|
||||
rts
|
||||
|
||||
over_update:
|
||||
; blink the retry prompt
|
||||
lda framectr
|
||||
and #32
|
||||
bne ou_hide
|
||||
+prtext BOXROW+3, 14, YELLOW, txt_retry, 12
|
||||
+prtext 16, 14, YELLOW, txt_retry, 12
|
||||
jmp ou_start
|
||||
ou_hide:
|
||||
+prtext BOXROW+3, 14, YELLOW, txt_blank, 12
|
||||
+prtext 16, 14, YELLOW, txt_blank, 12
|
||||
ou_start:
|
||||
jsr start_edge
|
||||
beq ou_done
|
||||
|
||||
@@ -1,90 +1,69 @@
|
||||
; -----------------------------------------------------------
|
||||
; title.asm - big RABBIT logo over the road, scooters parked
|
||||
; on all five lanes, three demo rabbits hopping in, blinking
|
||||
; "press fire to start"
|
||||
; title.asm - full-screen menu card: big RABBIT / SCOOTER
|
||||
; logo flanked by two hopping rabbits, the scooter waiting at
|
||||
; the bottom, blinking "fire = start game"
|
||||
; -----------------------------------------------------------
|
||||
|
||||
title_init:
|
||||
lda #COL_SKY ; back from the intro's black screen
|
||||
lda #BLACK ; the menu plays on a black screen
|
||||
sta bg_top
|
||||
lda #COL_GRASS
|
||||
sta bg_bot
|
||||
jsr clear_screen
|
||||
jsr draw_road
|
||||
|
||||
+prbig 1, 8, RED, txt_rabbit, 6
|
||||
+prtext 6, 16, WHITE, txt_scooter, 7
|
||||
+prtext 17, 8, WHITE, txt_info, 23
|
||||
+prbig 2, 8, RED, txt_rabbit, 6
|
||||
+prbig 8, 6, WHITE, txt_scooter, 7
|
||||
+prtext 18, 8, WHITE, txt_info, 23
|
||||
|
||||
; one parked scooter per lane on sprites 0-4, all in red
|
||||
ldx #4
|
||||
ti_col:
|
||||
; decoration: white rabbits flank the logo (sprites 1-2,
|
||||
; double-sized), the red scooter waits at the bottom
|
||||
lda #RED
|
||||
sta SPR_COL,x
|
||||
dex
|
||||
bne ti_col
|
||||
ldx #4
|
||||
ti_scoot:
|
||||
txa
|
||||
asl
|
||||
tay
|
||||
lda pxlo,x
|
||||
sta SPRPOS,y
|
||||
lda #PLAYER_SY
|
||||
sta SPRPOS+1,y
|
||||
sta SPR_COL
|
||||
lda #WHITE
|
||||
sta SPR_COL+1
|
||||
sta SPR_COL+2
|
||||
lda #SPRP_SCOOT
|
||||
sta SPRPTR,x
|
||||
dex
|
||||
bpl ti_scoot
|
||||
lda #0
|
||||
sta SPRPTR
|
||||
lda #172 ; center lane position
|
||||
sta SPRPOS
|
||||
lda #210
|
||||
sta SPRPOS+1
|
||||
lda #30 ; left rabbit
|
||||
sta SPRPOS+2
|
||||
lda #66
|
||||
sta SPRPOS+3
|
||||
sta SPRPOS+5
|
||||
lda #34 ; right rabbit: x = 290, MSB below
|
||||
sta SPRPOS+4
|
||||
lda #%00000100
|
||||
sta SPR_MSBX
|
||||
lda #%00000110 ; both rabbits double-sized
|
||||
sta SPR_XEX
|
||||
sta SPR_YEX
|
||||
|
||||
; demo rabbits on slots 4-6 (sprites 5-7), staggered starts
|
||||
ldx #4
|
||||
ti_demo:
|
||||
jsr rand5
|
||||
sta r_lane,x
|
||||
lda demo_t-4,x
|
||||
sta r_thi,x
|
||||
lda #1
|
||||
sta r_act,x
|
||||
inx
|
||||
cpx #NRABBITS
|
||||
bne ti_demo
|
||||
lda #%00000111
|
||||
sta SPR_EN
|
||||
|
||||
+setupd title_update
|
||||
rts
|
||||
|
||||
title_update:
|
||||
; shadows: five scooters (lane 4 needs the x MSB), no expand
|
||||
lda #%00011111
|
||||
sta en_sh
|
||||
lda #%00010000
|
||||
sta msb_sh
|
||||
lda #0
|
||||
sta xex_sh
|
||||
sta yex_sh
|
||||
|
||||
; demo rabbits: constant lope, respawn on a random lane
|
||||
ldx #4
|
||||
tu_rab:
|
||||
lda r_thi,x
|
||||
; hop the flanking rabbits through the big frames,
|
||||
; half a cycle apart
|
||||
lda framectr
|
||||
lsr
|
||||
lsr
|
||||
lsr
|
||||
and #3
|
||||
sta rtmp
|
||||
clc
|
||||
adc #3
|
||||
sta r_thi,x
|
||||
bcc tu_pos
|
||||
lda #0
|
||||
sta r_thi,x
|
||||
jsr rand5
|
||||
sta r_lane,x
|
||||
tu_pos:
|
||||
jsr rab_pos
|
||||
inx
|
||||
cpx #NRABBITS
|
||||
bne tu_rab
|
||||
|
||||
jsr write_shadows
|
||||
adc #SPRP_BIG
|
||||
sta SPRPTR+1
|
||||
lda rtmp
|
||||
clc
|
||||
adc #2
|
||||
and #3
|
||||
clc
|
||||
adc #SPRP_BIG
|
||||
sta SPRPTR+2
|
||||
|
||||
; blink the start line
|
||||
lda framectr
|
||||
@@ -93,14 +72,10 @@ tu_pos:
|
||||
+prtext 15, 11, YELLOW, txt_press, 17
|
||||
jmp tu_start
|
||||
tu_hide:
|
||||
lda #9 ; hide: repaint road row 15 over the text
|
||||
sta drtmp
|
||||
jsr road_row
|
||||
+prtext 15, 11, YELLOW, txt_blank, 17
|
||||
tu_start:
|
||||
jsr start_edge
|
||||
beq tu_done
|
||||
jmp play_init ; its rts returns to the main loop
|
||||
tu_done:
|
||||
rts
|
||||
|
||||
demo_t: !byte 0, 85, 170
|
||||
|
||||
Reference in New Issue
Block a user