From 8af3721308016804cca53f640705d3ace267c499 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 22 Jan 2023 12:47:24 -0800 Subject: [PATCH 1/2] tweaks --- mandel.s | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/mandel.s b/mandel.s index f4862c6..0a21202 100644 --- a/mandel.s +++ b/mandel.s @@ -436,11 +436,16 @@ keep_going: .macro quick_exit arg .local keep_going + .local keep_going2 lda arg + 1 cmp #(4 << 4) bmi keep_going rts keep_going: + cmp #(256 - (4 << 4)) + bpl keep_going2 + rts + keep_going2: .endmacro ; 4.12: (-8 .. +7.9) @@ -452,18 +457,19 @@ keep_going: ; zy = zx_zy + zx_zy + cy add16 zy, zx_zy, zx_zy add16 zy, zy, cy + quick_exit zy ; zx_2 = zx * zx imul16_round zx_2, zx, zx, 4 - quick_exit dist + quick_exit zx_2 ; zy_2 = zy * zy imul16_round zy_2, zy, zy, 4 - quick_exit dist + quick_exit zy_2 ; zx_zy = zx * zy imul16_round zx_zy, zx, zy, 4 - quick_exit dist + quick_exit zx_zy ; dist = zx_2 + zy_2 add16 dist, zx_2, zy_2 From 0afed893a672d5f54122a4f8dcf2f10eb50cdb90 Mon Sep 17 00:00:00 2001 From: Brion Vibber Date: Sun, 22 Jan 2023 12:57:52 -0800 Subject: [PATCH 2/2] whoops now produces correct fractal but iterations outside are sometimes wrong probably range errrs in intermediate calc --- mandel.s | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mandel.s b/mandel.s index 0a21202..d5b62e5 100644 --- a/mandel.s +++ b/mandel.s @@ -397,7 +397,7 @@ neg2: positive: inc arg + 2 ; 5 cyc - beq next ; 2 cyc + bne next ; 2 cyc inc arg + 3 ; 5 cyc zero: