add Ceiling Zero captive demo

This commit is contained in:
4am 2018-12-23 11:13:47 -05:00
parent 30d72daaec
commit 0103e0443c
12 changed files with 1407 additions and 5 deletions

View File

@ -32,8 +32,6 @@
# uncompressed but unpatched # uncompressed but unpatched
Alien Downpour Alien Downpour
Bouncing Kamungas Bouncing Kamungas
Ceiling Zero
Drelbs
Spider Raid Spider Raid
Stellar 7 Stellar 7
The Goonies The Goonies
@ -48,6 +46,7 @@ Aquatron
Bolo Bolo
BurgerTime BurgerTime
Buzzard Bait Buzzard Bait
Ceiling Zero
Championship Lode Runner Championship Lode Runner
Choplifter Choplifter
Conan Conan

View File

@ -1 +1 @@
# # Mega-Attract-Mode configuration file # # Mega-Attract-Mode is split into modules. Each module can be a # short slideshow or a self-running demo (like a game's built-in # 'attract mode'). Modules are run in the order listed here, one # after the next, until interrupted by user input. The last-run # module is tracked in the global prefs file. # # Format: # key=value # # |key| must be unique within this file # # |value| must be one of # 1 for HGR slideshow (|key| is a file containing a list of HGR graphics) # 2 for DHGR slideshow (|key| is a file containing a list of DHGR graphics) # 3 for self-running demo (|key| is an executable binary file) # # Blank lines and lines beginning with '#' are ignored (like this one!) # A line beginning with '[' terminates the parsing # SHORT.CONF=1 DHGR.CONF=2 ORILEYS.MINE=3 FORMULA.1=3 FIREBIRD=3 FAVORITES.CONF=1 BUZZARD.BAIT=3 SNAKE.BYTE=3 HIGH.RISE=3 THUNDERBOMBS=3 ROBOTRON=3 NIBBLER=3 LADY.TUT=3 STARGATE=3 #SPIDER.RAID=3 FLIP.OUT=3 #STELLAR.7=3 #TRACK.AND.FIELD=3 AGENT.USA=3 GUMBALL=3 TUBEWAY=3 CIDER.SPIDER=3 CONAN=3 MR.COOL=3 CHOPLIFTER=3 HARD.HAT.MACK=3 PACMAN=3 SERPENTINE=3 KARATEKA=3 WARP.DESTROYER=3 LOST.TOMB=3 VINDICATOR=3 REPTON=3 SAMMY.LIGHTFOOT=3 DUNG.BEETLES=3 GAMMA.GOBLINS=3 #ALIEN.DOWNPOUR=3 PIEMAN=3 ALIEN.AMBUSH=3 ALIEN.RAIN=3 AQUATRON=3 JUNGLE.HUNT=3 POOYAN=3 PLASMANIA=3 SPY.HUNTER=3 DINO.EGGS=3 BOLO=3 CHAMP.LODERUN=3 SPYS.DEMISE=3 PEST.PATROL=3 PITFALL.II=3 LODE.RUNNER=3 BURGERTIME=3 SPARE.CHANGE=3 SNEAKERS=3 WAVY.NAVY=3 EFG.CONF=1 ACTIVISION.CONF=1 CD.CONF=1 BRODERBUND.CONF=1 T.CONF=1 ATARI.CONF=1 SIERRA.CONF=1 PQR.CONF=1 DATAMOST.CONF=1 MNO.CONF=1 DATASOFT.CONF=1 S.CONF=1 MICROFUN.CONF=1 AB.CONF=1 PICCADILLY.CONF=1 HIJKL.CONF=1 SIRIUS.CONF=1 [eof] # # Mega-Attract-Mode configuration file # # Mega-Attract-Mode is split into modules. Each module can be a # short slideshow or a self-running demo (like a game's built-in # 'attract mode'). Modules are run in the order listed here, one # after the next, until interrupted by user input. The last-run # module is tracked in the global prefs file. # # Format: # key=value # # |key| must be unique within this file # # |value| must be one of # 1 for HGR slideshow (|key| is a file containing a list of HGR graphics) # 2 for DHGR slideshow (|key| is a file containing a list of DHGR graphics) # 3 for self-running demo (|key| is an executable binary file) # # Blank lines and lines beginning with '#' are ignored (like this one!) # A line beginning with '[' terminates the parsing # CEILING.ZERO=3 SHORT.CONF=1 DHGR.CONF=2 ORILEYS.MINE=3 FORMULA.1=3 FIREBIRD=3 FAVORITES.CONF=1 BUZZARD.BAIT=3 SNAKE.BYTE=3 HIGH.RISE=3 THUNDERBOMBS=3 ROBOTRON=3 NIBBLER=3 LADY.TUT=3 STARGATE=3 #SPIDER.RAID=3 FLIP.OUT=3 #STELLAR.7=3 #TRACK.AND.FIELD=3 AGENT.USA=3 GUMBALL=3 TUBEWAY=3 CIDER.SPIDER=3 CONAN=3 MR.COOL=3 CHOPLIFTER=3 HARD.HAT.MACK=3 PACMAN=3 SERPENTINE=3 KARATEKA=3 WARP.DESTROYER=3 LOST.TOMB=3 VINDICATOR=3 REPTON=3 SAMMY.LIGHTFOOT=3 DUNG.BEETLES=3 GAMMA.GOBLINS=3 #ALIEN.DOWNPOUR=3 PIEMAN=3 ALIEN.AMBUSH=3 ALIEN.RAIN=3 AQUATRON=3 JUNGLE.HUNT=3 POOYAN=3 PLASMANIA=3 SPY.HUNTER=3 DINO.EGGS=3 BOLO=3 CHAMP.LODERUN=3 SPYS.DEMISE=3 PEST.PATROL=3 PITFALL.II=3 LODE.RUNNER=3 BURGERTIME=3 SPARE.CHANGE=3 SNEAKERS=3 WAVY.NAVY=3 EFG.CONF=1 ACTIVISION.CONF=1 CD.CONF=1 BRODERBUND.CONF=1 T.CONF=1 ATARI.CONF=1 SIERRA.CONF=1 PQR.CONF=1 DATAMOST.CONF=1 MNO.CONF=1 DATASOFT.CONF=1 S.CONF=1 MICROFUN.CONF=1 AB.CONF=1 PICCADILLY.CONF=1 HIJKL.CONF=1 SIRIUS.CONF=1 [eof]

