1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-09-08 17:54:40 +00:00

Updated tests

This commit is contained in:
jespergravgaard 2019-06-29 10:08:46 +02:00
parent 2f8097ca17
commit d0c23993cc
14 changed files with 4194 additions and 3007 deletions

View File

@ -4,6 +4,7 @@
import "font-hex"
import "atan2"
import "c64"
import "print"
const byte* CHARSET = 0x2000;
const byte* SCREEN = 0x2800;
@ -15,27 +16,38 @@ kickasm(pc SCREEN_REF) {{
.byte round(256*atan2(y, x)/PI/2)
}}
void main() {
init_font_hex(CHARSET);
*D018 = toD018(SCREEN, CHARSET);
byte* screen = SCREEN;
byte* screen_ref = SCREEN_REF;
word diff_sum = 0;
for(signed byte y: -12..12) {
for(signed byte x: -19..20) {
//byte angle_b = atan2_8(x, y);
//diff_sum += diff(angle_b, *screen_ref);
//*screen = angle_b - *screen_ref++;
//*screen = angle_b;
signed word xw = (signed word)(word){ (byte)x, 0 };
signed word yw = (signed word)(word){ (byte)y, 0 };
word angle_w = atan2_16(xw, yw);
//*screen++ = (>angle_w)-angle_b;
//*screen++ = >angle_w;
*screen++ = (>(angle_w+0x0080)) - *screen_ref++;
//*screen++ = angle_b - *screen_ref++;
byte ang_w = >(angle_w+0x0080);
//*screen = (>angle_w)-angle_b;
//*screen = >angle_w;
diff_sum += diff(ang_w, *screen_ref);
*screen = ang_w - *screen_ref;
//*screen++ = *screen_ref++;
screen++;
screen_ref++;
}
}
print_word(diff_sum);
byte* col00 = COLS+12*40+19;
while(true) (*col00)++;
}
byte diff(byte bb1, byte bb2) {
return (bb1<bb2)?(bb2-bb1):bb1-bb2;
}

View File

@ -4,48 +4,23 @@
import "font-hex"
import "atan2"
import "c64"
import "print"
const byte* CHARSET = 0x2000;
const byte* SCREEN = 0x2800;
const byte* SCREEN_REF = 0x2c00;
kickasm(pc SCREEN_REF) {{
.for(var y=-12;y<=12;y++)
.for(var x=-19;x<=20;x++)
.byte round(256*atan2(y, x)/PI/2)
}}
void main() {
init_font_hex(CHARSET);
*D018 = toD018(SCREEN, CHARSET);
byte* screen = SCREEN;
byte* screen_ref = SCREEN_REF;
//word diff_sum = 0;
for(signed byte y: -12..12) {
for(signed byte x: -19..20) {
byte angle_b = atan2_8(x, y);
signed word xw = (signed word)(word){ (byte)x, 0 };
signed word yw = (signed word)(word){ (byte)y, 0 };
word angle_w = atan2_16(xw, yw);
byte ang_w = >(angle_w+0x0080);
//*screen++ = (>angle_w)-angle_b;
*screen++ = >angle_w;
//diff_sum += diff(ang_w, *screen_ref);
//diff_sum += diff(angle_b, *screen_ref);
//*screen++ = ang_w - *screen_ref++;
//*screen++ = angle_b - *screen_ref++;
//*screen++ = angle_b;
//*screen++ = *screen_ref++;
*screen++ = ang_w;
}
}
//print_word(diff_sum);
byte* col00 = COLS+12*40+19;
while(true) (*col00)++;
}
byte diff(byte bb1, byte bb2) {
return (bb1<bb2)?(bb2-bb1):bb1-bb2;
}

View File

