From 6c22417d4a05b662ab10f848202916df2501b1f8 Mon Sep 17 00:00:00 2001 From: Martin Haye Date: Thu, 13 Jun 2019 08:50:38 -0700 Subject: [PATCH] More reliable checks for the destruction of 3D rasterizer's line table on aux zp. --- Platform/Apple/virtual/src/core/mem.s | 2 ++ Platform/Apple/virtual/src/include/mem.i | 1 + Platform/Apple/virtual/src/marks/marks.s | 2 ++ Platform/Apple/virtual/src/raycast/render.s | 14 ++++++++++++-- 4 files changed, 17 insertions(+), 2 deletions(-) diff --git a/Platform/Apple/virtual/src/core/mem.s b/Platform/Apple/virtual/src/core/mem.s index fcee6ce2..214eb6b4 100644 --- a/Platform/Apple/virtual/src/core/mem.s +++ b/Platform/Apple/virtual/src/core/mem.s @@ -325,6 +325,7 @@ loMemBegin: !pseudopc $800 { jmp __internalErr _fixedRTS: rts ; fixed place to find RTS, for setting V flag +_diskOpCt !byte 0 ; count of disk ops since last render __aux_dispatch: sec @@ -411,6 +412,7 @@ _jbrk jmp $1111 ; self-modified by init ; Clear carry to call opendir, set carry to call rdwrpart ; On return, A contains status (for opendir only) callProRWTS: + inc _diskOpCt ; Copy the parameters to aux zero page ldx #$F - sta clrAuxZP diff --git a/Platform/Apple/virtual/src/include/mem.i b/Platform/Apple/virtual/src/include/mem.i index b3c5bda7..6750bd7b 100644 --- a/Platform/Apple/virtual/src/include/mem.i +++ b/Platform/Apple/virtual/src/include/mem.i @@ -513,6 +513,7 @@ _crout = _prY+3 _waitKey = _crout+3 _internalErr = _waitKey+3 fixedRTS = _internalErr+3 +diskOpCt = fixedRTS+1 ; Debug macros !macro safeBell { diff --git a/Platform/Apple/virtual/src/marks/marks.s b/Platform/Apple/virtual/src/marks/marks.s index a26d3ced..67d19af3 100644 --- a/Platform/Apple/virtual/src/marks/marks.s +++ b/Platform/Apple/virtual/src/marks/marks.s @@ -14,6 +14,7 @@ !convtab "../include/hiBitAscii.ct" ; Other equates +!source "../include/mem.i" !source "../include/prorwts.i" target = $3 ; len 1 @@ -256,6 +257,7 @@ _writeMarks: !zone sec ; fall through to final ProRWTS command callProRWTS: + inc diskOpCt stx sizelo sty sizehi sta reqcmd diff --git a/Platform/Apple/virtual/src/raycast/render.s b/Platform/Apple/virtual/src/raycast/render.s index 6f6986f7..f160dbcb 100644 --- a/Platform/Apple/virtual/src/raycast/render.s +++ b/Platform/Apple/virtual/src/raycast/render.s @@ -1959,9 +1959,19 @@ pl_render: !zone bne + lda $2001 cmp $4001 + bne + + lda $2C00 + cmp $4C00 + bne + + lda $2C01 + cmp $4C01 + bne + + lda diskOpCt ; check if any disk ops (ProRWTS can use aux zp) beq ++ -+ jsr copyScreen ; if it was, restore by copying hgr1 to hgr2 - jsr makeLines ++ jsr copyScreen ; restore by copying hgr1 to hgr2 + jsr makeLines ; and regenerate line pointers on aux zp + lda #0 + sta diskOpCt ++ jmp renderFrame ; then go ahead and render ;-------------------------------------------------------------------------------