From 6c56c915bdaa92c1ba56768e3a644f802a7f0183 Mon Sep 17 00:00:00 2001 From: Vince Weaver Date: Tue, 25 Feb 2025 22:29:25 -0500 Subject: [PATCH] starpath: working assembly code --- graphics/gr/starpath/starpath.s | 21 ++++++++++++--------- 1 file changed, 12 insertions(+), 9 deletions(-) diff --git a/graphics/gr/starpath/starpath.s b/graphics/gr/starpath/starpath.s index 4cc1be9b..aef230c0 100644 --- a/graphics/gr/starpath/starpath.s +++ b/graphics/gr/starpath/starpath.s @@ -59,13 +59,13 @@ loop3: tay ; multiply Y*4*D lda D - jsr mul8 + jsr mul8 ; definitely 8-bit mul in original sta YPH ; store out to YPH:YPL lda PRODLO sta YPL - lda XPOS ; XP=(X*6)-D + lda XPOS ; XP=(X*6)-D curve X by depth asl sta XPL asl @@ -79,7 +79,7 @@ loop3: sbc D sta XPL - bpl loop4 ;IF XP<0 THEN + bcs loop4 ; IF XP<0 THEN if left then draw sky lda #31 ; C=31 sta C @@ -96,17 +96,20 @@ loop3: jmp loop7 ; GOTO7 loop4: - ; Q=XP*D/256 + ; Q=XP*D/256 multiply X by current depth + ; want high part + ; definitely 8-bit mul ldy XPL lda D jsr mul8 - ora YPH ; R=YP/256 - sta Q ; Q=ora Q,R - + ora YPH ; R=YP/256 + sta Q ; Q=ora Q,R + ; or for texture pattern clc - lda D ;and D+F + lda D ; add depth plus frame D+F adc FRAME - and Q + + and Q ; mask geometry by time shifted depth sta C inc D ; D=D+1