From bf7bd82b24b38c2ee84bffea9342daad78294096 Mon Sep 17 00:00:00 2001 From: 4am Date: Fri, 25 Sep 2020 23:32:51 -0400 Subject: [PATCH] demo [WIP] --- src/storage.a | 6 +++--- src/ui.demo.a | 33 +++++++++++++++++++++++++++------ src/ui.font.heavy.silk.a | 2 +- src/ui.play.a | 13 ++++++++----- 4 files changed, 39 insertions(+), 15 deletions(-) diff --git a/src/storage.a b/src/storage.a index dc0abe6..7f51128 100644 --- a/src/storage.a +++ b/src/storage.a @@ -59,7 +59,7 @@ MaybeLoadWorldFromDisk !word $2F00 ; maximum length !word WORLDFILEBUFFER ; address of ProDOS file buffer bcs @exit - jsr @PreParseWorldData + jsr PreParseWorldData cpx #100 bne + clc @@ -72,7 +72,7 @@ MaybeLoadWorldFromDisk !byte 1 ; length !raw $FD ; SMC -@PreParseWorldData +PreParseWorldData ; find the starting address of each of the 100 puzzles in this world ; in: $9000+ contains raw world data from disk lda #$FF @@ -107,7 +107,7 @@ MaybeLoadWorldFromDisk lda ($FE),y cmp #$0D ; CR - hide it beq @IncAndGetChar - rts +@exit rts ;------------------------------------------------------------------------------ ; LoadProgressFromDisk diff --git a/src/ui.demo.a b/src/ui.demo.a index 6a9c6c0..fe34181 100644 --- a/src/ui.demo.a +++ b/src/ui.demo.a @@ -19,6 +19,8 @@ ; all other registers & flags clobbered ;------------------------------------------------------------------------------ RunDemo + jsr Home + jsr LoadDemoPuzzles +LDADDR DemoCode +ST16 GetNextDemoByte+1 - jsr GetNextDemoByte @@ -31,13 +33,24 @@ RunDemo bpl - jsr DemoOnEXIT ; does not return -LoadDemoPuzzle - ; TODO - rts +LoadDemoPuzzles + ldx #0 +- lda demoPuzzles, x + sta WORLDDATA, x + inx + bne - + jmp PreParseWorldData DrawDemoPuzzleChrome - ; TODO - rts + +PRINT_AT sDemo, 2, 33 + lda gPuzzleID + clc + adc #$31 + sta @s+1 + +LDADDR @s + jsr DrawHeavySilkString + jmp DrawPuzzleChromeCommon +@s !byte 1,$FD DemoOnEXIT lda #$FF @@ -58,7 +71,7 @@ DemoOnLOAD jsr InitPuzzleStorage jsr InitPuzzleSound ldx gPuzzleID - jsr LoadDemoPuzzle + jsr LoadPuzzleFromMemory lda #0 sta gSelectedLogicalColumn jsr DrawDemoPuzzleChrome @@ -126,6 +139,14 @@ UP = 6 DOWN = 7 WAIT = 8 +demoPuzzles + !raw "AOCD,LTLE,IBUH|ABLE,ITCH,LOUD",$0A + !raw "[" + +sDemo + !byte 6 + !raw "DEMO-0" + sUpDown !byte 24 !raw "MOVE COLUMNS UP AND DOWN" diff --git a/src/ui.font.heavy.silk.a b/src/ui.font.heavy.silk.a index 9aaa7f9..18ba06c 100644 --- a/src/ui.font.heavy.silk.a +++ b/src/ui.font.heavy.silk.a @@ -10,7 +10,7 @@ ; ;------------------------------------------------------------------------------ -; DrawLargeCharacter +; DrawHeavySilkString ; ; in: A/Y contains address of length-prefixed string (length 1..40, ; characters 0x20..0x5A only) diff --git a/src/ui.play.a b/src/ui.play.a index 82c6588..f6f558a 100644 --- a/src/ui.play.a +++ b/src/ui.play.a @@ -311,10 +311,6 @@ AnimatePuzzleIntoPlace ; out: all registers and flags clobbered ;------------------------------------------------------------------------------ DrawPuzzleChrome - +PRINT_AT sTitleLine1, 0, 0 - +PRINT_AT sTitleLine2, 1, 0 - +PRINT_AT sTitleLine3, 2, 0 - +PRINT_AT sLevel, 0, 34 +LDADDR kWorldShortNames +ST16 $FE lda gWorldID @@ -339,7 +335,14 @@ DrawPuzzleChrome lda #$30 ; padding character ('0') jsr ToASCIIString +LDADDR $00F1 - jmp DrawHeavySilkString + jsr DrawHeavySilkString +DrawPuzzleChromeCommon + +PRINT_AT sTitleLine1, 0, 0 + +PRINT_AT sTitleLine2, 1, 0 + +PRINT_AT sTitleLine3, 2, 0 + +PRINT_AT sLevel, 0, 34 + rts + ;------------------------------------------------------------------------------ ; AnimatePuzzleCompleted