new title and over screens

This commit is contained in:
2026-07-15 22:45:56 +02:00
parent 97216d245d
commit c7da1be163
4 changed files with 72 additions and 172 deletions
+5 -4
View File
@@ -22,8 +22,9 @@ in the original.
- PAL frame loop synced by polling the raster beam (no interrupts), one - PAL frame loop synced by polling the raster beam (no interrupts), one
state update per frame — intro, menu, play and game over are `updvec` state update per frame — intro, menu, play and game over are `updvec`
states. Boot shows the giant TTG / Teletype Games logo with the gold 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*; color wash from the c64-demo; the menu and the game over screens are
losing brings up the final score with *fire = retry*. 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 background is raster-split at the horizon: sky above, grass below.
The road is a grey wedge of inverse-space characters between painted The road is a grey wedge of inverse-space characters between painted
white edge lines, with trees along both shoulders. white edge lines, with trees along both shoulders.
@@ -44,9 +45,9 @@ in the original.
| `main.asm` | BASIC stub, init, frame loop, state dispatch | | `main.asm` | BASIC stub, init, frame loop, state dispatch |
| `defs.asm` | registers, constants, zero page, macros | | `defs.asm` | registers, constants, zero page, macros |
| `intro.asm` | boot screen: giant TTG logo with the gold wash | | `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 | | `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 | | `common.asm` | shared routines: printing, road, input, RNG, rabbit positioning |
| `tables.asm` | assembly-time perspective and speed tables | | `tables.asm` | assembly-time perspective and speed tables |
| `sprites.asm` | sprite art (scooter, 4+4 rabbit frames) | | `sprites.asm` | sprite art (scooter, 4+4 rabbit frames) |
+2 -1
View File
@@ -533,12 +533,13 @@ bigglyphs:
!byte 5, 5, 2, 2, 2 ; 15 Y !byte 5, 5, 2, 2, 2 ; 15 Y
!byte 3, 4, 5, 5, 7 ; 16 G !byte 3, 4, 5, 5, 7 ; 16 G
!byte 6, 5, 6, 5, 6 ; 17 B !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 bigmap: ; screen code (a=1..z=26) -> glyph index
!byte 0 ; (unused) !byte 0 ; (unused)
!byte 1, 17, 2, 3, 4, 5, 16, 0, 6, 0 ; a-j !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, 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) ---- ; ---- texts (screen codes) ----
txt_score: !scr "score" txt_score: !scr "score"
+17 -94
View File
@@ -1,122 +1,45 @@
; ----------------------------------------------------------- ; -----------------------------------------------------------
; over.asm - game over box over the frozen playfield: final ; over.asm - full-screen game over card: big GAME OVER, the
; score + blinking retry prompt, fire restarts the round ; final score and a blinking retry prompt; fire restarts
; ----------------------------------------------------------- ; -----------------------------------------------------------
BOXROW = 10 ; box: rows 10-14, columns 12-27
BOXCOL = 12
BOXW = 16
over_init: over_init:
lda en_sh ; the scooter may be mid-blink: show it lda #BLACK ; clean card, the playfield is gone
ora #1 sta bg_top
sta bg_bot
lda #0
sta SPR_EN sta SPR_EN
jsr clear_screen
; box interior + frame, drawn over the frozen road +prbig 4, 2, RED, txt_over, 9
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
+prtext BOXROW+1, 15, WHITE, txt_over, 9 +prtext 12, 15, WHITE, txt_score, 5
+prtext BOXROW+2, 15, WHITE, txt_score, 5
; final score digits next to the label
lda sc_d0 lda sc_d0
ora #48 ora #48
sta SCREEN+(BOXROW+2)*40+21 sta SCREEN+12*40+21
lda sc_d1 lda sc_d1
ora #48 ora #48
sta SCREEN+(BOXROW+2)*40+22 sta SCREEN+12*40+22
lda sc_d2 lda sc_d2
ora #48 ora #48
sta SCREEN+(BOXROW+2)*40+23 sta SCREEN+12*40+23
lda #YELLOW lda #YELLOW
sta COLRAM+(BOXROW+2)*40+21 sta COLRAM+12*40+21
sta COLRAM+(BOXROW+2)*40+22 sta COLRAM+12*40+22
sta COLRAM+(BOXROW+2)*40+23 sta COLRAM+12*40+23
+setupd over_update +setupd over_update
rts 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: over_update:
; blink the retry prompt ; blink the retry prompt
lda framectr lda framectr
and #32 and #32
bne ou_hide bne ou_hide
+prtext BOXROW+3, 14, YELLOW, txt_retry, 12 +prtext 16, 14, YELLOW, txt_retry, 12
jmp ou_start jmp ou_start
ou_hide: ou_hide:
+prtext BOXROW+3, 14, YELLOW, txt_blank, 12 +prtext 16, 14, YELLOW, txt_blank, 12
ou_start: ou_start:
jsr start_edge jsr start_edge
beq ou_done beq ou_done
+48 -73
View File
@@ -1,90 +1,69 @@
; ----------------------------------------------------------- ; -----------------------------------------------------------
; title.asm - big RABBIT logo over the road, scooters parked ; title.asm - full-screen menu card: big RABBIT / SCOOTER
; on all five lanes, three demo rabbits hopping in, blinking ; logo flanked by two hopping rabbits, the scooter waiting at
; "press fire to start" ; the bottom, blinking "fire = start game"
; ----------------------------------------------------------- ; -----------------------------------------------------------
title_init: title_init:
lda #COL_SKY ; back from the intro's black screen lda #BLACK ; the menu plays on a black screen
sta bg_top sta bg_top
lda #COL_GRASS
sta bg_bot sta bg_bot
jsr clear_screen jsr clear_screen
jsr draw_road
+prbig 1, 8, RED, txt_rabbit, 6 +prbig 2, 8, RED, txt_rabbit, 6
+prtext 6, 16, WHITE, txt_scooter, 7 +prbig 8, 6, WHITE, txt_scooter, 7
+prtext 17, 8, WHITE, txt_info, 23 +prtext 18, 8, WHITE, txt_info, 23
; one parked scooter per lane on sprites 0-4, all in red ; decoration: white rabbits flank the logo (sprites 1-2,
ldx #4 ; double-sized), the red scooter waits at the bottom
ti_col:
lda #RED lda #RED
sta SPR_COL,x sta SPR_COL
dex lda #WHITE
bne ti_col sta SPR_COL+1
ldx #4 sta SPR_COL+2
ti_scoot:
txa
asl
tay
lda pxlo,x
sta SPRPOS,y
lda #PLAYER_SY
sta SPRPOS+1,y
lda #SPRP_SCOOT lda #SPRP_SCOOT
sta SPRPTR,x sta SPRPTR
dex lda #172 ; center lane position
bpl ti_scoot sta SPRPOS
lda #0 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_XEX
sta SPR_YEX sta SPR_YEX
lda #%00000111
; demo rabbits on slots 4-6 (sprites 5-7), staggered starts sta SPR_EN
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
+setupd title_update +setupd title_update
rts rts
title_update: title_update:
; shadows: five scooters (lane 4 needs the x MSB), no expand ; hop the flanking rabbits through the big frames,
lda #%00011111 ; half a cycle apart
sta en_sh lda framectr
lda #%00010000 lsr
sta msb_sh lsr
lda #0 lsr
sta xex_sh and #3
sta yex_sh sta rtmp
; demo rabbits: constant lope, respawn on a random lane
ldx #4
tu_rab:
lda r_thi,x
clc clc
adc #3 adc #SPRP_BIG
sta r_thi,x sta SPRPTR+1
bcc tu_pos lda rtmp
lda #0 clc
sta r_thi,x adc #2
jsr rand5 and #3
sta r_lane,x clc
tu_pos: adc #SPRP_BIG
jsr rab_pos sta SPRPTR+2
inx
cpx #NRABBITS
bne tu_rab
jsr write_shadows
; blink the start line ; blink the start line
lda framectr lda framectr
@@ -93,14 +72,10 @@ tu_pos:
+prtext 15, 11, YELLOW, txt_press, 17 +prtext 15, 11, YELLOW, txt_press, 17
jmp tu_start jmp tu_start
tu_hide: tu_hide:
lda #9 ; hide: repaint road row 15 over the text +prtext 15, 11, YELLOW, txt_blank, 17
sta drtmp
jsr road_row
tu_start: tu_start:
jsr start_edge jsr start_edge
beq tu_done beq tu_done
jmp play_init ; its rts returns to the main loop jmp play_init ; its rts returns to the main loop
tu_done: tu_done:
rts rts
demo_t: !byte 0, 85, 170