diff --git a/src/main/kc/stdlib/atan2.kc b/src/main/kc/stdlib/atan2.kc index 5a7129e7c..be4c9bed8 100644 --- a/src/main/kc/stdlib/atan2.kc +++ b/src/main/kc/stdlib/atan2.kc @@ -14,8 +14,8 @@ word[CORDIC_ITERATIONS_16] CORDIC_ATAN2_ANGLES_16 = kickasm {{ // Finding the angle requires a binary search using CORDIC_ITERATIONS_16 // Returns the angle in hex-degrees (0=0, 0x8000=PI, 0x10000=2*PI) word atan2_16(signed word x, signed word y) { - signed word yi = (y>0)?y:-y; - signed word xi = (x>0)?x:-x; + signed word yi = (y>=0)?y:-y; + signed word xi = (x>=0)?x:-x; word angle = 0; for( byte i: 0..CORDIC_ITERATIONS_16-1) { if(yi==0) { @@ -24,7 +24,7 @@ word atan2_16(signed word x, signed word y) { } signed word xd = xi>>i; signed word yd = yi>>i; - if(yi>0) { + if(yi>=0) { xi += yd; yi -= xd; angle += CORDIC_ATAN2_ANGLES_16[i]; diff --git a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java index da4e00733..7331fea05 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java @@ -42,7 +42,7 @@ public class TestPrograms { @Test public void testScreenCenterAngle() throws IOException, URISyntaxException { - compileAndCompare("screen-center-angle"); + compileAndCompare("screen-center-angle", log()); } @Test diff --git a/src/test/kc/screen-center-angle.kc b/src/test/kc/screen-center-angle.kc index 56e5bb965..741000315 100644 --- a/src/test/kc/screen-center-angle.kc +++ b/src/test/kc/screen-center-angle.kc @@ -5,8 +5,6 @@ import "c64" import "font-hex" import "atan2" -#reserve(08) - const byte* CHARSET = 0x2000; const byte* SCREEN = 0x2800; diff --git a/src/test/ref/screen-center-angle.asm b/src/test/ref/screen-center-angle.asm index c90244cfa..2a382aa8a 100644 --- a/src/test/ref/screen-center-angle.asm +++ b/src/test/ref/screen-center-angle.asm @@ -20,10 +20,10 @@ main: { // The actual value stored is distance*2 to increase precision // init_angle_screen(byte* zeropage(3) screen) init_angle_screen: { - .label _7 = $c - .label xw = $17 - .label yw = $19 - .label angle_w = $c + .label _7 = $a + .label xw = $15 + .label yw = $17 + .label angle_w = $a .label screen = 3 .label y = 2 lda #(signed byte) 0) goto atan2_16::@1 + [29] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1 to:atan2_16::@2 atan2_16::@2: scope:[atan2_16] from atan2_16 [30] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0 to:atan2_16::@3 atan2_16::@3: scope:[atan2_16] from atan2_16::@1 atan2_16::@2 [31] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#11 atan2_16::@2/(signed word~) atan2_16::$2 ) - [32] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4 + [32] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4 to:atan2_16::@5 atan2_16::@5: scope:[atan2_16] from atan2_16::@3 [33] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0 diff --git a/src/test/ref/screen-center-angle.log b/src/test/ref/screen-center-angle.log index a28461a81..e38deea4b 100644 --- a/src/test/ref/screen-center-angle.log +++ b/src/test/ref/screen-center-angle.log @@ -162,7 +162,7 @@ init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5 atan2_16: scope:[atan2_16] from init_angle_screen::@2 (signed word) atan2_16::x#9 ← phi( init_angle_screen::@2/(signed word) atan2_16::x#0 ) (signed word) atan2_16::y#1 ← phi( init_angle_screen::@2/(signed word) atan2_16::y#0 ) - (bool~) atan2_16::$0 ← (signed word) atan2_16::y#1 > (number) 0 + (bool~) atan2_16::$0 ← (signed word) atan2_16::y#1 >= (number) 0 if((bool~) atan2_16::$0) goto atan2_16::@1 to:atan2_16::@2 atan2_16::@1: scope:[atan2_16] from atan2_16 @@ -181,7 +181,7 @@ atan2_16::@3: scope:[atan2_16] from atan2_16::@1 atan2_16::@2 (signed word) atan2_16::x#1 ← phi( atan2_16::@1/(signed word) atan2_16::x#5 atan2_16::@2/(signed word) atan2_16::x#6 ) (signed word~) atan2_16::$4 ← phi( atan2_16::@1/(signed word~) atan2_16::$3 atan2_16::@2/(signed word~) atan2_16::$2 ) (signed word) atan2_16::yi#0 ← (signed word~) atan2_16::$4 - (bool~) atan2_16::$5 ← (signed word) atan2_16::x#1 > (number) 0 + (bool~) atan2_16::$5 ← (signed word) atan2_16::x#1 >= (number) 0 if((bool~) atan2_16::$5) goto atan2_16::@4 to:atan2_16::@5 atan2_16::@4: scope:[atan2_16] from atan2_16::@3 @@ -722,8 +722,8 @@ Adding number conversion cast (unumber) 5 in (byte*) init_font_hex::proto_lo#1 Adding number conversion cast (unumber) 8 in (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#4 + (number) 8 Adding number conversion cast (unumber) 5 in (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#3 + (number) 5 Adding number conversion cast (unumber) $f in (byte) CORDIC_ITERATIONS_16#0 ← (number) $f -Adding number conversion cast (snumber) 0 in (bool~) atan2_16::$0 ← (signed word) atan2_16::y#1 > (number) 0 -Adding number conversion cast (snumber) 0 in (bool~) atan2_16::$5 ← (signed word) atan2_16::x#1 > (number) 0 +Adding number conversion cast (snumber) 0 in (bool~) atan2_16::$0 ← (signed word) atan2_16::y#1 >= (number) 0 +Adding number conversion cast (snumber) 0 in (bool~) atan2_16::$5 ← (signed word) atan2_16::x#1 >= (number) 0 Adding number conversion cast (unumber) 0 in (word) atan2_16::angle#0 ← (number) 0 Adding number conversion cast (unumber) 1 in (number~) atan2_16::$16 ← (byte) CORDIC_ITERATIONS_16#0 - (number) 1 Adding number conversion cast (unumber) atan2_16::$16 in (number~) atan2_16::$16 ← (byte) CORDIC_ITERATIONS_16#0 - (unumber)(number) 1 @@ -999,8 +999,8 @@ Successful SSA optimization Pass2IdenticalPhiElimination Simple Condition (bool~) init_font_hex::$3 [20] if((byte) init_font_hex::i#1!=rangelast(0,4)) goto init_font_hex::@3 Simple Condition (bool~) init_font_hex::$4 [30] if((byte) init_font_hex::c1#1!=rangelast(0,$f)) goto init_font_hex::@2 Simple Condition (bool~) init_font_hex::$5 [35] if((byte) init_font_hex::c#1!=rangelast(0,$f)) goto init_font_hex::@1 -Simple Condition (bool~) atan2_16::$0 [42] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1 -Simple Condition (bool~) atan2_16::$5 [51] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4 +Simple Condition (bool~) atan2_16::$0 [42] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1 +Simple Condition (bool~) atan2_16::$5 [51] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4 Simple Condition (bool~) atan2_16::$18 [65] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@16 Simple Condition (bool~) atan2_16::$21 [72] if((signed word) atan2_16::yi#3>(signed byte) 0) goto atan2_16::@18 Simple Condition (bool~) atan2_16::$11 [77] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7 @@ -1330,14 +1330,14 @@ init_angle_screen::@return: scope:[init_angle_screen] from init_angle_screen::@ [28] return to:@return atan2_16: scope:[atan2_16] from init_angle_screen::@2 - [29] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1 + [29] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1 to:atan2_16::@2 atan2_16::@2: scope:[atan2_16] from atan2_16 [30] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0 to:atan2_16::@3 atan2_16::@3: scope:[atan2_16] from atan2_16::@1 atan2_16::@2 [31] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#11 atan2_16::@2/(signed word~) atan2_16::$2 ) - [32] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4 + [32] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4 to:atan2_16::@5 atan2_16::@5: scope:[atan2_16] from atan2_16::@3 [33] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0 @@ -1626,33 +1626,33 @@ Allocated zp ZP_BYTE:2 [ init_angle_screen::y#4 init_angle_screen::y#1 ] Allocated zp ZP_BYTE:3 [ init_angle_screen::x#2 init_angle_screen::x#1 ] Allocated zp ZP_WORD:4 [ init_angle_screen::screen#2 init_angle_screen::screen#4 init_angle_screen::screen#1 ] Allocated zp ZP_WORD:6 [ atan2_16::yi#3 atan2_16::yi#7 atan2_16::yi#0 atan2_16::yi#11 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ] -Allocated zp ZP_WORD:9 [ atan2_16::xi#3 atan2_16::xi#7 atan2_16::xi#0 atan2_16::xi#8 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] -Allocated zp ZP_BYTE:11 [ atan2_16::i#2 atan2_16::i#1 ] -Allocated zp ZP_WORD:12 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] -Allocated zp ZP_WORD:14 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] -Allocated zp ZP_WORD:16 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] -Allocated zp ZP_BYTE:18 [ init_font_hex::c#6 init_font_hex::c#1 ] -Allocated zp ZP_WORD:19 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] -Allocated zp ZP_WORD:21 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] -Allocated zp ZP_BYTE:23 [ init_font_hex::c1#4 init_font_hex::c1#1 ] -Allocated zp ZP_BYTE:24 [ init_font_hex::i#2 init_font_hex::i#1 ] -Allocated zp ZP_BYTE:25 [ init_font_hex::idx#5 init_font_hex::idx#2 ] -Allocated zp ZP_WORD:26 [ init_angle_screen::xw#0 ] -Allocated zp ZP_WORD:28 [ init_angle_screen::yw#0 ] -Allocated zp ZP_WORD:30 [ atan2_16::x#0 ] -Allocated zp ZP_WORD:32 [ atan2_16::y#0 ] -Allocated zp ZP_WORD:34 [ atan2_16::return#2 ] -Allocated zp ZP_WORD:36 [ init_angle_screen::angle_w#0 ] -Allocated zp ZP_WORD:38 [ init_angle_screen::$7 ] -Allocated zp ZP_BYTE:40 [ init_angle_screen::ang_w#0 ] -Allocated zp ZP_WORD:41 [ atan2_16::xd#0 ] -Allocated zp ZP_WORD:43 [ atan2_16::yd#0 ] -Allocated zp ZP_BYTE:45 [ atan2_16::$24 ] -Allocated zp ZP_BYTE:46 [ atan2_16::$23 ] -Allocated zp ZP_BYTE:47 [ init_font_hex::$0 ] -Allocated zp ZP_BYTE:48 [ init_font_hex::$1 ] -Allocated zp ZP_BYTE:49 [ init_font_hex::$2 ] -Allocated zp ZP_BYTE:50 [ init_font_hex::idx#3 ] +Allocated zp ZP_WORD:8 [ atan2_16::xi#3 atan2_16::xi#7 atan2_16::xi#0 atan2_16::xi#8 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] +Allocated zp ZP_BYTE:10 [ atan2_16::i#2 atan2_16::i#1 ] +Allocated zp ZP_WORD:11 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] +Allocated zp ZP_WORD:13 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] +Allocated zp ZP_WORD:15 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] +Allocated zp ZP_BYTE:17 [ init_font_hex::c#6 init_font_hex::c#1 ] +Allocated zp ZP_WORD:18 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] +Allocated zp ZP_WORD:20 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] +Allocated zp ZP_BYTE:22 [ init_font_hex::c1#4 init_font_hex::c1#1 ] +Allocated zp ZP_BYTE:23 [ init_font_hex::i#2 init_font_hex::i#1 ] +Allocated zp ZP_BYTE:24 [ init_font_hex::idx#5 init_font_hex::idx#2 ] +Allocated zp ZP_WORD:25 [ init_angle_screen::xw#0 ] +Allocated zp ZP_WORD:27 [ init_angle_screen::yw#0 ] +Allocated zp ZP_WORD:29 [ atan2_16::x#0 ] +Allocated zp ZP_WORD:31 [ atan2_16::y#0 ] +Allocated zp ZP_WORD:33 [ atan2_16::return#2 ] +Allocated zp ZP_WORD:35 [ init_angle_screen::angle_w#0 ] +Allocated zp ZP_WORD:37 [ init_angle_screen::$7 ] +Allocated zp ZP_BYTE:39 [ init_angle_screen::ang_w#0 ] +Allocated zp ZP_WORD:40 [ atan2_16::xd#0 ] +Allocated zp ZP_WORD:42 [ atan2_16::yd#0 ] +Allocated zp ZP_BYTE:44 [ atan2_16::$24 ] +Allocated zp ZP_BYTE:45 [ atan2_16::$23 ] +Allocated zp ZP_BYTE:46 [ init_font_hex::$0 ] +Allocated zp ZP_BYTE:47 [ init_font_hex::$1 ] +Allocated zp ZP_BYTE:48 [ init_font_hex::$2 ] +Allocated zp ZP_BYTE:49 [ init_font_hex::idx#3 ] INITIAL ASM //SEG0 File Comments @@ -1717,11 +1717,11 @@ main: { // The actual value stored is distance*2 to increase precision // init_angle_screen(byte* zeropage(4) screen) init_angle_screen: { - .label _7 = $26 - .label xw = $1a - .label yw = $1c - .label angle_w = $24 - .label ang_w = $28 + .label _7 = $25 + .label xw = $19 + .label yw = $1b + .label angle_w = $23 + .label ang_w = $27 .label screen = 4 .label x = 3 .label y = 2 @@ -1837,36 +1837,30 @@ init_angle_screen: { // Find the atan2(x, y) - which is the angle of the line from (0,0) to (x,y) // Finding the angle requires a binary search using CORDIC_ITERATIONS_16 // Returns the angle in hex-degrees (0=0, 0x8000=PI, 0x10000=2*PI) -// atan2_16(signed word zeropage($1e) x, signed word zeropage($20) y) +// atan2_16(signed word zeropage($1d) x, signed word zeropage($1f) y) atan2_16: { .label _2 = 6 - .label _7 = 9 - .label _23 = $2e - .label _24 = $2d + .label _7 = 8 + .label _23 = $2d + .label _24 = $2c .label yi = 6 - .label xi = 9 - .label xd = $29 - .label yd = $2b - .label angle = $e - .label angle_2 = $c - .label angle_3 = $c - .label i = $b - .label return = $e - .label x = $1e - .label y = $20 - .label return_2 = $22 - .label angle_6 = $c - .label angle_12 = $c - .label angle_13 = $c - //SEG56 [29] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1 -- vwsz1_gt_0_then_la1 + .label xi = 8 + .label xd = $28 + .label yd = $2a + .label angle = $d + .label angle_2 = $b + .label angle_3 = $b + .label i = $a + .label return = $d + .label x = $1d + .label y = $1f + .label return_2 = $21 + .label angle_6 = $b + .label angle_12 = $b + .label angle_13 = $b + //SEG56 [29] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1 -- vwsz1_ge_0_then_la1 lda y+1 - bne !+ - lda y - beq !e+ - lsr - !: bpl b1 - !e: jmp b2 //SEG57 atan2_16::@2 b2: @@ -1885,15 +1879,9 @@ atan2_16: { jmp b3 //SEG61 atan2_16::@3 b3: - //SEG62 [32] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4 -- vwsz1_gt_0_then_la1 + //SEG62 [32] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4 -- vwsz1_ge_0_then_la1 lda x+1 - bne !+ - lda x - beq !e+ - lsr - !: bpl b4 - !e: jmp b5 //SEG63 atan2_16::@5 b5: @@ -2141,19 +2129,19 @@ atan2_16: { } //SEG123 init_font_hex // Make charset from proto chars -// init_font_hex(byte* zeropage($13) charset) +// init_font_hex(byte* zeropage($12) charset) init_font_hex: { - .label _0 = $2f - .label _1 = $30 - .label _2 = $31 - .label idx = $19 - .label i = $18 - .label idx_3 = $32 - .label proto_lo = $15 - .label charset = $13 - .label c1 = $17 - .label proto_hi = $10 - .label c = $12 + .label _0 = $2e + .label _1 = $2f + .label _2 = $30 + .label idx = $18 + .label i = $17 + .label idx_3 = $31 + .label proto_lo = $14 + .label charset = $12 + .label c1 = $16 + .label proto_hi = $f + .label c = $11 //SEG124 [63] phi from init_font_hex to init_font_hex::@1 [phi:init_font_hex->init_font_hex::@1] b1_from_init_font_hex: //SEG125 [63] phi (byte) init_font_hex::c#6 = (byte) 0 [phi:init_font_hex->init_font_hex::@1#0] -- vbuz1=vbuc1 @@ -2331,12 +2319,12 @@ Statement [19] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2 Statement [20] (word~) init_angle_screen::$7 ← (word) init_angle_screen::angle_w#0 + (byte) $80 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 init_angle_screen::$7 ] ( main:2::init_angle_screen:8 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 init_angle_screen::$7 ] ) always clobbers reg byte a Statement [21] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$7 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 init_angle_screen::ang_w#0 ] ( main:2::init_angle_screen:8 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 init_angle_screen::ang_w#0 ] ) always clobbers reg byte a Statement [22] *((byte*) init_angle_screen::screen#2) ← (byte) init_angle_screen::ang_w#0 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 ] ( main:2::init_angle_screen:8 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 ] ) always clobbers reg byte y -Statement [29] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1 [ atan2_16::x#0 atan2_16::y#0 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 ] ) always clobbers reg byte a +Statement [29] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1 [ atan2_16::x#0 atan2_16::y#0 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 ] ) always clobbers reg byte a Statement [30] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::$2 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 atan2_16::$2 ] ) always clobbers reg byte a -Statement [32] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 ] ) always clobbers reg byte a +Statement [32] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 ] ) always clobbers reg byte a Statement [33] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 atan2_16::$7 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 atan2_16::$7 ] ) always clobbers reg byte a Statement [36] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 ] ) always clobbers reg byte a -Removing always clobbered register reg byte a as potential for zp ZP_BYTE:11 [ atan2_16::i#2 atan2_16::i#1 ] +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:10 [ atan2_16::i#2 atan2_16::i#1 ] Statement [38] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1 [ atan2_16::x#0 atan2_16::y#0 atan2_16::angle#1 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 atan2_16::angle#1 ] ) always clobbers reg byte a Statement [39] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7 [ atan2_16::y#0 atan2_16::angle#1 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::y#0 atan2_16::angle#1 ] ) always clobbers reg byte a Statement [40] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1 [ atan2_16::y#0 atan2_16::angle#4 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::y#0 atan2_16::angle#4 ] ) always clobbers reg byte a @@ -2356,15 +2344,15 @@ Statement [59] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const Statement [60] (signed word~) atan2_16::xi#8 ← (signed word) atan2_16::x#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 atan2_16::xi#8 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 atan2_16::xi#8 ] ) always clobbers reg byte a Statement [61] (signed word~) atan2_16::yi#11 ← (signed word) atan2_16::y#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#11 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#11 ] ) always clobbers reg byte a Statement [65] *((byte*) init_font_hex::charset#2) ← (byte) 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ) always clobbers reg byte a reg byte y -Removing always clobbered register reg byte a as potential for zp ZP_BYTE:18 [ init_font_hex::c#6 init_font_hex::c#1 ] -Removing always clobbered register reg byte y as potential for zp ZP_BYTE:18 [ init_font_hex::c#6 init_font_hex::c#1 ] -Removing always clobbered register reg byte a as potential for zp ZP_BYTE:23 [ init_font_hex::c1#4 init_font_hex::c1#1 ] -Removing always clobbered register reg byte y as potential for zp ZP_BYTE:23 [ init_font_hex::c1#4 init_font_hex::c1#1 ] +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:17 [ init_font_hex::c#6 init_font_hex::c#1 ] +Removing always clobbered register reg byte y as potential for zp ZP_BYTE:17 [ init_font_hex::c#6 init_font_hex::c#1 ] +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:22 [ init_font_hex::c1#4 init_font_hex::c1#1 ] +Removing always clobbered register reg byte y as potential for zp ZP_BYTE:22 [ init_font_hex::c1#4 init_font_hex::c1#1 ] Statement [67] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 ] ) always clobbers reg byte a -Removing always clobbered register reg byte a as potential for zp ZP_BYTE:24 [ init_font_hex::i#2 init_font_hex::i#1 ] -Removing always clobbered register reg byte a as potential for zp ZP_BYTE:25 [ init_font_hex::idx#5 init_font_hex::idx#2 ] +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:23 [ init_font_hex::i#2 init_font_hex::i#1 ] +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:24 [ init_font_hex::idx#5 init_font_hex::idx#2 ] Statement [68] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 init_font_hex::$1 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 init_font_hex::$1 ] ) always clobbers reg byte a -Removing always clobbered register reg byte a as potential for zp ZP_BYTE:47 [ init_font_hex::$0 ] +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:46 [ init_font_hex::$0 ] Statement [74] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::idx#2 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::idx#2 ] ) always clobbers reg byte a Statement [76] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ) always clobbers reg byte a Statement [77] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] ) always clobbers reg byte a @@ -2380,9 +2368,9 @@ Statement [19] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2 Statement [20] (word~) init_angle_screen::$7 ← (word) init_angle_screen::angle_w#0 + (byte) $80 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 init_angle_screen::$7 ] ( main:2::init_angle_screen:8 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 init_angle_screen::$7 ] ) always clobbers reg byte a Statement [21] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$7 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 init_angle_screen::ang_w#0 ] ( main:2::init_angle_screen:8 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 init_angle_screen::ang_w#0 ] ) always clobbers reg byte a Statement [22] *((byte*) init_angle_screen::screen#2) ← (byte) init_angle_screen::ang_w#0 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 ] ( main:2::init_angle_screen:8 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 ] ) always clobbers reg byte y -Statement [29] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1 [ atan2_16::x#0 atan2_16::y#0 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 ] ) always clobbers reg byte a +Statement [29] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1 [ atan2_16::x#0 atan2_16::y#0 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 ] ) always clobbers reg byte a Statement [30] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::$2 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 atan2_16::$2 ] ) always clobbers reg byte a -Statement [32] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 ] ) always clobbers reg byte a +Statement [32] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 ] ) always clobbers reg byte a Statement [33] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 atan2_16::$7 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 atan2_16::$7 ] ) always clobbers reg byte a Statement [36] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 ] ) always clobbers reg byte a Statement [38] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1 [ atan2_16::x#0 atan2_16::y#0 atan2_16::angle#1 ] ( main:2::init_angle_screen:8::atan2_16:17 [ init_angle_screen::y#4 init_angle_screen::x#2 init_angle_screen::screen#2 atan2_16::x#0 atan2_16::y#0 atan2_16::angle#1 ] ) always clobbers reg byte a @@ -2415,80 +2403,83 @@ Potential registers zp ZP_BYTE:2 [ init_angle_screen::y#4 init_angle_screen::y#1 Potential registers zp ZP_BYTE:3 [ init_angle_screen::x#2 init_angle_screen::x#1 ] : zp ZP_BYTE:3 , reg byte x , Potential registers zp ZP_WORD:4 [ init_angle_screen::screen#2 init_angle_screen::screen#4 init_angle_screen::screen#1 ] : zp ZP_WORD:4 , Potential registers zp ZP_WORD:6 [ atan2_16::yi#3 atan2_16::yi#7 atan2_16::yi#0 atan2_16::yi#11 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ] : zp ZP_WORD:6 , -Potential registers zp ZP_WORD:9 [ atan2_16::xi#3 atan2_16::xi#7 atan2_16::xi#0 atan2_16::xi#8 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] : zp ZP_WORD:9 , -Potential registers zp ZP_BYTE:11 [ atan2_16::i#2 atan2_16::i#1 ] : zp ZP_BYTE:11 , reg byte x , reg byte y , -Potential registers zp ZP_WORD:12 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] : zp ZP_WORD:12 , -Potential registers zp ZP_WORD:14 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] : zp ZP_WORD:14 , -Potential registers zp ZP_WORD:16 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] : zp ZP_WORD:16 , -Potential registers zp ZP_BYTE:18 [ init_font_hex::c#6 init_font_hex::c#1 ] : zp ZP_BYTE:18 , reg byte x , -Potential registers zp ZP_WORD:19 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] : zp ZP_WORD:19 , -Potential registers zp ZP_WORD:21 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] : zp ZP_WORD:21 , -Potential registers zp ZP_BYTE:23 [ init_font_hex::c1#4 init_font_hex::c1#1 ] : zp ZP_BYTE:23 , reg byte x , -Potential registers zp ZP_BYTE:24 [ init_font_hex::i#2 init_font_hex::i#1 ] : zp ZP_BYTE:24 , reg byte x , reg byte y , -Potential registers zp ZP_BYTE:25 [ init_font_hex::idx#5 init_font_hex::idx#2 ] : zp ZP_BYTE:25 , reg byte x , reg byte y , -Potential registers zp ZP_WORD:26 [ init_angle_screen::xw#0 ] : zp ZP_WORD:26 , -Potential registers zp ZP_WORD:28 [ init_angle_screen::yw#0 ] : zp ZP_WORD:28 , -Potential registers zp ZP_WORD:30 [ atan2_16::x#0 ] : zp ZP_WORD:30 , -Potential registers zp ZP_WORD:32 [ atan2_16::y#0 ] : zp ZP_WORD:32 , -Potential registers zp ZP_WORD:34 [ atan2_16::return#2 ] : zp ZP_WORD:34 , -Potential registers zp ZP_WORD:36 [ init_angle_screen::angle_w#0 ] : zp ZP_WORD:36 , -Potential registers zp ZP_WORD:38 [ init_angle_screen::$7 ] : zp ZP_WORD:38 , -Potential registers zp ZP_BYTE:40 [ init_angle_screen::ang_w#0 ] : zp ZP_BYTE:40 , reg byte a , reg byte x , reg byte y , -Potential registers zp ZP_WORD:41 [ atan2_16::xd#0 ] : zp ZP_WORD:41 , -Potential registers zp ZP_WORD:43 [ atan2_16::yd#0 ] : zp ZP_WORD:43 , -Potential registers zp ZP_BYTE:45 [ atan2_16::$24 ] : zp ZP_BYTE:45 , reg byte a , reg byte x , reg byte y , -Potential registers zp ZP_BYTE:46 [ atan2_16::$23 ] : zp ZP_BYTE:46 , reg byte a , reg byte x , reg byte y , -Potential registers zp ZP_BYTE:47 [ init_font_hex::$0 ] : zp ZP_BYTE:47 , reg byte x , reg byte y , -Potential registers zp ZP_BYTE:48 [ init_font_hex::$1 ] : zp ZP_BYTE:48 , reg byte a , reg byte x , reg byte y , -Potential registers zp ZP_BYTE:49 [ init_font_hex::$2 ] : zp ZP_BYTE:49 , reg byte a , reg byte x , reg byte y , -Potential registers zp ZP_BYTE:50 [ init_font_hex::idx#3 ] : zp ZP_BYTE:50 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_WORD:8 [ atan2_16::xi#3 atan2_16::xi#7 atan2_16::xi#0 atan2_16::xi#8 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] : zp ZP_WORD:8 , +Potential registers zp ZP_BYTE:10 [ atan2_16::i#2 atan2_16::i#1 ] : zp ZP_BYTE:10 , reg byte x , reg byte y , +Potential registers zp ZP_WORD:11 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] : zp ZP_WORD:11 , +Potential registers zp ZP_WORD:13 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] : zp ZP_WORD:13 , +Potential registers zp ZP_WORD:15 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] : zp ZP_WORD:15 , +Potential registers zp ZP_BYTE:17 [ init_font_hex::c#6 init_font_hex::c#1 ] : zp ZP_BYTE:17 , reg byte x , +Potential registers zp ZP_WORD:18 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] : zp ZP_WORD:18 , +Potential registers zp ZP_WORD:20 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] : zp ZP_WORD:20 , +Potential registers zp ZP_BYTE:22 [ init_font_hex::c1#4 init_font_hex::c1#1 ] : zp ZP_BYTE:22 , reg byte x , +Potential registers zp ZP_BYTE:23 [ init_font_hex::i#2 init_font_hex::i#1 ] : zp ZP_BYTE:23 , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:24 [ init_font_hex::idx#5 init_font_hex::idx#2 ] : zp ZP_BYTE:24 , reg byte x , reg byte y , +Potential registers zp ZP_WORD:25 [ init_angle_screen::xw#0 ] : zp ZP_WORD:25 , +Potential registers zp ZP_WORD:27 [ init_angle_screen::yw#0 ] : zp ZP_WORD:27 , +Potential registers zp ZP_WORD:29 [ atan2_16::x#0 ] : zp ZP_WORD:29 , +Potential registers zp ZP_WORD:31 [ atan2_16::y#0 ] : zp ZP_WORD:31 , +Potential registers zp ZP_WORD:33 [ atan2_16::return#2 ] : zp ZP_WORD:33 , +Potential registers zp ZP_WORD:35 [ init_angle_screen::angle_w#0 ] : zp ZP_WORD:35 , +Potential registers zp ZP_WORD:37 [ init_angle_screen::$7 ] : zp ZP_WORD:37 , +Potential registers zp ZP_BYTE:39 [ init_angle_screen::ang_w#0 ] : zp ZP_BYTE:39 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_WORD:40 [ atan2_16::xd#0 ] : zp ZP_WORD:40 , +Potential registers zp ZP_WORD:42 [ atan2_16::yd#0 ] : zp ZP_WORD:42 , +Potential registers zp ZP_BYTE:44 [ atan2_16::$24 ] : zp ZP_BYTE:44 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:45 [ atan2_16::$23 ] : zp ZP_BYTE:45 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:46 [ init_font_hex::$0 ] : zp ZP_BYTE:46 , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:47 [ init_font_hex::$1 ] : zp ZP_BYTE:47 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:48 [ init_font_hex::$2 ] : zp ZP_BYTE:48 , reg byte a , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:49 [ init_font_hex::idx#3 ] : zp ZP_BYTE:49 , reg byte a , reg byte x , reg byte y , REGISTER UPLIFT SCOPES -Uplift Scope [atan2_16] 7,706.67: zp ZP_WORD:12 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] 3,203.15: zp ZP_WORD:6 [ atan2_16::yi#3 atan2_16::yi#7 atan2_16::yi#0 atan2_16::yi#11 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ] 2,817.2: zp ZP_WORD:9 [ atan2_16::xi#3 atan2_16::xi#7 atan2_16::xi#0 atan2_16::xi#8 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] 2,002: zp ZP_BYTE:45 [ atan2_16::$24 ] 2,002: zp ZP_BYTE:46 [ atan2_16::$23 ] 1,930.5: zp ZP_BYTE:11 [ atan2_16::i#2 atan2_16::i#1 ] 1,501.5: zp ZP_WORD:43 [ atan2_16::yd#0 ] 600.6: zp ZP_WORD:41 [ atan2_16::xd#0 ] 202: zp ZP_WORD:34 [ atan2_16::return#2 ] 50: zp ZP_WORD:14 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] 3.89: zp ZP_WORD:30 [ atan2_16::x#0 ] 3.63: zp ZP_WORD:32 [ atan2_16::y#0 ] -Uplift Scope [init_font_hex] 2,168.83: zp ZP_BYTE:24 [ init_font_hex::i#2 init_font_hex::i#1 ] 2,002: zp ZP_BYTE:48 [ init_font_hex::$1 ] 2,002: zp ZP_BYTE:49 [ init_font_hex::$2 ] 1,151.6: zp ZP_BYTE:25 [ init_font_hex::idx#5 init_font_hex::idx#2 ] 1,001: zp ZP_BYTE:47 [ init_font_hex::$0 ] 202: zp ZP_BYTE:50 [ init_font_hex::idx#3 ] 165.86: zp ZP_WORD:19 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] 164.97: zp ZP_BYTE:23 [ init_font_hex::c1#4 init_font_hex::c1#1 ] 143.04: zp ZP_WORD:21 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] 64.17: zp ZP_WORD:16 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] 17.66: zp ZP_BYTE:18 [ init_font_hex::c#6 init_font_hex::c#1 ] -Uplift Scope [init_angle_screen] 202: zp ZP_WORD:36 [ init_angle_screen::angle_w#0 ] 202: zp ZP_WORD:38 [ init_angle_screen::$7 ] 202: zp ZP_BYTE:40 [ init_angle_screen::ang_w#0 ] 168.33: zp ZP_BYTE:3 [ init_angle_screen::x#2 init_angle_screen::x#1 ] 93.15: zp ZP_WORD:4 [ init_angle_screen::screen#2 init_angle_screen::screen#4 init_angle_screen::screen#1 ] 50.5: zp ZP_WORD:26 [ init_angle_screen::xw#0 ] 50.5: zp ZP_WORD:28 [ init_angle_screen::yw#0 ] 17.97: zp ZP_BYTE:2 [ init_angle_screen::y#4 init_angle_screen::y#1 ] +Uplift Scope [atan2_16] 7,706.67: zp ZP_WORD:11 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] 3,203.15: zp ZP_WORD:6 [ atan2_16::yi#3 atan2_16::yi#7 atan2_16::yi#0 atan2_16::yi#11 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ] 2,817.2: zp ZP_WORD:8 [ atan2_16::xi#3 atan2_16::xi#7 atan2_16::xi#0 atan2_16::xi#8 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] 2,002: zp ZP_BYTE:44 [ atan2_16::$24 ] 2,002: zp ZP_BYTE:45 [ atan2_16::$23 ] 1,930.5: zp ZP_BYTE:10 [ atan2_16::i#2 atan2_16::i#1 ] 1,501.5: zp ZP_WORD:42 [ atan2_16::yd#0 ] 600.6: zp ZP_WORD:40 [ atan2_16::xd#0 ] 202: zp ZP_WORD:33 [ atan2_16::return#2 ] 50: zp ZP_WORD:13 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] 3.89: zp ZP_WORD:29 [ atan2_16::x#0 ] 3.63: zp ZP_WORD:31 [ atan2_16::y#0 ] +Uplift Scope [init_font_hex] 2,168.83: zp ZP_BYTE:23 [ init_font_hex::i#2 init_font_hex::i#1 ] 2,002: zp ZP_BYTE:47 [ init_font_hex::$1 ] 2,002: zp ZP_BYTE:48 [ init_font_hex::$2 ] 1,151.6: zp ZP_BYTE:24 [ init_font_hex::idx#5 init_font_hex::idx#2 ] 1,001: zp ZP_BYTE:46 [ init_font_hex::$0 ] 202: zp ZP_BYTE:49 [ init_font_hex::idx#3 ] 165.86: zp ZP_WORD:18 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] 164.97: zp ZP_BYTE:22 [ init_font_hex::c1#4 init_font_hex::c1#1 ] 143.04: zp ZP_WORD:20 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] 64.17: zp ZP_WORD:15 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] 17.66: zp ZP_BYTE:17 [ init_font_hex::c#6 init_font_hex::c#1 ] +Uplift Scope [init_angle_screen] 202: zp ZP_WORD:35 [ init_angle_screen::angle_w#0 ] 202: zp ZP_WORD:37 [ init_angle_screen::$7 ] 202: zp ZP_BYTE:39 [ init_angle_screen::ang_w#0 ] 168.33: zp ZP_BYTE:3 [ init_angle_screen::x#2 init_angle_screen::x#1 ] 93.15: zp ZP_WORD:4 [ init_angle_screen::screen#2 init_angle_screen::screen#4 init_angle_screen::screen#1 ] 50.5: zp ZP_WORD:25 [ init_angle_screen::xw#0 ] 50.5: zp ZP_WORD:27 [ init_angle_screen::yw#0 ] 17.97: zp ZP_BYTE:2 [ init_angle_screen::y#4 init_angle_screen::y#1 ] Uplift Scope [main] Uplift Scope [] -Uplifting [atan2_16] best 405260 combination zp ZP_WORD:12 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] zp ZP_WORD:6 [ atan2_16::yi#3 atan2_16::yi#7 atan2_16::yi#0 atan2_16::yi#11 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ] zp ZP_WORD:9 [ atan2_16::xi#3 atan2_16::xi#7 atan2_16::xi#0 atan2_16::xi#8 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] reg byte a [ atan2_16::$24 ] reg byte a [ atan2_16::$23 ] zp ZP_BYTE:11 [ atan2_16::i#2 atan2_16::i#1 ] zp ZP_WORD:43 [ atan2_16::yd#0 ] zp ZP_WORD:41 [ atan2_16::xd#0 ] zp ZP_WORD:34 [ atan2_16::return#2 ] zp ZP_WORD:14 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] zp ZP_WORD:30 [ atan2_16::x#0 ] zp ZP_WORD:32 [ atan2_16::y#0 ] -Uplifting [init_font_hex] best 386260 combination reg byte x [ init_font_hex::i#2 init_font_hex::i#1 ] reg byte a [ init_font_hex::$1 ] reg byte a [ init_font_hex::$2 ] zp ZP_BYTE:25 [ init_font_hex::idx#5 init_font_hex::idx#2 ] zp ZP_BYTE:47 [ init_font_hex::$0 ] zp ZP_BYTE:50 [ init_font_hex::idx#3 ] zp ZP_WORD:19 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] zp ZP_BYTE:23 [ init_font_hex::c1#4 init_font_hex::c1#1 ] zp ZP_WORD:21 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] zp ZP_WORD:16 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] zp ZP_BYTE:18 [ init_font_hex::c#6 init_font_hex::c#1 ] +Uplifting [atan2_16] best 405240 combination zp ZP_WORD:11 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] zp ZP_WORD:6 [ atan2_16::yi#3 atan2_16::yi#7 atan2_16::yi#0 atan2_16::yi#11 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ] zp ZP_WORD:8 [ atan2_16::xi#3 atan2_16::xi#7 atan2_16::xi#0 atan2_16::xi#8 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] reg byte a [ atan2_16::$24 ] reg byte a [ atan2_16::$23 ] zp ZP_BYTE:10 [ atan2_16::i#2 atan2_16::i#1 ] zp ZP_WORD:42 [ atan2_16::yd#0 ] zp ZP_WORD:40 [ atan2_16::xd#0 ] zp ZP_WORD:33 [ atan2_16::return#2 ] zp ZP_WORD:13 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] zp ZP_WORD:29 [ atan2_16::x#0 ] zp ZP_WORD:31 [ atan2_16::y#0 ] +Uplifting [init_font_hex] best 386240 combination reg byte x [ init_font_hex::i#2 init_font_hex::i#1 ] reg byte a [ init_font_hex::$1 ] reg byte a [ init_font_hex::$2 ] zp ZP_BYTE:24 [ init_font_hex::idx#5 init_font_hex::idx#2 ] zp ZP_BYTE:46 [ init_font_hex::$0 ] zp ZP_BYTE:49 [ init_font_hex::idx#3 ] zp ZP_WORD:18 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] zp ZP_BYTE:22 [ init_font_hex::c1#4 init_font_hex::c1#1 ] zp ZP_WORD:20 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] zp ZP_WORD:15 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] zp ZP_BYTE:17 [ init_font_hex::c#6 init_font_hex::c#1 ] Limited combination testing to 100 combinations of 6912 possible. -Uplifting [init_angle_screen] best 384660 combination zp ZP_WORD:36 [ init_angle_screen::angle_w#0 ] zp ZP_WORD:38 [ init_angle_screen::$7 ] reg byte a [ init_angle_screen::ang_w#0 ] reg byte x [ init_angle_screen::x#2 init_angle_screen::x#1 ] zp ZP_WORD:4 [ init_angle_screen::screen#2 init_angle_screen::screen#4 init_angle_screen::screen#1 ] zp ZP_WORD:26 [ init_angle_screen::xw#0 ] zp ZP_WORD:28 [ init_angle_screen::yw#0 ] zp ZP_BYTE:2 [ init_angle_screen::y#4 init_angle_screen::y#1 ] -Uplifting [main] best 384660 combination -Uplifting [] best 384660 combination -Attempting to uplift remaining variables inzp ZP_BYTE:11 [ atan2_16::i#2 atan2_16::i#1 ] -Uplifting [atan2_16] best 384660 combination zp ZP_BYTE:11 [ atan2_16::i#2 atan2_16::i#1 ] -Attempting to uplift remaining variables inzp ZP_BYTE:25 [ init_font_hex::idx#5 init_font_hex::idx#2 ] -Uplifting [init_font_hex] best 384660 combination zp ZP_BYTE:25 [ init_font_hex::idx#5 init_font_hex::idx#2 ] -Attempting to uplift remaining variables inzp ZP_BYTE:47 [ init_font_hex::$0 ] -Uplifting [init_font_hex] best 384660 combination zp ZP_BYTE:47 [ init_font_hex::$0 ] -Attempting to uplift remaining variables inzp ZP_BYTE:50 [ init_font_hex::idx#3 ] -Uplifting [init_font_hex] best 384060 combination reg byte y [ init_font_hex::idx#3 ] -Attempting to uplift remaining variables inzp ZP_BYTE:23 [ init_font_hex::c1#4 init_font_hex::c1#1 ] -Uplifting [init_font_hex] best 384060 combination zp ZP_BYTE:23 [ init_font_hex::c1#4 init_font_hex::c1#1 ] +Uplifting [init_angle_screen] best 384640 combination zp ZP_WORD:35 [ init_angle_screen::angle_w#0 ] zp ZP_WORD:37 [ init_angle_screen::$7 ] reg byte a [ init_angle_screen::ang_w#0 ] reg byte x [ init_angle_screen::x#2 init_angle_screen::x#1 ] zp ZP_WORD:4 [ init_angle_screen::screen#2 init_angle_screen::screen#4 init_angle_screen::screen#1 ] zp ZP_WORD:25 [ init_angle_screen::xw#0 ] zp ZP_WORD:27 [ init_angle_screen::yw#0 ] zp ZP_BYTE:2 [ init_angle_screen::y#4 init_angle_screen::y#1 ] +Uplifting [main] best 384640 combination +Uplifting [] best 384640 combination +Attempting to uplift remaining variables inzp ZP_BYTE:10 [ atan2_16::i#2 atan2_16::i#1 ] +Uplifting [atan2_16] best 384640 combination zp ZP_BYTE:10 [ atan2_16::i#2 atan2_16::i#1 ] +Attempting to uplift remaining variables inzp ZP_BYTE:24 [ init_font_hex::idx#5 init_font_hex::idx#2 ] +Uplifting [init_font_hex] best 384640 combination zp ZP_BYTE:24 [ init_font_hex::idx#5 init_font_hex::idx#2 ] +Attempting to uplift remaining variables inzp ZP_BYTE:46 [ init_font_hex::$0 ] +Uplifting [init_font_hex] best 384640 combination zp ZP_BYTE:46 [ init_font_hex::$0 ] +Attempting to uplift remaining variables inzp ZP_BYTE:49 [ init_font_hex::idx#3 ] +Uplifting [init_font_hex] best 384040 combination reg byte y [ init_font_hex::idx#3 ] +Attempting to uplift remaining variables inzp ZP_BYTE:22 [ init_font_hex::c1#4 init_font_hex::c1#1 ] +Uplifting [init_font_hex] best 384040 combination zp ZP_BYTE:22 [ init_font_hex::c1#4 init_font_hex::c1#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:2 [ init_angle_screen::y#4 init_angle_screen::y#1 ] -Uplifting [init_angle_screen] best 384060 combination zp ZP_BYTE:2 [ init_angle_screen::y#4 init_angle_screen::y#1 ] -Attempting to uplift remaining variables inzp ZP_BYTE:18 [ init_font_hex::c#6 init_font_hex::c#1 ] -Uplifting [init_font_hex] best 384060 combination zp ZP_BYTE:18 [ init_font_hex::c#6 init_font_hex::c#1 ] -Coalescing zero page register with common assignment [ zp ZP_WORD:12 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] ] with [ zp ZP_WORD:14 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] ] - score: 1 -Coalescing zero page register with common assignment [ zp ZP_WORD:26 [ init_angle_screen::xw#0 ] ] with [ zp ZP_WORD:30 [ atan2_16::x#0 ] ] - score: 1 -Coalescing zero page register with common assignment [ zp ZP_WORD:28 [ init_angle_screen::yw#0 ] ] with [ zp ZP_WORD:32 [ atan2_16::y#0 ] ] - score: 1 -Coalescing zero page register with common assignment [ zp ZP_WORD:34 [ atan2_16::return#2 ] ] with [ zp ZP_WORD:36 [ init_angle_screen::angle_w#0 ] ] - score: 1 -Coalescing zero page register with common assignment [ zp ZP_WORD:12 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] ] with [ zp ZP_WORD:34 [ atan2_16::return#2 init_angle_screen::angle_w#0 ] ] - score: 1 -Coalescing zero page register with common assignment [ zp ZP_WORD:12 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 atan2_16::return#2 init_angle_screen::angle_w#0 ] ] with [ zp ZP_WORD:38 [ init_angle_screen::$7 ] ] - score: 1 +Uplifting [init_angle_screen] best 384040 combination zp ZP_BYTE:2 [ init_angle_screen::y#4 init_angle_screen::y#1 ] +Attempting to uplift remaining variables inzp ZP_BYTE:17 [ init_font_hex::c#6 init_font_hex::c#1 ] +Uplifting [init_font_hex] best 384040 combination zp ZP_BYTE:17 [ init_font_hex::c#6 init_font_hex::c#1 ] +Coalescing zero page register with common assignment [ zp ZP_WORD:11 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] ] with [ zp ZP_WORD:13 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:25 [ init_angle_screen::xw#0 ] ] with [ zp ZP_WORD:29 [ atan2_16::x#0 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:27 [ init_angle_screen::yw#0 ] ] with [ zp ZP_WORD:31 [ atan2_16::y#0 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:33 [ atan2_16::return#2 ] ] with [ zp ZP_WORD:35 [ init_angle_screen::angle_w#0 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:11 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] ] with [ zp ZP_WORD:33 [ atan2_16::return#2 init_angle_screen::angle_w#0 ] ] - score: 1 +Coalescing zero page register with common assignment [ zp ZP_WORD:11 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 atan2_16::return#2 init_angle_screen::angle_w#0 ] ] with [ zp ZP_WORD:37 [ init_angle_screen::$7 ] ] - score: 1 Allocated (was zp ZP_WORD:4) zp ZP_WORD:3 [ init_angle_screen::screen#2 init_angle_screen::screen#4 init_angle_screen::screen#1 ] Allocated (was zp ZP_WORD:6) zp ZP_WORD:5 [ atan2_16::yi#3 atan2_16::yi#7 atan2_16::yi#0 atan2_16::yi#11 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ] -Allocated (was zp ZP_WORD:16) zp ZP_WORD:14 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] -Allocated (was zp ZP_BYTE:18) zp ZP_BYTE:16 [ init_font_hex::c#6 init_font_hex::c#1 ] -Allocated (was zp ZP_WORD:19) zp ZP_WORD:17 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] -Allocated (was zp ZP_WORD:21) zp ZP_WORD:19 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] -Allocated (was zp ZP_BYTE:23) zp ZP_BYTE:21 [ init_font_hex::c1#4 init_font_hex::c1#1 ] -Allocated (was zp ZP_BYTE:25) zp ZP_BYTE:22 [ init_font_hex::idx#5 init_font_hex::idx#2 ] -Allocated (was zp ZP_WORD:26) zp ZP_WORD:23 [ init_angle_screen::xw#0 atan2_16::x#0 ] -Allocated (was zp ZP_WORD:28) zp ZP_WORD:25 [ init_angle_screen::yw#0 atan2_16::y#0 ] -Allocated (was zp ZP_WORD:41) zp ZP_WORD:27 [ atan2_16::xd#0 ] -Allocated (was zp ZP_WORD:43) zp ZP_WORD:29 [ atan2_16::yd#0 ] -Allocated (was zp ZP_BYTE:47) zp ZP_BYTE:31 [ init_font_hex::$0 ] +Allocated (was zp ZP_WORD:8) zp ZP_WORD:7 [ atan2_16::xi#3 atan2_16::xi#7 atan2_16::xi#0 atan2_16::xi#8 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] +Allocated (was zp ZP_BYTE:10) zp ZP_BYTE:9 [ atan2_16::i#2 atan2_16::i#1 ] +Allocated (was zp ZP_WORD:11) zp ZP_WORD:10 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 atan2_16::return#2 init_angle_screen::angle_w#0 init_angle_screen::$7 ] +Allocated (was zp ZP_WORD:15) zp ZP_WORD:12 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] +Allocated (was zp ZP_BYTE:17) zp ZP_BYTE:14 [ init_font_hex::c#6 init_font_hex::c#1 ] +Allocated (was zp ZP_WORD:18) zp ZP_WORD:15 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] +Allocated (was zp ZP_WORD:20) zp ZP_WORD:17 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] +Allocated (was zp ZP_BYTE:22) zp ZP_BYTE:19 [ init_font_hex::c1#4 init_font_hex::c1#1 ] +Allocated (was zp ZP_BYTE:24) zp ZP_BYTE:20 [ init_font_hex::idx#5 init_font_hex::idx#2 ] +Allocated (was zp ZP_WORD:25) zp ZP_WORD:21 [ init_angle_screen::xw#0 atan2_16::x#0 ] +Allocated (was zp ZP_WORD:27) zp ZP_WORD:23 [ init_angle_screen::yw#0 atan2_16::y#0 ] +Allocated (was zp ZP_WORD:40) zp ZP_WORD:25 [ atan2_16::xd#0 ] +Allocated (was zp ZP_WORD:42) zp ZP_WORD:27 [ atan2_16::yd#0 ] +Allocated (was zp ZP_BYTE:46) zp ZP_BYTE:29 [ init_font_hex::$0 ] ASSEMBLER BEFORE OPTIMIZATION //SEG0 File Comments @@ -2553,10 +2544,10 @@ main: { // The actual value stored is distance*2 to increase precision // init_angle_screen(byte* zeropage(3) screen) init_angle_screen: { - .label _7 = $c - .label xw = $17 - .label yw = $19 - .label angle_w = $c + .label _7 = $a + .label xw = $15 + .label yw = $17 + .label angle_w = $a .label screen = 3 .label y = 2 //SEG22 [11] phi from init_angle_screen to init_angle_screen::@1 [phi:init_angle_screen->init_angle_screen::@1] @@ -2651,28 +2642,22 @@ init_angle_screen: { // Find the atan2(x, y) - which is the angle of the line from (0,0) to (x,y) // Finding the angle requires a binary search using CORDIC_ITERATIONS_16 // Returns the angle in hex-degrees (0=0, 0x8000=PI, 0x10000=2*PI) -// atan2_16(signed word zeropage($17) x, signed word zeropage($19) y) +// atan2_16(signed word zeropage($15) x, signed word zeropage($17) y) atan2_16: { .label _2 = 5 - .label _7 = 9 + .label _7 = 7 .label yi = 5 - .label xi = 9 - .label xd = $1b - .label yd = $1d - .label angle = $c - .label i = $b - .label return = $c - .label x = $17 - .label y = $19 - //SEG56 [29] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1 -- vwsz1_gt_0_then_la1 + .label xi = 7 + .label xd = $19 + .label yd = $1b + .label angle = $a + .label i = 9 + .label return = $a + .label x = $15 + .label y = $17 + //SEG56 [29] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1 -- vwsz1_ge_0_then_la1 lda y+1 - bne !+ - lda y - beq !e+ - lsr - !: bpl b1 - !e: jmp b2 //SEG57 atan2_16::@2 b2: @@ -2691,15 +2676,9 @@ atan2_16: { jmp b3 //SEG61 atan2_16::@3 b3: - //SEG62 [32] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4 -- vwsz1_gt_0_then_la1 + //SEG62 [32] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4 -- vwsz1_ge_0_then_la1 lda x+1 - bne !+ - lda x - beq !e+ - lsr - !: bpl b4 - !e: jmp b5 //SEG63 atan2_16::@5 b5: @@ -2941,15 +2920,15 @@ atan2_16: { } //SEG123 init_font_hex // Make charset from proto chars -// init_font_hex(byte* zeropage($11) charset) +// init_font_hex(byte* zeropage($f) charset) init_font_hex: { - .label _0 = $1f - .label idx = $16 - .label proto_lo = $13 - .label charset = $11 - .label c1 = $15 - .label proto_hi = $e - .label c = $10 + .label _0 = $1d + .label idx = $14 + .label proto_lo = $11 + .label charset = $f + .label c1 = $13 + .label proto_hi = $c + .label c = $e //SEG124 [63] phi from init_font_hex to init_font_hex::@1 [phi:init_font_hex->init_font_hex::@1] b1_from_init_font_hex: //SEG125 [63] phi (byte) init_font_hex::c#6 = (byte) 0 [phi:init_font_hex->init_font_hex::@1#0] -- vbuz1=vbuc1 @@ -3215,9 +3194,9 @@ Removing instruction jmp b3 Succesful ASM optimization Pass5NextJumpElimination Removing instruction bbegin: Succesful ASM optimization Pass5UnusedLabelElimination -Fixing long branch [216] beq b12 to bne -Fixing long branch [90] bpl b1 to bmi -Fixing long branch [108] bpl b4 to bmi +Fixing long branch [204] beq b12 to bne +Fixing long branch [85] bpl b1 to bmi +Fixing long branch [97] bpl b4 to bmi FINAL SYMBOL TABLE (label) @1 @@ -3241,7 +3220,7 @@ FINAL SYMBOL TABLE (signed word~) atan2_16::$2 $2 zp ZP_WORD:5 4.0 (byte~) atan2_16::$23 reg byte a 2002.0 (byte~) atan2_16::$24 reg byte a 2002.0 -(signed word~) atan2_16::$7 $7 zp ZP_WORD:9 4.0 +(signed word~) atan2_16::$7 $7 zp ZP_WORD:7 4.0 (label) atan2_16::@1 (label) atan2_16::@10 (label) atan2_16::@11 @@ -3260,36 +3239,36 @@ FINAL SYMBOL TABLE (label) atan2_16::@9 (label) atan2_16::@return (word) atan2_16::angle -(word) atan2_16::angle#1 angle zp ZP_WORD:12 3.0 -(word) atan2_16::angle#11 angle zp ZP_WORD:12 4.0 -(word) atan2_16::angle#12 angle zp ZP_WORD:12 364.0 -(word) atan2_16::angle#13 angle zp ZP_WORD:12 1334.6666666666667 -(word) atan2_16::angle#2 angle zp ZP_WORD:12 2002.0 -(word) atan2_16::angle#3 angle zp ZP_WORD:12 2002.0 -(word) atan2_16::angle#4 angle zp ZP_WORD:12 4.0 -(word) atan2_16::angle#5 angle zp ZP_WORD:12 4.0 -(word) atan2_16::angle#6 angle zp ZP_WORD:12 2004.0 +(word) atan2_16::angle#1 angle zp ZP_WORD:10 3.0 +(word) atan2_16::angle#11 angle zp ZP_WORD:10 4.0 +(word) atan2_16::angle#12 angle zp ZP_WORD:10 364.0 +(word) atan2_16::angle#13 angle zp ZP_WORD:10 1334.6666666666667 +(word) atan2_16::angle#2 angle zp ZP_WORD:10 2002.0 +(word) atan2_16::angle#3 angle zp ZP_WORD:10 2002.0 +(word) atan2_16::angle#4 angle zp ZP_WORD:10 4.0 +(word) atan2_16::angle#5 angle zp ZP_WORD:10 4.0 +(word) atan2_16::angle#6 angle zp ZP_WORD:10 2004.0 (byte) atan2_16::i -(byte) atan2_16::i#1 i zp ZP_BYTE:11 1501.5 -(byte) atan2_16::i#2 i zp ZP_BYTE:11 429.0 +(byte) atan2_16::i#1 i zp ZP_BYTE:9 1501.5 +(byte) atan2_16::i#2 i zp ZP_BYTE:9 429.0 (word) atan2_16::return -(word) atan2_16::return#0 return zp ZP_WORD:12 34.99999999999999 -(word) atan2_16::return#2 return zp ZP_WORD:12 202.0 +(word) atan2_16::return#0 return zp ZP_WORD:10 34.99999999999999 +(word) atan2_16::return#2 return zp ZP_WORD:10 202.0 (signed word) atan2_16::x -(signed word) atan2_16::x#0 x zp ZP_WORD:23 3.8928571428571437 +(signed word) atan2_16::x#0 x zp ZP_WORD:21 3.8928571428571437 (signed word) atan2_16::xd -(signed word) atan2_16::xd#0 xd zp ZP_WORD:27 600.5999999999999 +(signed word) atan2_16::xd#0 xd zp ZP_WORD:25 600.5999999999999 (signed word) atan2_16::xi -(signed word) atan2_16::xi#0 xi zp ZP_WORD:9 6.0 -(signed word) atan2_16::xi#1 xi zp ZP_WORD:9 500.5 -(signed word) atan2_16::xi#2 xi zp ZP_WORD:9 500.5 -(signed word) atan2_16::xi#3 xi zp ZP_WORD:9 801.2 -(signed word) atan2_16::xi#7 xi zp ZP_WORD:9 1001.0 -(signed word~) atan2_16::xi#8 xi zp ZP_WORD:9 4.0 +(signed word) atan2_16::xi#0 xi zp ZP_WORD:7 6.0 +(signed word) atan2_16::xi#1 xi zp ZP_WORD:7 500.5 +(signed word) atan2_16::xi#2 xi zp ZP_WORD:7 500.5 +(signed word) atan2_16::xi#3 xi zp ZP_WORD:7 801.2 +(signed word) atan2_16::xi#7 xi zp ZP_WORD:7 1001.0 +(signed word~) atan2_16::xi#8 xi zp ZP_WORD:7 4.0 (signed word) atan2_16::y -(signed word) atan2_16::y#0 y zp ZP_WORD:25 3.633333333333334 +(signed word) atan2_16::y#0 y zp ZP_WORD:23 3.633333333333334 (signed word) atan2_16::yd -(signed word) atan2_16::yd#0 yd zp ZP_WORD:29 1501.5 +(signed word) atan2_16::yd#0 yd zp ZP_WORD:27 1501.5 (signed word) atan2_16::yi (signed word) atan2_16::yi#0 yi zp ZP_WORD:5 1.2000000000000002 (signed word) atan2_16::yi#1 yi zp ZP_WORD:5 667.3333333333334 @@ -3298,7 +3277,7 @@ FINAL SYMBOL TABLE (signed word) atan2_16::yi#3 yi zp ZP_WORD:5 858.2857142857142 (signed word) atan2_16::yi#7 yi zp ZP_WORD:5 1001.0 (void()) init_angle_screen((byte*) init_angle_screen::screen) -(word~) init_angle_screen::$7 $7 zp ZP_WORD:12 202.0 +(word~) init_angle_screen::$7 $7 zp ZP_WORD:10 202.0 (label) init_angle_screen::@1 (label) init_angle_screen::@2 (label) init_angle_screen::@3 @@ -3307,7 +3286,7 @@ FINAL SYMBOL TABLE (byte) init_angle_screen::ang_w (byte) init_angle_screen::ang_w#0 reg byte a 202.0 (word) init_angle_screen::angle_w -(word) init_angle_screen::angle_w#0 angle_w zp ZP_WORD:12 202.0 +(word) init_angle_screen::angle_w#0 angle_w zp ZP_WORD:10 202.0 (byte*) init_angle_screen::screen (byte*) init_angle_screen::screen#1 screen zp ZP_WORD:3 42.599999999999994 (byte*) init_angle_screen::screen#2 screen zp ZP_WORD:3 28.545454545454547 @@ -3316,14 +3295,14 @@ FINAL SYMBOL TABLE (signed byte) init_angle_screen::x#1 reg byte x 151.5 (signed byte) init_angle_screen::x#2 reg byte x 16.833333333333332 (signed word) init_angle_screen::xw -(word) init_angle_screen::xw#0 xw zp ZP_WORD:23 50.5 +(word) init_angle_screen::xw#0 xw zp ZP_WORD:21 50.5 (signed byte) init_angle_screen::y (signed byte) init_angle_screen::y#1 y zp ZP_BYTE:2 16.5 (signed byte) init_angle_screen::y#4 y zp ZP_BYTE:2 1.4666666666666666 (signed word) init_angle_screen::yw -(word) init_angle_screen::yw#0 yw zp ZP_WORD:25 50.5 +(word) init_angle_screen::yw#0 yw zp ZP_WORD:23 50.5 (void()) init_font_hex((byte*) init_font_hex::charset) -(byte~) init_font_hex::$0 $0 zp ZP_BYTE:31 1001.0 +(byte~) init_font_hex::$0 $0 zp ZP_BYTE:29 1001.0 (byte~) init_font_hex::$1 reg byte a 2002.0 (byte~) init_font_hex::$2 reg byte a 2002.0 (label) init_font_hex::@1 @@ -3333,28 +3312,28 @@ FINAL SYMBOL TABLE (label) init_font_hex::@5 (label) init_font_hex::@return (byte) init_font_hex::c -(byte) init_font_hex::c#1 c zp ZP_BYTE:16 16.5 -(byte) init_font_hex::c#6 c zp ZP_BYTE:16 1.1578947368421053 +(byte) init_font_hex::c#1 c zp ZP_BYTE:14 16.5 +(byte) init_font_hex::c#6 c zp ZP_BYTE:14 1.1578947368421053 (byte) init_font_hex::c1 -(byte) init_font_hex::c1#1 c1 zp ZP_BYTE:21 151.5 -(byte) init_font_hex::c1#4 c1 zp ZP_BYTE:21 13.466666666666667 +(byte) init_font_hex::c1#1 c1 zp ZP_BYTE:19 151.5 +(byte) init_font_hex::c1#4 c1 zp ZP_BYTE:19 13.466666666666667 (byte*) init_font_hex::charset -(byte*) init_font_hex::charset#0 charset zp ZP_WORD:17 35.5 -(byte*) init_font_hex::charset#2 charset zp ZP_WORD:17 108.35714285714285 -(byte*) init_font_hex::charset#5 charset zp ZP_WORD:17 22.0 +(byte*) init_font_hex::charset#0 charset zp ZP_WORD:15 35.5 +(byte*) init_font_hex::charset#2 charset zp ZP_WORD:15 108.35714285714285 +(byte*) init_font_hex::charset#5 charset zp ZP_WORD:15 22.0 (byte) init_font_hex::i (byte) init_font_hex::i#1 reg byte x 1501.5 (byte) init_font_hex::i#2 reg byte x 667.3333333333334 (byte) init_font_hex::idx -(byte) init_font_hex::idx#2 idx zp ZP_BYTE:22 551.0 +(byte) init_font_hex::idx#2 idx zp ZP_BYTE:20 551.0 (byte) init_font_hex::idx#3 reg byte y 202.0 -(byte) init_font_hex::idx#5 idx zp ZP_BYTE:22 600.5999999999999 +(byte) init_font_hex::idx#5 idx zp ZP_BYTE:20 600.5999999999999 (byte*) init_font_hex::proto_hi -(byte*) init_font_hex::proto_hi#1 proto_hi zp ZP_WORD:14 7.333333333333333 -(byte*) init_font_hex::proto_hi#6 proto_hi zp ZP_WORD:14 56.83333333333334 +(byte*) init_font_hex::proto_hi#1 proto_hi zp ZP_WORD:12 7.333333333333333 +(byte*) init_font_hex::proto_hi#6 proto_hi zp ZP_WORD:12 56.83333333333334 (byte*) init_font_hex::proto_lo -(byte*) init_font_hex::proto_lo#1 proto_lo zp ZP_WORD:19 50.5 -(byte*) init_font_hex::proto_lo#4 proto_lo zp ZP_WORD:19 92.53846153846155 +(byte*) init_font_hex::proto_lo#1 proto_lo zp ZP_WORD:17 50.5 +(byte*) init_font_hex::proto_lo#4 proto_lo zp ZP_WORD:17 92.53846153846155 (void()) main() (label) main::@1 (label) main::@return @@ -3377,31 +3356,31 @@ zp ZP_BYTE:2 [ init_angle_screen::y#4 init_angle_screen::y#1 ] reg byte x [ init_angle_screen::x#2 init_angle_screen::x#1 ] zp ZP_WORD:3 [ init_angle_screen::screen#2 init_angle_screen::screen#4 init_angle_screen::screen#1 ] zp ZP_WORD:5 [ atan2_16::yi#3 atan2_16::yi#7 atan2_16::yi#0 atan2_16::yi#11 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ] -zp ZP_WORD:9 [ atan2_16::xi#3 atan2_16::xi#7 atan2_16::xi#0 atan2_16::xi#8 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] -zp ZP_BYTE:11 [ atan2_16::i#2 atan2_16::i#1 ] -zp ZP_WORD:12 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 atan2_16::return#2 init_angle_screen::angle_w#0 init_angle_screen::$7 ] -zp ZP_WORD:14 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] -zp ZP_BYTE:16 [ init_font_hex::c#6 init_font_hex::c#1 ] -zp ZP_WORD:17 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] -zp ZP_WORD:19 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] -zp ZP_BYTE:21 [ init_font_hex::c1#4 init_font_hex::c1#1 ] +zp ZP_WORD:7 [ atan2_16::xi#3 atan2_16::xi#7 atan2_16::xi#0 atan2_16::xi#8 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] +zp ZP_BYTE:9 [ atan2_16::i#2 atan2_16::i#1 ] +zp ZP_WORD:10 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 atan2_16::return#2 init_angle_screen::angle_w#0 init_angle_screen::$7 ] +zp ZP_WORD:12 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] +zp ZP_BYTE:14 [ init_font_hex::c#6 init_font_hex::c#1 ] +zp ZP_WORD:15 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] +zp ZP_WORD:17 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] +zp ZP_BYTE:19 [ init_font_hex::c1#4 init_font_hex::c1#1 ] reg byte x [ init_font_hex::i#2 init_font_hex::i#1 ] -zp ZP_BYTE:22 [ init_font_hex::idx#5 init_font_hex::idx#2 ] -zp ZP_WORD:23 [ init_angle_screen::xw#0 atan2_16::x#0 ] -zp ZP_WORD:25 [ init_angle_screen::yw#0 atan2_16::y#0 ] +zp ZP_BYTE:20 [ init_font_hex::idx#5 init_font_hex::idx#2 ] +zp ZP_WORD:21 [ init_angle_screen::xw#0 atan2_16::x#0 ] +zp ZP_WORD:23 [ init_angle_screen::yw#0 atan2_16::y#0 ] reg byte a [ init_angle_screen::ang_w#0 ] -zp ZP_WORD:27 [ atan2_16::xd#0 ] -zp ZP_WORD:29 [ atan2_16::yd#0 ] +zp ZP_WORD:25 [ atan2_16::xd#0 ] +zp ZP_WORD:27 [ atan2_16::yd#0 ] reg byte a [ atan2_16::$24 ] reg byte a [ atan2_16::$23 ] -zp ZP_BYTE:31 [ init_font_hex::$0 ] +zp ZP_BYTE:29 [ init_font_hex::$0 ] reg byte a [ init_font_hex::$1 ] reg byte a [ init_font_hex::$2 ] reg byte y [ init_font_hex::idx#3 ] FINAL ASSEMBLER -Score: 357125 +Score: 357105 //SEG0 File Comments // Calculate the angle to the center of the screen - and show it using font-hex @@ -3447,10 +3426,10 @@ main: { // The actual value stored is distance*2 to increase precision // init_angle_screen(byte* zeropage(3) screen) init_angle_screen: { - .label _7 = $c - .label xw = $17 - .label yw = $19 - .label angle_w = $c + .label _7 = $a + .label xw = $15 + .label yw = $17 + .label angle_w = $a .label screen = 3 .label y = 2 //SEG22 [11] phi from init_angle_screen to init_angle_screen::@1 [phi:init_angle_screen->init_angle_screen::@1] @@ -3530,30 +3509,24 @@ init_angle_screen: { // Find the atan2(x, y) - which is the angle of the line from (0,0) to (x,y) // Finding the angle requires a binary search using CORDIC_ITERATIONS_16 // Returns the angle in hex-degrees (0=0, 0x8000=PI, 0x10000=2*PI) -// atan2_16(signed word zeropage($17) x, signed word zeropage($19) y) +// atan2_16(signed word zeropage($15) x, signed word zeropage($17) y) atan2_16: { .label _2 = 5 - .label _7 = 9 + .label _7 = 7 .label yi = 5 - .label xi = 9 - .label xd = $1b - .label yd = $1d - .label angle = $c - .label i = $b - .label return = $c - .label x = $17 - .label y = $19 - //SEG56 [29] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1 -- vwsz1_gt_0_then_la1 + .label xi = 7 + .label xd = $19 + .label yd = $1b + .label angle = $a + .label i = 9 + .label return = $a + .label x = $15 + .label y = $17 + //SEG56 [29] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1 -- vwsz1_ge_0_then_la1 lda y+1 - bne !+ - lda y - beq !e+ - lsr - !: bmi !b1+ jmp b1 !b1: - !e: //SEG57 atan2_16::@2 //SEG58 [30] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0 -- vwsz1=_neg_vwsz2 sec @@ -3567,17 +3540,11 @@ atan2_16: { //SEG60 [31] phi (signed word) atan2_16::yi#0 = (signed word~) atan2_16::yi#11 [phi:atan2_16::@1/atan2_16::@2->atan2_16::@3#0] -- register_copy //SEG61 atan2_16::@3 b3: - //SEG62 [32] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4 -- vwsz1_gt_0_then_la1 + //SEG62 [32] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4 -- vwsz1_ge_0_then_la1 lda x+1 - bne !+ - lda x - beq !e+ - lsr - !: bmi !b4+ jmp b4 !b4: - !e: //SEG63 atan2_16::@5 //SEG64 [33] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0 -- vwsz1=_neg_vwsz2 sec @@ -3791,15 +3758,15 @@ atan2_16: { } //SEG123 init_font_hex // Make charset from proto chars -// init_font_hex(byte* zeropage($11) charset) +// init_font_hex(byte* zeropage($f) charset) init_font_hex: { - .label _0 = $1f - .label idx = $16 - .label proto_lo = $13 - .label charset = $11 - .label c1 = $15 - .label proto_hi = $e - .label c = $10 + .label _0 = $1d + .label idx = $14 + .label proto_lo = $11 + .label charset = $f + .label c1 = $13 + .label proto_hi = $c + .label c = $e //SEG124 [63] phi from init_font_hex to init_font_hex::@1 [phi:init_font_hex->init_font_hex::@1] //SEG125 [63] phi (byte) init_font_hex::c#6 = (byte) 0 [phi:init_font_hex->init_font_hex::@1#0] -- vbuz1=vbuc1 lda #0 diff --git a/src/test/ref/screen-center-angle.sym b/src/test/ref/screen-center-angle.sym index d3227c3ca..23e23ef06 100644 --- a/src/test/ref/screen-center-angle.sym +++ b/src/test/ref/screen-center-angle.sym @@ -19,7 +19,7 @@ (signed word~) atan2_16::$2 $2 zp ZP_WORD:5 4.0 (byte~) atan2_16::$23 reg byte a 2002.0 (byte~) atan2_16::$24 reg byte a 2002.0 -(signed word~) atan2_16::$7 $7 zp ZP_WORD:9 4.0 +(signed word~) atan2_16::$7 $7 zp ZP_WORD:7 4.0 (label) atan2_16::@1 (label) atan2_16::@10 (label) atan2_16::@11 @@ -38,36 +38,36 @@ (label) atan2_16::@9 (label) atan2_16::@return (word) atan2_16::angle -(word) atan2_16::angle#1 angle zp ZP_WORD:12 3.0 -(word) atan2_16::angle#11 angle zp ZP_WORD:12 4.0 -(word) atan2_16::angle#12 angle zp ZP_WORD:12 364.0 -(word) atan2_16::angle#13 angle zp ZP_WORD:12 1334.6666666666667 -(word) atan2_16::angle#2 angle zp ZP_WORD:12 2002.0 -(word) atan2_16::angle#3 angle zp ZP_WORD:12 2002.0 -(word) atan2_16::angle#4 angle zp ZP_WORD:12 4.0 -(word) atan2_16::angle#5 angle zp ZP_WORD:12 4.0 -(word) atan2_16::angle#6 angle zp ZP_WORD:12 2004.0 +(word) atan2_16::angle#1 angle zp ZP_WORD:10 3.0 +(word) atan2_16::angle#11 angle zp ZP_WORD:10 4.0 +(word) atan2_16::angle#12 angle zp ZP_WORD:10 364.0 +(word) atan2_16::angle#13 angle zp ZP_WORD:10 1334.6666666666667 +(word) atan2_16::angle#2 angle zp ZP_WORD:10 2002.0 +(word) atan2_16::angle#3 angle zp ZP_WORD:10 2002.0 +(word) atan2_16::angle#4 angle zp ZP_WORD:10 4.0 +(word) atan2_16::angle#5 angle zp ZP_WORD:10 4.0 +(word) atan2_16::angle#6 angle zp ZP_WORD:10 2004.0 (byte) atan2_16::i -(byte) atan2_16::i#1 i zp ZP_BYTE:11 1501.5 -(byte) atan2_16::i#2 i zp ZP_BYTE:11 429.0 +(byte) atan2_16::i#1 i zp ZP_BYTE:9 1501.5 +(byte) atan2_16::i#2 i zp ZP_BYTE:9 429.0 (word) atan2_16::return -(word) atan2_16::return#0 return zp ZP_WORD:12 34.99999999999999 -(word) atan2_16::return#2 return zp ZP_WORD:12 202.0 +(word) atan2_16::return#0 return zp ZP_WORD:10 34.99999999999999 +(word) atan2_16::return#2 return zp ZP_WORD:10 202.0 (signed word) atan2_16::x -(signed word) atan2_16::x#0 x zp ZP_WORD:23 3.8928571428571437 +(signed word) atan2_16::x#0 x zp ZP_WORD:21 3.8928571428571437 (signed word) atan2_16::xd -(signed word) atan2_16::xd#0 xd zp ZP_WORD:27 600.5999999999999 +(signed word) atan2_16::xd#0 xd zp ZP_WORD:25 600.5999999999999 (signed word) atan2_16::xi -(signed word) atan2_16::xi#0 xi zp ZP_WORD:9 6.0 -(signed word) atan2_16::xi#1 xi zp ZP_WORD:9 500.5 -(signed word) atan2_16::xi#2 xi zp ZP_WORD:9 500.5 -(signed word) atan2_16::xi#3 xi zp ZP_WORD:9 801.2 -(signed word) atan2_16::xi#7 xi zp ZP_WORD:9 1001.0 -(signed word~) atan2_16::xi#8 xi zp ZP_WORD:9 4.0 +(signed word) atan2_16::xi#0 xi zp ZP_WORD:7 6.0 +(signed word) atan2_16::xi#1 xi zp ZP_WORD:7 500.5 +(signed word) atan2_16::xi#2 xi zp ZP_WORD:7 500.5 +(signed word) atan2_16::xi#3 xi zp ZP_WORD:7 801.2 +(signed word) atan2_16::xi#7 xi zp ZP_WORD:7 1001.0 +(signed word~) atan2_16::xi#8 xi zp ZP_WORD:7 4.0 (signed word) atan2_16::y -(signed word) atan2_16::y#0 y zp ZP_WORD:25 3.633333333333334 +(signed word) atan2_16::y#0 y zp ZP_WORD:23 3.633333333333334 (signed word) atan2_16::yd -(signed word) atan2_16::yd#0 yd zp ZP_WORD:29 1501.5 +(signed word) atan2_16::yd#0 yd zp ZP_WORD:27 1501.5 (signed word) atan2_16::yi (signed word) atan2_16::yi#0 yi zp ZP_WORD:5 1.2000000000000002 (signed word) atan2_16::yi#1 yi zp ZP_WORD:5 667.3333333333334 @@ -76,7 +76,7 @@ (signed word) atan2_16::yi#3 yi zp ZP_WORD:5 858.2857142857142 (signed word) atan2_16::yi#7 yi zp ZP_WORD:5 1001.0 (void()) init_angle_screen((byte*) init_angle_screen::screen) -(word~) init_angle_screen::$7 $7 zp ZP_WORD:12 202.0 +(word~) init_angle_screen::$7 $7 zp ZP_WORD:10 202.0 (label) init_angle_screen::@1 (label) init_angle_screen::@2 (label) init_angle_screen::@3 @@ -85,7 +85,7 @@ (byte) init_angle_screen::ang_w (byte) init_angle_screen::ang_w#0 reg byte a 202.0 (word) init_angle_screen::angle_w -(word) init_angle_screen::angle_w#0 angle_w zp ZP_WORD:12 202.0 +(word) init_angle_screen::angle_w#0 angle_w zp ZP_WORD:10 202.0 (byte*) init_angle_screen::screen (byte*) init_angle_screen::screen#1 screen zp ZP_WORD:3 42.599999999999994 (byte*) init_angle_screen::screen#2 screen zp ZP_WORD:3 28.545454545454547 @@ -94,14 +94,14 @@ (signed byte) init_angle_screen::x#1 reg byte x 151.5 (signed byte) init_angle_screen::x#2 reg byte x 16.833333333333332 (signed word) init_angle_screen::xw -(word) init_angle_screen::xw#0 xw zp ZP_WORD:23 50.5 +(word) init_angle_screen::xw#0 xw zp ZP_WORD:21 50.5 (signed byte) init_angle_screen::y (signed byte) init_angle_screen::y#1 y zp ZP_BYTE:2 16.5 (signed byte) init_angle_screen::y#4 y zp ZP_BYTE:2 1.4666666666666666 (signed word) init_angle_screen::yw -(word) init_angle_screen::yw#0 yw zp ZP_WORD:25 50.5 +(word) init_angle_screen::yw#0 yw zp ZP_WORD:23 50.5 (void()) init_font_hex((byte*) init_font_hex::charset) -(byte~) init_font_hex::$0 $0 zp ZP_BYTE:31 1001.0 +(byte~) init_font_hex::$0 $0 zp ZP_BYTE:29 1001.0 (byte~) init_font_hex::$1 reg byte a 2002.0 (byte~) init_font_hex::$2 reg byte a 2002.0 (label) init_font_hex::@1 @@ -111,28 +111,28 @@ (label) init_font_hex::@5 (label) init_font_hex::@return (byte) init_font_hex::c -(byte) init_font_hex::c#1 c zp ZP_BYTE:16 16.5 -(byte) init_font_hex::c#6 c zp ZP_BYTE:16 1.1578947368421053 +(byte) init_font_hex::c#1 c zp ZP_BYTE:14 16.5 +(byte) init_font_hex::c#6 c zp ZP_BYTE:14 1.1578947368421053 (byte) init_font_hex::c1 -(byte) init_font_hex::c1#1 c1 zp ZP_BYTE:21 151.5 -(byte) init_font_hex::c1#4 c1 zp ZP_BYTE:21 13.466666666666667 +(byte) init_font_hex::c1#1 c1 zp ZP_BYTE:19 151.5 +(byte) init_font_hex::c1#4 c1 zp ZP_BYTE:19 13.466666666666667 (byte*) init_font_hex::charset -(byte*) init_font_hex::charset#0 charset zp ZP_WORD:17 35.5 -(byte*) init_font_hex::charset#2 charset zp ZP_WORD:17 108.35714285714285 -(byte*) init_font_hex::charset#5 charset zp ZP_WORD:17 22.0 +(byte*) init_font_hex::charset#0 charset zp ZP_WORD:15 35.5 +(byte*) init_font_hex::charset#2 charset zp ZP_WORD:15 108.35714285714285 +(byte*) init_font_hex::charset#5 charset zp ZP_WORD:15 22.0 (byte) init_font_hex::i (byte) init_font_hex::i#1 reg byte x 1501.5 (byte) init_font_hex::i#2 reg byte x 667.3333333333334 (byte) init_font_hex::idx -(byte) init_font_hex::idx#2 idx zp ZP_BYTE:22 551.0 +(byte) init_font_hex::idx#2 idx zp ZP_BYTE:20 551.0 (byte) init_font_hex::idx#3 reg byte y 202.0 -(byte) init_font_hex::idx#5 idx zp ZP_BYTE:22 600.5999999999999 +(byte) init_font_hex::idx#5 idx zp ZP_BYTE:20 600.5999999999999 (byte*) init_font_hex::proto_hi -(byte*) init_font_hex::proto_hi#1 proto_hi zp ZP_WORD:14 7.333333333333333 -(byte*) init_font_hex::proto_hi#6 proto_hi zp ZP_WORD:14 56.83333333333334 +(byte*) init_font_hex::proto_hi#1 proto_hi zp ZP_WORD:12 7.333333333333333 +(byte*) init_font_hex::proto_hi#6 proto_hi zp ZP_WORD:12 56.83333333333334 (byte*) init_font_hex::proto_lo -(byte*) init_font_hex::proto_lo#1 proto_lo zp ZP_WORD:19 50.5 -(byte*) init_font_hex::proto_lo#4 proto_lo zp ZP_WORD:19 92.53846153846155 +(byte*) init_font_hex::proto_lo#1 proto_lo zp ZP_WORD:17 50.5 +(byte*) init_font_hex::proto_lo#4 proto_lo zp ZP_WORD:17 92.53846153846155 (void()) main() (label) main::@1 (label) main::@return @@ -155,24 +155,24 @@ zp ZP_BYTE:2 [ init_angle_screen::y#4 init_angle_screen::y#1 ] reg byte x [ init_angle_screen::x#2 init_angle_screen::x#1 ] zp ZP_WORD:3 [ init_angle_screen::screen#2 init_angle_screen::screen#4 init_angle_screen::screen#1 ] zp ZP_WORD:5 [ atan2_16::yi#3 atan2_16::yi#7 atan2_16::yi#0 atan2_16::yi#11 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ] -zp ZP_WORD:9 [ atan2_16::xi#3 atan2_16::xi#7 atan2_16::xi#0 atan2_16::xi#8 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] -zp ZP_BYTE:11 [ atan2_16::i#2 atan2_16::i#1 ] -zp ZP_WORD:12 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 atan2_16::return#2 init_angle_screen::angle_w#0 init_angle_screen::$7 ] -zp ZP_WORD:14 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] -zp ZP_BYTE:16 [ init_font_hex::c#6 init_font_hex::c#1 ] -zp ZP_WORD:17 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] -zp ZP_WORD:19 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] -zp ZP_BYTE:21 [ init_font_hex::c1#4 init_font_hex::c1#1 ] +zp ZP_WORD:7 [ atan2_16::xi#3 atan2_16::xi#7 atan2_16::xi#0 atan2_16::xi#8 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] +zp ZP_BYTE:9 [ atan2_16::i#2 atan2_16::i#1 ] +zp ZP_WORD:10 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 atan2_16::return#2 init_angle_screen::angle_w#0 init_angle_screen::$7 ] +zp ZP_WORD:12 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] +zp ZP_BYTE:14 [ init_font_hex::c#6 init_font_hex::c#1 ] +zp ZP_WORD:15 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] +zp ZP_WORD:17 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] +zp ZP_BYTE:19 [ init_font_hex::c1#4 init_font_hex::c1#1 ] reg byte x [ init_font_hex::i#2 init_font_hex::i#1 ] -zp ZP_BYTE:22 [ init_font_hex::idx#5 init_font_hex::idx#2 ] -zp ZP_WORD:23 [ init_angle_screen::xw#0 atan2_16::x#0 ] -zp ZP_WORD:25 [ init_angle_screen::yw#0 atan2_16::y#0 ] +zp ZP_BYTE:20 [ init_font_hex::idx#5 init_font_hex::idx#2 ] +zp ZP_WORD:21 [ init_angle_screen::xw#0 atan2_16::x#0 ] +zp ZP_WORD:23 [ init_angle_screen::yw#0 atan2_16::y#0 ] reg byte a [ init_angle_screen::ang_w#0 ] -zp ZP_WORD:27 [ atan2_16::xd#0 ] -zp ZP_WORD:29 [ atan2_16::yd#0 ] +zp ZP_WORD:25 [ atan2_16::xd#0 ] +zp ZP_WORD:27 [ atan2_16::yd#0 ] reg byte a [ atan2_16::$24 ] reg byte a [ atan2_16::$23 ] -zp ZP_BYTE:31 [ init_font_hex::$0 ] +zp ZP_BYTE:29 [ init_font_hex::$0 ] reg byte a [ init_font_hex::$1 ] reg byte a [ init_font_hex::$2 ] reg byte y [ init_font_hex::idx#3 ]