From d3b96a7e1b1249de4b7ed0c94c10ebd1832b2719 Mon Sep 17 00:00:00 2001 From: 4am Date: Mon, 5 Feb 2018 16:29:29 -0500 Subject: [PATCH] load strings from datafile works --- src/config.a | 26 +++++++++++++------ src/pitchdark.a | 67 ++++++++++++++++--------------------------------- 2 files changed, 39 insertions(+), 54 deletions(-) diff --git a/src/config.a b/src/config.a index 5736c87..20710db 100644 --- a/src/config.a +++ b/src/config.a @@ -159,14 +159,6 @@ parseloop lda #$FF sta bFoundCR bra .next -+ cmp #$5E ; '^' -> closed-apple mousetext - bne + - lda #$40 - sta ($00) -+ cmp #$26 ; '&' -> open-apple mousetext - bne + - lda #$41 - sta ($00) + cmp #$5B ; '[' is section name start delimiter beq .startsectionname cmp #$5D ; ']' is section name end delimiter @@ -174,6 +166,24 @@ parseloop bit bInSectionName bmi .parsesectionname bvs .next + + tax + beq .nohighbit ++ cmp #$5E ; '^' -> closed-apple mousetext + bne + + lda #$40 + sta ($00) + bra .nohighbit ++ cmp #$26 ; '&' -> open-apple mousetext + bne .highbit + lda #$41 + sta ($00) + bra .nohighbit +.highbit + ora #$80 + sta ($00) +.nohighbit + bit bFoundCR bpl .next stz bFoundCR diff --git a/src/pitchdark.a b/src/pitchdark.a index 6c12b91..b271512 100644 --- a/src/pitchdark.a +++ b/src/pitchdark.a @@ -75,53 +75,36 @@ Init sta PARAM1 jsr WeeGUI + lda addrInfo + sta $00 + lda addrInfo+1 + sta $01 + stz .line+1 +infoloop ldx #WGSetCursor stz PARAM0 - stz PARAM1 - jsr WeeGUI - ldx #WGPrint - lda #string_info1 - sta PARAM1 - jsr WeeGUI - - ldx #WGSetCursor - stz PARAM0 - lda #1 +.line lda #$FD ; set at runtime sta PARAM1 jsr WeeGUI ldx #WGPrint - lda #string_info2 - sta PARAM1 - jsr WeeGUI - - ldx #WGSetCursor - stz PARAM0 - lda #3 - sta PARAM1 - jsr WeeGUI - ldx #WGPrint - lda #string_info3 - sta PARAM1 - jsr WeeGUI - - ldx #WGSetCursor - stz PARAM0 - lda #5 - sta PARAM1 - jsr WeeGUI - ldx #WGPrint - lda #string_info4 + lda $01 sta PARAM1 bit MAGICRTS ; set overflow bit jsr WeeGUI + bit #%00000000 +- lda ($00) + bne + + bit MAGICRTS ++ inc $00 + bne + + inc $01 ++ bvc - + inc .line+1 + lda .line+1 + cmp #$06 + bne infoloop bit $c010 - lda $c000 @@ -258,14 +241,6 @@ view_info !byte 7 ; visible height !byte 20 ; width !byte 7 ; height -string_info1 - !text " ZORK I: THE GREAT ",0 -string_info2 - !text " UNDERGROUND EMPIRE ",0 -string_info3 - !text "1980 Fantasy",0 -string_info4 - !text "Difficulty: ",64,64,64,65,65,0 view_blurb !byte 12 ; view ID