credits screen
This commit is contained in:
@@ -1,7 +1,8 @@
|
||||
; -----------------------------------------------------------
|
||||
; title.asm - full-screen menu card: big RABBIT / SCOOTER
|
||||
; logo flanked by two hopping rabbits, single/multiplayer
|
||||
; picker (joystick up/down + fire, or the 1 / 2 keys)
|
||||
; logo flanked by two hopping rabbits, and a three-item menu:
|
||||
; single player / multiplayer / credits (joystick up/down +
|
||||
; fire; s, m, c pick; 1 and 2 pick and start at once)
|
||||
; -----------------------------------------------------------
|
||||
|
||||
title_init:
|
||||
@@ -10,10 +11,11 @@ title_init:
|
||||
sta bg_bot
|
||||
jsr clear_screen
|
||||
|
||||
+prbig 2, 8, RED, txt_rabbit, 6
|
||||
+prbig 8, 6, WHITE, txt_scooter, 7
|
||||
+prtext 18, 9, LGREY, txt_info, 21
|
||||
+prtext 19, 9, LGREY, txt_info2, 21
|
||||
+prbig 1, 8, RED, txt_rabbit, 6
|
||||
+prbig 7, 6, WHITE, txt_scooter, 7
|
||||
|
||||
lda mp_mode ; cursor starts on the last played mode
|
||||
sta menusel
|
||||
|
||||
; decoration: white rabbits flank the logo (sprites 1-2,
|
||||
; double-sized), the red scooter waits at the bottom
|
||||
@@ -26,11 +28,11 @@ title_init:
|
||||
sta SPRPTR
|
||||
lda #172 ; center lane position
|
||||
sta SPRPOS
|
||||
lda #210
|
||||
lda #226 ; just below the footer line
|
||||
sta SPRPOS+1
|
||||
lda #30 ; left rabbit
|
||||
sta SPRPOS+2
|
||||
lda #66
|
||||
lda #58
|
||||
sta SPRPOS+3
|
||||
sta SPRPOS+5
|
||||
lda #34 ; right rabbit: x = 290, MSB below
|
||||
@@ -66,29 +68,48 @@ title_update:
|
||||
adc #SPRP_BIG
|
||||
sta SPRPTR+2
|
||||
|
||||
; joystick up/down picks the mode
|
||||
; joystick up/down steps the cursor (edge detected)
|
||||
jsr read_joy
|
||||
lda joyb
|
||||
and #1 ; up
|
||||
beq tu_noup
|
||||
lda #0
|
||||
sta mp_mode
|
||||
tu_noup:
|
||||
lda joyb
|
||||
and #2 ; down
|
||||
beq tu_nodown
|
||||
and #3
|
||||
beq tu_udrel
|
||||
lda udheld
|
||||
bne tu_udend
|
||||
lda #1
|
||||
sta mp_mode
|
||||
tu_nodown:
|
||||
sta udheld
|
||||
lda joyb
|
||||
and #1 ; up
|
||||
beq tu_down
|
||||
lda menusel
|
||||
beq tu_udend
|
||||
dec menusel
|
||||
jmp tu_udend
|
||||
tu_down:
|
||||
lda menusel
|
||||
cmp #MENU_ITEMS-1
|
||||
beq tu_udend
|
||||
inc menusel
|
||||
jmp tu_udend
|
||||
tu_udrel:
|
||||
lda #0
|
||||
sta udheld
|
||||
tu_udend:
|
||||
|
||||
; the 's' / 'm' keys pick the mode (fire still starts)
|
||||
; letter keys pick a line (fire still starts); skipped
|
||||
; while joystick 1 fire is down, because it grounds the
|
||||
; same row line the 'm' and 'c' keys sit on
|
||||
lda #$ff
|
||||
sta CIA1_PA
|
||||
lda CIA1_PB
|
||||
and #$10
|
||||
beq tu_keydone
|
||||
lda #$fd ; 's': keyboard column 1, row bit 5
|
||||
sta CIA1_PA
|
||||
lda CIA1_PB
|
||||
and #$20
|
||||
bne tu_nos
|
||||
lda #0
|
||||
sta mp_mode
|
||||
sta menusel
|
||||
tu_nos:
|
||||
lda #$ef ; 'm': keyboard column 4, row bit 4
|
||||
sta CIA1_PA
|
||||
@@ -96,8 +117,16 @@ tu_nos:
|
||||
and #$10
|
||||
bne tu_nom
|
||||
lda #1
|
||||
sta mp_mode
|
||||
sta menusel
|
||||
tu_nom:
|
||||
lda #$fb ; 'c': keyboard column 2, row bit 4
|
||||
sta CIA1_PA
|
||||
lda CIA1_PB
|
||||
and #$10
|
||||
bne tu_noc
|
||||
lda #2
|
||||
sta menusel
|
||||
tu_noc:
|
||||
|
||||
; the 1 / 2 keys pick and start right away (edge detected)
|
||||
lda #$7f ; keyboard column 7: '1' = bit 0, '2' = bit 3
|
||||
@@ -107,58 +136,114 @@ tu_nom:
|
||||
cmp #$09
|
||||
beq tu_keyup ; neither key held
|
||||
ldx k12held
|
||||
bne tu_menu ; still held from an earlier frame
|
||||
bne tu_keydone ; still held from an earlier frame
|
||||
inx
|
||||
stx k12held
|
||||
and #$01
|
||||
bne tu_key2
|
||||
lda #0
|
||||
sta mp_mode
|
||||
sta menusel
|
||||
jmp title_go
|
||||
tu_key2:
|
||||
lda #1
|
||||
sta mp_mode
|
||||
sta menusel
|
||||
jmp title_go
|
||||
tu_keyup:
|
||||
lda #0
|
||||
sta k12held
|
||||
tu_menu:
|
||||
tu_keydone:
|
||||
|
||||
; footer: the two control lines take turns
|
||||
lda framectr
|
||||
and #64
|
||||
beq tu_foot2
|
||||
+prtext 21, 9, LGREY, txt_info, 21
|
||||
jmp tu_footdone
|
||||
tu_foot2:
|
||||
+prtext 21, 9, LGREY, txt_info2, 21
|
||||
tu_footdone:
|
||||
|
||||
; the menu items: the picked line is yellow
|
||||
ldx #0
|
||||
tm_items:
|
||||
txa
|
||||
pha
|
||||
jsr draw_mitem
|
||||
pla
|
||||
tax
|
||||
inx
|
||||
cpx #MENU_ITEMS
|
||||
bne tm_items
|
||||
|
||||
; the two options: the picked line is yellow
|
||||
lda mp_mode
|
||||
bne tm_multi
|
||||
+prtext 14, 14, YELLOW, txt_1p, 13
|
||||
+prtext 16, 14, WHITE, txt_2p, 11
|
||||
jmp tm_cursor
|
||||
tm_multi:
|
||||
+prtext 14, 14, WHITE, txt_1p, 13
|
||||
+prtext 16, 14, YELLOW, txt_2p, 11
|
||||
tm_cursor:
|
||||
; blinking '>' cursor in front of the picked line
|
||||
lda #$20
|
||||
sta SCREEN+14*40+12
|
||||
sta SCREEN+16*40+12
|
||||
sta SCREEN+18*40+12
|
||||
lda framectr
|
||||
and #16
|
||||
bne tu_start
|
||||
lda mp_mode
|
||||
bne tm_cur2
|
||||
ldx menusel
|
||||
lda mcur_lo,x
|
||||
sta scrlo
|
||||
lda mcur_hi,x
|
||||
sta scrhi
|
||||
ldy #0
|
||||
lda #62 ; '>'
|
||||
sta SCREEN+14*40+12
|
||||
sta (scrlo),y
|
||||
lda scrhi
|
||||
clc
|
||||
adc #$d4 ; same cell in color RAM
|
||||
sta scrhi
|
||||
lda #YELLOW
|
||||
sta COLRAM+14*40+12
|
||||
jmp tu_start
|
||||
tm_cur2:
|
||||
lda #62
|
||||
sta SCREEN+16*40+12
|
||||
lda #YELLOW
|
||||
sta COLRAM+16*40+12
|
||||
sta (scrlo),y
|
||||
|
||||
tu_start:
|
||||
; fire or space starts the picked mode
|
||||
; fire or space opens the picked line
|
||||
jsr start_edge
|
||||
beq tu_done
|
||||
title_go:
|
||||
lda menusel
|
||||
cmp #2
|
||||
beq tg_credits
|
||||
sta mp_mode ; item 0 / 1 doubles as the player count
|
||||
jmp play_init ; its rts returns to the main loop
|
||||
tg_credits:
|
||||
jmp credits_init
|
||||
tu_done:
|
||||
rts
|
||||
|
||||
; ---- draw menu item X, yellow when it is the picked one ----
|
||||
draw_mitem:
|
||||
lda mitem_lo,x
|
||||
sta txtlo
|
||||
lda mitem_hi,x
|
||||
sta txthi
|
||||
lda mitem_row,x
|
||||
sta prow
|
||||
lda #14
|
||||
sta pcol
|
||||
lda mitem_len,x
|
||||
sta plen
|
||||
lda #WHITE
|
||||
cpx menusel
|
||||
bne dm_store
|
||||
lda #YELLOW
|
||||
dm_store:
|
||||
sta pcolor
|
||||
jmp print_text
|
||||
|
||||
; ---- menu tables ----
|
||||
MENU_ITEMS = 3
|
||||
mitem_lo: !byte <txt_1p, <txt_2p, <txt_credits
|
||||
mitem_hi: !byte >txt_1p, >txt_2p, >txt_credits
|
||||
mitem_len: !byte 13, 11, 7
|
||||
mitem_row: !byte 14, 16, 18
|
||||
mcur_lo: ; cursor cells: column 12 of those rows
|
||||
!byte <(SCREEN+14*40+12), <(SCREEN+16*40+12), <(SCREEN+18*40+12)
|
||||
mcur_hi:
|
||||
!byte >(SCREEN+14*40+12), >(SCREEN+16*40+12), >(SCREEN+18*40+12)
|
||||
|
||||
; ---- menu variables ----
|
||||
menusel: !byte 0 ; picked line: 0-2
|
||||
udheld: !byte 0 ; joystick up/down edge detection state
|
||||
|
||||
Reference in New Issue
Block a user