@ -12,7 +12,6 @@ const byte* SCREEN = 0x2800;
void main() {
init_font_hex(CHARSET);
*D018 = toD018(SCREEN, CHARSET);
byte* screen = SCREEN;
for(signed byte y: -12..12) {
for(signed byte x: -19..20) {

View File

@ -17,15 +17,18 @@
.label CHARSET = $2000
.label SCREEN = $2800
.label SCREEN_REF = $2c00
.label print_char_cursor = 9
// Populate cordic angles table
// Populate cordic angles table
main: {
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET)/4&$f
.label _11 = $c
.label xw = $17
.label yw = $19
.label angle_w = $c
.label screen = 5
.label _12 = $10
.label xw = $1b
.label yw = $1d
.label angle_w = $10
.label ang_w = $1f
.label diff_sum = 5
.label screen = 7
.label screen_ref = 3
.label y = 2
jsr init_font_hex
@ -35,6 +38,9 @@ main: {
sta screen
lda #>SCREEN
sta screen+1
lda #0
sta diff_sum
sta diff_sum+1
lda #<SCREEN_REF
sta screen_ref
lda #>SCREEN_REF
@ -54,17 +60,28 @@ main: {
jsr atan2_16
lda #$80
clc
adc _11
sta _11
adc _12
sta _12
bcc !+
inc _11+1
inc _12+1
!:
lda _11+1
lda _12+1
sta ang_w
ldy #0
lda (screen_ref),y
jsr diff
//*screen = (>angle_w)-angle_b;
//*screen = >angle_w;
clc
adc diff_sum
sta diff_sum
bcc !+
inc diff_sum+1
!:
lda ang_w
sec
ldy #0
sbc (screen_ref),y
//*screen++ = (>angle_w)-angle_b;
//*screen++ = >angle_w;
sta (screen),y
inc screen
bne !+
@ -81,29 +98,90 @@ main: {
lda #$d
cmp y
bne b1
b4:
jsr print_word
b5:
lda COLS+$c*$28+$13
clc
adc #1
sta COLS+$c*$28+$13
jmp b4
jmp b5
}
// Print a word as HEX
// print_word(word zeropage(5) w)
print_word: {
.label w = 5
lda w+1
tax
lda #<$400
sta print_char_cursor
lda #>$400
sta print_char_cursor+1
jsr print_byte
lda w
tax
jsr print_byte
rts
}
// Print a byte as HEX
// print_byte(byte register(X) b)
print_byte: {
txa
lsr
lsr
lsr
lsr
tay
lda print_hextab,y
jsr print_char
lda #$f
axs #0
lda print_hextab,x
jsr print_char
rts
}
// Print a single char
// print_char(byte register(A) ch)
print_char: {
ldy #0
sta (print_char_cursor),y
inc print_char_cursor
bne !+
inc print_char_cursor+1
!:
rts
}
// diff(byte zeropage($1f) bb1, byte register(A) bb2)
diff: {
.label bb1 = $1f
cmp bb1
beq !+
bcs b1
!:
eor #$ff
sec
adc bb1
rts
b1:
sec
sbc bb1
rts
}
// 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($1b) x, signed word zeropage($1d) y)
atan2_16: {
.label _2 = 7
.label _7 = 9
.label yi = 7
.label xi = 9
.label xd = $1b
.label yd = $1d
.label angle = $c
.label i = $b
.label return = $c
.label x = $17
.label y = $19
.label _2 = $b
.label _7 = $d
.label yi = $b
.label xi = $d
.label xd = $20
.label yd = $22
.label angle = $10
.label i = $f
.label return = $10
.label x = $1b
.label y = $1d
lda y+1
bne !+
lda y
@ -238,7 +316,7 @@ atan2_16: {
sta angle+1
b14:
inc i
lda #CORDIC_ITERATIONS_16+1
lda #CORDIC_ITERATIONS_16-1+1
cmp i
bne !b12+
jmp b12
@ -284,15 +362,15 @@ atan2_16: {
jmp b3
}
// Make charset from proto chars
// init_font_hex(byte* zeropage($11) charset)
// init_font_hex(byte* zeropage($15) 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 = $24
.label idx = $1a
.label proto_lo = $17
.label charset = $15
.label c1 = $19
.label proto_hi = $12
.label c = $14
lda #0
sta c
lda #<FONT_HEX_PROTO
@ -375,6 +453,7 @@ init_font_hex: {
}
// Bit patterns for symbols 0-f (3x5 pixels) used in font hex
FONT_HEX_PROTO: .byte 2, 5, 5, 5, 2, 6, 2, 2, 2, 7, 6, 1, 2, 4, 7, 6, 1, 2, 1, 6, 5, 5, 7, 1, 1, 7, 4, 6, 1, 6, 3, 4, 6, 5, 2, 7, 1, 1, 1, 1, 2, 5, 2, 5, 2, 2, 5, 3, 1, 1, 2, 5, 7, 5, 5, 6, 5, 6, 5, 6, 2, 5, 4, 5, 2, 6, 5, 5, 5, 6, 7, 4, 6, 4, 7, 7, 4, 6, 4, 4
print_hextab: .text "0123456789abcdef"
.pc = CORDIC_ATAN2_ANGLES_16 "CORDIC_ATAN2_ANGLES_16"
.for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2

View File

@ -28,157 +28,221 @@ main: scope:[main] from @4
to:main::toD0181
main::toD0181: scope:[main] from main
[9] phi()
to:main::@5
main::@5: scope:[main] from main::toD0181
to:main::@6
main::@6: scope:[main] from main::toD0181
[10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
to:main::@1
main::@1: scope:[main] from main::@3 main::@5
[11] (byte*) main::screen#4 ← phi( main::@5/(const byte*) SCREEN#0 main::@3/(byte*) main::screen#1 )
[11] (byte*) main::screen_ref#4 ← phi( main::@5/(const byte*) SCREEN_REF#0 main::@3/(byte*) main::screen_ref#1 )
[11] (signed byte) main::y#4 ← phi( main::@5/(signed byte) -$c main::@3/(signed byte) main::y#1 )
main::@1: scope:[main] from main::@3 main::@6
[11] (byte*) main::screen#5 ← phi( main::@6/(const byte*) SCREEN#0 main::@3/(byte*) main::screen#1 )
[11] (word) main::diff_sum#7 ← phi( main::@6/(byte) 0 main::@3/(word) main::diff_sum#1 )
[11] (byte*) main::screen_ref#5 ← phi( main::@6/(const byte*) SCREEN_REF#0 main::@3/(byte*) main::screen_ref#1 )
[11] (signed byte) main::y#4 ← phi( main::@6/(signed byte) -$c main::@3/(signed byte) main::y#1 )
to:main::@2
main::@2: scope:[main] from main::@1 main::@6
[12] (byte*) main::screen#2 ← phi( main::@1/(byte*) main::screen#4 main::@6/(byte*) main::screen#1 )
[12] (byte*) main::screen_ref#2 ← phi( main::@1/(byte*) main::screen_ref#4 main::@6/(byte*) main::screen_ref#1 )
[12] (signed byte) main::x#2 ← phi( main::@1/(signed byte) -$13 main::@6/(signed byte) main::x#1 )
main::@2: scope:[main] from main::@1 main::@8
[12] (byte*) main::screen#2 ← phi( main::@1/(byte*) main::screen#5 main::@8/(byte*) main::screen#1 )
[12] (word) main::diff_sum#2 ← phi( main::@1/(word) main::diff_sum#7 main::@8/(word) main::diff_sum#1 )
[12] (byte*) main::screen_ref#2 ← phi( main::@1/(byte*) main::screen_ref#5 main::@8/(byte*) main::screen_ref#1 )
[12] (signed byte) main::x#2 ← phi( main::@1/(signed byte) -$13 main::@8/(signed byte) main::x#1 )
[13] (word) main::xw#0 ← (byte)(signed byte) main::x#2 w= (byte) 0
[14] (word) main::yw#0 ← (byte)(signed byte) main::y#4 w= (byte) 0
[15] (signed word) atan2_16::x#0 ← (signed word)(word) main::xw#0
[16] (signed word) atan2_16::y#0 ← (signed word)(word) main::yw#0
[17] call atan2_16
[18] (word) atan2_16::return#2 ← (word) atan2_16::return#0
to:main::@6
main::@6: scope:[main] from main::@2
to:main::@7
main::@7: scope:[main] from main::@2
[19] (word) main::angle_w#0 ← (word) atan2_16::return#2
[20] (word~) main::$11 ← (word) main::angle_w#0 + (byte) $80
[21] (byte~) main::$12 ← > (word~) main::$11
[22] (byte~) main::$13 ← (byte~) main::$12 - *((byte*) main::screen_ref#2)
[23] *((byte*) main::screen#2) ← (byte~) main::$13
[24] (byte*) main::screen#1 ← ++ (byte*) main::screen#2
[25] (byte*) main::screen_ref#1 ← ++ (byte*) main::screen_ref#2
[26] (signed byte) main::x#1 ← ++ (signed byte) main::x#2
[27] if((signed byte) main::x#1!=(signed byte) $15) goto main::@2
[20] (word~) main::$12 ← (word) main::angle_w#0 + (byte) $80
[21] (byte) main::ang_w#0 ← > (word~) main::$12
[22] (byte) diff::bb1#0 ← (byte) main::ang_w#0
[23] (byte) diff::bb2#0 ← *((byte*) main::screen_ref#2)
[24] call diff
[25] (byte) diff::return#0 ← (byte) diff::return#1
to:main::@8
main::@8: scope:[main] from main::@7
[26] (byte~) main::$14 ← (byte) diff::return#0
[27] (word) main::diff_sum#1 ← (word) main::diff_sum#2 + (byte~) main::$14
[28] (byte~) main::$15 ← (byte) main::ang_w#0 - *((byte*) main::screen_ref#2)
[29] *((byte*) main::screen#2) ← (byte~) main::$15
[30] (byte*) main::screen#1 ← ++ (byte*) main::screen#2
[31] (byte*) main::screen_ref#1 ← ++ (byte*) main::screen_ref#2
[32] (signed byte) main::x#1 ← ++ (signed byte) main::x#2
[33] if((signed byte) main::x#1!=(signed byte) $15) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@6
[28] (signed byte) main::y#1 ← ++ (signed byte) main::y#4
[29] if((signed byte) main::y#1!=(signed byte) $d) goto main::@1
to:main::@4
main::@4: scope:[main] from main::@3 main::@4
[30] *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13) ← ++ *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13)
main::@3: scope:[main] from main::@8
[34] (signed byte) main::y#1 ← ++ (signed byte) main::y#4
[35] if((signed byte) main::y#1!=(signed byte) $d) goto main::@1
to:main::@4
main::@4: scope:[main] from main::@3
[36] (word) print_word::w#0 ← (word) main::diff_sum#1
[37] call print_word
to:main::@5
main::@5: scope:[main] from main::@4 main::@5
[38] *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13) ← ++ *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13)
to:main::@5
print_word: scope:[print_word] from main::@4
[39] (byte) print_byte::b#0 ← > (word) print_word::w#0
[40] call print_byte
to:print_word::@1
print_word::@1: scope:[print_word] from print_word
[41] (byte) print_byte::b#1 ← < (word) print_word::w#0
[42] call print_byte
to:print_word::@return
print_word::@return: scope:[print_word] from print_word::@1
[43] return
to:@return
print_byte: scope:[print_byte] from print_word print_word::@1
[44] (byte*) print_char_cursor#24 ← phi( print_word/(byte*) 1024 print_word::@1/(byte*) print_char_cursor#19 )
[44] (byte) print_byte::b#2 ← phi( print_word/(byte) print_byte::b#0 print_word::@1/(byte) print_byte::b#1 )
[45] (byte~) print_byte::$0 ← (byte) print_byte::b#2 >> (byte) 4
[46] (byte) print_char::ch#0 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$0)
[47] call print_char
to:print_byte::@1
print_byte::@1: scope:[print_byte] from print_byte
[48] (byte~) print_byte::$2 ← (byte) print_byte::b#2 & (byte) $f
[49] (byte) print_char::ch#1 ← *((const byte[]) print_hextab#0 + (byte~) print_byte::$2)
[50] call print_char
to:print_byte::@return
print_byte::@return: scope:[print_byte] from print_byte::@1
[51] return
to:@return
print_char: scope:[print_char] from print_byte print_byte::@1
[52] (byte*) print_char_cursor#18 ← phi( print_byte/(byte*) print_char_cursor#24 print_byte::@1/(byte*) print_char_cursor#19 )
[52] (byte) print_char::ch#2 ← phi( print_byte/(byte) print_char::ch#0 print_byte::@1/(byte) print_char::ch#1 )
[53] *((byte*) print_char_cursor#18) ← (byte) print_char::ch#2
[54] (byte*) print_char_cursor#19 ← ++ (byte*) print_char_cursor#18
to:print_char::@return
print_char::@return: scope:[print_char] from print_char
[55] return
to:@return
diff: scope:[diff] from main::@7
[56] if((byte) diff::bb1#0<(byte) diff::bb2#0) goto diff::@1
to:diff::@2
diff::@2: scope:[diff] from diff
[57] (byte~) diff::$2 ← (byte) diff::bb1#0 - (byte) diff::bb2#0
to:diff::@3
diff::@3: scope:[diff] from diff::@1 diff::@2
[58] (byte) diff::return#1 ← phi( diff::@1/(byte~) diff::$4 diff::@2/(byte~) diff::$2 )
to:diff::@return
diff::@return: scope:[diff] from diff::@3
[59] return
to:@return
diff::@1: scope:[diff] from diff
[60] (byte~) diff::$4 ← (byte) diff::bb2#0 - (byte) diff::bb1#0
to:diff::@3
atan2_16: scope:[atan2_16] from main::@2
[31] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1
[61] 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
[32] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0
[62] (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
[33] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#11 atan2_16::@2/(signed word~) atan2_16::$2 )
[34] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4
[63] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#11 atan2_16::@2/(signed word~) atan2_16::$2 )
[64] 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
[35] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0
[65] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0
to:atan2_16::@6
atan2_16::@6: scope:[atan2_16] from atan2_16::@4 atan2_16::@5
[36] (signed word) atan2_16::xi#0 ← phi( atan2_16::@4/(signed word~) atan2_16::xi#8 atan2_16::@5/(signed word~) atan2_16::$7 )
[66] (signed word) atan2_16::xi#0 ← phi( atan2_16::@4/(signed word~) atan2_16::xi#8 atan2_16::@5/(signed word~) atan2_16::$7 )
to:atan2_16::@10
atan2_16::@10: scope:[atan2_16] from atan2_16::@14 atan2_16::@6
[37] (word) atan2_16::angle#12 ← phi( atan2_16::@14/(word) atan2_16::angle#13 atan2_16::@6/(byte) 0 )
[37] (byte) atan2_16::i#2 ← phi( atan2_16::@14/(byte) atan2_16::i#1 atan2_16::@6/(byte) 0 )
[37] (signed word) atan2_16::xi#3 ← phi( atan2_16::@14/(signed word) atan2_16::xi#7 atan2_16::@6/(signed word) atan2_16::xi#0 )
[37] (signed word) atan2_16::yi#3 ← phi( atan2_16::@14/(signed word) atan2_16::yi#7 atan2_16::@6/(signed word) atan2_16::yi#0 )
[38] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11
[67] (word) atan2_16::angle#12 ← phi( atan2_16::@14/(word) atan2_16::angle#13 atan2_16::@6/(byte) 0 )
[67] (byte) atan2_16::i#2 ← phi( atan2_16::@14/(byte) atan2_16::i#1 atan2_16::@6/(byte) 0 )
[67] (signed word) atan2_16::xi#3 ← phi( atan2_16::@14/(signed word) atan2_16::xi#7 atan2_16::@6/(signed word) atan2_16::xi#0 )
[67] (signed word) atan2_16::yi#3 ← phi( atan2_16::@14/(signed word) atan2_16::yi#7 atan2_16::@6/(signed word) atan2_16::yi#0 )
[68] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11
to:atan2_16::@12
atan2_16::@12: scope:[atan2_16] from atan2_16::@10 atan2_16::@14
[39] (word) atan2_16::angle#6 ← phi( atan2_16::@10/(word) atan2_16::angle#12 atan2_16::@14/(word) atan2_16::angle#13 )
[40] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1
[41] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7
[69] (word) atan2_16::angle#6 ← phi( atan2_16::@10/(word) atan2_16::angle#12 atan2_16::@14/(word) atan2_16::angle#13 )
[70] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1
[71] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7
to:atan2_16::@16
atan2_16::@16: scope:[atan2_16] from atan2_16::@12
[42] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1
[72] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1
to:atan2_16::@7
atan2_16::@7: scope:[atan2_16] from atan2_16::@12 atan2_16::@16
[43] (word) atan2_16::angle#11 ← phi( atan2_16::@12/(word) atan2_16::angle#1 atan2_16::@16/(word) atan2_16::angle#4 )
[44] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8
[73] (word) atan2_16::angle#11 ← phi( atan2_16::@12/(word) atan2_16::angle#1 atan2_16::@16/(word) atan2_16::angle#4 )
[74] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8
to:atan2_16::@9
atan2_16::@9: scope:[atan2_16] from atan2_16::@7
[45] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11
[75] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11
to:atan2_16::@8
atan2_16::@8: scope:[atan2_16] from atan2_16::@7 atan2_16::@9
[46] (word) atan2_16::return#0 ← phi( atan2_16::@9/(word) atan2_16::angle#5 atan2_16::@7/(word) atan2_16::angle#11 )
[76] (word) atan2_16::return#0 ← phi( atan2_16::@9/(word) atan2_16::angle#5 atan2_16::@7/(word) atan2_16::angle#11 )
to:atan2_16::@return
atan2_16::@return: scope:[atan2_16] from atan2_16::@8
[47] return
[77] return
to:@return
atan2_16::@11: scope:[atan2_16] from atan2_16::@10
[48] (signed word) atan2_16::xd#0 ← (signed word) atan2_16::xi#3 >> (byte) atan2_16::i#2
[49] (signed word) atan2_16::yd#0 ← (signed word) atan2_16::yi#3 >> (byte) atan2_16::i#2
[50] if((signed word) atan2_16::yi#3>(signed byte) 0) goto atan2_16::@13
[78] (signed word) atan2_16::xd#0 ← (signed word) atan2_16::xi#3 >> (byte) atan2_16::i#2
[79] (signed word) atan2_16::yd#0 ← (signed word) atan2_16::yi#3 >> (byte) atan2_16::i#2
[80] if((signed word) atan2_16::yi#3>(signed byte) 0) goto atan2_16::@13
to:atan2_16::@15
atan2_16::@15: scope:[atan2_16] from atan2_16::@11
[51] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#0
[52] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#0
[53] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1
[54] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word*) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
[81] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#0
[82] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#0
[83] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1
[84] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word*) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24)
to:atan2_16::@14
atan2_16::@14: scope:[atan2_16] from atan2_16::@13 atan2_16::@15
[55] (signed word) atan2_16::xi#7 ← phi( atan2_16::@13/(signed word) atan2_16::xi#1 atan2_16::@15/(signed word) atan2_16::xi#2 )
[55] (word) atan2_16::angle#13 ← phi( atan2_16::@13/(word) atan2_16::angle#2 atan2_16::@15/(word) atan2_16::angle#3 )
[55] (signed word) atan2_16::yi#7 ← phi( atan2_16::@13/(signed word) atan2_16::yi#1 atan2_16::@15/(signed word) atan2_16::yi#2 )
[56] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2
[57] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0+(byte) 1) goto atan2_16::@12
[85] (signed word) atan2_16::xi#7 ← phi( atan2_16::@13/(signed word) atan2_16::xi#1 atan2_16::@15/(signed word) atan2_16::xi#2 )
[85] (word) atan2_16::angle#13 ← phi( atan2_16::@13/(word) atan2_16::angle#2 atan2_16::@15/(word) atan2_16::angle#3 )
[85] (signed word) atan2_16::yi#7 ← phi( atan2_16::@13/(signed word) atan2_16::yi#1 atan2_16::@15/(signed word) atan2_16::yi#2 )
[86] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2
[87] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0-(byte) 1+(byte) 1) goto atan2_16::@12
to:atan2_16::@10
atan2_16::@13: scope:[atan2_16] from atan2_16::@11
[58] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#0
[59] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#0
[60] (byte~) atan2_16::$22 ← (byte) atan2_16::i#2 << (byte) 1
[61] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word*) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$22)
[88] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#0
[89] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#0
[90] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1
[91] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word*) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
to:atan2_16::@14
atan2_16::@4: scope:[atan2_16] from atan2_16::@3
[62] (signed word~) atan2_16::xi#8 ← (signed word) atan2_16::x#0
[92] (signed word~) atan2_16::xi#8 ← (signed word) atan2_16::x#0
to:atan2_16::@6
atan2_16::@1: scope:[atan2_16] from atan2_16
[63] (signed word~) atan2_16::yi#11 ← (signed word) atan2_16::y#0
[93] (signed word~) atan2_16::yi#11 ← (signed word) atan2_16::y#0
to:atan2_16::@3
init_font_hex: scope:[init_font_hex] from main
[64] phi()
[94] phi()
to:init_font_hex::@1
init_font_hex::@1: scope:[init_font_hex] from init_font_hex init_font_hex::@5
[65] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 )
[65] (byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 )
[65] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET#0 init_font_hex::@5/(byte*) init_font_hex::charset#0 )
[95] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 )
[95] (byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 )
[95] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET#0 init_font_hex::@5/(byte*) init_font_hex::charset#0 )
to:init_font_hex::@2
init_font_hex::@2: scope:[init_font_hex] from init_font_hex::@1 init_font_hex::@4
[66] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 )
[66] (byte*) init_font_hex::proto_lo#4 ← phi( init_font_hex::@1/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@4/(byte*) init_font_hex::proto_lo#1 )
[66] (byte*) init_font_hex::charset#2 ← phi( init_font_hex::@1/(byte*) init_font_hex::charset#5 init_font_hex::@4/(byte*) init_font_hex::charset#0 )
[67] *((byte*) init_font_hex::charset#2) ← (byte) 0
[96] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 )
[96] (byte*) init_font_hex::proto_lo#4 ← phi( init_font_hex::@1/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@4/(byte*) init_font_hex::proto_lo#1 )
[96] (byte*) init_font_hex::charset#2 ← phi( init_font_hex::@1/(byte*) init_font_hex::charset#5 init_font_hex::@4/(byte*) init_font_hex::charset#0 )
[97] *((byte*) init_font_hex::charset#2) ← (byte) 0
to:init_font_hex::@3
init_font_hex::@3: scope:[init_font_hex] from init_font_hex::@2 init_font_hex::@3
[68] (byte) init_font_hex::idx#5 ← phi( init_font_hex::@2/(byte) 1 init_font_hex::@3/(byte) init_font_hex::idx#2 )
[68] (byte) init_font_hex::i#2 ← phi( init_font_hex::@2/(byte) 0 init_font_hex::@3/(byte) init_font_hex::i#1 )
[69] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4
[70] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1
[71] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1
[72] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2
[73] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5
[74] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2
[75] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3
[98] (byte) init_font_hex::idx#5 ← phi( init_font_hex::@2/(byte) 1 init_font_hex::@3/(byte) init_font_hex::idx#2 )
[98] (byte) init_font_hex::i#2 ← phi( init_font_hex::@2/(byte) 0 init_font_hex::@3/(byte) init_font_hex::i#1 )
[99] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4
[100] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1
[101] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1
[102] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2
[103] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5
[104] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2
[105] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3
to:init_font_hex::@4
init_font_hex::@4: scope:[init_font_hex] from init_font_hex::@3
[76] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0
[77] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2
[78] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0
[79] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5
[80] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8
[81] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4
[82] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2
[106] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0
[107] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2
[108] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0
[109] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5
[110] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8
[111] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4
[112] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2
to:init_font_hex::@5
init_font_hex::@5: scope:[init_font_hex] from init_font_hex::@4
[83] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5
[84] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6
[85] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1
[113] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5
[114] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6
[115] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1
to:init_font_hex::@return
init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5
[86] return
[116] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -25,10 +25,10 @@
(byte*) SCREEN_REF
(const byte*) SCREEN_REF#0 SCREEN_REF = (byte*) 11264
(word()) atan2_16((signed word) atan2_16::x , (signed word) atan2_16::y)
(signed word~) atan2_16::$2 $2 zp ZP_WORD:7 4.0
(byte~) atan2_16::$22 reg byte a 2002.0
(signed word~) atan2_16::$2 $2 zp ZP_WORD:11 4.0
(byte~) atan2_16::$23 reg byte a 2002.0
(signed word~) atan2_16::$7 $7 zp ZP_WORD:9 4.0
(byte~) atan2_16::$24 reg byte a 2002.0
(signed word~) atan2_16::$7 $7 zp ZP_WORD:13 4.0
(label) atan2_16::@1
(label) atan2_16::@10
(label) atan2_16::@11
@ -47,45 +47,59 @@
(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:16 3.0
(word) atan2_16::angle#11 angle zp ZP_WORD:16 4.0
(word) atan2_16::angle#12 angle zp ZP_WORD:16 364.0
(word) atan2_16::angle#13 angle zp ZP_WORD:16 1334.6666666666667
(word) atan2_16::angle#2 angle zp ZP_WORD:16 2002.0
(word) atan2_16::angle#3 angle zp ZP_WORD:16 2002.0
(word) atan2_16::angle#4 angle zp ZP_WORD:16 4.0
(word) atan2_16::angle#5 angle zp ZP_WORD:16 4.0
(word) atan2_16::angle#6 angle zp ZP_WORD:16 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:15 1501.5
(byte) atan2_16::i#2 i zp ZP_BYTE:15 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:16 34.99999999999999
(word) atan2_16::return#2 return zp ZP_WORD:16 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:27 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:32 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:13 6.0
(signed word) atan2_16::xi#1 xi zp ZP_WORD:13 500.5
(signed word) atan2_16::xi#2 xi zp ZP_WORD:13 500.5
(signed word) atan2_16::xi#3 xi zp ZP_WORD:13 801.2
(signed word) atan2_16::xi#7 xi zp ZP_WORD:13 1001.0
(signed word~) atan2_16::xi#8 xi zp ZP_WORD:13 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:29 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:34 1501.5
(signed word) atan2_16::yi
(signed word) atan2_16::yi#0 yi zp ZP_WORD:7 1.2000000000000002
(signed word) atan2_16::yi#1 yi zp ZP_WORD:7 667.3333333333334
(signed word~) atan2_16::yi#11 yi zp ZP_WORD:7 4.0
(signed word) atan2_16::yi#2 yi zp ZP_WORD:7 667.3333333333334
(signed word) atan2_16::yi#3 yi zp ZP_WORD:7 858.2857142857142
(signed word) atan2_16::yi#7 yi zp ZP_WORD:7 1001.0
(signed word) atan2_16::yi#0 yi zp ZP_WORD:11 1.2000000000000002
(signed word) atan2_16::yi#1 yi zp ZP_WORD:11 667.3333333333334
(signed word~) atan2_16::yi#11 yi zp ZP_WORD:11 4.0
(signed word) atan2_16::yi#2 yi zp ZP_WORD:11 667.3333333333334
(signed word) atan2_16::yi#3 yi zp ZP_WORD:11 858.2857142857142
(signed word) atan2_16::yi#7 yi zp ZP_WORD:11 1001.0
(byte()) diff((byte) diff::bb1 , (byte) diff::bb2)
(byte~) diff::$2 reg byte a 4.0
(byte~) diff::$4 reg byte a 4.0
(label) diff::@1
(label) diff::@2
(label) diff::@3
(label) diff::@return
(byte) diff::bb1
(byte) diff::bb1#0 bb1 zp ZP_BYTE:31 35.66666666666666
(byte) diff::bb2
(byte) diff::bb2#0 reg byte a 53.5
(byte) diff::return
(byte) diff::return#0 reg byte a 202.0
(byte) diff::return#1 reg byte a 34.99999999999999
(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:36 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
@ -95,49 +109,57 @@
(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:20 16.5
(byte) init_font_hex::c#6 c zp ZP_BYTE:20 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:25 151.5
(byte) init_font_hex::c1#4 c1 zp ZP_BYTE:25 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:21 35.5
(byte*) init_font_hex::charset#2 charset zp ZP_WORD:21 108.35714285714285
(byte*) init_font_hex::charset#5 charset zp ZP_WORD:21 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:26 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:26 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:18 7.333333333333333
(byte*) init_font_hex::proto_hi#6 proto_hi zp ZP_WORD:18 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:23 50.5
(byte*) init_font_hex::proto_lo#4 proto_lo zp ZP_WORD:23 92.53846153846155
(void()) main()
(word~) main::$11 $11 zp ZP_WORD:12 202.0
(byte~) main::$12 reg byte a 202.0
(byte~) main::$13 reg byte a 202.0
(word~) main::$12 $12 zp ZP_WORD:16 202.0
(byte~) main::$14 reg byte a 202.0
(byte~) main::$15 reg byte a 202.0
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@8
(byte) main::ang_w
(byte) main::ang_w#0 ang_w zp ZP_BYTE:31 43.285714285714285
(word) main::angle_w
(word) main::angle_w#0 angle_w zp ZP_WORD:12 202.0
(word) main::angle_w#0 angle_w zp ZP_WORD:16 202.0
(byte*) main::col00
(word) main::diff_sum
(word) main::diff_sum#1 diff_sum zp ZP_WORD:5 23.888888888888886
(word) main::diff_sum#2 diff_sum zp ZP_WORD:5 14.2
(word) main::diff_sum#7 diff_sum zp ZP_WORD:5 22.0
(byte*) main::screen
(byte*) main::screen#1 screen zp ZP_WORD:5 35.5
(byte*) main::screen#2 screen zp ZP_WORD:5 26.166666666666664
(byte*) main::screen#4 screen zp ZP_WORD:5 22.0
(byte*) main::screen#1 screen zp ZP_WORD:7 35.5
(byte*) main::screen#2 screen zp ZP_WORD:7 17.444444444444443
(byte*) main::screen#5 screen zp ZP_WORD:7 22.0
(byte*) main::screen_ref
(byte*) main::screen_ref#1 screen_ref zp ZP_WORD:3 42.599999999999994
(byte*) main::screen_ref#2 screen_ref zp ZP_WORD:3 24.153846153846153
(byte*) main::screen_ref#4 screen_ref zp ZP_WORD:3 22.0
(byte*) main::screen_ref#2 screen_ref zp ZP_WORD:3 21.842105263157897
(byte*) main::screen_ref#5 screen_ref zp ZP_WORD:3 22.0
(label) main::toD0181
(word~) main::toD0181_$0
(number~) main::toD0181_$1
@ -154,39 +176,77 @@
(byte*) main::toD0181_screen
(signed byte) main::x
(signed byte) main::x#1 reg byte x 151.5
(signed byte) main::x#2 reg byte x 14.428571428571429
(signed byte) main::x#2 reg byte x 10.1
(signed word) main::xw
(word) main::xw#0 xw zp ZP_WORD:23 50.5
(word) main::xw#0 xw zp ZP_WORD:27 50.5
(signed byte) main::y
(signed byte) main::y#1 y zp ZP_BYTE:2 16.5
(signed byte) main::y#4 y zp ZP_BYTE:2 1.2941176470588236
(signed byte) main::y#4 y zp ZP_BYTE:2 0.9565217391304348
(signed word) main::yw
(word) main::yw#0 yw zp ZP_WORD:25 50.5
(word) main::yw#0 yw zp ZP_WORD:29 50.5
(void()) print_byte((byte) print_byte::b)
(byte~) print_byte::$0 reg byte a 4.0
(byte~) print_byte::$2 reg byte x 4.0
(label) print_byte::@1
(label) print_byte::@return
(byte) print_byte::b
(byte) print_byte::b#0 reg byte x 4.0
(byte) print_byte::b#1 reg byte x 4.0
(byte) print_byte::b#2 reg byte x 2.0
(void()) print_char((byte) print_char::ch)
(label) print_char::@return
(byte) print_char::ch
(byte) print_char::ch#0 reg byte a 4.0
(byte) print_char::ch#1 reg byte a 4.0
(byte) print_char::ch#2 reg byte a 6.0
(byte*) print_char_cursor
(byte*) print_char_cursor#18 print_char_cursor zp ZP_WORD:9 4.0
(byte*) print_char_cursor#19 print_char_cursor zp ZP_WORD:9 0.6666666666666666
(byte*) print_char_cursor#24 print_char_cursor zp ZP_WORD:9 1.3333333333333333
(byte[]) print_hextab
(const byte[]) print_hextab#0 print_hextab = (string) "0123456789abcdef"
(byte*) print_line_cursor
(byte*) print_screen
(void()) print_word((word) print_word::w)
(label) print_word::@1
(label) print_word::@return
(word) print_word::w
(word) print_word::w#0 w zp ZP_WORD:5 2.0
zp ZP_BYTE:2 [ main::y#4 main::y#1 ]
reg byte x [ main::x#2 main::x#1 ]
zp ZP_WORD:3 [ main::screen_ref#2 main::screen_ref#4 main::screen_ref#1 ]
zp ZP_WORD:5 [ main::screen#2 main::screen#4 main::screen#1 ]
zp ZP_WORD:7 [ 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 main::angle_w#0 main::$11 ]
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:3 [ main::screen_ref#2 main::screen_ref#5 main::screen_ref#1 ]
zp ZP_WORD:5 [ main::diff_sum#2 main::diff_sum#7 main::diff_sum#1 print_word::w#0 ]
zp ZP_WORD:7 [ main::screen#2 main::screen#5 main::screen#1 ]
reg byte x [ print_byte::b#2 print_byte::b#0 print_byte::b#1 ]
reg byte a [ print_char::ch#2 print_char::ch#0 print_char::ch#1 ]
zp ZP_WORD:9 [ print_char_cursor#18 print_char_cursor#24 print_char_cursor#19 ]
reg byte a [ diff::return#1 diff::$4 diff::$2 ]
zp ZP_WORD:11 [ 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:13 [ 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:15 [ atan2_16::i#2 atan2_16::i#1 ]
zp ZP_WORD:16 [ 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 main::angle_w#0 main::$12 ]
zp ZP_WORD:18 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ]
zp ZP_BYTE:20 [ init_font_hex::c#6 init_font_hex::c#1 ]
zp ZP_WORD:21 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ]
zp ZP_WORD:23 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ]
zp ZP_BYTE:25 [ 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 [ main::xw#0 atan2_16::x#0 ]
zp ZP_WORD:25 [ main::yw#0 atan2_16::y#0 ]
reg byte a [ main::$12 ]
reg byte a [ main::$13 ]
zp ZP_WORD:27 [ atan2_16::xd#0 ]
zp ZP_WORD:29 [ atan2_16::yd#0 ]
zp ZP_BYTE:26 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
zp ZP_WORD:27 [ main::xw#0 atan2_16::x#0 ]
zp ZP_WORD:29 [ main::yw#0 atan2_16::y#0 ]
zp ZP_BYTE:31 [ main::ang_w#0 diff::bb1#0 ]
reg byte a [ diff::bb2#0 ]
reg byte a [ diff::return#0 ]
reg byte a [ main::$14 ]
reg byte a [ main::$15 ]
reg byte a [ print_byte::$0 ]
reg byte x [ print_byte::$2 ]
zp ZP_WORD:32 [ atan2_16::xd#0 ]
zp ZP_WORD:34 [ atan2_16::yd#0 ]
reg byte a [ atan2_16::$24 ]
reg byte a [ atan2_16::$23 ]
reg byte a [ atan2_16::$22 ]
zp ZP_BYTE:31 [ init_font_hex::$0 ]
zp ZP_BYTE:36 [ 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 ]

View File

@ -16,17 +16,15 @@
.label COLS = $d800
.label CHARSET = $2000
.label SCREEN = $2800
.label SCREEN_REF = $2c00
// Populate cordic angles table
// Populate cordic angles table
main: {
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET)/4&$f
.label _11 = $c
.label xw = $17
.label yw = $19
.label angle_w = $c
.label screen = 5
.label screen_ref = 3
.label _11 = $a
.label xw = $15
.label yw = $17
.label angle_w = $a
.label screen = 3
.label y = 2
jsr init_font_hex
lda #toD0181_return
@ -35,10 +33,6 @@ main: {
sta screen
lda #>SCREEN
sta screen+1
lda #<SCREEN_REF
sta screen_ref
lda #>SCREEN_REF
sta screen_ref+1
lda #-$c
sta y
b1:
@ -60,19 +54,11 @@ main: {
inc _11+1
!:
lda _11+1
sec
ldy #0
sbc (screen_ref),y
//*screen++ = (>angle_w)-angle_b;
//*screen++ = >angle_w;
sta (screen),y
inc screen
bne !+
inc screen+1
!:
inc screen_ref
bne !+
inc screen_ref+1
!:
inx
cpx #$15
@ -91,19 +77,19 @@ main: {
// 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 = 7
.label _7 = 9
.label yi = 7
.label xi = 9
.label xd = $1b
.label yd = $1d
.label angle = $c
.label i = $b
.label return = $c
.label x = $17
.label y = $19
.label _2 = 5
.label _7 = 7
.label yi = 5
.label xi = 7
.label xd = $19
.label yd = $1b
.label angle = $a
.label i = 9
.label return = $a
.label x = $15
.label y = $17
lda y+1
bne !+
lda y
@ -238,7 +224,7 @@ atan2_16: {
sta angle+1
b14:
inc i
lda #CORDIC_ITERATIONS_16+1
lda #CORDIC_ITERATIONS_16-1+1
cmp i
bne !b12+
jmp b12
@ -284,15 +270,15 @@ atan2_16: {
jmp b3
}
// 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
lda #0
sta c
lda #<FONT_HEX_PROTO
@ -382,8 +368,3 @@ init_font_hex: {
.pc = CORDIC_ATAN2_ANGLES_8 "CORDIC_ATAN2_ANGLES_8"
.fill CORDIC_ITERATIONS_8, 2*256*atan(1/pow(2,i))/PI/2
.pc = SCREEN_REF "SCREEN_REF"
.for(var y=-12;y<=12;y++)
.for(var x=-19;x<=20;x++)
.byte round(256*atan2(y, x)/PI/2)

View File

@ -11,174 +11,164 @@
}}
to:@3
@3: scope:[] from @2
kickasm(location (const byte*) SCREEN_REF#0) {{ .for(var y=-12;y<=12;y++)
.for(var x=-19;x<=20;x++)
.byte round(256*atan2(y, x)/PI/2)
}}
to:@4
@4: scope:[] from @3
[4] phi()
[5] call main
[3] phi()
[4] call main
to:@end
@end: scope:[] from @4
@end: scope:[] from @3
[5] phi()
main: scope:[main] from @3
[6] phi()
main: scope:[main] from @4
[7] phi()
[8] call init_font_hex
[7] call init_font_hex
to:main::toD0181
main::toD0181: scope:[main] from main
[9] phi()
[8] phi()
to:main::@5
main::@5: scope:[main] from main::toD0181
[10] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
[9] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
to:main::@1
main::@1: scope:[main] from main::@3 main::@5
[11] (byte*) main::screen#4 ← phi( main::@5/(const byte*) SCREEN#0 main::@3/(byte*) main::screen#1 )
[11] (byte*) main::screen_ref#4 ← phi( main::@5/(const byte*) SCREEN_REF#0 main::@3/(byte*) main::screen_ref#1 )
[11] (signed byte) main::y#4 ← phi( main::@5/(signed byte) -$c main::@3/(signed byte) main::y#1 )
[10] (byte*) main::screen#4 ← phi( main::@5/(const byte*) SCREEN#0 main::@3/(byte*) main::screen#1 )
[10] (signed byte) main::y#4 ← phi( main::@5/(signed byte) -$c main::@3/(signed byte) main::y#1 )
to:main::@2
main::@2: scope:[main] from main::@1 main::@6
[12] (byte*) main::screen#2 ← phi( main::@1/(byte*) main::screen#4 main::@6/(byte*) main::screen#1 )
[12] (byte*) main::screen_ref#2 ← phi( main::@1/(byte*) main::screen_ref#4 main::@6/(byte*) main::screen_ref#1 )
[12] (signed byte) main::x#2 ← phi( main::@1/(signed byte) -$13 main::@6/(signed byte) main::x#1 )
[13] (word) main::xw#0 ← (byte)(signed byte) main::x#2 w= (byte) 0
[14] (word) main::yw#0 ← (byte)(signed byte) main::y#4 w= (byte) 0
[15] (signed word) atan2_16::x#0 ← (signed word)(word) main::xw#0
[16] (signed word) atan2_16::y#0 ← (signed word)(word) main::yw#0
[17] call atan2_16
[18] (word) atan2_16::return#2 ← (word) atan2_16::return#0
[11] (byte*) main::screen#2 ← phi( main::@1/(byte*) main::screen#4 main::@6/(byte*) main::screen#1 )
[11] (signed byte) main::x#2 ← phi( main::@1/(signed byte) -$13 main::@6/(signed byte) main::x#1 )
[12] (word) main::xw#0 ← (byte)(signed byte) main::x#2 w= (byte) 0
[13] (word) main::yw#0 ← (byte)(signed byte) main::y#4 w= (byte) 0
[14] (signed word) atan2_16::x#0 ← (signed word)(word) main::xw#0
[15] (signed word) atan2_16::y#0 ← (signed word)(word) main::yw#0
[16] call atan2_16
[17] (word) atan2_16::return#2 ← (word) atan2_16::return#0
to:main::@6
main::@6: scope:[main] from main::@2
[19] (word) main::angle_w#0 ← (word) atan2_16::return#2
[20] (word~) main::$11 ← (word) main::angle_w#0 + (byte) $80
[21] (byte~) main::$12 ← > (word~) main::$11
[22] (byte~) main::$13 ← (byte~) main::$12 - *((byte*) main::screen_ref#2)
[23] *((byte*) main::screen#2) ← (byte~) main::$13
[24] (byte*) main::screen#1 ← ++ (byte*) main::screen#2
[25] (byte*) main::screen_ref#1 ← ++ (byte*) main::screen_ref#2
[26] (signed byte) main::x#1 ← ++ (signed byte) main::x#2
[27] if((signed byte) main::x#1!=(signed byte) $15) goto main::@2
[18] (word) main::angle_w#0 ← (word) atan2_16::return#2
[19] (word~) main::$11 ← (word) main::angle_w#0 + (byte) $80
[20] (byte) main::ang_w#0 ← > (word~) main::$11
[21] *((byte*) main::screen#2) ← (byte) main::ang_w#0
[22] (byte*) main::screen#1 ← ++ (byte*) main::screen#2
[23] (signed byte) main::x#1 ← ++ (signed byte) main::x#2
[24] if((signed byte) main::x#1!=(signed byte) $15) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@6
[28] (signed byte) main::y#1 ← ++ (signed byte) main::y#4
[29] if((signed byte) main::y#1!=(signed byte) $d) goto main::@1
[25] (signed byte) main::y#1 ← ++ (signed byte) main::y#4
[26] if((signed byte) main::y#1!=(signed byte) $d) goto main::@1
to:main::@4
main::@4: scope:[main] from main::@3 main::@4
[30] *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13) ← ++ *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13)
[27] *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13) ← ++ *((const byte*) COLS#0+(word)(number) $c*(number) $28+(byte) $13)
to:main::@4
atan2_16: scope:[atan2_16] from main::@2
[31] if((signed word) atan2_16::y#0>(signed byte) 0) goto atan2_16::@1
[28] 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
[32] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0
[29] (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
[33] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#11 atan2_16::@2/(signed word~) atan2_16::$2 )
[34] if((signed word) atan2_16::x#0>(signed byte) 0) goto atan2_16::@4
[30] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#11 atan2_16::@2/(signed word~) atan2_16::$2 )
[31] 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
[35] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0
[32] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0
to:atan2_16::@6
atan2_16::@6: scope:[atan2_16] from atan2_16::@4 atan2_16::@5
[36] (signed word) atan2_16::xi#0 ← phi( atan2_16::@4/(signed word~) atan2_16::xi#8 atan2_16::@5/(signed word~) atan2_16::$7 )
[33] (signed word) atan2_16::xi#0 ← phi( atan2_16::@4/(signed word~) atan2_16::xi#8 atan2_16::@5/(signed word~) atan2_16::$7 )
to:atan2_16::@10
atan2_16::@10: scope:[atan2_16] from atan2_16::@14 atan2_16::@6
[37] (word) atan2_16::angle#12 ← phi( atan2_16::@14/(word) atan2_16::angle#13 atan2_16::@6/(byte) 0 )
[37] (byte) atan2_16::i#2 ← phi( atan2_16::@14/(byte) atan2_16::i#1 atan2_16::@6/(byte) 0 )
[37] (signed word) atan2_16::xi#3 ← phi( atan2_16::@14/(signed word) atan2_16::xi#7 atan2_16::@6/(signed word) atan2_16::xi#0 )
[37] (signed word) atan2_16::yi#3 ← phi( atan2_16::@14/(signed word) atan2_16::yi#7 atan2_16::@6/(signed word) atan2_16::yi#0 )
[38] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11
[34] (word) atan2_16::angle#12 ← phi( atan2_16::@14/(word) atan2_16::angle#13 atan2_16::@6/(byte) 0 )
[34] (byte) atan2_16::i#2 ← phi( atan2_16::@14/(byte) atan2_16::i#1 atan2_16::@6/(byte) 0 )
[34] (signed word) atan2_16::xi#3 ← phi( atan2_16::@14/(signed word) atan2_16::xi#7 atan2_16::@6/(signed word) atan2_16::xi#0 )
[34] (signed word) atan2_16::yi#3 ← phi( atan2_16::@14/(signed word) atan2_16::yi#7 atan2_16::@6/(signed word) atan2_16::yi#0 )
[35] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11
to:atan2_16::@12
atan2_16::@12: scope:[atan2_16] from atan2_16::@10 atan2_16::@14
[39] (word) atan2_16::angle#6 ← phi( atan2_16::@10/(word) atan2_16::angle#12 atan2_16::@14/(word) atan2_16::angle#13 )
[40] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1
[41] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7
[36] (word) atan2_16::angle#6 ← phi( atan2_16::@10/(word) atan2_16::angle#12 atan2_16::@14/(word) atan2_16::angle#13 )
[37] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1
[38] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7
to:atan2_16::@16
atan2_16::@16: scope:[atan2_16] from atan2_16::@12
[42] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1
[39] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1
to:atan2_16::@7
atan2_16::@7: scope:[atan2_16] from atan2_16::@12 atan2_16::@16
[43] (word) atan2_16::angle#11 ← phi( atan2_16::@12/(word) atan2_16::angle#1 atan2_16::@16/(word) atan2_16::angle#4 )
[44] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8
[40] (word) atan2_16::angle#11 ← phi( atan2_16::@12/(word) atan2_16::angle#1 atan2_16::@16/(word) atan2_16::angle#4 )
[41] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8
to:atan2_16::@9
atan2_16::@9: scope:[atan2_16] from atan2_16::@7
[45] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11
[42] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11
to:atan2_16::@8
atan2_16::@8: scope:[atan2_16] from atan2_16::@7 atan2_16::@9
[46] (word) atan2_16::return#0 ← phi( atan2_16::@9/(word) atan2_16::angle#5 atan2_16::@7/(word) atan2_16::angle#11 )
[43] (word) atan2_16::return#0 ← phi( atan2_16::@9/(word) atan2_16::angle#5 atan2_16::@7/(word) atan2_16::angle#11 )
to:atan2_16::@return
atan2_16::@return: scope:[atan2_16] from atan2_16::@8
[47] return
[44] return
to:@return
atan2_16::@11: scope:[atan2_16] from atan2_16::@10
[48] (signed word) atan2_16::xd#0 ← (signed word) atan2_16::xi#3 >> (byte) atan2_16::i#2
[49] (signed word) atan2_16::yd#0 ← (signed word) atan2_16::yi#3 >> (byte) atan2_16::i#2
[50] if((signed word) atan2_16::yi#3>(signed byte) 0) goto atan2_16::@13
[45] (signed word) atan2_16::xd#0 ← (signed word) atan2_16::xi#3 >> (byte) atan2_16::i#2
[46] (signed word) atan2_16::yd#0 ← (signed word) atan2_16::yi#3 >> (byte) atan2_16::i#2
[47] if((signed word) atan2_16::yi#3>(signed byte) 0) goto atan2_16::@13
to:atan2_16::@15
atan2_16::@15: scope:[atan2_16] from atan2_16::@11
[51] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#0
[52] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#0
[53] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1
[54] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word*) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
[48] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#0
[49] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#0
[50] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1
[51] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word*) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24)
to:atan2_16::@14
atan2_16::@14: scope:[atan2_16] from atan2_16::@13 atan2_16::@15
[55] (signed word) atan2_16::xi#7 ← phi( atan2_16::@13/(signed word) atan2_16::xi#1 atan2_16::@15/(signed word) atan2_16::xi#2 )
[55] (word) atan2_16::angle#13 ← phi( atan2_16::@13/(word) atan2_16::angle#2 atan2_16::@15/(word) atan2_16::angle#3 )
[55] (signed word) atan2_16::yi#7 ← phi( atan2_16::@13/(signed word) atan2_16::yi#1 atan2_16::@15/(signed word) atan2_16::yi#2 )
[56] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2
[57] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0+(byte) 1) goto atan2_16::@12
[52] (signed word) atan2_16::xi#7 ← phi( atan2_16::@13/(signed word) atan2_16::xi#1 atan2_16::@15/(signed word) atan2_16::xi#2 )
[52] (word) atan2_16::angle#13 ← phi( atan2_16::@13/(word) atan2_16::angle#2 atan2_16::@15/(word) atan2_16::angle#3 )
[52] (signed word) atan2_16::yi#7 ← phi( atan2_16::@13/(signed word) atan2_16::yi#1 atan2_16::@15/(signed word) atan2_16::yi#2 )
[53] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2
[54] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0-(byte) 1+(byte) 1) goto atan2_16::@12
to:atan2_16::@10
atan2_16::@13: scope:[atan2_16] from atan2_16::@11
[58] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#0
[59] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#0
[60] (byte~) atan2_16::$22 ← (byte) atan2_16::i#2 << (byte) 1
[61] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word*) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$22)
[55] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#0
[56] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#0
[57] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1
[58] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word*) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
to:atan2_16::@14
atan2_16::@4: scope:[atan2_16] from atan2_16::@3
[62] (signed word~) atan2_16::xi#8 ← (signed word) atan2_16::x#0
[59] (signed word~) atan2_16::xi#8 ← (signed word) atan2_16::x#0
to:atan2_16::@6
atan2_16::@1: scope:[atan2_16] from atan2_16
[63] (signed word~) atan2_16::yi#11 ← (signed word) atan2_16::y#0
[60] (signed word~) atan2_16::yi#11 ← (signed word) atan2_16::y#0
to:atan2_16::@3
init_font_hex: scope:[init_font_hex] from main
[64] phi()
[61] phi()
to:init_font_hex::@1
init_font_hex::@1: scope:[init_font_hex] from init_font_hex init_font_hex::@5
[65] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 )
[65] (byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 )
[65] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET#0 init_font_hex::@5/(byte*) init_font_hex::charset#0 )
[62] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 )
[62] (byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 )
[62] (byte*) init_font_hex::charset#5 ← phi( init_font_hex/(const byte*) CHARSET#0 init_font_hex::@5/(byte*) init_font_hex::charset#0 )
to:init_font_hex::@2
init_font_hex::@2: scope:[init_font_hex] from init_font_hex::@1 init_font_hex::@4
[66] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 )
[66] (byte*) init_font_hex::proto_lo#4 ← phi( init_font_hex::@1/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@4/(byte*) init_font_hex::proto_lo#1 )
[66] (byte*) init_font_hex::charset#2 ← phi( init_font_hex::@1/(byte*) init_font_hex::charset#5 init_font_hex::@4/(byte*) init_font_hex::charset#0 )
[67] *((byte*) init_font_hex::charset#2) ← (byte) 0
[63] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 )
[63] (byte*) init_font_hex::proto_lo#4 ← phi( init_font_hex::@1/(const byte[]) FONT_HEX_PROTO#0 init_font_hex::@4/(byte*) init_font_hex::proto_lo#1 )
[63] (byte*) init_font_hex::charset#2 ← phi( init_font_hex::@1/(byte*) init_font_hex::charset#5 init_font_hex::@4/(byte*) init_font_hex::charset#0 )
[64] *((byte*) init_font_hex::charset#2) ← (byte) 0
to:init_font_hex::@3
init_font_hex::@3: scope:[init_font_hex] from init_font_hex::@2 init_font_hex::@3
[68] (byte) init_font_hex::idx#5 ← phi( init_font_hex::@2/(byte) 1 init_font_hex::@3/(byte) init_font_hex::idx#2 )
[68] (byte) init_font_hex::i#2 ← phi( init_font_hex::@2/(byte) 0 init_font_hex::@3/(byte) init_font_hex::i#1 )
[69] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4
[70] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1
[71] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1
[72] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2
[73] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5
[74] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2
[75] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3
[65] (byte) init_font_hex::idx#5 ← phi( init_font_hex::@2/(byte) 1 init_font_hex::@3/(byte) init_font_hex::idx#2 )
[65] (byte) init_font_hex::i#2 ← phi( init_font_hex::@2/(byte) 0 init_font_hex::@3/(byte) init_font_hex::i#1 )
[66] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4
[67] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1
[68] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1
[69] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2
[70] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5
[71] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2
[72] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3
to:init_font_hex::@4
init_font_hex::@4: scope:[init_font_hex] from init_font_hex::@3
[76] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0
[77] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2
[78] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0
[79] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5
[80] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8
[81] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4
[82] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2
[73] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0
[74] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2
[75] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0
[76] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5
[77] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8
[78] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4
[79] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2
to:init_font_hex::@5
init_font_hex::@5: scope:[init_font_hex] from init_font_hex::@4
[83] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5
[84] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6
[85] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1
[80] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5
[81] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6
[82] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1
to:init_font_hex::@return
init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5
[86] return
[83] return
to:@return

File diff suppressed because it is too large Load Diff

View File

@ -1,7 +1,6 @@
(label) @1
(label) @2
(label) @3
(label) @4
(label) @begin
(label) @end
(byte*) CHARSET
@ -22,13 +21,11 @@
(const byte[]) FONT_HEX_PROTO#0 FONT_HEX_PROTO = { (byte) 2, (byte) 5, (byte) 5, (byte) 5, (byte) 2, (byte) 6, (byte) 2, (byte) 2, (byte) 2, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 4, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 1, (byte) 6, (byte) 5, (byte) 5, (byte) 7, (byte) 1, (byte) 1, (byte) 7, (byte) 4, (byte) 6, (byte) 1, (byte) 6, (byte) 3, (byte) 4, (byte) 6, (byte) 5, (byte) 2, (byte) 7, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 2, (byte) 5, (byte) 2, (byte) 2, (byte) 5, (byte) 3, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 7, (byte) 5, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 2, (byte) 5, (byte) 4, (byte) 5, (byte) 2, (byte) 6, (byte) 5, (byte) 5, (byte) 5, (byte) 6, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 7, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 4 }
(byte*) SCREEN
(const byte*) SCREEN#0 SCREEN = (byte*) 10240
(byte*) SCREEN_REF
(const byte*) SCREEN_REF#0 SCREEN_REF = (byte*) 11264
(word()) atan2_16((signed word) atan2_16::x , (signed word) atan2_16::y)
(signed word~) atan2_16::$2 $2 zp ZP_WORD:7 4.0
(byte~) atan2_16::$22 reg byte a 2002.0
(signed word~) atan2_16::$2 $2 zp ZP_WORD:5 4.0
(byte~) atan2_16::$23 reg byte a 2002.0
(signed word~) atan2_16::$7 $7 zp ZP_WORD:9 4.0
(byte~) atan2_16::$24 reg byte a 2002.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
@ -47,45 +44,45 @@
(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:7 1.2000000000000002
(signed word) atan2_16::yi#1 yi zp ZP_WORD:7 667.3333333333334
(signed word~) atan2_16::yi#11 yi zp ZP_WORD:7 4.0
(signed word) atan2_16::yi#2 yi zp ZP_WORD:7 667.3333333333334
(signed word) atan2_16::yi#3 yi zp ZP_WORD:7 858.2857142857142
(signed word) atan2_16::yi#7 yi zp ZP_WORD:7 1001.0
(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
(signed word~) atan2_16::yi#11 yi zp ZP_WORD:5 4.0
(signed word) atan2_16::yi#2 yi zp ZP_WORD:5 667.3333333333334
(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_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
@ -95,49 +92,45 @@
(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()
(word~) main::$11 $11 zp ZP_WORD:12 202.0
(byte~) main::$12 reg byte a 202.0
(byte~) main::$13 reg byte a 202.0
(word~) main::$11 $11 zp ZP_WORD:10 202.0
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(byte) main::ang_w
(byte) main::ang_w#0 reg byte a 202.0
(word) main::angle_w
(word) main::angle_w#0 angle_w zp ZP_WORD:12 202.0
(word) main::angle_w#0 angle_w zp ZP_WORD:10 202.0
(byte*) main::col00
(byte*) main::screen
(byte*) main::screen#1 screen zp ZP_WORD:5 35.5
(byte*) main::screen#2 screen zp ZP_WORD:5 26.166666666666664
(byte*) main::screen#4 screen zp ZP_WORD:5 22.0
(byte*) main::screen_ref
(byte*) main::screen_ref#1 screen_ref zp ZP_WORD:3 42.599999999999994
(byte*) main::screen_ref#2 screen_ref zp ZP_WORD:3 24.153846153846153
(byte*) main::screen_ref#4 screen_ref zp ZP_WORD:3 22.0
(byte*) main::screen#1 screen zp ZP_WORD:3 42.599999999999994
(byte*) main::screen#2 screen zp ZP_WORD:3 28.545454545454547
(byte*) main::screen#4 screen zp ZP_WORD:3 22.0
(label) main::toD0181
(word~) main::toD0181_$0
(number~) main::toD0181_$1
@ -154,39 +147,37 @@
(byte*) main::toD0181_screen
(signed byte) main::x
(signed byte) main::x#1 reg byte x 151.5
(signed byte) main::x#2 reg byte x 14.428571428571429
(signed byte) main::x#2 reg byte x 16.833333333333332
(signed word) main::xw
(word) main::xw#0 xw zp ZP_WORD:23 50.5
(word) main::xw#0 xw zp ZP_WORD:21 50.5
(signed byte) main::y
(signed byte) main::y#1 y zp ZP_BYTE:2 16.5
(signed byte) main::y#4 y zp ZP_BYTE:2 1.2941176470588236
(signed byte) main::y#4 y zp ZP_BYTE:2 1.4666666666666666
(signed word) main::yw
(word) main::yw#0 yw zp ZP_WORD:25 50.5
(word) main::yw#0 yw zp ZP_WORD:23 50.5
zp ZP_BYTE:2 [ main::y#4 main::y#1 ]
reg byte x [ main::x#2 main::x#1 ]
zp ZP_WORD:3 [ main::screen_ref#2 main::screen_ref#4 main::screen_ref#1 ]
zp ZP_WORD:5 [ main::screen#2 main::screen#4 main::screen#1 ]
zp ZP_WORD:7 [ 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 main::angle_w#0 main::$11 ]
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:3 [ main::screen#2 main::screen#4 main::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: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 main::angle_w#0 main::$11 ]
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 [ main::xw#0 atan2_16::x#0 ]
zp ZP_WORD:25 [ main::yw#0 atan2_16::y#0 ]
reg byte a [ main::$12 ]
reg byte a [ main::$13 ]
zp ZP_WORD:27 [ atan2_16::xd#0 ]
zp ZP_WORD:29 [ atan2_16::yd#0 ]
zp ZP_BYTE:20 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
zp ZP_WORD:21 [ main::xw#0 atan2_16::x#0 ]
zp ZP_WORD:23 [ main::yw#0 atan2_16::y#0 ]
reg byte a [ main::ang_w#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 ]
reg byte a [ atan2_16::$22 ]
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 ]

View File

@ -170,7 +170,7 @@ atan2_8: {
sta angle
b14:
inc i
lda #CORDIC_ITERATIONS_8+1
lda #CORDIC_ITERATIONS_8-1+1
cmp i
beq b12
jmp b10

View File

@ -111,7 +111,7 @@ atan2_8::@14: scope:[atan2_8] from atan2_8::@13 atan2_8::@15
[47] (byte) atan2_8::angle#13 ← phi( atan2_8::@13/(byte) atan2_8::angle#2 atan2_8::@15/(byte) atan2_8::angle#3 )
[47] (signed byte) atan2_8::yi#7 ← phi( atan2_8::@13/(signed byte) atan2_8::yi#1 atan2_8::@15/(signed byte) atan2_8::yi#2 )
[48] (byte) atan2_8::i#1 ← ++ (byte) atan2_8::i#2
[49] if((byte) atan2_8::i#1==(const byte) CORDIC_ITERATIONS_8#0+(byte) 1) goto atan2_8::@12
[49] if((byte) atan2_8::i#1==(const byte) CORDIC_ITERATIONS_8#0-(byte) 1+(byte) 1) goto atan2_8::@12
to:atan2_8::@10
atan2_8::@13: scope:[atan2_8] from atan2_8::@11
[50] (signed byte) atan2_8::xi#1 ← (signed byte) atan2_8::xi#3 + (signed byte) atan2_8::yd#0

View File

@ -208,6 +208,7 @@ atan2_8::@6: scope:[atan2_8] from atan2_8::@4 atan2_8::@5
(signed byte~) atan2_8::$9 ← phi( atan2_8::@4/(signed byte~) atan2_8::$8 atan2_8::@5/(signed byte~) atan2_8::$7 )
(signed byte) atan2_8::xi#0 ← (signed byte~) atan2_8::$9
(byte) atan2_8::angle#0 ← (number) 0
(number~) atan2_8::$17 ← (byte) CORDIC_ITERATIONS_8#0 - (number) 1
(byte) atan2_8::i#0 ← (byte) 0
to:atan2_8::@15
atan2_8::@15: scope:[atan2_8] from atan2_8::@19 atan2_8::@6
@ -217,9 +218,9 @@ atan2_8::@15: scope:[atan2_8] from atan2_8::@19 atan2_8::@6
(byte) atan2_8::i#6 ← phi( atan2_8::@19/(byte) atan2_8::i#1 atan2_8::@6/(byte) atan2_8::i#0 )
(signed byte) atan2_8::xi#6 ← phi( atan2_8::@19/(signed byte) atan2_8::xi#7 atan2_8::@6/(signed byte) atan2_8::xi#0 )
(signed byte) atan2_8::yi#3 ← phi( atan2_8::@19/(signed byte) atan2_8::yi#7 atan2_8::@6/(signed byte) atan2_8::yi#8 )
(bool~) atan2_8::$17 ← (signed byte) atan2_8::yi#3 == (number) 0
(bool~) atan2_8::$18 ← ! (bool~) atan2_8::$17
if((bool~) atan2_8::$18) goto atan2_8::@16
(bool~) atan2_8::$18 ← (signed byte) atan2_8::yi#3 == (number) 0
(bool~) atan2_8::$19 ← ! (bool~) atan2_8::$18
if((bool~) atan2_8::$19) goto atan2_8::@16
to:atan2_8::@17
atan2_8::@16: scope:[atan2_8] from atan2_8::@15
(signed byte) atan2_8::y#14 ← phi( atan2_8::@15/(signed byte) atan2_8::y#7 )
@ -228,12 +229,12 @@ atan2_8::@16: scope:[atan2_8] from atan2_8::@15
(signed byte) atan2_8::yi#4 ← phi( atan2_8::@15/(signed byte) atan2_8::yi#3 )
(byte) atan2_8::i#2 ← phi( atan2_8::@15/(byte) atan2_8::i#6 )
(signed byte) atan2_8::xi#3 ← phi( atan2_8::@15/(signed byte) atan2_8::xi#6 )
(signed byte~) atan2_8::$19 ← (signed byte) atan2_8::xi#3 >> (byte) atan2_8::i#2
(signed byte) atan2_8::xd#0 ← (signed byte~) atan2_8::$19
(signed byte~) atan2_8::$20 ← (signed byte) atan2_8::yi#4 >> (byte) atan2_8::i#2
(signed byte) atan2_8::yd#0 ← (signed byte~) atan2_8::$20
(bool~) atan2_8::$21 ← (signed byte) atan2_8::yi#4 > (number) 0
if((bool~) atan2_8::$21) goto atan2_8::@18
(signed byte~) atan2_8::$20 ← (signed byte) atan2_8::xi#3 >> (byte) atan2_8::i#2
(signed byte) atan2_8::xd#0 ← (signed byte~) atan2_8::$20
(signed byte~) atan2_8::$21 ← (signed byte) atan2_8::yi#4 >> (byte) atan2_8::i#2
(signed byte) atan2_8::yd#0 ← (signed byte~) atan2_8::$21
(bool~) atan2_8::$22 ← (signed byte) atan2_8::yi#4 > (number) 0
if((bool~) atan2_8::$22) goto atan2_8::@18
to:atan2_8::@22
atan2_8::@17: scope:[atan2_8] from atan2_8::@15 atan2_8::@19
(signed byte) atan2_8::y#5 ← phi( atan2_8::@15/(signed byte) atan2_8::y#7 atan2_8::@19/(signed byte) atan2_8::y#8 )
@ -278,9 +279,9 @@ atan2_8::@19: scope:[atan2_8] from atan2_8::@18 atan2_8::@22
(byte) atan2_8::angle#13 ← phi( atan2_8::@18/(byte) atan2_8::angle#2 atan2_8::@22/(byte) atan2_8::angle#3 )
(signed byte) atan2_8::yi#7 ← phi( atan2_8::@18/(signed byte) atan2_8::yi#1 atan2_8::@22/(signed byte) atan2_8::yi#2 )
(byte) atan2_8::i#5 ← phi( atan2_8::@18/(byte) atan2_8::i#3 atan2_8::@22/(byte) atan2_8::i#4 )
(byte) atan2_8::i#1 ← (byte) atan2_8::i#5 + rangenext(0,CORDIC_ITERATIONS_8#0)
(bool~) atan2_8::$22 ← (byte) atan2_8::i#1 != rangelast(0,CORDIC_ITERATIONS_8#0)
if((bool~) atan2_8::$22) goto atan2_8::@15
(byte) atan2_8::i#1 ← (byte) atan2_8::i#5 + rangenext(0,atan2_8::$17)
(bool~) atan2_8::$23 ← (byte) atan2_8::i#1 != rangelast(0,atan2_8::$17)
if((bool~) atan2_8::$23) goto atan2_8::@15
to:atan2_8::@17
atan2_8::@7: scope:[atan2_8] from atan2_8::@17 atan2_8::@25
(byte) atan2_8::angle#15 ← phi( atan2_8::@17/(byte) atan2_8::angle#1 atan2_8::@25/(byte) atan2_8::angle#4 )
@ -440,13 +441,14 @@ SYMBOL TABLE SSA
(bool~) atan2_8::$14
(bool~) atan2_8::$15
(byte~) atan2_8::$16
(bool~) atan2_8::$17
(number~) atan2_8::$17
(bool~) atan2_8::$18
(signed byte~) atan2_8::$19
(bool~) atan2_8::$19
(signed byte~) atan2_8::$2
(signed byte~) atan2_8::$20
(bool~) atan2_8::$21
(signed byte~) atan2_8::$21
(bool~) atan2_8::$22
(bool~) atan2_8::$23
(signed byte~) atan2_8::$3
(signed byte~) atan2_8::$4
(bool~) atan2_8::$5
@ -713,8 +715,10 @@ Adding number conversion cast (unumber) 8 in (byte) CORDIC_ITERATIONS_8#0 ← (n
Adding number conversion cast (snumber) 0 in (bool~) atan2_8::$0 ← (signed byte) atan2_8::y#1 > (number) 0
Adding number conversion cast (snumber) 0 in (bool~) atan2_8::$5 ← (signed byte) atan2_8::x#1 > (number) 0
Adding number conversion cast (unumber) 0 in (byte) atan2_8::angle#0 ← (number) 0
Adding number conversion cast (snumber) 0 in (bool~) atan2_8::$17 ← (signed byte) atan2_8::yi#3 == (number) 0
Adding number conversion cast (snumber) 0 in (bool~) atan2_8::$21 ← (signed byte) atan2_8::yi#4 > (number) 0
Adding number conversion cast (unumber) 1 in (number~) atan2_8::$17 ← (byte) CORDIC_ITERATIONS_8#0 - (number) 1
Adding number conversion cast (unumber) atan2_8::$17 in (number~) atan2_8::$17 ← (byte) CORDIC_ITERATIONS_8#0 - (unumber)(number) 1
Adding number conversion cast (snumber) 0 in (bool~) atan2_8::$18 ← (signed byte) atan2_8::yi#3 == (number) 0
Adding number conversion cast (snumber) 0 in (bool~) atan2_8::$22 ← (signed byte) atan2_8::yi#4 > (number) 0
Adding number conversion cast (unumber) 2 in (number~) atan2_8::$10 ← (byte) atan2_8::angle#6 / (number) 2
Adding number conversion cast (unumber) atan2_8::$10 in (number~) atan2_8::$10 ← (byte) atan2_8::angle#6 / (unumber)(number) 2
Adding number conversion cast (snumber) 0 in (bool~) atan2_8::$11 ← (signed byte) atan2_8::x#4 < (number) 0
@ -850,6 +854,7 @@ Simplifying constant pointer cast (byte*) 4352
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 2
@ -878,6 +883,7 @@ Finalized unsigned number type (byte) 8
Finalized signed number type (signed byte) 0
Finalized signed number type (signed byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized signed number type (signed byte) 0
Finalized signed number type (signed byte) 0
Finalized unsigned number type (byte) 2
@ -890,6 +896,7 @@ Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) $f
Finalized unsigned number type (byte) $13
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) atan2_8::$17 ← (byte) CORDIC_ITERATIONS_8#0 - (byte) 1
Inferred type updated to byte in (unumber~) atan2_8::$10 ← (byte) atan2_8::angle#6 / (byte) 2
Inferred type updated to byte in (unumber~) atan2_8::$13 ← (byte) $80 - (byte) atan2_8::angle#9
Inferred type updated to word in (unumber~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (word) $3fff
@ -898,9 +905,9 @@ Inferred type updated to byte in (unumber~) main::toD0181_$3#0 ← > (word~) mai
Inferred type updated to byte in (unumber~) main::toD0181_$6#0 ← (byte~) main::toD0181_$5#0 / (byte) 4
Inferred type updated to byte in (unumber~) main::toD0181_$7#0 ← (byte~) main::toD0181_$6#0 & (byte) $f
Inferred type updated to byte in (unumber~) main::toD0181_$8#0 ← (byte~) main::toD0181_$3#0 | (byte~) main::toD0181_$7#0
Inversing boolean not [68] (bool~) atan2_8::$18 ← (signed byte) atan2_8::yi#3 != (signed byte) 0 from [67] (bool~) atan2_8::$17 ← (signed byte) atan2_8::yi#3 == (signed byte) 0
Inversing boolean not [81] (bool~) atan2_8::$12 ← (signed byte) atan2_8::x#4 >= (signed byte) 0 from [80] (bool~) atan2_8::$11 ← (signed byte) atan2_8::x#4 < (signed byte) 0
Inversing boolean not [97] (bool~) atan2_8::$15 ← (signed byte) atan2_8::y#4 >= (signed byte) 0 from [96] (bool~) atan2_8::$14 ← (signed byte) atan2_8::y#4 < (signed byte) 0
Inversing boolean not [69] (bool~) atan2_8::$19 ← (signed byte) atan2_8::yi#3 != (signed byte) 0 from [68] (bool~) atan2_8::$18 ← (signed byte) atan2_8::yi#3 == (signed byte) 0
Inversing boolean not [82] (bool~) atan2_8::$12 ← (signed byte) atan2_8::x#4 >= (signed byte) 0 from [81] (bool~) atan2_8::$11 ← (signed byte) atan2_8::x#4 < (signed byte) 0
Inversing boolean not [98] (bool~) atan2_8::$15 ← (signed byte) atan2_8::y#4 >= (signed byte) 0 from [97] (bool~) atan2_8::$14 ← (signed byte) atan2_8::y#4 < (signed byte) 0
Successful SSA optimization Pass2UnaryNotSimplification
Alias (byte*) init_font_hex::charset#3 = (byte*) init_font_hex::charset#4
Alias (byte) init_font_hex::idx#2 = (byte) init_font_hex::idx#6
@ -923,8 +930,8 @@ Alias (signed byte) atan2_8::yi#3 = (signed byte) atan2_8::yi#4 (signed byte) at
Alias (byte) atan2_8::angle#12 = (byte) atan2_8::angle#14 (byte) atan2_8::angle#7 (byte) atan2_8::angle#8
Alias (signed byte) atan2_8::x#11 = (signed byte) atan2_8::x#13 (signed byte) atan2_8::x#7 (signed byte) atan2_8::x#12
Alias (signed byte) atan2_8::y#10 = (signed byte) atan2_8::y#14 (signed byte) atan2_8::y#7 (signed byte) atan2_8::y#11
Alias (signed byte) atan2_8::xd#0 = (signed byte~) atan2_8::$19 (signed byte) atan2_8::xd#1 (signed byte) atan2_8::xd#2
Alias (signed byte) atan2_8::yd#0 = (signed byte~) atan2_8::$20 (signed byte) atan2_8::yd#1 (signed byte) atan2_8::yd#2
Alias (signed byte) atan2_8::xd#0 = (signed byte~) atan2_8::$20 (signed byte) atan2_8::xd#1 (signed byte) atan2_8::xd#2
Alias (signed byte) atan2_8::yd#0 = (signed byte~) atan2_8::$21 (signed byte) atan2_8::yd#1 (signed byte) atan2_8::yd#2
Alias (byte) atan2_8::angle#1 = (byte~) atan2_8::$10 (byte) atan2_8::angle#9
Alias (signed byte) atan2_8::y#5 = (signed byte) atan2_8::y#6
Alias (byte) atan2_8::angle#4 = (byte~) atan2_8::$13
@ -982,15 +989,15 @@ Simple Condition (bool~) init_font_hex::$4 [29] if((byte) init_font_hex::c1#1!=r
Simple Condition (bool~) init_font_hex::$5 [34] if((byte) init_font_hex::c#1!=rangelast(0,$f)) goto init_font_hex::@1
Simple Condition (bool~) atan2_8::$0 [47] if((signed byte) atan2_8::y#0>(signed byte) 0) goto atan2_8::@1
Simple Condition (bool~) atan2_8::$5 [56] if((signed byte) atan2_8::x#0>(signed byte) 0) goto atan2_8::@4
Simple Condition (bool~) atan2_8::$18 [69] if((signed byte) atan2_8::yi#3!=(signed byte) 0) goto atan2_8::@16
Simple Condition (bool~) atan2_8::$21 [76] if((signed byte) atan2_8::yi#3>(signed byte) 0) goto atan2_8::@18
Simple Condition (bool~) atan2_8::$12 [82] if((signed byte) atan2_8::x#0>=(signed byte) 0) goto atan2_8::@7
Simple Condition (bool~) atan2_8::$22 [94] if((byte) atan2_8::i#1!=rangelast(0,CORDIC_ITERATIONS_8#0)) goto atan2_8::@15
Simple Condition (bool~) atan2_8::$15 [98] if((signed byte) atan2_8::y#0>=(signed byte) 0) goto atan2_8::@8
Simple Condition (bool~) main::$5 [148] if((signed byte) main::x#1!=rangelast(-$13,$14)) goto main::@2
Simple Condition (bool~) main::$6 [152] if((signed byte) main::y#1!=rangelast(-$c,$c)) goto main::@1
Simple Condition (bool~) atan2_8::$19 [70] if((signed byte) atan2_8::yi#3!=(signed byte) 0) goto atan2_8::@16
Simple Condition (bool~) atan2_8::$22 [77] if((signed byte) atan2_8::yi#3>(signed byte) 0) goto atan2_8::@18
Simple Condition (bool~) atan2_8::$12 [83] if((signed byte) atan2_8::x#0>=(signed byte) 0) goto atan2_8::@7
Simple Condition (bool~) atan2_8::$23 [95] if((byte) atan2_8::i#1!=rangelast(0,atan2_8::$17)) goto atan2_8::@15
Simple Condition (bool~) atan2_8::$15 [99] if((signed byte) atan2_8::y#0>=(signed byte) 0) goto atan2_8::@8
Simple Condition (bool~) main::$5 [149] if((signed byte) main::x#1!=rangelast(-$13,$14)) goto main::@2
Simple Condition (bool~) main::$6 [153] if((signed byte) main::y#1!=rangelast(-$c,$c)) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Negating conditional jump and destination [94] if((byte) atan2_8::i#1==rangelast(0,CORDIC_ITERATIONS_8#0)) goto atan2_8::@17
Negating conditional jump and destination [95] if((byte) atan2_8::i#1==rangelast(0,atan2_8::$17)) goto atan2_8::@17
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [36] (byte[]) FONT_HEX_PROTO#0 ← { (byte) 2, (byte) 5, (byte) 5, (byte) 5, (byte) 2, (byte) 6, (byte) 2, (byte) 2, (byte) 2, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 4, (byte) 7, (byte) 6, (byte) 1, (byte) 2, (byte) 1, (byte) 6, (byte) 5, (byte) 5, (byte) 7, (byte) 1, (byte) 1, (byte) 7, (byte) 4, (byte) 6, (byte) 1, (byte) 6, (byte) 3, (byte) 4, (byte) 6, (byte) 5, (byte) 2, (byte) 7, (byte) 1, (byte) 1, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 2, (byte) 5, (byte) 2, (byte) 2, (byte) 5, (byte) 3, (byte) 1, (byte) 1, (byte) 2, (byte) 5, (byte) 7, (byte) 5, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 5, (byte) 6, (byte) 2, (byte) 5, (byte) 4, (byte) 5, (byte) 2, (byte) 6, (byte) 5, (byte) 5, (byte) 5, (byte) 6, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 7, (byte) 7, (byte) 4, (byte) 6, (byte) 4, (byte) 4 }
Successful SSA optimization Pass2ConstantRValueConsolidation
@ -1019,10 +1026,10 @@ Constant (const byte*) main::toD0181_screen#0 = SCREEN#0
Constant (const byte*) main::toD0181_gfx#0 = CHARSET#0
Constant (const byte*) main::screen#0 = SCREEN#0
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (word)main::toD0181_screen#0 in [117] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0
Constant value identified (word)main::toD0181_gfx#0 in [121] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0
Constant value identified (word)main::toD0181_screen#0 in [118] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0
Constant value identified (word)main::toD0181_gfx#0 in [122] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0
Successful SSA optimization Pass2ConstantValues
if() condition always true - replacing block destination [157] if(true) goto main::@6
if() condition always true - replacing block destination [158] if(true) goto main::@6
Successful SSA optimization Pass2ConstantIfs
Resolved ranged next value [17] init_font_hex::i#1 ← ++ init_font_hex::i#2 to ++
Resolved ranged comparison value [19] if(init_font_hex::i#1!=rangelast(0,4)) goto init_font_hex::@3 to (number) 5
@ -1030,42 +1037,35 @@ Resolved ranged next value [27] init_font_hex::c1#1 ← ++ init_font_hex::c1#4 t
Resolved ranged comparison value [29] if(init_font_hex::c1#1!=rangelast(0,$f)) goto init_font_hex::@2 to (number) $10
Resolved ranged next value [32] init_font_hex::c#1 ← ++ init_font_hex::c#5 to ++
Resolved ranged comparison value [34] if(init_font_hex::c#1!=rangelast(0,$f)) goto init_font_hex::@1 to (number) $10
Resolved ranged next value [92] atan2_8::i#1 ← ++ atan2_8::i#2 to ++
Resolved ranged comparison value [94] if(atan2_8::i#1==rangelast(0,CORDIC_ITERATIONS_8#0)) goto atan2_8::@17 to (const byte) CORDIC_ITERATIONS_8#0+(number) 1
Resolved ranged next value [146] main::x#1 ← ++ main::x#2 to ++
Resolved ranged comparison value [148] if(main::x#1!=rangelast(-$13,$14)) goto main::@2 to (number) $15
Resolved ranged next value [150] main::y#1 ← ++ main::y#4 to ++
Resolved ranged comparison value [152] if(main::y#1!=rangelast(-$c,$c)) goto main::@1 to (number) $d
Converting *(pointer+n) to pointer[n] [159] *((byte*) main::col00#0) ← ++ *((byte*) main::col00#0) -- *(main::$2 + $13)
Converting *(pointer+n) to pointer[n] [159] *((byte*) main::col00#0) ← ++ *((byte*~) main::$2 + (byte) $13) -- *(main::$2 + $13)
Resolved ranged next value [147] main::x#1 ← ++ main::x#2 to ++
Resolved ranged comparison value [149] if(main::x#1!=rangelast(-$13,$14)) goto main::@2 to (number) $15
Resolved ranged next value [151] main::y#1 ← ++ main::y#4 to ++
Resolved ranged comparison value [153] if(main::y#1!=rangelast(-$c,$c)) goto main::@1 to (number) $d
Converting *(pointer+n) to pointer[n] [160] *((byte*) main::col00#0) ← ++ *((byte*) main::col00#0) -- *(main::$2 + $13)
Converting *(pointer+n) to pointer[n] [160] *((byte*) main::col00#0) ← ++ *((byte*~) main::$2 + (byte) $13) -- *(main::$2 + $13)
Successful SSA optimization Pass2InlineDerefIdx
Simplifying expression containing zero init_font_hex::charset#2 in [8] *((byte*) init_font_hex::charset#2 + (const byte) init_font_hex::idx#0) ← (byte) 0
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (byte) init_font_hex::idx#4 and assignment [15] (byte) init_font_hex::idx#4 ← ++ (byte) init_font_hex::idx#3
Eliminating unused variable (byte*) main::col00#0 and assignment [80] (byte*) main::col00#0 ← (byte*~) main::$2 + (byte) $13
Eliminating unused variable (byte*) main::col00#0 and assignment [81] (byte*) main::col00#0 ← (byte*~) main::$2 + (byte) $13
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Adding number conversion cast (unumber) 5 in if((byte) init_font_hex::i#1!=(number) 5) goto init_font_hex::@3
Adding number conversion cast (unumber) $10 in if((byte) init_font_hex::c1#1!=(number) $10) goto init_font_hex::@2
Adding number conversion cast (unumber) $10 in if((byte) init_font_hex::c#1!=(number) $10) goto init_font_hex::@1
Adding number conversion cast (unumber) CORDIC_ITERATIONS_8#0+1 in if((byte) atan2_8::i#1==(const byte) CORDIC_ITERATIONS_8#0+(number) 1) goto atan2_8::@17
Adding number conversion cast (unumber) 1 in if((byte) atan2_8::i#1==(unumber)(const byte) CORDIC_ITERATIONS_8#0+(number) 1) goto atan2_8::@17
Adding number conversion cast (snumber) $15 in if((signed byte) main::x#1!=(number) $15) goto main::@2
Adding number conversion cast (snumber) $d in if((signed byte) main::y#1!=(number) $d) goto main::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 5
Simplifying constant integer cast $10
Simplifying constant integer cast $10
Simplifying constant integer cast (const byte) CORDIC_ITERATIONS_8#0+(unumber)(number) 1
Simplifying constant integer cast 1
Simplifying constant integer cast $15
Simplifying constant integer cast $d
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 5
Finalized unsigned number type (byte) $10
Finalized unsigned number type (byte) $10
Finalized unsigned number type (byte) 1
Finalized signed number type (signed byte) $15
Finalized signed number type (signed byte) $d
Successful SSA optimization PassNFinalizeNumberTypeConversions
@ -1076,13 +1076,25 @@ Identical Phi Values (byte*) init_font_hex::proto_hi#4 (byte*) init_font_hex::pr
Identical Phi Values (byte) init_font_hex::c#5 (byte) init_font_hex::c#6
Successful SSA optimization Pass2IdenticalPhiElimination
Constant right-side identified [3] (byte) init_font_hex::idx#1 ← ++ (const byte) init_font_hex::idx#0
Constant right-side identified [78] (byte*~) main::$2 ← (const byte*) COLS#0 + (word)(number) $c*(number) $28
Constant right-side identified [31] (byte~) atan2_8::$17 ← (const byte) CORDIC_ITERATIONS_8#0 - (byte) 1
Constant right-side identified [79] (byte*~) main::$2 ← (const byte*) COLS#0 + (word)(number) $c*(number) $28
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) init_font_hex::idx#1 = ++init_font_hex::idx#0
Constant (const byte) atan2_8::$17 = CORDIC_ITERATIONS_8#0-1
Constant (const word) main::toD0181_$0#0 = (word)main::toD0181_screen#0
Constant (const word) main::toD0181_$4#0 = (word)main::toD0181_gfx#0
Constant (const byte*) main::$2 = COLS#0+(word)$c*$28
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [47] atan2_8::i#1 ← ++ atan2_8::i#2 to ++
Resolved ranged comparison value [48] if(atan2_8::i#1==rangelast(0,atan2_8::$17)) goto atan2_8::@17 to (const byte) atan2_8::$17+(number) 1
Adding number conversion cast (unumber) atan2_8::$17+1 in if((byte) atan2_8::i#1==(const byte) atan2_8::$17+(number) 1) goto atan2_8::@17
Adding number conversion cast (unumber) 1 in if((byte) atan2_8::i#1==(unumber)(const byte) atan2_8::$17+(number) 1) goto atan2_8::@17
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast (const byte) atan2_8::$17+(unumber)(number) 1
Simplifying constant integer cast 1
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 1
Successful SSA optimization PassNFinalizeNumberTypeConversions
Constant right-side identified [54] (word~) main::toD0181_$1#0 ← (const word) main::toD0181_$0#0 & (word) $3fff
Constant right-side identified [57] (byte~) main::toD0181_$5#0 ← > (const word) main::toD0181_$4#0
Successful SSA optimization Pass2ConstantRValueConsolidation
@ -1124,13 +1136,16 @@ Constant inlined main::screen#0 = (const byte*) SCREEN#0
Constant inlined main::toD0181_screen#0 = (const byte*) SCREEN#0
Constant inlined main::toD0181_gfx#0 = (const byte*) CHARSET#0
Constant inlined init_font_hex::proto_hi#0 = (const byte[]) FONT_HEX_PROTO#0
Constant inlined init_font_hex::charset#1 = (const byte*) CHARSET#0
Constant inlined atan2_8::i#0 = (byte) 0
Constant inlined init_font_hex::c1#0 = (byte) 0
Constant inlined atan2_8::angle#0 = (byte) 0
Constant inlined main::toD0181_$0#0 = (word)(const byte*) SCREEN#0
Constant inlined main::x#0 = (signed byte) -$13
Constant inlined main::toD0181_$1#0 = (word)(const byte*) SCREEN#0&(word) $3fff
Constant inlined main::y#0 = (signed byte) -$c
Constant inlined init_font_hex::i#0 = (byte) 0
Constant inlined init_font_hex::charset#1 = (const byte*) CHARSET#0
Constant inlined atan2_8::$17 = (const byte) CORDIC_ITERATIONS_8#0-(byte) 1
Constant inlined main::toD0181_$6#0 = >(word)(const byte*) CHARSET#0/(byte) 4
Constant inlined main::toD0181_$7#0 = >(word)(const byte*) CHARSET#0/(byte) 4&(byte) $f
Constant inlined init_font_hex::idx#1 = ++(byte) 0
@ -1141,9 +1156,7 @@ Constant inlined main::toD0181_$3#0 = >(word)(const byte*) SCREEN#0&(word) $3fff
Constant inlined main::toD0181_$4#0 = (word)(const byte*) CHARSET#0
Constant inlined main::toD0181_$5#0 = >(word)(const byte*) CHARSET#0
Constant inlined init_font_hex::proto_lo#0 = (const byte[]) FONT_HEX_PROTO#0
Constant inlined atan2_8::i#0 = (byte) 0
Constant inlined init_font_hex::c#0 = (byte) 0
Constant inlined init_font_hex::c1#0 = (byte) 0
Successful SSA optimization Pass2ConstantInlining
Consolidated array index constant in *(COLS#0+(word)$c*$28+$13)
Consolidated array index constant in *(COLS#0+(word)$c*$28+$13)
@ -1367,7 +1380,7 @@ atan2_8::@14: scope:[atan2_8] from atan2_8::@13 atan2_8::@15
[47] (byte) atan2_8::angle#13 ← phi( atan2_8::@13/(byte) atan2_8::angle#2 atan2_8::@15/(byte) atan2_8::angle#3 )
[47] (signed byte) atan2_8::yi#7 ← phi( atan2_8::@13/(signed byte) atan2_8::yi#1 atan2_8::@15/(signed byte) atan2_8::yi#2 )
[48] (byte) atan2_8::i#1 ← ++ (byte) atan2_8::i#2
[49] if((byte) atan2_8::i#1==(const byte) CORDIC_ITERATIONS_8#0+(byte) 1) goto atan2_8::@12
[49] if((byte) atan2_8::i#1==(const byte) CORDIC_ITERATIONS_8#0-(byte) 1+(byte) 1) goto atan2_8::@12
to:atan2_8::@10
atan2_8::@13: scope:[atan2_8] from atan2_8::@11
[50] (signed byte) atan2_8::xi#1 ← (signed byte) atan2_8::xi#3 + (signed byte) atan2_8::yd#0
@ -1961,8 +1974,8 @@ atan2_8: {
b14:
//SEG101 [48] (byte) atan2_8::i#1 ← ++ (byte) atan2_8::i#2 -- vbuz1=_inc_vbuz1
inc i
//SEG102 [49] if((byte) atan2_8::i#1==(const byte) CORDIC_ITERATIONS_8#0+(byte) 1) goto atan2_8::@12 -- vbuz1_eq_vbuc1_then_la1
lda #CORDIC_ITERATIONS_8+1
//SEG102 [49] if((byte) atan2_8::i#1==(const byte) CORDIC_ITERATIONS_8#0-(byte) 1+(byte) 1) goto atan2_8::@12 -- vbuz1_eq_vbuc1_then_la1
lda #CORDIC_ITERATIONS_8-1+1
cmp i
beq b12_from_b14
//SEG103 [30] phi from atan2_8::@14 to atan2_8::@10 [phi:atan2_8::@14->atan2_8::@10]
@ -2688,8 +2701,8 @@ atan2_8: {
b14:
//SEG101 [48] (byte) atan2_8::i#1 ← ++ (byte) atan2_8::i#2 -- vbuz1=_inc_vbuz1
inc i
//SEG102 [49] if((byte) atan2_8::i#1==(const byte) CORDIC_ITERATIONS_8#0+(byte) 1) goto atan2_8::@12 -- vbuz1_eq_vbuc1_then_la1
lda #CORDIC_ITERATIONS_8+1
//SEG102 [49] if((byte) atan2_8::i#1==(const byte) CORDIC_ITERATIONS_8#0-(byte) 1+(byte) 1) goto atan2_8::@12 -- vbuz1_eq_vbuc1_then_la1
lda #CORDIC_ITERATIONS_8-1+1
cmp i
beq b12_from_b14
//SEG103 [30] phi from atan2_8::@14 to atan2_8::@10 [phi:atan2_8::@14->atan2_8::@10]
@ -3461,8 +3474,8 @@ atan2_8: {
b14:
//SEG101 [48] (byte) atan2_8::i#1 ← ++ (byte) atan2_8::i#2 -- vbuz1=_inc_vbuz1
inc i
//SEG102 [49] if((byte) atan2_8::i#1==(const byte) CORDIC_ITERATIONS_8#0+(byte) 1) goto atan2_8::@12 -- vbuz1_eq_vbuc1_then_la1
lda #CORDIC_ITERATIONS_8+1
//SEG102 [49] if((byte) atan2_8::i#1==(const byte) CORDIC_ITERATIONS_8#0-(byte) 1+(byte) 1) goto atan2_8::@12 -- vbuz1_eq_vbuc1_then_la1
lda #CORDIC_ITERATIONS_8-1+1
cmp i
beq b12
//SEG103 [30] phi from atan2_8::@14 to atan2_8::@10 [phi:atan2_8::@14->atan2_8::@10]