BIN
res/demo/CEILING.ZERO Executable file

Binary file not shown.

BIN
res/demo/CEILING.ZERO.1 Executable file

Binary file not shown.

View File

@ -16,6 +16,8 @@ BURGERTIME.4=Type(F1),AuxType(0C00),Access(C3)
BURGERTIME.5=Type(F1),AuxType(6000),Access(C3) BURGERTIME.5=Type(F1),AuxType(6000),Access(C3)
BUZZARD.BAIT=Type(06),AuxType(0300),Access(C3) BUZZARD.BAIT=Type(06),AuxType(0300),Access(C3)
BUZZARD.BAIT.1=Type(F1),AuxType(0000),Access(C3) BUZZARD.BAIT.1=Type(F1),AuxType(0000),Access(C3)
CEILING.ZERO=Type(06),AuxType(0300),Access(C3)
CEILING.ZERO.1=Type(F1),AuxType(0000),Access(C3)
CHAMP.LODERUN=Type(06),AuxType(0800),Access(C3) CHAMP.LODERUN=Type(06),AuxType(0800),Access(C3)
CHAMP.LODERUN.1=Type(F1),AuxType(0000),Access(C3) CHAMP.LODERUN.1=Type(F1),AuxType(0000),Access(C3)
CHAMP.LODERUN.Z=Type(F1),AuxType(0000),Access(C3) CHAMP.LODERUN.Z=Type(F1),AuxType(0000),Access(C3)

View File

@ -0,0 +1,7 @@
$7D97: AD61C0 -> AD00C0 to change button detection to keypress detection (context is AD61C010036C1C04)
$7D9C: 6C1C04 -> 4C0001 to exit on aforementioned keypress
$8117: AD61C0 -> AD00C0 to change button detection to keypress detection (context is AD61C03004C617)
$7DD7: AD61C0 -> AD00C0 to change button detection to keypress detection (context is AD61C0300CE658)
$7DE8: 6C1C04 -> 4C0001 to exit on aforementioned keypress
$7E69: AD61C0 -> AD00C0 to change button detection to keypress detection (context is AD61C030036C0A046C1E04)
$7DE3: AD61C0 -> 4C0001 to exit at end of demo cycle

View File

