diff --git a/res/attract-mode.txt b/res/attract-mode.txt index b720c8a44..969daca10 100644 --- a/res/attract-mode.txt +++ b/res/attract-mode.txt @@ -32,8 +32,6 @@ # uncompressed but unpatched Alien Downpour Bouncing Kamungas -Ceiling Zero -Drelbs Spider Raid Stellar 7 The Goonies @@ -48,6 +46,7 @@ Aquatron Bolo BurgerTime Buzzard Bait +Ceiling Zero Championship Lode Runner Choplifter Conan diff --git a/res/attract.conf b/res/attract.conf index 064ea0471..96c439349 100644 --- a/res/attract.conf +++ b/res/attract.conf @@ -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] \ No newline at end of file +# # 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] \ No newline at end of file diff --git a/res/demo/CEILING.ZERO b/res/demo/CEILING.ZERO new file mode 100755 index 000000000..8d1c9b6af Binary files /dev/null and b/res/demo/CEILING.ZERO differ diff --git a/res/demo/CEILING.ZERO.1 b/res/demo/CEILING.ZERO.1 new file mode 100755 index 000000000..fc366f03d Binary files /dev/null and b/res/demo/CEILING.ZERO.1 differ diff --git a/res/demo/_FileInformation.txt b/res/demo/_FileInformation.txt index c2a7d8873..e8a1f7b0a 100644 --- a/res/demo/_FileInformation.txt +++ b/res/demo/_FileInformation.txt @@ -16,6 +16,8 @@ BURGERTIME.4=Type(F1),AuxType(0C00),Access(C3) BURGERTIME.5=Type(F1),AuxType(6000),Access(C3) BUZZARD.BAIT=Type(06),AuxType(0300),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.1=Type(F1),AuxType(0000),Access(C3) CHAMP.LODERUN.Z=Type(F1),AuxType(0000),Access(C3) diff --git a/res/notes/ceiling-zero.txt b/res/notes/ceiling-zero.txt new file mode 100644 index 000000000..51c2b9ebe --- /dev/null +++ b/res/notes/ceiling-zero.txt @@ -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 diff --git a/src/4cade.a b/src/4cade.a index a15132965..9957af219 100644 --- a/src/4cade.a +++ b/src/4cade.a @@ -20,11 +20,13 @@ Main ldx #$FF txs jsr BlankHGR -- bit $C010 +@loop + bit $C010 jsr AttractMode - jmp - + jmp @loop ; 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/prodos.path.a" !source "src/glue.prorwts2.a" @@ -33,6 +35,8 @@ Main !source "src/parse.common.a" !source "src/parse.prefs.a" !source "src/parse.games.a" + !source "src/ui.font.a" + !source "src/ui.font.data.a" gGlobalPrefsStore !word *+2 ; address of first okvs store } diff --git a/src/constants.a b/src/constants.a index c23628583..24b77d9b0 100644 --- a/src/constants.a +++ b/src/constants.a @@ -20,6 +20,8 @@ PTR = $02 SRC = $04 DEST = $06 SAVE = $08 +HTAB = $24 +VTAB = $25 MachineStatus =$F0 ; bit 7 = 1 if machine has joystick ; bit 6 = 1 if machine has 128K ; $FE ; used by ParseGamesList diff --git a/src/ui.font.a b/src/ui.font.a new file mode 100644 index 000000000..10d7c8d27 --- /dev/null +++ b/src/ui.font.a @@ -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 diff --git a/src/ui.font.data.a b/src/ui.font.data.a new file mode 100644 index 000000000..d0b07079f --- /dev/null +++ b/src/ui.font.data.a @@ -0,0 +1,1032 @@ +FontDataRow0 + !byte $80 + !byte $80 + !byte $80 + !byte $9C + !byte $80 + !byte $9C + !byte $80 + !byte $80 + !byte $9C + !byte $9C + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $B6 + !byte $80 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $EC + !byte $B0 + !byte $B0 + !byte $8C + !byte $98 + !byte $80 + !byte $98 + !byte $B6 + !byte $80 + !byte $98 + !byte $E7 + !byte $BE + !byte $98 + !byte $98 + !byte $8C + !byte $E3 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $E0 + !byte $BC + !byte $98 + !byte $BE + !byte $BE + !byte $E6 + !byte $FE + !byte $BC + !byte $FE + !byte $BC + !byte $BC + !byte $80 + !byte $80 + !byte $F0 + !byte $80 + !byte $8E + !byte $BC + !byte $BE + !byte $BE + !byte $BF + !byte $FE + !byte $BF + !byte $FF + !byte $FF + !byte $FE + !byte $E3 + !byte $BE + !byte $F0 + !byte $E3 + !byte $83 + !byte $E3 + !byte $E3 + !byte $BE + !byte $BF + !byte $BE + !byte $BF + !byte $FE + !byte $FF + !byte $E3 + !byte $E3 + !byte $E3 + !byte $C1 + !byte $E3 + !byte $FF + !byte $9C + !byte $83 + !byte $9C + !byte $98 + !byte $80 + !byte $8E + !byte $80 + !byte $86 + !byte $80 + !byte $E0 + !byte $80 + !byte $F8 + !byte $80 + !byte $86 + !byte $98 + !byte $80 + !byte $86 + !byte $9C + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $8C + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $B0 + !byte $9C + !byte $86 + !byte $80 + !byte $FF +FontDataRow1 + !byte $80 + !byte $9C + !byte $9C + !byte $9C + !byte $9C + !byte $9C + !byte $80 + !byte $80 + !byte $BC + !byte $9E + !byte $80 + !byte $80 + !byte $80 + !byte $9C + !byte $FF + !byte $E6 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $80 + !byte $98 + !byte $98 + !byte $98 + !byte $8C + !byte $80 + !byte $BC + !byte $B6 + !byte $B6 + !byte $FE + !byte $F3 + !byte $E3 + !byte $98 + !byte $8C + !byte $98 + !byte $B6 + !byte $98 + !byte $80 + !byte $80 + !byte $80 + !byte $F0 + !byte $E6 + !byte $9C + !byte $E0 + !byte $E0 + !byte $E6 + !byte $86 + !byte $86 + !byte $E0 + !byte $E6 + !byte $E6 + !byte $98 + !byte $98 + !byte $B8 + !byte $BE + !byte $9C + !byte $E6 + !byte $E3 + !byte $FF + !byte $FF + !byte $FF + !byte $FF + !byte $FF + !byte $FF + !byte $FF + !byte $E3 + !byte $BE + !byte $F0 + !byte $F3 + !byte $83 + !byte $F7 + !byte $E7 + !byte $FF + !byte $FF + !byte $FF + !byte $FF + !byte $FF + !byte $FF + !byte $E3 + !byte $E3 + !byte $E3 + !byte $E3 + !byte $E3 + !byte $FF + !byte $8C + !byte $87 + !byte $98 + !byte $BC + !byte $80 + !byte $9B + !byte $80 + !byte $86 + !byte $80 + !byte $E0 + !byte $80 + !byte $8C + !byte $80 + !byte $86 + !byte $98 + !byte $B0 + !byte $86 + !byte $98 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $8C + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $98 + !byte $9C + !byte $8C + !byte $80 + !byte $FF +FontDataRow2 + !byte $FF + !byte $FE + !byte $BF + !byte $9C + !byte $BE + !byte $9C + !byte $F0 + !byte $87 + !byte $FC + !byte $9F + !byte $80 + !byte $88 + !byte $9C + !byte $BE + !byte $FF + !byte $BC + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $FC + !byte $BC + !byte $80 + !byte $BC + !byte $BE + !byte $80 + !byte $BC + !byte $A4 + !byte $FF + !byte $9B + !byte $F8 + !byte $87 + !byte $88 + !byte $8C + !byte $98 + !byte $9C + !byte $98 + !byte $80 + !byte $80 + !byte $80 + !byte $B8 + !byte $F6 + !byte $9C + !byte $FC + !byte $FC + !byte $E6 + !byte $BE + !byte $BE + !byte $B0 + !byte $FE + !byte $FE + !byte $98 + !byte $98 + !byte $9C + !byte $BE + !byte $B8 + !byte $E0 + !byte $FB + !byte $E3 + !byte $E3 + !byte $83 + !byte $E3 + !byte $83 + !byte $83 + !byte $83 + !byte $E3 + !byte $9C + !byte $E0 + !byte $B3 + !byte $83 + !byte $FF + !byte $EF + !byte $E3 + !byte $E3 + !byte $E3 + !byte $E3 + !byte $83 + !byte $9C + !byte $E3 + !byte $E3 + !byte $E3 + !byte $E7 + !byte $E3 + !byte $F0 + !byte $8C + !byte $8E + !byte $98 + !byte $E6 + !byte $80 + !byte $B8 + !byte $FC + !byte $B6 + !byte $BC + !byte $EC + !byte $BC + !byte $BE + !byte $FC + !byte $B6 + !byte $80 + !byte $B0 + !byte $E6 + !byte $98 + !byte $E6 + !byte $BE + !byte $BC + !byte $BE + !byte $FC + !byte $BC + !byte $F8 + !byte $FE + !byte $E6 + !byte $E6 + !byte $E6 + !byte $E6 + !byte $E6 + !byte $FE + !byte $98 + !byte $9C + !byte $8C + !byte $EC + !byte $FF +FontDataRow3 + !byte $FF + !byte $FE + !byte $BF + !byte $9C + !byte $BE + !byte $BE + !byte $F8 + !byte $8F + !byte $F8 + !byte $8F + !byte $88 + !byte $9C + !byte $BE + !byte $BE + !byte $FF + !byte $98 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $E6 + !byte $E6 + !byte $9C + !byte $E0 + !byte $FF + !byte $80 + !byte $98 + !byte $80 + !byte $FF + !byte $BE + !byte $BC + !byte $F6 + !byte $80 + !byte $8C + !byte $98 + !byte $FC + !byte $FE + !byte $80 + !byte $BE + !byte $80 + !byte $9C + !byte $EE + !byte $98 + !byte $BE + !byte $BC + !byte $FE + !byte $FE + !byte $FE + !byte $98 + !byte $BC + !byte $FC + !byte $80 + !byte $80 + !byte $8E + !byte $80 + !byte $F0 + !byte $F8 + !byte $FB + !byte $E3 + !byte $BB + !byte $83 + !byte $E3 + !byte $BB + !byte $BB + !byte $FB + !byte $FB + !byte $9C + !byte $E0 + !byte $9B + !byte $83 + !byte $FF + !byte $FF + !byte $E3 + !byte $E3 + !byte $E3 + !byte $E3 + !byte $BF + !byte $9C + !byte $E3 + !byte $E3 + !byte $E3 + !byte $BE + !byte $B6 + !byte $B8 + !byte $8C + !byte $9C + !byte $98 + !byte $80 + !byte $80 + !byte $80 + !byte $E6 + !byte $E6 + !byte $86 + !byte $E6 + !byte $E6 + !byte $8C + !byte $E6 + !byte $E6 + !byte $9C + !byte $80 + !byte $B6 + !byte $98 + !byte $FE + !byte $E6 + !byte $E6 + !byte $E6 + !byte $E6 + !byte $86 + !byte $9C + !byte $8C + !byte $E6 + !byte $E6 + !byte $E6 + !byte $BC + !byte $E6 + !byte $B0 + !byte $8E + !byte $9C + !byte $B8 + !byte $FE + !byte $FF +FontDataRow4 + !byte $FF + !byte $FE + !byte $BF + !byte $9C + !byte $BE + !byte $BE + !byte $FC + !byte $9F + !byte $F0 + !byte $87 + !byte $80 + !byte $9C + !byte $BE + !byte $BE + !byte $BE + !byte $BC + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $E6 + !byte $B6 + !byte $98 + !byte $E6 + !byte $E3 + !byte $80 + !byte $98 + !byte $80 + !byte $B6 + !byte $F8 + !byte $9E + !byte $E3 + !byte $80 + !byte $8C + !byte $98 + !byte $9F + !byte $FE + !byte $80 + !byte $BE + !byte $80 + !byte $8E + !byte $E6 + !byte $98 + !byte $86 + !byte $E0 + !byte $FC + !byte $E0 + !byte $E6 + !byte $9C + !byte $E6 + !byte $E0 + !byte $98 + !byte $98 + !byte $9C + !byte $BE + !byte $B8 + !byte $BC + !byte $BB + !byte $FB + !byte $BB + !byte $83 + !byte $E3 + !byte $BB + !byte $BB + !byte $FB + !byte $FB + !byte $9C + !byte $E0 + !byte $9B + !byte $83 + !byte $EB + !byte $FB + !byte $E3 + !byte $FB + !byte $E3 + !byte $BB + !byte $BE + !byte $9C + !byte $E3 + !byte $F7 + !byte $EB + !byte $9C + !byte $BE + !byte $9C + !byte $8C + !byte $B8 + !byte $98 + !byte $80 + !byte $80 + !byte $80 + !byte $E6 + !byte $E6 + !byte $86 + !byte $E6 + !byte $B6 + !byte $8C + !byte $FC + !byte $E6 + !byte $98 + !byte $B0 + !byte $9E + !byte $98 + !byte $FE + !byte $E6 + !byte $E6 + !byte $E6 + !byte $E6 + !byte $86 + !byte $B0 + !byte $8C + !byte $E6 + !byte $BC + !byte $FE + !byte $98 + !byte $EC + !byte $8C + !byte $8E + !byte $9C + !byte $B8 + !byte $B6 + !byte $FF +FontDataRow5 + !byte $80 + !byte $9C + !byte $9C + !byte $9C + !byte $9C + !byte $BE + !byte $BC + !byte $9E + !byte $80 + !byte $80 + !byte $80 + !byte $88 + !byte $9C + !byte $BE + !byte $9C + !byte $E6 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $EE + !byte $9E + !byte $B8 + !byte $FE + !byte $FB + !byte $80 + !byte $80 + !byte $80 + !byte $FF + !byte $FF + !byte $8F + !byte $E3 + !byte $80 + !byte $8C + !byte $98 + !byte $9C + !byte $98 + !byte $98 + !byte $80 + !byte $98 + !byte $87 + !byte $FE + !byte $98 + !byte $FE + !byte $FE + !byte $E0 + !byte $FE + !byte $FE + !byte $9C + !byte $FE + !byte $FE + !byte $98 + !byte $98 + !byte $B8 + !byte $BE + !byte $9C + !byte $80 + !byte $83 + !byte $FB + !byte $E3 + !byte $83 + !byte $E3 + !byte $83 + !byte $83 + !byte $E3 + !byte $E3 + !byte $9C + !byte $E3 + !byte $B3 + !byte $83 + !byte $E3 + !byte $F3 + !byte $E3 + !byte $BB + !byte $FF + !byte $BB + !byte $E0 + !byte $9C + !byte $E3 + !byte $BE + !byte $FF + !byte $BE + !byte $9C + !byte $8E + !byte $8C + !byte $F0 + !byte $98 + !byte $80 + !byte $80 + !byte $80 + !byte $EE + !byte $FE + !byte $FE + !byte $FE + !byte $9E + !byte $8C + !byte $E0 + !byte $E6 + !byte $B8 + !byte $B0 + !byte $BE + !byte $B8 + !byte $E6 + !byte $E6 + !byte $FE + !byte $FE + !byte $EE + !byte $86 + !byte $FE + !byte $FC + !byte $EE + !byte $BC + !byte $FE + !byte $BC + !byte $E0 + !byte $FE + !byte $98 + !byte $9C + !byte $8C + !byte $80 + !byte $FF +FontDataRow6 + !byte $80 + !byte $80 + !byte $80 + !byte $9C + !byte $9C + !byte $9C + !byte $9C + !byte $9C + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $9C + !byte $88 + !byte $80 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $EC + !byte $FC + !byte $B8 + !byte $BC + !byte $FB + !byte $80 + !byte $98 + !byte $80 + !byte $FF + !byte $BE + !byte $E7 + !byte $FF + !byte $80 + !byte $8C + !byte $98 + !byte $B6 + !byte $98 + !byte $98 + !byte $80 + !byte $98 + !byte $83 + !byte $BC + !byte $98 + !byte $FE + !byte $BE + !byte $E0 + !byte $BE + !byte $BC + !byte $9C + !byte $BC + !byte $BE + !byte $80 + !byte $8C + !byte $F0 + !byte $80 + !byte $8E + !byte $98 + !byte $FF + !byte $E3 + !byte $FF + !byte $FF + !byte $FB + !byte $FF + !byte $83 + !byte $FF + !byte $E3 + !byte $BE + !byte $FF + !byte $F3 + !byte $FF + !byte $E3 + !byte $E3 + !byte $FF + !byte $83 + !byte $BE + !byte $F3 + !byte $FF + !byte $9C + !byte $FF + !byte $9C + !byte $F7 + !byte $F7 + !byte $9C + !byte $FF + !byte $8C + !byte $E0 + !byte $98 + !byte $80 + !byte $FF + !byte $80 + !byte $EC + !byte $BE + !byte $BC + !byte $FC + !byte $FC + !byte $8C + !byte $FE + !byte $E6 + !byte $B8 + !byte $BE + !byte $F6 + !byte $B8 + !byte $E6 + !byte $E6 + !byte $BC + !byte $BE + !byte $EC + !byte $86 + !byte $BC + !byte $B8 + !byte $EC + !byte $98 + !byte $E6 + !byte $E6 + !byte $FE + !byte $FE + !byte $98 + !byte $9C + !byte $8C + !byte $80 + !byte $FF +FontDataRow7 + !byte $00 + !byte $80 + !byte $80 + !byte $9C + !byte $9C + !byte $80 + !byte $9C + !byte $9C + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $00 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $E3 + !byte $80 + !byte $98 + !byte $80 + !byte $B6 + !byte $98 + !byte $F3 + !byte $BE + !byte $80 + !byte $98 + !byte $8C + !byte $E3 + !byte $80 + !byte $8C + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $8C + !byte $80 + !byte $80 + !byte $80 + !byte $98 + !byte $BE + !byte $E3 + !byte $BF + !byte $FE + !byte $BB + !byte $FF + !byte $83 + !byte $BE + !byte $E3 + !byte $BE + !byte $BE + !byte $E3 + !byte $FF + !byte $E3 + !byte $E3 + !byte $BE + !byte $83 + !byte $F0 + !byte $E3 + !byte $BF + !byte $9C + !byte $BE + !byte $88 + !byte $E3 + !byte $E3 + !byte $9C + !byte $FF + !byte $9C + !byte $80 + !byte $9C + !byte $80 + !byte $FF + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $BC + !byte $80 + !byte $80 + !byte $9C + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $86 + !byte $E0 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $80 + !byte $BC + !byte $80 + !byte $B0 + !byte $9C + !byte $86 + !byte $80 + !byte $FF diff --git a/src/ui.search.mode.a b/src/ui.search.mode.a new file mode 100644 index 000000000..7d81c52b6 --- /dev/null +++ b/src/ui.search.mode.a @@ -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" diff --git a/src/unused.a b/src/unused.a index 67fcc760b..734b4a3af 100644 --- a/src/unused.a +++ b/src/unused.a @@ -37,3 +37,68 @@ cover128 cover128_b !text "COVER.A2FC" 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 +