1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-08-09 20:25:17 +00:00
Files
kickc/src/test/ref/screen-center-angle.log
2019-07-04 19:56:11 +02:00

6424 lines
380 KiB
Plaintext

Resolved forward reference FONT_HEX_PROTO to (byte[]) FONT_HEX_PROTO
Resolved forward reference FONT_HEX_PROTO to (byte[]) FONT_HEX_PROTO
Fixing pointer addition (word*~) bsearch16u::$7 ← (word*) bsearch16u::items + (byte~) bsearch16u::$6
Fixing pointer addition (word*~) bsearch16u::$15 ← (word*) bsearch16u::pivot + (number) 1
Fixing pointer addition (word*~) bsearch16u::$1 ← (word*) bsearch16u::items - (number) 1
Fixing pointer array-indexing *((word[CORDIC_ITERATIONS_16]) CORDIC_ATAN2_ANGLES_16 + (byte) atan2_16::i)
Fixing pointer array-indexing *((word[CORDIC_ITERATIONS_16]) CORDIC_ATAN2_ANGLES_16 + (byte) atan2_16::i)
Warning! Adding boolean cast to non-boolean sub-expression (byte) atan2_16::shift
Identified constant variable (byte*) HEAP_START
Identified constant variable (byte*) main::BASE_SCREEN
Identified constant variable (byte*) main::BASE_CHARSET
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Inlined call (byte~) main::$1 ← call toD018 (byte*) SCREEN (byte*) CHARSET
Inlined call (byte~) main::$7 ← call toD018 (byte*) main::BASE_SCREEN (byte*) main::BASE_CHARSET
Culled Empty Block (label) @1
Culled Empty Block (label) @2
Culled Empty Block (label) @4
Culled Empty Block (label) @5
Culled Empty Block (label) @6
Culled Empty Block (label) @7
Culled Empty Block (label) init_font_hex::@6
Culled Empty Block (label) atan2_16::@9
Culled Empty Block (label) atan2_16::@10
Culled Empty Block (label) atan2_16::@11
Culled Empty Block (label) atan2_16::@12
Culled Empty Block (label) atan2_16::@28
Culled Empty Block (label) atan2_16::@29
Culled Empty Block (label) atan2_16::@21
Culled Empty Block (label) atan2_16::@22
Culled Empty Block (label) atan2_16::@23
Culled Empty Block (label) atan2_16::@31
Culled Empty Block (label) atan2_16::@32
Culled Empty Block (label) atan2_16::@14
Culled Empty Block (label) @9
Culled Empty Block (label) clock::@1
Culled Empty Block (label) @11
Culled Empty Block (label) @12
Culled Empty Block (label) @13
Culled Empty Block (label) @14
Culled Empty Block (label) @15
Culled Empty Block (label) @16
Culled Empty Block (label) @17
Culled Empty Block (label) @18
Culled Empty Block (label) @19
Culled Empty Block (label) @20
Culled Empty Block (label) @21
Culled Empty Block (label) @22
Culled Empty Block (label) @23
Culled Empty Block (label) @24
Culled Empty Block (label) @25
Culled Empty Block (label) @27
Culled Empty Block (label) @28
Culled Empty Block (label) @29
Culled Empty Block (label) @30
Culled Empty Block (label) @31
Culled Empty Block (label) @32
Culled Empty Block (label) main::toD0181_@1
Culled Empty Block (label) main::toD0182_@1
Culled Empty Block (label) @34
Culled Empty Block (label) init_angle_screen::@4
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
to:@3
@3: scope:[] from @begin
(byte*) D018#0 ← ((byte*)) (number) $d018
(dword*) CIA2_TIMER_AB#0 ← ((dword*)) (number) $dd04
(byte*) CIA2_TIMER_A_CONTROL#0 ← ((byte*)) (number) $dd0e
(byte*) CIA2_TIMER_B_CONTROL#0 ← ((byte*)) (number) $dd0f
(byte) CIA_TIMER_CONTROL_STOP#0 ← (number) 0
(byte) CIA_TIMER_CONTROL_START#0 ← (number) 1
(byte) CIA_TIMER_CONTROL_CONTINUOUS#0 ← (number) 0
(byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES#0 ← (number) 0
(byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 ← (number) $40
to:@8
init_font_hex: scope:[init_font_hex] from main
(byte*) init_font_hex::charset#6 ← phi( main/(byte*) init_font_hex::charset#1 )
(byte*) init_font_hex::proto_hi#0 ← (byte[]) FONT_HEX_PROTO#0
(byte) init_font_hex::c#0 ← (byte) 0
to:init_font_hex::@1
init_font_hex::@1: scope:[init_font_hex] from init_font_hex init_font_hex::@5
(byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) init_font_hex::c#0 init_font_hex::@5/(byte) init_font_hex::c#1 )
(byte*) init_font_hex::proto_hi#6 ← phi( init_font_hex/(byte*) init_font_hex::proto_hi#0 init_font_hex::@5/(byte*) init_font_hex::proto_hi#1 )
(byte*) init_font_hex::charset#5 ← phi( init_font_hex/(byte*) init_font_hex::charset#6 init_font_hex::@5/(byte*) init_font_hex::charset#7 )
(byte*) init_font_hex::proto_lo#0 ← (byte[]) FONT_HEX_PROTO#0
(byte) init_font_hex::c1#0 ← (byte) 0
to:init_font_hex::@2
init_font_hex::@2: scope:[init_font_hex] from init_font_hex::@1 init_font_hex::@4
(byte) init_font_hex::c#5 ← phi( init_font_hex::@1/(byte) init_font_hex::c#6 init_font_hex::@4/(byte) init_font_hex::c#3 )
(byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) init_font_hex::c1#0 init_font_hex::@4/(byte) init_font_hex::c1#1 )
(byte*) init_font_hex::proto_lo#4 ← phi( init_font_hex::@1/(byte*) init_font_hex::proto_lo#0 init_font_hex::@4/(byte*) init_font_hex::proto_lo#1 )
(byte*) init_font_hex::proto_hi#4 ← phi( init_font_hex::@1/(byte*) init_font_hex::proto_hi#6 init_font_hex::@4/(byte*) init_font_hex::proto_hi#5 )
(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 )
(byte) init_font_hex::idx#0 ← (number) 0
*((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#0) ← (number) 0
(byte) init_font_hex::idx#1 ← ++ (byte) init_font_hex::idx#0
(byte) init_font_hex::i#0 ← (byte) 0
to:init_font_hex::@3
init_font_hex::@3: scope:[init_font_hex] from init_font_hex::@2 init_font_hex::@3
(byte) init_font_hex::c#4 ← phi( init_font_hex::@2/(byte) init_font_hex::c#5 init_font_hex::@3/(byte) init_font_hex::c#4 )
(byte) init_font_hex::c1#3 ← phi( init_font_hex::@2/(byte) init_font_hex::c1#4 init_font_hex::@3/(byte) init_font_hex::c1#3 )
(byte) init_font_hex::idx#5 ← phi( init_font_hex::@2/(byte) init_font_hex::idx#1 init_font_hex::@3/(byte) init_font_hex::idx#2 )
(byte*) init_font_hex::charset#3 ← phi( init_font_hex::@2/(byte*) init_font_hex::charset#2 init_font_hex::@3/(byte*) init_font_hex::charset#3 )
(byte*) init_font_hex::proto_lo#2 ← phi( init_font_hex::@2/(byte*) init_font_hex::proto_lo#4 init_font_hex::@3/(byte*) init_font_hex::proto_lo#2 )
(byte) init_font_hex::i#2 ← phi( init_font_hex::@2/(byte) init_font_hex::i#0 init_font_hex::@3/(byte) init_font_hex::i#1 )
(byte*) init_font_hex::proto_hi#2 ← phi( init_font_hex::@2/(byte*) init_font_hex::proto_hi#4 init_font_hex::@3/(byte*) init_font_hex::proto_hi#2 )
(byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#2 + (byte) init_font_hex::i#2) << (number) 4
(byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#2 + (byte) init_font_hex::i#2) << (number) 1
(byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1
*((byte*) init_font_hex::charset#3 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2
(byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5
(byte) init_font_hex::i#1 ← (byte) init_font_hex::i#2 + rangenext(0,4)
(bool~) init_font_hex::$3 ← (byte) init_font_hex::i#1 != rangelast(0,4)
if((bool~) init_font_hex::$3) goto init_font_hex::@3
to:init_font_hex::@4
init_font_hex::@4: scope:[init_font_hex] from init_font_hex::@3
(byte) init_font_hex::c#3 ← phi( init_font_hex::@3/(byte) init_font_hex::c#4 )
(byte*) init_font_hex::proto_hi#5 ← phi( init_font_hex::@3/(byte*) init_font_hex::proto_hi#2 )
(byte) init_font_hex::c1#2 ← phi( init_font_hex::@3/(byte) init_font_hex::c1#3 )
(byte*) init_font_hex::proto_lo#3 ← phi( init_font_hex::@3/(byte*) init_font_hex::proto_lo#2 )
(byte) init_font_hex::idx#6 ← phi( init_font_hex::@3/(byte) init_font_hex::idx#2 )
(byte*) init_font_hex::charset#4 ← phi( init_font_hex::@3/(byte*) init_font_hex::charset#3 )
*((byte*) init_font_hex::charset#4 + (byte) init_font_hex::idx#6) ← (number) 0
(byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#6
*((byte*) init_font_hex::charset#4 + (byte) init_font_hex::idx#3) ← (number) 0
(byte) init_font_hex::idx#4 ← ++ (byte) init_font_hex::idx#3
(byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#3 + (number) 5
(byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#4 + (number) 8
(byte) init_font_hex::c1#1 ← (byte) init_font_hex::c1#2 + rangenext(0,$f)
(bool~) init_font_hex::$4 ← (byte) init_font_hex::c1#1 != rangelast(0,$f)
if((bool~) init_font_hex::$4) goto init_font_hex::@2
to:init_font_hex::@5
init_font_hex::@5: scope:[init_font_hex] from init_font_hex::@4
(byte*) init_font_hex::charset#7 ← phi( init_font_hex::@4/(byte*) init_font_hex::charset#0 )
(byte) init_font_hex::c#2 ← phi( init_font_hex::@4/(byte) init_font_hex::c#3 )
(byte*) init_font_hex::proto_hi#3 ← phi( init_font_hex::@4/(byte*) init_font_hex::proto_hi#5 )
(byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#3 + (number) 5
(byte) init_font_hex::c#1 ← (byte) init_font_hex::c#2 + rangenext(0,$f)
(bool~) init_font_hex::$5 ← (byte) init_font_hex::c#1 != rangelast(0,$f)
if((bool~) init_font_hex::$5) goto init_font_hex::@1
to:init_font_hex::@return
init_font_hex::@return: scope:[init_font_hex] from init_font_hex::@5
return
to:@return
@8: scope:[] from @3
(byte[]) FONT_HEX_PROTO#0 ← { (number) 2, (number) 5, (number) 5, (number) 5, (number) 2, (number) 6, (number) 2, (number) 2, (number) 2, (number) 7, (number) 6, (number) 1, (number) 2, (number) 4, (number) 7, (number) 6, (number) 1, (number) 2, (number) 1, (number) 6, (number) 5, (number) 5, (number) 7, (number) 1, (number) 1, (number) 7, (number) 4, (number) 6, (number) 1, (number) 6, (number) 3, (number) 4, (number) 6, (number) 5, (number) 2, (number) 7, (number) 1, (number) 1, (number) 1, (number) 1, (number) 2, (number) 5, (number) 2, (number) 5, (number) 2, (number) 2, (number) 5, (number) 3, (number) 1, (number) 1, (number) 2, (number) 5, (number) 7, (number) 5, (number) 5, (number) 6, (number) 5, (number) 6, (number) 5, (number) 6, (number) 2, (number) 5, (number) 4, (number) 5, (number) 2, (number) 6, (number) 5, (number) 5, (number) 5, (number) 6, (number) 7, (number) 4, (number) 6, (number) 4, (number) 7, (number) 7, (number) 4, (number) 6, (number) 4, (number) 4 }
(byte) CORDIC_ITERATIONS_16#0 ← (number) $f
(word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 ← kickasm {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
to:@10
atan2_16: scope:[atan2_16] from init_angle_screen::@2
(signed word) atan2_16::x#9 ← phi( init_angle_screen::@2/(signed word) atan2_16::x#0 )
(signed word) atan2_16::y#1 ← phi( init_angle_screen::@2/(signed word) atan2_16::y#0 )
(bool~) atan2_16::$0 ← (signed word) atan2_16::y#1 >= (number) 0
if((bool~) atan2_16::$0) goto atan2_16::@1
to:atan2_16::@2
atan2_16::@1: scope:[atan2_16] from atan2_16
(signed word) atan2_16::x#5 ← phi( atan2_16/(signed word) atan2_16::x#9 )
(signed word) atan2_16::y#2 ← phi( atan2_16/(signed word) atan2_16::y#1 )
(signed word~) atan2_16::$3 ← (signed word) atan2_16::y#2
to:atan2_16::@3
atan2_16::@2: scope:[atan2_16] from atan2_16
(signed word) atan2_16::x#6 ← phi( atan2_16/(signed word) atan2_16::x#9 )
(signed word) atan2_16::y#3 ← phi( atan2_16/(signed word) atan2_16::y#1 )
(signed word~) atan2_16::$1 ← - (signed word) atan2_16::y#3
(signed word~) atan2_16::$2 ← (signed word~) atan2_16::$1
to:atan2_16::@3
atan2_16::@3: scope:[atan2_16] from atan2_16::@1 atan2_16::@2
(signed word) atan2_16::y#15 ← phi( atan2_16::@1/(signed word) atan2_16::y#2 atan2_16::@2/(signed word) atan2_16::y#3 )
(signed word) atan2_16::x#1 ← phi( atan2_16::@1/(signed word) atan2_16::x#5 atan2_16::@2/(signed word) atan2_16::x#6 )
(signed word~) atan2_16::$4 ← phi( atan2_16::@1/(signed word~) atan2_16::$3 atan2_16::@2/(signed word~) atan2_16::$2 )
(signed word) atan2_16::yi#0 ← (signed word~) atan2_16::$4
(bool~) atan2_16::$5 ← (signed word) atan2_16::x#1 >= (number) 0
if((bool~) atan2_16::$5) goto atan2_16::@4
to:atan2_16::@5
atan2_16::@4: scope:[atan2_16] from atan2_16::@3
(signed word) atan2_16::y#12 ← phi( atan2_16::@3/(signed word) atan2_16::y#15 )
(signed word) atan2_16::yi#12 ← phi( atan2_16::@3/(signed word) atan2_16::yi#0 )
(signed word) atan2_16::x#2 ← phi( atan2_16::@3/(signed word) atan2_16::x#1 )
(signed word~) atan2_16::$8 ← (signed word) atan2_16::x#2
to:atan2_16::@6
atan2_16::@5: scope:[atan2_16] from atan2_16::@3
(signed word) atan2_16::y#13 ← phi( atan2_16::@3/(signed word) atan2_16::y#15 )
(signed word) atan2_16::yi#13 ← phi( atan2_16::@3/(signed word) atan2_16::yi#0 )
(signed word) atan2_16::x#3 ← phi( atan2_16::@3/(signed word) atan2_16::x#1 )
(signed word~) atan2_16::$6 ← - (signed word) atan2_16::x#3
(signed word~) atan2_16::$7 ← (signed word~) atan2_16::$6
to:atan2_16::@6
atan2_16::@6: scope:[atan2_16] from atan2_16::@4 atan2_16::@5
(signed word) atan2_16::y#9 ← phi( atan2_16::@4/(signed word) atan2_16::y#12 atan2_16::@5/(signed word) atan2_16::y#13 )
(signed word) atan2_16::x#10 ← phi( atan2_16::@4/(signed word) atan2_16::x#2 atan2_16::@5/(signed word) atan2_16::x#3 )
(signed word) atan2_16::yi#9 ← phi( atan2_16::@4/(signed word) atan2_16::yi#12 atan2_16::@5/(signed word) atan2_16::yi#13 )
(signed word~) atan2_16::$9 ← phi( atan2_16::@4/(signed word~) atan2_16::$8 atan2_16::@5/(signed word~) atan2_16::$7 )
(signed word) atan2_16::xi#0 ← (signed word~) atan2_16::$9
(word) atan2_16::angle#0 ← (number) 0
(number~) atan2_16::$16 ← (byte) CORDIC_ITERATIONS_16#0 - (number) 1
(byte) atan2_16::i#0 ← (byte) 0
to:atan2_16::@15
atan2_16::@15: scope:[atan2_16] from atan2_16::@27 atan2_16::@6
(signed word) atan2_16::y#7 ← phi( atan2_16::@27/(signed word) atan2_16::y#8 atan2_16::@6/(signed word) atan2_16::y#9 )
(signed word) atan2_16::x#7 ← phi( atan2_16::@27/(signed word) atan2_16::x#8 atan2_16::@6/(signed word) atan2_16::x#10 )
(word) atan2_16::angle#12 ← phi( atan2_16::@27/(word) atan2_16::angle#13 atan2_16::@6/(word) atan2_16::angle#0 )
(byte) atan2_16::i#6 ← phi( atan2_16::@27/(byte) atan2_16::i#1 atan2_16::@6/(byte) atan2_16::i#0 )
(signed word) atan2_16::xi#6 ← phi( atan2_16::@27/(signed word) atan2_16::xi#8 atan2_16::@6/(signed word) atan2_16::xi#0 )
(signed word) atan2_16::yi#3 ← phi( atan2_16::@27/(signed word) atan2_16::yi#8 atan2_16::@6/(signed word) atan2_16::yi#9 )
(bool~) atan2_16::$17 ← (signed word) atan2_16::yi#3 == (number) 0
(bool~) atan2_16::$18 ← ! (bool~) atan2_16::$17
if((bool~) atan2_16::$18) goto atan2_16::@16
to:atan2_16::@17
atan2_16::@16: scope:[atan2_16] from atan2_16::@15
(signed word) atan2_16::y#19 ← phi( atan2_16::@15/(signed word) atan2_16::y#7 )
(signed word) atan2_16::x#17 ← phi( atan2_16::@15/(signed word) atan2_16::x#7 )
(word) atan2_16::angle#19 ← phi( atan2_16::@15/(word) atan2_16::angle#12 )
(byte) atan2_16::i#2 ← phi( atan2_16::@15/(byte) atan2_16::i#6 )
(signed word) atan2_16::yi#4 ← phi( atan2_16::@15/(signed word) atan2_16::yi#3 )
(signed word) atan2_16::xi#3 ← phi( atan2_16::@15/(signed word) atan2_16::xi#6 )
(signed word) atan2_16::xd#0 ← (signed word) atan2_16::xi#3
(signed word) atan2_16::yd#0 ← (signed word) atan2_16::yi#4
(byte) atan2_16::shift#0 ← (byte) atan2_16::i#2
to:atan2_16::@18
atan2_16::@17: scope:[atan2_16] from atan2_16::@15 atan2_16::@27
(signed word) atan2_16::y#5 ← phi( atan2_16::@15/(signed word) atan2_16::y#7 atan2_16::@27/(signed word) atan2_16::y#8 )
(signed word) atan2_16::x#4 ← phi( atan2_16::@15/(signed word) atan2_16::x#7 atan2_16::@27/(signed word) atan2_16::x#8 )
(word) atan2_16::angle#6 ← phi( atan2_16::@15/(word) atan2_16::angle#12 atan2_16::@27/(word) atan2_16::angle#13 )
(word) atan2_16::angle#1 ← (word) atan2_16::angle#6 / (number) 2
(bool~) atan2_16::$10 ← (signed word) atan2_16::x#4 < (number) 0
(bool~) atan2_16::$11 ← ! (bool~) atan2_16::$10
if((bool~) atan2_16::$11) goto atan2_16::@7
to:atan2_16::@33
atan2_16::@18: scope:[atan2_16] from atan2_16::@16 atan2_16::@19
(signed word) atan2_16::y#18 ← phi( atan2_16::@16/(signed word) atan2_16::y#19 atan2_16::@19/(signed word) atan2_16::y#20 )
(signed word) atan2_16::x#16 ← phi( atan2_16::@16/(signed word) atan2_16::x#17 atan2_16::@19/(signed word) atan2_16::x#18 )
(word) atan2_16::angle#18 ← phi( atan2_16::@16/(word) atan2_16::angle#19 atan2_16::@19/(word) atan2_16::angle#20 )
(byte) atan2_16::i#10 ← phi( atan2_16::@16/(byte) atan2_16::i#2 atan2_16::@19/(byte) atan2_16::i#11 )
(signed word) atan2_16::xi#11 ← phi( atan2_16::@16/(signed word) atan2_16::xi#3 atan2_16::@19/(signed word) atan2_16::xi#12 )
(signed word) atan2_16::yi#14 ← phi( atan2_16::@16/(signed word) atan2_16::yi#4 atan2_16::@19/(signed word) atan2_16::yi#15 )
(signed word) atan2_16::yd#7 ← phi( atan2_16::@16/(signed word) atan2_16::yd#0 atan2_16::@19/(signed word) atan2_16::yd#1 )
(signed word) atan2_16::xd#7 ← phi( atan2_16::@16/(signed word) atan2_16::xd#0 atan2_16::@19/(signed word) atan2_16::xd#1 )
(byte) atan2_16::shift#2 ← phi( atan2_16::@16/(byte) atan2_16::shift#0 atan2_16::@19/(byte) atan2_16::shift#1 )
(bool~) atan2_16::$19 ← (byte) atan2_16::shift#2 > (number) 1
if((bool~) atan2_16::$19) goto atan2_16::@19
to:atan2_16::@20
atan2_16::@19: scope:[atan2_16] from atan2_16::@18
(signed word) atan2_16::y#20 ← phi( atan2_16::@18/(signed word) atan2_16::y#18 )
(signed word) atan2_16::x#18 ← phi( atan2_16::@18/(signed word) atan2_16::x#16 )
(word) atan2_16::angle#20 ← phi( atan2_16::@18/(word) atan2_16::angle#18 )
(byte) atan2_16::i#11 ← phi( atan2_16::@18/(byte) atan2_16::i#10 )
(signed word) atan2_16::xi#12 ← phi( atan2_16::@18/(signed word) atan2_16::xi#11 )
(signed word) atan2_16::yi#15 ← phi( atan2_16::@18/(signed word) atan2_16::yi#14 )
(byte) atan2_16::shift#3 ← phi( atan2_16::@18/(byte) atan2_16::shift#2 )
(signed word) atan2_16::yd#3 ← phi( atan2_16::@18/(signed word) atan2_16::yd#7 )
(signed word) atan2_16::xd#3 ← phi( atan2_16::@18/(signed word) atan2_16::xd#7 )
(signed word) atan2_16::xd#1 ← (signed word) atan2_16::xd#3 >> (number) 2
(signed word) atan2_16::yd#1 ← (signed word) atan2_16::yd#3 >> (number) 2
(byte) atan2_16::shift#1 ← (byte) atan2_16::shift#3 - (number) 2
to:atan2_16::@18
atan2_16::@20: scope:[atan2_16] from atan2_16::@18
(signed word) atan2_16::y#16 ← phi( atan2_16::@18/(signed word) atan2_16::y#18 )
(signed word) atan2_16::x#14 ← phi( atan2_16::@18/(signed word) atan2_16::x#16 )
(word) atan2_16::angle#16 ← phi( atan2_16::@18/(word) atan2_16::angle#18 )
(byte) atan2_16::i#8 ← phi( atan2_16::@18/(byte) atan2_16::i#10 )
(signed word) atan2_16::xi#9 ← phi( atan2_16::@18/(signed word) atan2_16::xi#11 )
(signed word) atan2_16::yd#8 ← phi( atan2_16::@18/(signed word) atan2_16::yd#7 )
(signed word) atan2_16::xd#8 ← phi( atan2_16::@18/(signed word) atan2_16::xd#7 )
(signed word) atan2_16::yi#10 ← phi( atan2_16::@18/(signed word) atan2_16::yi#14 )
(byte) atan2_16::shift#4 ← phi( atan2_16::@18/(byte) atan2_16::shift#2 )
(bool~) atan2_16::$25 ← (number) 0 != (byte) atan2_16::shift#4
(bool~) atan2_16::$20 ← ! (bool~) atan2_16::$25
if((bool~) atan2_16::$20) goto atan2_16::@25
to:atan2_16::@24
atan2_16::@25: scope:[atan2_16] from atan2_16::@20 atan2_16::@24
(signed word) atan2_16::y#14 ← phi( atan2_16::@20/(signed word) atan2_16::y#16 atan2_16::@24/(signed word) atan2_16::y#17 )
(signed word) atan2_16::x#13 ← phi( atan2_16::@20/(signed word) atan2_16::x#14 atan2_16::@24/(signed word) atan2_16::x#15 )
(word) atan2_16::angle#14 ← phi( atan2_16::@20/(word) atan2_16::angle#16 atan2_16::@24/(word) atan2_16::angle#17 )
(byte) atan2_16::i#7 ← phi( atan2_16::@20/(byte) atan2_16::i#8 atan2_16::@24/(byte) atan2_16::i#9 )
(signed word) atan2_16::xd#9 ← phi( atan2_16::@20/(signed word) atan2_16::xd#8 atan2_16::@24/(signed word) atan2_16::xd#2 )
(signed word) atan2_16::yd#9 ← phi( atan2_16::@20/(signed word) atan2_16::yd#8 atan2_16::@24/(signed word) atan2_16::yd#2 )
(signed word) atan2_16::xi#7 ← phi( atan2_16::@20/(signed word) atan2_16::xi#9 atan2_16::@24/(signed word) atan2_16::xi#10 )
(signed word) atan2_16::yi#5 ← phi( atan2_16::@20/(signed word) atan2_16::yi#10 atan2_16::@24/(signed word) atan2_16::yi#11 )
(bool~) atan2_16::$21 ← (signed word) atan2_16::yi#5 >= (number) 0
if((bool~) atan2_16::$21) goto atan2_16::@26
to:atan2_16::@30
atan2_16::@24: scope:[atan2_16] from atan2_16::@20
(signed word) atan2_16::y#17 ← phi( atan2_16::@20/(signed word) atan2_16::y#16 )
(signed word) atan2_16::x#15 ← phi( atan2_16::@20/(signed word) atan2_16::x#14 )
(word) atan2_16::angle#17 ← phi( atan2_16::@20/(word) atan2_16::angle#16 )
(byte) atan2_16::i#9 ← phi( atan2_16::@20/(byte) atan2_16::i#8 )
(signed word) atan2_16::xi#10 ← phi( atan2_16::@20/(signed word) atan2_16::xi#9 )
(signed word) atan2_16::yi#11 ← phi( atan2_16::@20/(signed word) atan2_16::yi#10 )
(signed word) atan2_16::yd#4 ← phi( atan2_16::@20/(signed word) atan2_16::yd#8 )
(signed word) atan2_16::xd#4 ← phi( atan2_16::@20/(signed word) atan2_16::xd#8 )
(signed word) atan2_16::xd#2 ← (signed word) atan2_16::xd#4 >> (number) 1
(signed word) atan2_16::yd#2 ← (signed word) atan2_16::yd#4 >> (number) 1
to:atan2_16::@25
atan2_16::@26: scope:[atan2_16] from atan2_16::@25
(signed word) atan2_16::y#10 ← phi( atan2_16::@25/(signed word) atan2_16::y#14 )
(signed word) atan2_16::x#11 ← phi( atan2_16::@25/(signed word) atan2_16::x#13 )
(word) atan2_16::angle#7 ← phi( atan2_16::@25/(word) atan2_16::angle#14 )
(byte) atan2_16::i#3 ← phi( atan2_16::@25/(byte) atan2_16::i#7 )
(signed word) atan2_16::xd#5 ← phi( atan2_16::@25/(signed word) atan2_16::xd#9 )
(signed word) atan2_16::yi#6 ← phi( atan2_16::@25/(signed word) atan2_16::yi#5 )
(signed word) atan2_16::yd#5 ← phi( atan2_16::@25/(signed word) atan2_16::yd#9 )
(signed word) atan2_16::xi#4 ← phi( atan2_16::@25/(signed word) atan2_16::xi#7 )
(signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#4 + (signed word) atan2_16::yd#5
(signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#6 - (signed word) atan2_16::xd#5
(byte~) atan2_16::$23 ← (byte) atan2_16::i#3 * (const byte) SIZEOF_WORD
(word) atan2_16::angle#2 ← (word) atan2_16::angle#7 + *((word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
to:atan2_16::@27
atan2_16::@30: scope:[atan2_16] from atan2_16::@25
(signed word) atan2_16::y#11 ← phi( atan2_16::@25/(signed word) atan2_16::y#14 )
(signed word) atan2_16::x#12 ← phi( atan2_16::@25/(signed word) atan2_16::x#13 )
(word) atan2_16::angle#8 ← phi( atan2_16::@25/(word) atan2_16::angle#14 )
(byte) atan2_16::i#4 ← phi( atan2_16::@25/(byte) atan2_16::i#7 )
(signed word) atan2_16::xd#6 ← phi( atan2_16::@25/(signed word) atan2_16::xd#9 )
(signed word) atan2_16::yi#7 ← phi( atan2_16::@25/(signed word) atan2_16::yi#5 )
(signed word) atan2_16::yd#6 ← phi( atan2_16::@25/(signed word) atan2_16::yd#9 )
(signed word) atan2_16::xi#5 ← phi( atan2_16::@25/(signed word) atan2_16::xi#7 )
(signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#5 - (signed word) atan2_16::yd#6
(signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#7 + (signed word) atan2_16::xd#6
(byte~) atan2_16::$24 ← (byte) atan2_16::i#4 * (const byte) SIZEOF_WORD
(word) atan2_16::angle#3 ← (word) atan2_16::angle#8 - *((word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24)
to:atan2_16::@27
atan2_16::@27: scope:[atan2_16] from atan2_16::@26 atan2_16::@30
(signed word) atan2_16::y#8 ← phi( atan2_16::@26/(signed word) atan2_16::y#10 atan2_16::@30/(signed word) atan2_16::y#11 )
(signed word) atan2_16::xi#8 ← phi( atan2_16::@26/(signed word) atan2_16::xi#1 atan2_16::@30/(signed word) atan2_16::xi#2 )
(signed word) atan2_16::x#8 ← phi( atan2_16::@26/(signed word) atan2_16::x#11 atan2_16::@30/(signed word) atan2_16::x#12 )
(word) atan2_16::angle#13 ← phi( atan2_16::@26/(word) atan2_16::angle#2 atan2_16::@30/(word) atan2_16::angle#3 )
(signed word) atan2_16::yi#8 ← phi( atan2_16::@26/(signed word) atan2_16::yi#1 atan2_16::@30/(signed word) atan2_16::yi#2 )
(byte) atan2_16::i#5 ← phi( atan2_16::@26/(byte) atan2_16::i#3 atan2_16::@30/(byte) atan2_16::i#4 )
(byte) atan2_16::i#1 ← (byte) atan2_16::i#5 + rangenext(0,atan2_16::$16)
(bool~) atan2_16::$22 ← (byte) atan2_16::i#1 != rangelast(0,atan2_16::$16)
if((bool~) atan2_16::$22) goto atan2_16::@15
to:atan2_16::@17
atan2_16::@7: scope:[atan2_16] from atan2_16::@17 atan2_16::@33
(word) atan2_16::angle#15 ← phi( atan2_16::@17/(word) atan2_16::angle#1 atan2_16::@33/(word) atan2_16::angle#4 )
(signed word) atan2_16::y#4 ← phi( atan2_16::@17/(signed word) atan2_16::y#5 atan2_16::@33/(signed word) atan2_16::y#6 )
(bool~) atan2_16::$13 ← (signed word) atan2_16::y#4 < (number) 0
(bool~) atan2_16::$14 ← ! (bool~) atan2_16::$13
if((bool~) atan2_16::$14) goto atan2_16::@8
to:atan2_16::@13
atan2_16::@33: scope:[atan2_16] from atan2_16::@17
(signed word) atan2_16::y#6 ← phi( atan2_16::@17/(signed word) atan2_16::y#5 )
(word) atan2_16::angle#9 ← phi( atan2_16::@17/(word) atan2_16::angle#1 )
(number~) atan2_16::$12 ← (number) $8000 - (word) atan2_16::angle#9
(word) atan2_16::angle#4 ← (number~) atan2_16::$12
to:atan2_16::@7
atan2_16::@8: scope:[atan2_16] from atan2_16::@13 atan2_16::@7
(word) atan2_16::angle#10 ← phi( atan2_16::@13/(word) atan2_16::angle#5 atan2_16::@7/(word) atan2_16::angle#15 )
(word) atan2_16::return#0 ← (word) atan2_16::angle#10
to:atan2_16::@return
atan2_16::@13: scope:[atan2_16] from atan2_16::@7
(word) atan2_16::angle#11 ← phi( atan2_16::@7/(word) atan2_16::angle#15 )
(word~) atan2_16::$15 ← - (word) atan2_16::angle#11
(word) atan2_16::angle#5 ← (word~) atan2_16::$15
to:atan2_16::@8
atan2_16::@return: scope:[atan2_16] from atan2_16::@8
(word) atan2_16::return#3 ← phi( atan2_16::@8/(word) atan2_16::return#0 )
(word) atan2_16::return#1 ← (word) atan2_16::return#3
return
to:@return
@10: scope:[] from @8
(dword) CLOCKS_PER_INIT#0 ← (number) $12
to:@26
clock: scope:[clock] from main::@5
(number~) clock::$0 ← (number) $ffffffff - *((dword*) CIA2_TIMER_AB#0)
(dword) clock::return#0 ← (number~) clock::$0
to:clock::@return
clock::@return: scope:[clock] from clock
(dword) clock::return#3 ← phi( clock/(dword) clock::return#0 )
(dword) clock::return#1 ← (dword) clock::return#3
return
to:@return
clock_start: scope:[clock_start] from main::@1
(byte~) clock_start::$0 ← (byte) CIA_TIMER_CONTROL_STOP#0 | (byte) CIA_TIMER_CONTROL_CONTINUOUS#0
(byte~) clock_start::$1 ← (byte~) clock_start::$0 | (byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES#0
*((byte*) CIA2_TIMER_A_CONTROL#0) ← (byte~) clock_start::$1
(byte~) clock_start::$2 ← (byte) CIA_TIMER_CONTROL_STOP#0 | (byte) CIA_TIMER_CONTROL_CONTINUOUS#0
(byte~) clock_start::$3 ← (byte~) clock_start::$2 | (byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0
*((byte*) CIA2_TIMER_B_CONTROL#0) ← (byte~) clock_start::$3
*((dword*) CIA2_TIMER_AB#0) ← (number) $ffffffff
(byte~) clock_start::$4 ← (byte) CIA_TIMER_CONTROL_START#0 | (byte) CIA_TIMER_CONTROL_CONTINUOUS#0
(byte~) clock_start::$5 ← (byte~) clock_start::$4 | (byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0
*((byte*) CIA2_TIMER_B_CONTROL#0) ← (byte~) clock_start::$5
(byte~) clock_start::$6 ← (byte) CIA_TIMER_CONTROL_START#0 | (byte) CIA_TIMER_CONTROL_CONTINUOUS#0
(byte~) clock_start::$7 ← (byte~) clock_start::$6 | (byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES#0
*((byte*) CIA2_TIMER_A_CONTROL#0) ← (byte~) clock_start::$7
to:clock_start::@return
clock_start::@return: scope:[clock_start] from clock_start
return
to:@return
print_word_at: scope:[print_word_at] from print_dword_at print_dword_at::@1
(byte*) print_word_at::at#2 ← phi( print_dword_at/(byte*) print_word_at::at#0 print_dword_at::@1/(byte*) print_word_at::at#1 )
(word) print_word_at::w#2 ← phi( print_dword_at/(word) print_word_at::w#0 print_dword_at::@1/(word) print_word_at::w#1 )
(byte~) print_word_at::$0 ← > (word) print_word_at::w#2
(byte) print_byte_at::b#0 ← (byte~) print_word_at::$0
(byte*) print_byte_at::at#0 ← (byte*) print_word_at::at#2
call print_byte_at
to:print_word_at::@1
print_word_at::@1: scope:[print_word_at] from print_word_at
(byte*) print_word_at::at#3 ← phi( print_word_at/(byte*) print_word_at::at#2 )
(word) print_word_at::w#3 ← phi( print_word_at/(word) print_word_at::w#2 )
(byte~) print_word_at::$2 ← < (word) print_word_at::w#3
(byte*~) print_word_at::$3 ← (byte*) print_word_at::at#3 + (number) 2
(byte) print_byte_at::b#1 ← (byte~) print_word_at::$2
(byte*) print_byte_at::at#1 ← (byte*~) print_word_at::$3
call print_byte_at
to:print_word_at::@2
print_word_at::@2: scope:[print_word_at] from print_word_at::@1
to:print_word_at::@return
print_word_at::@return: scope:[print_word_at] from print_word_at::@2
return
to:@return
print_dword_at: scope:[print_dword_at] from main::@6
(byte*) print_dword_at::at#1 ← phi( main::@6/(byte*) print_dword_at::at#0 )
(dword) print_dword_at::dw#1 ← phi( main::@6/(dword) print_dword_at::dw#0 )
(word~) print_dword_at::$0 ← > (dword) print_dword_at::dw#1
(word) print_word_at::w#0 ← (word~) print_dword_at::$0
(byte*) print_word_at::at#0 ← (byte*) print_dword_at::at#1
call print_word_at
to:print_dword_at::@1
print_dword_at::@1: scope:[print_dword_at] from print_dword_at
(byte*) print_dword_at::at#2 ← phi( print_dword_at/(byte*) print_dword_at::at#1 )
(dword) print_dword_at::dw#2 ← phi( print_dword_at/(dword) print_dword_at::dw#1 )
(word~) print_dword_at::$2 ← < (dword) print_dword_at::dw#2
(byte*~) print_dword_at::$3 ← (byte*) print_dword_at::at#2 + (number) 4
(word) print_word_at::w#1 ← (word~) print_dword_at::$2
(byte*) print_word_at::at#1 ← (byte*~) print_dword_at::$3
call print_word_at
to:print_dword_at::@2
print_dword_at::@2: scope:[print_dword_at] from print_dword_at::@1
to:print_dword_at::@return
print_dword_at::@return: scope:[print_dword_at] from print_dword_at::@2
return
to:@return
@26: scope:[] from @10
(byte[]) print_hextab#0 ← (const string) $0
to:@33
print_byte_at: scope:[print_byte_at] from print_word_at print_word_at::@1
(byte*) print_byte_at::at#2 ← phi( print_word_at/(byte*) print_byte_at::at#0 print_word_at::@1/(byte*) print_byte_at::at#1 )
(byte) print_byte_at::b#2 ← phi( print_word_at/(byte) print_byte_at::b#0 print_word_at::@1/(byte) print_byte_at::b#1 )
(byte~) print_byte_at::$0 ← (byte) print_byte_at::b#2 >> (number) 4
(byte) print_char_at::ch#0 ← *((byte[]) print_hextab#0 + (byte~) print_byte_at::$0)
(byte*) print_char_at::at#0 ← (byte*) print_byte_at::at#2
call print_char_at
to:print_byte_at::@1
print_byte_at::@1: scope:[print_byte_at] from print_byte_at
(byte*) print_byte_at::at#3 ← phi( print_byte_at/(byte*) print_byte_at::at#2 )
(byte) print_byte_at::b#3 ← phi( print_byte_at/(byte) print_byte_at::b#2 )
(number~) print_byte_at::$2 ← (byte) print_byte_at::b#3 & (number) $f
(byte*~) print_byte_at::$3 ← (byte*) print_byte_at::at#3 + (number) 1
(byte) print_char_at::ch#1 ← *((byte[]) print_hextab#0 + (number~) print_byte_at::$2)
(byte*) print_char_at::at#1 ← (byte*~) print_byte_at::$3
call print_char_at
to:print_byte_at::@2
print_byte_at::@2: scope:[print_byte_at] from print_byte_at::@1
to:print_byte_at::@return
print_byte_at::@return: scope:[print_byte_at] from print_byte_at::@2
return
to:@return
print_char_at: scope:[print_char_at] from print_byte_at print_byte_at::@1
(byte*) print_char_at::at#2 ← phi( print_byte_at/(byte*) print_char_at::at#0 print_byte_at::@1/(byte*) print_char_at::at#1 )
(byte) print_char_at::ch#2 ← phi( print_byte_at/(byte) print_char_at::ch#0 print_byte_at::@1/(byte) print_char_at::ch#1 )
*((byte*) print_char_at::at#2) ← (byte) print_char_at::ch#2
to:print_char_at::@return
print_char_at::@return: scope:[print_char_at] from print_char_at
return
to:@return
@33: scope:[] from @26
(byte*) CHARSET#0 ← ((byte*)) (number) $2000
(byte*) SCREEN#0 ← ((byte*)) (number) $2800
to:@35
main: scope:[main] from @35
(byte*) init_font_hex::charset#1 ← (byte*) CHARSET#0
call init_font_hex
to:main::@3
main::@3: scope:[main] from main
(byte*) main::toD0181_screen#0 ← (byte*) SCREEN#0
(byte*) main::toD0181_gfx#0 ← (byte*) CHARSET#0
to:main::toD0181
main::toD0181: scope:[main] from main::@3
(byte*) main::toD0181_gfx#1 ← phi( main::@3/(byte*) main::toD0181_gfx#0 )
(byte*) main::toD0181_screen#1 ← phi( main::@3/(byte*) main::toD0181_screen#0 )
(word~) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1
(number~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (number) $3fff
(number~) main::toD0181_$2#0 ← (number~) main::toD0181_$1#0 * (number) 4
(number~) main::toD0181_$3#0 ← > (number~) main::toD0181_$2#0
(word~) main::toD0181_$4#0 ← ((word)) (byte*) main::toD0181_gfx#1
(byte~) main::toD0181_$5#0 ← > (word~) main::toD0181_$4#0
(number~) main::toD0181_$6#0 ← (byte~) main::toD0181_$5#0 / (number) 4
(number~) main::toD0181_$7#0 ← (number~) main::toD0181_$6#0 & (number) $f
(number~) main::toD0181_$8#0 ← (number~) main::toD0181_$3#0 | (number~) main::toD0181_$7#0
(byte) main::toD0181_return#0 ← (number~) main::toD0181_$8#0
to:main::toD0181_@return
main::toD0181_@return: scope:[main] from main::toD0181
(byte) main::toD0181_return#2 ← phi( main::toD0181/(byte) main::toD0181_return#0 )
(byte) main::toD0181_return#1 ← (byte) main::toD0181_return#2
to:main::@1
main::@1: scope:[main] from main::toD0181_@return
(byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 )
(byte~) main::$1 ← (byte) main::toD0181_return#3
*((byte*) D018#0) ← (byte~) main::$1
call clock_start
to:main::@4
main::@4: scope:[main] from main::@1
(byte*) init_angle_screen::screen#0 ← (byte*) SCREEN#0
call init_angle_screen
to:main::@5
main::@5: scope:[main] from main::@4
call clock
(dword) clock::return#2 ← (dword) clock::return#1
to:main::@6
main::@6: scope:[main] from main::@5
(dword) clock::return#4 ← phi( main::@5/(dword) clock::return#2 )
(dword~) main::$4 ← (dword) clock::return#4
(dword~) main::$5 ← (dword~) main::$4 - (dword) CLOCKS_PER_INIT#0
(dword) main::cyclecount#0 ← (dword~) main::$5
(byte*) main::BASE_SCREEN#0 ← ((byte*)) (number) $400
(byte*) main::BASE_CHARSET#0 ← ((byte*)) (number) $1000
(dword) print_dword_at::dw#0 ← (dword) main::cyclecount#0
(byte*) print_dword_at::at#0 ← (byte*) main::BASE_SCREEN#0
call print_dword_at
to:main::@7
main::@7: scope:[main] from main::@6
(byte*) main::toD0182_screen#0 ← (byte*) main::BASE_SCREEN#0
(byte*) main::toD0182_gfx#0 ← (byte*) main::BASE_CHARSET#0
to:main::toD0182
main::toD0182: scope:[main] from main::@7
(byte*) main::toD0182_gfx#1 ← phi( main::@7/(byte*) main::toD0182_gfx#0 )
(byte*) main::toD0182_screen#1 ← phi( main::@7/(byte*) main::toD0182_screen#0 )
(word~) main::toD0182_$0#0 ← ((word)) (byte*) main::toD0182_screen#1
(number~) main::toD0182_$1#0 ← (word~) main::toD0182_$0#0 & (number) $3fff
(number~) main::toD0182_$2#0 ← (number~) main::toD0182_$1#0 * (number) 4
(number~) main::toD0182_$3#0 ← > (number~) main::toD0182_$2#0
(word~) main::toD0182_$4#0 ← ((word)) (byte*) main::toD0182_gfx#1
(byte~) main::toD0182_$5#0 ← > (word~) main::toD0182_$4#0
(number~) main::toD0182_$6#0 ← (byte~) main::toD0182_$5#0 / (number) 4
(number~) main::toD0182_$7#0 ← (number~) main::toD0182_$6#0 & (number) $f
(number~) main::toD0182_$8#0 ← (number~) main::toD0182_$3#0 | (number~) main::toD0182_$7#0
(byte) main::toD0182_return#0 ← (number~) main::toD0182_$8#0
to:main::toD0182_@return
main::toD0182_@return: scope:[main] from main::toD0182
(byte) main::toD0182_return#2 ← phi( main::toD0182/(byte) main::toD0182_return#0 )
(byte) main::toD0182_return#1 ← (byte) main::toD0182_return#2
to:main::@2
main::@2: scope:[main] from main::toD0182_@return
(byte) main::toD0182_return#3 ← phi( main::toD0182_@return/(byte) main::toD0182_return#1 )
(byte~) main::$7 ← (byte) main::toD0182_return#3
*((byte*) D018#0) ← (byte~) main::$7
to:main::@return
main::@return: scope:[main] from main::@2
return
to:@return
init_angle_screen: scope:[init_angle_screen] from main::@4
(byte*) init_angle_screen::screen#1 ← phi( main::@4/(byte*) init_angle_screen::screen#0 )
(byte*~) init_angle_screen::$0 ← (byte*) init_angle_screen::screen#1 + (number) $28*(number) $c
(byte*) init_angle_screen::screen_topline#0 ← (byte*~) init_angle_screen::$0
(byte*~) init_angle_screen::$1 ← (byte*) init_angle_screen::screen#1 + (number) $28*(number) $c
(byte*) init_angle_screen::screen_bottomline#0 ← (byte*~) init_angle_screen::$1
(byte) init_angle_screen::y#0 ← (byte) 0
to:init_angle_screen::@1
init_angle_screen::@1: scope:[init_angle_screen] from init_angle_screen init_angle_screen::@3
(byte*) init_angle_screen::screen_bottomline#5 ← phi( init_angle_screen/(byte*) init_angle_screen::screen_bottomline#0 init_angle_screen::@3/(byte*) init_angle_screen::screen_bottomline#1 )
(byte*) init_angle_screen::screen_topline#5 ← phi( init_angle_screen/(byte*) init_angle_screen::screen_topline#0 init_angle_screen::@3/(byte*) init_angle_screen::screen_topline#1 )
(byte) init_angle_screen::y#4 ← phi( init_angle_screen/(byte) init_angle_screen::y#0 init_angle_screen::@3/(byte) init_angle_screen::y#1 )
(byte) init_angle_screen::x#0 ← (number) 0
(byte) init_angle_screen::xb#0 ← (number) $27
to:init_angle_screen::@2
init_angle_screen::@2: scope:[init_angle_screen] from init_angle_screen::@1 init_angle_screen::@5
(byte) init_angle_screen::xb#3 ← phi( init_angle_screen::@1/(byte) init_angle_screen::xb#0 init_angle_screen::@5/(byte) init_angle_screen::xb#1 )
(byte*) init_angle_screen::screen_bottomline#4 ← phi( init_angle_screen::@1/(byte*) init_angle_screen::screen_bottomline#5 init_angle_screen::@5/(byte*) init_angle_screen::screen_bottomline#2 )
(byte*) init_angle_screen::screen_topline#4 ← phi( init_angle_screen::@1/(byte*) init_angle_screen::screen_topline#5 init_angle_screen::@5/(byte*) init_angle_screen::screen_topline#2 )
(byte) init_angle_screen::y#2 ← phi( init_angle_screen::@1/(byte) init_angle_screen::y#4 init_angle_screen::@5/(byte) init_angle_screen::y#5 )
(byte) init_angle_screen::x#2 ← phi( init_angle_screen::@1/(byte) init_angle_screen::x#0 init_angle_screen::@5/(byte) init_angle_screen::x#1 )
(number~) init_angle_screen::$2 ← (byte) init_angle_screen::x#2 * (number) 2
(number~) init_angle_screen::$3 ← (number) $27 - (number~) init_angle_screen::$2
(word~) init_angle_screen::$4 ← ((word)) { (number~) init_angle_screen::$3, (number) 0 }
(signed word~) init_angle_screen::$5 ← ((signed word)) (word~) init_angle_screen::$4
(signed word) init_angle_screen::xw#0 ← (signed word~) init_angle_screen::$5
(number~) init_angle_screen::$6 ← (byte) init_angle_screen::y#2 * (number) 2
(word~) init_angle_screen::$7 ← ((word)) { (number~) init_angle_screen::$6, (number) 0 }
(signed word~) init_angle_screen::$8 ← ((signed word)) (word~) init_angle_screen::$7
(signed word) init_angle_screen::yw#0 ← (signed word~) init_angle_screen::$8
(signed word) atan2_16::x#0 ← (signed word) init_angle_screen::xw#0
(signed word) atan2_16::y#0 ← (signed word) init_angle_screen::yw#0
call atan2_16
(word) atan2_16::return#2 ← (word) atan2_16::return#1
to:init_angle_screen::@5
init_angle_screen::@5: scope:[init_angle_screen] from init_angle_screen::@2
(byte) init_angle_screen::y#5 ← phi( init_angle_screen::@2/(byte) init_angle_screen::y#2 )
(byte) init_angle_screen::xb#2 ← phi( init_angle_screen::@2/(byte) init_angle_screen::xb#3 )
(byte*) init_angle_screen::screen_bottomline#2 ← phi( init_angle_screen::@2/(byte*) init_angle_screen::screen_bottomline#4 )
(byte) init_angle_screen::x#3 ← phi( init_angle_screen::@2/(byte) init_angle_screen::x#2 )
(byte*) init_angle_screen::screen_topline#2 ← phi( init_angle_screen::@2/(byte*) init_angle_screen::screen_topline#4 )
(word) atan2_16::return#4 ← phi( init_angle_screen::@2/(word) atan2_16::return#2 )
(word~) init_angle_screen::$9 ← (word) atan2_16::return#4
(word) init_angle_screen::angle_w#0 ← (word~) init_angle_screen::$9
(number~) init_angle_screen::$10 ← (word) init_angle_screen::angle_w#0 + (number) $80
(number~) init_angle_screen::$11 ← > (number~) init_angle_screen::$10
(byte) init_angle_screen::ang_w#0 ← (number~) init_angle_screen::$11
(number~) init_angle_screen::$12 ← (number) $80 + (byte) init_angle_screen::ang_w#0
*((byte*) init_angle_screen::screen_topline#2 + (byte) init_angle_screen::x#3) ← (number~) init_angle_screen::$12
(number~) init_angle_screen::$13 ← (number) $80 - (byte) init_angle_screen::ang_w#0
*((byte*) init_angle_screen::screen_bottomline#2 + (byte) init_angle_screen::x#3) ← (number~) init_angle_screen::$13
(byte~) init_angle_screen::$14 ← - (byte) init_angle_screen::ang_w#0
*((byte*) init_angle_screen::screen_topline#2 + (byte) init_angle_screen::xb#2) ← (byte~) init_angle_screen::$14
*((byte*) init_angle_screen::screen_bottomline#2 + (byte) init_angle_screen::xb#2) ← (byte) init_angle_screen::ang_w#0
(byte) init_angle_screen::x#1 ← ++ (byte) init_angle_screen::x#3
(byte) init_angle_screen::xb#1 ← -- (byte) init_angle_screen::xb#2
(bool~) init_angle_screen::$15 ← (byte) init_angle_screen::x#1 <= (number) $13
if((bool~) init_angle_screen::$15) goto init_angle_screen::@2
to:init_angle_screen::@3
init_angle_screen::@3: scope:[init_angle_screen] from init_angle_screen::@5
(byte) init_angle_screen::y#3 ← phi( init_angle_screen::@5/(byte) init_angle_screen::y#5 )
(byte*) init_angle_screen::screen_bottomline#3 ← phi( init_angle_screen::@5/(byte*) init_angle_screen::screen_bottomline#2 )
(byte*) init_angle_screen::screen_topline#3 ← phi( init_angle_screen::@5/(byte*) init_angle_screen::screen_topline#2 )
(byte*) init_angle_screen::screen_topline#1 ← (byte*) init_angle_screen::screen_topline#3 - (number) $28
(byte*) init_angle_screen::screen_bottomline#1 ← (byte*) init_angle_screen::screen_bottomline#3 + (number) $28
(byte) init_angle_screen::y#1 ← (byte) init_angle_screen::y#3 + rangenext(0,$c)
(bool~) init_angle_screen::$16 ← (byte) init_angle_screen::y#1 != rangelast(0,$c)
if((bool~) init_angle_screen::$16) goto init_angle_screen::@1
to:init_angle_screen::@return
init_angle_screen::@return: scope:[init_angle_screen] from init_angle_screen::@3
return
to:@return
@35: scope:[] from @33
call main
to:@36
@36: scope:[] from @35
to:@end
@end: scope:[] from @36
SYMBOL TABLE SSA
(const string) $0 = (string) "0123456789abcdef"
(label) @10
(label) @26
(label) @3
(label) @33
(label) @35
(label) @36
(label) @8
(label) @begin
(label) @end
(byte*) CHARSET
(byte*) CHARSET#0
(dword*) CIA2_TIMER_AB
(dword*) CIA2_TIMER_AB#0
(byte*) CIA2_TIMER_A_CONTROL
(byte*) CIA2_TIMER_A_CONTROL#0
(byte*) CIA2_TIMER_B_CONTROL
(byte*) CIA2_TIMER_B_CONTROL#0
(byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
(byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES#0
(byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
(byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0
(byte) CIA_TIMER_CONTROL_CONTINUOUS
(byte) CIA_TIMER_CONTROL_CONTINUOUS#0
(byte) CIA_TIMER_CONTROL_START
(byte) CIA_TIMER_CONTROL_START#0
(byte) CIA_TIMER_CONTROL_STOP
(byte) CIA_TIMER_CONTROL_STOP#0
(dword) CLOCKS_PER_INIT
(dword) CLOCKS_PER_INIT#0
(word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16
(word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0
(byte) CORDIC_ITERATIONS_16
(byte) CORDIC_ITERATIONS_16#0
(byte*) D018
(byte*) D018#0
(byte[]) FONT_HEX_PROTO
(byte[]) FONT_HEX_PROTO#0
(byte*) SCREEN
(byte*) SCREEN#0
(const byte) SIZEOF_WORD = (byte) 2
(word()) atan2_16((signed word) atan2_16::x , (signed word) atan2_16::y)
(bool~) atan2_16::$0
(signed word~) atan2_16::$1
(bool~) atan2_16::$10
(bool~) atan2_16::$11
(number~) atan2_16::$12
(bool~) atan2_16::$13
(bool~) atan2_16::$14
(word~) atan2_16::$15
(number~) atan2_16::$16
(bool~) atan2_16::$17
(bool~) atan2_16::$18
(bool~) atan2_16::$19
(signed word~) atan2_16::$2
(bool~) atan2_16::$20
(bool~) atan2_16::$21
(bool~) atan2_16::$22
(byte~) atan2_16::$23
(byte~) atan2_16::$24
(bool~) atan2_16::$25
(signed word~) atan2_16::$3
(signed word~) atan2_16::$4
(bool~) atan2_16::$5
(signed word~) atan2_16::$6
(signed word~) atan2_16::$7
(signed word~) atan2_16::$8
(signed word~) atan2_16::$9
(label) atan2_16::@1
(label) atan2_16::@13
(label) atan2_16::@15
(label) atan2_16::@16
(label) atan2_16::@17
(label) atan2_16::@18
(label) atan2_16::@19
(label) atan2_16::@2
(label) atan2_16::@20
(label) atan2_16::@24
(label) atan2_16::@25
(label) atan2_16::@26
(label) atan2_16::@27
(label) atan2_16::@3
(label) atan2_16::@30
(label) atan2_16::@33
(label) atan2_16::@4
(label) atan2_16::@5
(label) atan2_16::@6
(label) atan2_16::@7
(label) atan2_16::@8
(label) atan2_16::@return
(word) atan2_16::angle
(word) atan2_16::angle#0
(word) atan2_16::angle#1
(word) atan2_16::angle#10
(word) atan2_16::angle#11
(word) atan2_16::angle#12
(word) atan2_16::angle#13
(word) atan2_16::angle#14
(word) atan2_16::angle#15
(word) atan2_16::angle#16
(word) atan2_16::angle#17
(word) atan2_16::angle#18
(word) atan2_16::angle#19
(word) atan2_16::angle#2
(word) atan2_16::angle#20
(word) atan2_16::angle#3
(word) atan2_16::angle#4
(word) atan2_16::angle#5
(word) atan2_16::angle#6
(word) atan2_16::angle#7
(word) atan2_16::angle#8
(word) atan2_16::angle#9
(byte) atan2_16::i
(byte) atan2_16::i#0
(byte) atan2_16::i#1
(byte) atan2_16::i#10
(byte) atan2_16::i#11
(byte) atan2_16::i#2
(byte) atan2_16::i#3
(byte) atan2_16::i#4
(byte) atan2_16::i#5
(byte) atan2_16::i#6
(byte) atan2_16::i#7
(byte) atan2_16::i#8
(byte) atan2_16::i#9
(word) atan2_16::return
(word) atan2_16::return#0
(word) atan2_16::return#1
(word) atan2_16::return#2
(word) atan2_16::return#3
(word) atan2_16::return#4
(byte) atan2_16::shift
(byte) atan2_16::shift#0
(byte) atan2_16::shift#1
(byte) atan2_16::shift#2
(byte) atan2_16::shift#3
(byte) atan2_16::shift#4
(signed word) atan2_16::x
(signed word) atan2_16::x#0
(signed word) atan2_16::x#1
(signed word) atan2_16::x#10
(signed word) atan2_16::x#11
(signed word) atan2_16::x#12
(signed word) atan2_16::x#13
(signed word) atan2_16::x#14
(signed word) atan2_16::x#15
(signed word) atan2_16::x#16
(signed word) atan2_16::x#17
(signed word) atan2_16::x#18
(signed word) atan2_16::x#2
(signed word) atan2_16::x#3
(signed word) atan2_16::x#4
(signed word) atan2_16::x#5
(signed word) atan2_16::x#6
(signed word) atan2_16::x#7
(signed word) atan2_16::x#8
(signed word) atan2_16::x#9
(signed word) atan2_16::xd
(signed word) atan2_16::xd#0
(signed word) atan2_16::xd#1
(signed word) atan2_16::xd#2
(signed word) atan2_16::xd#3
(signed word) atan2_16::xd#4
(signed word) atan2_16::xd#5
(signed word) atan2_16::xd#6
(signed word) atan2_16::xd#7
(signed word) atan2_16::xd#8
(signed word) atan2_16::xd#9
(signed word) atan2_16::xi
(signed word) atan2_16::xi#0
(signed word) atan2_16::xi#1
(signed word) atan2_16::xi#10
(signed word) atan2_16::xi#11
(signed word) atan2_16::xi#12
(signed word) atan2_16::xi#2
(signed word) atan2_16::xi#3
(signed word) atan2_16::xi#4
(signed word) atan2_16::xi#5
(signed word) atan2_16::xi#6
(signed word) atan2_16::xi#7
(signed word) atan2_16::xi#8
(signed word) atan2_16::xi#9
(signed word) atan2_16::y
(signed word) atan2_16::y#0
(signed word) atan2_16::y#1
(signed word) atan2_16::y#10
(signed word) atan2_16::y#11
(signed word) atan2_16::y#12
(signed word) atan2_16::y#13
(signed word) atan2_16::y#14
(signed word) atan2_16::y#15
(signed word) atan2_16::y#16
(signed word) atan2_16::y#17
(signed word) atan2_16::y#18
(signed word) atan2_16::y#19
(signed word) atan2_16::y#2
(signed word) atan2_16::y#20
(signed word) atan2_16::y#3
(signed word) atan2_16::y#4
(signed word) atan2_16::y#5
(signed word) atan2_16::y#6
(signed word) atan2_16::y#7
(signed word) atan2_16::y#8
(signed word) atan2_16::y#9
(signed word) atan2_16::yd
(signed word) atan2_16::yd#0
(signed word) atan2_16::yd#1
(signed word) atan2_16::yd#2
(signed word) atan2_16::yd#3
(signed word) atan2_16::yd#4
(signed word) atan2_16::yd#5
(signed word) atan2_16::yd#6
(signed word) atan2_16::yd#7
(signed word) atan2_16::yd#8
(signed word) atan2_16::yd#9
(signed word) atan2_16::yi
(signed word) atan2_16::yi#0
(signed word) atan2_16::yi#1
(signed word) atan2_16::yi#10
(signed word) atan2_16::yi#11
(signed word) atan2_16::yi#12
(signed word) atan2_16::yi#13
(signed word) atan2_16::yi#14
(signed word) atan2_16::yi#15
(signed word) atan2_16::yi#2
(signed word) atan2_16::yi#3
(signed word) atan2_16::yi#4
(signed word) atan2_16::yi#5
(signed word) atan2_16::yi#6
(signed word) atan2_16::yi#7
(signed word) atan2_16::yi#8
(signed word) atan2_16::yi#9
(dword()) clock()
(number~) clock::$0
(label) clock::@return
(dword) clock::return
(dword) clock::return#0
(dword) clock::return#1
(dword) clock::return#2
(dword) clock::return#3
(dword) clock::return#4
(void()) clock_start()
(byte~) clock_start::$0
(byte~) clock_start::$1
(byte~) clock_start::$2
(byte~) clock_start::$3
(byte~) clock_start::$4
(byte~) clock_start::$5
(byte~) clock_start::$6
(byte~) clock_start::$7
(label) clock_start::@return
(void()) init_angle_screen((byte*) init_angle_screen::screen)
(byte*~) init_angle_screen::$0
(byte*~) init_angle_screen::$1
(number~) init_angle_screen::$10
(number~) init_angle_screen::$11
(number~) init_angle_screen::$12
(number~) init_angle_screen::$13
(byte~) init_angle_screen::$14
(bool~) init_angle_screen::$15
(bool~) init_angle_screen::$16
(number~) init_angle_screen::$2
(number~) init_angle_screen::$3
(word~) init_angle_screen::$4
(signed word~) init_angle_screen::$5
(number~) init_angle_screen::$6
(word~) init_angle_screen::$7
(signed word~) init_angle_screen::$8
(word~) init_angle_screen::$9
(label) init_angle_screen::@1
(label) init_angle_screen::@2
(label) init_angle_screen::@3
(label) init_angle_screen::@5
(label) init_angle_screen::@return
(byte) init_angle_screen::ang_w
(byte) init_angle_screen::ang_w#0
(word) init_angle_screen::angle_w
(word) init_angle_screen::angle_w#0
(byte*) init_angle_screen::screen
(byte*) init_angle_screen::screen#0
(byte*) init_angle_screen::screen#1
(byte*) init_angle_screen::screen_bottomline
(byte*) init_angle_screen::screen_bottomline#0
(byte*) init_angle_screen::screen_bottomline#1
(byte*) init_angle_screen::screen_bottomline#2
(byte*) init_angle_screen::screen_bottomline#3
(byte*) init_angle_screen::screen_bottomline#4
(byte*) init_angle_screen::screen_bottomline#5
(byte*) init_angle_screen::screen_topline
(byte*) init_angle_screen::screen_topline#0
(byte*) init_angle_screen::screen_topline#1
(byte*) init_angle_screen::screen_topline#2
(byte*) init_angle_screen::screen_topline#3
(byte*) init_angle_screen::screen_topline#4
(byte*) init_angle_screen::screen_topline#5
(byte) init_angle_screen::x
(byte) init_angle_screen::x#0
(byte) init_angle_screen::x#1
(byte) init_angle_screen::x#2
(byte) init_angle_screen::x#3
(byte) init_angle_screen::xb
(byte) init_angle_screen::xb#0
(byte) init_angle_screen::xb#1
(byte) init_angle_screen::xb#2
(byte) init_angle_screen::xb#3
(signed word) init_angle_screen::xw
(signed word) init_angle_screen::xw#0
(byte) init_angle_screen::y
(byte) init_angle_screen::y#0
(byte) init_angle_screen::y#1
(byte) init_angle_screen::y#2
(byte) init_angle_screen::y#3
(byte) init_angle_screen::y#4
(byte) init_angle_screen::y#5
(signed word) init_angle_screen::yw
(signed word) init_angle_screen::yw#0
(void()) init_font_hex((byte*) init_font_hex::charset)
(byte~) init_font_hex::$0
(byte~) init_font_hex::$1
(byte~) init_font_hex::$2
(bool~) init_font_hex::$3
(bool~) init_font_hex::$4
(bool~) init_font_hex::$5
(label) init_font_hex::@1
(label) init_font_hex::@2
(label) init_font_hex::@3
(label) init_font_hex::@4
(label) init_font_hex::@5
(label) init_font_hex::@return
(byte) init_font_hex::c
(byte) init_font_hex::c#0
(byte) init_font_hex::c#1
(byte) init_font_hex::c#2
(byte) init_font_hex::c#3
(byte) init_font_hex::c#4
(byte) init_font_hex::c#5
(byte) init_font_hex::c#6
(byte) init_font_hex::c1
(byte) init_font_hex::c1#0
(byte) init_font_hex::c1#1
(byte) init_font_hex::c1#2
(byte) init_font_hex::c1#3
(byte) init_font_hex::c1#4
(byte*) init_font_hex::charset
(byte*) init_font_hex::charset#0
(byte*) init_font_hex::charset#1
(byte*) init_font_hex::charset#2
(byte*) init_font_hex::charset#3
(byte*) init_font_hex::charset#4
(byte*) init_font_hex::charset#5
(byte*) init_font_hex::charset#6
(byte*) init_font_hex::charset#7
(byte) init_font_hex::i
(byte) init_font_hex::i#0
(byte) init_font_hex::i#1
(byte) init_font_hex::i#2
(byte) init_font_hex::idx
(byte) init_font_hex::idx#0
(byte) init_font_hex::idx#1
(byte) init_font_hex::idx#2
(byte) init_font_hex::idx#3
(byte) init_font_hex::idx#4
(byte) init_font_hex::idx#5
(byte) init_font_hex::idx#6
(byte*) init_font_hex::proto_hi
(byte*) init_font_hex::proto_hi#0
(byte*) init_font_hex::proto_hi#1
(byte*) init_font_hex::proto_hi#2
(byte*) init_font_hex::proto_hi#3
(byte*) init_font_hex::proto_hi#4
(byte*) init_font_hex::proto_hi#5
(byte*) init_font_hex::proto_hi#6
(byte*) init_font_hex::proto_lo
(byte*) init_font_hex::proto_lo#0
(byte*) init_font_hex::proto_lo#1
(byte*) init_font_hex::proto_lo#2
(byte*) init_font_hex::proto_lo#3
(byte*) init_font_hex::proto_lo#4
(void()) main()
(byte~) main::$1
(dword~) main::$4
(dword~) main::$5
(byte~) main::$7
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@6
(label) main::@7
(label) main::@return
(byte*) main::BASE_CHARSET
(byte*) main::BASE_CHARSET#0
(byte*) main::BASE_SCREEN
(byte*) main::BASE_SCREEN#0
(dword) main::cyclecount
(dword) main::cyclecount#0
(label) main::toD0181
(word~) main::toD0181_$0
(word~) main::toD0181_$0#0
(number~) main::toD0181_$1
(number~) main::toD0181_$1#0
(number~) main::toD0181_$2
(number~) main::toD0181_$2#0
(number~) main::toD0181_$3
(number~) main::toD0181_$3#0
(word~) main::toD0181_$4
(word~) main::toD0181_$4#0
(byte~) main::toD0181_$5
(byte~) main::toD0181_$5#0
(number~) main::toD0181_$6
(number~) main::toD0181_$6#0
(number~) main::toD0181_$7
(number~) main::toD0181_$7#0
(number~) main::toD0181_$8
(number~) main::toD0181_$8#0
(label) main::toD0181_@return
(byte*) main::toD0181_gfx
(byte*) main::toD0181_gfx#0
(byte*) main::toD0181_gfx#1
(byte) main::toD0181_return
(byte) main::toD0181_return#0
(byte) main::toD0181_return#1
(byte) main::toD0181_return#2
(byte) main::toD0181_return#3
(byte*) main::toD0181_screen
(byte*) main::toD0181_screen#0
(byte*) main::toD0181_screen#1
(label) main::toD0182
(word~) main::toD0182_$0
(word~) main::toD0182_$0#0
(number~) main::toD0182_$1
(number~) main::toD0182_$1#0
(number~) main::toD0182_$2
(number~) main::toD0182_$2#0
(number~) main::toD0182_$3
(number~) main::toD0182_$3#0
(word~) main::toD0182_$4
(word~) main::toD0182_$4#0
(byte~) main::toD0182_$5
(byte~) main::toD0182_$5#0
(number~) main::toD0182_$6
(number~) main::toD0182_$6#0
(number~) main::toD0182_$7
(number~) main::toD0182_$7#0
(number~) main::toD0182_$8
(number~) main::toD0182_$8#0
(label) main::toD0182_@return
(byte*) main::toD0182_gfx
(byte*) main::toD0182_gfx#0
(byte*) main::toD0182_gfx#1
(byte) main::toD0182_return
(byte) main::toD0182_return#0
(byte) main::toD0182_return#1
(byte) main::toD0182_return#2
(byte) main::toD0182_return#3
(byte*) main::toD0182_screen
(byte*) main::toD0182_screen#0
(byte*) main::toD0182_screen#1
(void()) print_byte_at((byte) print_byte_at::b , (byte*) print_byte_at::at)
(byte~) print_byte_at::$0
(number~) print_byte_at::$2
(byte*~) print_byte_at::$3
(label) print_byte_at::@1
(label) print_byte_at::@2
(label) print_byte_at::@return
(byte*) print_byte_at::at
(byte*) print_byte_at::at#0
(byte*) print_byte_at::at#1
(byte*) print_byte_at::at#2
(byte*) print_byte_at::at#3
(byte) print_byte_at::b
(byte) print_byte_at::b#0
(byte) print_byte_at::b#1
(byte) print_byte_at::b#2
(byte) print_byte_at::b#3
(void()) print_char_at((byte) print_char_at::ch , (byte*) print_char_at::at)
(label) print_char_at::@return
(byte*) print_char_at::at
(byte*) print_char_at::at#0
(byte*) print_char_at::at#1
(byte*) print_char_at::at#2
(byte) print_char_at::ch
(byte) print_char_at::ch#0
(byte) print_char_at::ch#1
(byte) print_char_at::ch#2
(void()) print_dword_at((dword) print_dword_at::dw , (byte*) print_dword_at::at)
(word~) print_dword_at::$0
(word~) print_dword_at::$2
(byte*~) print_dword_at::$3
(label) print_dword_at::@1
(label) print_dword_at::@2
(label) print_dword_at::@return
(byte*) print_dword_at::at
(byte*) print_dword_at::at#0
(byte*) print_dword_at::at#1
(byte*) print_dword_at::at#2
(dword) print_dword_at::dw
(dword) print_dword_at::dw#0
(dword) print_dword_at::dw#1
(dword) print_dword_at::dw#2
(byte[]) print_hextab
(byte[]) print_hextab#0
(void()) print_word_at((word) print_word_at::w , (byte*) print_word_at::at)
(byte~) print_word_at::$0
(byte~) print_word_at::$2
(byte*~) print_word_at::$3
(label) print_word_at::@1
(label) print_word_at::@2
(label) print_word_at::@return
(byte*) print_word_at::at
(byte*) print_word_at::at#0
(byte*) print_word_at::at#1
(byte*) print_word_at::at#2
(byte*) print_word_at::at#3
(word) print_word_at::w
(word) print_word_at::w#0
(word) print_word_at::w#1
(word) print_word_at::w#2
(word) print_word_at::w#3
Fixing inline constructor with init_angle_screen::$17 ← (byte)init_angle_screen::$3 w= (byte)0
Fixing inline constructor with init_angle_screen::$18 ← (byte)init_angle_screen::$6 w= (byte)0
Successful SSA optimization Pass2FixInlineConstructorsNew
Adding number conversion cast (unumber) 0 in (byte) CIA_TIMER_CONTROL_STOP#0 ← (number) 0
Adding number conversion cast (unumber) 1 in (byte) CIA_TIMER_CONTROL_START#0 ← (number) 1
Adding number conversion cast (unumber) 0 in (byte) CIA_TIMER_CONTROL_CONTINUOUS#0 ← (number) 0
Adding number conversion cast (unumber) 0 in (byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES#0 ← (number) 0
Adding number conversion cast (unumber) $40 in (byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 ← (number) $40
Adding number conversion cast (unumber) 0 in (byte) init_font_hex::idx#0 ← (number) 0
Adding number conversion cast (unumber) 0 in *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#0) ← (number) 0
Adding number conversion cast (unumber) 4 in (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#2 + (byte) init_font_hex::i#2) << (number) 4
Adding number conversion cast (unumber) 1 in (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#2 + (byte) init_font_hex::i#2) << (number) 1
Adding number conversion cast (unumber) 0 in *((byte*) init_font_hex::charset#4 + (byte) init_font_hex::idx#6) ← (number) 0
Adding number conversion cast (unumber) 0 in *((byte*) init_font_hex::charset#4 + (byte) init_font_hex::idx#3) ← (number) 0
Adding number conversion cast (unumber) 5 in (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#3 + (number) 5
Adding number conversion cast (unumber) 8 in (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#4 + (number) 8
Adding number conversion cast (unumber) 5 in (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#3 + (number) 5
Adding number conversion cast (unumber) $f in (byte) CORDIC_ITERATIONS_16#0 ← (number) $f
Adding number conversion cast (snumber) 0 in (bool~) atan2_16::$0 ← (signed word) atan2_16::y#1 >= (number) 0
Adding number conversion cast (snumber) 0 in (bool~) atan2_16::$5 ← (signed word) atan2_16::x#1 >= (number) 0
Adding number conversion cast (unumber) 0 in (word) atan2_16::angle#0 ← (number) 0
Adding number conversion cast (unumber) 1 in (number~) atan2_16::$16 ← (byte) CORDIC_ITERATIONS_16#0 - (number) 1
Adding number conversion cast (unumber) atan2_16::$16 in (number~) atan2_16::$16 ← (byte) CORDIC_ITERATIONS_16#0 - (unumber)(number) 1
Adding number conversion cast (snumber) 0 in (bool~) atan2_16::$17 ← (signed word) atan2_16::yi#3 == (number) 0
Adding number conversion cast (unumber) 2 in (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 / (number) 2
Adding number conversion cast (snumber) 0 in (bool~) atan2_16::$10 ← (signed word) atan2_16::x#4 < (number) 0
Adding number conversion cast (unumber) 1 in (bool~) atan2_16::$19 ← (byte) atan2_16::shift#2 > (number) 1
Adding number conversion cast (snumber) 2 in (signed word) atan2_16::xd#1 ← (signed word) atan2_16::xd#3 >> (number) 2
Adding number conversion cast (snumber) 2 in (signed word) atan2_16::yd#1 ← (signed word) atan2_16::yd#3 >> (number) 2
Adding number conversion cast (unumber) 2 in (byte) atan2_16::shift#1 ← (byte) atan2_16::shift#3 - (number) 2
Adding number conversion cast (unumber) 0 in (bool~) atan2_16::$25 ← (number) 0 != (byte) atan2_16::shift#4
Adding number conversion cast (snumber) 0 in (bool~) atan2_16::$21 ← (signed word) atan2_16::yi#5 >= (number) 0
Adding number conversion cast (snumber) 1 in (signed word) atan2_16::xd#2 ← (signed word) atan2_16::xd#4 >> (number) 1
Adding number conversion cast (snumber) 1 in (signed word) atan2_16::yd#2 ← (signed word) atan2_16::yd#4 >> (number) 1
Adding number conversion cast (snumber) 0 in (bool~) atan2_16::$13 ← (signed word) atan2_16::y#4 < (number) 0
Adding number conversion cast (unumber) $8000 in (number~) atan2_16::$12 ← (number) $8000 - (word) atan2_16::angle#9
Adding number conversion cast (unumber) atan2_16::$12 in (number~) atan2_16::$12 ← (unumber)(number) $8000 - (word) atan2_16::angle#9
Adding number conversion cast (unumber) $12 in (dword) CLOCKS_PER_INIT#0 ← (number) $12
Adding number conversion cast (unumber) $ffffffff in (number~) clock::$0 ← (number) $ffffffff - *((dword*) CIA2_TIMER_AB#0)
Adding number conversion cast (unumber) clock::$0 in (number~) clock::$0 ← (unumber)(number) $ffffffff - *((dword*) CIA2_TIMER_AB#0)
Adding number conversion cast (unumber) $ffffffff in *((dword*) CIA2_TIMER_AB#0) ← (number) $ffffffff
Adding number conversion cast (unumber) 2 in (byte*~) print_word_at::$3 ← (byte*) print_word_at::at#3 + (number) 2
Adding number conversion cast (unumber) 4 in (byte*~) print_dword_at::$3 ← (byte*) print_dword_at::at#2 + (number) 4
Adding number conversion cast (unumber) 4 in (byte~) print_byte_at::$0 ← (byte) print_byte_at::b#2 >> (number) 4
Adding number conversion cast (unumber) $f in (number~) print_byte_at::$2 ← (byte) print_byte_at::b#3 & (number) $f
Adding number conversion cast (unumber) print_byte_at::$2 in (number~) print_byte_at::$2 ← (byte) print_byte_at::b#3 & (unumber)(number) $f
Adding number conversion cast (unumber) 1 in (byte*~) print_byte_at::$3 ← (byte*) print_byte_at::at#3 + (number) 1
Adding number conversion cast (unumber) $3fff in (number~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (number) $3fff
Adding number conversion cast (unumber) main::toD0181_$1#0 in (number~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (unumber)(number) $3fff
Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$2#0 ← (unumber~) main::toD0181_$1#0 * (number) 4
Adding number conversion cast (unumber) main::toD0181_$2#0 in (number~) main::toD0181_$2#0 ← (unumber~) main::toD0181_$1#0 * (unumber)(number) 4
Adding number conversion cast (unumber) main::toD0181_$3#0 in (number~) main::toD0181_$3#0 ← > (unumber~) main::toD0181_$2#0
Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$6#0 ← (byte~) main::toD0181_$5#0 / (number) 4
Adding number conversion cast (unumber) main::toD0181_$6#0 in (number~) main::toD0181_$6#0 ← (byte~) main::toD0181_$5#0 / (unumber)(number) 4
Adding number conversion cast (unumber) $f in (number~) main::toD0181_$7#0 ← (unumber~) main::toD0181_$6#0 & (number) $f
Adding number conversion cast (unumber) main::toD0181_$7#0 in (number~) main::toD0181_$7#0 ← (unumber~) main::toD0181_$6#0 & (unumber)(number) $f
Adding number conversion cast (unumber) main::toD0181_$8#0 in (number~) main::toD0181_$8#0 ← (unumber~) main::toD0181_$3#0 | (unumber~) main::toD0181_$7#0
Adding number conversion cast (unumber) $3fff in (number~) main::toD0182_$1#0 ← (word~) main::toD0182_$0#0 & (number) $3fff
Adding number conversion cast (unumber) main::toD0182_$1#0 in (number~) main::toD0182_$1#0 ← (word~) main::toD0182_$0#0 & (unumber)(number) $3fff
Adding number conversion cast (unumber) 4 in (number~) main::toD0182_$2#0 ← (unumber~) main::toD0182_$1#0 * (number) 4
Adding number conversion cast (unumber) main::toD0182_$2#0 in (number~) main::toD0182_$2#0 ← (unumber~) main::toD0182_$1#0 * (unumber)(number) 4
Adding number conversion cast (unumber) main::toD0182_$3#0 in (number~) main::toD0182_$3#0 ← > (unumber~) main::toD0182_$2#0
Adding number conversion cast (unumber) 4 in (number~) main::toD0182_$6#0 ← (byte~) main::toD0182_$5#0 / (number) 4
Adding number conversion cast (unumber) main::toD0182_$6#0 in (number~) main::toD0182_$6#0 ← (byte~) main::toD0182_$5#0 / (unumber)(number) 4
Adding number conversion cast (unumber) $f in (number~) main::toD0182_$7#0 ← (unumber~) main::toD0182_$6#0 & (number) $f
Adding number conversion cast (unumber) main::toD0182_$7#0 in (number~) main::toD0182_$7#0 ← (unumber~) main::toD0182_$6#0 & (unumber)(number) $f
Adding number conversion cast (unumber) main::toD0182_$8#0 in (number~) main::toD0182_$8#0 ← (unumber~) main::toD0182_$3#0 | (unumber~) main::toD0182_$7#0
Adding number conversion cast (unumber) $28*$c in (byte*~) init_angle_screen::$0 ← (byte*) init_angle_screen::screen#1 + (number) $28*(number) $c
Adding number conversion cast (unumber) $28*$c in (byte*~) init_angle_screen::$1 ← (byte*) init_angle_screen::screen#1 + (number) $28*(number) $c
Adding number conversion cast (unumber) 0 in (byte) init_angle_screen::x#0 ← (number) 0
Adding number conversion cast (unumber) $27 in (byte) init_angle_screen::xb#0 ← (number) $27
Adding number conversion cast (unumber) 2 in (number~) init_angle_screen::$2 ← (byte) init_angle_screen::x#2 * (number) 2
Adding number conversion cast (unumber) init_angle_screen::$2 in (number~) init_angle_screen::$2 ← (byte) init_angle_screen::x#2 * (unumber)(number) 2
Adding number conversion cast (unumber) $27 in (number~) init_angle_screen::$3 ← (number) $27 - (unumber~) init_angle_screen::$2
Adding number conversion cast (unumber) init_angle_screen::$3 in (number~) init_angle_screen::$3 ← (unumber)(number) $27 - (unumber~) init_angle_screen::$2
Adding number conversion cast (unumber) 2 in (number~) init_angle_screen::$6 ← (byte) init_angle_screen::y#2 * (number) 2
Adding number conversion cast (unumber) init_angle_screen::$6 in (number~) init_angle_screen::$6 ← (byte) init_angle_screen::y#2 * (unumber)(number) 2
Adding number conversion cast (unumber) $80 in (number~) init_angle_screen::$10 ← (word) init_angle_screen::angle_w#0 + (number) $80
Adding number conversion cast (unumber) init_angle_screen::$10 in (number~) init_angle_screen::$10 ← (word) init_angle_screen::angle_w#0 + (unumber)(number) $80
Adding number conversion cast (unumber) init_angle_screen::$11 in (number~) init_angle_screen::$11 ← > (unumber~) init_angle_screen::$10
Adding number conversion cast (unumber) $80 in (number~) init_angle_screen::$12 ← (number) $80 + (byte) init_angle_screen::ang_w#0
Adding number conversion cast (unumber) init_angle_screen::$12 in (number~) init_angle_screen::$12 ← (unumber)(number) $80 + (byte) init_angle_screen::ang_w#0
Adding number conversion cast (unumber) $80 in (number~) init_angle_screen::$13 ← (number) $80 - (byte) init_angle_screen::ang_w#0
Adding number conversion cast (unumber) init_angle_screen::$13 in (number~) init_angle_screen::$13 ← (unumber)(number) $80 - (byte) init_angle_screen::ang_w#0
Adding number conversion cast (unumber) $13 in (bool~) init_angle_screen::$15 ← (byte) init_angle_screen::x#1 <= (number) $13
Adding number conversion cast (unumber) $28 in (byte*) init_angle_screen::screen_topline#1 ← (byte*) init_angle_screen::screen_topline#3 - (number) $28
Adding number conversion cast (unumber) $28 in (byte*) init_angle_screen::screen_bottomline#1 ← (byte*) init_angle_screen::screen_bottomline#3 + (number) $28
Successful SSA optimization PassNAddNumberTypeConversions
Adding number conversion cast (byte) to elements in (byte[]) FONT_HEX_PROTO#0 ← { (byte)(number) 2, (byte)(number) 5, (byte)(number) 5, (byte)(number) 5, (byte)(number) 2, (byte)(number) 6, (byte)(number) 2, (byte)(number) 2, (byte)(number) 2, (byte)(number) 7, (byte)(number) 6, (byte)(number) 1, (byte)(number) 2, (byte)(number) 4, (byte)(number) 7, (byte)(number) 6, (byte)(number) 1, (byte)(number) 2, (byte)(number) 1, (byte)(number) 6, (byte)(number) 5, (byte)(number) 5, (byte)(number) 7, (byte)(number) 1, (byte)(number) 1, (byte)(number) 7, (byte)(number) 4, (byte)(number) 6, (byte)(number) 1, (byte)(number) 6, (byte)(number) 3, (byte)(number) 4, (byte)(number) 6, (byte)(number) 5, (byte)(number) 2, (byte)(number) 7, (byte)(number) 1, (byte)(number) 1, (byte)(number) 1, (byte)(number) 1, (byte)(number) 2, (byte)(number) 5, (byte)(number) 2, (byte)(number) 5, (byte)(number) 2, (byte)(number) 2, (byte)(number) 5, (byte)(number) 3, (byte)(number) 1, (byte)(number) 1, (byte)(number) 2, (byte)(number) 5, (byte)(number) 7, (byte)(number) 5, (byte)(number) 5, (byte)(number) 6, (byte)(number) 5, (byte)(number) 6, (byte)(number) 5, (byte)(number) 6, (byte)(number) 2, (byte)(number) 5, (byte)(number) 4, (byte)(number) 5, (byte)(number) 2, (byte)(number) 6, (byte)(number) 5, (byte)(number) 5, (byte)(number) 5, (byte)(number) 6, (byte)(number) 7, (byte)(number) 4, (byte)(number) 6, (byte)(number) 4, (byte)(number) 7, (byte)(number) 7, (byte)(number) 4, (byte)(number) 6, (byte)(number) 4, (byte)(number) 4 }
Successful SSA optimization PassNAddArrayNumberTypeConversions
Inlining cast (byte*) D018#0 ← (byte*)(number) $d018
Inlining cast (dword*) CIA2_TIMER_AB#0 ← (dword*)(number) $dd04
Inlining cast (byte*) CIA2_TIMER_A_CONTROL#0 ← (byte*)(number) $dd0e
Inlining cast (byte*) CIA2_TIMER_B_CONTROL#0 ← (byte*)(number) $dd0f
Inlining cast (byte) CIA_TIMER_CONTROL_STOP#0 ← (unumber)(number) 0
Inlining cast (byte) CIA_TIMER_CONTROL_START#0 ← (unumber)(number) 1
Inlining cast (byte) CIA_TIMER_CONTROL_CONTINUOUS#0 ← (unumber)(number) 0
Inlining cast (byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES#0 ← (unumber)(number) 0
Inlining cast (byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 ← (unumber)(number) $40
Inlining cast (byte) init_font_hex::idx#0 ← (unumber)(number) 0
Inlining cast *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#0) ← (unumber)(number) 0
Inlining cast *((byte*) init_font_hex::charset#4 + (byte) init_font_hex::idx#6) ← (unumber)(number) 0
Inlining cast *((byte*) init_font_hex::charset#4 + (byte) init_font_hex::idx#3) ← (unumber)(number) 0
Inlining cast (byte) CORDIC_ITERATIONS_16#0 ← (unumber)(number) $f
Inlining cast (word) atan2_16::angle#0 ← (unumber)(number) 0
Inlining cast (dword) CLOCKS_PER_INIT#0 ← (unumber)(number) $12
Inlining cast *((dword*) CIA2_TIMER_AB#0) ← (unumber)(number) $ffffffff
Inlining cast (byte*) CHARSET#0 ← (byte*)(number) $2000
Inlining cast (byte*) SCREEN#0 ← (byte*)(number) $2800
Inlining cast (word~) main::toD0181_$0#0 ← (word)(byte*) main::toD0181_screen#1
Inlining cast (word~) main::toD0181_$4#0 ← (word)(byte*) main::toD0181_gfx#1
Inlining cast (byte*) main::BASE_SCREEN#0 ← (byte*)(number) $400
Inlining cast (byte*) main::BASE_CHARSET#0 ← (byte*)(number) $1000
Inlining cast (word~) main::toD0182_$0#0 ← (word)(byte*) main::toD0182_screen#1
Inlining cast (word~) main::toD0182_$4#0 ← (word)(byte*) main::toD0182_gfx#1
Inlining cast (byte) init_angle_screen::x#0 ← (unumber)(number) 0
Inlining cast (byte) init_angle_screen::xb#0 ← (unumber)(number) $27
Inlining cast (signed word~) init_angle_screen::$5 ← (signed word)(word~) init_angle_screen::$4
Inlining cast (signed word~) init_angle_screen::$8 ← (signed word)(word~) init_angle_screen::$7
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (dword*) 56580
Simplifying constant pointer cast (byte*) 56590
Simplifying constant pointer cast (byte*) 56591
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast $40
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 4
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 5
Simplifying constant integer cast 8
Simplifying constant integer cast 5
Simplifying constant integer cast 2
Simplifying constant integer cast 5
Simplifying constant integer cast 5
Simplifying constant integer cast 5
Simplifying constant integer cast 2
Simplifying constant integer cast 6
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Simplifying constant integer cast 7
Simplifying constant integer cast 6
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 4
Simplifying constant integer cast 7
Simplifying constant integer cast 6
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 1
Simplifying constant integer cast 6
Simplifying constant integer cast 5
Simplifying constant integer cast 5
Simplifying constant integer cast 7
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast 7
Simplifying constant integer cast 4
Simplifying constant integer cast 6
Simplifying constant integer cast 1
Simplifying constant integer cast 6
Simplifying constant integer cast 3
Simplifying constant integer cast 4
Simplifying constant integer cast 6
Simplifying constant integer cast 5
Simplifying constant integer cast 2
Simplifying constant integer cast 7
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 5
Simplifying constant integer cast 2
Simplifying constant integer cast 5
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Simplifying constant integer cast 5
Simplifying constant integer cast 3
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 5
Simplifying constant integer cast 7
Simplifying constant integer cast 5
Simplifying constant integer cast 5
Simplifying constant integer cast 6
Simplifying constant integer cast 5
Simplifying constant integer cast 6
Simplifying constant integer cast 5
Simplifying constant integer cast 6
Simplifying constant integer cast 2
Simplifying constant integer cast 5
Simplifying constant integer cast 4
Simplifying constant integer cast 5
Simplifying constant integer cast 2
Simplifying constant integer cast 6
Simplifying constant integer cast 5
Simplifying constant integer cast 5
Simplifying constant integer cast 5
Simplifying constant integer cast 6
Simplifying constant integer cast 7
Simplifying constant integer cast 4
Simplifying constant integer cast 6
Simplifying constant integer cast 4
Simplifying constant integer cast 7
Simplifying constant integer cast 7
Simplifying constant integer cast 4
Simplifying constant integer cast 6
Simplifying constant integer cast 4
Simplifying constant integer cast 4
Simplifying constant integer cast $f
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 2
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Simplifying constant integer cast 2
Simplifying constant integer cast 0
Simplifying constant integer cast 0
Simplifying constant integer cast 1
Simplifying constant integer cast 1
Simplifying constant integer cast 0
Simplifying constant integer cast $8000
Simplifying constant integer cast $12
Simplifying constant integer cast $ffffffff
Simplifying constant integer cast $ffffffff
Simplifying constant integer cast 2
Simplifying constant integer cast 4
Simplifying constant integer cast 4
Simplifying constant integer cast $f
Simplifying constant integer cast 1
Simplifying constant pointer cast (byte*) 8192
Simplifying constant pointer cast (byte*) 10240
Simplifying constant integer cast $3fff
Simplifying constant integer cast 4
Simplifying constant integer cast 4
Simplifying constant integer cast $f
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 4096
Simplifying constant integer cast $3fff
Simplifying constant integer cast 4
Simplifying constant integer cast 4
Simplifying constant integer cast $f
Simplifying constant integer cast 0
Simplifying constant integer cast $27
Simplifying constant integer cast 2
Simplifying constant integer cast $27
Simplifying constant integer cast 0
Simplifying constant integer cast 2
Simplifying constant integer cast 0
Simplifying constant integer cast $80
Simplifying constant integer cast $80
Simplifying constant integer cast $80
Simplifying constant integer cast $13
Simplifying constant integer cast $28
Simplifying constant integer cast $28
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $40
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 1
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) 5
Finalized unsigned number type (byte) 8
Finalized unsigned number type (byte) 5
Finalized unsigned number type (byte) $f
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 unsigned number type (byte) 2
Finalized signed number type (signed byte) 0
Finalized unsigned number type (byte) 1
Finalized signed number type (signed byte) 2
Finalized signed number type (signed byte) 2
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 0
Finalized signed number type (signed byte) 0
Finalized signed number type (signed byte) 1
Finalized signed number type (signed byte) 1
Finalized signed number type (signed byte) 0
Finalized unsigned number type (word) $8000
Finalized unsigned number type (byte) $12
Finalized unsigned number type (dword) $ffffffff
Finalized unsigned number type (dword) $ffffffff
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) $f
Finalized unsigned number type (byte) 1
Finalized unsigned number type (word) $3fff
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) $f
Finalized unsigned number type (word) $3fff
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) 4
Finalized unsigned number type (byte) $f
Finalized unsigned number type (byte) 0
Finalized unsigned number type (byte) $27
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) $27
Finalized unsigned number type (byte) 2
Finalized unsigned number type (byte) $80
Finalized unsigned number type (byte) $80
Finalized unsigned number type (byte) $80
Finalized unsigned number type (byte) $13
Finalized unsigned number type (byte) $28
Finalized unsigned number type (byte) $28
Successful SSA optimization PassNFinalizeNumberTypeConversions
Inferred type updated to byte in (unumber~) atan2_16::$16 ← (byte) CORDIC_ITERATIONS_16#0 - (byte) 1
Inferred type updated to word in (unumber~) atan2_16::$12 ← (word) $8000 - (word) atan2_16::angle#9
Inferred type updated to dword in (unumber~) clock::$0 ← (dword) $ffffffff - *((dword*) CIA2_TIMER_AB#0)
Inferred type updated to byte in (unumber~) print_byte_at::$2 ← (byte) print_byte_at::b#3 & (byte) $f
Inferred type updated to word in (unumber~) main::toD0181_$1#0 ← (word~) main::toD0181_$0#0 & (word) $3fff
Inferred type updated to word in (unumber~) main::toD0181_$2#0 ← (word~) main::toD0181_$1#0 * (byte) 4
Inferred type updated to byte in (unumber~) main::toD0181_$3#0 ← > (word~) main::toD0181_$2#0
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
Inferred type updated to word in (unumber~) main::toD0182_$1#0 ← (word~) main::toD0182_$0#0 & (word) $3fff
Inferred type updated to word in (unumber~) main::toD0182_$2#0 ← (word~) main::toD0182_$1#0 * (byte) 4
Inferred type updated to byte in (unumber~) main::toD0182_$3#0 ← > (word~) main::toD0182_$2#0
Inferred type updated to byte in (unumber~) main::toD0182_$6#0 ← (byte~) main::toD0182_$5#0 / (byte) 4
Inferred type updated to byte in (unumber~) main::toD0182_$7#0 ← (byte~) main::toD0182_$6#0 & (byte) $f
Inferred type updated to byte in (unumber~) main::toD0182_$8#0 ← (byte~) main::toD0182_$3#0 | (byte~) main::toD0182_$7#0
Inferred type updated to byte in (unumber~) init_angle_screen::$2 ← (byte) init_angle_screen::x#2 * (byte) 2
Inferred type updated to byte in (unumber~) init_angle_screen::$3 ← (byte) $27 - (byte~) init_angle_screen::$2
Inferred type updated to byte in (unumber~) init_angle_screen::$6 ← (byte) init_angle_screen::y#2 * (byte) 2
Inferred type updated to word in (unumber~) init_angle_screen::$10 ← (word) init_angle_screen::angle_w#0 + (byte) $80
Inferred type updated to byte in (unumber~) init_angle_screen::$11 ← > (word~) init_angle_screen::$10
Inferred type updated to byte in (unumber~) init_angle_screen::$12 ← (byte) $80 + (byte) init_angle_screen::ang_w#0
Inferred type updated to byte in (unumber~) init_angle_screen::$13 ← (byte) $80 - (byte) init_angle_screen::ang_w#0
Inversing boolean not [72] (bool~) atan2_16::$18 ← (signed word) atan2_16::yi#3 != (signed byte) 0 from [71] (bool~) atan2_16::$17 ← (signed word) atan2_16::yi#3 == (signed byte) 0
Inversing boolean not [81] (bool~) atan2_16::$11 ← (signed word) atan2_16::x#4 >= (signed byte) 0 from [80] (bool~) atan2_16::$10 ← (signed word) atan2_16::x#4 < (signed byte) 0
Inversing boolean not [92] (bool~) atan2_16::$20 ← (byte) 0 == (byte) atan2_16::shift#4 from [91] (bool~) atan2_16::$25 ← (byte) 0 != (byte) atan2_16::shift#4
Inversing boolean not [116] (bool~) atan2_16::$14 ← (signed word) atan2_16::y#4 >= (signed byte) 0 from [115] (bool~) atan2_16::$13 ← (signed word) atan2_16::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
Alias (byte*) init_font_hex::proto_lo#2 = (byte*) init_font_hex::proto_lo#3
Alias (byte) init_font_hex::c1#2 = (byte) init_font_hex::c1#3
Alias (byte*) init_font_hex::proto_hi#2 = (byte*) init_font_hex::proto_hi#5 (byte*) init_font_hex::proto_hi#3
Alias (byte) init_font_hex::c#2 = (byte) init_font_hex::c#3 (byte) init_font_hex::c#4
Alias (byte*) init_font_hex::charset#0 = (byte*) init_font_hex::charset#7
Alias (signed word) atan2_16::y#1 = (signed word) atan2_16::y#2 (signed word~) atan2_16::$3 (signed word) atan2_16::y#3
Alias (signed word) atan2_16::x#5 = (signed word) atan2_16::x#9 (signed word) atan2_16::x#6
Alias (signed word~) atan2_16::$2 = (signed word~) atan2_16::$1
Alias (signed word) atan2_16::yi#0 = (signed word~) atan2_16::$4 (signed word) atan2_16::yi#12 (signed word) atan2_16::yi#13
Alias (signed word) atan2_16::x#1 = (signed word) atan2_16::x#2 (signed word~) atan2_16::$8 (signed word) atan2_16::x#3
Alias (signed word) atan2_16::y#12 = (signed word) atan2_16::y#15 (signed word) atan2_16::y#13
Alias (signed word~) atan2_16::$7 = (signed word~) atan2_16::$6
Alias (signed word) atan2_16::xi#0 = (signed word~) atan2_16::$9
Alias (signed word) atan2_16::xi#3 = (signed word) atan2_16::xi#6 (signed word) atan2_16::xd#0
Alias (signed word) atan2_16::yi#3 = (signed word) atan2_16::yi#4 (signed word) atan2_16::yd#0
Alias (byte) atan2_16::i#2 = (byte) atan2_16::i#6 (byte) atan2_16::shift#0
Alias (word) atan2_16::angle#12 = (word) atan2_16::angle#19
Alias (signed word) atan2_16::x#17 = (signed word) atan2_16::x#7
Alias (signed word) atan2_16::y#19 = (signed word) atan2_16::y#7
Alias (signed word) atan2_16::xd#3 = (signed word) atan2_16::xd#7 (signed word) atan2_16::xd#8 (signed word) atan2_16::xd#4
Alias (signed word) atan2_16::yd#3 = (signed word) atan2_16::yd#7 (signed word) atan2_16::yd#8 (signed word) atan2_16::yd#4
Alias (byte) atan2_16::shift#2 = (byte) atan2_16::shift#3 (byte) atan2_16::shift#4
Alias (signed word) atan2_16::yi#10 = (signed word) atan2_16::yi#15 (signed word) atan2_16::yi#14 (signed word) atan2_16::yi#11
Alias (signed word) atan2_16::xi#10 = (signed word) atan2_16::xi#12 (signed word) atan2_16::xi#11 (signed word) atan2_16::xi#9
Alias (byte) atan2_16::i#10 = (byte) atan2_16::i#11 (byte) atan2_16::i#8 (byte) atan2_16::i#9
Alias (word) atan2_16::angle#16 = (word) atan2_16::angle#20 (word) atan2_16::angle#18 (word) atan2_16::angle#17
Alias (signed word) atan2_16::x#14 = (signed word) atan2_16::x#18 (signed word) atan2_16::x#16 (signed word) atan2_16::x#15
Alias (signed word) atan2_16::y#16 = (signed word) atan2_16::y#20 (signed word) atan2_16::y#18 (signed word) atan2_16::y#17
Alias (signed word) atan2_16::xi#4 = (signed word) atan2_16::xi#7 (signed word) atan2_16::xi#5
Alias (signed word) atan2_16::yd#5 = (signed word) atan2_16::yd#9 (signed word) atan2_16::yd#6
Alias (signed word) atan2_16::yi#5 = (signed word) atan2_16::yi#6 (signed word) atan2_16::yi#7
Alias (signed word) atan2_16::xd#5 = (signed word) atan2_16::xd#9 (signed word) atan2_16::xd#6
Alias (byte) atan2_16::i#3 = (byte) atan2_16::i#7 (byte) atan2_16::i#4
Alias (word) atan2_16::angle#14 = (word) atan2_16::angle#7 (word) atan2_16::angle#8
Alias (signed word) atan2_16::x#11 = (signed word) atan2_16::x#13 (signed word) atan2_16::x#12
Alias (signed word) atan2_16::y#10 = (signed word) atan2_16::y#14 (signed word) atan2_16::y#11
Alias (word) atan2_16::angle#1 = (word) atan2_16::angle#9
Alias (signed word) atan2_16::y#5 = (signed word) atan2_16::y#6
Alias (word) atan2_16::angle#4 = (word~) atan2_16::$12
Alias (word) atan2_16::return#0 = (word) atan2_16::angle#10 (word) atan2_16::return#3 (word) atan2_16::return#1
Alias (word) atan2_16::angle#11 = (word) atan2_16::angle#15
Alias (word) atan2_16::angle#5 = (word~) atan2_16::$15
Alias (dword) clock::return#0 = (dword~) clock::$0 (dword) clock::return#3 (dword) clock::return#1
Alias (byte) print_byte_at::b#0 = (byte~) print_word_at::$0
Alias (word) print_word_at::w#2 = (word) print_word_at::w#3
Alias (byte*) print_word_at::at#2 = (byte*) print_word_at::at#3
Alias (byte) print_byte_at::b#1 = (byte~) print_word_at::$2
Alias (byte*) print_byte_at::at#1 = (byte*~) print_word_at::$3
Alias (word) print_word_at::w#0 = (word~) print_dword_at::$0
Alias (dword) print_dword_at::dw#1 = (dword) print_dword_at::dw#2
Alias (byte*) print_dword_at::at#1 = (byte*) print_dword_at::at#2
Alias (word) print_word_at::w#1 = (word~) print_dword_at::$2
Alias (byte*) print_word_at::at#1 = (byte*~) print_dword_at::$3
Alias (byte) print_byte_at::b#2 = (byte) print_byte_at::b#3
Alias (byte*) print_byte_at::at#2 = (byte*) print_byte_at::at#3
Alias (byte*) print_char_at::at#1 = (byte*~) print_byte_at::$3
Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1
Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1
Alias (byte) main::toD0181_return#0 = (byte~) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$1
Alias (dword) clock::return#2 = (dword) clock::return#4
Alias (dword) main::cyclecount#0 = (dword~) main::$5
Alias (byte*) main::BASE_SCREEN#0 = (byte*) main::toD0182_screen#0 (byte*) main::toD0182_screen#1
Alias (byte*) main::BASE_CHARSET#0 = (byte*) main::toD0182_gfx#0 (byte*) main::toD0182_gfx#1
Alias (byte) main::toD0182_return#0 = (byte~) main::toD0182_$8#0 (byte) main::toD0182_return#2 (byte) main::toD0182_return#1 (byte) main::toD0182_return#3 (byte~) main::$7
Alias (byte*) init_angle_screen::screen_topline#0 = (byte*~) init_angle_screen::$0
Alias (byte*) init_angle_screen::screen_bottomline#0 = (byte*~) init_angle_screen::$1
Alias (word~) init_angle_screen::$4 = (word~) init_angle_screen::$17
Alias (signed word) init_angle_screen::xw#0 = (signed word~) init_angle_screen::$5
Alias (word~) init_angle_screen::$7 = (word~) init_angle_screen::$18
Alias (signed word) init_angle_screen::yw#0 = (signed word~) init_angle_screen::$8
Alias (word) atan2_16::return#2 = (word) atan2_16::return#4
Alias (byte*) init_angle_screen::screen_topline#2 = (byte*) init_angle_screen::screen_topline#4 (byte*) init_angle_screen::screen_topline#3
Alias (byte) init_angle_screen::x#2 = (byte) init_angle_screen::x#3
Alias (byte*) init_angle_screen::screen_bottomline#2 = (byte*) init_angle_screen::screen_bottomline#4 (byte*) init_angle_screen::screen_bottomline#3
Alias (byte) init_angle_screen::xb#2 = (byte) init_angle_screen::xb#3
Alias (byte) init_angle_screen::y#2 = (byte) init_angle_screen::y#5 (byte) init_angle_screen::y#3
Alias (word) init_angle_screen::angle_w#0 = (word~) init_angle_screen::$9
Alias (byte) init_angle_screen::ang_w#0 = (byte~) init_angle_screen::$11
Successful SSA optimization Pass2AliasElimination
Alias (signed word) atan2_16::x#1 = (signed word) atan2_16::x#5 (signed word) atan2_16::x#10
Alias (signed word) atan2_16::y#1 = (signed word) atan2_16::y#12 (signed word) atan2_16::y#9
Alias (signed word) atan2_16::yi#0 = (signed word) atan2_16::yi#9
Alias (signed word) atan2_16::yi#10 = (signed word) atan2_16::yi#5
Alias (signed word) atan2_16::xi#10 = (signed word) atan2_16::xi#4
Alias (byte) atan2_16::i#10 = (byte) atan2_16::i#3 (byte) atan2_16::i#5
Alias (word) atan2_16::angle#14 = (word) atan2_16::angle#16
Alias (signed word) atan2_16::x#11 = (signed word) atan2_16::x#14 (signed word) atan2_16::x#8
Alias (signed word) atan2_16::y#10 = (signed word) atan2_16::y#16 (signed word) atan2_16::y#8
Alias (signed word) atan2_16::y#4 = (signed word) atan2_16::y#5
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte*) init_font_hex::proto_hi#2
Self Phi Eliminated (byte*) init_font_hex::proto_lo#2
Self Phi Eliminated (byte*) init_font_hex::charset#3
Self Phi Eliminated (byte) init_font_hex::c1#2
Self Phi Eliminated (byte) init_font_hex::c#2
Self Phi Eliminated (signed word) atan2_16::yi#10
Self Phi Eliminated (signed word) atan2_16::xi#10
Self Phi Eliminated (byte) atan2_16::i#10
Self Phi Eliminated (word) atan2_16::angle#14
Self Phi Eliminated (signed word) atan2_16::x#11
Self Phi Eliminated (signed word) atan2_16::y#10
Self Phi Eliminated (byte) init_angle_screen::y#2
Self Phi Eliminated (byte*) init_angle_screen::screen_topline#2
Self Phi Eliminated (byte*) init_angle_screen::screen_bottomline#2
Successful SSA optimization Pass2SelfPhiElimination
Identical Phi Values (byte*) init_font_hex::charset#6 (byte*) init_font_hex::charset#1
Identical Phi Values (byte*) init_font_hex::proto_hi#2 (byte*) init_font_hex::proto_hi#4
Identical Phi Values (byte*) init_font_hex::proto_lo#2 (byte*) init_font_hex::proto_lo#4
Identical Phi Values (byte*) init_font_hex::charset#3 (byte*) init_font_hex::charset#2
Identical Phi Values (byte) init_font_hex::c1#2 (byte) init_font_hex::c1#4
Identical Phi Values (byte) init_font_hex::c#2 (byte) init_font_hex::c#5
Identical Phi Values (signed word) atan2_16::y#1 (signed word) atan2_16::y#0
Identical Phi Values (signed word) atan2_16::x#1 (signed word) atan2_16::x#0
Identical Phi Values (signed word) atan2_16::yi#10 (signed word) atan2_16::yi#3
Identical Phi Values (signed word) atan2_16::xi#10 (signed word) atan2_16::xi#3
Identical Phi Values (byte) atan2_16::i#10 (byte) atan2_16::i#2
Identical Phi Values (word) atan2_16::angle#14 (word) atan2_16::angle#12
Identical Phi Values (signed word) atan2_16::x#11 (signed word) atan2_16::x#17
Identical Phi Values (signed word) atan2_16::y#10 (signed word) atan2_16::y#19
Identical Phi Values (dword) print_dword_at::dw#1 (dword) print_dword_at::dw#0
Identical Phi Values (byte*) print_dword_at::at#1 (byte*) print_dword_at::at#0
Identical Phi Values (byte*) init_angle_screen::screen#1 (byte*) init_angle_screen::screen#0
Identical Phi Values (byte) init_angle_screen::y#2 (byte) init_angle_screen::y#4
Identical Phi Values (byte*) init_angle_screen::screen_topline#2 (byte*) init_angle_screen::screen_topline#5
Identical Phi Values (byte*) init_angle_screen::screen_bottomline#2 (byte*) init_angle_screen::screen_bottomline#5
Successful SSA optimization Pass2IdenticalPhiElimination
Identical Phi Values (signed word) atan2_16::x#4 (signed word) atan2_16::x#17
Identical Phi Values (signed word) atan2_16::y#4 (signed word) atan2_16::y#19
Successful SSA optimization Pass2IdenticalPhiElimination
Identified duplicate assignment right side [138] (byte~) clock_start::$2 ← (byte) CIA_TIMER_CONTROL_STOP#0 | (byte) CIA_TIMER_CONTROL_CONTINUOUS#0
Identified duplicate assignment right side [145] (byte~) clock_start::$6 ← (byte) CIA_TIMER_CONTROL_START#0 | (byte) CIA_TIMER_CONTROL_CONTINUOUS#0
Successful SSA optimization Pass2DuplicateRValueIdentification
Simple Condition (bool~) init_font_hex::$3 [28] if((byte) init_font_hex::i#1!=rangelast(0,4)) goto init_font_hex::@3
Simple Condition (bool~) init_font_hex::$4 [38] if((byte) init_font_hex::c1#1!=rangelast(0,$f)) goto init_font_hex::@2
Simple Condition (bool~) init_font_hex::$5 [43] if((byte) init_font_hex::c#1!=rangelast(0,$f)) goto init_font_hex::@1
Simple Condition (bool~) atan2_16::$0 [50] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1
Simple Condition (bool~) atan2_16::$5 [59] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4
Simple Condition (bool~) atan2_16::$18 [73] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@16
Simple Condition (bool~) atan2_16::$11 [82] if((signed word) atan2_16::x#17>=(signed byte) 0) goto atan2_16::@7
Simple Condition (bool~) atan2_16::$19 [85] if((byte) atan2_16::shift#2>(byte) 1) goto atan2_16::@19
Simple Condition (bool~) atan2_16::$20 [93] if((byte) 0==(byte) atan2_16::shift#2) goto atan2_16::@25
Simple Condition (bool~) atan2_16::$21 [96] if((signed word) atan2_16::yi#3>=(signed byte) 0) goto atan2_16::@26
Simple Condition (bool~) atan2_16::$22 [113] if((byte) atan2_16::i#1!=rangelast(0,atan2_16::$16)) goto atan2_16::@15
Simple Condition (bool~) atan2_16::$14 [117] if((signed word) atan2_16::y#19>=(signed byte) 0) goto atan2_16::@8
Simple Condition (bool~) init_angle_screen::$15 [285] if((byte) init_angle_screen::x#1<=(byte) $13) goto init_angle_screen::@2
Simple Condition (bool~) init_angle_screen::$16 [291] if((byte) init_angle_screen::y#1!=rangelast(0,$c)) goto init_angle_screen::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Negating conditional jump and destination [113] if((byte) atan2_16::i#1==rangelast(0,atan2_16::$16)) goto atan2_16::@17
Successful SSA optimization Pass2ConditionalJumpSequenceImprovement
Constant right-side identified [45] (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
Constant (const byte*) D018#0 = (byte*) 53272
Constant (const dword*) CIA2_TIMER_AB#0 = (dword*) 56580
Constant (const byte*) CIA2_TIMER_A_CONTROL#0 = (byte*) 56590
Constant (const byte*) CIA2_TIMER_B_CONTROL#0 = (byte*) 56591
Constant (const byte) CIA_TIMER_CONTROL_STOP#0 = 0
Constant (const byte) CIA_TIMER_CONTROL_START#0 = 1
Constant (const byte) CIA_TIMER_CONTROL_CONTINUOUS#0 = 0
Constant (const byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES#0 = 0
Constant (const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 = $40
Constant (const byte) init_font_hex::c#0 = 0
Constant (const byte) init_font_hex::c1#0 = 0
Constant (const byte) init_font_hex::idx#0 = 0
Constant (const byte) init_font_hex::i#0 = 0
Constant (const byte[]) FONT_HEX_PROTO#0 = { 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 }
Constant (const byte) CORDIC_ITERATIONS_16#0 = $f
Constant (const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 = kickasm {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
Constant (const word) atan2_16::angle#0 = 0
Constant (const byte) atan2_16::i#0 = 0
Constant (const dword) CLOCKS_PER_INIT#0 = $12
Constant (const byte[]) print_hextab#0 = $0
Constant (const byte*) CHARSET#0 = (byte*) 8192
Constant (const byte*) SCREEN#0 = (byte*) 10240
Constant (const byte*) main::BASE_SCREEN#0 = (byte*) 1024
Constant (const byte*) main::BASE_CHARSET#0 = (byte*) 4096
Constant (const byte) init_angle_screen::y#0 = 0
Constant (const byte) init_angle_screen::x#0 = 0
Constant (const byte) init_angle_screen::xb#0 = $27
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) init_font_hex::proto_hi#0 = FONT_HEX_PROTO#0
Constant (const byte*) init_font_hex::proto_lo#0 = FONT_HEX_PROTO#0
Constant (const byte*) init_font_hex::charset#1 = CHARSET#0
Constant (const byte*) main::toD0181_screen#0 = SCREEN#0
Constant (const byte*) main::toD0181_gfx#0 = CHARSET#0
Constant (const byte*) init_angle_screen::screen#0 = SCREEN#0
Constant (const byte*) print_dword_at::at#0 = main::BASE_SCREEN#0
Successful SSA optimization Pass2ConstantIdentification
Constant (const byte*) print_word_at::at#0 = print_dword_at::at#0
Successful SSA optimization Pass2ConstantIdentification
Constant value identified (word)main::toD0181_screen#0 in [196] (word~) main::toD0181_$0#0 ← (word)(const byte*) main::toD0181_screen#0
Constant value identified (word)main::toD0181_gfx#0 in [200] (word~) main::toD0181_$4#0 ← (word)(const byte*) main::toD0181_gfx#0
Constant value identified (word)main::BASE_SCREEN#0 in [228] (word~) main::toD0182_$0#0 ← (word)(const byte*) main::BASE_SCREEN#0
Constant value identified (word)main::BASE_CHARSET#0 in [232] (word~) main::toD0182_$4#0 ← (word)(const byte*) main::BASE_CHARSET#0
Successful SSA optimization Pass2ConstantValues
Resolved ranged next value [26] init_font_hex::i#1 ← ++ init_font_hex::i#2 to ++
Resolved ranged comparison value [28] if(init_font_hex::i#1!=rangelast(0,4)) goto init_font_hex::@3 to (number) 5
Resolved ranged next value [36] init_font_hex::c1#1 ← ++ init_font_hex::c1#4 to ++
Resolved ranged comparison value [38] if(init_font_hex::c1#1!=rangelast(0,$f)) goto init_font_hex::@2 to (number) $10
Resolved ranged next value [41] init_font_hex::c#1 ← ++ init_font_hex::c#5 to ++
Resolved ranged comparison value [43] if(init_font_hex::c#1!=rangelast(0,$f)) goto init_font_hex::@1 to (number) $10
Resolved ranged next value [289] init_angle_screen::y#1 ← ++ init_angle_screen::y#4 to ++
Resolved ranged comparison value [291] if(init_angle_screen::y#1!=rangelast(0,$c)) goto init_angle_screen::@1 to (number) $d
Rewriting conditional comparison [85] if((byte) atan2_16::shift#2>(byte) 1) goto atan2_16::@19
Rewriting conditional comparison [285] if((byte) init_angle_screen::x#1<=(byte) $13) goto init_angle_screen::@2
Simplifying expression containing zero init_font_hex::charset#2 in [17] *((byte*) init_font_hex::charset#2 + (const byte) init_font_hex::idx#0) ← (byte) 0
Simplifying expression containing zero CIA_TIMER_CONTROL_CONTINUOUS#0 in [135] (byte~) clock_start::$0 ← (const byte) CIA_TIMER_CONTROL_STOP#0 | (const byte) CIA_TIMER_CONTROL_CONTINUOUS#0
Simplifying expression containing zero clock_start::$0 in [136] (byte~) clock_start::$1 ← (byte~) clock_start::$0 | (const byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES#0
Simplifying expression containing zero CIA_TIMER_CONTROL_START#0 in [142] (byte~) clock_start::$4 ← (const byte) CIA_TIMER_CONTROL_START#0 | (const byte) CIA_TIMER_CONTROL_CONTINUOUS#0
Simplifying expression containing zero clock_start::$6 in [146] (byte~) clock_start::$7 ← (byte~) clock_start::$6 | (const byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES#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 constant (const byte) CIA_TIMER_CONTROL_STOP#0
Eliminating unused constant (const byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES#0
Successful SSA optimization PassNEliminateUnusedVars
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) 1+1 in if((byte) atan2_16::shift#2>=(byte) 1+(number) 1) goto atan2_16::@19
Adding number conversion cast (unumber) 1 in if((byte) atan2_16::shift#2>=(unumber)(byte) 1+(number) 1) goto atan2_16::@19
Adding number conversion cast (unumber) $13+1 in if((byte) init_angle_screen::x#1<(byte) $13+(number) 1) goto init_angle_screen::@2
Adding number conversion cast (unumber) 1 in if((byte) init_angle_screen::x#1<(unumber)(byte) $13+(number) 1) goto init_angle_screen::@2
Adding number conversion cast (unumber) $d in if((byte) init_angle_screen::y#1!=(number) $d) goto init_angle_screen::@1
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast 5
Simplifying constant integer cast $10
Simplifying constant integer cast $10
Simplifying constant integer cast (byte) 1+(unumber)(number) 1
Simplifying constant integer cast 1
Simplifying constant integer cast (byte~) init_angle_screen::$3
Simplifying constant integer cast (byte~) init_angle_screen::$6
Simplifying constant integer cast (byte) $13+(unumber)(number) 1
Simplifying constant integer cast 1
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 unsigned number type (byte) 1
Finalized unsigned number type (byte) $d
Successful SSA optimization PassNFinalizeNumberTypeConversions
Alias (byte~) clock_start::$1 = (byte~) clock_start::$0 (byte~) clock_start::$2
Alias (byte~) clock_start::$6 = (byte~) clock_start::$4 (byte~) clock_start::$7
Successful SSA optimization Pass2AliasElimination
Self Phi Eliminated (byte*) init_font_hex::proto_hi#4
Self Phi Eliminated (byte) init_font_hex::c#5
Self Phi Eliminated (signed word) atan2_16::x#17
Self Phi Eliminated (signed word) atan2_16::y#19
Successful SSA optimization Pass2SelfPhiElimination
Identical Phi Values (byte*) init_font_hex::proto_hi#4 (byte*) init_font_hex::proto_hi#6
Identical Phi Values (byte) init_font_hex::c#5 (byte) init_font_hex::c#6
Identical Phi Values (signed word) atan2_16::x#17 (signed word) atan2_16::x#0
Identical Phi Values (signed word) atan2_16::y#19 (signed word) atan2_16::y#0
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 [29] (byte~) atan2_16::$16 ← (const byte) CORDIC_ITERATIONS_16#0 - (byte) 1
Constant right-side identified [89] (byte*) print_word_at::at#1 ← (const byte*) print_dword_at::at#0 + (byte) 4
Constant right-side identified [135] (byte*) init_angle_screen::screen_topline#0 ← (const byte*) init_angle_screen::screen#0 + (word)(number) $28*(number) $c
Constant right-side identified [136] (byte*) init_angle_screen::screen_bottomline#0 ← (const byte*) init_angle_screen::screen#0 + (word)(number) $28*(number) $c
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) init_font_hex::idx#1 = ++init_font_hex::idx#0
Constant (const byte) atan2_16::$16 = CORDIC_ITERATIONS_16#0-1
Constant (const byte) clock_start::$1 = CIA_TIMER_CONTROL_CONTINUOUS#0
Constant (const byte) clock_start::$6 = CIA_TIMER_CONTROL_START#0
Constant (const byte*) print_word_at::at#1 = print_dword_at::at#0+4
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 word) main::toD0182_$0#0 = (word)main::BASE_SCREEN#0
Constant (const word) main::toD0182_$4#0 = (word)main::BASE_CHARSET#0
Constant (const byte*) init_angle_screen::screen_topline#0 = init_angle_screen::screen#0+(word)$28*$c
Constant (const byte*) init_angle_screen::screen_bottomline#0 = init_angle_screen::screen#0+(word)$28*$c
Successful SSA optimization Pass2ConstantIdentification
Resolved ranged next value [54] atan2_16::i#1 ← ++ atan2_16::i#2 to ++
Resolved ranged comparison value [55] if(atan2_16::i#1==rangelast(0,atan2_16::$16)) goto atan2_16::@17 to (const byte) atan2_16::$16+(number) 1
Simplifying expression containing zero CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 in [68] (byte~) clock_start::$3 ← (const byte) clock_start::$1 | (const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0
Successful SSA optimization PassNSimplifyExpressionWithZero
Adding number conversion cast (unumber) atan2_16::$16+1 in if((byte) atan2_16::i#1==(const byte) atan2_16::$16+(number) 1) goto atan2_16::@17
Adding number conversion cast (unumber) 1 in if((byte) atan2_16::i#1==(unumber)(const byte) atan2_16::$16+(number) 1) goto atan2_16::@17
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant integer cast (const byte) atan2_16::$16+(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 [66] (byte~) clock_start::$5 ← (const byte) clock_start::$6 | (const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0
Constant right-side identified [97] (word~) main::toD0181_$1#0 ← (const word) main::toD0181_$0#0 & (word) $3fff
Constant right-side identified [100] (byte~) main::toD0181_$5#0 ← > (const word) main::toD0181_$4#0
Constant right-side identified [113] (word~) main::toD0182_$1#0 ← (const word) main::toD0182_$0#0 & (word) $3fff
Constant right-side identified [116] (byte~) main::toD0182_$5#0 ← > (const word) main::toD0182_$4#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) clock_start::$3 = CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0
Constant (const byte) clock_start::$5 = clock_start::$6|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0
Constant (const word) main::toD0181_$1#0 = main::toD0181_$0#0&$3fff
Constant (const byte) main::toD0181_$5#0 = >main::toD0181_$4#0
Constant (const word) main::toD0182_$1#0 = main::toD0182_$0#0&$3fff
Constant (const byte) main::toD0182_$5#0 = >main::toD0182_$4#0
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [95] (word~) main::toD0181_$2#0 ← (const word) main::toD0181_$1#0 * (byte) 4
Constant right-side identified [97] (byte~) main::toD0181_$6#0 ← (const byte) main::toD0181_$5#0 / (byte) 4
Constant right-side identified [109] (word~) main::toD0182_$2#0 ← (const word) main::toD0182_$1#0 * (byte) 4
Constant right-side identified [111] (byte~) main::toD0182_$6#0 ← (const byte) main::toD0182_$5#0 / (byte) 4
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const word) main::toD0181_$2#0 = main::toD0181_$1#0*4
Constant (const byte) main::toD0181_$6#0 = main::toD0181_$5#0/4
Constant (const word) main::toD0182_$2#0 = main::toD0182_$1#0*4
Constant (const byte) main::toD0182_$6#0 = main::toD0182_$5#0/4
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [95] (byte~) main::toD0181_$3#0 ← > (const word) main::toD0181_$2#0
Constant right-side identified [96] (byte~) main::toD0181_$7#0 ← (const byte) main::toD0181_$6#0 & (byte) $f
Constant right-side identified [107] (byte~) main::toD0182_$3#0 ← > (const word) main::toD0182_$2#0
Constant right-side identified [108] (byte~) main::toD0182_$7#0 ← (const byte) main::toD0182_$6#0 & (byte) $f
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::toD0181_$3#0 = >main::toD0181_$2#0
Constant (const byte) main::toD0181_$7#0 = main::toD0181_$6#0&$f
Constant (const byte) main::toD0182_$3#0 = >main::toD0182_$2#0
Constant (const byte) main::toD0182_$7#0 = main::toD0182_$6#0&$f
Successful SSA optimization Pass2ConstantIdentification
Constant right-side identified [95] (byte) main::toD0181_return#0 ← (const byte) main::toD0181_$3#0 | (const byte) main::toD0181_$7#0
Constant right-side identified [105] (byte) main::toD0182_return#0 ← (const byte) main::toD0182_$3#0 | (const byte) main::toD0182_$7#0
Successful SSA optimization Pass2ConstantRValueConsolidation
Constant (const byte) main::toD0181_return#0 = main::toD0181_$3#0|main::toD0181_$7#0
Constant (const byte) main::toD0182_return#0 = main::toD0182_$3#0|main::toD0182_$7#0
Successful SSA optimization Pass2ConstantIdentification
Inlining Noop Cast [111] (signed word) init_angle_screen::xw#0 ← (signed word)(word~) init_angle_screen::$4 keeping init_angle_screen::xw#0
Inlining Noop Cast [114] (signed word) init_angle_screen::yw#0 ← (signed word)(word~) init_angle_screen::$7 keeping init_angle_screen::yw#0
Successful SSA optimization Pass2NopCastInlining
Rewriting division to use shift [31] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 / (byte) 2
Rewriting multiplication to use shift [45] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 * (const byte) SIZEOF_WORD
Rewriting multiplication to use shift [49] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 * (const byte) SIZEOF_WORD
Rewriting multiplication to use shift [108] (byte~) init_angle_screen::$2 ← (byte) init_angle_screen::x#2 * (byte) 2
Rewriting multiplication to use shift [112] (byte~) init_angle_screen::$6 ← (byte) init_angle_screen::y#4 * (byte) 2
Successful SSA optimization Pass2MultiplyToShiftRewriting
Inlining constant with var siblings (const byte) init_font_hex::c#0
Inlining constant with var siblings (const byte) init_font_hex::c1#0
Inlining constant with var siblings (const byte) init_font_hex::idx#0
Inlining constant with var siblings (const byte) init_font_hex::i#0
Inlining constant with var siblings (const byte*) init_font_hex::proto_hi#0
Inlining constant with var siblings (const byte*) init_font_hex::proto_lo#0
Inlining constant with var siblings (const byte*) init_font_hex::charset#1
Inlining constant with var siblings (const byte) init_font_hex::idx#1
Inlining constant with var siblings (const word) atan2_16::angle#0
Inlining constant with var siblings (const byte) atan2_16::i#0
Inlining constant with var siblings (const byte*) print_word_at::at#0
Inlining constant with var siblings (const byte*) print_word_at::at#1
Inlining constant with var siblings (const byte) init_angle_screen::y#0
Inlining constant with var siblings (const byte) init_angle_screen::x#0
Inlining constant with var siblings (const byte) init_angle_screen::xb#0
Inlining constant with var siblings (const byte*) init_angle_screen::screen_topline#0
Inlining constant with var siblings (const byte*) init_angle_screen::screen_bottomline#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_angle_screen::y#0 = (byte) 0
Constant inlined init_angle_screen::x#0 = (byte) 0
Constant inlined $0 = (const byte[]) print_hextab#0
Constant inlined clock_start::$5 = (const byte) CIA_TIMER_CONTROL_START#0|(const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0
Constant inlined atan2_16::angle#0 = (byte) 0
Constant inlined clock_start::$6 = (const byte) CIA_TIMER_CONTROL_START#0
Constant inlined init_angle_screen::screen_bottomline#0 = (const byte*) SCREEN#0+(word)(number) $28*(number) $c
Constant inlined clock_start::$3 = (const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0
Constant inlined init_font_hex::charset#1 = (const byte*) CHARSET#0
Constant inlined print_dword_at::at#0 = (const byte*) main::BASE_SCREEN#0
Constant inlined init_angle_screen::screen#0 = (const byte*) SCREEN#0
Constant inlined init_font_hex::c1#0 = (byte) 0
Constant inlined atan2_16::$16 = (const byte) CORDIC_ITERATIONS_16#0-(byte) 1
Constant inlined init_angle_screen::xb#0 = (byte) $27
Constant inlined main::toD0182_$4#0 = (word)(const byte*) main::BASE_CHARSET#0
Constant inlined atan2_16::i#0 = (byte) 0
Constant inlined main::toD0182_$3#0 = >(word)(const byte*) main::BASE_SCREEN#0&(word) $3fff*(byte) 4
Constant inlined main::toD0181_$0#0 = (word)(const byte*) SCREEN#0
Constant inlined main::toD0182_$6#0 = >(word)(const byte*) main::BASE_CHARSET#0/(byte) 4
Constant inlined main::toD0181_$1#0 = (word)(const byte*) SCREEN#0&(word) $3fff
Constant inlined main::toD0182_$5#0 = >(word)(const byte*) main::BASE_CHARSET#0
Constant inlined init_font_hex::i#0 = (byte) 0
Constant inlined main::toD0182_$7#0 = >(word)(const byte*) main::BASE_CHARSET#0/(byte) 4&(byte) $f
Constant inlined clock_start::$1 = (const byte) CIA_TIMER_CONTROL_CONTINUOUS#0
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
Constant inlined init_angle_screen::screen_topline#0 = (const byte*) SCREEN#0+(word)(number) $28*(number) $c
Constant inlined init_font_hex::idx#0 = (byte) 0
Constant inlined main::toD0182_$0#0 = (word)(const byte*) main::BASE_SCREEN#0
Constant inlined main::toD0181_$2#0 = (word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4
Constant inlined main::toD0181_$3#0 = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4
Constant inlined main::toD0181_$4#0 = (word)(const byte*) CHARSET#0
Constant inlined main::toD0182_$2#0 = (word)(const byte*) main::BASE_SCREEN#0&(word) $3fff*(byte) 4
Constant inlined main::toD0181_$5#0 = >(word)(const byte*) CHARSET#0
Constant inlined main::toD0182_$1#0 = (word)(const byte*) main::BASE_SCREEN#0&(word) $3fff
Constant inlined init_font_hex::proto_lo#0 = (const byte[]) FONT_HEX_PROTO#0
Constant inlined init_font_hex::c#0 = (byte) 0
Constant inlined print_word_at::at#1 = (const byte*) main::BASE_SCREEN#0+(byte) 4
Constant inlined print_word_at::at#0 = (const byte*) main::BASE_SCREEN#0
Successful SSA optimization Pass2ConstantInlining
Simplifying constant integer increment ++0
Successful SSA optimization Pass2ConstantSimplification
Eliminating unused constant (const byte) SIZEOF_WORD
Successful SSA optimization PassNEliminateUnusedVars
Added new block during phi lifting init_font_hex::@7(between init_font_hex::@5 and init_font_hex::@1)
Added new block during phi lifting init_font_hex::@8(between init_font_hex::@4 and init_font_hex::@2)
Added new block during phi lifting init_font_hex::@9(between init_font_hex::@3 and init_font_hex::@3)
Added new block during phi lifting atan2_16::@34(between atan2_16::@27 and atan2_16::@15)
Added new block during phi lifting atan2_16::@35(between atan2_16::@15 and atan2_16::@17)
Added new block during phi lifting atan2_16::@36(between atan2_16::@27 and atan2_16::@17)
Added new block during phi lifting atan2_16::@37(between atan2_16::@20 and atan2_16::@25)
Added new block during phi lifting atan2_16::@38(between atan2_16::@17 and atan2_16::@7)
Added new block during phi lifting atan2_16::@39(between atan2_16::@7 and atan2_16::@8)
Added new block during phi lifting init_angle_screen::@6(between init_angle_screen::@3 and init_angle_screen::@1)
Added new block during phi lifting init_angle_screen::@7(between init_angle_screen::@5 and init_angle_screen::@2)
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @3
Adding NOP phi() at start of @8
Adding NOP phi() at start of @10
Adding NOP phi() at start of @26
Adding NOP phi() at start of @33
Adding NOP phi() at start of @35
Adding NOP phi() at start of @36
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of main::toD0181
Adding NOP phi() at start of main::toD0181_@return
Adding NOP phi() at start of main::@4
Adding NOP phi() at start of main::@5
Adding NOP phi() at start of main::@7
Adding NOP phi() at start of main::toD0182
Adding NOP phi() at start of main::toD0182_@return
Adding NOP phi() at start of print_dword_at::@2
Adding NOP phi() at start of print_word_at::@2
Adding NOP phi() at start of print_byte_at::@2
Adding NOP phi() at start of init_angle_screen
Adding NOP phi() at start of init_font_hex
CALL GRAPH
Calls in [] to main:7
Calls in [main] to init_font_hex:11 clock_start:16 init_angle_screen:18 clock:20 print_dword_at:25
Calls in [print_dword_at] to print_word_at:33 print_word_at:36
Calls in [print_word_at] to print_byte_at:44 print_byte_at:49
Calls in [print_byte_at] to print_char_at:58 print_char_at:64
Calls in [init_angle_screen] to atan2_16:82
Created 36 initial phi equivalence classes
Coalesced [32] print_word_at::w#4 ← print_word_at::w#0
Coalesced [35] print_word_at::w#5 ← print_word_at::w#1
Coalesced [42] print_byte_at::b#4 ← print_byte_at::b#0
Coalesced [43] print_byte_at::at#4 ← print_byte_at::at#0
Coalesced [47] print_byte_at::b#5 ← print_byte_at::b#1
Coalesced [48] print_byte_at::at#5 ← print_byte_at::at#1
Coalesced [56] print_char_at::ch#3 ← print_char_at::ch#0
Coalesced [57] print_char_at::at#3 ← print_char_at::at#0
Coalesced [62] print_char_at::ch#4 ← print_char_at::ch#1
Coalesced [63] print_char_at::at#4 ← print_char_at::at#1
Coalesced [102] init_angle_screen::y#6 ← init_angle_screen::y#1
Coalesced [103] init_angle_screen::screen_topline#6 ← init_angle_screen::screen_topline#1
Coalesced [104] init_angle_screen::screen_bottomline#6 ← init_angle_screen::screen_bottomline#1
Coalesced [105] init_angle_screen::x#4 ← init_angle_screen::x#1
Coalesced [106] init_angle_screen::xb#4 ← init_angle_screen::xb#1
Coalesced [109] atan2_16::yi#17 ← atan2_16::$2
Coalesced [113] atan2_16::xi#14 ← atan2_16::$7
Coalesced [115] atan2_16::yi#19 ← atan2_16::yi#0
Coalesced [116] atan2_16::xi#16 ← atan2_16::xi#0
Coalesced [119] atan2_16::angle#22 ← atan2_16::angle#12
Coalesced [124] atan2_16::angle#27 ← atan2_16::angle#4
Coalesced [128] atan2_16::return#5 ← atan2_16::angle#5
Coalesced [131] atan2_16::return#6 ← atan2_16::angle#11
Coalesced [132] atan2_16::angle#26 ← atan2_16::angle#1
Not coalescing [133] atan2_16::shift#5 ← atan2_16::i#2
Not coalescing [134] atan2_16::xd#10 ← atan2_16::xi#3
Not coalescing [135] atan2_16::yd#10 ← atan2_16::yi#3
Coalesced [141] atan2_16::yd#13 ← atan2_16::yd#2
Coalesced [142] atan2_16::xd#13 ← atan2_16::xd#2
Coalesced [149] atan2_16::yi#21 ← atan2_16::yi#2
Coalesced [150] atan2_16::angle#25 ← atan2_16::angle#3
Coalesced [151] atan2_16::xi#18 ← atan2_16::xi#2
Coalesced [155] atan2_16::yi#18 ← atan2_16::yi#8
Coalesced [156] atan2_16::xi#15 ← atan2_16::xi#8
Coalesced [157] atan2_16::i#12 ← atan2_16::i#1
Coalesced [158] atan2_16::angle#21 ← atan2_16::angle#13
Coalesced (already) [159] atan2_16::angle#23 ← atan2_16::angle#13
Coalesced [164] atan2_16::yi#20 ← atan2_16::yi#1
Coalesced [165] atan2_16::angle#24 ← atan2_16::angle#2
Coalesced [166] atan2_16::xi#17 ← atan2_16::xi#1
Coalesced [167] atan2_16::yd#12 ← atan2_16::yd#3
Coalesced [168] atan2_16::xd#12 ← atan2_16::xd#3
Coalesced [172] atan2_16::shift#6 ← atan2_16::shift#1
Coalesced [173] atan2_16::xd#11 ← atan2_16::xd#1
Coalesced [174] atan2_16::yd#11 ← atan2_16::yd#1
Not coalescing [175] atan2_16::xi#13 ← atan2_16::x#0
Not coalescing [176] atan2_16::yi#16 ← atan2_16::y#0
Coalesced [185] init_font_hex::charset#9 ← init_font_hex::charset#5
Coalesced [207] init_font_hex::charset#8 ← init_font_hex::charset#0
Coalesced [208] init_font_hex::proto_hi#7 ← init_font_hex::proto_hi#1
Coalesced [209] init_font_hex::c#7 ← init_font_hex::c#1
Coalesced (already) [210] init_font_hex::charset#10 ← init_font_hex::charset#0
Coalesced [211] init_font_hex::proto_lo#5 ← init_font_hex::proto_lo#1
Coalesced [212] init_font_hex::c1#5 ← init_font_hex::c1#1
Coalesced [213] init_font_hex::i#3 ← init_font_hex::i#1
Coalesced [214] init_font_hex::idx#7 ← init_font_hex::idx#2
Coalesced down to 28 phi equivalence classes
Culled Empty Block (label) @3
Culled Empty Block (label) @8
Culled Empty Block (label) @10
Culled Empty Block (label) @26
Culled Empty Block (label) @33
Culled Empty Block (label) @36
Culled Empty Block (label) main::@3
Culled Empty Block (label) main::toD0181_@return
Culled Empty Block (label) main::@7
Culled Empty Block (label) main::toD0182_@return
Culled Empty Block (label) print_dword_at::@2
Culled Empty Block (label) print_word_at::@2
Culled Empty Block (label) print_byte_at::@2
Culled Empty Block (label) init_angle_screen::@6
Culled Empty Block (label) init_angle_screen::@7
Culled Empty Block (label) atan2_16::@35
Culled Empty Block (label) atan2_16::@39
Culled Empty Block (label) atan2_16::@38
Culled Empty Block (label) atan2_16::@34
Culled Empty Block (label) atan2_16::@36
Culled Empty Block (label) atan2_16::@37
Culled Empty Block (label) init_font_hex::@7
Culled Empty Block (label) init_font_hex::@8
Culled Empty Block (label) init_font_hex::@9
Renumbering block @35 to @1
Renumbering block atan2_16::@13 to atan2_16::@9
Renumbering block atan2_16::@15 to atan2_16::@10
Renumbering block atan2_16::@16 to atan2_16::@11
Renumbering block atan2_16::@17 to atan2_16::@12
Renumbering block atan2_16::@18 to atan2_16::@13
Renumbering block atan2_16::@19 to atan2_16::@14
Renumbering block atan2_16::@20 to atan2_16::@15
Renumbering block atan2_16::@24 to atan2_16::@16
Renumbering block atan2_16::@25 to atan2_16::@17
Renumbering block atan2_16::@26 to atan2_16::@18
Renumbering block atan2_16::@27 to atan2_16::@19
Renumbering block atan2_16::@30 to atan2_16::@20
Renumbering block atan2_16::@33 to atan2_16::@21
Renumbering block main::@4 to main::@3
Renumbering block main::@5 to main::@4
Renumbering block main::@6 to main::@5
Renumbering block init_angle_screen::@5 to init_angle_screen::@4
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @end
Adding NOP phi() at start of main
Adding NOP phi() at start of main::toD0181
Adding NOP phi() at start of main::@3
Adding NOP phi() at start of main::@4
Adding NOP phi() at start of main::toD0182
Adding NOP phi() at start of init_angle_screen
Adding NOP phi() at start of init_font_hex
FINAL CONTROL FLOW GRAPH
@begin: scope:[] from
[0] phi()
to:@1
@1: scope:[] from @begin
[1] phi()
[2] call main
to:@end
@end: scope:[] from @1
[3] phi()
main: scope:[main] from @1
[4] phi()
[5] call init_font_hex
to:main::toD0181
main::toD0181: scope:[main] from main
[6] phi()
to:main::@1
main::@1: scope:[main] from main::toD0181
[7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0
[8] call clock_start
to:main::@3
main::@3: scope:[main] from main::@1
[9] phi()
[10] call init_angle_screen
to:main::@4
main::@4: scope:[main] from main::@3
[11] phi()
[12] call clock
[13] (dword) clock::return#2 ← (dword) clock::return#0
to:main::@5
main::@5: scope:[main] from main::@4
[14] (dword~) main::$4 ← (dword) clock::return#2
[15] (dword) main::cyclecount#0 ← (dword~) main::$4 - (const dword) CLOCKS_PER_INIT#0
[16] (dword) print_dword_at::dw#0 ← (dword) main::cyclecount#0
[17] call print_dword_at
to:main::toD0182
main::toD0182: scope:[main] from main::@5
[18] phi()
to:main::@2
main::@2: scope:[main] from main::toD0182
[19] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0
to:main::@return
main::@return: scope:[main] from main::@2
[20] return
to:@return
print_dword_at: scope:[print_dword_at] from main::@5
[21] (word) print_word_at::w#0 ← > (dword) print_dword_at::dw#0
[22] call print_word_at
to:print_dword_at::@1
print_dword_at::@1: scope:[print_dword_at] from print_dword_at
[23] (word) print_word_at::w#1 ← < (dword) print_dword_at::dw#0
[24] call print_word_at
to:print_dword_at::@return
print_dword_at::@return: scope:[print_dword_at] from print_dword_at::@1
[25] return
to:@return
print_word_at: scope:[print_word_at] from print_dword_at print_dword_at::@1
[26] (byte*) print_word_at::at#2 ← phi( print_dword_at/(const byte*) main::BASE_SCREEN#0 print_dword_at::@1/(const byte*) main::BASE_SCREEN#0+(byte) 4 )
[26] (word) print_word_at::w#2 ← phi( print_dword_at/(word) print_word_at::w#0 print_dword_at::@1/(word) print_word_at::w#1 )
[27] (byte) print_byte_at::b#0 ← > (word) print_word_at::w#2
[28] (byte*) print_byte_at::at#0 ← (byte*) print_word_at::at#2
[29] call print_byte_at
to:print_word_at::@1
print_word_at::@1: scope:[print_word_at] from print_word_at
[30] (byte) print_byte_at::b#1 ← < (word) print_word_at::w#2
[31] (byte*) print_byte_at::at#1 ← (byte*) print_word_at::at#2 + (byte) 2
[32] call print_byte_at
to:print_word_at::@return
print_word_at::@return: scope:[print_word_at] from print_word_at::@1
[33] return
to:@return
print_byte_at: scope:[print_byte_at] from print_word_at print_word_at::@1
[34] (byte*) print_byte_at::at#2 ← phi( print_word_at/(byte*) print_byte_at::at#0 print_word_at::@1/(byte*) print_byte_at::at#1 )
[34] (byte) print_byte_at::b#2 ← phi( print_word_at/(byte) print_byte_at::b#0 print_word_at::@1/(byte) print_byte_at::b#1 )
[35] (byte~) print_byte_at::$0 ← (byte) print_byte_at::b#2 >> (byte) 4
[36] (byte) print_char_at::ch#0 ← *((const byte[]) print_hextab#0 + (byte~) print_byte_at::$0)
[37] (byte*) print_char_at::at#0 ← (byte*) print_byte_at::at#2
[38] call print_char_at
to:print_byte_at::@1
print_byte_at::@1: scope:[print_byte_at] from print_byte_at
[39] (byte~) print_byte_at::$2 ← (byte) print_byte_at::b#2 & (byte) $f
[40] (byte*) print_char_at::at#1 ← (byte*) print_byte_at::at#2 + (byte) 1
[41] (byte) print_char_at::ch#1 ← *((const byte[]) print_hextab#0 + (byte~) print_byte_at::$2)
[42] call print_char_at
to:print_byte_at::@return
print_byte_at::@return: scope:[print_byte_at] from print_byte_at::@1
[43] return
to:@return
print_char_at: scope:[print_char_at] from print_byte_at print_byte_at::@1
[44] (byte*) print_char_at::at#2 ← phi( print_byte_at/(byte*) print_char_at::at#0 print_byte_at::@1/(byte*) print_char_at::at#1 )
[44] (byte) print_char_at::ch#2 ← phi( print_byte_at/(byte) print_char_at::ch#0 print_byte_at::@1/(byte) print_char_at::ch#1 )
[45] *((byte*) print_char_at::at#2) ← (byte) print_char_at::ch#2
to:print_char_at::@return
print_char_at::@return: scope:[print_char_at] from print_char_at
[46] return
to:@return
clock: scope:[clock] from main::@4
[47] (dword) clock::return#0 ← (dword) $ffffffff - *((const dword*) CIA2_TIMER_AB#0)
to:clock::@return
clock::@return: scope:[clock] from clock
[48] return
to:@return
init_angle_screen: scope:[init_angle_screen] from main::@3
[49] phi()
to:init_angle_screen::@1
init_angle_screen::@1: scope:[init_angle_screen] from init_angle_screen init_angle_screen::@3
[50] (byte*) init_angle_screen::screen_bottomline#5 ← phi( init_angle_screen/(const byte*) SCREEN#0+(word)(number) $28*(number) $c init_angle_screen::@3/(byte*) init_angle_screen::screen_bottomline#1 )
[50] (byte*) init_angle_screen::screen_topline#5 ← phi( init_angle_screen/(const byte*) SCREEN#0+(word)(number) $28*(number) $c init_angle_screen::@3/(byte*) init_angle_screen::screen_topline#1 )
[50] (byte) init_angle_screen::y#4 ← phi( init_angle_screen/(byte) 0 init_angle_screen::@3/(byte) init_angle_screen::y#1 )
to:init_angle_screen::@2
init_angle_screen::@2: scope:[init_angle_screen] from init_angle_screen::@1 init_angle_screen::@4
[51] (byte) init_angle_screen::xb#2 ← phi( init_angle_screen::@1/(byte) $27 init_angle_screen::@4/(byte) init_angle_screen::xb#1 )
[51] (byte) init_angle_screen::x#2 ← phi( init_angle_screen::@1/(byte) 0 init_angle_screen::@4/(byte) init_angle_screen::x#1 )
[52] (byte~) init_angle_screen::$2 ← (byte) init_angle_screen::x#2 << (byte) 1
[53] (byte~) init_angle_screen::$3 ← (byte) $27 - (byte~) init_angle_screen::$2
[54] (word) init_angle_screen::xw#0 ← (byte~) init_angle_screen::$3 w= (byte) 0
[55] (byte~) init_angle_screen::$6 ← (byte) init_angle_screen::y#4 << (byte) 1
[56] (word) init_angle_screen::yw#0 ← (byte~) init_angle_screen::$6 w= (byte) 0
[57] (signed word) atan2_16::x#0 ← (signed word)(word) init_angle_screen::xw#0
[58] (signed word) atan2_16::y#0 ← (signed word)(word) init_angle_screen::yw#0
[59] call atan2_16
[60] (word) atan2_16::return#2 ← (word) atan2_16::return#0
to:init_angle_screen::@4
init_angle_screen::@4: scope:[init_angle_screen] from init_angle_screen::@2
[61] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2
[62] (word~) init_angle_screen::$10 ← (word) init_angle_screen::angle_w#0 + (byte) $80
[63] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$10
[64] (byte~) init_angle_screen::$12 ← (byte) $80 + (byte) init_angle_screen::ang_w#0
[65] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$12
[66] (byte~) init_angle_screen::$13 ← (byte) $80 - (byte) init_angle_screen::ang_w#0
[67] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$13
[68] (byte~) init_angle_screen::$14 ← - (byte) init_angle_screen::ang_w#0
[69] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::xb#2) ← (byte~) init_angle_screen::$14
[70] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::xb#2) ← (byte) init_angle_screen::ang_w#0
[71] (byte) init_angle_screen::x#1 ← ++ (byte) init_angle_screen::x#2
[72] (byte) init_angle_screen::xb#1 ← -- (byte) init_angle_screen::xb#2
[73] if((byte) init_angle_screen::x#1<(byte) $13+(byte) 1) goto init_angle_screen::@2
to:init_angle_screen::@3
init_angle_screen::@3: scope:[init_angle_screen] from init_angle_screen::@4
[74] (byte*) init_angle_screen::screen_topline#1 ← (byte*) init_angle_screen::screen_topline#5 - (byte) $28
[75] (byte*) init_angle_screen::screen_bottomline#1 ← (byte*) init_angle_screen::screen_bottomline#5 + (byte) $28
[76] (byte) init_angle_screen::y#1 ← ++ (byte) init_angle_screen::y#4
[77] if((byte) init_angle_screen::y#1!=(byte) $d) goto init_angle_screen::@1
to:init_angle_screen::@return
init_angle_screen::@return: scope:[init_angle_screen] from init_angle_screen::@3
[78] return
to:@return
atan2_16: scope:[atan2_16] from init_angle_screen::@2
[79] 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
[80] (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
[81] (signed word) atan2_16::yi#0 ← phi( atan2_16::@1/(signed word~) atan2_16::yi#16 atan2_16::@2/(signed word~) atan2_16::$2 )
[82] 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
[83] (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
[84] (signed word) atan2_16::xi#0 ← phi( atan2_16::@4/(signed word~) atan2_16::xi#13 atan2_16::@5/(signed word~) atan2_16::$7 )
to:atan2_16::@10
atan2_16::@10: scope:[atan2_16] from atan2_16::@19 atan2_16::@6
[85] (word) atan2_16::angle#12 ← phi( atan2_16::@19/(word) atan2_16::angle#13 atan2_16::@6/(byte) 0 )
[85] (byte) atan2_16::i#2 ← phi( atan2_16::@19/(byte) atan2_16::i#1 atan2_16::@6/(byte) 0 )
[85] (signed word) atan2_16::xi#3 ← phi( atan2_16::@19/(signed word) atan2_16::xi#8 atan2_16::@6/(signed word) atan2_16::xi#0 )
[85] (signed word) atan2_16::yi#3 ← phi( atan2_16::@19/(signed word) atan2_16::yi#8 atan2_16::@6/(signed word) atan2_16::yi#0 )
[86] 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::@19
[87] (word) atan2_16::angle#6 ← phi( atan2_16::@10/(word) atan2_16::angle#12 atan2_16::@19/(word) atan2_16::angle#13 )
[88] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1
[89] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7
to:atan2_16::@21
atan2_16::@21: scope:[atan2_16] from atan2_16::@12
[90] (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::@21
[91] (word) atan2_16::angle#11 ← phi( atan2_16::@12/(word) atan2_16::angle#1 atan2_16::@21/(word) atan2_16::angle#4 )
[92] 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
[93] (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
[94] (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
[95] return
to:@return
atan2_16::@11: scope:[atan2_16] from atan2_16::@10
[96] (byte~) atan2_16::shift#5 ← (byte) atan2_16::i#2
[97] (signed word~) atan2_16::xd#10 ← (signed word) atan2_16::xi#3
[98] (signed word~) atan2_16::yd#10 ← (signed word) atan2_16::yi#3
to:atan2_16::@13
atan2_16::@13: scope:[atan2_16] from atan2_16::@11 atan2_16::@14
[99] (signed word) atan2_16::yd#3 ← phi( atan2_16::@11/(signed word~) atan2_16::yd#10 atan2_16::@14/(signed word) atan2_16::yd#1 )
[99] (signed word) atan2_16::xd#3 ← phi( atan2_16::@11/(signed word~) atan2_16::xd#10 atan2_16::@14/(signed word) atan2_16::xd#1 )
[99] (byte) atan2_16::shift#2 ← phi( atan2_16::@11/(byte~) atan2_16::shift#5 atan2_16::@14/(byte) atan2_16::shift#1 )
[100] if((byte) atan2_16::shift#2>=(byte) 1+(byte) 1) goto atan2_16::@14
to:atan2_16::@15
atan2_16::@15: scope:[atan2_16] from atan2_16::@13
[101] if((byte) 0==(byte) atan2_16::shift#2) goto atan2_16::@17
to:atan2_16::@16
atan2_16::@16: scope:[atan2_16] from atan2_16::@15
[102] (signed word) atan2_16::xd#2 ← (signed word) atan2_16::xd#3 >> (signed byte) 1
[103] (signed word) atan2_16::yd#2 ← (signed word) atan2_16::yd#3 >> (signed byte) 1
to:atan2_16::@17
atan2_16::@17: scope:[atan2_16] from atan2_16::@15 atan2_16::@16
[104] (signed word) atan2_16::xd#5 ← phi( atan2_16::@15/(signed word) atan2_16::xd#3 atan2_16::@16/(signed word) atan2_16::xd#2 )
[104] (signed word) atan2_16::yd#5 ← phi( atan2_16::@15/(signed word) atan2_16::yd#3 atan2_16::@16/(signed word) atan2_16::yd#2 )
[105] if((signed word) atan2_16::yi#3>=(signed byte) 0) goto atan2_16::@18
to:atan2_16::@20
atan2_16::@20: scope:[atan2_16] from atan2_16::@17
[106] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#5
[107] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#5
[108] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1
[109] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24)
to:atan2_16::@19
atan2_16::@19: scope:[atan2_16] from atan2_16::@18 atan2_16::@20
[110] (signed word) atan2_16::xi#8 ← phi( atan2_16::@18/(signed word) atan2_16::xi#1 atan2_16::@20/(signed word) atan2_16::xi#2 )
[110] (word) atan2_16::angle#13 ← phi( atan2_16::@18/(word) atan2_16::angle#2 atan2_16::@20/(word) atan2_16::angle#3 )
[110] (signed word) atan2_16::yi#8 ← phi( atan2_16::@18/(signed word) atan2_16::yi#1 atan2_16::@20/(signed word) atan2_16::yi#2 )
[111] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2
[112] 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::@18: scope:[atan2_16] from atan2_16::@17
[113] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#5
[114] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#5
[115] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1
[116] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23)
to:atan2_16::@19
atan2_16::@14: scope:[atan2_16] from atan2_16::@13
[117] (signed word) atan2_16::xd#1 ← (signed word) atan2_16::xd#3 >> (signed byte) 2
[118] (signed word) atan2_16::yd#1 ← (signed word) atan2_16::yd#3 >> (signed byte) 2
[119] (byte) atan2_16::shift#1 ← (byte) atan2_16::shift#2 - (byte) 2
to:atan2_16::@13
atan2_16::@4: scope:[atan2_16] from atan2_16::@3
[120] (signed word~) atan2_16::xi#13 ← (signed word) atan2_16::x#0
to:atan2_16::@6
atan2_16::@1: scope:[atan2_16] from atan2_16
[121] (signed word~) atan2_16::yi#16 ← (signed word) atan2_16::y#0
to:atan2_16::@3
clock_start: scope:[clock_start] from main::@1
[122] *((const byte*) CIA2_TIMER_A_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_CONTINUOUS#0
[123] *((const byte*) CIA2_TIMER_B_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0
[124] *((const dword*) CIA2_TIMER_AB#0) ← (dword) $ffffffff
[125] *((const byte*) CIA2_TIMER_B_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_START#0|(const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0
[126] *((const byte*) CIA2_TIMER_A_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_START#0
to:clock_start::@return
clock_start::@return: scope:[clock_start] from clock_start
[127] return
to:@return
init_font_hex: scope:[init_font_hex] from main
[128] phi()
to:init_font_hex::@1
init_font_hex::@1: scope:[init_font_hex] from init_font_hex init_font_hex::@5
[129] (byte) init_font_hex::c#6 ← phi( init_font_hex/(byte) 0 init_font_hex::@5/(byte) init_font_hex::c#1 )
[129] (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 )
[129] (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
[130] (byte) init_font_hex::c1#4 ← phi( init_font_hex::@1/(byte) 0 init_font_hex::@4/(byte) init_font_hex::c1#1 )
[130] (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 )
[130] (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 )
[131] *((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
[132] (byte) init_font_hex::idx#5 ← phi( init_font_hex::@2/(byte) 1 init_font_hex::@3/(byte) init_font_hex::idx#2 )
[132] (byte) init_font_hex::i#2 ← phi( init_font_hex::@2/(byte) 0 init_font_hex::@3/(byte) init_font_hex::i#1 )
[133] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4
[134] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1
[135] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1
[136] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2
[137] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5
[138] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2
[139] 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
[140] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0
[141] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2
[142] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0
[143] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5
[144] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8
[145] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4
[146] 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
[147] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5
[148] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6
[149] 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
[150] return
to:@return
VARIABLE REGISTER WEIGHTS
(byte*) CHARSET
(dword*) CIA2_TIMER_AB
(byte*) CIA2_TIMER_A_CONTROL
(byte*) CIA2_TIMER_B_CONTROL
(byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
(byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
(byte) CIA_TIMER_CONTROL_CONTINUOUS
(byte) CIA_TIMER_CONTROL_START
(byte) CIA_TIMER_CONTROL_STOP
(dword) CLOCKS_PER_INIT
(word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16
(byte) CORDIC_ITERATIONS_16
(byte*) D018
(byte[]) FONT_HEX_PROTO
(byte*) SCREEN
(word()) atan2_16((signed word) atan2_16::x , (signed word) atan2_16::y)
(signed word~) atan2_16::$2 4.0
(byte~) atan2_16::$23 2002.0
(byte~) atan2_16::$24 2002.0
(signed word~) atan2_16::$7 4.0
(word) atan2_16::angle
(word) atan2_16::angle#1 3.0
(word) atan2_16::angle#11 4.0
(word) atan2_16::angle#12 190.66666666666666
(word) atan2_16::angle#13 1334.6666666666667
(word) atan2_16::angle#2 2002.0
(word) atan2_16::angle#3 2002.0
(word) atan2_16::angle#4 4.0
(word) atan2_16::angle#5 4.0
(word) atan2_16::angle#6 2004.0
(byte) atan2_16::i
(byte) atan2_16::i#1 1501.5
(byte) atan2_16::i#2 208.54166666666669
(word) atan2_16::return
(word) atan2_16::return#0 34.99999999999999
(word) atan2_16::return#2 202.0
(byte) atan2_16::shift
(byte) atan2_16::shift#1 20002.0
(byte) atan2_16::shift#2 8001.25
(byte~) atan2_16::shift#5 667.3333333333334
(signed word) atan2_16::x
(signed word) atan2_16::x#0 2.8684210526315796
(signed word) atan2_16::xd
(signed word) atan2_16::xd#1 6667.333333333333
(signed word~) atan2_16::xd#10 1001.0
(signed word) atan2_16::xd#2 1001.0
(signed word) atan2_16::xd#3 7668.333333333332
(signed word) atan2_16::xd#5 1001.0
(signed word) atan2_16::xi
(signed word) atan2_16::xi#0 6.0
(signed word) atan2_16::xi#1 500.5
(signed word~) atan2_16::xi#13 4.0
(signed word) atan2_16::xi#2 500.5
(signed word) atan2_16::xi#3 267.0666666666667
(signed word) atan2_16::xi#8 1001.0
(signed word) atan2_16::y
(signed word) atan2_16::y#0 2.724999999999999
(signed word) atan2_16::yd
(signed word) atan2_16::yd#1 10001.0
(signed word~) atan2_16::yd#10 2002.0
(signed word) atan2_16::yd#2 2002.0
(signed word) atan2_16::yd#3 4601.0
(signed word) atan2_16::yd#5 2002.0
(signed word) atan2_16::yi
(signed word) atan2_16::yi#0 1.2000000000000002
(signed word) atan2_16::yi#1 667.3333333333334
(signed word~) atan2_16::yi#16 4.0
(signed word) atan2_16::yi#2 667.3333333333334
(signed word) atan2_16::yi#3 353.4117647058823
(signed word) atan2_16::yi#8 1001.0
(dword()) clock()
(dword) clock::return
(dword) clock::return#0 1.3333333333333333
(dword) clock::return#2 4.0
(void()) clock_start()
(void()) init_angle_screen((byte*) init_angle_screen::screen)
(word~) init_angle_screen::$10 202.0
(byte~) init_angle_screen::$12 202.0
(byte~) init_angle_screen::$13 202.0
(byte~) init_angle_screen::$14 202.0
(byte~) init_angle_screen::$2 202.0
(byte~) init_angle_screen::$3 202.0
(byte~) init_angle_screen::$6 202.0
(byte) init_angle_screen::ang_w
(byte) init_angle_screen::ang_w#0 72.14285714285714
(word) init_angle_screen::angle_w
(word) init_angle_screen::angle_w#0 202.0
(byte*) init_angle_screen::screen
(byte*) init_angle_screen::screen_bottomline
(byte*) init_angle_screen::screen_bottomline#1 7.333333333333333
(byte*) init_angle_screen::screen_bottomline#5 8.959999999999999
(byte*) init_angle_screen::screen_topline
(byte*) init_angle_screen::screen_topline#1 5.5
(byte*) init_angle_screen::screen_topline#5 9.333333333333334
(byte) init_angle_screen::x
(byte) init_angle_screen::x#1 101.0
(byte) init_angle_screen::x#2 25.25
(byte) init_angle_screen::xb
(byte) init_angle_screen::xb#1 101.0
(byte) init_angle_screen::xb#2 19.238095238095237
(signed word) init_angle_screen::xw
(word) init_angle_screen::xw#0 33.666666666666664
(byte) init_angle_screen::y
(byte) init_angle_screen::y#1 16.5
(byte) init_angle_screen::y#4 4.730769230769231
(signed word) init_angle_screen::yw
(word) init_angle_screen::yw#0 50.5
(void()) init_font_hex((byte*) init_font_hex::charset)
(byte~) init_font_hex::$0 1001.0
(byte~) init_font_hex::$1 2002.0
(byte~) init_font_hex::$2 2002.0
(byte) init_font_hex::c
(byte) init_font_hex::c#1 16.5
(byte) init_font_hex::c#6 1.1578947368421053
(byte) init_font_hex::c1
(byte) init_font_hex::c1#1 151.5
(byte) init_font_hex::c1#4 13.466666666666667
(byte*) init_font_hex::charset
(byte*) init_font_hex::charset#0 35.5
(byte*) init_font_hex::charset#2 108.35714285714285
(byte*) init_font_hex::charset#5 22.0
(byte) init_font_hex::i
(byte) init_font_hex::i#1 1501.5
(byte) init_font_hex::i#2 667.3333333333334
(byte) init_font_hex::idx
(byte) init_font_hex::idx#2 551.0
(byte) init_font_hex::idx#3 202.0
(byte) init_font_hex::idx#5 600.5999999999999
(byte*) init_font_hex::proto_hi
(byte*) init_font_hex::proto_hi#1 7.333333333333333
(byte*) init_font_hex::proto_hi#6 56.83333333333334
(byte*) init_font_hex::proto_lo
(byte*) init_font_hex::proto_lo#1 50.5
(byte*) init_font_hex::proto_lo#4 92.53846153846155
(void()) main()
(dword~) main::$4 4.0
(byte*) main::BASE_CHARSET
(byte*) main::BASE_SCREEN
(dword) main::cyclecount
(dword) main::cyclecount#0 4.0
(word~) main::toD0181_$0
(number~) main::toD0181_$1
(number~) main::toD0181_$2
(number~) main::toD0181_$3
(word~) main::toD0181_$4
(byte~) main::toD0181_$5
(number~) main::toD0181_$6
(number~) main::toD0181_$7
(number~) main::toD0181_$8
(byte*) main::toD0181_gfx
(byte) main::toD0181_return
(byte*) main::toD0181_screen
(word~) main::toD0182_$0
(number~) main::toD0182_$1
(number~) main::toD0182_$2
(number~) main::toD0182_$3
(word~) main::toD0182_$4
(byte~) main::toD0182_$5
(number~) main::toD0182_$6
(number~) main::toD0182_$7
(number~) main::toD0182_$8
(byte*) main::toD0182_gfx
(byte) main::toD0182_return
(byte*) main::toD0182_screen
(void()) print_byte_at((byte) print_byte_at::b , (byte*) print_byte_at::at)
(byte~) print_byte_at::$0 4.0
(byte~) print_byte_at::$2 2.0
(byte*) print_byte_at::at
(byte*) print_byte_at::at#0 4.0
(byte*) print_byte_at::at#1 4.0
(byte*) print_byte_at::at#2 1.3333333333333333
(byte) print_byte_at::b
(byte) print_byte_at::b#0 2.0
(byte) print_byte_at::b#1 2.0
(byte) print_byte_at::b#2 1.6
(void()) print_char_at((byte) print_char_at::ch , (byte*) print_char_at::at)
(byte*) print_char_at::at
(byte*) print_char_at::at#0 4.0
(byte*) print_char_at::at#1 2.0
(byte*) print_char_at::at#2 6.0
(byte) print_char_at::ch
(byte) print_char_at::ch#0 2.0
(byte) print_char_at::ch#1 4.0
(byte) print_char_at::ch#2 6.0
(void()) print_dword_at((dword) print_dword_at::dw , (byte*) print_dword_at::at)
(byte*) print_dword_at::at
(dword) print_dword_at::dw
(dword) print_dword_at::dw#0 2.0
(byte[]) print_hextab
(void()) print_word_at((word) print_word_at::w , (byte*) print_word_at::at)
(byte*) print_word_at::at
(byte*) print_word_at::at#2 0.8
(word) print_word_at::w
(word) print_word_at::w#0 4.0
(word) print_word_at::w#1 4.0
(word) print_word_at::w#2 2.0
Initial phi equivalence classes
[ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ]
[ print_word_at::at#2 ]
[ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ]
[ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ]
[ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ]
[ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ]
[ init_angle_screen::y#4 init_angle_screen::y#1 ]
[ init_angle_screen::screen_topline#5 init_angle_screen::screen_topline#1 ]
[ init_angle_screen::screen_bottomline#5 init_angle_screen::screen_bottomline#1 ]
[ init_angle_screen::x#2 init_angle_screen::x#1 ]
[ init_angle_screen::xb#2 init_angle_screen::xb#1 ]
[ atan2_16::yi#3 atan2_16::yi#8 atan2_16::yi#0 atan2_16::yi#16 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ]
[ atan2_16::xi#3 atan2_16::xi#8 atan2_16::xi#0 atan2_16::xi#13 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ]
[ atan2_16::i#2 atan2_16::i#1 ]
[ 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::shift#2 atan2_16::shift#5 atan2_16::shift#1 ]
[ atan2_16::yd#5 atan2_16::yd#3 atan2_16::yd#10 atan2_16::yd#1 atan2_16::yd#2 ]
[ atan2_16::xd#5 atan2_16::xd#3 atan2_16::xd#10 atan2_16::xd#1 atan2_16::xd#2 ]
[ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ]
[ init_font_hex::c#6 init_font_hex::c#1 ]
[ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ]
[ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ]
[ init_font_hex::c1#4 init_font_hex::c1#1 ]
[ init_font_hex::i#2 init_font_hex::i#1 ]
[ init_font_hex::idx#5 init_font_hex::idx#2 ]
Added variable clock::return#2 to zero page equivalence class [ clock::return#2 ]
Added variable main::$4 to zero page equivalence class [ main::$4 ]
Added variable main::cyclecount#0 to zero page equivalence class [ main::cyclecount#0 ]
Added variable print_dword_at::dw#0 to zero page equivalence class [ print_dword_at::dw#0 ]
Added variable print_byte_at::$0 to zero page equivalence class [ print_byte_at::$0 ]
Added variable print_byte_at::$2 to zero page equivalence class [ print_byte_at::$2 ]
Added variable clock::return#0 to zero page equivalence class [ clock::return#0 ]
Added variable init_angle_screen::$2 to zero page equivalence class [ init_angle_screen::$2 ]
Added variable init_angle_screen::$3 to zero page equivalence class [ init_angle_screen::$3 ]
Added variable init_angle_screen::xw#0 to zero page equivalence class [ init_angle_screen::xw#0 ]
Added variable init_angle_screen::$6 to zero page equivalence class [ init_angle_screen::$6 ]
Added variable init_angle_screen::yw#0 to zero page equivalence class [ init_angle_screen::yw#0 ]
Added variable atan2_16::x#0 to zero page equivalence class [ atan2_16::x#0 ]
Added variable atan2_16::y#0 to zero page equivalence class [ atan2_16::y#0 ]
Added variable atan2_16::return#2 to zero page equivalence class [ atan2_16::return#2 ]
Added variable init_angle_screen::angle_w#0 to zero page equivalence class [ init_angle_screen::angle_w#0 ]
Added variable init_angle_screen::$10 to zero page equivalence class [ init_angle_screen::$10 ]
Added variable init_angle_screen::ang_w#0 to zero page equivalence class [ init_angle_screen::ang_w#0 ]
Added variable init_angle_screen::$12 to zero page equivalence class [ init_angle_screen::$12 ]
Added variable init_angle_screen::$13 to zero page equivalence class [ init_angle_screen::$13 ]
Added variable init_angle_screen::$14 to zero page equivalence class [ init_angle_screen::$14 ]
Added variable atan2_16::$24 to zero page equivalence class [ atan2_16::$24 ]
Added variable atan2_16::$23 to zero page equivalence class [ atan2_16::$23 ]
Added variable init_font_hex::$0 to zero page equivalence class [ init_font_hex::$0 ]
Added variable init_font_hex::$1 to zero page equivalence class [ init_font_hex::$1 ]
Added variable init_font_hex::$2 to zero page equivalence class [ init_font_hex::$2 ]
Added variable init_font_hex::idx#3 to zero page equivalence class [ init_font_hex::idx#3 ]
Complete equivalence classes
[ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ]
[ print_word_at::at#2 ]
[ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ]
[ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ]
[ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ]
[ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ]
[ init_angle_screen::y#4 init_angle_screen::y#1 ]
[ init_angle_screen::screen_topline#5 init_angle_screen::screen_topline#1 ]
[ init_angle_screen::screen_bottomline#5 init_angle_screen::screen_bottomline#1 ]
[ init_angle_screen::x#2 init_angle_screen::x#1 ]
[ init_angle_screen::xb#2 init_angle_screen::xb#1 ]
[ atan2_16::yi#3 atan2_16::yi#8 atan2_16::yi#0 atan2_16::yi#16 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ]
[ atan2_16::xi#3 atan2_16::xi#8 atan2_16::xi#0 atan2_16::xi#13 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ]
[ atan2_16::i#2 atan2_16::i#1 ]
[ 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::shift#2 atan2_16::shift#5 atan2_16::shift#1 ]
[ atan2_16::yd#5 atan2_16::yd#3 atan2_16::yd#10 atan2_16::yd#1 atan2_16::yd#2 ]
[ atan2_16::xd#5 atan2_16::xd#3 atan2_16::xd#10 atan2_16::xd#1 atan2_16::xd#2 ]
[ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ]
[ init_font_hex::c#6 init_font_hex::c#1 ]
[ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ]
[ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ]
[ init_font_hex::c1#4 init_font_hex::c1#1 ]
[ init_font_hex::i#2 init_font_hex::i#1 ]
[ init_font_hex::idx#5 init_font_hex::idx#2 ]
[ clock::return#2 ]
[ main::$4 ]
[ main::cyclecount#0 ]
[ print_dword_at::dw#0 ]
[ print_byte_at::$0 ]
[ print_byte_at::$2 ]
[ clock::return#0 ]
[ init_angle_screen::$2 ]
[ init_angle_screen::$3 ]
[ init_angle_screen::xw#0 ]
[ init_angle_screen::$6 ]
[ init_angle_screen::yw#0 ]
[ atan2_16::x#0 ]
[ atan2_16::y#0 ]
[ atan2_16::return#2 ]
[ init_angle_screen::angle_w#0 ]
[ init_angle_screen::$10 ]
[ init_angle_screen::ang_w#0 ]
[ init_angle_screen::$12 ]
[ init_angle_screen::$13 ]
[ init_angle_screen::$14 ]
[ atan2_16::$24 ]
[ atan2_16::$23 ]
[ init_font_hex::$0 ]
[ init_font_hex::$1 ]
[ init_font_hex::$2 ]
[ init_font_hex::idx#3 ]
Allocated zp ZP_WORD:2 [ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ]
Allocated zp ZP_WORD:4 [ print_word_at::at#2 ]
Allocated zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ]
Allocated zp ZP_WORD:7 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ]
Allocated zp ZP_BYTE:9 [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ]
Allocated zp ZP_WORD:10 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ]
Allocated zp ZP_BYTE:12 [ init_angle_screen::y#4 init_angle_screen::y#1 ]
Allocated zp ZP_WORD:13 [ init_angle_screen::screen_topline#5 init_angle_screen::screen_topline#1 ]
Allocated zp ZP_WORD:15 [ init_angle_screen::screen_bottomline#5 init_angle_screen::screen_bottomline#1 ]
Allocated zp ZP_BYTE:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ]
Allocated zp ZP_BYTE:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ]
Allocated zp ZP_WORD:19 [ atan2_16::yi#3 atan2_16::yi#8 atan2_16::yi#0 atan2_16::yi#16 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ]
Allocated zp ZP_WORD:21 [ atan2_16::xi#3 atan2_16::xi#8 atan2_16::xi#0 atan2_16::xi#13 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ]
Allocated zp ZP_BYTE:23 [ atan2_16::i#2 atan2_16::i#1 ]
Allocated zp ZP_WORD:24 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ]
Allocated zp ZP_WORD:26 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ]
Allocated zp ZP_BYTE:28 [ atan2_16::shift#2 atan2_16::shift#5 atan2_16::shift#1 ]
Allocated zp ZP_WORD:29 [ atan2_16::yd#5 atan2_16::yd#3 atan2_16::yd#10 atan2_16::yd#1 atan2_16::yd#2 ]
Allocated zp ZP_WORD:31 [ atan2_16::xd#5 atan2_16::xd#3 atan2_16::xd#10 atan2_16::xd#1 atan2_16::xd#2 ]
Allocated zp ZP_WORD:33 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ]
Allocated zp ZP_BYTE:35 [ init_font_hex::c#6 init_font_hex::c#1 ]
Allocated zp ZP_WORD:36 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ]
Allocated zp ZP_WORD:38 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ]
Allocated zp ZP_BYTE:40 [ init_font_hex::c1#4 init_font_hex::c1#1 ]
Allocated zp ZP_BYTE:41 [ init_font_hex::i#2 init_font_hex::i#1 ]
Allocated zp ZP_BYTE:42 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
Allocated zp ZP_DWORD:43 [ clock::return#2 ]
Allocated zp ZP_DWORD:47 [ main::$4 ]
Allocated zp ZP_DWORD:51 [ main::cyclecount#0 ]
Allocated zp ZP_DWORD:55 [ print_dword_at::dw#0 ]
Allocated zp ZP_BYTE:59 [ print_byte_at::$0 ]
Allocated zp ZP_BYTE:60 [ print_byte_at::$2 ]
Allocated zp ZP_DWORD:61 [ clock::return#0 ]
Allocated zp ZP_BYTE:65 [ init_angle_screen::$2 ]
Allocated zp ZP_BYTE:66 [ init_angle_screen::$3 ]
Allocated zp ZP_WORD:67 [ init_angle_screen::xw#0 ]
Allocated zp ZP_BYTE:69 [ init_angle_screen::$6 ]
Allocated zp ZP_WORD:70 [ init_angle_screen::yw#0 ]
Allocated zp ZP_WORD:72 [ atan2_16::x#0 ]
Allocated zp ZP_WORD:74 [ atan2_16::y#0 ]
Allocated zp ZP_WORD:76 [ atan2_16::return#2 ]
Allocated zp ZP_WORD:78 [ init_angle_screen::angle_w#0 ]
Allocated zp ZP_WORD:80 [ init_angle_screen::$10 ]
Allocated zp ZP_BYTE:82 [ init_angle_screen::ang_w#0 ]
Allocated zp ZP_BYTE:83 [ init_angle_screen::$12 ]
Allocated zp ZP_BYTE:84 [ init_angle_screen::$13 ]
Allocated zp ZP_BYTE:85 [ init_angle_screen::$14 ]
Allocated zp ZP_BYTE:86 [ atan2_16::$24 ]
Allocated zp ZP_BYTE:87 [ atan2_16::$23 ]
Allocated zp ZP_BYTE:88 [ init_font_hex::$0 ]
Allocated zp ZP_BYTE:89 [ init_font_hex::$1 ]
Allocated zp ZP_BYTE:90 [ init_font_hex::$2 ]
Allocated zp ZP_BYTE:91 [ init_font_hex::idx#3 ]
INITIAL ASM
//SEG0 File Comments
// Calculate the angle to the center of the screen - and show it using font-hex
// 4.65 million cycles
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.label D018 = $d018
// CIA #2 Timer A+B Value (32-bit)
.label CIA2_TIMER_AB = $dd04
// CIA #2 Timer A Control Register
.label CIA2_TIMER_A_CONTROL = $dd0e
// CIA #2 Timer B Control Register
.label CIA2_TIMER_B_CONTROL = $dd0f
// Timer Control - Start/stop timer (0:stop, 1: start)
.const CIA_TIMER_CONTROL_START = 1
// Timer Control - Time CONTINUOUS/ONE-SHOT (0:CONTINUOUS, 1: ONE-SHOT)
.const CIA_TIMER_CONTROL_CONTINUOUS = 0
// Timer B Control - Timer counts (00:system cycles, 01: CNT pulses, 10: timer A underflow, 11: time A underflow while CNT is high)
.const CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = $40
// The number of iterations performed during 16-bit CORDIC atan2 calculation
.const CORDIC_ITERATIONS_16 = $f
// Clock cycles used to start & read the cycle clock by calling clock_start() and clock() once. Can be subtracted when calculating the number of cycles used by a routine.
// To make precise cycle measurements interrupts and the display must be disabled so neither steals any cycles from the code.
.const CLOCKS_PER_INIT = $12
.label CHARSET = $2000
.label SCREEN = $2800
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
jmp b1
//SEG5 @1
b1:
//SEG6 [2] call main
//SEG7 [4] phi from @1 to main [phi:@1->main]
main_from_b1:
jsr main
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
jmp bend
//SEG9 @end
bend:
//SEG10 main
main: {
.label BASE_SCREEN = $400
.label BASE_CHARSET = $1000
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET)/4&$f
.const toD0182_return = (>(BASE_SCREEN&$3fff)*4)|(>BASE_CHARSET)/4&$f
.label _4 = $2f
.label cyclecount = $33
//SEG11 [5] call init_font_hex
//SEG12 [128] phi from main to init_font_hex [phi:main->init_font_hex]
init_font_hex_from_main:
jsr init_font_hex
//SEG13 [6] phi from main to main::toD0181 [phi:main->main::toD0181]
toD0181_from_main:
jmp toD0181
//SEG14 main::toD0181
toD0181:
jmp b1
//SEG15 main::@1
b1:
//SEG16 [7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2
lda #toD0181_return
sta D018
//SEG17 [8] call clock_start
jsr clock_start
//SEG18 [9] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
b3_from_b1:
jmp b3
//SEG19 main::@3
b3:
//SEG20 [10] call init_angle_screen
//SEG21 [49] phi from main::@3 to init_angle_screen [phi:main::@3->init_angle_screen]
init_angle_screen_from_b3:
jsr init_angle_screen
//SEG22 [11] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
b4_from_b3:
jmp b4
//SEG23 main::@4
b4:
//SEG24 [12] call clock
jsr clock
//SEG25 [13] (dword) clock::return#2 ← (dword) clock::return#0 -- vduz1=vduz2
lda clock.return
sta clock.return_2
lda clock.return+1
sta clock.return_2+1
lda clock.return+2
sta clock.return_2+2
lda clock.return+3
sta clock.return_2+3
jmp b5
//SEG26 main::@5
b5:
//SEG27 [14] (dword~) main::$4 ← (dword) clock::return#2 -- vduz1=vduz2
lda clock.return_2
sta _4
lda clock.return_2+1
sta _4+1
lda clock.return_2+2
sta _4+2
lda clock.return_2+3
sta _4+3
//SEG28 [15] (dword) main::cyclecount#0 ← (dword~) main::$4 - (const dword) CLOCKS_PER_INIT#0 -- vduz1=vduz2_minus_vduc1
lda _4
sec
sbc #<CLOCKS_PER_INIT
sta cyclecount
lda _4+1
sbc #>CLOCKS_PER_INIT
sta cyclecount+1
lda _4+2
sbc #<CLOCKS_PER_INIT>>$10
sta cyclecount+2
lda _4+3
sbc #>CLOCKS_PER_INIT>>$10
sta cyclecount+3
//SEG29 [16] (dword) print_dword_at::dw#0 ← (dword) main::cyclecount#0 -- vduz1=vduz2
lda cyclecount
sta print_dword_at.dw
lda cyclecount+1
sta print_dword_at.dw+1
lda cyclecount+2
sta print_dword_at.dw+2
lda cyclecount+3
sta print_dword_at.dw+3
//SEG30 [17] call print_dword_at
jsr print_dword_at
//SEG31 [18] phi from main::@5 to main::toD0182 [phi:main::@5->main::toD0182]
toD0182_from_b5:
jmp toD0182
//SEG32 main::toD0182
toD0182:
jmp b2
//SEG33 main::@2
b2:
//SEG34 [19] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2
lda #toD0182_return
sta D018
jmp breturn
//SEG35 main::@return
breturn:
//SEG36 [20] return
rts
}
//SEG37 print_dword_at
// Print a dword as HEX at a specific position
// print_dword_at(dword zeropage($37) dw)
print_dword_at: {
.label dw = $37
//SEG38 [21] (word) print_word_at::w#0 ← > (dword) print_dword_at::dw#0 -- vwuz1=_hi_vduz2
lda dw+2
sta print_word_at.w
lda dw+3
sta print_word_at.w+1
//SEG39 [22] call print_word_at
//SEG40 [26] phi from print_dword_at to print_word_at [phi:print_dword_at->print_word_at]
print_word_at_from_print_dword_at:
//SEG41 [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0 [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1
lda #<main.BASE_SCREEN
sta print_word_at.at
lda #>main.BASE_SCREEN
sta print_word_at.at+1
//SEG42 [26] phi (word) print_word_at::w#2 = (word) print_word_at::w#0 [phi:print_dword_at->print_word_at#1] -- register_copy
jsr print_word_at
jmp b1
//SEG43 print_dword_at::@1
b1:
//SEG44 [23] (word) print_word_at::w#1 ← < (dword) print_dword_at::dw#0 -- vwuz1=_lo_vduz2
lda dw
sta print_word_at.w
lda dw+1
sta print_word_at.w+1
//SEG45 [24] call print_word_at
//SEG46 [26] phi from print_dword_at::@1 to print_word_at [phi:print_dword_at::@1->print_word_at]
print_word_at_from_b1:
//SEG47 [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1
lda #<main.BASE_SCREEN+4
sta print_word_at.at
lda #>main.BASE_SCREEN+4
sta print_word_at.at+1
//SEG48 [26] phi (word) print_word_at::w#2 = (word) print_word_at::w#1 [phi:print_dword_at::@1->print_word_at#1] -- register_copy
jsr print_word_at
jmp breturn
//SEG49 print_dword_at::@return
breturn:
//SEG50 [25] return
rts
}
//SEG51 print_word_at
// Print a word as HEX at a specific position
// print_word_at(word zeropage(2) w, byte* zeropage(4) at)
print_word_at: {
.label w = 2
.label at = 4
//SEG52 [27] (byte) print_byte_at::b#0 ← > (word) print_word_at::w#2 -- vbuz1=_hi_vwuz2
lda w+1
sta print_byte_at.b
//SEG53 [28] (byte*) print_byte_at::at#0 ← (byte*) print_word_at::at#2 -- pbuz1=pbuz2
lda at
sta print_byte_at.at
lda at+1
sta print_byte_at.at+1
//SEG54 [29] call print_byte_at
//SEG55 [34] phi from print_word_at to print_byte_at [phi:print_word_at->print_byte_at]
print_byte_at_from_print_word_at:
//SEG56 [34] phi (byte*) print_byte_at::at#2 = (byte*) print_byte_at::at#0 [phi:print_word_at->print_byte_at#0] -- register_copy
//SEG57 [34] phi (byte) print_byte_at::b#2 = (byte) print_byte_at::b#0 [phi:print_word_at->print_byte_at#1] -- register_copy
jsr print_byte_at
jmp b1
//SEG58 print_word_at::@1
b1:
//SEG59 [30] (byte) print_byte_at::b#1 ← < (word) print_word_at::w#2 -- vbuz1=_lo_vwuz2
lda w
sta print_byte_at.b
//SEG60 [31] (byte*) print_byte_at::at#1 ← (byte*) print_word_at::at#2 + (byte) 2 -- pbuz1=pbuz2_plus_2
lda at
clc
adc #2
sta print_byte_at.at
lda at+1
adc #0
sta print_byte_at.at+1
//SEG61 [32] call print_byte_at
//SEG62 [34] phi from print_word_at::@1 to print_byte_at [phi:print_word_at::@1->print_byte_at]
print_byte_at_from_b1:
//SEG63 [34] phi (byte*) print_byte_at::at#2 = (byte*) print_byte_at::at#1 [phi:print_word_at::@1->print_byte_at#0] -- register_copy
//SEG64 [34] phi (byte) print_byte_at::b#2 = (byte) print_byte_at::b#1 [phi:print_word_at::@1->print_byte_at#1] -- register_copy
jsr print_byte_at
jmp breturn
//SEG65 print_word_at::@return
breturn:
//SEG66 [33] return
rts
}
//SEG67 print_byte_at
// Print a byte as HEX at a specific position
// print_byte_at(byte zeropage(6) b, byte* zeropage(7) at)
print_byte_at: {
.label _0 = $3b
.label _2 = $3c
.label b = 6
.label at = 7
//SEG68 [35] (byte~) print_byte_at::$0 ← (byte) print_byte_at::b#2 >> (byte) 4 -- vbuz1=vbuz2_ror_4
lda b
lsr
lsr
lsr
lsr
sta _0
//SEG69 [36] (byte) print_char_at::ch#0 ← *((const byte[]) print_hextab#0 + (byte~) print_byte_at::$0) -- vbuz1=pbuc1_derefidx_vbuz2
ldy _0
lda print_hextab,y
sta print_char_at.ch
//SEG70 [37] (byte*) print_char_at::at#0 ← (byte*) print_byte_at::at#2 -- pbuz1=pbuz2
lda at
sta print_char_at.at
lda at+1
sta print_char_at.at+1
//SEG71 [38] call print_char_at
//SEG72 [44] phi from print_byte_at to print_char_at [phi:print_byte_at->print_char_at]
print_char_at_from_print_byte_at:
//SEG73 [44] phi (byte*) print_char_at::at#2 = (byte*) print_char_at::at#0 [phi:print_byte_at->print_char_at#0] -- register_copy
//SEG74 [44] phi (byte) print_char_at::ch#2 = (byte) print_char_at::ch#0 [phi:print_byte_at->print_char_at#1] -- register_copy
jsr print_char_at
jmp b1
//SEG75 print_byte_at::@1
b1:
//SEG76 [39] (byte~) print_byte_at::$2 ← (byte) print_byte_at::b#2 & (byte) $f -- vbuz1=vbuz2_band_vbuc1
lda #$f
and b
sta _2
//SEG77 [40] (byte*) print_char_at::at#1 ← (byte*) print_byte_at::at#2 + (byte) 1 -- pbuz1=pbuz2_plus_1
lda at
clc
adc #1
sta print_char_at.at
lda at+1
adc #0
sta print_char_at.at+1
//SEG78 [41] (byte) print_char_at::ch#1 ← *((const byte[]) print_hextab#0 + (byte~) print_byte_at::$2) -- vbuz1=pbuc1_derefidx_vbuz2
ldy _2
lda print_hextab,y
sta print_char_at.ch
//SEG79 [42] call print_char_at
//SEG80 [44] phi from print_byte_at::@1 to print_char_at [phi:print_byte_at::@1->print_char_at]
print_char_at_from_b1:
//SEG81 [44] phi (byte*) print_char_at::at#2 = (byte*) print_char_at::at#1 [phi:print_byte_at::@1->print_char_at#0] -- register_copy
//SEG82 [44] phi (byte) print_char_at::ch#2 = (byte) print_char_at::ch#1 [phi:print_byte_at::@1->print_char_at#1] -- register_copy
jsr print_char_at
jmp breturn
//SEG83 print_byte_at::@return
breturn:
//SEG84 [43] return
rts
}
//SEG85 print_char_at
// Print a single char
// print_char_at(byte zeropage(9) ch, byte* zeropage($a) at)
print_char_at: {
.label ch = 9
.label at = $a
//SEG86 [45] *((byte*) print_char_at::at#2) ← (byte) print_char_at::ch#2 -- _deref_pbuz1=vbuz2
lda ch
ldy #0
sta (at),y
jmp breturn
//SEG87 print_char_at::@return
breturn:
//SEG88 [46] return
rts
}
//SEG89 clock
// Returns the processor clock time used since the beginning of an implementation defined era (normally the beginning of the program).
// This uses CIA #2 Timer A+B on the C64, and must be initialized using clock_start()
clock: {
.label return = $3d
.label return_2 = $2b
//SEG90 [47] (dword) clock::return#0 ← (dword) $ffffffff - *((const dword*) CIA2_TIMER_AB#0) -- vduz1=vduc1_minus__deref_pduc2
lda #<$ffffffff
sec
sbc CIA2_TIMER_AB
sta return
lda #>$ffffffff
sbc CIA2_TIMER_AB+1
sta return+1
lda #<$ffffffff>>$10
sbc CIA2_TIMER_AB+2
sta return+2
lda #>$ffffffff>>$10
sbc CIA2_TIMER_AB+3
sta return+3
jmp breturn
//SEG91 clock::@return
breturn:
//SEG92 [48] return
rts
}
//SEG93 init_angle_screen
// Populates 1000 bytes (a screen) with values representing the angle to the center.
// Utilizes symmetry around the center
init_angle_screen: {
.label _2 = $41
.label _3 = $42
.label _6 = $45
.label _10 = $50
.label _12 = $53
.label _13 = $54
.label _14 = $55
.label xw = $43
.label yw = $46
.label angle_w = $4e
.label ang_w = $52
.label x = $11
.label xb = $12
.label screen_topline = $d
.label screen_bottomline = $f
.label y = $c
//SEG94 [50] phi from init_angle_screen to init_angle_screen::@1 [phi:init_angle_screen->init_angle_screen::@1]
b1_from_init_angle_screen:
//SEG95 [50] phi (byte*) init_angle_screen::screen_bottomline#5 = (const byte*) SCREEN#0+(word)(number) $28*(number) $c [phi:init_angle_screen->init_angle_screen::@1#0] -- pbuz1=pbuc1
lda #<SCREEN+$28*$c
sta screen_bottomline
lda #>SCREEN+$28*$c
sta screen_bottomline+1
//SEG96 [50] phi (byte*) init_angle_screen::screen_topline#5 = (const byte*) SCREEN#0+(word)(number) $28*(number) $c [phi:init_angle_screen->init_angle_screen::@1#1] -- pbuz1=pbuc1
lda #<SCREEN+$28*$c
sta screen_topline
lda #>SCREEN+$28*$c
sta screen_topline+1
//SEG97 [50] phi (byte) init_angle_screen::y#4 = (byte) 0 [phi:init_angle_screen->init_angle_screen::@1#2] -- vbuz1=vbuc1
lda #0
sta y
jmp b1
//SEG98 [50] phi from init_angle_screen::@3 to init_angle_screen::@1 [phi:init_angle_screen::@3->init_angle_screen::@1]
b1_from_b3:
//SEG99 [50] phi (byte*) init_angle_screen::screen_bottomline#5 = (byte*) init_angle_screen::screen_bottomline#1 [phi:init_angle_screen::@3->init_angle_screen::@1#0] -- register_copy
//SEG100 [50] phi (byte*) init_angle_screen::screen_topline#5 = (byte*) init_angle_screen::screen_topline#1 [phi:init_angle_screen::@3->init_angle_screen::@1#1] -- register_copy
//SEG101 [50] phi (byte) init_angle_screen::y#4 = (byte) init_angle_screen::y#1 [phi:init_angle_screen::@3->init_angle_screen::@1#2] -- register_copy
jmp b1
//SEG102 init_angle_screen::@1
b1:
//SEG103 [51] phi from init_angle_screen::@1 to init_angle_screen::@2 [phi:init_angle_screen::@1->init_angle_screen::@2]
b2_from_b1:
//SEG104 [51] phi (byte) init_angle_screen::xb#2 = (byte) $27 [phi:init_angle_screen::@1->init_angle_screen::@2#0] -- vbuz1=vbuc1
lda #$27
sta xb
//SEG105 [51] phi (byte) init_angle_screen::x#2 = (byte) 0 [phi:init_angle_screen::@1->init_angle_screen::@2#1] -- vbuz1=vbuc1
lda #0
sta x
jmp b2
//SEG106 [51] phi from init_angle_screen::@4 to init_angle_screen::@2 [phi:init_angle_screen::@4->init_angle_screen::@2]
b2_from_b4:
//SEG107 [51] phi (byte) init_angle_screen::xb#2 = (byte) init_angle_screen::xb#1 [phi:init_angle_screen::@4->init_angle_screen::@2#0] -- register_copy
//SEG108 [51] phi (byte) init_angle_screen::x#2 = (byte) init_angle_screen::x#1 [phi:init_angle_screen::@4->init_angle_screen::@2#1] -- register_copy
jmp b2
//SEG109 init_angle_screen::@2
b2:
//SEG110 [52] (byte~) init_angle_screen::$2 ← (byte) init_angle_screen::x#2 << (byte) 1 -- vbuz1=vbuz2_rol_1
lda x
asl
sta _2
//SEG111 [53] (byte~) init_angle_screen::$3 ← (byte) $27 - (byte~) init_angle_screen::$2 -- vbuz1=vbuc1_minus_vbuz2
lda #$27
sec
sbc _2
sta _3
//SEG112 [54] (word) init_angle_screen::xw#0 ← (byte~) init_angle_screen::$3 w= (byte) 0 -- vwuz1=vbuz2_word_vbuc1
lda _3
ldy #0
sta xw+1
sty xw
//SEG113 [55] (byte~) init_angle_screen::$6 ← (byte) init_angle_screen::y#4 << (byte) 1 -- vbuz1=vbuz2_rol_1
lda y
asl
sta _6
//SEG114 [56] (word) init_angle_screen::yw#0 ← (byte~) init_angle_screen::$6 w= (byte) 0 -- vwuz1=vbuz2_word_vbuc1
lda _6
ldy #0
sta yw+1
sty yw
//SEG115 [57] (signed word) atan2_16::x#0 ← (signed word)(word) init_angle_screen::xw#0 -- vwsz1=vwsz2
lda xw
sta atan2_16.x
lda xw+1
sta atan2_16.x+1
//SEG116 [58] (signed word) atan2_16::y#0 ← (signed word)(word) init_angle_screen::yw#0 -- vwsz1=vwsz2
lda yw
sta atan2_16.y
lda yw+1
sta atan2_16.y+1
//SEG117 [59] call atan2_16
jsr atan2_16
//SEG118 [60] (word) atan2_16::return#2 ← (word) atan2_16::return#0 -- vwuz1=vwuz2
lda atan2_16.return
sta atan2_16.return_2
lda atan2_16.return+1
sta atan2_16.return_2+1
jmp b4
//SEG119 init_angle_screen::@4
b4:
//SEG120 [61] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2 -- vwuz1=vwuz2
lda atan2_16.return_2
sta angle_w
lda atan2_16.return_2+1
sta angle_w+1
//SEG121 [62] (word~) init_angle_screen::$10 ← (word) init_angle_screen::angle_w#0 + (byte) $80 -- vwuz1=vwuz2_plus_vbuc1
lda #$80
clc
adc angle_w
sta _10
lda #0
adc angle_w+1
sta _10+1
//SEG122 [63] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$10 -- vbuz1=_hi_vwuz2
lda _10+1
sta ang_w
//SEG123 [64] (byte~) init_angle_screen::$12 ← (byte) $80 + (byte) init_angle_screen::ang_w#0 -- vbuz1=vbuc1_plus_vbuz2
lax ang_w
axs #-[$80]
stx _12
//SEG124 [65] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$12 -- pbuz1_derefidx_vbuz2=vbuz3
lda _12
ldy x
sta (screen_topline),y
//SEG125 [66] (byte~) init_angle_screen::$13 ← (byte) $80 - (byte) init_angle_screen::ang_w#0 -- vbuz1=vbuc1_minus_vbuz2
lda #$80
sec
sbc ang_w
sta _13
//SEG126 [67] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$13 -- pbuz1_derefidx_vbuz2=vbuz3
lda _13
ldy x
sta (screen_bottomline),y
//SEG127 [68] (byte~) init_angle_screen::$14 ← - (byte) init_angle_screen::ang_w#0 -- vbuz1=_neg_vbuz2
lda ang_w
eor #$ff
clc
adc #1
sta _14
//SEG128 [69] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::xb#2) ← (byte~) init_angle_screen::$14 -- pbuz1_derefidx_vbuz2=vbuz3
lda _14
ldy xb
sta (screen_topline),y
//SEG129 [70] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::xb#2) ← (byte) init_angle_screen::ang_w#0 -- pbuz1_derefidx_vbuz2=vbuz3
lda ang_w
ldy xb
sta (screen_bottomline),y
//SEG130 [71] (byte) init_angle_screen::x#1 ← ++ (byte) init_angle_screen::x#2 -- vbuz1=_inc_vbuz1
inc x
//SEG131 [72] (byte) init_angle_screen::xb#1 ← -- (byte) init_angle_screen::xb#2 -- vbuz1=_dec_vbuz1
dec xb
//SEG132 [73] if((byte) init_angle_screen::x#1<(byte) $13+(byte) 1) goto init_angle_screen::@2 -- vbuz1_lt_vbuc1_then_la1
lda x
cmp #$13+1
bcc b2_from_b4
jmp b3
//SEG133 init_angle_screen::@3
b3:
//SEG134 [74] (byte*) init_angle_screen::screen_topline#1 ← (byte*) init_angle_screen::screen_topline#5 - (byte) $28 -- pbuz1=pbuz1_minus_vwuc1
lda screen_topline
sec
sbc #<$28
sta screen_topline
lda screen_topline+1
sbc #>$28
sta screen_topline+1
//SEG135 [75] (byte*) init_angle_screen::screen_bottomline#1 ← (byte*) init_angle_screen::screen_bottomline#5 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc screen_bottomline
sta screen_bottomline
bcc !+
inc screen_bottomline+1
!:
//SEG136 [76] (byte) init_angle_screen::y#1 ← ++ (byte) init_angle_screen::y#4 -- vbuz1=_inc_vbuz1
inc y
//SEG137 [77] if((byte) init_angle_screen::y#1!=(byte) $d) goto init_angle_screen::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$d
cmp y
bne b1_from_b3
jmp breturn
//SEG138 init_angle_screen::@return
breturn:
//SEG139 [78] return
rts
}
//SEG140 atan2_16
// 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($48) x, signed word zeropage($4a) y)
atan2_16: {
.label _2 = $13
.label _7 = $15
.label _23 = $57
.label _24 = $56
.label yi = $13
.label xi = $15
.label angle = $1a
.label xd = $1f
.label yd = $1d
.label shift = $1c
.label angle_2 = $18
.label angle_3 = $18
.label i = $17
.label return = $1a
.label x = $48
.label y = $4a
.label return_2 = $4c
.label angle_6 = $18
.label angle_12 = $18
.label angle_13 = $18
//SEG141 [79] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1 -- vwsz1_ge_0_then_la1
lda y+1
bpl b1
jmp b2
//SEG142 atan2_16::@2
b2:
//SEG143 [80] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0 -- vwsz1=_neg_vwsz2
sec
lda #0
sbc y
sta _2
lda #0
sbc y+1
sta _2+1
//SEG144 [81] phi from atan2_16::@1 atan2_16::@2 to atan2_16::@3 [phi:atan2_16::@1/atan2_16::@2->atan2_16::@3]
b3_from_b1:
b3_from_b2:
//SEG145 [81] phi (signed word) atan2_16::yi#0 = (signed word~) atan2_16::yi#16 [phi:atan2_16::@1/atan2_16::@2->atan2_16::@3#0] -- register_copy
jmp b3
//SEG146 atan2_16::@3
b3:
//SEG147 [82] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4 -- vwsz1_ge_0_then_la1
lda x+1
bpl b4
jmp b5
//SEG148 atan2_16::@5
b5:
//SEG149 [83] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0 -- vwsz1=_neg_vwsz2
sec
lda #0
sbc x
sta _7
lda #0
sbc x+1
sta _7+1
//SEG150 [84] phi from atan2_16::@4 atan2_16::@5 to atan2_16::@6 [phi:atan2_16::@4/atan2_16::@5->atan2_16::@6]
b6_from_b4:
b6_from_b5:
//SEG151 [84] phi (signed word) atan2_16::xi#0 = (signed word~) atan2_16::xi#13 [phi:atan2_16::@4/atan2_16::@5->atan2_16::@6#0] -- register_copy
jmp b6
//SEG152 atan2_16::@6
b6:
//SEG153 [85] phi from atan2_16::@6 to atan2_16::@10 [phi:atan2_16::@6->atan2_16::@10]
b10_from_b6:
//SEG154 [85] phi (word) atan2_16::angle#12 = (byte) 0 [phi:atan2_16::@6->atan2_16::@10#0] -- vwuz1=vbuc1
lda #0
sta angle_12
lda #0
sta angle_12+1
//SEG155 [85] phi (byte) atan2_16::i#2 = (byte) 0 [phi:atan2_16::@6->atan2_16::@10#1] -- vbuz1=vbuc1
lda #0
sta i
//SEG156 [85] phi (signed word) atan2_16::xi#3 = (signed word) atan2_16::xi#0 [phi:atan2_16::@6->atan2_16::@10#2] -- register_copy
//SEG157 [85] phi (signed word) atan2_16::yi#3 = (signed word) atan2_16::yi#0 [phi:atan2_16::@6->atan2_16::@10#3] -- register_copy
jmp b10
//SEG158 atan2_16::@10
b10:
//SEG159 [86] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11 -- vwsz1_neq_0_then_la1
lda yi+1
bne b11
lda yi
bne b11
//SEG160 [87] phi from atan2_16::@10 atan2_16::@19 to atan2_16::@12 [phi:atan2_16::@10/atan2_16::@19->atan2_16::@12]
b12_from_b10:
b12_from_b19:
//SEG161 [87] phi (word) atan2_16::angle#6 = (word) atan2_16::angle#12 [phi:atan2_16::@10/atan2_16::@19->atan2_16::@12#0] -- register_copy
jmp b12
//SEG162 atan2_16::@12
b12:
//SEG163 [88] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1 -- vwuz1=vwuz2_ror_1
lda angle_6+1
lsr
sta angle+1
lda angle_6
ror
sta angle
//SEG164 [89] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7 -- vwsz1_ge_0_then_la1
lda x+1
bpl b7_from_b12
jmp b21
//SEG165 atan2_16::@21
b21:
//SEG166 [90] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1 -- vwuz1=vwuc1_minus_vwuz1
sec
lda #<$8000
sbc angle
sta angle
lda #>$8000
sbc angle+1
sta angle+1
//SEG167 [91] phi from atan2_16::@12 atan2_16::@21 to atan2_16::@7 [phi:atan2_16::@12/atan2_16::@21->atan2_16::@7]
b7_from_b12:
b7_from_b21:
//SEG168 [91] phi (word) atan2_16::angle#11 = (word) atan2_16::angle#1 [phi:atan2_16::@12/atan2_16::@21->atan2_16::@7#0] -- register_copy
jmp b7
//SEG169 atan2_16::@7
b7:
//SEG170 [92] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8 -- vwsz1_ge_0_then_la1
lda y+1
bpl b8_from_b7
jmp b9
//SEG171 atan2_16::@9
b9:
//SEG172 [93] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11 -- vwuz1=_neg_vwuz1
sec
lda #0
sbc angle
sta angle
lda #0
sbc angle+1
sta angle+1
//SEG173 [94] phi from atan2_16::@7 atan2_16::@9 to atan2_16::@8 [phi:atan2_16::@7/atan2_16::@9->atan2_16::@8]
b8_from_b7:
b8_from_b9:
//SEG174 [94] phi (word) atan2_16::return#0 = (word) atan2_16::angle#11 [phi:atan2_16::@7/atan2_16::@9->atan2_16::@8#0] -- register_copy
jmp b8
//SEG175 atan2_16::@8
b8:
jmp breturn
//SEG176 atan2_16::@return
breturn:
//SEG177 [95] return
rts
//SEG178 atan2_16::@11
b11:
//SEG179 [96] (byte~) atan2_16::shift#5 ← (byte) atan2_16::i#2 -- vbuz1=vbuz2
lda i
sta shift
//SEG180 [97] (signed word~) atan2_16::xd#10 ← (signed word) atan2_16::xi#3 -- vwsz1=vwsz2
lda xi
sta xd
lda xi+1
sta xd+1
//SEG181 [98] (signed word~) atan2_16::yd#10 ← (signed word) atan2_16::yi#3 -- vwsz1=vwsz2
lda yi
sta yd
lda yi+1
sta yd+1
//SEG182 [99] phi from atan2_16::@11 atan2_16::@14 to atan2_16::@13 [phi:atan2_16::@11/atan2_16::@14->atan2_16::@13]
b13_from_b11:
b13_from_b14:
//SEG183 [99] phi (signed word) atan2_16::yd#3 = (signed word~) atan2_16::yd#10 [phi:atan2_16::@11/atan2_16::@14->atan2_16::@13#0] -- register_copy
//SEG184 [99] phi (signed word) atan2_16::xd#3 = (signed word~) atan2_16::xd#10 [phi:atan2_16::@11/atan2_16::@14->atan2_16::@13#1] -- register_copy
//SEG185 [99] phi (byte) atan2_16::shift#2 = (byte~) atan2_16::shift#5 [phi:atan2_16::@11/atan2_16::@14->atan2_16::@13#2] -- register_copy
jmp b13
//SEG186 atan2_16::@13
b13:
//SEG187 [100] if((byte) atan2_16::shift#2>=(byte) 1+(byte) 1) goto atan2_16::@14 -- vbuz1_ge_vbuc1_then_la1
lda shift
cmp #1+1
bcs b14
jmp b15
//SEG188 atan2_16::@15
b15:
//SEG189 [101] if((byte) 0==(byte) atan2_16::shift#2) goto atan2_16::@17 -- vbuc1_eq_vbuz1_then_la1
lda #0
cmp shift
beq b17_from_b15
jmp b16
//SEG190 atan2_16::@16
b16:
//SEG191 [102] (signed word) atan2_16::xd#2 ← (signed word) atan2_16::xd#3 >> (signed byte) 1 -- vwsz1=vwsz1_ror_1
lda xd+1
cmp #$80
ror xd+1
ror xd
//SEG192 [103] (signed word) atan2_16::yd#2 ← (signed word) atan2_16::yd#3 >> (signed byte) 1 -- vwsz1=vwsz1_ror_1
lda yd+1
cmp #$80
ror yd+1
ror yd
//SEG193 [104] phi from atan2_16::@15 atan2_16::@16 to atan2_16::@17 [phi:atan2_16::@15/atan2_16::@16->atan2_16::@17]
b17_from_b15:
b17_from_b16:
//SEG194 [104] phi (signed word) atan2_16::xd#5 = (signed word) atan2_16::xd#3 [phi:atan2_16::@15/atan2_16::@16->atan2_16::@17#0] -- register_copy
//SEG195 [104] phi (signed word) atan2_16::yd#5 = (signed word) atan2_16::yd#3 [phi:atan2_16::@15/atan2_16::@16->atan2_16::@17#1] -- register_copy
jmp b17
//SEG196 atan2_16::@17
b17:
//SEG197 [105] if((signed word) atan2_16::yi#3>=(signed byte) 0) goto atan2_16::@18 -- vwsz1_ge_0_then_la1
lda yi+1
bpl b18
jmp b20
//SEG198 atan2_16::@20
b20:
//SEG199 [106] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#5 -- vwsz1=vwsz1_minus_vwsz2
lda xi
sec
sbc yd
sta xi
lda xi+1
sbc yd+1
sta xi+1
//SEG200 [107] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#5 -- vwsz1=vwsz1_plus_vwsz2
lda yi
clc
adc xd
sta yi
lda yi+1
adc xd+1
sta yi+1
//SEG201 [108] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1 -- vbuz1=vbuz2_rol_1
lda i
asl
sta _24
//SEG202 [109] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24) -- vwuz1=vwuz1_minus_pwuc1_derefidx_vbuz2
ldy _24
sec
lda angle_3
sbc CORDIC_ATAN2_ANGLES_16,y
sta angle_3
lda angle_3+1
sbc CORDIC_ATAN2_ANGLES_16+1,y
sta angle_3+1
//SEG203 [110] phi from atan2_16::@18 atan2_16::@20 to atan2_16::@19 [phi:atan2_16::@18/atan2_16::@20->atan2_16::@19]
b19_from_b18:
b19_from_b20:
//SEG204 [110] phi (signed word) atan2_16::xi#8 = (signed word) atan2_16::xi#1 [phi:atan2_16::@18/atan2_16::@20->atan2_16::@19#0] -- register_copy
//SEG205 [110] phi (word) atan2_16::angle#13 = (word) atan2_16::angle#2 [phi:atan2_16::@18/atan2_16::@20->atan2_16::@19#1] -- register_copy
//SEG206 [110] phi (signed word) atan2_16::yi#8 = (signed word) atan2_16::yi#1 [phi:atan2_16::@18/atan2_16::@20->atan2_16::@19#2] -- register_copy
jmp b19
//SEG207 atan2_16::@19
b19:
//SEG208 [111] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2 -- vbuz1=_inc_vbuz1
inc i
//SEG209 [112] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0-(byte) 1+(byte) 1) goto atan2_16::@12 -- vbuz1_eq_vbuc1_then_la1
lda #CORDIC_ITERATIONS_16-1+1
cmp i
beq b12_from_b19
//SEG210 [85] phi from atan2_16::@19 to atan2_16::@10 [phi:atan2_16::@19->atan2_16::@10]
b10_from_b19:
//SEG211 [85] phi (word) atan2_16::angle#12 = (word) atan2_16::angle#13 [phi:atan2_16::@19->atan2_16::@10#0] -- register_copy
//SEG212 [85] phi (byte) atan2_16::i#2 = (byte) atan2_16::i#1 [phi:atan2_16::@19->atan2_16::@10#1] -- register_copy
//SEG213 [85] phi (signed word) atan2_16::xi#3 = (signed word) atan2_16::xi#8 [phi:atan2_16::@19->atan2_16::@10#2] -- register_copy
//SEG214 [85] phi (signed word) atan2_16::yi#3 = (signed word) atan2_16::yi#8 [phi:atan2_16::@19->atan2_16::@10#3] -- register_copy
jmp b10
//SEG215 atan2_16::@18
b18:
//SEG216 [113] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#5 -- vwsz1=vwsz1_plus_vwsz2
lda xi
clc
adc yd
sta xi
lda xi+1
adc yd+1
sta xi+1
//SEG217 [114] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#5 -- vwsz1=vwsz1_minus_vwsz2
lda yi
sec
sbc xd
sta yi
lda yi+1
sbc xd+1
sta yi+1
//SEG218 [115] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1 -- vbuz1=vbuz2_rol_1
lda i
asl
sta _23
//SEG219 [116] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23) -- vwuz1=vwuz1_plus_pwuc1_derefidx_vbuz2
ldy _23
clc
lda angle_2
adc CORDIC_ATAN2_ANGLES_16,y
sta angle_2
lda angle_2+1
adc CORDIC_ATAN2_ANGLES_16+1,y
sta angle_2+1
jmp b19_from_b18
//SEG220 atan2_16::@14
b14:
//SEG221 [117] (signed word) atan2_16::xd#1 ← (signed word) atan2_16::xd#3 >> (signed byte) 2 -- vwsz1=vwsz1_ror_2
lda xd+1
cmp #$80
ror xd+1
ror xd
lda xd+1
cmp #$80
ror xd+1
ror xd
//SEG222 [118] (signed word) atan2_16::yd#1 ← (signed word) atan2_16::yd#3 >> (signed byte) 2 -- vwsz1=vwsz1_ror_2
lda yd+1
cmp #$80
ror yd+1
ror yd
lda yd+1
cmp #$80
ror yd+1
ror yd
//SEG223 [119] (byte) atan2_16::shift#1 ← (byte) atan2_16::shift#2 - (byte) 2 -- vbuz1=vbuz1_minus_2
dec shift
dec shift
jmp b13_from_b14
//SEG224 atan2_16::@4
b4:
//SEG225 [120] (signed word~) atan2_16::xi#13 ← (signed word) atan2_16::x#0 -- vwsz1=vwsz2
lda x
sta xi
lda x+1
sta xi+1
jmp b6_from_b4
//SEG226 atan2_16::@1
b1:
//SEG227 [121] (signed word~) atan2_16::yi#16 ← (signed word) atan2_16::y#0 -- vwsz1=vwsz2
lda y
sta yi
lda y+1
sta yi+1
jmp b3_from_b1
}
//SEG228 clock_start
// Reset & start the processor clock time. The value can be read using clock().
// This uses CIA #2 Timer A+B on the C64
clock_start: {
//SEG229 [122] *((const byte*) CIA2_TIMER_A_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_CONTINUOUS#0 -- _deref_pbuc1=vbuc2
// Setup CIA#2 timer A to count (down) CPU cycles
lda #CIA_TIMER_CONTROL_CONTINUOUS
sta CIA2_TIMER_A_CONTROL
//SEG230 [123] *((const byte*) CIA2_TIMER_B_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
//SEG231 [124] *((const dword*) CIA2_TIMER_AB#0) ← (dword) $ffffffff -- _deref_pduc1=vduc2
lda #<$ffffffff
sta CIA2_TIMER_AB
lda #>$ffffffff
sta CIA2_TIMER_AB+1
lda #<$ffffffff>>$10
sta CIA2_TIMER_AB+2
lda #>$ffffffff>>$10
sta CIA2_TIMER_AB+3
//SEG232 [125] *((const byte*) CIA2_TIMER_B_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_START#0|(const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
//SEG233 [126] *((const byte*) CIA2_TIMER_A_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_START#0 -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START
sta CIA2_TIMER_A_CONTROL
jmp breturn
//SEG234 clock_start::@return
breturn:
//SEG235 [127] return
rts
}
//SEG236 init_font_hex
// Make charset from proto chars
// init_font_hex(byte* zeropage($24) charset)
init_font_hex: {
.label _0 = $58
.label _1 = $59
.label _2 = $5a
.label idx = $2a
.label i = $29
.label idx_3 = $5b
.label proto_lo = $26
.label charset = $24
.label c1 = $28
.label proto_hi = $21
.label c = $23
//SEG237 [129] phi from init_font_hex to init_font_hex::@1 [phi:init_font_hex->init_font_hex::@1]
b1_from_init_font_hex:
//SEG238 [129] phi (byte) init_font_hex::c#6 = (byte) 0 [phi:init_font_hex->init_font_hex::@1#0] -- vbuz1=vbuc1
lda #0
sta c
//SEG239 [129] phi (byte*) init_font_hex::proto_hi#6 = (const byte[]) FONT_HEX_PROTO#0 [phi:init_font_hex->init_font_hex::@1#1] -- pbuz1=pbuc1
lda #<FONT_HEX_PROTO
sta proto_hi
lda #>FONT_HEX_PROTO
sta proto_hi+1
//SEG240 [129] phi (byte*) init_font_hex::charset#5 = (const byte*) CHARSET#0 [phi:init_font_hex->init_font_hex::@1#2] -- pbuz1=pbuc1
lda #<CHARSET
sta charset
lda #>CHARSET
sta charset+1
jmp b1
//SEG241 [129] phi from init_font_hex::@5 to init_font_hex::@1 [phi:init_font_hex::@5->init_font_hex::@1]
b1_from_b5:
//SEG242 [129] phi (byte) init_font_hex::c#6 = (byte) init_font_hex::c#1 [phi:init_font_hex::@5->init_font_hex::@1#0] -- register_copy
//SEG243 [129] phi (byte*) init_font_hex::proto_hi#6 = (byte*) init_font_hex::proto_hi#1 [phi:init_font_hex::@5->init_font_hex::@1#1] -- register_copy
//SEG244 [129] phi (byte*) init_font_hex::charset#5 = (byte*) init_font_hex::charset#0 [phi:init_font_hex::@5->init_font_hex::@1#2] -- register_copy
jmp b1
//SEG245 init_font_hex::@1
b1:
//SEG246 [130] phi from init_font_hex::@1 to init_font_hex::@2 [phi:init_font_hex::@1->init_font_hex::@2]
b2_from_b1:
//SEG247 [130] phi (byte) init_font_hex::c1#4 = (byte) 0 [phi:init_font_hex::@1->init_font_hex::@2#0] -- vbuz1=vbuc1
lda #0
sta c1
//SEG248 [130] phi (byte*) init_font_hex::proto_lo#4 = (const byte[]) FONT_HEX_PROTO#0 [phi:init_font_hex::@1->init_font_hex::@2#1] -- pbuz1=pbuc1
lda #<FONT_HEX_PROTO
sta proto_lo
lda #>FONT_HEX_PROTO
sta proto_lo+1
//SEG249 [130] phi (byte*) init_font_hex::charset#2 = (byte*) init_font_hex::charset#5 [phi:init_font_hex::@1->init_font_hex::@2#2] -- register_copy
jmp b2
//SEG250 [130] phi from init_font_hex::@4 to init_font_hex::@2 [phi:init_font_hex::@4->init_font_hex::@2]
b2_from_b4:
//SEG251 [130] phi (byte) init_font_hex::c1#4 = (byte) init_font_hex::c1#1 [phi:init_font_hex::@4->init_font_hex::@2#0] -- register_copy
//SEG252 [130] phi (byte*) init_font_hex::proto_lo#4 = (byte*) init_font_hex::proto_lo#1 [phi:init_font_hex::@4->init_font_hex::@2#1] -- register_copy
//SEG253 [130] phi (byte*) init_font_hex::charset#2 = (byte*) init_font_hex::charset#0 [phi:init_font_hex::@4->init_font_hex::@2#2] -- register_copy
jmp b2
//SEG254 init_font_hex::@2
b2:
//SEG255 [131] *((byte*) init_font_hex::charset#2) ← (byte) 0 -- _deref_pbuz1=vbuc1
lda #0
ldy #0
sta (charset),y
//SEG256 [132] phi from init_font_hex::@2 to init_font_hex::@3 [phi:init_font_hex::@2->init_font_hex::@3]
b3_from_b2:
//SEG257 [132] phi (byte) init_font_hex::idx#5 = (byte) 1 [phi:init_font_hex::@2->init_font_hex::@3#0] -- vbuz1=vbuc1
lda #1
sta idx
//SEG258 [132] phi (byte) init_font_hex::i#2 = (byte) 0 [phi:init_font_hex::@2->init_font_hex::@3#1] -- vbuz1=vbuc1
lda #0
sta i
jmp b3
//SEG259 [132] phi from init_font_hex::@3 to init_font_hex::@3 [phi:init_font_hex::@3->init_font_hex::@3]
b3_from_b3:
//SEG260 [132] phi (byte) init_font_hex::idx#5 = (byte) init_font_hex::idx#2 [phi:init_font_hex::@3->init_font_hex::@3#0] -- register_copy
//SEG261 [132] phi (byte) init_font_hex::i#2 = (byte) init_font_hex::i#1 [phi:init_font_hex::@3->init_font_hex::@3#1] -- register_copy
jmp b3
//SEG262 init_font_hex::@3
b3:
//SEG263 [133] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4 -- vbuz1=pbuz2_derefidx_vbuz3_rol_4
ldy i
lda (proto_hi),y
asl
asl
asl
asl
sta _0
//SEG264 [134] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1 -- vbuz1=pbuz2_derefidx_vbuz3_rol_1
ldy i
lda (proto_lo),y
asl
sta _1
//SEG265 [135] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1 -- vbuz1=vbuz2_bor_vbuz3
lda _0
ora _1
sta _2
//SEG266 [136] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2 -- pbuz1_derefidx_vbuz2=vbuz3
lda _2
ldy idx
sta (charset),y
//SEG267 [137] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5 -- vbuz1=_inc_vbuz1
inc idx
//SEG268 [138] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2 -- vbuz1=_inc_vbuz1
inc i
//SEG269 [139] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3 -- vbuz1_neq_vbuc1_then_la1
lda #5
cmp i
bne b3_from_b3
jmp b4
//SEG270 init_font_hex::@4
b4:
//SEG271 [140] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0 -- pbuz1_derefidx_vbuz2=vbuc1
lda #0
ldy idx
sta (charset),y
//SEG272 [141] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2 -- vbuz1=_inc_vbuz2
ldy idx
iny
sty idx_3
//SEG273 [142] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0 -- pbuz1_derefidx_vbuz2=vbuc1
lda #0
ldy idx_3
sta (charset),y
//SEG274 [143] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5 -- pbuz1=pbuz1_plus_vbuc1
lda #5
clc
adc proto_lo
sta proto_lo
bcc !+
inc proto_lo+1
!:
//SEG275 [144] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8 -- pbuz1=pbuz1_plus_vbuc1
lda #8
clc
adc charset
sta charset
bcc !+
inc charset+1
!:
//SEG276 [145] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4 -- vbuz1=_inc_vbuz1
inc c1
//SEG277 [146] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2 -- vbuz1_neq_vbuc1_then_la1
lda #$10
cmp c1
bne b2_from_b4
jmp b5
//SEG278 init_font_hex::@5
b5:
//SEG279 [147] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5 -- pbuz1=pbuz1_plus_vbuc1
lda #5
clc
adc proto_hi
sta proto_hi
bcc !+
inc proto_hi+1
!:
//SEG280 [148] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6 -- vbuz1=_inc_vbuz1
inc c
//SEG281 [149] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$10
cmp c
bne b1_from_b5
jmp breturn
//SEG282 init_font_hex::@return
breturn:
//SEG283 [150] return
rts
}
//SEG284 File Data
// 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
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
CORDIC_ATAN2_ANGLES_16:
.for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
print_hextab: .text "0123456789abcdef"
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [13] (dword) clock::return#2 ← (dword) clock::return#0 [ clock::return#2 ] ( main:2 [ clock::return#2 ] ) always clobbers reg byte a
Statement [14] (dword~) main::$4 ← (dword) clock::return#2 [ main::$4 ] ( main:2 [ main::$4 ] ) always clobbers reg byte a
Statement [15] (dword) main::cyclecount#0 ← (dword~) main::$4 - (const dword) CLOCKS_PER_INIT#0 [ main::cyclecount#0 ] ( main:2 [ main::cyclecount#0 ] ) always clobbers reg byte a
Statement [16] (dword) print_dword_at::dw#0 ← (dword) main::cyclecount#0 [ print_dword_at::dw#0 ] ( main:2 [ print_dword_at::dw#0 ] ) always clobbers reg byte a
Statement [19] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [21] (word) print_word_at::w#0 ← > (dword) print_dword_at::dw#0 [ print_dword_at::dw#0 print_word_at::w#0 ] ( main:2::print_dword_at:17 [ print_dword_at::dw#0 print_word_at::w#0 ] ) always clobbers reg byte a
Statement [23] (word) print_word_at::w#1 ← < (dword) print_dword_at::dw#0 [ print_word_at::w#1 ] ( main:2::print_dword_at:17 [ print_word_at::w#1 ] ) always clobbers reg byte a
Statement [27] (byte) print_byte_at::b#0 ← > (word) print_word_at::w#2 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::b#0 ] ( main:2::print_dword_at:17::print_word_at:22 [ print_dword_at::dw#0 print_word_at::w#2 print_word_at::at#2 print_byte_at::b#0 ] main:2::print_dword_at:17::print_word_at:24 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::b#0 ] ) always clobbers reg byte a
Statement [28] (byte*) print_byte_at::at#0 ← (byte*) print_word_at::at#2 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::b#0 print_byte_at::at#0 ] ( main:2::print_dword_at:17::print_word_at:22 [ print_dword_at::dw#0 print_word_at::w#2 print_word_at::at#2 print_byte_at::b#0 print_byte_at::at#0 ] main:2::print_dword_at:17::print_word_at:24 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::b#0 print_byte_at::at#0 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ]
Statement [30] (byte) print_byte_at::b#1 ← < (word) print_word_at::w#2 [ print_word_at::at#2 print_byte_at::b#1 ] ( main:2::print_dword_at:17::print_word_at:22 [ print_dword_at::dw#0 print_word_at::at#2 print_byte_at::b#1 ] main:2::print_dword_at:17::print_word_at:24 [ print_word_at::at#2 print_byte_at::b#1 ] ) always clobbers reg byte a
Statement [31] (byte*) print_byte_at::at#1 ← (byte*) print_word_at::at#2 + (byte) 2 [ print_byte_at::b#1 print_byte_at::at#1 ] ( main:2::print_dword_at:17::print_word_at:22 [ print_dword_at::dw#0 print_byte_at::b#1 print_byte_at::at#1 ] main:2::print_dword_at:17::print_word_at:24 [ print_byte_at::b#1 print_byte_at::at#1 ] ) always clobbers reg byte a
Statement [35] (byte~) print_byte_at::$0 ← (byte) print_byte_at::b#2 >> (byte) 4 [ print_byte_at::b#2 print_byte_at::at#2 print_byte_at::$0 ] ( main:2::print_dword_at:17::print_word_at:22::print_byte_at:29 [ print_dword_at::dw#0 print_word_at::w#2 print_word_at::at#2 print_byte_at::b#2 print_byte_at::at#2 print_byte_at::$0 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:29 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::b#2 print_byte_at::at#2 print_byte_at::$0 ] main:2::print_dword_at:17::print_word_at:22::print_byte_at:32 [ print_dword_at::dw#0 print_byte_at::b#2 print_byte_at::at#2 print_byte_at::$0 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:32 [ print_byte_at::b#2 print_byte_at::at#2 print_byte_at::$0 ] ) always clobbers reg byte a
Statement [37] (byte*) print_char_at::at#0 ← (byte*) print_byte_at::at#2 [ print_byte_at::b#2 print_byte_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] ( main:2::print_dword_at:17::print_word_at:22::print_byte_at:29 [ print_dword_at::dw#0 print_word_at::w#2 print_word_at::at#2 print_byte_at::b#2 print_byte_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:29 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::b#2 print_byte_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] main:2::print_dword_at:17::print_word_at:22::print_byte_at:32 [ print_dword_at::dw#0 print_byte_at::b#2 print_byte_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:32 [ print_byte_at::b#2 print_byte_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:9 [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ]
Statement [39] (byte~) print_byte_at::$2 ← (byte) print_byte_at::b#2 & (byte) $f [ print_byte_at::at#2 print_byte_at::$2 ] ( main:2::print_dword_at:17::print_word_at:22::print_byte_at:29 [ print_dword_at::dw#0 print_word_at::w#2 print_word_at::at#2 print_byte_at::at#2 print_byte_at::$2 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:29 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::at#2 print_byte_at::$2 ] main:2::print_dword_at:17::print_word_at:22::print_byte_at:32 [ print_dword_at::dw#0 print_byte_at::at#2 print_byte_at::$2 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:32 [ print_byte_at::at#2 print_byte_at::$2 ] ) always clobbers reg byte a
Statement [40] (byte*) print_char_at::at#1 ← (byte*) print_byte_at::at#2 + (byte) 1 [ print_byte_at::$2 print_char_at::at#1 ] ( main:2::print_dword_at:17::print_word_at:22::print_byte_at:29 [ print_dword_at::dw#0 print_word_at::w#2 print_word_at::at#2 print_byte_at::$2 print_char_at::at#1 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:29 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::$2 print_char_at::at#1 ] main:2::print_dword_at:17::print_word_at:22::print_byte_at:32 [ print_dword_at::dw#0 print_byte_at::$2 print_char_at::at#1 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:32 [ print_byte_at::$2 print_char_at::at#1 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:60 [ print_byte_at::$2 ]
Statement [45] *((byte*) print_char_at::at#2) ← (byte) print_char_at::ch#2 [ ] ( main:2::print_dword_at:17::print_word_at:22::print_byte_at:29::print_char_at:38 [ print_dword_at::dw#0 print_word_at::w#2 print_word_at::at#2 print_byte_at::b#2 print_byte_at::at#2 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:29::print_char_at:38 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::b#2 print_byte_at::at#2 ] main:2::print_dword_at:17::print_word_at:22::print_byte_at:32::print_char_at:38 [ print_dword_at::dw#0 print_byte_at::b#2 print_byte_at::at#2 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:32::print_char_at:38 [ print_byte_at::b#2 print_byte_at::at#2 ] main:2::print_dword_at:17::print_word_at:22::print_byte_at:29::print_char_at:42 [ print_dword_at::dw#0 print_word_at::w#2 print_word_at::at#2 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:29::print_char_at:42 [ print_word_at::w#2 print_word_at::at#2 ] main:2::print_dword_at:17::print_word_at:22::print_byte_at:32::print_char_at:42 [ print_dword_at::dw#0 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:32::print_char_at:42 [ ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ]
Statement [47] (dword) clock::return#0 ← (dword) $ffffffff - *((const dword*) CIA2_TIMER_AB#0) [ clock::return#0 ] ( main:2::clock:12 [ clock::return#0 ] ) always clobbers reg byte a
Statement [52] (byte~) init_angle_screen::$2 ← (byte) init_angle_screen::x#2 << (byte) 1 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$2 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$2 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:12 [ init_angle_screen::y#4 init_angle_screen::y#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ]
Statement [53] (byte~) init_angle_screen::$3 ← (byte) $27 - (byte~) init_angle_screen::$2 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] ) always clobbers reg byte a
Statement [54] (word) init_angle_screen::xw#0 ← (byte~) init_angle_screen::$3 w= (byte) 0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ) always clobbers reg byte y
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:12 [ init_angle_screen::y#4 init_angle_screen::y#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ]
Statement [55] (byte~) init_angle_screen::$6 ← (byte) init_angle_screen::y#4 << (byte) 1 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$6 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$6 ] ) always clobbers reg byte a
Statement [56] (word) init_angle_screen::yw#0 ← (byte~) init_angle_screen::$6 w= (byte) 0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ) always clobbers reg byte y
Statement [57] (signed word) atan2_16::x#0 ← (signed word)(word) init_angle_screen::xw#0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ) always clobbers reg byte a
Statement [58] (signed word) atan2_16::y#0 ← (signed word)(word) init_angle_screen::yw#0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ) always clobbers reg byte a
Statement [60] (word) atan2_16::return#2 ← (word) atan2_16::return#0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ) always clobbers reg byte a
Statement [61] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ) always clobbers reg byte a
Statement [62] (word~) init_angle_screen::$10 ← (word) init_angle_screen::angle_w#0 + (byte) $80 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$10 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$10 ] ) always clobbers reg byte a
Statement [63] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ) always clobbers reg byte a
Statement [65] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$12 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ) always clobbers reg byte y
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:82 [ init_angle_screen::ang_w#0 ]
Statement [66] (byte~) init_angle_screen::$13 ← (byte) $80 - (byte) init_angle_screen::ang_w#0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$13 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$13 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:82 [ init_angle_screen::ang_w#0 ]
Statement [67] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$13 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ) always clobbers reg byte y
Statement [68] (byte~) init_angle_screen::$14 ← - (byte) init_angle_screen::ang_w#0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$14 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$14 ] ) always clobbers reg byte a
Statement [69] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::xb#2) ← (byte~) init_angle_screen::$14 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ) always clobbers reg byte y
Statement [70] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::xb#2) ← (byte) init_angle_screen::ang_w#0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 ] ) always clobbers reg byte a reg byte y
Statement [74] (byte*) init_angle_screen::screen_topline#1 ← (byte*) init_angle_screen::screen_topline#5 - (byte) $28 [ init_angle_screen::y#4 init_angle_screen::screen_bottomline#5 init_angle_screen::screen_topline#1 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_bottomline#5 init_angle_screen::screen_topline#1 ] ) always clobbers reg byte a
Statement [75] (byte*) init_angle_screen::screen_bottomline#1 ← (byte*) init_angle_screen::screen_bottomline#5 + (byte) $28 [ init_angle_screen::y#4 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] ) always clobbers reg byte a
Statement [79] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1 [ atan2_16::x#0 atan2_16::y#0 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ) always clobbers reg byte a
Statement [80] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::$2 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::$2 ] ) always clobbers reg byte a
Statement [82] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 ] ) always clobbers reg byte a
Statement [83] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 atan2_16::$7 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 atan2_16::$7 ] ) always clobbers reg byte a
Statement [86] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:23 [ atan2_16::i#2 atan2_16::i#1 ]
Statement [88] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1 [ atan2_16::x#0 atan2_16::y#0 atan2_16::angle#1 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::angle#1 ] ) always clobbers reg byte a
Statement [89] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7 [ atan2_16::y#0 atan2_16::angle#1 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::y#0 atan2_16::angle#1 ] ) always clobbers reg byte a
Statement [90] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1 [ atan2_16::y#0 atan2_16::angle#4 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::y#0 atan2_16::angle#4 ] ) always clobbers reg byte a
Statement [92] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8 [ atan2_16::angle#11 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::angle#11 ] ) always clobbers reg byte a
Statement [93] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11 [ atan2_16::angle#5 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::angle#5 ] ) always clobbers reg byte a
Statement [97] (signed word~) atan2_16::xd#10 ← (signed word) atan2_16::xi#3 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::shift#5 atan2_16::xd#10 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::shift#5 atan2_16::xd#10 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:28 [ atan2_16::shift#2 atan2_16::shift#5 atan2_16::shift#1 ]
Statement [98] (signed word~) atan2_16::yd#10 ← (signed word) atan2_16::yi#3 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::shift#5 atan2_16::xd#10 atan2_16::yd#10 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::shift#5 atan2_16::xd#10 atan2_16::yd#10 ] ) always clobbers reg byte a
Statement [102] (signed word) atan2_16::xd#2 ← (signed word) atan2_16::xd#3 >> (signed byte) 1 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::yd#3 atan2_16::xd#2 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::yd#3 atan2_16::xd#2 ] ) always clobbers reg byte a
Statement [103] (signed word) atan2_16::yd#2 ← (signed word) atan2_16::yd#3 >> (signed byte) 1 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::xd#2 atan2_16::yd#2 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::xd#2 atan2_16::yd#2 ] ) always clobbers reg byte a
Statement [105] if((signed word) atan2_16::yi#3>=(signed byte) 0) goto atan2_16::@18 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::yd#5 atan2_16::xd#5 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::yd#5 atan2_16::xd#5 ] ) always clobbers reg byte a
Statement [106] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#5 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::xd#5 atan2_16::xi#2 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::xd#5 atan2_16::xi#2 ] ) always clobbers reg byte a
Statement [107] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#5 [ atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::angle#12 atan2_16::xi#2 atan2_16::yi#2 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::angle#12 atan2_16::xi#2 atan2_16::yi#2 ] ) always clobbers reg byte a
Statement [108] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1 [ atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::angle#12 atan2_16::xi#2 atan2_16::yi#2 atan2_16::$24 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::angle#12 atan2_16::xi#2 atan2_16::yi#2 atan2_16::$24 ] ) always clobbers reg byte a
Statement [109] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24) [ atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::xi#2 atan2_16::yi#2 atan2_16::angle#3 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::xi#2 atan2_16::yi#2 atan2_16::angle#3 ] ) always clobbers reg byte a
Statement [113] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#5 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::xd#5 atan2_16::xi#1 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::xd#5 atan2_16::xi#1 ] ) always clobbers reg byte a
Statement [114] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#5 [ atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::angle#12 atan2_16::yi#1 atan2_16::xi#1 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::angle#12 atan2_16::yi#1 atan2_16::xi#1 ] ) always clobbers reg byte a
Statement [115] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1 [ atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::angle#12 atan2_16::yi#1 atan2_16::xi#1 atan2_16::$23 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::angle#12 atan2_16::yi#1 atan2_16::xi#1 atan2_16::$23 ] ) always clobbers reg byte a
Statement [116] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23) [ atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::yi#1 atan2_16::angle#2 atan2_16::xi#1 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::yi#1 atan2_16::angle#2 atan2_16::xi#1 ] ) always clobbers reg byte a
Statement [117] (signed word) atan2_16::xd#1 ← (signed word) atan2_16::xd#3 >> (signed byte) 2 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::shift#2 atan2_16::yd#3 atan2_16::xd#1 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::shift#2 atan2_16::yd#3 atan2_16::xd#1 ] ) always clobbers reg byte a
Statement [118] (signed word) atan2_16::yd#1 ← (signed word) atan2_16::yd#3 >> (signed byte) 2 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::shift#2 atan2_16::xd#1 atan2_16::yd#1 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::shift#2 atan2_16::xd#1 atan2_16::yd#1 ] ) always clobbers reg byte a
Statement [120] (signed word~) atan2_16::xi#13 ← (signed word) atan2_16::x#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 atan2_16::xi#13 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 atan2_16::xi#13 ] ) always clobbers reg byte a
Statement [121] (signed word~) atan2_16::yi#16 ← (signed word) atan2_16::y#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#16 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#16 ] ) always clobbers reg byte a
Statement [122] *((const byte*) CIA2_TIMER_A_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_CONTINUOUS#0 [ ] ( main:2::clock_start:8 [ ] ) always clobbers reg byte a
Statement [123] *((const byte*) CIA2_TIMER_B_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 [ ] ( main:2::clock_start:8 [ ] ) always clobbers reg byte a
Statement [124] *((const dword*) CIA2_TIMER_AB#0) ← (dword) $ffffffff [ ] ( main:2::clock_start:8 [ ] ) always clobbers reg byte a
Statement [125] *((const byte*) CIA2_TIMER_B_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_START#0|(const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 [ ] ( main:2::clock_start:8 [ ] ) always clobbers reg byte a
Statement [126] *((const byte*) CIA2_TIMER_A_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_START#0 [ ] ( main:2::clock_start:8 [ ] ) always clobbers reg byte a
Statement [131] *((byte*) init_font_hex::charset#2) ← (byte) 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:35 [ init_font_hex::c#6 init_font_hex::c#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:35 [ init_font_hex::c#6 init_font_hex::c#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:40 [ init_font_hex::c1#4 init_font_hex::c1#1 ]
Removing always clobbered register reg byte y as potential for zp ZP_BYTE:40 [ init_font_hex::c1#4 init_font_hex::c1#1 ]
Statement [133] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:41 [ init_font_hex::i#2 init_font_hex::i#1 ]
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:42 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
Statement [134] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 init_font_hex::$1 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 init_font_hex::$1 ] ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp ZP_BYTE:88 [ init_font_hex::$0 ]
Statement [140] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::idx#2 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::idx#2 ] ) always clobbers reg byte a
Statement [142] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ) always clobbers reg byte a
Statement [143] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] ) always clobbers reg byte a
Statement [144] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#0 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#0 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] ) always clobbers reg byte a
Statement [147] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5 [ init_font_hex::c#6 init_font_hex::charset#0 init_font_hex::proto_hi#1 ] ( main:2::init_font_hex:5 [ init_font_hex::c#6 init_font_hex::charset#0 init_font_hex::proto_hi#1 ] ) always clobbers reg byte a
Statement [7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [13] (dword) clock::return#2 ← (dword) clock::return#0 [ clock::return#2 ] ( main:2 [ clock::return#2 ] ) always clobbers reg byte a
Statement [14] (dword~) main::$4 ← (dword) clock::return#2 [ main::$4 ] ( main:2 [ main::$4 ] ) always clobbers reg byte a
Statement [15] (dword) main::cyclecount#0 ← (dword~) main::$4 - (const dword) CLOCKS_PER_INIT#0 [ main::cyclecount#0 ] ( main:2 [ main::cyclecount#0 ] ) always clobbers reg byte a
Statement [16] (dword) print_dword_at::dw#0 ← (dword) main::cyclecount#0 [ print_dword_at::dw#0 ] ( main:2 [ print_dword_at::dw#0 ] ) always clobbers reg byte a
Statement [19] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 [ ] ( main:2 [ ] ) always clobbers reg byte a
Statement [21] (word) print_word_at::w#0 ← > (dword) print_dword_at::dw#0 [ print_dword_at::dw#0 print_word_at::w#0 ] ( main:2::print_dword_at:17 [ print_dword_at::dw#0 print_word_at::w#0 ] ) always clobbers reg byte a
Statement [23] (word) print_word_at::w#1 ← < (dword) print_dword_at::dw#0 [ print_word_at::w#1 ] ( main:2::print_dword_at:17 [ print_word_at::w#1 ] ) always clobbers reg byte a
Statement [27] (byte) print_byte_at::b#0 ← > (word) print_word_at::w#2 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::b#0 ] ( main:2::print_dword_at:17::print_word_at:22 [ print_dword_at::dw#0 print_word_at::w#2 print_word_at::at#2 print_byte_at::b#0 ] main:2::print_dword_at:17::print_word_at:24 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::b#0 ] ) always clobbers reg byte a
Statement [28] (byte*) print_byte_at::at#0 ← (byte*) print_word_at::at#2 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::b#0 print_byte_at::at#0 ] ( main:2::print_dword_at:17::print_word_at:22 [ print_dword_at::dw#0 print_word_at::w#2 print_word_at::at#2 print_byte_at::b#0 print_byte_at::at#0 ] main:2::print_dword_at:17::print_word_at:24 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::b#0 print_byte_at::at#0 ] ) always clobbers reg byte a
Statement [30] (byte) print_byte_at::b#1 ← < (word) print_word_at::w#2 [ print_word_at::at#2 print_byte_at::b#1 ] ( main:2::print_dword_at:17::print_word_at:22 [ print_dword_at::dw#0 print_word_at::at#2 print_byte_at::b#1 ] main:2::print_dword_at:17::print_word_at:24 [ print_word_at::at#2 print_byte_at::b#1 ] ) always clobbers reg byte a
Statement [31] (byte*) print_byte_at::at#1 ← (byte*) print_word_at::at#2 + (byte) 2 [ print_byte_at::b#1 print_byte_at::at#1 ] ( main:2::print_dword_at:17::print_word_at:22 [ print_dword_at::dw#0 print_byte_at::b#1 print_byte_at::at#1 ] main:2::print_dword_at:17::print_word_at:24 [ print_byte_at::b#1 print_byte_at::at#1 ] ) always clobbers reg byte a
Statement [35] (byte~) print_byte_at::$0 ← (byte) print_byte_at::b#2 >> (byte) 4 [ print_byte_at::b#2 print_byte_at::at#2 print_byte_at::$0 ] ( main:2::print_dword_at:17::print_word_at:22::print_byte_at:29 [ print_dword_at::dw#0 print_word_at::w#2 print_word_at::at#2 print_byte_at::b#2 print_byte_at::at#2 print_byte_at::$0 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:29 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::b#2 print_byte_at::at#2 print_byte_at::$0 ] main:2::print_dword_at:17::print_word_at:22::print_byte_at:32 [ print_dword_at::dw#0 print_byte_at::b#2 print_byte_at::at#2 print_byte_at::$0 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:32 [ print_byte_at::b#2 print_byte_at::at#2 print_byte_at::$0 ] ) always clobbers reg byte a
Statement [37] (byte*) print_char_at::at#0 ← (byte*) print_byte_at::at#2 [ print_byte_at::b#2 print_byte_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] ( main:2::print_dword_at:17::print_word_at:22::print_byte_at:29 [ print_dword_at::dw#0 print_word_at::w#2 print_word_at::at#2 print_byte_at::b#2 print_byte_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:29 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::b#2 print_byte_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] main:2::print_dword_at:17::print_word_at:22::print_byte_at:32 [ print_dword_at::dw#0 print_byte_at::b#2 print_byte_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:32 [ print_byte_at::b#2 print_byte_at::at#2 print_char_at::ch#0 print_char_at::at#0 ] ) always clobbers reg byte a
Statement [39] (byte~) print_byte_at::$2 ← (byte) print_byte_at::b#2 & (byte) $f [ print_byte_at::at#2 print_byte_at::$2 ] ( main:2::print_dword_at:17::print_word_at:22::print_byte_at:29 [ print_dword_at::dw#0 print_word_at::w#2 print_word_at::at#2 print_byte_at::at#2 print_byte_at::$2 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:29 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::at#2 print_byte_at::$2 ] main:2::print_dword_at:17::print_word_at:22::print_byte_at:32 [ print_dword_at::dw#0 print_byte_at::at#2 print_byte_at::$2 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:32 [ print_byte_at::at#2 print_byte_at::$2 ] ) always clobbers reg byte a
Statement [40] (byte*) print_char_at::at#1 ← (byte*) print_byte_at::at#2 + (byte) 1 [ print_byte_at::$2 print_char_at::at#1 ] ( main:2::print_dword_at:17::print_word_at:22::print_byte_at:29 [ print_dword_at::dw#0 print_word_at::w#2 print_word_at::at#2 print_byte_at::$2 print_char_at::at#1 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:29 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::$2 print_char_at::at#1 ] main:2::print_dword_at:17::print_word_at:22::print_byte_at:32 [ print_dword_at::dw#0 print_byte_at::$2 print_char_at::at#1 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:32 [ print_byte_at::$2 print_char_at::at#1 ] ) always clobbers reg byte a
Statement [45] *((byte*) print_char_at::at#2) ← (byte) print_char_at::ch#2 [ ] ( main:2::print_dword_at:17::print_word_at:22::print_byte_at:29::print_char_at:38 [ print_dword_at::dw#0 print_word_at::w#2 print_word_at::at#2 print_byte_at::b#2 print_byte_at::at#2 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:29::print_char_at:38 [ print_word_at::w#2 print_word_at::at#2 print_byte_at::b#2 print_byte_at::at#2 ] main:2::print_dword_at:17::print_word_at:22::print_byte_at:32::print_char_at:38 [ print_dword_at::dw#0 print_byte_at::b#2 print_byte_at::at#2 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:32::print_char_at:38 [ print_byte_at::b#2 print_byte_at::at#2 ] main:2::print_dword_at:17::print_word_at:22::print_byte_at:29::print_char_at:42 [ print_dword_at::dw#0 print_word_at::w#2 print_word_at::at#2 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:29::print_char_at:42 [ print_word_at::w#2 print_word_at::at#2 ] main:2::print_dword_at:17::print_word_at:22::print_byte_at:32::print_char_at:42 [ print_dword_at::dw#0 ] main:2::print_dword_at:17::print_word_at:24::print_byte_at:32::print_char_at:42 [ ] ) always clobbers reg byte a reg byte y
Statement [47] (dword) clock::return#0 ← (dword) $ffffffff - *((const dword*) CIA2_TIMER_AB#0) [ clock::return#0 ] ( main:2::clock:12 [ clock::return#0 ] ) always clobbers reg byte a
Statement [52] (byte~) init_angle_screen::$2 ← (byte) init_angle_screen::x#2 << (byte) 1 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$2 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$2 ] ) always clobbers reg byte a
Statement [53] (byte~) init_angle_screen::$3 ← (byte) $27 - (byte~) init_angle_screen::$2 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$3 ] ) always clobbers reg byte a
Statement [54] (word) init_angle_screen::xw#0 ← (byte~) init_angle_screen::$3 w= (byte) 0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 ] ) always clobbers reg byte y
Statement [55] (byte~) init_angle_screen::$6 ← (byte) init_angle_screen::y#4 << (byte) 1 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$6 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::$6 ] ) always clobbers reg byte a
Statement [56] (word) init_angle_screen::yw#0 ← (byte~) init_angle_screen::$6 w= (byte) 0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::xw#0 init_angle_screen::yw#0 ] ) always clobbers reg byte y
Statement [57] (signed word) atan2_16::x#0 ← (signed word)(word) init_angle_screen::xw#0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::yw#0 atan2_16::x#0 ] ) always clobbers reg byte a
Statement [58] (signed word) atan2_16::y#0 ← (signed word)(word) init_angle_screen::yw#0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ) always clobbers reg byte a
Statement [60] (word) atan2_16::return#2 ← (word) atan2_16::return#0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::return#2 ] ) always clobbers reg byte a
Statement [61] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::angle_w#0 ] ) always clobbers reg byte a
Statement [62] (word~) init_angle_screen::$10 ← (word) init_angle_screen::angle_w#0 + (byte) $80 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$10 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::$10 ] ) always clobbers reg byte a
Statement [63] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ) always clobbers reg byte a
Statement [64] (byte~) init_angle_screen::$12 ← (byte) $80 + (byte) init_angle_screen::ang_w#0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$12 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$12 ] ) always clobbers reg byte a
Statement [65] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$12 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ) always clobbers reg byte y
Statement [66] (byte~) init_angle_screen::$13 ← (byte) $80 - (byte) init_angle_screen::ang_w#0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$13 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$13 ] ) always clobbers reg byte a
Statement [67] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$13 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ) always clobbers reg byte y
Statement [68] (byte~) init_angle_screen::$14 ← - (byte) init_angle_screen::ang_w#0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$14 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 init_angle_screen::$14 ] ) always clobbers reg byte a
Statement [69] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::xb#2) ← (byte~) init_angle_screen::$14 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 init_angle_screen::ang_w#0 ] ) always clobbers reg byte y
Statement [70] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::xb#2) ← (byte) init_angle_screen::ang_w#0 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 ] ) always clobbers reg byte a reg byte y
Statement [74] (byte*) init_angle_screen::screen_topline#1 ← (byte*) init_angle_screen::screen_topline#5 - (byte) $28 [ init_angle_screen::y#4 init_angle_screen::screen_bottomline#5 init_angle_screen::screen_topline#1 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_bottomline#5 init_angle_screen::screen_topline#1 ] ) always clobbers reg byte a
Statement [75] (byte*) init_angle_screen::screen_bottomline#1 ← (byte*) init_angle_screen::screen_bottomline#5 + (byte) $28 [ init_angle_screen::y#4 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] ( main:2::init_angle_screen:10 [ init_angle_screen::y#4 init_angle_screen::screen_topline#1 init_angle_screen::screen_bottomline#1 ] ) always clobbers reg byte a
Statement [79] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1 [ atan2_16::x#0 atan2_16::y#0 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 ] ) always clobbers reg byte a
Statement [80] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::$2 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::$2 ] ) always clobbers reg byte a
Statement [82] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 ] ) always clobbers reg byte a
Statement [83] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 atan2_16::$7 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 atan2_16::$7 ] ) always clobbers reg byte a
Statement [86] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 ] ) always clobbers reg byte a
Statement [88] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1 [ atan2_16::x#0 atan2_16::y#0 atan2_16::angle#1 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::angle#1 ] ) always clobbers reg byte a
Statement [89] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7 [ atan2_16::y#0 atan2_16::angle#1 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::y#0 atan2_16::angle#1 ] ) always clobbers reg byte a
Statement [90] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1 [ atan2_16::y#0 atan2_16::angle#4 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::y#0 atan2_16::angle#4 ] ) always clobbers reg byte a
Statement [92] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8 [ atan2_16::angle#11 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::angle#11 ] ) always clobbers reg byte a
Statement [93] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11 [ atan2_16::angle#5 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::angle#5 ] ) always clobbers reg byte a
Statement [97] (signed word~) atan2_16::xd#10 ← (signed word) atan2_16::xi#3 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::shift#5 atan2_16::xd#10 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::shift#5 atan2_16::xd#10 ] ) always clobbers reg byte a
Statement [98] (signed word~) atan2_16::yd#10 ← (signed word) atan2_16::yi#3 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::shift#5 atan2_16::xd#10 atan2_16::yd#10 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::shift#5 atan2_16::xd#10 atan2_16::yd#10 ] ) always clobbers reg byte a
Statement [102] (signed word) atan2_16::xd#2 ← (signed word) atan2_16::xd#3 >> (signed byte) 1 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::yd#3 atan2_16::xd#2 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::yd#3 atan2_16::xd#2 ] ) always clobbers reg byte a
Statement [103] (signed word) atan2_16::yd#2 ← (signed word) atan2_16::yd#3 >> (signed byte) 1 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::xd#2 atan2_16::yd#2 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::xd#2 atan2_16::yd#2 ] ) always clobbers reg byte a
Statement [105] if((signed word) atan2_16::yi#3>=(signed byte) 0) goto atan2_16::@18 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::yd#5 atan2_16::xd#5 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::yd#5 atan2_16::xd#5 ] ) always clobbers reg byte a
Statement [106] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#5 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::xd#5 atan2_16::xi#2 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::xd#5 atan2_16::xi#2 ] ) always clobbers reg byte a
Statement [107] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#5 [ atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::angle#12 atan2_16::xi#2 atan2_16::yi#2 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::angle#12 atan2_16::xi#2 atan2_16::yi#2 ] ) always clobbers reg byte a
Statement [108] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1 [ atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::angle#12 atan2_16::xi#2 atan2_16::yi#2 atan2_16::$24 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::angle#12 atan2_16::xi#2 atan2_16::yi#2 atan2_16::$24 ] ) always clobbers reg byte a
Statement [109] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24) [ atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::xi#2 atan2_16::yi#2 atan2_16::angle#3 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::xi#2 atan2_16::yi#2 atan2_16::angle#3 ] ) always clobbers reg byte a
Statement [113] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#5 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::xd#5 atan2_16::xi#1 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::xd#5 atan2_16::xi#1 ] ) always clobbers reg byte a
Statement [114] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#5 [ atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::angle#12 atan2_16::yi#1 atan2_16::xi#1 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::angle#12 atan2_16::yi#1 atan2_16::xi#1 ] ) always clobbers reg byte a
Statement [115] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1 [ atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::angle#12 atan2_16::yi#1 atan2_16::xi#1 atan2_16::$23 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::angle#12 atan2_16::yi#1 atan2_16::xi#1 atan2_16::$23 ] ) always clobbers reg byte a
Statement [116] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23) [ atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::yi#1 atan2_16::angle#2 atan2_16::xi#1 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::i#2 atan2_16::yi#1 atan2_16::angle#2 atan2_16::xi#1 ] ) always clobbers reg byte a
Statement [117] (signed word) atan2_16::xd#1 ← (signed word) atan2_16::xd#3 >> (signed byte) 2 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::shift#2 atan2_16::yd#3 atan2_16::xd#1 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::shift#2 atan2_16::yd#3 atan2_16::xd#1 ] ) always clobbers reg byte a
Statement [118] (signed word) atan2_16::yd#1 ← (signed word) atan2_16::yd#3 >> (signed byte) 2 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::shift#2 atan2_16::xd#1 atan2_16::yd#1 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#3 atan2_16::xi#3 atan2_16::i#2 atan2_16::angle#12 atan2_16::shift#2 atan2_16::xd#1 atan2_16::yd#1 ] ) always clobbers reg byte a
Statement [120] (signed word~) atan2_16::xi#13 ← (signed word) atan2_16::x#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 atan2_16::xi#13 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#0 atan2_16::xi#13 ] ) always clobbers reg byte a
Statement [121] (signed word~) atan2_16::yi#16 ← (signed word) atan2_16::y#0 [ atan2_16::x#0 atan2_16::y#0 atan2_16::yi#16 ] ( main:2::init_angle_screen:10::atan2_16:59 [ init_angle_screen::y#4 init_angle_screen::screen_topline#5 init_angle_screen::screen_bottomline#5 init_angle_screen::x#2 init_angle_screen::xb#2 atan2_16::x#0 atan2_16::y#0 atan2_16::yi#16 ] ) always clobbers reg byte a
Statement [122] *((const byte*) CIA2_TIMER_A_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_CONTINUOUS#0 [ ] ( main:2::clock_start:8 [ ] ) always clobbers reg byte a
Statement [123] *((const byte*) CIA2_TIMER_B_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 [ ] ( main:2::clock_start:8 [ ] ) always clobbers reg byte a
Statement [124] *((const dword*) CIA2_TIMER_AB#0) ← (dword) $ffffffff [ ] ( main:2::clock_start:8 [ ] ) always clobbers reg byte a
Statement [125] *((const byte*) CIA2_TIMER_B_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_START#0|(const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 [ ] ( main:2::clock_start:8 [ ] ) always clobbers reg byte a
Statement [126] *((const byte*) CIA2_TIMER_A_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_START#0 [ ] ( main:2::clock_start:8 [ ] ) always clobbers reg byte a
Statement [131] *((byte*) init_font_hex::charset#2) ← (byte) 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ) always clobbers reg byte a reg byte y
Statement [133] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 ] ) always clobbers reg byte a
Statement [134] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 init_font_hex::$1 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::i#2 init_font_hex::idx#5 init_font_hex::$0 init_font_hex::$1 ] ) always clobbers reg byte a
Statement [140] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::idx#2 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 init_font_hex::idx#2 ] ) always clobbers reg byte a
Statement [142] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::proto_lo#4 init_font_hex::c1#4 ] ) always clobbers reg byte a
Statement [143] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#2 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] ) always clobbers reg byte a
Statement [144] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#0 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] ( main:2::init_font_hex:5 [ init_font_hex::proto_hi#6 init_font_hex::c#6 init_font_hex::charset#0 init_font_hex::c1#4 init_font_hex::proto_lo#1 ] ) always clobbers reg byte a
Statement [147] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5 [ init_font_hex::c#6 init_font_hex::charset#0 init_font_hex::proto_hi#1 ] ( main:2::init_font_hex:5 [ init_font_hex::c#6 init_font_hex::charset#0 init_font_hex::proto_hi#1 ] ) always clobbers reg byte a
Potential registers zp ZP_WORD:2 [ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ] : zp ZP_WORD:2 ,
Potential registers zp ZP_WORD:4 [ print_word_at::at#2 ] : zp ZP_WORD:4 ,
Potential registers zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] : zp ZP_BYTE:6 , reg byte x ,
Potential registers zp ZP_WORD:7 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] : zp ZP_WORD:7 ,
Potential registers zp ZP_BYTE:9 [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] : zp ZP_BYTE:9 , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:10 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ] : zp ZP_WORD:10 ,
Potential registers zp ZP_BYTE:12 [ init_angle_screen::y#4 init_angle_screen::y#1 ] : zp ZP_BYTE:12 , reg byte x ,
Potential registers zp ZP_WORD:13 [ init_angle_screen::screen_topline#5 init_angle_screen::screen_topline#1 ] : zp ZP_WORD:13 ,
Potential registers zp ZP_WORD:15 [ init_angle_screen::screen_bottomline#5 init_angle_screen::screen_bottomline#1 ] : zp ZP_WORD:15 ,
Potential registers zp ZP_BYTE:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ] : zp ZP_BYTE:17 , reg byte x ,
Potential registers zp ZP_BYTE:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] : zp ZP_BYTE:18 , reg byte x ,
Potential registers zp ZP_WORD:19 [ atan2_16::yi#3 atan2_16::yi#8 atan2_16::yi#0 atan2_16::yi#16 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ] : zp ZP_WORD:19 ,
Potential registers zp ZP_WORD:21 [ atan2_16::xi#3 atan2_16::xi#8 atan2_16::xi#0 atan2_16::xi#13 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] : zp ZP_WORD:21 ,
Potential registers zp ZP_BYTE:23 [ atan2_16::i#2 atan2_16::i#1 ] : zp ZP_BYTE:23 , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:24 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] : zp ZP_WORD:24 ,
Potential registers zp ZP_WORD:26 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] : zp ZP_WORD:26 ,
Potential registers zp ZP_BYTE:28 [ atan2_16::shift#2 atan2_16::shift#5 atan2_16::shift#1 ] : zp ZP_BYTE:28 , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:29 [ atan2_16::yd#5 atan2_16::yd#3 atan2_16::yd#10 atan2_16::yd#1 atan2_16::yd#2 ] : zp ZP_WORD:29 ,
Potential registers zp ZP_WORD:31 [ atan2_16::xd#5 atan2_16::xd#3 atan2_16::xd#10 atan2_16::xd#1 atan2_16::xd#2 ] : zp ZP_WORD:31 ,
Potential registers zp ZP_WORD:33 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] : zp ZP_WORD:33 ,
Potential registers zp ZP_BYTE:35 [ init_font_hex::c#6 init_font_hex::c#1 ] : zp ZP_BYTE:35 , reg byte x ,
Potential registers zp ZP_WORD:36 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] : zp ZP_WORD:36 ,
Potential registers zp ZP_WORD:38 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] : zp ZP_WORD:38 ,
Potential registers zp ZP_BYTE:40 [ init_font_hex::c1#4 init_font_hex::c1#1 ] : zp ZP_BYTE:40 , reg byte x ,
Potential registers zp ZP_BYTE:41 [ init_font_hex::i#2 init_font_hex::i#1 ] : zp ZP_BYTE:41 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:42 [ init_font_hex::idx#5 init_font_hex::idx#2 ] : zp ZP_BYTE:42 , reg byte x , reg byte y ,
Potential registers zp ZP_DWORD:43 [ clock::return#2 ] : zp ZP_DWORD:43 ,
Potential registers zp ZP_DWORD:47 [ main::$4 ] : zp ZP_DWORD:47 ,
Potential registers zp ZP_DWORD:51 [ main::cyclecount#0 ] : zp ZP_DWORD:51 ,
Potential registers zp ZP_DWORD:55 [ print_dword_at::dw#0 ] : zp ZP_DWORD:55 ,
Potential registers zp ZP_BYTE:59 [ print_byte_at::$0 ] : zp ZP_BYTE:59 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:60 [ print_byte_at::$2 ] : zp ZP_BYTE:60 , reg byte x , reg byte y ,
Potential registers zp ZP_DWORD:61 [ clock::return#0 ] : zp ZP_DWORD:61 ,
Potential registers zp ZP_BYTE:65 [ init_angle_screen::$2 ] : zp ZP_BYTE:65 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:66 [ init_angle_screen::$3 ] : zp ZP_BYTE:66 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:67 [ init_angle_screen::xw#0 ] : zp ZP_WORD:67 ,
Potential registers zp ZP_BYTE:69 [ init_angle_screen::$6 ] : zp ZP_BYTE:69 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_WORD:70 [ init_angle_screen::yw#0 ] : zp ZP_WORD:70 ,
Potential registers zp ZP_WORD:72 [ atan2_16::x#0 ] : zp ZP_WORD:72 ,
Potential registers zp ZP_WORD:74 [ atan2_16::y#0 ] : zp ZP_WORD:74 ,
Potential registers zp ZP_WORD:76 [ atan2_16::return#2 ] : zp ZP_WORD:76 ,
Potential registers zp ZP_WORD:78 [ init_angle_screen::angle_w#0 ] : zp ZP_WORD:78 ,
Potential registers zp ZP_WORD:80 [ init_angle_screen::$10 ] : zp ZP_WORD:80 ,
Potential registers zp ZP_BYTE:82 [ init_angle_screen::ang_w#0 ] : zp ZP_BYTE:82 , reg byte x ,
Potential registers zp ZP_BYTE:83 [ init_angle_screen::$12 ] : zp ZP_BYTE:83 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:84 [ init_angle_screen::$13 ] : zp ZP_BYTE:84 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:85 [ init_angle_screen::$14 ] : zp ZP_BYTE:85 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:86 [ atan2_16::$24 ] : zp ZP_BYTE:86 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:87 [ atan2_16::$23 ] : zp ZP_BYTE:87 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:88 [ init_font_hex::$0 ] : zp ZP_BYTE:88 , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:89 [ init_font_hex::$1 ] : zp ZP_BYTE:89 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:90 [ init_font_hex::$2 ] : zp ZP_BYTE:90 , reg byte a , reg byte x , reg byte y ,
Potential registers zp ZP_BYTE:91 [ init_font_hex::idx#3 ] : zp ZP_BYTE:91 , reg byte a , reg byte x , reg byte y ,
REGISTER UPLIFT SCOPES
Uplift Scope [atan2_16] 28,670.58: zp ZP_BYTE:28 [ atan2_16::shift#2 atan2_16::shift#5 atan2_16::shift#1 ] 20,608: zp ZP_WORD:29 [ atan2_16::yd#5 atan2_16::yd#3 atan2_16::yd#10 atan2_16::yd#1 atan2_16::yd#2 ] 17,338.67: zp ZP_WORD:31 [ atan2_16::xd#5 atan2_16::xd#3 atan2_16::xd#10 atan2_16::xd#1 atan2_16::xd#2 ] 7,533.33: zp ZP_WORD:24 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] 2,698.28: zp ZP_WORD:19 [ atan2_16::yi#3 atan2_16::yi#8 atan2_16::yi#0 atan2_16::yi#16 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ] 2,283.07: zp ZP_WORD:21 [ atan2_16::xi#3 atan2_16::xi#8 atan2_16::xi#0 atan2_16::xi#13 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] 2,002: zp ZP_BYTE:86 [ atan2_16::$24 ] 2,002: zp ZP_BYTE:87 [ atan2_16::$23 ] 1,710.04: zp ZP_BYTE:23 [ atan2_16::i#2 atan2_16::i#1 ] 202: zp ZP_WORD:76 [ atan2_16::return#2 ] 50: zp ZP_WORD:26 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] 2.87: zp ZP_WORD:72 [ atan2_16::x#0 ] 2.72: zp ZP_WORD:74 [ atan2_16::y#0 ]
Uplift Scope [init_font_hex] 2,168.83: zp ZP_BYTE:41 [ init_font_hex::i#2 init_font_hex::i#1 ] 2,002: zp ZP_BYTE:89 [ init_font_hex::$1 ] 2,002: zp ZP_BYTE:90 [ init_font_hex::$2 ] 1,151.6: zp ZP_BYTE:42 [ init_font_hex::idx#5 init_font_hex::idx#2 ] 1,001: zp ZP_BYTE:88 [ init_font_hex::$0 ] 202: zp ZP_BYTE:91 [ init_font_hex::idx#3 ] 165.86: zp ZP_WORD:36 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] 164.97: zp ZP_BYTE:40 [ init_font_hex::c1#4 init_font_hex::c1#1 ] 143.04: zp ZP_WORD:38 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] 64.17: zp ZP_WORD:33 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] 17.66: zp ZP_BYTE:35 [ init_font_hex::c#6 init_font_hex::c#1 ]
Uplift Scope [init_angle_screen] 202: zp ZP_BYTE:65 [ init_angle_screen::$2 ] 202: zp ZP_BYTE:66 [ init_angle_screen::$3 ] 202: zp ZP_BYTE:69 [ init_angle_screen::$6 ] 202: zp ZP_WORD:78 [ init_angle_screen::angle_w#0 ] 202: zp ZP_WORD:80 [ init_angle_screen::$10 ] 202: zp ZP_BYTE:83 [ init_angle_screen::$12 ] 202: zp ZP_BYTE:84 [ init_angle_screen::$13 ] 202: zp ZP_BYTE:85 [ init_angle_screen::$14 ] 126.25: zp ZP_BYTE:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ] 120.24: zp ZP_BYTE:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] 72.14: zp ZP_BYTE:82 [ init_angle_screen::ang_w#0 ] 50.5: zp ZP_WORD:70 [ init_angle_screen::yw#0 ] 33.67: zp ZP_WORD:67 [ init_angle_screen::xw#0 ] 21.23: zp ZP_BYTE:12 [ init_angle_screen::y#4 init_angle_screen::y#1 ] 16.29: zp ZP_WORD:15 [ init_angle_screen::screen_bottomline#5 init_angle_screen::screen_bottomline#1 ] 14.83: zp ZP_WORD:13 [ init_angle_screen::screen_topline#5 init_angle_screen::screen_topline#1 ]
Uplift Scope [print_char_at] 12: zp ZP_BYTE:9 [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] 12: zp ZP_WORD:10 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ]
Uplift Scope [print_byte_at] 9.33: zp ZP_WORD:7 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] 5.6: zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] 4: zp ZP_BYTE:59 [ print_byte_at::$0 ] 2: zp ZP_BYTE:60 [ print_byte_at::$2 ]
Uplift Scope [print_word_at] 10: zp ZP_WORD:2 [ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ] 0.8: zp ZP_WORD:4 [ print_word_at::at#2 ]
Uplift Scope [main] 4: zp ZP_DWORD:47 [ main::$4 ] 4: zp ZP_DWORD:51 [ main::cyclecount#0 ]
Uplift Scope [clock] 4: zp ZP_DWORD:43 [ clock::return#2 ] 1.33: zp ZP_DWORD:61 [ clock::return#0 ]
Uplift Scope [print_dword_at] 2: zp ZP_DWORD:55 [ print_dword_at::dw#0 ]
Uplift Scope [clock_start]
Uplift Scope []
Uplifting [atan2_16] best 1159771 combination reg byte y [ atan2_16::shift#2 atan2_16::shift#5 atan2_16::shift#1 ] zp ZP_WORD:29 [ atan2_16::yd#5 atan2_16::yd#3 atan2_16::yd#10 atan2_16::yd#1 atan2_16::yd#2 ] zp ZP_WORD:31 [ atan2_16::xd#5 atan2_16::xd#3 atan2_16::xd#10 atan2_16::xd#1 atan2_16::xd#2 ] zp ZP_WORD:24 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] zp ZP_WORD:19 [ atan2_16::yi#3 atan2_16::yi#8 atan2_16::yi#0 atan2_16::yi#16 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ] zp ZP_WORD:21 [ atan2_16::xi#3 atan2_16::xi#8 atan2_16::xi#0 atan2_16::xi#13 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ] reg byte a [ atan2_16::$24 ] reg byte a [ atan2_16::$23 ] reg byte x [ atan2_16::i#2 atan2_16::i#1 ] zp ZP_WORD:76 [ atan2_16::return#2 ] zp ZP_WORD:26 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] zp ZP_WORD:72 [ atan2_16::x#0 ] zp ZP_WORD:74 [ atan2_16::y#0 ]
Limited combination testing to 100 combinations of 144 possible.
Uplifting [init_font_hex] best 1140771 combination reg byte x [ init_font_hex::i#2 init_font_hex::i#1 ] reg byte a [ init_font_hex::$1 ] reg byte a [ init_font_hex::$2 ] zp ZP_BYTE:42 [ init_font_hex::idx#5 init_font_hex::idx#2 ] zp ZP_BYTE:88 [ init_font_hex::$0 ] zp ZP_BYTE:91 [ init_font_hex::idx#3 ] zp ZP_WORD:36 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ] zp ZP_BYTE:40 [ init_font_hex::c1#4 init_font_hex::c1#1 ] zp ZP_WORD:38 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ] zp ZP_WORD:33 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ] zp ZP_BYTE:35 [ init_font_hex::c#6 init_font_hex::c#1 ]
Limited combination testing to 100 combinations of 6912 possible.
Uplifting [init_angle_screen] best 1138771 combination reg byte a [ init_angle_screen::$2 ] reg byte a [ init_angle_screen::$3 ] reg byte a [ init_angle_screen::$6 ] zp ZP_WORD:78 [ init_angle_screen::angle_w#0 ] zp ZP_WORD:80 [ init_angle_screen::$10 ] reg byte a [ init_angle_screen::$12 ] zp ZP_BYTE:84 [ init_angle_screen::$13 ] zp ZP_BYTE:85 [ init_angle_screen::$14 ] zp ZP_BYTE:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ] zp ZP_BYTE:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ] zp ZP_BYTE:82 [ init_angle_screen::ang_w#0 ] zp ZP_WORD:70 [ init_angle_screen::yw#0 ] zp ZP_WORD:67 [ init_angle_screen::xw#0 ] zp ZP_BYTE:12 [ init_angle_screen::y#4 init_angle_screen::y#1 ] zp ZP_WORD:15 [ init_angle_screen::screen_bottomline#5 init_angle_screen::screen_bottomline#1 ] zp ZP_WORD:13 [ init_angle_screen::screen_topline#5 init_angle_screen::screen_topline#1 ]
Limited combination testing to 100 combinations of 65536 possible.
Uplifting [print_char_at] best 1138764 combination reg byte x [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ] zp ZP_WORD:10 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ]
Uplifting [print_byte_at] best 1138756 combination zp ZP_WORD:7 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ] reg byte a [ print_byte_at::$0 ] reg byte y [ print_byte_at::$2 ]
Uplifting [print_word_at] best 1138756 combination zp ZP_WORD:2 [ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ] zp ZP_WORD:4 [ print_word_at::at#2 ]
Uplifting [main] best 1138756 combination zp ZP_DWORD:47 [ main::$4 ] zp ZP_DWORD:51 [ main::cyclecount#0 ]
Uplifting [clock] best 1138756 combination zp ZP_DWORD:43 [ clock::return#2 ] zp ZP_DWORD:61 [ clock::return#0 ]
Uplifting [print_dword_at] best 1138756 combination zp ZP_DWORD:55 [ print_dword_at::dw#0 ]
Uplifting [clock_start] best 1138756 combination
Uplifting [] best 1138756 combination
Attempting to uplift remaining variables inzp ZP_BYTE:42 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
Uplifting [init_font_hex] best 1138756 combination zp ZP_BYTE:42 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
Attempting to uplift remaining variables inzp ZP_BYTE:88 [ init_font_hex::$0 ]
Uplifting [init_font_hex] best 1138756 combination zp ZP_BYTE:88 [ init_font_hex::$0 ]
Attempting to uplift remaining variables inzp ZP_BYTE:84 [ init_angle_screen::$13 ]
Uplifting [init_angle_screen] best 1138156 combination reg byte a [ init_angle_screen::$13 ]
Attempting to uplift remaining variables inzp ZP_BYTE:85 [ init_angle_screen::$14 ]
Uplifting [init_angle_screen] best 1137556 combination reg byte a [ init_angle_screen::$14 ]
Attempting to uplift remaining variables inzp ZP_BYTE:91 [ init_font_hex::idx#3 ]
Uplifting [init_font_hex] best 1136956 combination reg byte y [ init_font_hex::idx#3 ]
Attempting to uplift remaining variables inzp ZP_BYTE:40 [ init_font_hex::c1#4 init_font_hex::c1#1 ]
Uplifting [init_font_hex] best 1136956 combination zp ZP_BYTE:40 [ init_font_hex::c1#4 init_font_hex::c1#1 ]
Attempting to uplift remaining variables inzp ZP_BYTE:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ]
Uplifting [init_angle_screen] best 1136956 combination zp ZP_BYTE:17 [ init_angle_screen::x#2 init_angle_screen::x#1 ]
Attempting to uplift remaining variables inzp ZP_BYTE:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ]
Uplifting [init_angle_screen] best 1136956 combination zp ZP_BYTE:18 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ]
Attempting to uplift remaining variables inzp ZP_BYTE:82 [ init_angle_screen::ang_w#0 ]
Uplifting [init_angle_screen] best 1136956 combination zp ZP_BYTE:82 [ init_angle_screen::ang_w#0 ]
Attempting to uplift remaining variables inzp ZP_BYTE:12 [ init_angle_screen::y#4 init_angle_screen::y#1 ]
Uplifting [init_angle_screen] best 1136956 combination zp ZP_BYTE:12 [ init_angle_screen::y#4 init_angle_screen::y#1 ]
Attempting to uplift remaining variables inzp ZP_BYTE:35 [ init_font_hex::c#6 init_font_hex::c#1 ]
Uplifting [init_font_hex] best 1136956 combination zp ZP_BYTE:35 [ init_font_hex::c#6 init_font_hex::c#1 ]
Attempting to uplift remaining variables inzp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ]
Uplifting [print_byte_at] best 1136956 combination zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ]
Coalescing zero page register with common assignment [ zp ZP_WORD:4 [ print_word_at::at#2 ] ] with [ zp ZP_WORD:7 [ print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ] ] - score: 2
Coalescing zero page register with common assignment [ zp ZP_WORD:24 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 ] ] with [ zp ZP_WORD:26 [ atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_DWORD:43 [ clock::return#2 ] ] with [ zp ZP_DWORD:47 [ main::$4 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_DWORD:43 [ clock::return#2 main::$4 ] ] with [ zp ZP_DWORD:61 [ clock::return#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_DWORD:51 [ main::cyclecount#0 ] ] with [ zp ZP_DWORD:55 [ print_dword_at::dw#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:67 [ init_angle_screen::xw#0 ] ] with [ zp ZP_WORD:72 [ atan2_16::x#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:70 [ init_angle_screen::yw#0 ] ] with [ zp ZP_WORD:74 [ atan2_16::y#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:76 [ atan2_16::return#2 ] ] with [ zp ZP_WORD:78 [ init_angle_screen::angle_w#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:24 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 ] ] with [ zp ZP_WORD:76 [ atan2_16::return#2 init_angle_screen::angle_w#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_DWORD:43 [ clock::return#2 main::$4 clock::return#0 ] ] with [ zp ZP_DWORD:51 [ main::cyclecount#0 print_dword_at::dw#0 ] ] - score: 1
Coalescing zero page register with common assignment [ zp ZP_WORD:24 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 atan2_16::return#2 init_angle_screen::angle_w#0 ] ] with [ zp ZP_WORD:80 [ init_angle_screen::$10 ] ] - score: 1
Allocated (was zp ZP_WORD:10) zp ZP_WORD:7 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ]
Allocated (was zp ZP_BYTE:12) zp ZP_BYTE:9 [ init_angle_screen::y#4 init_angle_screen::y#1 ]
Allocated (was zp ZP_WORD:13) zp ZP_WORD:10 [ init_angle_screen::screen_topline#5 init_angle_screen::screen_topline#1 ]
Allocated (was zp ZP_WORD:15) zp ZP_WORD:12 [ init_angle_screen::screen_bottomline#5 init_angle_screen::screen_bottomline#1 ]
Allocated (was zp ZP_BYTE:17) zp ZP_BYTE:14 [ init_angle_screen::x#2 init_angle_screen::x#1 ]
Allocated (was zp ZP_BYTE:18) zp ZP_BYTE:15 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ]
Allocated (was zp ZP_WORD:19) zp ZP_WORD:16 [ atan2_16::yi#3 atan2_16::yi#8 atan2_16::yi#0 atan2_16::yi#16 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ]
Allocated (was zp ZP_WORD:21) zp ZP_WORD:18 [ atan2_16::xi#3 atan2_16::xi#8 atan2_16::xi#0 atan2_16::xi#13 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ]
Allocated (was zp ZP_WORD:24) zp ZP_WORD:20 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 atan2_16::return#2 init_angle_screen::angle_w#0 init_angle_screen::$10 ]
Allocated (was zp ZP_WORD:29) zp ZP_WORD:22 [ atan2_16::yd#5 atan2_16::yd#3 atan2_16::yd#10 atan2_16::yd#1 atan2_16::yd#2 ]
Allocated (was zp ZP_WORD:31) zp ZP_WORD:24 [ atan2_16::xd#5 atan2_16::xd#3 atan2_16::xd#10 atan2_16::xd#1 atan2_16::xd#2 ]
Allocated (was zp ZP_WORD:33) zp ZP_WORD:26 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ]
Allocated (was zp ZP_BYTE:35) zp ZP_BYTE:28 [ init_font_hex::c#6 init_font_hex::c#1 ]
Allocated (was zp ZP_WORD:36) zp ZP_WORD:29 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ]
Allocated (was zp ZP_WORD:38) zp ZP_WORD:31 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ]
Allocated (was zp ZP_BYTE:40) zp ZP_BYTE:33 [ init_font_hex::c1#4 init_font_hex::c1#1 ]
Allocated (was zp ZP_BYTE:42) zp ZP_BYTE:34 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
Allocated (was zp ZP_DWORD:43) zp ZP_DWORD:35 [ clock::return#2 main::$4 clock::return#0 main::cyclecount#0 print_dword_at::dw#0 ]
Allocated (was zp ZP_WORD:67) zp ZP_WORD:39 [ init_angle_screen::xw#0 atan2_16::x#0 ]
Allocated (was zp ZP_WORD:70) zp ZP_WORD:41 [ init_angle_screen::yw#0 atan2_16::y#0 ]
Allocated (was zp ZP_BYTE:82) zp ZP_BYTE:43 [ init_angle_screen::ang_w#0 ]
Allocated (was zp ZP_BYTE:88) zp ZP_BYTE:44 [ init_font_hex::$0 ]
ASSEMBLER BEFORE OPTIMIZATION
//SEG0 File Comments
// Calculate the angle to the center of the screen - and show it using font-hex
// 4.65 million cycles
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(bbegin)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.label D018 = $d018
// CIA #2 Timer A+B Value (32-bit)
.label CIA2_TIMER_AB = $dd04
// CIA #2 Timer A Control Register
.label CIA2_TIMER_A_CONTROL = $dd0e
// CIA #2 Timer B Control Register
.label CIA2_TIMER_B_CONTROL = $dd0f
// Timer Control - Start/stop timer (0:stop, 1: start)
.const CIA_TIMER_CONTROL_START = 1
// Timer Control - Time CONTINUOUS/ONE-SHOT (0:CONTINUOUS, 1: ONE-SHOT)
.const CIA_TIMER_CONTROL_CONTINUOUS = 0
// Timer B Control - Timer counts (00:system cycles, 01: CNT pulses, 10: timer A underflow, 11: time A underflow while CNT is high)
.const CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = $40
// The number of iterations performed during 16-bit CORDIC atan2 calculation
.const CORDIC_ITERATIONS_16 = $f
// Clock cycles used to start & read the cycle clock by calling clock_start() and clock() once. Can be subtracted when calculating the number of cycles used by a routine.
// To make precise cycle measurements interrupts and the display must be disabled so neither steals any cycles from the code.
.const CLOCKS_PER_INIT = $12
.label CHARSET = $2000
.label SCREEN = $2800
//SEG3 @begin
bbegin:
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
b1_from_bbegin:
jmp b1
//SEG5 @1
b1:
//SEG6 [2] call main
//SEG7 [4] phi from @1 to main [phi:@1->main]
main_from_b1:
jsr main
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
bend_from_b1:
jmp bend
//SEG9 @end
bend:
//SEG10 main
main: {
.label BASE_SCREEN = $400
.label BASE_CHARSET = $1000
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET)/4&$f
.const toD0182_return = (>(BASE_SCREEN&$3fff)*4)|(>BASE_CHARSET)/4&$f
.label _4 = $23
.label cyclecount = $23
//SEG11 [5] call init_font_hex
//SEG12 [128] phi from main to init_font_hex [phi:main->init_font_hex]
init_font_hex_from_main:
jsr init_font_hex
//SEG13 [6] phi from main to main::toD0181 [phi:main->main::toD0181]
toD0181_from_main:
jmp toD0181
//SEG14 main::toD0181
toD0181:
jmp b1
//SEG15 main::@1
b1:
//SEG16 [7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2
lda #toD0181_return
sta D018
//SEG17 [8] call clock_start
jsr clock_start
//SEG18 [9] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
b3_from_b1:
jmp b3
//SEG19 main::@3
b3:
//SEG20 [10] call init_angle_screen
//SEG21 [49] phi from main::@3 to init_angle_screen [phi:main::@3->init_angle_screen]
init_angle_screen_from_b3:
jsr init_angle_screen
//SEG22 [11] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
b4_from_b3:
jmp b4
//SEG23 main::@4
b4:
//SEG24 [12] call clock
jsr clock
//SEG25 [13] (dword) clock::return#2 ← (dword) clock::return#0
jmp b5
//SEG26 main::@5
b5:
//SEG27 [14] (dword~) main::$4 ← (dword) clock::return#2
//SEG28 [15] (dword) main::cyclecount#0 ← (dword~) main::$4 - (const dword) CLOCKS_PER_INIT#0 -- vduz1=vduz1_minus_vduc1
lda cyclecount
sec
sbc #<CLOCKS_PER_INIT
sta cyclecount
lda cyclecount+1
sbc #>CLOCKS_PER_INIT
sta cyclecount+1
lda cyclecount+2
sbc #<CLOCKS_PER_INIT>>$10
sta cyclecount+2
lda cyclecount+3
sbc #>CLOCKS_PER_INIT>>$10
sta cyclecount+3
//SEG29 [16] (dword) print_dword_at::dw#0 ← (dword) main::cyclecount#0
//SEG30 [17] call print_dword_at
jsr print_dword_at
//SEG31 [18] phi from main::@5 to main::toD0182 [phi:main::@5->main::toD0182]
toD0182_from_b5:
jmp toD0182
//SEG32 main::toD0182
toD0182:
jmp b2
//SEG33 main::@2
b2:
//SEG34 [19] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2
lda #toD0182_return
sta D018
jmp breturn
//SEG35 main::@return
breturn:
//SEG36 [20] return
rts
}
//SEG37 print_dword_at
// Print a dword as HEX at a specific position
// print_dword_at(dword zeropage($23) dw)
print_dword_at: {
.label dw = $23
//SEG38 [21] (word) print_word_at::w#0 ← > (dword) print_dword_at::dw#0 -- vwuz1=_hi_vduz2
lda dw+2
sta print_word_at.w
lda dw+3
sta print_word_at.w+1
//SEG39 [22] call print_word_at
//SEG40 [26] phi from print_dword_at to print_word_at [phi:print_dword_at->print_word_at]
print_word_at_from_print_dword_at:
//SEG41 [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0 [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1
lda #<main.BASE_SCREEN
sta print_word_at.at
lda #>main.BASE_SCREEN
sta print_word_at.at+1
//SEG42 [26] phi (word) print_word_at::w#2 = (word) print_word_at::w#0 [phi:print_dword_at->print_word_at#1] -- register_copy
jsr print_word_at
jmp b1
//SEG43 print_dword_at::@1
b1:
//SEG44 [23] (word) print_word_at::w#1 ← < (dword) print_dword_at::dw#0 -- vwuz1=_lo_vduz2
lda dw
sta print_word_at.w
lda dw+1
sta print_word_at.w+1
//SEG45 [24] call print_word_at
//SEG46 [26] phi from print_dword_at::@1 to print_word_at [phi:print_dword_at::@1->print_word_at]
print_word_at_from_b1:
//SEG47 [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1
lda #<main.BASE_SCREEN+4
sta print_word_at.at
lda #>main.BASE_SCREEN+4
sta print_word_at.at+1
//SEG48 [26] phi (word) print_word_at::w#2 = (word) print_word_at::w#1 [phi:print_dword_at::@1->print_word_at#1] -- register_copy
jsr print_word_at
jmp breturn
//SEG49 print_dword_at::@return
breturn:
//SEG50 [25] return
rts
}
//SEG51 print_word_at
// Print a word as HEX at a specific position
// print_word_at(word zeropage(2) w, byte* zeropage(4) at)
print_word_at: {
.label w = 2
.label at = 4
//SEG52 [27] (byte) print_byte_at::b#0 ← > (word) print_word_at::w#2 -- vbuz1=_hi_vwuz2
lda w+1
sta print_byte_at.b
//SEG53 [28] (byte*) print_byte_at::at#0 ← (byte*) print_word_at::at#2
//SEG54 [29] call print_byte_at
//SEG55 [34] phi from print_word_at to print_byte_at [phi:print_word_at->print_byte_at]
print_byte_at_from_print_word_at:
//SEG56 [34] phi (byte*) print_byte_at::at#2 = (byte*) print_byte_at::at#0 [phi:print_word_at->print_byte_at#0] -- register_copy
//SEG57 [34] phi (byte) print_byte_at::b#2 = (byte) print_byte_at::b#0 [phi:print_word_at->print_byte_at#1] -- register_copy
jsr print_byte_at
jmp b1
//SEG58 print_word_at::@1
b1:
//SEG59 [30] (byte) print_byte_at::b#1 ← < (word) print_word_at::w#2 -- vbuz1=_lo_vwuz2
lda w
sta print_byte_at.b
//SEG60 [31] (byte*) print_byte_at::at#1 ← (byte*) print_word_at::at#2 + (byte) 2 -- pbuz1=pbuz1_plus_2
lda print_byte_at.at
clc
adc #2
sta print_byte_at.at
bcc !+
inc print_byte_at.at+1
!:
//SEG61 [32] call print_byte_at
//SEG62 [34] phi from print_word_at::@1 to print_byte_at [phi:print_word_at::@1->print_byte_at]
print_byte_at_from_b1:
//SEG63 [34] phi (byte*) print_byte_at::at#2 = (byte*) print_byte_at::at#1 [phi:print_word_at::@1->print_byte_at#0] -- register_copy
//SEG64 [34] phi (byte) print_byte_at::b#2 = (byte) print_byte_at::b#1 [phi:print_word_at::@1->print_byte_at#1] -- register_copy
jsr print_byte_at
jmp breturn
//SEG65 print_word_at::@return
breturn:
//SEG66 [33] return
rts
}
//SEG67 print_byte_at
// Print a byte as HEX at a specific position
// print_byte_at(byte zeropage(6) b, byte* zeropage(4) at)
print_byte_at: {
.label b = 6
.label at = 4
//SEG68 [35] (byte~) print_byte_at::$0 ← (byte) print_byte_at::b#2 >> (byte) 4 -- vbuaa=vbuz1_ror_4
lda b
lsr
lsr
lsr
lsr
//SEG69 [36] (byte) print_char_at::ch#0 ← *((const byte[]) print_hextab#0 + (byte~) print_byte_at::$0) -- vbuxx=pbuc1_derefidx_vbuaa
tay
ldx print_hextab,y
//SEG70 [37] (byte*) print_char_at::at#0 ← (byte*) print_byte_at::at#2 -- pbuz1=pbuz2
lda at
sta print_char_at.at
lda at+1
sta print_char_at.at+1
//SEG71 [38] call print_char_at
//SEG72 [44] phi from print_byte_at to print_char_at [phi:print_byte_at->print_char_at]
print_char_at_from_print_byte_at:
//SEG73 [44] phi (byte*) print_char_at::at#2 = (byte*) print_char_at::at#0 [phi:print_byte_at->print_char_at#0] -- register_copy
//SEG74 [44] phi (byte) print_char_at::ch#2 = (byte) print_char_at::ch#0 [phi:print_byte_at->print_char_at#1] -- register_copy
jsr print_char_at
jmp b1
//SEG75 print_byte_at::@1
b1:
//SEG76 [39] (byte~) print_byte_at::$2 ← (byte) print_byte_at::b#2 & (byte) $f -- vbuyy=vbuz1_band_vbuc1
lda #$f
and b
tay
//SEG77 [40] (byte*) print_char_at::at#1 ← (byte*) print_byte_at::at#2 + (byte) 1 -- pbuz1=pbuz2_plus_1
lda at
clc
adc #1
sta print_char_at.at
lda at+1
adc #0
sta print_char_at.at+1
//SEG78 [41] (byte) print_char_at::ch#1 ← *((const byte[]) print_hextab#0 + (byte~) print_byte_at::$2) -- vbuxx=pbuc1_derefidx_vbuyy
ldx print_hextab,y
//SEG79 [42] call print_char_at
//SEG80 [44] phi from print_byte_at::@1 to print_char_at [phi:print_byte_at::@1->print_char_at]
print_char_at_from_b1:
//SEG81 [44] phi (byte*) print_char_at::at#2 = (byte*) print_char_at::at#1 [phi:print_byte_at::@1->print_char_at#0] -- register_copy
//SEG82 [44] phi (byte) print_char_at::ch#2 = (byte) print_char_at::ch#1 [phi:print_byte_at::@1->print_char_at#1] -- register_copy
jsr print_char_at
jmp breturn
//SEG83 print_byte_at::@return
breturn:
//SEG84 [43] return
rts
}
//SEG85 print_char_at
// Print a single char
// print_char_at(byte register(X) ch, byte* zeropage(7) at)
print_char_at: {
.label at = 7
//SEG86 [45] *((byte*) print_char_at::at#2) ← (byte) print_char_at::ch#2 -- _deref_pbuz1=vbuxx
txa
ldy #0
sta (at),y
jmp breturn
//SEG87 print_char_at::@return
breturn:
//SEG88 [46] return
rts
}
//SEG89 clock
// Returns the processor clock time used since the beginning of an implementation defined era (normally the beginning of the program).
// This uses CIA #2 Timer A+B on the C64, and must be initialized using clock_start()
clock: {
.label return = $23
//SEG90 [47] (dword) clock::return#0 ← (dword) $ffffffff - *((const dword*) CIA2_TIMER_AB#0) -- vduz1=vduc1_minus__deref_pduc2
lda #<$ffffffff
sec
sbc CIA2_TIMER_AB
sta return
lda #>$ffffffff
sbc CIA2_TIMER_AB+1
sta return+1
lda #<$ffffffff>>$10
sbc CIA2_TIMER_AB+2
sta return+2
lda #>$ffffffff>>$10
sbc CIA2_TIMER_AB+3
sta return+3
jmp breturn
//SEG91 clock::@return
breturn:
//SEG92 [48] return
rts
}
//SEG93 init_angle_screen
// Populates 1000 bytes (a screen) with values representing the angle to the center.
// Utilizes symmetry around the center
init_angle_screen: {
.label _10 = $14
.label xw = $27
.label yw = $29
.label angle_w = $14
.label ang_w = $2b
.label x = $e
.label xb = $f
.label screen_topline = $a
.label screen_bottomline = $c
.label y = 9
//SEG94 [50] phi from init_angle_screen to init_angle_screen::@1 [phi:init_angle_screen->init_angle_screen::@1]
b1_from_init_angle_screen:
//SEG95 [50] phi (byte*) init_angle_screen::screen_bottomline#5 = (const byte*) SCREEN#0+(word)(number) $28*(number) $c [phi:init_angle_screen->init_angle_screen::@1#0] -- pbuz1=pbuc1
lda #<SCREEN+$28*$c
sta screen_bottomline
lda #>SCREEN+$28*$c
sta screen_bottomline+1
//SEG96 [50] phi (byte*) init_angle_screen::screen_topline#5 = (const byte*) SCREEN#0+(word)(number) $28*(number) $c [phi:init_angle_screen->init_angle_screen::@1#1] -- pbuz1=pbuc1
lda #<SCREEN+$28*$c
sta screen_topline
lda #>SCREEN+$28*$c
sta screen_topline+1
//SEG97 [50] phi (byte) init_angle_screen::y#4 = (byte) 0 [phi:init_angle_screen->init_angle_screen::@1#2] -- vbuz1=vbuc1
lda #0
sta y
jmp b1
//SEG98 [50] phi from init_angle_screen::@3 to init_angle_screen::@1 [phi:init_angle_screen::@3->init_angle_screen::@1]
b1_from_b3:
//SEG99 [50] phi (byte*) init_angle_screen::screen_bottomline#5 = (byte*) init_angle_screen::screen_bottomline#1 [phi:init_angle_screen::@3->init_angle_screen::@1#0] -- register_copy
//SEG100 [50] phi (byte*) init_angle_screen::screen_topline#5 = (byte*) init_angle_screen::screen_topline#1 [phi:init_angle_screen::@3->init_angle_screen::@1#1] -- register_copy
//SEG101 [50] phi (byte) init_angle_screen::y#4 = (byte) init_angle_screen::y#1 [phi:init_angle_screen::@3->init_angle_screen::@1#2] -- register_copy
jmp b1
//SEG102 init_angle_screen::@1
b1:
//SEG103 [51] phi from init_angle_screen::@1 to init_angle_screen::@2 [phi:init_angle_screen::@1->init_angle_screen::@2]
b2_from_b1:
//SEG104 [51] phi (byte) init_angle_screen::xb#2 = (byte) $27 [phi:init_angle_screen::@1->init_angle_screen::@2#0] -- vbuz1=vbuc1
lda #$27
sta xb
//SEG105 [51] phi (byte) init_angle_screen::x#2 = (byte) 0 [phi:init_angle_screen::@1->init_angle_screen::@2#1] -- vbuz1=vbuc1
lda #0
sta x
jmp b2
//SEG106 [51] phi from init_angle_screen::@4 to init_angle_screen::@2 [phi:init_angle_screen::@4->init_angle_screen::@2]
b2_from_b4:
//SEG107 [51] phi (byte) init_angle_screen::xb#2 = (byte) init_angle_screen::xb#1 [phi:init_angle_screen::@4->init_angle_screen::@2#0] -- register_copy
//SEG108 [51] phi (byte) init_angle_screen::x#2 = (byte) init_angle_screen::x#1 [phi:init_angle_screen::@4->init_angle_screen::@2#1] -- register_copy
jmp b2
//SEG109 init_angle_screen::@2
b2:
//SEG110 [52] (byte~) init_angle_screen::$2 ← (byte) init_angle_screen::x#2 << (byte) 1 -- vbuaa=vbuz1_rol_1
lda x
asl
//SEG111 [53] (byte~) init_angle_screen::$3 ← (byte) $27 - (byte~) init_angle_screen::$2 -- vbuaa=vbuc1_minus_vbuaa
eor #$ff
clc
adc #$27+1
//SEG112 [54] (word) init_angle_screen::xw#0 ← (byte~) init_angle_screen::$3 w= (byte) 0 -- vwuz1=vbuaa_word_vbuc1
ldy #0
sta xw+1
sty xw
//SEG113 [55] (byte~) init_angle_screen::$6 ← (byte) init_angle_screen::y#4 << (byte) 1 -- vbuaa=vbuz1_rol_1
lda y
asl
//SEG114 [56] (word) init_angle_screen::yw#0 ← (byte~) init_angle_screen::$6 w= (byte) 0 -- vwuz1=vbuaa_word_vbuc1
ldy #0
sta yw+1
sty yw
//SEG115 [57] (signed word) atan2_16::x#0 ← (signed word)(word) init_angle_screen::xw#0
//SEG116 [58] (signed word) atan2_16::y#0 ← (signed word)(word) init_angle_screen::yw#0
//SEG117 [59] call atan2_16
jsr atan2_16
//SEG118 [60] (word) atan2_16::return#2 ← (word) atan2_16::return#0
jmp b4
//SEG119 init_angle_screen::@4
b4:
//SEG120 [61] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2
//SEG121 [62] (word~) init_angle_screen::$10 ← (word) init_angle_screen::angle_w#0 + (byte) $80 -- vwuz1=vwuz1_plus_vbuc1
lda #$80
clc
adc _10
sta _10
bcc !+
inc _10+1
!:
//SEG122 [63] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$10 -- vbuz1=_hi_vwuz2
lda _10+1
sta ang_w
//SEG123 [64] (byte~) init_angle_screen::$12 ← (byte) $80 + (byte) init_angle_screen::ang_w#0 -- vbuaa=vbuc1_plus_vbuz1
lda #$80
clc
adc ang_w
//SEG124 [65] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$12 -- pbuz1_derefidx_vbuz2=vbuaa
ldy x
sta (screen_topline),y
//SEG125 [66] (byte~) init_angle_screen::$13 ← (byte) $80 - (byte) init_angle_screen::ang_w#0 -- vbuaa=vbuc1_minus_vbuz1
lda #$80
sec
sbc ang_w
//SEG126 [67] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$13 -- pbuz1_derefidx_vbuz2=vbuaa
ldy x
sta (screen_bottomline),y
//SEG127 [68] (byte~) init_angle_screen::$14 ← - (byte) init_angle_screen::ang_w#0 -- vbuaa=_neg_vbuz1
lda ang_w
eor #$ff
clc
adc #1
//SEG128 [69] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::xb#2) ← (byte~) init_angle_screen::$14 -- pbuz1_derefidx_vbuz2=vbuaa
ldy xb
sta (screen_topline),y
//SEG129 [70] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::xb#2) ← (byte) init_angle_screen::ang_w#0 -- pbuz1_derefidx_vbuz2=vbuz3
lda ang_w
ldy xb
sta (screen_bottomline),y
//SEG130 [71] (byte) init_angle_screen::x#1 ← ++ (byte) init_angle_screen::x#2 -- vbuz1=_inc_vbuz1
inc x
//SEG131 [72] (byte) init_angle_screen::xb#1 ← -- (byte) init_angle_screen::xb#2 -- vbuz1=_dec_vbuz1
dec xb
//SEG132 [73] if((byte) init_angle_screen::x#1<(byte) $13+(byte) 1) goto init_angle_screen::@2 -- vbuz1_lt_vbuc1_then_la1
lda x
cmp #$13+1
bcc b2_from_b4
jmp b3
//SEG133 init_angle_screen::@3
b3:
//SEG134 [74] (byte*) init_angle_screen::screen_topline#1 ← (byte*) init_angle_screen::screen_topline#5 - (byte) $28 -- pbuz1=pbuz1_minus_vwuc1
lda screen_topline
sec
sbc #<$28
sta screen_topline
lda screen_topline+1
sbc #>$28
sta screen_topline+1
//SEG135 [75] (byte*) init_angle_screen::screen_bottomline#1 ← (byte*) init_angle_screen::screen_bottomline#5 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc screen_bottomline
sta screen_bottomline
bcc !+
inc screen_bottomline+1
!:
//SEG136 [76] (byte) init_angle_screen::y#1 ← ++ (byte) init_angle_screen::y#4 -- vbuz1=_inc_vbuz1
inc y
//SEG137 [77] if((byte) init_angle_screen::y#1!=(byte) $d) goto init_angle_screen::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$d
cmp y
bne b1_from_b3
jmp breturn
//SEG138 init_angle_screen::@return
breturn:
//SEG139 [78] return
rts
}
//SEG140 atan2_16
// 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($27) x, signed word zeropage($29) y)
atan2_16: {
.label _2 = $10
.label _7 = $12
.label yi = $10
.label xi = $12
.label angle = $14
.label xd = $18
.label yd = $16
.label return = $14
.label x = $27
.label y = $29
//SEG141 [79] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1 -- vwsz1_ge_0_then_la1
lda y+1
bpl b1
jmp b2
//SEG142 atan2_16::@2
b2:
//SEG143 [80] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0 -- vwsz1=_neg_vwsz2
sec
lda #0
sbc y
sta _2
lda #0
sbc y+1
sta _2+1
//SEG144 [81] phi from atan2_16::@1 atan2_16::@2 to atan2_16::@3 [phi:atan2_16::@1/atan2_16::@2->atan2_16::@3]
b3_from_b1:
b3_from_b2:
//SEG145 [81] phi (signed word) atan2_16::yi#0 = (signed word~) atan2_16::yi#16 [phi:atan2_16::@1/atan2_16::@2->atan2_16::@3#0] -- register_copy
jmp b3
//SEG146 atan2_16::@3
b3:
//SEG147 [82] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4 -- vwsz1_ge_0_then_la1
lda x+1
bpl b4
jmp b5
//SEG148 atan2_16::@5
b5:
//SEG149 [83] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0 -- vwsz1=_neg_vwsz2
sec
lda #0
sbc x
sta _7
lda #0
sbc x+1
sta _7+1
//SEG150 [84] phi from atan2_16::@4 atan2_16::@5 to atan2_16::@6 [phi:atan2_16::@4/atan2_16::@5->atan2_16::@6]
b6_from_b4:
b6_from_b5:
//SEG151 [84] phi (signed word) atan2_16::xi#0 = (signed word~) atan2_16::xi#13 [phi:atan2_16::@4/atan2_16::@5->atan2_16::@6#0] -- register_copy
jmp b6
//SEG152 atan2_16::@6
b6:
//SEG153 [85] phi from atan2_16::@6 to atan2_16::@10 [phi:atan2_16::@6->atan2_16::@10]
b10_from_b6:
//SEG154 [85] phi (word) atan2_16::angle#12 = (byte) 0 [phi:atan2_16::@6->atan2_16::@10#0] -- vwuz1=vbuc1
lda #0
sta angle
lda #0
sta angle+1
//SEG155 [85] phi (byte) atan2_16::i#2 = (byte) 0 [phi:atan2_16::@6->atan2_16::@10#1] -- vbuxx=vbuc1
ldx #0
//SEG156 [85] phi (signed word) atan2_16::xi#3 = (signed word) atan2_16::xi#0 [phi:atan2_16::@6->atan2_16::@10#2] -- register_copy
//SEG157 [85] phi (signed word) atan2_16::yi#3 = (signed word) atan2_16::yi#0 [phi:atan2_16::@6->atan2_16::@10#3] -- register_copy
jmp b10
//SEG158 atan2_16::@10
b10:
//SEG159 [86] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11 -- vwsz1_neq_0_then_la1
lda yi+1
bne b11
lda yi
bne b11
//SEG160 [87] phi from atan2_16::@10 atan2_16::@19 to atan2_16::@12 [phi:atan2_16::@10/atan2_16::@19->atan2_16::@12]
b12_from_b10:
b12_from_b19:
//SEG161 [87] phi (word) atan2_16::angle#6 = (word) atan2_16::angle#12 [phi:atan2_16::@10/atan2_16::@19->atan2_16::@12#0] -- register_copy
jmp b12
//SEG162 atan2_16::@12
b12:
//SEG163 [88] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1 -- vwuz1=vwuz1_ror_1
lsr angle+1
ror angle
//SEG164 [89] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7 -- vwsz1_ge_0_then_la1
lda x+1
bpl b7_from_b12
jmp b21
//SEG165 atan2_16::@21
b21:
//SEG166 [90] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1 -- vwuz1=vwuc1_minus_vwuz1
sec
lda #<$8000
sbc angle
sta angle
lda #>$8000
sbc angle+1
sta angle+1
//SEG167 [91] phi from atan2_16::@12 atan2_16::@21 to atan2_16::@7 [phi:atan2_16::@12/atan2_16::@21->atan2_16::@7]
b7_from_b12:
b7_from_b21:
//SEG168 [91] phi (word) atan2_16::angle#11 = (word) atan2_16::angle#1 [phi:atan2_16::@12/atan2_16::@21->atan2_16::@7#0] -- register_copy
jmp b7
//SEG169 atan2_16::@7
b7:
//SEG170 [92] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8 -- vwsz1_ge_0_then_la1
lda y+1
bpl b8_from_b7
jmp b9
//SEG171 atan2_16::@9
b9:
//SEG172 [93] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11 -- vwuz1=_neg_vwuz1
sec
lda #0
sbc angle
sta angle
lda #0
sbc angle+1
sta angle+1
//SEG173 [94] phi from atan2_16::@7 atan2_16::@9 to atan2_16::@8 [phi:atan2_16::@7/atan2_16::@9->atan2_16::@8]
b8_from_b7:
b8_from_b9:
//SEG174 [94] phi (word) atan2_16::return#0 = (word) atan2_16::angle#11 [phi:atan2_16::@7/atan2_16::@9->atan2_16::@8#0] -- register_copy
jmp b8
//SEG175 atan2_16::@8
b8:
jmp breturn
//SEG176 atan2_16::@return
breturn:
//SEG177 [95] return
rts
//SEG178 atan2_16::@11
b11:
//SEG179 [96] (byte~) atan2_16::shift#5 ← (byte) atan2_16::i#2 -- vbuyy=vbuxx
txa
tay
//SEG180 [97] (signed word~) atan2_16::xd#10 ← (signed word) atan2_16::xi#3 -- vwsz1=vwsz2
lda xi
sta xd
lda xi+1
sta xd+1
//SEG181 [98] (signed word~) atan2_16::yd#10 ← (signed word) atan2_16::yi#3 -- vwsz1=vwsz2
lda yi
sta yd
lda yi+1
sta yd+1
//SEG182 [99] phi from atan2_16::@11 atan2_16::@14 to atan2_16::@13 [phi:atan2_16::@11/atan2_16::@14->atan2_16::@13]
b13_from_b11:
b13_from_b14:
//SEG183 [99] phi (signed word) atan2_16::yd#3 = (signed word~) atan2_16::yd#10 [phi:atan2_16::@11/atan2_16::@14->atan2_16::@13#0] -- register_copy
//SEG184 [99] phi (signed word) atan2_16::xd#3 = (signed word~) atan2_16::xd#10 [phi:atan2_16::@11/atan2_16::@14->atan2_16::@13#1] -- register_copy
//SEG185 [99] phi (byte) atan2_16::shift#2 = (byte~) atan2_16::shift#5 [phi:atan2_16::@11/atan2_16::@14->atan2_16::@13#2] -- register_copy
jmp b13
//SEG186 atan2_16::@13
b13:
//SEG187 [100] if((byte) atan2_16::shift#2>=(byte) 1+(byte) 1) goto atan2_16::@14 -- vbuyy_ge_vbuc1_then_la1
cpy #1+1
bcs b14
jmp b15
//SEG188 atan2_16::@15
b15:
//SEG189 [101] if((byte) 0==(byte) atan2_16::shift#2) goto atan2_16::@17 -- vbuc1_eq_vbuyy_then_la1
cpy #0
beq b17_from_b15
jmp b16
//SEG190 atan2_16::@16
b16:
//SEG191 [102] (signed word) atan2_16::xd#2 ← (signed word) atan2_16::xd#3 >> (signed byte) 1 -- vwsz1=vwsz1_ror_1
lda xd+1
cmp #$80
ror xd+1
ror xd
//SEG192 [103] (signed word) atan2_16::yd#2 ← (signed word) atan2_16::yd#3 >> (signed byte) 1 -- vwsz1=vwsz1_ror_1
lda yd+1
cmp #$80
ror yd+1
ror yd
//SEG193 [104] phi from atan2_16::@15 atan2_16::@16 to atan2_16::@17 [phi:atan2_16::@15/atan2_16::@16->atan2_16::@17]
b17_from_b15:
b17_from_b16:
//SEG194 [104] phi (signed word) atan2_16::xd#5 = (signed word) atan2_16::xd#3 [phi:atan2_16::@15/atan2_16::@16->atan2_16::@17#0] -- register_copy
//SEG195 [104] phi (signed word) atan2_16::yd#5 = (signed word) atan2_16::yd#3 [phi:atan2_16::@15/atan2_16::@16->atan2_16::@17#1] -- register_copy
jmp b17
//SEG196 atan2_16::@17
b17:
//SEG197 [105] if((signed word) atan2_16::yi#3>=(signed byte) 0) goto atan2_16::@18 -- vwsz1_ge_0_then_la1
lda yi+1
bpl b18
jmp b20
//SEG198 atan2_16::@20
b20:
//SEG199 [106] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#5 -- vwsz1=vwsz1_minus_vwsz2
lda xi
sec
sbc yd
sta xi
lda xi+1
sbc yd+1
sta xi+1
//SEG200 [107] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#5 -- vwsz1=vwsz1_plus_vwsz2
lda yi
clc
adc xd
sta yi
lda yi+1
adc xd+1
sta yi+1
//SEG201 [108] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1
txa
asl
//SEG202 [109] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24) -- vwuz1=vwuz1_minus_pwuc1_derefidx_vbuaa
tay
sec
lda angle
sbc CORDIC_ATAN2_ANGLES_16,y
sta angle
lda angle+1
sbc CORDIC_ATAN2_ANGLES_16+1,y
sta angle+1
//SEG203 [110] phi from atan2_16::@18 atan2_16::@20 to atan2_16::@19 [phi:atan2_16::@18/atan2_16::@20->atan2_16::@19]
b19_from_b18:
b19_from_b20:
//SEG204 [110] phi (signed word) atan2_16::xi#8 = (signed word) atan2_16::xi#1 [phi:atan2_16::@18/atan2_16::@20->atan2_16::@19#0] -- register_copy
//SEG205 [110] phi (word) atan2_16::angle#13 = (word) atan2_16::angle#2 [phi:atan2_16::@18/atan2_16::@20->atan2_16::@19#1] -- register_copy
//SEG206 [110] phi (signed word) atan2_16::yi#8 = (signed word) atan2_16::yi#1 [phi:atan2_16::@18/atan2_16::@20->atan2_16::@19#2] -- register_copy
jmp b19
//SEG207 atan2_16::@19
b19:
//SEG208 [111] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2 -- vbuxx=_inc_vbuxx
inx
//SEG209 [112] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0-(byte) 1+(byte) 1) goto atan2_16::@12 -- vbuxx_eq_vbuc1_then_la1
cpx #CORDIC_ITERATIONS_16-1+1
beq b12_from_b19
//SEG210 [85] phi from atan2_16::@19 to atan2_16::@10 [phi:atan2_16::@19->atan2_16::@10]
b10_from_b19:
//SEG211 [85] phi (word) atan2_16::angle#12 = (word) atan2_16::angle#13 [phi:atan2_16::@19->atan2_16::@10#0] -- register_copy
//SEG212 [85] phi (byte) atan2_16::i#2 = (byte) atan2_16::i#1 [phi:atan2_16::@19->atan2_16::@10#1] -- register_copy
//SEG213 [85] phi (signed word) atan2_16::xi#3 = (signed word) atan2_16::xi#8 [phi:atan2_16::@19->atan2_16::@10#2] -- register_copy
//SEG214 [85] phi (signed word) atan2_16::yi#3 = (signed word) atan2_16::yi#8 [phi:atan2_16::@19->atan2_16::@10#3] -- register_copy
jmp b10
//SEG215 atan2_16::@18
b18:
//SEG216 [113] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#5 -- vwsz1=vwsz1_plus_vwsz2
lda xi
clc
adc yd
sta xi
lda xi+1
adc yd+1
sta xi+1
//SEG217 [114] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#5 -- vwsz1=vwsz1_minus_vwsz2
lda yi
sec
sbc xd
sta yi
lda yi+1
sbc xd+1
sta yi+1
//SEG218 [115] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1
txa
asl
//SEG219 [116] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23) -- vwuz1=vwuz1_plus_pwuc1_derefidx_vbuaa
tay
clc
lda angle
adc CORDIC_ATAN2_ANGLES_16,y
sta angle
lda angle+1
adc CORDIC_ATAN2_ANGLES_16+1,y
sta angle+1
jmp b19_from_b18
//SEG220 atan2_16::@14
b14:
//SEG221 [117] (signed word) atan2_16::xd#1 ← (signed word) atan2_16::xd#3 >> (signed byte) 2 -- vwsz1=vwsz1_ror_2
lda xd+1
cmp #$80
ror xd+1
ror xd
lda xd+1
cmp #$80
ror xd+1
ror xd
//SEG222 [118] (signed word) atan2_16::yd#1 ← (signed word) atan2_16::yd#3 >> (signed byte) 2 -- vwsz1=vwsz1_ror_2
lda yd+1
cmp #$80
ror yd+1
ror yd
lda yd+1
cmp #$80
ror yd+1
ror yd
//SEG223 [119] (byte) atan2_16::shift#1 ← (byte) atan2_16::shift#2 - (byte) 2 -- vbuyy=vbuyy_minus_2
dey
dey
jmp b13_from_b14
//SEG224 atan2_16::@4
b4:
//SEG225 [120] (signed word~) atan2_16::xi#13 ← (signed word) atan2_16::x#0 -- vwsz1=vwsz2
lda x
sta xi
lda x+1
sta xi+1
jmp b6_from_b4
//SEG226 atan2_16::@1
b1:
//SEG227 [121] (signed word~) atan2_16::yi#16 ← (signed word) atan2_16::y#0 -- vwsz1=vwsz2
lda y
sta yi
lda y+1
sta yi+1
jmp b3_from_b1
}
//SEG228 clock_start
// Reset & start the processor clock time. The value can be read using clock().
// This uses CIA #2 Timer A+B on the C64
clock_start: {
//SEG229 [122] *((const byte*) CIA2_TIMER_A_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_CONTINUOUS#0 -- _deref_pbuc1=vbuc2
// Setup CIA#2 timer A to count (down) CPU cycles
lda #CIA_TIMER_CONTROL_CONTINUOUS
sta CIA2_TIMER_A_CONTROL
//SEG230 [123] *((const byte*) CIA2_TIMER_B_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
//SEG231 [124] *((const dword*) CIA2_TIMER_AB#0) ← (dword) $ffffffff -- _deref_pduc1=vduc2
lda #<$ffffffff
sta CIA2_TIMER_AB
lda #>$ffffffff
sta CIA2_TIMER_AB+1
lda #<$ffffffff>>$10
sta CIA2_TIMER_AB+2
lda #>$ffffffff>>$10
sta CIA2_TIMER_AB+3
//SEG232 [125] *((const byte*) CIA2_TIMER_B_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_START#0|(const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
//SEG233 [126] *((const byte*) CIA2_TIMER_A_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_START#0 -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START
sta CIA2_TIMER_A_CONTROL
jmp breturn
//SEG234 clock_start::@return
breturn:
//SEG235 [127] return
rts
}
//SEG236 init_font_hex
// Make charset from proto chars
// init_font_hex(byte* zeropage($1d) charset)
init_font_hex: {
.label _0 = $2c
.label idx = $22
.label proto_lo = $1f
.label charset = $1d
.label c1 = $21
.label proto_hi = $1a
.label c = $1c
//SEG237 [129] phi from init_font_hex to init_font_hex::@1 [phi:init_font_hex->init_font_hex::@1]
b1_from_init_font_hex:
//SEG238 [129] phi (byte) init_font_hex::c#6 = (byte) 0 [phi:init_font_hex->init_font_hex::@1#0] -- vbuz1=vbuc1
lda #0
sta c
//SEG239 [129] phi (byte*) init_font_hex::proto_hi#6 = (const byte[]) FONT_HEX_PROTO#0 [phi:init_font_hex->init_font_hex::@1#1] -- pbuz1=pbuc1
lda #<FONT_HEX_PROTO
sta proto_hi
lda #>FONT_HEX_PROTO
sta proto_hi+1
//SEG240 [129] phi (byte*) init_font_hex::charset#5 = (const byte*) CHARSET#0 [phi:init_font_hex->init_font_hex::@1#2] -- pbuz1=pbuc1
lda #<CHARSET
sta charset
lda #>CHARSET
sta charset+1
jmp b1
//SEG241 [129] phi from init_font_hex::@5 to init_font_hex::@1 [phi:init_font_hex::@5->init_font_hex::@1]
b1_from_b5:
//SEG242 [129] phi (byte) init_font_hex::c#6 = (byte) init_font_hex::c#1 [phi:init_font_hex::@5->init_font_hex::@1#0] -- register_copy
//SEG243 [129] phi (byte*) init_font_hex::proto_hi#6 = (byte*) init_font_hex::proto_hi#1 [phi:init_font_hex::@5->init_font_hex::@1#1] -- register_copy
//SEG244 [129] phi (byte*) init_font_hex::charset#5 = (byte*) init_font_hex::charset#0 [phi:init_font_hex::@5->init_font_hex::@1#2] -- register_copy
jmp b1
//SEG245 init_font_hex::@1
b1:
//SEG246 [130] phi from init_font_hex::@1 to init_font_hex::@2 [phi:init_font_hex::@1->init_font_hex::@2]
b2_from_b1:
//SEG247 [130] phi (byte) init_font_hex::c1#4 = (byte) 0 [phi:init_font_hex::@1->init_font_hex::@2#0] -- vbuz1=vbuc1
lda #0
sta c1
//SEG248 [130] phi (byte*) init_font_hex::proto_lo#4 = (const byte[]) FONT_HEX_PROTO#0 [phi:init_font_hex::@1->init_font_hex::@2#1] -- pbuz1=pbuc1
lda #<FONT_HEX_PROTO
sta proto_lo
lda #>FONT_HEX_PROTO
sta proto_lo+1
//SEG249 [130] phi (byte*) init_font_hex::charset#2 = (byte*) init_font_hex::charset#5 [phi:init_font_hex::@1->init_font_hex::@2#2] -- register_copy
jmp b2
//SEG250 [130] phi from init_font_hex::@4 to init_font_hex::@2 [phi:init_font_hex::@4->init_font_hex::@2]
b2_from_b4:
//SEG251 [130] phi (byte) init_font_hex::c1#4 = (byte) init_font_hex::c1#1 [phi:init_font_hex::@4->init_font_hex::@2#0] -- register_copy
//SEG252 [130] phi (byte*) init_font_hex::proto_lo#4 = (byte*) init_font_hex::proto_lo#1 [phi:init_font_hex::@4->init_font_hex::@2#1] -- register_copy
//SEG253 [130] phi (byte*) init_font_hex::charset#2 = (byte*) init_font_hex::charset#0 [phi:init_font_hex::@4->init_font_hex::@2#2] -- register_copy
jmp b2
//SEG254 init_font_hex::@2
b2:
//SEG255 [131] *((byte*) init_font_hex::charset#2) ← (byte) 0 -- _deref_pbuz1=vbuc1
lda #0
ldy #0
sta (charset),y
//SEG256 [132] phi from init_font_hex::@2 to init_font_hex::@3 [phi:init_font_hex::@2->init_font_hex::@3]
b3_from_b2:
//SEG257 [132] phi (byte) init_font_hex::idx#5 = (byte) 1 [phi:init_font_hex::@2->init_font_hex::@3#0] -- vbuz1=vbuc1
lda #1
sta idx
//SEG258 [132] phi (byte) init_font_hex::i#2 = (byte) 0 [phi:init_font_hex::@2->init_font_hex::@3#1] -- vbuxx=vbuc1
ldx #0
jmp b3
//SEG259 [132] phi from init_font_hex::@3 to init_font_hex::@3 [phi:init_font_hex::@3->init_font_hex::@3]
b3_from_b3:
//SEG260 [132] phi (byte) init_font_hex::idx#5 = (byte) init_font_hex::idx#2 [phi:init_font_hex::@3->init_font_hex::@3#0] -- register_copy
//SEG261 [132] phi (byte) init_font_hex::i#2 = (byte) init_font_hex::i#1 [phi:init_font_hex::@3->init_font_hex::@3#1] -- register_copy
jmp b3
//SEG262 init_font_hex::@3
b3:
//SEG263 [133] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4 -- vbuz1=pbuz2_derefidx_vbuxx_rol_4
txa
tay
lda (proto_hi),y
asl
asl
asl
asl
sta _0
//SEG264 [134] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1 -- vbuaa=pbuz1_derefidx_vbuxx_rol_1
txa
tay
lda (proto_lo),y
asl
//SEG265 [135] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1 -- vbuaa=vbuz1_bor_vbuaa
ora _0
//SEG266 [136] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2 -- pbuz1_derefidx_vbuz2=vbuaa
ldy idx
sta (charset),y
//SEG267 [137] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5 -- vbuz1=_inc_vbuz1
inc idx
//SEG268 [138] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2 -- vbuxx=_inc_vbuxx
inx
//SEG269 [139] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3 -- vbuxx_neq_vbuc1_then_la1
cpx #5
bne b3_from_b3
jmp b4
//SEG270 init_font_hex::@4
b4:
//SEG271 [140] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0 -- pbuz1_derefidx_vbuz2=vbuc1
lda #0
ldy idx
sta (charset),y
//SEG272 [141] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2 -- vbuyy=_inc_vbuz1
ldy idx
iny
//SEG273 [142] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0 -- pbuz1_derefidx_vbuyy=vbuc1
lda #0
sta (charset),y
//SEG274 [143] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5 -- pbuz1=pbuz1_plus_vbuc1
lda #5
clc
adc proto_lo
sta proto_lo
bcc !+
inc proto_lo+1
!:
//SEG275 [144] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8 -- pbuz1=pbuz1_plus_vbuc1
lda #8
clc
adc charset
sta charset
bcc !+
inc charset+1
!:
//SEG276 [145] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4 -- vbuz1=_inc_vbuz1
inc c1
//SEG277 [146] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2 -- vbuz1_neq_vbuc1_then_la1
lda #$10
cmp c1
bne b2_from_b4
jmp b5
//SEG278 init_font_hex::@5
b5:
//SEG279 [147] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5 -- pbuz1=pbuz1_plus_vbuc1
lda #5
clc
adc proto_hi
sta proto_hi
bcc !+
inc proto_hi+1
!:
//SEG280 [148] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6 -- vbuz1=_inc_vbuz1
inc c
//SEG281 [149] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$10
cmp c
bne b1_from_b5
jmp breturn
//SEG282 init_font_hex::@return
breturn:
//SEG283 [150] return
rts
}
//SEG284 File Data
// 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
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
CORDIC_ATAN2_ANGLES_16:
.for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
print_hextab: .text "0123456789abcdef"
ASSEMBLER OPTIMIZATIONS
Removing instruction jmp b1
Removing instruction jmp bend
Removing instruction jmp toD0181
Removing instruction jmp b1
Removing instruction jmp b3
Removing instruction jmp b4
Removing instruction jmp b5
Removing instruction jmp toD0182
Removing instruction jmp b2
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp breturn
Removing instruction jmp breturn
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b4
Removing instruction jmp b3
Removing instruction jmp breturn
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp b5
Removing instruction jmp b6
Removing instruction jmp b10
Removing instruction jmp b12
Removing instruction jmp b21
Removing instruction jmp b7
Removing instruction jmp b9
Removing instruction jmp b8
Removing instruction jmp breturn
Removing instruction jmp b13
Removing instruction jmp b15
Removing instruction jmp b16
Removing instruction jmp b17
Removing instruction jmp b20
Removing instruction jmp b19
Removing instruction jmp breturn
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Removing instruction jmp b4
Removing instruction jmp b5
Removing instruction jmp breturn
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction ldy #0
Removing instruction ldy x
Removing instruction ldy xb
Removing instruction lda #0
Replacing instruction ldx #0 with TAX
Replacing instruction ldy #0 with TAY
Removing instruction ldy idx
Removing instruction lda #0
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Replacing label b2_from_b4 with b2
Replacing label b1_from_b3 with b1
Replacing label b7_from_b12 with b7
Replacing label b8_from_b7 with b8
Replacing label b17_from_b15 with b17
Replacing label b12_from_b19 with b12
Replacing label b19_from_b18 with b19
Replacing label b13_from_b14 with b13
Replacing label b6_from_b4 with b6
Replacing label b3_from_b1 with b3
Replacing label b3_from_b3 with b3
Replacing label b2_from_b4 with b2
Replacing label b1_from_b5 with b1
Removing instruction b1_from_bbegin:
Removing instruction b1:
Removing instruction main_from_b1:
Removing instruction bend_from_b1:
Removing instruction toD0181_from_main:
Removing instruction toD0181:
Removing instruction b3_from_b1:
Removing instruction init_angle_screen_from_b3:
Removing instruction b4_from_b3:
Removing instruction toD0182_from_b5:
Removing instruction toD0182:
Removing instruction b1_from_b3:
Removing instruction b2_from_b1:
Removing instruction b2_from_b4:
Removing instruction b3_from_b1:
Removing instruction b3_from_b2:
Removing instruction b6_from_b4:
Removing instruction b6_from_b5:
Removing instruction b10_from_b6:
Removing instruction b12_from_b10:
Removing instruction b12_from_b19:
Removing instruction b7_from_b12:
Removing instruction b7_from_b21:
Removing instruction b8_from_b7:
Removing instruction b8_from_b9:
Removing instruction breturn:
Removing instruction b13_from_b11:
Removing instruction b13_from_b14:
Removing instruction b17_from_b15:
Removing instruction b17_from_b16:
Removing instruction b19_from_b18:
Removing instruction b19_from_b20:
Removing instruction b1_from_b5:
Removing instruction b2_from_b1:
Removing instruction b2_from_b4:
Removing instruction b3_from_b3:
Succesful ASM optimization Pass5RedundantLabelElimination
Removing instruction bend:
Removing instruction init_font_hex_from_main:
Removing instruction b1:
Removing instruction b3:
Removing instruction b4:
Removing instruction b5:
Removing instruction b2:
Removing instruction breturn:
Removing instruction print_word_at_from_print_dword_at:
Removing instruction b1:
Removing instruction print_word_at_from_b1:
Removing instruction breturn:
Removing instruction print_byte_at_from_print_word_at:
Removing instruction b1:
Removing instruction print_byte_at_from_b1:
Removing instruction breturn:
Removing instruction print_char_at_from_print_byte_at:
Removing instruction b1:
Removing instruction print_char_at_from_b1:
Removing instruction breturn:
Removing instruction breturn:
Removing instruction breturn:
Removing instruction b1_from_init_angle_screen:
Removing instruction b4:
Removing instruction b3:
Removing instruction breturn:
Removing instruction b2:
Removing instruction b5:
Removing instruction b21:
Removing instruction b9:
Removing instruction b15:
Removing instruction b16:
Removing instruction b20:
Removing instruction b10_from_b19:
Removing instruction breturn:
Removing instruction b1_from_init_font_hex:
Removing instruction b3_from_b2:
Removing instruction b4:
Removing instruction b5:
Removing instruction breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Updating BasicUpstart to call main directly
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b1
Removing instruction jmp b2
Removing instruction jmp b3
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
Fixing long branch [374] beq b12 to bne
Fixing long branch [268] bpl b1 to bmi
Fixing long branch [280] bpl b4 to bmi
FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(byte*) CHARSET
(const byte*) CHARSET#0 CHARSET = (byte*) 8192
(dword*) CIA2_TIMER_AB
(const dword*) CIA2_TIMER_AB#0 CIA2_TIMER_AB = (dword*) 56580
(byte*) CIA2_TIMER_A_CONTROL
(const byte*) CIA2_TIMER_A_CONTROL#0 CIA2_TIMER_A_CONTROL = (byte*) 56590
(byte*) CIA2_TIMER_B_CONTROL
(const byte*) CIA2_TIMER_B_CONTROL#0 CIA2_TIMER_B_CONTROL = (byte*) 56591
(byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
(byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
(const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = (byte) $40
(byte) CIA_TIMER_CONTROL_CONTINUOUS
(const byte) CIA_TIMER_CONTROL_CONTINUOUS#0 CIA_TIMER_CONTROL_CONTINUOUS = (byte) 0
(byte) CIA_TIMER_CONTROL_START
(const byte) CIA_TIMER_CONTROL_START#0 CIA_TIMER_CONTROL_START = (byte) 1
(byte) CIA_TIMER_CONTROL_STOP
(dword) CLOCKS_PER_INIT
(const dword) CLOCKS_PER_INIT#0 CLOCKS_PER_INIT = (byte) $12
(word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16
(const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 CORDIC_ATAN2_ANGLES_16 = kickasm {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
}}
(byte) CORDIC_ITERATIONS_16
(const byte) CORDIC_ITERATIONS_16#0 CORDIC_ITERATIONS_16 = (byte) $f
(byte*) D018
(const byte*) D018#0 D018 = (byte*) 53272
(byte[]) FONT_HEX_PROTO
(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
(word()) atan2_16((signed word) atan2_16::x , (signed word) atan2_16::y)
(signed word~) atan2_16::$2 $2 zp ZP_WORD:16 4.0
(byte~) atan2_16::$23 reg byte a 2002.0
(byte~) atan2_16::$24 reg byte a 2002.0
(signed word~) atan2_16::$7 $7 zp ZP_WORD:18 4.0
(label) atan2_16::@1
(label) atan2_16::@10
(label) atan2_16::@11
(label) atan2_16::@12
(label) atan2_16::@13
(label) atan2_16::@14
(label) atan2_16::@15
(label) atan2_16::@16
(label) atan2_16::@17
(label) atan2_16::@18
(label) atan2_16::@19
(label) atan2_16::@2
(label) atan2_16::@20
(label) atan2_16::@21
(label) atan2_16::@3
(label) atan2_16::@4
(label) atan2_16::@5
(label) atan2_16::@6
(label) atan2_16::@7
(label) atan2_16::@8
(label) atan2_16::@9
(label) atan2_16::@return
(word) atan2_16::angle
(word) atan2_16::angle#1 angle zp ZP_WORD:20 3.0
(word) atan2_16::angle#11 angle zp ZP_WORD:20 4.0
(word) atan2_16::angle#12 angle zp ZP_WORD:20 190.66666666666666
(word) atan2_16::angle#13 angle zp ZP_WORD:20 1334.6666666666667
(word) atan2_16::angle#2 angle zp ZP_WORD:20 2002.0
(word) atan2_16::angle#3 angle zp ZP_WORD:20 2002.0
(word) atan2_16::angle#4 angle zp ZP_WORD:20 4.0
(word) atan2_16::angle#5 angle zp ZP_WORD:20 4.0
(word) atan2_16::angle#6 angle zp ZP_WORD:20 2004.0
(byte) atan2_16::i
(byte) atan2_16::i#1 reg byte x 1501.5
(byte) atan2_16::i#2 reg byte x 208.54166666666669
(word) atan2_16::return
(word) atan2_16::return#0 return zp ZP_WORD:20 34.99999999999999
(word) atan2_16::return#2 return zp ZP_WORD:20 202.0
(byte) atan2_16::shift
(byte) atan2_16::shift#1 reg byte y 20002.0
(byte) atan2_16::shift#2 reg byte y 8001.25
(byte~) atan2_16::shift#5 reg byte y 667.3333333333334
(signed word) atan2_16::x
(signed word) atan2_16::x#0 x zp ZP_WORD:39 2.8684210526315796
(signed word) atan2_16::xd
(signed word) atan2_16::xd#1 xd zp ZP_WORD:24 6667.333333333333
(signed word~) atan2_16::xd#10 xd zp ZP_WORD:24 1001.0
(signed word) atan2_16::xd#2 xd zp ZP_WORD:24 1001.0
(signed word) atan2_16::xd#3 xd zp ZP_WORD:24 7668.333333333332
(signed word) atan2_16::xd#5 xd zp ZP_WORD:24 1001.0
(signed word) atan2_16::xi
(signed word) atan2_16::xi#0 xi zp ZP_WORD:18 6.0
(signed word) atan2_16::xi#1 xi zp ZP_WORD:18 500.5
(signed word~) atan2_16::xi#13 xi zp ZP_WORD:18 4.0
(signed word) atan2_16::xi#2 xi zp ZP_WORD:18 500.5
(signed word) atan2_16::xi#3 xi zp ZP_WORD:18 267.0666666666667
(signed word) atan2_16::xi#8 xi zp ZP_WORD:18 1001.0
(signed word) atan2_16::y
(signed word) atan2_16::y#0 y zp ZP_WORD:41 2.724999999999999
(signed word) atan2_16::yd
(signed word) atan2_16::yd#1 yd zp ZP_WORD:22 10001.0
(signed word~) atan2_16::yd#10 yd zp ZP_WORD:22 2002.0
(signed word) atan2_16::yd#2 yd zp ZP_WORD:22 2002.0
(signed word) atan2_16::yd#3 yd zp ZP_WORD:22 4601.0
(signed word) atan2_16::yd#5 yd zp ZP_WORD:22 2002.0
(signed word) atan2_16::yi
(signed word) atan2_16::yi#0 yi zp ZP_WORD:16 1.2000000000000002
(signed word) atan2_16::yi#1 yi zp ZP_WORD:16 667.3333333333334
(signed word~) atan2_16::yi#16 yi zp ZP_WORD:16 4.0
(signed word) atan2_16::yi#2 yi zp ZP_WORD:16 667.3333333333334
(signed word) atan2_16::yi#3 yi zp ZP_WORD:16 353.4117647058823
(signed word) atan2_16::yi#8 yi zp ZP_WORD:16 1001.0
(dword()) clock()
(label) clock::@return
(dword) clock::return
(dword) clock::return#0 return zp ZP_DWORD:35 1.3333333333333333
(dword) clock::return#2 return zp ZP_DWORD:35 4.0
(void()) clock_start()
(label) clock_start::@return
(void()) init_angle_screen((byte*) init_angle_screen::screen)
(word~) init_angle_screen::$10 $10 zp ZP_WORD:20 202.0
(byte~) init_angle_screen::$12 reg byte a 202.0
(byte~) init_angle_screen::$13 reg byte a 202.0
(byte~) init_angle_screen::$14 reg byte a 202.0
(byte~) init_angle_screen::$2 reg byte a 202.0
(byte~) init_angle_screen::$3 reg byte a 202.0
(byte~) init_angle_screen::$6 reg byte a 202.0
(label) init_angle_screen::@1
(label) init_angle_screen::@2
(label) init_angle_screen::@3
(label) init_angle_screen::@4
(label) init_angle_screen::@return
(byte) init_angle_screen::ang_w
(byte) init_angle_screen::ang_w#0 ang_w zp ZP_BYTE:43 72.14285714285714
(word) init_angle_screen::angle_w
(word) init_angle_screen::angle_w#0 angle_w zp ZP_WORD:20 202.0
(byte*) init_angle_screen::screen
(byte*) init_angle_screen::screen_bottomline
(byte*) init_angle_screen::screen_bottomline#1 screen_bottomline zp ZP_WORD:12 7.333333333333333
(byte*) init_angle_screen::screen_bottomline#5 screen_bottomline zp ZP_WORD:12 8.959999999999999
(byte*) init_angle_screen::screen_topline
(byte*) init_angle_screen::screen_topline#1 screen_topline zp ZP_WORD:10 5.5
(byte*) init_angle_screen::screen_topline#5 screen_topline zp ZP_WORD:10 9.333333333333334
(byte) init_angle_screen::x
(byte) init_angle_screen::x#1 x zp ZP_BYTE:14 101.0
(byte) init_angle_screen::x#2 x zp ZP_BYTE:14 25.25
(byte) init_angle_screen::xb
(byte) init_angle_screen::xb#1 xb zp ZP_BYTE:15 101.0
(byte) init_angle_screen::xb#2 xb zp ZP_BYTE:15 19.238095238095237
(signed word) init_angle_screen::xw
(word) init_angle_screen::xw#0 xw zp ZP_WORD:39 33.666666666666664
(byte) init_angle_screen::y
(byte) init_angle_screen::y#1 y zp ZP_BYTE:9 16.5
(byte) init_angle_screen::y#4 y zp ZP_BYTE:9 4.730769230769231
(signed word) init_angle_screen::yw
(word) init_angle_screen::yw#0 yw zp ZP_WORD:41 50.5
(void()) init_font_hex((byte*) init_font_hex::charset)
(byte~) init_font_hex::$0 $0 zp ZP_BYTE:44 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
(label) init_font_hex::@2
(label) init_font_hex::@3
(label) init_font_hex::@4
(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:28 16.5
(byte) init_font_hex::c#6 c zp ZP_BYTE:28 1.1578947368421053
(byte) init_font_hex::c1
(byte) init_font_hex::c1#1 c1 zp ZP_BYTE:33 151.5
(byte) init_font_hex::c1#4 c1 zp ZP_BYTE:33 13.466666666666667
(byte*) init_font_hex::charset
(byte*) init_font_hex::charset#0 charset zp ZP_WORD:29 35.5
(byte*) init_font_hex::charset#2 charset zp ZP_WORD:29 108.35714285714285
(byte*) init_font_hex::charset#5 charset zp ZP_WORD:29 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:34 551.0
(byte) init_font_hex::idx#3 reg byte y 202.0
(byte) init_font_hex::idx#5 idx zp ZP_BYTE:34 600.5999999999999
(byte*) init_font_hex::proto_hi
(byte*) init_font_hex::proto_hi#1 proto_hi zp ZP_WORD:26 7.333333333333333
(byte*) init_font_hex::proto_hi#6 proto_hi zp ZP_WORD:26 56.83333333333334
(byte*) init_font_hex::proto_lo
(byte*) init_font_hex::proto_lo#1 proto_lo zp ZP_WORD:31 50.5
(byte*) init_font_hex::proto_lo#4 proto_lo zp ZP_WORD:31 92.53846153846155
(void()) main()
(dword~) main::$4 $4 zp ZP_DWORD:35 4.0
(label) main::@1
(label) main::@2
(label) main::@3
(label) main::@4
(label) main::@5
(label) main::@return
(byte*) main::BASE_CHARSET
(const byte*) main::BASE_CHARSET#0 BASE_CHARSET = (byte*) 4096
(byte*) main::BASE_SCREEN
(const byte*) main::BASE_SCREEN#0 BASE_SCREEN = (byte*) 1024
(dword) main::cyclecount
(dword) main::cyclecount#0 cyclecount zp ZP_DWORD:35 4.0
(label) main::toD0181
(word~) main::toD0181_$0
(number~) main::toD0181_$1
(number~) main::toD0181_$2
(number~) main::toD0181_$3
(word~) main::toD0181_$4
(byte~) main::toD0181_$5
(number~) main::toD0181_$6
(number~) main::toD0181_$7
(number~) main::toD0181_$8
(byte*) main::toD0181_gfx
(byte) main::toD0181_return
(const byte) main::toD0181_return#0 toD0181_return = >(word)(const byte*) SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) CHARSET#0/(byte) 4&(byte) $f
(byte*) main::toD0181_screen
(label) main::toD0182
(word~) main::toD0182_$0
(number~) main::toD0182_$1
(number~) main::toD0182_$2
(number~) main::toD0182_$3
(word~) main::toD0182_$4
(byte~) main::toD0182_$5
(number~) main::toD0182_$6
(number~) main::toD0182_$7
(number~) main::toD0182_$8
(byte*) main::toD0182_gfx
(byte) main::toD0182_return
(const byte) main::toD0182_return#0 toD0182_return = >(word)(const byte*) main::BASE_SCREEN#0&(word) $3fff*(byte) 4|>(word)(const byte*) main::BASE_CHARSET#0/(byte) 4&(byte) $f
(byte*) main::toD0182_screen
(void()) print_byte_at((byte) print_byte_at::b , (byte*) print_byte_at::at)
(byte~) print_byte_at::$0 reg byte a 4.0
(byte~) print_byte_at::$2 reg byte y 2.0
(label) print_byte_at::@1
(label) print_byte_at::@return
(byte*) print_byte_at::at
(byte*) print_byte_at::at#0 at zp ZP_WORD:4 4.0
(byte*) print_byte_at::at#1 at zp ZP_WORD:4 4.0
(byte*) print_byte_at::at#2 at zp ZP_WORD:4 1.3333333333333333
(byte) print_byte_at::b
(byte) print_byte_at::b#0 b zp ZP_BYTE:6 2.0
(byte) print_byte_at::b#1 b zp ZP_BYTE:6 2.0
(byte) print_byte_at::b#2 b zp ZP_BYTE:6 1.6
(void()) print_char_at((byte) print_char_at::ch , (byte*) print_char_at::at)
(label) print_char_at::@return
(byte*) print_char_at::at
(byte*) print_char_at::at#0 at zp ZP_WORD:7 4.0
(byte*) print_char_at::at#1 at zp ZP_WORD:7 2.0
(byte*) print_char_at::at#2 at zp ZP_WORD:7 6.0
(byte) print_char_at::ch
(byte) print_char_at::ch#0 reg byte x 2.0
(byte) print_char_at::ch#1 reg byte x 4.0
(byte) print_char_at::ch#2 reg byte x 6.0
(void()) print_dword_at((dword) print_dword_at::dw , (byte*) print_dword_at::at)
(label) print_dword_at::@1
(label) print_dword_at::@return
(byte*) print_dword_at::at
(dword) print_dword_at::dw
(dword) print_dword_at::dw#0 dw zp ZP_DWORD:35 2.0
(byte[]) print_hextab
(const byte[]) print_hextab#0 print_hextab = (string) "0123456789abcdef"
(void()) print_word_at((word) print_word_at::w , (byte*) print_word_at::at)
(label) print_word_at::@1
(label) print_word_at::@return
(byte*) print_word_at::at
(byte*) print_word_at::at#2 at zp ZP_WORD:4 0.8
(word) print_word_at::w
(word) print_word_at::w#0 w zp ZP_WORD:2 4.0
(word) print_word_at::w#1 w zp ZP_WORD:2 4.0
(word) print_word_at::w#2 w zp ZP_WORD:2 2.0
zp ZP_WORD:2 [ print_word_at::w#2 print_word_at::w#0 print_word_at::w#1 ]
zp ZP_WORD:4 [ print_word_at::at#2 print_byte_at::at#2 print_byte_at::at#0 print_byte_at::at#1 ]
zp ZP_BYTE:6 [ print_byte_at::b#2 print_byte_at::b#0 print_byte_at::b#1 ]
reg byte x [ print_char_at::ch#2 print_char_at::ch#0 print_char_at::ch#1 ]
zp ZP_WORD:7 [ print_char_at::at#2 print_char_at::at#0 print_char_at::at#1 ]
zp ZP_BYTE:9 [ init_angle_screen::y#4 init_angle_screen::y#1 ]
zp ZP_WORD:10 [ init_angle_screen::screen_topline#5 init_angle_screen::screen_topline#1 ]
zp ZP_WORD:12 [ init_angle_screen::screen_bottomline#5 init_angle_screen::screen_bottomline#1 ]
zp ZP_BYTE:14 [ init_angle_screen::x#2 init_angle_screen::x#1 ]
zp ZP_BYTE:15 [ init_angle_screen::xb#2 init_angle_screen::xb#1 ]
zp ZP_WORD:16 [ atan2_16::yi#3 atan2_16::yi#8 atan2_16::yi#0 atan2_16::yi#16 atan2_16::$2 atan2_16::yi#1 atan2_16::yi#2 ]
zp ZP_WORD:18 [ atan2_16::xi#3 atan2_16::xi#8 atan2_16::xi#0 atan2_16::xi#13 atan2_16::$7 atan2_16::xi#1 atan2_16::xi#2 ]
reg byte x [ atan2_16::i#2 atan2_16::i#1 ]
zp ZP_WORD:20 [ atan2_16::angle#6 atan2_16::angle#12 atan2_16::angle#13 atan2_16::angle#2 atan2_16::angle#3 atan2_16::return#0 atan2_16::angle#5 atan2_16::angle#11 atan2_16::angle#1 atan2_16::angle#4 atan2_16::return#2 init_angle_screen::angle_w#0 init_angle_screen::$10 ]
reg byte y [ atan2_16::shift#2 atan2_16::shift#5 atan2_16::shift#1 ]
zp ZP_WORD:22 [ atan2_16::yd#5 atan2_16::yd#3 atan2_16::yd#10 atan2_16::yd#1 atan2_16::yd#2 ]
zp ZP_WORD:24 [ atan2_16::xd#5 atan2_16::xd#3 atan2_16::xd#10 atan2_16::xd#1 atan2_16::xd#2 ]
zp ZP_WORD:26 [ init_font_hex::proto_hi#6 init_font_hex::proto_hi#1 ]
zp ZP_BYTE:28 [ init_font_hex::c#6 init_font_hex::c#1 ]
zp ZP_WORD:29 [ init_font_hex::charset#2 init_font_hex::charset#5 init_font_hex::charset#0 ]
zp ZP_WORD:31 [ init_font_hex::proto_lo#4 init_font_hex::proto_lo#1 ]
zp ZP_BYTE:33 [ 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:34 [ init_font_hex::idx#5 init_font_hex::idx#2 ]
zp ZP_DWORD:35 [ clock::return#2 main::$4 clock::return#0 main::cyclecount#0 print_dword_at::dw#0 ]
reg byte a [ print_byte_at::$0 ]
reg byte y [ print_byte_at::$2 ]
reg byte a [ init_angle_screen::$2 ]
reg byte a [ init_angle_screen::$3 ]
zp ZP_WORD:39 [ init_angle_screen::xw#0 atan2_16::x#0 ]
reg byte a [ init_angle_screen::$6 ]
zp ZP_WORD:41 [ init_angle_screen::yw#0 atan2_16::y#0 ]
zp ZP_BYTE:43 [ init_angle_screen::ang_w#0 ]
reg byte a [ init_angle_screen::$12 ]
reg byte a [ init_angle_screen::$13 ]
reg byte a [ init_angle_screen::$14 ]
reg byte a [ atan2_16::$24 ]
reg byte a [ atan2_16::$23 ]
zp ZP_BYTE:44 [ init_font_hex::$0 ]
reg byte a [ init_font_hex::$1 ]
reg byte a [ init_font_hex::$2 ]
reg byte y [ init_font_hex::idx#3 ]
FINAL ASSEMBLER
Score: 1045267
//SEG0 File Comments
// Calculate the angle to the center of the screen - and show it using font-hex
// 4.65 million cycles
//SEG1 Basic Upstart
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
//SEG2 Global Constants & labels
.label D018 = $d018
// CIA #2 Timer A+B Value (32-bit)
.label CIA2_TIMER_AB = $dd04
// CIA #2 Timer A Control Register
.label CIA2_TIMER_A_CONTROL = $dd0e
// CIA #2 Timer B Control Register
.label CIA2_TIMER_B_CONTROL = $dd0f
// Timer Control - Start/stop timer (0:stop, 1: start)
.const CIA_TIMER_CONTROL_START = 1
// Timer Control - Time CONTINUOUS/ONE-SHOT (0:CONTINUOUS, 1: ONE-SHOT)
.const CIA_TIMER_CONTROL_CONTINUOUS = 0
// Timer B Control - Timer counts (00:system cycles, 01: CNT pulses, 10: timer A underflow, 11: time A underflow while CNT is high)
.const CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = $40
// The number of iterations performed during 16-bit CORDIC atan2 calculation
.const CORDIC_ITERATIONS_16 = $f
// Clock cycles used to start & read the cycle clock by calling clock_start() and clock() once. Can be subtracted when calculating the number of cycles used by a routine.
// To make precise cycle measurements interrupts and the display must be disabled so neither steals any cycles from the code.
.const CLOCKS_PER_INIT = $12
.label CHARSET = $2000
.label SCREEN = $2800
//SEG3 @begin
//SEG4 [1] phi from @begin to @1 [phi:@begin->@1]
//SEG5 @1
//SEG6 [2] call main
//SEG7 [4] phi from @1 to main [phi:@1->main]
//SEG8 [3] phi from @1 to @end [phi:@1->@end]
//SEG9 @end
//SEG10 main
main: {
.label BASE_SCREEN = $400
.label BASE_CHARSET = $1000
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET)/4&$f
.const toD0182_return = (>(BASE_SCREEN&$3fff)*4)|(>BASE_CHARSET)/4&$f
.label _4 = $23
.label cyclecount = $23
//SEG11 [5] call init_font_hex
//SEG12 [128] phi from main to init_font_hex [phi:main->init_font_hex]
jsr init_font_hex
//SEG13 [6] phi from main to main::toD0181 [phi:main->main::toD0181]
//SEG14 main::toD0181
//SEG15 main::@1
//SEG16 [7] *((const byte*) D018#0) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2
lda #toD0181_return
sta D018
//SEG17 [8] call clock_start
jsr clock_start
//SEG18 [9] phi from main::@1 to main::@3 [phi:main::@1->main::@3]
//SEG19 main::@3
//SEG20 [10] call init_angle_screen
//SEG21 [49] phi from main::@3 to init_angle_screen [phi:main::@3->init_angle_screen]
jsr init_angle_screen
//SEG22 [11] phi from main::@3 to main::@4 [phi:main::@3->main::@4]
//SEG23 main::@4
//SEG24 [12] call clock
jsr clock
//SEG25 [13] (dword) clock::return#2 ← (dword) clock::return#0
//SEG26 main::@5
//SEG27 [14] (dword~) main::$4 ← (dword) clock::return#2
//SEG28 [15] (dword) main::cyclecount#0 ← (dword~) main::$4 - (const dword) CLOCKS_PER_INIT#0 -- vduz1=vduz1_minus_vduc1
lda cyclecount
sec
sbc #<CLOCKS_PER_INIT
sta cyclecount
lda cyclecount+1
sbc #>CLOCKS_PER_INIT
sta cyclecount+1
lda cyclecount+2
sbc #<CLOCKS_PER_INIT>>$10
sta cyclecount+2
lda cyclecount+3
sbc #>CLOCKS_PER_INIT>>$10
sta cyclecount+3
//SEG29 [16] (dword) print_dword_at::dw#0 ← (dword) main::cyclecount#0
//SEG30 [17] call print_dword_at
jsr print_dword_at
//SEG31 [18] phi from main::@5 to main::toD0182 [phi:main::@5->main::toD0182]
//SEG32 main::toD0182
//SEG33 main::@2
//SEG34 [19] *((const byte*) D018#0) ← (const byte) main::toD0182_return#0 -- _deref_pbuc1=vbuc2
lda #toD0182_return
sta D018
//SEG35 main::@return
//SEG36 [20] return
rts
}
//SEG37 print_dword_at
// Print a dword as HEX at a specific position
// print_dword_at(dword zeropage($23) dw)
print_dword_at: {
.label dw = $23
//SEG38 [21] (word) print_word_at::w#0 ← > (dword) print_dword_at::dw#0 -- vwuz1=_hi_vduz2
lda dw+2
sta print_word_at.w
lda dw+3
sta print_word_at.w+1
//SEG39 [22] call print_word_at
//SEG40 [26] phi from print_dword_at to print_word_at [phi:print_dword_at->print_word_at]
//SEG41 [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0 [phi:print_dword_at->print_word_at#0] -- pbuz1=pbuc1
lda #<main.BASE_SCREEN
sta print_word_at.at
lda #>main.BASE_SCREEN
sta print_word_at.at+1
//SEG42 [26] phi (word) print_word_at::w#2 = (word) print_word_at::w#0 [phi:print_dword_at->print_word_at#1] -- register_copy
jsr print_word_at
//SEG43 print_dword_at::@1
//SEG44 [23] (word) print_word_at::w#1 ← < (dword) print_dword_at::dw#0 -- vwuz1=_lo_vduz2
lda dw
sta print_word_at.w
lda dw+1
sta print_word_at.w+1
//SEG45 [24] call print_word_at
//SEG46 [26] phi from print_dword_at::@1 to print_word_at [phi:print_dword_at::@1->print_word_at]
//SEG47 [26] phi (byte*) print_word_at::at#2 = (const byte*) main::BASE_SCREEN#0+(byte) 4 [phi:print_dword_at::@1->print_word_at#0] -- pbuz1=pbuc1
lda #<main.BASE_SCREEN+4
sta print_word_at.at
lda #>main.BASE_SCREEN+4
sta print_word_at.at+1
//SEG48 [26] phi (word) print_word_at::w#2 = (word) print_word_at::w#1 [phi:print_dword_at::@1->print_word_at#1] -- register_copy
jsr print_word_at
//SEG49 print_dword_at::@return
//SEG50 [25] return
rts
}
//SEG51 print_word_at
// Print a word as HEX at a specific position
// print_word_at(word zeropage(2) w, byte* zeropage(4) at)
print_word_at: {
.label w = 2
.label at = 4
//SEG52 [27] (byte) print_byte_at::b#0 ← > (word) print_word_at::w#2 -- vbuz1=_hi_vwuz2
lda w+1
sta print_byte_at.b
//SEG53 [28] (byte*) print_byte_at::at#0 ← (byte*) print_word_at::at#2
//SEG54 [29] call print_byte_at
//SEG55 [34] phi from print_word_at to print_byte_at [phi:print_word_at->print_byte_at]
//SEG56 [34] phi (byte*) print_byte_at::at#2 = (byte*) print_byte_at::at#0 [phi:print_word_at->print_byte_at#0] -- register_copy
//SEG57 [34] phi (byte) print_byte_at::b#2 = (byte) print_byte_at::b#0 [phi:print_word_at->print_byte_at#1] -- register_copy
jsr print_byte_at
//SEG58 print_word_at::@1
//SEG59 [30] (byte) print_byte_at::b#1 ← < (word) print_word_at::w#2 -- vbuz1=_lo_vwuz2
lda w
sta print_byte_at.b
//SEG60 [31] (byte*) print_byte_at::at#1 ← (byte*) print_word_at::at#2 + (byte) 2 -- pbuz1=pbuz1_plus_2
lda print_byte_at.at
clc
adc #2
sta print_byte_at.at
bcc !+
inc print_byte_at.at+1
!:
//SEG61 [32] call print_byte_at
//SEG62 [34] phi from print_word_at::@1 to print_byte_at [phi:print_word_at::@1->print_byte_at]
//SEG63 [34] phi (byte*) print_byte_at::at#2 = (byte*) print_byte_at::at#1 [phi:print_word_at::@1->print_byte_at#0] -- register_copy
//SEG64 [34] phi (byte) print_byte_at::b#2 = (byte) print_byte_at::b#1 [phi:print_word_at::@1->print_byte_at#1] -- register_copy
jsr print_byte_at
//SEG65 print_word_at::@return
//SEG66 [33] return
rts
}
//SEG67 print_byte_at
// Print a byte as HEX at a specific position
// print_byte_at(byte zeropage(6) b, byte* zeropage(4) at)
print_byte_at: {
.label b = 6
.label at = 4
//SEG68 [35] (byte~) print_byte_at::$0 ← (byte) print_byte_at::b#2 >> (byte) 4 -- vbuaa=vbuz1_ror_4
lda b
lsr
lsr
lsr
lsr
//SEG69 [36] (byte) print_char_at::ch#0 ← *((const byte[]) print_hextab#0 + (byte~) print_byte_at::$0) -- vbuxx=pbuc1_derefidx_vbuaa
tay
ldx print_hextab,y
//SEG70 [37] (byte*) print_char_at::at#0 ← (byte*) print_byte_at::at#2 -- pbuz1=pbuz2
lda at
sta print_char_at.at
lda at+1
sta print_char_at.at+1
//SEG71 [38] call print_char_at
//SEG72 [44] phi from print_byte_at to print_char_at [phi:print_byte_at->print_char_at]
//SEG73 [44] phi (byte*) print_char_at::at#2 = (byte*) print_char_at::at#0 [phi:print_byte_at->print_char_at#0] -- register_copy
//SEG74 [44] phi (byte) print_char_at::ch#2 = (byte) print_char_at::ch#0 [phi:print_byte_at->print_char_at#1] -- register_copy
jsr print_char_at
//SEG75 print_byte_at::@1
//SEG76 [39] (byte~) print_byte_at::$2 ← (byte) print_byte_at::b#2 & (byte) $f -- vbuyy=vbuz1_band_vbuc1
lda #$f
and b
tay
//SEG77 [40] (byte*) print_char_at::at#1 ← (byte*) print_byte_at::at#2 + (byte) 1 -- pbuz1=pbuz2_plus_1
lda at
clc
adc #1
sta print_char_at.at
lda at+1
adc #0
sta print_char_at.at+1
//SEG78 [41] (byte) print_char_at::ch#1 ← *((const byte[]) print_hextab#0 + (byte~) print_byte_at::$2) -- vbuxx=pbuc1_derefidx_vbuyy
ldx print_hextab,y
//SEG79 [42] call print_char_at
//SEG80 [44] phi from print_byte_at::@1 to print_char_at [phi:print_byte_at::@1->print_char_at]
//SEG81 [44] phi (byte*) print_char_at::at#2 = (byte*) print_char_at::at#1 [phi:print_byte_at::@1->print_char_at#0] -- register_copy
//SEG82 [44] phi (byte) print_char_at::ch#2 = (byte) print_char_at::ch#1 [phi:print_byte_at::@1->print_char_at#1] -- register_copy
jsr print_char_at
//SEG83 print_byte_at::@return
//SEG84 [43] return
rts
}
//SEG85 print_char_at
// Print a single char
// print_char_at(byte register(X) ch, byte* zeropage(7) at)
print_char_at: {
.label at = 7
//SEG86 [45] *((byte*) print_char_at::at#2) ← (byte) print_char_at::ch#2 -- _deref_pbuz1=vbuxx
txa
ldy #0
sta (at),y
//SEG87 print_char_at::@return
//SEG88 [46] return
rts
}
//SEG89 clock
// Returns the processor clock time used since the beginning of an implementation defined era (normally the beginning of the program).
// This uses CIA #2 Timer A+B on the C64, and must be initialized using clock_start()
clock: {
.label return = $23
//SEG90 [47] (dword) clock::return#0 ← (dword) $ffffffff - *((const dword*) CIA2_TIMER_AB#0) -- vduz1=vduc1_minus__deref_pduc2
lda #<$ffffffff
sec
sbc CIA2_TIMER_AB
sta return
lda #>$ffffffff
sbc CIA2_TIMER_AB+1
sta return+1
lda #<$ffffffff>>$10
sbc CIA2_TIMER_AB+2
sta return+2
lda #>$ffffffff>>$10
sbc CIA2_TIMER_AB+3
sta return+3
//SEG91 clock::@return
//SEG92 [48] return
rts
}
//SEG93 init_angle_screen
// Populates 1000 bytes (a screen) with values representing the angle to the center.
// Utilizes symmetry around the center
init_angle_screen: {
.label _10 = $14
.label xw = $27
.label yw = $29
.label angle_w = $14
.label ang_w = $2b
.label x = $e
.label xb = $f
.label screen_topline = $a
.label screen_bottomline = $c
.label y = 9
//SEG94 [50] phi from init_angle_screen to init_angle_screen::@1 [phi:init_angle_screen->init_angle_screen::@1]
//SEG95 [50] phi (byte*) init_angle_screen::screen_bottomline#5 = (const byte*) SCREEN#0+(word)(number) $28*(number) $c [phi:init_angle_screen->init_angle_screen::@1#0] -- pbuz1=pbuc1
lda #<SCREEN+$28*$c
sta screen_bottomline
lda #>SCREEN+$28*$c
sta screen_bottomline+1
//SEG96 [50] phi (byte*) init_angle_screen::screen_topline#5 = (const byte*) SCREEN#0+(word)(number) $28*(number) $c [phi:init_angle_screen->init_angle_screen::@1#1] -- pbuz1=pbuc1
lda #<SCREEN+$28*$c
sta screen_topline
lda #>SCREEN+$28*$c
sta screen_topline+1
//SEG97 [50] phi (byte) init_angle_screen::y#4 = (byte) 0 [phi:init_angle_screen->init_angle_screen::@1#2] -- vbuz1=vbuc1
lda #0
sta y
//SEG98 [50] phi from init_angle_screen::@3 to init_angle_screen::@1 [phi:init_angle_screen::@3->init_angle_screen::@1]
//SEG99 [50] phi (byte*) init_angle_screen::screen_bottomline#5 = (byte*) init_angle_screen::screen_bottomline#1 [phi:init_angle_screen::@3->init_angle_screen::@1#0] -- register_copy
//SEG100 [50] phi (byte*) init_angle_screen::screen_topline#5 = (byte*) init_angle_screen::screen_topline#1 [phi:init_angle_screen::@3->init_angle_screen::@1#1] -- register_copy
//SEG101 [50] phi (byte) init_angle_screen::y#4 = (byte) init_angle_screen::y#1 [phi:init_angle_screen::@3->init_angle_screen::@1#2] -- register_copy
//SEG102 init_angle_screen::@1
b1:
//SEG103 [51] phi from init_angle_screen::@1 to init_angle_screen::@2 [phi:init_angle_screen::@1->init_angle_screen::@2]
//SEG104 [51] phi (byte) init_angle_screen::xb#2 = (byte) $27 [phi:init_angle_screen::@1->init_angle_screen::@2#0] -- vbuz1=vbuc1
lda #$27
sta xb
//SEG105 [51] phi (byte) init_angle_screen::x#2 = (byte) 0 [phi:init_angle_screen::@1->init_angle_screen::@2#1] -- vbuz1=vbuc1
lda #0
sta x
//SEG106 [51] phi from init_angle_screen::@4 to init_angle_screen::@2 [phi:init_angle_screen::@4->init_angle_screen::@2]
//SEG107 [51] phi (byte) init_angle_screen::xb#2 = (byte) init_angle_screen::xb#1 [phi:init_angle_screen::@4->init_angle_screen::@2#0] -- register_copy
//SEG108 [51] phi (byte) init_angle_screen::x#2 = (byte) init_angle_screen::x#1 [phi:init_angle_screen::@4->init_angle_screen::@2#1] -- register_copy
//SEG109 init_angle_screen::@2
b2:
//SEG110 [52] (byte~) init_angle_screen::$2 ← (byte) init_angle_screen::x#2 << (byte) 1 -- vbuaa=vbuz1_rol_1
lda x
asl
//SEG111 [53] (byte~) init_angle_screen::$3 ← (byte) $27 - (byte~) init_angle_screen::$2 -- vbuaa=vbuc1_minus_vbuaa
eor #$ff
clc
adc #$27+1
//SEG112 [54] (word) init_angle_screen::xw#0 ← (byte~) init_angle_screen::$3 w= (byte) 0 -- vwuz1=vbuaa_word_vbuc1
ldy #0
sta xw+1
sty xw
//SEG113 [55] (byte~) init_angle_screen::$6 ← (byte) init_angle_screen::y#4 << (byte) 1 -- vbuaa=vbuz1_rol_1
lda y
asl
//SEG114 [56] (word) init_angle_screen::yw#0 ← (byte~) init_angle_screen::$6 w= (byte) 0 -- vwuz1=vbuaa_word_vbuc1
sta yw+1
sty yw
//SEG115 [57] (signed word) atan2_16::x#0 ← (signed word)(word) init_angle_screen::xw#0
//SEG116 [58] (signed word) atan2_16::y#0 ← (signed word)(word) init_angle_screen::yw#0
//SEG117 [59] call atan2_16
jsr atan2_16
//SEG118 [60] (word) atan2_16::return#2 ← (word) atan2_16::return#0
//SEG119 init_angle_screen::@4
//SEG120 [61] (word) init_angle_screen::angle_w#0 ← (word) atan2_16::return#2
//SEG121 [62] (word~) init_angle_screen::$10 ← (word) init_angle_screen::angle_w#0 + (byte) $80 -- vwuz1=vwuz1_plus_vbuc1
lda #$80
clc
adc _10
sta _10
bcc !+
inc _10+1
!:
//SEG122 [63] (byte) init_angle_screen::ang_w#0 ← > (word~) init_angle_screen::$10 -- vbuz1=_hi_vwuz2
lda _10+1
sta ang_w
//SEG123 [64] (byte~) init_angle_screen::$12 ← (byte) $80 + (byte) init_angle_screen::ang_w#0 -- vbuaa=vbuc1_plus_vbuz1
lda #$80
clc
adc ang_w
//SEG124 [65] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$12 -- pbuz1_derefidx_vbuz2=vbuaa
ldy x
sta (screen_topline),y
//SEG125 [66] (byte~) init_angle_screen::$13 ← (byte) $80 - (byte) init_angle_screen::ang_w#0 -- vbuaa=vbuc1_minus_vbuz1
lda #$80
sec
sbc ang_w
//SEG126 [67] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::x#2) ← (byte~) init_angle_screen::$13 -- pbuz1_derefidx_vbuz2=vbuaa
sta (screen_bottomline),y
//SEG127 [68] (byte~) init_angle_screen::$14 ← - (byte) init_angle_screen::ang_w#0 -- vbuaa=_neg_vbuz1
lda ang_w
eor #$ff
clc
adc #1
//SEG128 [69] *((byte*) init_angle_screen::screen_topline#5 + (byte) init_angle_screen::xb#2) ← (byte~) init_angle_screen::$14 -- pbuz1_derefidx_vbuz2=vbuaa
ldy xb
sta (screen_topline),y
//SEG129 [70] *((byte*) init_angle_screen::screen_bottomline#5 + (byte) init_angle_screen::xb#2) ← (byte) init_angle_screen::ang_w#0 -- pbuz1_derefidx_vbuz2=vbuz3
lda ang_w
sta (screen_bottomline),y
//SEG130 [71] (byte) init_angle_screen::x#1 ← ++ (byte) init_angle_screen::x#2 -- vbuz1=_inc_vbuz1
inc x
//SEG131 [72] (byte) init_angle_screen::xb#1 ← -- (byte) init_angle_screen::xb#2 -- vbuz1=_dec_vbuz1
dec xb
//SEG132 [73] if((byte) init_angle_screen::x#1<(byte) $13+(byte) 1) goto init_angle_screen::@2 -- vbuz1_lt_vbuc1_then_la1
lda x
cmp #$13+1
bcc b2
//SEG133 init_angle_screen::@3
//SEG134 [74] (byte*) init_angle_screen::screen_topline#1 ← (byte*) init_angle_screen::screen_topline#5 - (byte) $28 -- pbuz1=pbuz1_minus_vwuc1
lda screen_topline
sec
sbc #<$28
sta screen_topline
lda screen_topline+1
sbc #>$28
sta screen_topline+1
//SEG135 [75] (byte*) init_angle_screen::screen_bottomline#1 ← (byte*) init_angle_screen::screen_bottomline#5 + (byte) $28 -- pbuz1=pbuz1_plus_vbuc1
lda #$28
clc
adc screen_bottomline
sta screen_bottomline
bcc !+
inc screen_bottomline+1
!:
//SEG136 [76] (byte) init_angle_screen::y#1 ← ++ (byte) init_angle_screen::y#4 -- vbuz1=_inc_vbuz1
inc y
//SEG137 [77] if((byte) init_angle_screen::y#1!=(byte) $d) goto init_angle_screen::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$d
cmp y
bne b1
//SEG138 init_angle_screen::@return
//SEG139 [78] return
rts
}
//SEG140 atan2_16
// 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($27) x, signed word zeropage($29) y)
atan2_16: {
.label _2 = $10
.label _7 = $12
.label yi = $10
.label xi = $12
.label angle = $14
.label xd = $18
.label yd = $16
.label return = $14
.label x = $27
.label y = $29
//SEG141 [79] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@1 -- vwsz1_ge_0_then_la1
lda y+1
bmi !b1+
jmp b1
!b1:
//SEG142 atan2_16::@2
//SEG143 [80] (signed word~) atan2_16::$2 ← - (signed word) atan2_16::y#0 -- vwsz1=_neg_vwsz2
sec
lda #0
sbc y
sta _2
lda #0
sbc y+1
sta _2+1
//SEG144 [81] phi from atan2_16::@1 atan2_16::@2 to atan2_16::@3 [phi:atan2_16::@1/atan2_16::@2->atan2_16::@3]
//SEG145 [81] phi (signed word) atan2_16::yi#0 = (signed word~) atan2_16::yi#16 [phi:atan2_16::@1/atan2_16::@2->atan2_16::@3#0] -- register_copy
//SEG146 atan2_16::@3
b3:
//SEG147 [82] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@4 -- vwsz1_ge_0_then_la1
lda x+1
bmi !b4+
jmp b4
!b4:
//SEG148 atan2_16::@5
//SEG149 [83] (signed word~) atan2_16::$7 ← - (signed word) atan2_16::x#0 -- vwsz1=_neg_vwsz2
sec
lda #0
sbc x
sta _7
lda #0
sbc x+1
sta _7+1
//SEG150 [84] phi from atan2_16::@4 atan2_16::@5 to atan2_16::@6 [phi:atan2_16::@4/atan2_16::@5->atan2_16::@6]
//SEG151 [84] phi (signed word) atan2_16::xi#0 = (signed word~) atan2_16::xi#13 [phi:atan2_16::@4/atan2_16::@5->atan2_16::@6#0] -- register_copy
//SEG152 atan2_16::@6
b6:
//SEG153 [85] phi from atan2_16::@6 to atan2_16::@10 [phi:atan2_16::@6->atan2_16::@10]
//SEG154 [85] phi (word) atan2_16::angle#12 = (byte) 0 [phi:atan2_16::@6->atan2_16::@10#0] -- vwuz1=vbuc1
lda #0
sta angle
sta angle+1
//SEG155 [85] phi (byte) atan2_16::i#2 = (byte) 0 [phi:atan2_16::@6->atan2_16::@10#1] -- vbuxx=vbuc1
tax
//SEG156 [85] phi (signed word) atan2_16::xi#3 = (signed word) atan2_16::xi#0 [phi:atan2_16::@6->atan2_16::@10#2] -- register_copy
//SEG157 [85] phi (signed word) atan2_16::yi#3 = (signed word) atan2_16::yi#0 [phi:atan2_16::@6->atan2_16::@10#3] -- register_copy
//SEG158 atan2_16::@10
b10:
//SEG159 [86] if((signed word) atan2_16::yi#3!=(signed byte) 0) goto atan2_16::@11 -- vwsz1_neq_0_then_la1
lda yi+1
bne b11
lda yi
bne b11
//SEG160 [87] phi from atan2_16::@10 atan2_16::@19 to atan2_16::@12 [phi:atan2_16::@10/atan2_16::@19->atan2_16::@12]
//SEG161 [87] phi (word) atan2_16::angle#6 = (word) atan2_16::angle#12 [phi:atan2_16::@10/atan2_16::@19->atan2_16::@12#0] -- register_copy
//SEG162 atan2_16::@12
b12:
//SEG163 [88] (word) atan2_16::angle#1 ← (word) atan2_16::angle#6 >> (byte) 1 -- vwuz1=vwuz1_ror_1
lsr angle+1
ror angle
//SEG164 [89] if((signed word) atan2_16::x#0>=(signed byte) 0) goto atan2_16::@7 -- vwsz1_ge_0_then_la1
lda x+1
bpl b7
//SEG165 atan2_16::@21
//SEG166 [90] (word) atan2_16::angle#4 ← (word) $8000 - (word) atan2_16::angle#1 -- vwuz1=vwuc1_minus_vwuz1
sec
lda #<$8000
sbc angle
sta angle
lda #>$8000
sbc angle+1
sta angle+1
//SEG167 [91] phi from atan2_16::@12 atan2_16::@21 to atan2_16::@7 [phi:atan2_16::@12/atan2_16::@21->atan2_16::@7]
//SEG168 [91] phi (word) atan2_16::angle#11 = (word) atan2_16::angle#1 [phi:atan2_16::@12/atan2_16::@21->atan2_16::@7#0] -- register_copy
//SEG169 atan2_16::@7
b7:
//SEG170 [92] if((signed word) atan2_16::y#0>=(signed byte) 0) goto atan2_16::@8 -- vwsz1_ge_0_then_la1
lda y+1
bpl b8
//SEG171 atan2_16::@9
//SEG172 [93] (word) atan2_16::angle#5 ← - (word) atan2_16::angle#11 -- vwuz1=_neg_vwuz1
sec
lda #0
sbc angle
sta angle
lda #0
sbc angle+1
sta angle+1
//SEG173 [94] phi from atan2_16::@7 atan2_16::@9 to atan2_16::@8 [phi:atan2_16::@7/atan2_16::@9->atan2_16::@8]
//SEG174 [94] phi (word) atan2_16::return#0 = (word) atan2_16::angle#11 [phi:atan2_16::@7/atan2_16::@9->atan2_16::@8#0] -- register_copy
//SEG175 atan2_16::@8
b8:
//SEG176 atan2_16::@return
//SEG177 [95] return
rts
//SEG178 atan2_16::@11
b11:
//SEG179 [96] (byte~) atan2_16::shift#5 ← (byte) atan2_16::i#2 -- vbuyy=vbuxx
txa
tay
//SEG180 [97] (signed word~) atan2_16::xd#10 ← (signed word) atan2_16::xi#3 -- vwsz1=vwsz2
lda xi
sta xd
lda xi+1
sta xd+1
//SEG181 [98] (signed word~) atan2_16::yd#10 ← (signed word) atan2_16::yi#3 -- vwsz1=vwsz2
lda yi
sta yd
lda yi+1
sta yd+1
//SEG182 [99] phi from atan2_16::@11 atan2_16::@14 to atan2_16::@13 [phi:atan2_16::@11/atan2_16::@14->atan2_16::@13]
//SEG183 [99] phi (signed word) atan2_16::yd#3 = (signed word~) atan2_16::yd#10 [phi:atan2_16::@11/atan2_16::@14->atan2_16::@13#0] -- register_copy
//SEG184 [99] phi (signed word) atan2_16::xd#3 = (signed word~) atan2_16::xd#10 [phi:atan2_16::@11/atan2_16::@14->atan2_16::@13#1] -- register_copy
//SEG185 [99] phi (byte) atan2_16::shift#2 = (byte~) atan2_16::shift#5 [phi:atan2_16::@11/atan2_16::@14->atan2_16::@13#2] -- register_copy
//SEG186 atan2_16::@13
b13:
//SEG187 [100] if((byte) atan2_16::shift#2>=(byte) 1+(byte) 1) goto atan2_16::@14 -- vbuyy_ge_vbuc1_then_la1
cpy #1+1
bcs b14
//SEG188 atan2_16::@15
//SEG189 [101] if((byte) 0==(byte) atan2_16::shift#2) goto atan2_16::@17 -- vbuc1_eq_vbuyy_then_la1
cpy #0
beq b17
//SEG190 atan2_16::@16
//SEG191 [102] (signed word) atan2_16::xd#2 ← (signed word) atan2_16::xd#3 >> (signed byte) 1 -- vwsz1=vwsz1_ror_1
lda xd+1
cmp #$80
ror xd+1
ror xd
//SEG192 [103] (signed word) atan2_16::yd#2 ← (signed word) atan2_16::yd#3 >> (signed byte) 1 -- vwsz1=vwsz1_ror_1
lda yd+1
cmp #$80
ror yd+1
ror yd
//SEG193 [104] phi from atan2_16::@15 atan2_16::@16 to atan2_16::@17 [phi:atan2_16::@15/atan2_16::@16->atan2_16::@17]
//SEG194 [104] phi (signed word) atan2_16::xd#5 = (signed word) atan2_16::xd#3 [phi:atan2_16::@15/atan2_16::@16->atan2_16::@17#0] -- register_copy
//SEG195 [104] phi (signed word) atan2_16::yd#5 = (signed word) atan2_16::yd#3 [phi:atan2_16::@15/atan2_16::@16->atan2_16::@17#1] -- register_copy
//SEG196 atan2_16::@17
b17:
//SEG197 [105] if((signed word) atan2_16::yi#3>=(signed byte) 0) goto atan2_16::@18 -- vwsz1_ge_0_then_la1
lda yi+1
bpl b18
//SEG198 atan2_16::@20
//SEG199 [106] (signed word) atan2_16::xi#2 ← (signed word) atan2_16::xi#3 - (signed word) atan2_16::yd#5 -- vwsz1=vwsz1_minus_vwsz2
lda xi
sec
sbc yd
sta xi
lda xi+1
sbc yd+1
sta xi+1
//SEG200 [107] (signed word) atan2_16::yi#2 ← (signed word) atan2_16::yi#3 + (signed word) atan2_16::xd#5 -- vwsz1=vwsz1_plus_vwsz2
lda yi
clc
adc xd
sta yi
lda yi+1
adc xd+1
sta yi+1
//SEG201 [108] (byte~) atan2_16::$24 ← (byte) atan2_16::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1
txa
asl
//SEG202 [109] (word) atan2_16::angle#3 ← (word) atan2_16::angle#12 - *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$24) -- vwuz1=vwuz1_minus_pwuc1_derefidx_vbuaa
tay
sec
lda angle
sbc CORDIC_ATAN2_ANGLES_16,y
sta angle
lda angle+1
sbc CORDIC_ATAN2_ANGLES_16+1,y
sta angle+1
//SEG203 [110] phi from atan2_16::@18 atan2_16::@20 to atan2_16::@19 [phi:atan2_16::@18/atan2_16::@20->atan2_16::@19]
//SEG204 [110] phi (signed word) atan2_16::xi#8 = (signed word) atan2_16::xi#1 [phi:atan2_16::@18/atan2_16::@20->atan2_16::@19#0] -- register_copy
//SEG205 [110] phi (word) atan2_16::angle#13 = (word) atan2_16::angle#2 [phi:atan2_16::@18/atan2_16::@20->atan2_16::@19#1] -- register_copy
//SEG206 [110] phi (signed word) atan2_16::yi#8 = (signed word) atan2_16::yi#1 [phi:atan2_16::@18/atan2_16::@20->atan2_16::@19#2] -- register_copy
//SEG207 atan2_16::@19
b19:
//SEG208 [111] (byte) atan2_16::i#1 ← ++ (byte) atan2_16::i#2 -- vbuxx=_inc_vbuxx
inx
//SEG209 [112] if((byte) atan2_16::i#1==(const byte) CORDIC_ITERATIONS_16#0-(byte) 1+(byte) 1) goto atan2_16::@12 -- vbuxx_eq_vbuc1_then_la1
cpx #CORDIC_ITERATIONS_16-1+1
bne !b12+
jmp b12
!b12:
//SEG210 [85] phi from atan2_16::@19 to atan2_16::@10 [phi:atan2_16::@19->atan2_16::@10]
//SEG211 [85] phi (word) atan2_16::angle#12 = (word) atan2_16::angle#13 [phi:atan2_16::@19->atan2_16::@10#0] -- register_copy
//SEG212 [85] phi (byte) atan2_16::i#2 = (byte) atan2_16::i#1 [phi:atan2_16::@19->atan2_16::@10#1] -- register_copy
//SEG213 [85] phi (signed word) atan2_16::xi#3 = (signed word) atan2_16::xi#8 [phi:atan2_16::@19->atan2_16::@10#2] -- register_copy
//SEG214 [85] phi (signed word) atan2_16::yi#3 = (signed word) atan2_16::yi#8 [phi:atan2_16::@19->atan2_16::@10#3] -- register_copy
jmp b10
//SEG215 atan2_16::@18
b18:
//SEG216 [113] (signed word) atan2_16::xi#1 ← (signed word) atan2_16::xi#3 + (signed word) atan2_16::yd#5 -- vwsz1=vwsz1_plus_vwsz2
lda xi
clc
adc yd
sta xi
lda xi+1
adc yd+1
sta xi+1
//SEG217 [114] (signed word) atan2_16::yi#1 ← (signed word) atan2_16::yi#3 - (signed word) atan2_16::xd#5 -- vwsz1=vwsz1_minus_vwsz2
lda yi
sec
sbc xd
sta yi
lda yi+1
sbc xd+1
sta yi+1
//SEG218 [115] (byte~) atan2_16::$23 ← (byte) atan2_16::i#2 << (byte) 1 -- vbuaa=vbuxx_rol_1
txa
asl
//SEG219 [116] (word) atan2_16::angle#2 ← (word) atan2_16::angle#12 + *((const word[CORDIC_ITERATIONS_16#0]) CORDIC_ATAN2_ANGLES_16#0 + (byte~) atan2_16::$23) -- vwuz1=vwuz1_plus_pwuc1_derefidx_vbuaa
tay
clc
lda angle
adc CORDIC_ATAN2_ANGLES_16,y
sta angle
lda angle+1
adc CORDIC_ATAN2_ANGLES_16+1,y
sta angle+1
jmp b19
//SEG220 atan2_16::@14
b14:
//SEG221 [117] (signed word) atan2_16::xd#1 ← (signed word) atan2_16::xd#3 >> (signed byte) 2 -- vwsz1=vwsz1_ror_2
lda xd+1
cmp #$80
ror xd+1
ror xd
lda xd+1
cmp #$80
ror xd+1
ror xd
//SEG222 [118] (signed word) atan2_16::yd#1 ← (signed word) atan2_16::yd#3 >> (signed byte) 2 -- vwsz1=vwsz1_ror_2
lda yd+1
cmp #$80
ror yd+1
ror yd
lda yd+1
cmp #$80
ror yd+1
ror yd
//SEG223 [119] (byte) atan2_16::shift#1 ← (byte) atan2_16::shift#2 - (byte) 2 -- vbuyy=vbuyy_minus_2
dey
dey
jmp b13
//SEG224 atan2_16::@4
b4:
//SEG225 [120] (signed word~) atan2_16::xi#13 ← (signed word) atan2_16::x#0 -- vwsz1=vwsz2
lda x
sta xi
lda x+1
sta xi+1
jmp b6
//SEG226 atan2_16::@1
b1:
//SEG227 [121] (signed word~) atan2_16::yi#16 ← (signed word) atan2_16::y#0 -- vwsz1=vwsz2
lda y
sta yi
lda y+1
sta yi+1
jmp b3
}
//SEG228 clock_start
// Reset & start the processor clock time. The value can be read using clock().
// This uses CIA #2 Timer A+B on the C64
clock_start: {
//SEG229 [122] *((const byte*) CIA2_TIMER_A_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_CONTINUOUS#0 -- _deref_pbuc1=vbuc2
// Setup CIA#2 timer A to count (down) CPU cycles
lda #CIA_TIMER_CONTROL_CONTINUOUS
sta CIA2_TIMER_A_CONTROL
//SEG230 [123] *((const byte*) CIA2_TIMER_B_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
//SEG231 [124] *((const dword*) CIA2_TIMER_AB#0) ← (dword) $ffffffff -- _deref_pduc1=vduc2
lda #<$ffffffff
sta CIA2_TIMER_AB
lda #>$ffffffff
sta CIA2_TIMER_AB+1
lda #<$ffffffff>>$10
sta CIA2_TIMER_AB+2
lda #>$ffffffff>>$10
sta CIA2_TIMER_AB+3
//SEG232 [125] *((const byte*) CIA2_TIMER_B_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_START#0|(const byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A#0 -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
//SEG233 [126] *((const byte*) CIA2_TIMER_A_CONTROL#0) ← (const byte) CIA_TIMER_CONTROL_START#0 -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START
sta CIA2_TIMER_A_CONTROL
//SEG234 clock_start::@return
//SEG235 [127] return
rts
}
//SEG236 init_font_hex
// Make charset from proto chars
// init_font_hex(byte* zeropage($1d) charset)
init_font_hex: {
.label _0 = $2c
.label idx = $22
.label proto_lo = $1f
.label charset = $1d
.label c1 = $21
.label proto_hi = $1a
.label c = $1c
//SEG237 [129] phi from init_font_hex to init_font_hex::@1 [phi:init_font_hex->init_font_hex::@1]
//SEG238 [129] phi (byte) init_font_hex::c#6 = (byte) 0 [phi:init_font_hex->init_font_hex::@1#0] -- vbuz1=vbuc1
lda #0
sta c
//SEG239 [129] phi (byte*) init_font_hex::proto_hi#6 = (const byte[]) FONT_HEX_PROTO#0 [phi:init_font_hex->init_font_hex::@1#1] -- pbuz1=pbuc1
lda #<FONT_HEX_PROTO
sta proto_hi
lda #>FONT_HEX_PROTO
sta proto_hi+1
//SEG240 [129] phi (byte*) init_font_hex::charset#5 = (const byte*) CHARSET#0 [phi:init_font_hex->init_font_hex::@1#2] -- pbuz1=pbuc1
lda #<CHARSET
sta charset
lda #>CHARSET
sta charset+1
//SEG241 [129] phi from init_font_hex::@5 to init_font_hex::@1 [phi:init_font_hex::@5->init_font_hex::@1]
//SEG242 [129] phi (byte) init_font_hex::c#6 = (byte) init_font_hex::c#1 [phi:init_font_hex::@5->init_font_hex::@1#0] -- register_copy
//SEG243 [129] phi (byte*) init_font_hex::proto_hi#6 = (byte*) init_font_hex::proto_hi#1 [phi:init_font_hex::@5->init_font_hex::@1#1] -- register_copy
//SEG244 [129] phi (byte*) init_font_hex::charset#5 = (byte*) init_font_hex::charset#0 [phi:init_font_hex::@5->init_font_hex::@1#2] -- register_copy
//SEG245 init_font_hex::@1
b1:
//SEG246 [130] phi from init_font_hex::@1 to init_font_hex::@2 [phi:init_font_hex::@1->init_font_hex::@2]
//SEG247 [130] phi (byte) init_font_hex::c1#4 = (byte) 0 [phi:init_font_hex::@1->init_font_hex::@2#0] -- vbuz1=vbuc1
lda #0
sta c1
//SEG248 [130] phi (byte*) init_font_hex::proto_lo#4 = (const byte[]) FONT_HEX_PROTO#0 [phi:init_font_hex::@1->init_font_hex::@2#1] -- pbuz1=pbuc1
lda #<FONT_HEX_PROTO
sta proto_lo
lda #>FONT_HEX_PROTO
sta proto_lo+1
//SEG249 [130] phi (byte*) init_font_hex::charset#2 = (byte*) init_font_hex::charset#5 [phi:init_font_hex::@1->init_font_hex::@2#2] -- register_copy
//SEG250 [130] phi from init_font_hex::@4 to init_font_hex::@2 [phi:init_font_hex::@4->init_font_hex::@2]
//SEG251 [130] phi (byte) init_font_hex::c1#4 = (byte) init_font_hex::c1#1 [phi:init_font_hex::@4->init_font_hex::@2#0] -- register_copy
//SEG252 [130] phi (byte*) init_font_hex::proto_lo#4 = (byte*) init_font_hex::proto_lo#1 [phi:init_font_hex::@4->init_font_hex::@2#1] -- register_copy
//SEG253 [130] phi (byte*) init_font_hex::charset#2 = (byte*) init_font_hex::charset#0 [phi:init_font_hex::@4->init_font_hex::@2#2] -- register_copy
//SEG254 init_font_hex::@2
b2:
//SEG255 [131] *((byte*) init_font_hex::charset#2) ← (byte) 0 -- _deref_pbuz1=vbuc1
lda #0
tay
sta (charset),y
//SEG256 [132] phi from init_font_hex::@2 to init_font_hex::@3 [phi:init_font_hex::@2->init_font_hex::@3]
//SEG257 [132] phi (byte) init_font_hex::idx#5 = (byte) 1 [phi:init_font_hex::@2->init_font_hex::@3#0] -- vbuz1=vbuc1
lda #1
sta idx
//SEG258 [132] phi (byte) init_font_hex::i#2 = (byte) 0 [phi:init_font_hex::@2->init_font_hex::@3#1] -- vbuxx=vbuc1
ldx #0
//SEG259 [132] phi from init_font_hex::@3 to init_font_hex::@3 [phi:init_font_hex::@3->init_font_hex::@3]
//SEG260 [132] phi (byte) init_font_hex::idx#5 = (byte) init_font_hex::idx#2 [phi:init_font_hex::@3->init_font_hex::@3#0] -- register_copy
//SEG261 [132] phi (byte) init_font_hex::i#2 = (byte) init_font_hex::i#1 [phi:init_font_hex::@3->init_font_hex::@3#1] -- register_copy
//SEG262 init_font_hex::@3
b3:
//SEG263 [133] (byte~) init_font_hex::$0 ← *((byte*) init_font_hex::proto_hi#6 + (byte) init_font_hex::i#2) << (byte) 4 -- vbuz1=pbuz2_derefidx_vbuxx_rol_4
txa
tay
lda (proto_hi),y
asl
asl
asl
asl
sta _0
//SEG264 [134] (byte~) init_font_hex::$1 ← *((byte*) init_font_hex::proto_lo#4 + (byte) init_font_hex::i#2) << (byte) 1 -- vbuaa=pbuz1_derefidx_vbuxx_rol_1
txa
tay
lda (proto_lo),y
asl
//SEG265 [135] (byte~) init_font_hex::$2 ← (byte~) init_font_hex::$0 | (byte~) init_font_hex::$1 -- vbuaa=vbuz1_bor_vbuaa
ora _0
//SEG266 [136] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#5) ← (byte~) init_font_hex::$2 -- pbuz1_derefidx_vbuz2=vbuaa
ldy idx
sta (charset),y
//SEG267 [137] (byte) init_font_hex::idx#2 ← ++ (byte) init_font_hex::idx#5 -- vbuz1=_inc_vbuz1
inc idx
//SEG268 [138] (byte) init_font_hex::i#1 ← ++ (byte) init_font_hex::i#2 -- vbuxx=_inc_vbuxx
inx
//SEG269 [139] if((byte) init_font_hex::i#1!=(byte) 5) goto init_font_hex::@3 -- vbuxx_neq_vbuc1_then_la1
cpx #5
bne b3
//SEG270 init_font_hex::@4
//SEG271 [140] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#2) ← (byte) 0 -- pbuz1_derefidx_vbuz2=vbuc1
lda #0
ldy idx
sta (charset),y
//SEG272 [141] (byte) init_font_hex::idx#3 ← ++ (byte) init_font_hex::idx#2 -- vbuyy=_inc_vbuz1
iny
//SEG273 [142] *((byte*) init_font_hex::charset#2 + (byte) init_font_hex::idx#3) ← (byte) 0 -- pbuz1_derefidx_vbuyy=vbuc1
sta (charset),y
//SEG274 [143] (byte*) init_font_hex::proto_lo#1 ← (byte*) init_font_hex::proto_lo#4 + (byte) 5 -- pbuz1=pbuz1_plus_vbuc1
lda #5
clc
adc proto_lo
sta proto_lo
bcc !+
inc proto_lo+1
!:
//SEG275 [144] (byte*) init_font_hex::charset#0 ← (byte*) init_font_hex::charset#2 + (byte) 8 -- pbuz1=pbuz1_plus_vbuc1
lda #8
clc
adc charset
sta charset
bcc !+
inc charset+1
!:
//SEG276 [145] (byte) init_font_hex::c1#1 ← ++ (byte) init_font_hex::c1#4 -- vbuz1=_inc_vbuz1
inc c1
//SEG277 [146] if((byte) init_font_hex::c1#1!=(byte) $10) goto init_font_hex::@2 -- vbuz1_neq_vbuc1_then_la1
lda #$10
cmp c1
bne b2
//SEG278 init_font_hex::@5
//SEG279 [147] (byte*) init_font_hex::proto_hi#1 ← (byte*) init_font_hex::proto_hi#6 + (byte) 5 -- pbuz1=pbuz1_plus_vbuc1
lda #5
clc
adc proto_hi
sta proto_hi
bcc !+
inc proto_hi+1
!:
//SEG280 [148] (byte) init_font_hex::c#1 ← ++ (byte) init_font_hex::c#6 -- vbuz1=_inc_vbuz1
inc c
//SEG281 [149] if((byte) init_font_hex::c#1!=(byte) $10) goto init_font_hex::@1 -- vbuz1_neq_vbuc1_then_la1
lda #$10
cmp c
bne b1
//SEG282 init_font_hex::@return
//SEG283 [150] return
rts
}
//SEG284 File Data
// 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
// Angles representing ATAN(0.5), ATAN(0.25), ATAN(0.125), ...
CORDIC_ATAN2_ANGLES_16:
.for (var i=0; i<CORDIC_ITERATIONS_16; i++)
.word 256*2*256*atan(1/pow(2,i))/PI/2
print_hextab: .text "0123456789abcdef"