@ -20,11 +20,13 @@ Main
ldx #$FF ldx #$FF
txs txs
jsr BlankHGR jsr BlankHGR
- bit $C010 @loop
bit $C010
jsr AttractMode jsr AttractMode
jmp - jmp @loop
; these routines will only be called after relocating to language card ; these routines will only be called after relocating to language card
!source "src/ui.search.mode.a"
!source "src/ui.attract.mode.a" !source "src/ui.attract.mode.a"
!source "src/prodos.path.a" !source "src/prodos.path.a"
!source "src/glue.prorwts2.a" !source "src/glue.prorwts2.a"
@ -33,6 +35,8 @@ Main
!source "src/parse.common.a" !source "src/parse.common.a"
!source "src/parse.prefs.a" !source "src/parse.prefs.a"
!source "src/parse.games.a" !source "src/parse.games.a"
!source "src/ui.font.a"
!source "src/ui.font.data.a"
gGlobalPrefsStore gGlobalPrefsStore
!word *+2 ; address of first okvs store !word *+2 ; address of first okvs store
} }

View File

@ -20,6 +20,8 @@ PTR = $02
SRC = $04 SRC = $04
DEST = $06 DEST = $06
SAVE = $08 SAVE = $08
HTAB = $24
VTAB = $25
MachineStatus =$F0 ; bit 7 = 1 if machine has joystick MachineStatus =$F0 ; bit 7 = 1 if machine has joystick
; bit 6 = 1 if machine has 128K ; bit 6 = 1 if machine has 128K
; $FE ; used by ParseGamesList ; $FE ; used by ParseGamesList

152
src/ui.font.a Normal file
View File

@ -0,0 +1,152 @@
;license:MIT
;(c) 2018 by 4am
;
; hi-res font drawing routines
;
; Public functions
; - DrawPage
; - Draw40Chars
; - DrawString
; - DrawBuffer
;
DrawPage
; A/Y contains address of text buffer
; no special characters are drawn (0x20..0x7F only)
; 0x0A acts as carriage return
; drawing starts at HTAB 0, VTAB 0
; drawing ends after 24 lines have been drawn
; TODO
Draw40Chars
; A/Y contains address of character buffer
; carry bit clear -> draw on page 1
; carry bit set -> draw on page 2
; $25 contains textpage line (0..23) (this is the standard VTAB address)
; drawing starts at HTAB 0
; increments VTAB
; sets HTAB to 0 on exit
; clobbers A/X/Y
jsr +
ldx #40
jsr DrawBuffer
inc VTAB
+ ldx #0
stx HTAB
rts
DrawString
; A/Y contains address of length-prefixed string
; carry bit clear -> draw on page 1
; carry bit set -> draw on page 2
; $24 contains starting column (0..39) (this is the standard HTAB address)
; $25 contains textpage line (0..23) (this is the standard VTAB address)
; clobbers A/X/Y
; clobbers PTR/PTR+1
+STAY PTR
ldy #0
lda (PTR),y
tax
inc PTR
bne +
inc PTR+1
+
+LDAY PTR
; note: execution falls through here
DrawBuffer
; A/Y contains address of character buffer
; X contains buffer length (1..40)
; carry bit clear -> draw on page 1
; carry bit set -> draw on page 2
; characters MUST have high bit off (0x00..0x7F)
; special characters (0x00..0x1F) will be drawn
; $24 contains starting column (0..39) (this is the standard HTAB address)
; $25 contains textpage line (0..23) (this is the standard VTAB address)
; all characters are drawn on the same line
; HTAB is incremented for each character
; VTAB is NOT incremented
; clobbers A/X/Y
+STAY @src+1
bcs +
lda #$00
+HIDE_NEXT_2_BYTES
+
lda #$60
sta @pagemask
dex
lda VTAB
asl
asl
asl
; routine to calculate memory address within HGR page
; and self-modify addresses within draw loop that follows
; (routine clobbers A and Y but preserves X)
asl
tay
and #$F0
bpl @calc1
ora #$05
@calc1 bcc @calc2
ora #$0A
@calc2 asl
asl
sta @hgrlo+1
tya
and #$0E
adc #$10
asl @hgrlo+1
rol
@pagemask=*+1
eor #$FD ; SMC (0=hi-res page 1, #$60=hi-res page 2)
sta @row0+2
clc
adc #$04
sta @row1+2
adc #$04
sta @row2+2
adc #$04
sta @row3+2
adc #$04
sta @row4+2
adc #$04
sta @row5+2
adc #$04
sta @row6+2
adc #$04
sta @row7+2
@hgrlo lda #$FD
clc
adc HTAB
sta @row0+1
sta @row1+1
sta @row2+1
sta @row3+1
sta @row4+1
sta @row5+1
sta @row6+1
sta @row7+1
@loop
@src ldy $FDFD,x
lda FontDataRow0,y
@row0 sta $FDFD,x
lda FontDataRow1,y
@row1 sta $FDFD,x
lda FontDataRow2,y
@row2 sta $FDFD,x
lda FontDataRow3,y
@row3 sta $FDFD,x
lda FontDataRow4,y
@row4 sta $FDFD,x
lda FontDataRow5,y
@row5 sta $FDFD,x
lda FontDataRow6,y
@row6 sta $FDFD,x
lda FontDataRow7,y
@row7 sta $FDFD,x
inc HTAB
dex
bpl @loop
rts

