From 7f6d3752c0fab27b7f2de82ed3c221e601c43956 Mon Sep 17 00:00:00 2001 From: Martin Haye Date: Thu, 13 Jun 2019 09:50:11 -0700 Subject: [PATCH] Story mode fully working now. --- Platform/Apple/virtual/src/font/fontEngine.s | 51 +++++++++++--------- Platform/Apple/virtual/src/plasma/story.pla | 2 - 2 files changed, 29 insertions(+), 24 deletions(-) diff --git a/Platform/Apple/virtual/src/font/fontEngine.s b/Platform/Apple/virtual/src/font/fontEngine.s index 6112de0e..f4224d86 100644 --- a/Platform/Apple/virtual/src/font/fontEngine.s +++ b/Platform/Apple/virtual/src/font/fontEngine.s @@ -879,21 +879,8 @@ Pa_Tskp LDA AscChar BNE Pa_Lp1 Pa_ToFr !if DEBUG { +prChr '+' } ; MH: Added scroll lock checking - LDA ScrlLck_Flg ;check for scroll-lock mode - BEQ Pa_CBig ;if not locked, skip check for scroll - LDA CursRow ;current vertical coord - CLC - ADC #9 ;increment by 9 lines, down - CMP CursYb ;check if it's past the window end - BCC Pa_CBig ;if not then continue - LDY PrsAdrH ;calc adr of next word that would display - LDA PrsAdrL - CLC - ADC Pa_iBgn - BCC + - INY -+ RTS ;and return early without scrolling -Pa_CBig LDA Pa_WdCt ;if we didn't print any words yet, then it's + JSR Pa_ScCk + LDA Pa_WdCt ;if we didn't print any words yet, then it's BEQ Pa_BgWd ; a word too big for line: split it LDA #$8D STA AscChar @@ -929,25 +916,45 @@ Pa_Dn2b LDA TtlWdth CMP LinWdth BPL Pa_Dn3 LDA (PrsAdrL),Y ;Get the character + ORA #$80 + !if DEBUG { +prChr '>' : +safeCout } CMP #$8D - BEQ Pa_Dn3 - STA AscChar - !if DEBUG { +prChr '>' : ora #$80 : +safeCout } + BNE Pa_Dn2c + INC Pa_iBgn + JSR Pa_ScCk + DEC Pa_iBgn + LDA (PrsAdrL),Y +Pa_Dn2c STA AscChar JSR TestChr - JMP Pa_Dn4 + LDY Pa_iSv + INY + JMP Pa_Lp0 Pa_Dn3 LDY Pa_iSv LDA Pa_WdCt ;if we split a big word, then the splitting BMI Pa_Dn3b ; char needs to be printed too INY Pa_Dn3b STY Pa_iBgn JMP Pa_ToFr -Pa_Dn4 LDY Pa_iSv - INY - JMP Pa_Lp0 ParsDn !if DEBUG { +prChr '<' : +crout : BIT $C053 } LDA #0 ;return null to indicate all chars parsed TAY RTS +Pa_ScCk LDA ScrlLck_Flg ;check for scroll-lock mode + BEQ + ;if not locked, skip check for scroll + LDA CursRow ;current vertical coord + CLC + ADC #9 ;increment by 9 lines, down + CMP CursYb ;check if it's past the window end + BCC + ;if not then continue + PLA ;return early without scrolling + PLA + LDY PrsAdrH ;calc adr of next word that would display + LDA PrsAdrL + CLC + ADC Pa_iBgn + BCC + + INY ++ RTS ; ;Routine: Calculate width of string without plotting it diff --git a/Platform/Apple/virtual/src/plasma/story.pla b/Platform/Apple/virtual/src/plasma/story.pla index e6637948..55ab6036 100644 --- a/Platform/Apple/virtual/src/plasma/story.pla +++ b/Platform/Apple/virtual/src/plasma/story.pla @@ -124,7 +124,6 @@ def displayStoryBlock()#1 fin bak = ^p ^p = len - printf2("pStoryCur=$%x len=%x\n", pStoryCur, len) pNext = displayStrNoScroll(p) ^p = bak if pNext @@ -132,7 +131,6 @@ def displayStoryBlock()#1 break else pStoryCur = pStoryCur + len - rdkey fin loop return pStoryCur < pStoryEnd