1032
src/ui.font.data.a Normal file

File diff suppressed because it is too large Load Diff

139
src/ui.search.mode.a Normal file
View File

@ -0,0 +1,139 @@
;license:MIT
;(c) 2018 by 4am
;
; Search Mode - incrementally search game catalog
;
; Public functions
; - SearchMode
;
MaxInputLength = 24
SearchMode
jsr Home ; switches to text mode
jsr LoadFile ; load initial background at $2000
!word Cover
lda #22 ; draw search UI on top of background
sta VTAB
clc ; draw on page 1
+LDADDR UILine1
jsr Draw40Chars
clc
+LDADDR UILine2
jsr Draw40Chars
bit $c054 ; show it
bit $c052
bit $c057
bit $c050
@loop
bit $c010
- lda $c000
bpl -
ldx InputLength
cpx MaxInputLength
beq @loop
sta InputBuffer,x
inc InputLength
jsr OnInputChanged
jmp @loop
OnInputChanged
lda #0
sta MatchCount
jsr okvs_iter_values
!word gGamesListStore
!word RankSearchResult
lda MatchCount
beq @nomatches
lda BestMatchIndex
cmp SelectedIndex
beq @nochange
sta SelectedIndex
sta @index
jsr okvs_nth
!word gGamesListStore
@index !byte $FD
+STAY @key
; load game title page at $4000 (page 2, not currently visible)
+LOAD_FILE kHGRScreenshotDirectory, @key
jsr okvs_get
!word gGamesListStore
@key !word $FDFD
; TODO A/Y points to visible title string now
@nochange
; TODO
clc
rts
@nomatches
; TODO
sec
rts
RankSearchResult
zpword = $0
zpstring = $2
runningscore = $4
startat = $6
i = $7
tmp = $8
stx @tmpx
+STAY zpstring
+LDADDR InputLength
+STAY zpword
ldy #0
lda (zpstring),y
cmp InputLength
bne +
- lda (zpword),y
cmp (zpstring),y
bne +
dey
bne -
lda #100
rts
+
@tmpx !byte $FD
Cover !byte 5
!text "COVER"
InputLength
!byte 0
InputBuffer
!text " "
SelectedIndex ; only valid if InputLength > 0
!byte $FF
MatchCount ; only valid during OnInputChanged
!byte 0
BestMatchScore ; only valid during OnInputChanged
!byte 0
BestMatchIndex ; only valid during OnInputChanged, and only if MatchCount > 0
!byte 0
UILine1
!byte 0,0,0,0,0,0,0,0,0,0
!byte 0,0,0,0,0,0,0,0,0,0
!byte 0,0,0,0,0,0,0,0,0,0
!byte 0,0,0,0,0,0,0,0,0,0
UILine2
; !text "0123456789012345678901234567890123456789"
!text "["
!byte $7F
; !text "Championship Lode Runner_"
!text " "
!text "] 000 games"

View File

@ -37,3 +37,68 @@ cover128
cover128_b cover128_b
!text "COVER.A2FC" !text "COVER.A2FC"
cover128_e cover128_e
bcs @noname
+STAY PTR
ldx #0
stx HTAB
ldx #22
stx VTAB
ldy #0
lda (PTR),y
tax
+LDADDR @topline
jsr DrawBuffer
ldx #3
+LDADDR @toprightcorner
jsr DrawBuffer
inc VTAB
ldx #0
stx HTAB
inx
+LDADDR @rightline
jsr DrawBuffer
+LDAY PTR
jsr DrawString
ldx #2
+LDADDR @rightline
jsr DrawBuffer
dec VTAB
ldx #0
stx HTAB
@noname
rts
@topline
!byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
!byte 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0
@toprightcorner
!byte 0,0,7
@rightline
!text " "
!byte 3
HGR2To1
lda #$40
sta @a+2
ldx #$20
stx @b+2
ldy #0
@a lda $FD00,y ; SMC
@b sta $FD00,y ; SMC
iny
bne @a
inc @a+2
inc @b+2
dex
bne @a
rts