1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-01-13 18:30:21 +00:00

Fixed bresenham line to do proper word-based addition.

This commit is contained in:
jespergravgaard 2017-11-01 14:10:49 +01:00
parent 0317fc50c3
commit 4bcef390f3
12 changed files with 1753 additions and 1671 deletions

View File

@ -45,6 +45,9 @@ Arrays / Strings / Inline data
- Add support for empty / filled byte data arrays. - Add support for empty / filled byte data arrays.
- Add support for expressions in data initializers. - Add support for expressions in data initializers.
- Create a fill-like array initialization - byte[$100] plot_xlo = { [x] = x&$f8 }; - Create a fill-like array initialization - byte[$100] plot_xlo = { [x] = x&$f8 };
- Support word-arrays as two underlying byte-arrays in memory: word[$100] plot_x; -> ASM { plot_x_lo .fill $100,0 plot_x_hi .fill $100,0; }
- Support syntax for initializing the address of the two byte-arrays underlying a word array. word[] plot_x = { lo=$1000, hi=$1000 };
- Support syntax for initializing the address of a byte-array. byte[] plot_x = { addr=$1000 }; -- current syntax as a short hand byte[] plot_x = $1000;
- Inline ASM - Inline ASM
- Add support for inline asm - Add support for inline asm

View File

@ -0,0 +1,3 @@
sta {zpptrby1}+1
lda #<{coby1}
sta {zpptrby1}

View File

@ -0,0 +1,3 @@
stx {zpptrby1}+1
ldx #<{coby1}
stx {zpptrby1}

View File

@ -0,0 +1,3 @@
sty {zpptrby1}+1
ldy #<{coby1}
sty {zpptrby1}

View File

@ -0,0 +1,4 @@
lda #<{coby1}
sta {zpptrby1}
lda {zpby1}
sta {zpptrby1}+1

View File

@ -0,0 +1,7 @@
lda {zpptrby1}
clc
adc {zpptrby2}
sta {zpptrby1}
lda {zpptrby1}+1
adc {zpptrby2}+1
sta {zpptrby1}+1

View File

@ -0,0 +1,7 @@
lda {zpptrby2}
clc
adc {zpptrby3}
sta {zpptrby1}
lda {zpptrby2}+1
adc {zpptrby3}+1
sta {zpptrby1}+1

View File

@ -31,9 +31,8 @@ void main() {
*D018 = $18; // Needs casting for *D018 = ((word)SCREEN/$40)|((word)BITMAP/$400); *D018 = $18; // Needs casting for *D018 = ((word)SCREEN/$40)|((word)BITMAP/$400);
initscreen(); initscreen();
initplottables(); initplottables();
// TODO: Error with constant identification of the parameters! line(0,0,200,100);
line(0,0,20,10); line(10,20,140,140);
line(10,20,40,40);
} }
void line(byte x0, byte y0, byte x1, byte y1) { void line(byte x0, byte y0, byte x1, byte y1) {
@ -44,7 +43,6 @@ void line(byte x0, byte y0, byte x1, byte y1) {
byte e = yd>>1; byte e = yd>>1;
do { do {
plot(x,y); plot(x,y);
// TODO: Ensure coalescing of plotter#0 and plotter#1 into a single live range equivalence class.
x = x + 1; x = x + 1;
e = e+yd; e = e+yd;
if(xd<e) { if(xd<e) {
@ -63,7 +61,6 @@ void initscreen() {
} }
} }
void initplottables() { void initplottables() {
byte bit = $80; byte bit = $80;
for(byte x : 0..255) { for(byte x : 0..255) {
@ -85,16 +82,14 @@ void initplottables() {
} }
} }
void plot(byte x, byte y) { void plot(byte x, byte y) {
// TODO: This assignment is needed - to avoid plotter var being destroyed during compilation. Find a way to eliminate it. byte* plotter_x = 0;
byte* plotter = BITMAP; byte* plotter_y = 0;
<plotter = plot_xlo[x]+plot_ylo[y]; >plotter_x = plot_xhi[x]; // Needs word arrays arranged as two underlying byte arrays to allow byte* plotter_x = plot_x[x]; - and eventually - byte* plotter = plot_x[x] + plot_y[y];
>plotter = plot_xhi[x]+plot_yhi[y]; <plotter_x = plot_xlo[x];
// TODO: <plotter can overflow - and carry must then be added to the >plotter part. Requires new logic? >plotter_y = plot_yhi[y];
// TODO: New logic needed is 1) word-table lookup (split into two byte-tables) 2) word-addition 3) ALU-capable word-addition <plotter_y = plot_ylo[y];
byte* plotter = plotter_x+plotter_y;
*plotter = *plotter | plot_bit[x]; *plotter = *plotter | plot_bit[x];
} }

View File

@ -32,17 +32,17 @@ main: {
jsr initplottables jsr initplottables
lda #0 lda #0
sta line.y sta line.y
ldx #$a ldx #$64
sta line.x sta line.x
lda #$14 lda #$c8
sta line.x1 sta line.x1
jsr line jsr line
lda #$14 lda #$14
sta line.y sta line.y
ldx #$28 ldx #$8c
lda #$a lda #$a
sta line.x sta line.x
lda #$28 lda #$8c
sta line.x1 sta line.x1
jsr line jsr line
rts rts
@ -91,29 +91,34 @@ line: {
rts rts
} }
plot: { plot: {
.label _0 = 10 .label _5 = 12
.label _3 = 10 .label plotter_x = 6
.label _6 = 10 .label plotter_y = 10
.label plotter = 6 .label plotter = 6
lda plot_xlo,x
sta _0
lda plot_ylo,y
clc
adc _0
sta plotter
lda #>BITMAP
sta plotter+1
lda plot_xhi,x lda plot_xhi,x
sta _3 sta plotter_x+1
lda #<0
sta plotter_x
lda plot_xlo,x
sta plotter_x
lda plot_yhi,y lda plot_yhi,y
sta plotter_y+1
lda #<0
sta plotter_y
lda plot_ylo,y
sta plotter_y
lda plotter
clc clc
adc _3 adc plotter_y
sta plotter
lda plotter+1
adc plotter_y+1
sta plotter+1 sta plotter+1
ldy #0 ldy #0
lda (plotter),y lda (plotter),y
sta _6 sta _5
lda plot_bit,x lda plot_bit,x
ora _6 ora _5
sta (plotter),y sta (plotter),y
rts rts
} }

View File

@ -25,9 +25,9 @@ main::@return: scope:[main] from main::@3
to:@return to:@return
line: scope:[line] from main::@2 main::@3 line: scope:[line] from main::@2 main::@3
[10] (byte) line::y#0 ← phi( main::@2/(byte) 0 main::@3/(byte) 20 ) [ line::x1#2 line::x#0 line::y1#2 line::y#0 ] [10] (byte) line::y#0 ← phi( main::@2/(byte) 0 main::@3/(byte) 20 ) [ line::x1#2 line::x#0 line::y1#2 line::y#0 ]
[10] (byte) line::y1#2 ← phi( main::@2/(byte) 10 main::@3/(byte) 40 ) [ line::x1#2 line::x#0 line::y1#2 line::y#0 ] [10] (byte) line::y1#2 ← phi( main::@2/(byte) 100 main::@3/(byte) 140 ) [ line::x1#2 line::x#0 line::y1#2 line::y#0 ]
[10] (byte) line::x#0 ← phi( main::@2/(byte) 0 main::@3/(byte) 10 ) [ line::x1#2 line::x#0 line::y1#2 line::y#0 ] [10] (byte) line::x#0 ← phi( main::@2/(byte) 0 main::@3/(byte) 10 ) [ line::x1#2 line::x#0 line::y1#2 line::y#0 ]
[10] (byte) line::x1#2 ← phi( main::@2/(byte) 20 main::@3/(byte) 40 ) [ line::x1#2 line::x#0 line::y1#2 line::y#0 ] [10] (byte) line::x1#2 ← phi( main::@2/(byte) 200 main::@3/(byte) 140 ) [ line::x1#2 line::x#0 line::y1#2 line::y#0 ]
[11] (byte) line::xd#0 ← (byte) line::x1#2 - (byte) line::x#0 [ line::x1#2 line::x#0 line::y1#2 line::y#0 line::xd#0 ] [11] (byte) line::xd#0 ← (byte) line::x1#2 - (byte) line::x#0 [ line::x1#2 line::x#0 line::y1#2 line::y#0 line::xd#0 ]
[12] (byte) line::yd#0 ← (byte) line::y1#2 - (byte) line::y#0 [ line::x1#2 line::x#0 line::y#0 line::xd#0 line::yd#0 ] [12] (byte) line::yd#0 ← (byte) line::y1#2 - (byte) line::y#0 [ line::x1#2 line::x#0 line::y#0 line::xd#0 line::yd#0 ]
[13] (byte) line::e#0 ← (byte) line::yd#0 >> (byte) 1 [ line::x1#2 line::x#0 line::y#0 line::xd#0 line::yd#0 line::e#0 ] [13] (byte) line::e#0 ← (byte) line::yd#0 >> (byte) 1 [ line::x1#2 line::x#0 line::y#0 line::xd#0 line::yd#0 line::e#0 ]
@ -59,80 +59,81 @@ line::@return: scope:[line] from line::@2
[26] return [ ] [26] return [ ]
to:@return to:@return
plot: scope:[plot] from line::@1 plot: scope:[plot] from line::@1
[27] (byte~) plot::$0 ← (const byte[]) plot_xlo#0 *idx (byte) plot::x#0 [ plot::x#0 plot::y#0 plot::$0 ] [27] (byte~) plot::$0 ← (const byte[]) plot_xhi#0 *idx (byte) plot::x#0 [ plot::x#0 plot::y#0 plot::$0 ]
[28] (byte~) plot::$1 ← (const byte[]) plot_ylo#0 *idx (byte) plot::y#0 [ plot::x#0 plot::y#0 plot::$0 plot::$1 ] [28] (byte*) plot::plotter_x#1 ← (byte) 0 hi= (byte~) plot::$0 [ plot::x#0 plot::y#0 plot::plotter_x#1 ]
[29] (byte~) plot::$2 ← (byte~) plot::$0 + (byte~) plot::$1 [ plot::x#0 plot::y#0 plot::$2 ] [29] (byte~) plot::$1 ← (const byte[]) plot_xlo#0 *idx (byte) plot::x#0 [ plot::x#0 plot::y#0 plot::plotter_x#1 plot::$1 ]
[30] (byte*) plot::plotter#1 ← (const byte*) BITMAP#0 lo= (byte~) plot::$2 [ plot::x#0 plot::y#0 plot::plotter#1 ] [30] (byte*) plot::plotter_x#2 ← (byte*) plot::plotter_x#1 lo= (byte~) plot::$1 [ plot::x#0 plot::y#0 plot::plotter_x#2 ]
[31] (byte~) plot::$3 ← (const byte[]) plot_xhi#0 *idx (byte) plot::x#0 [ plot::x#0 plot::y#0 plot::plotter#1 plot::$3 ] [31] (byte~) plot::$2 ← (const byte[]) plot_yhi#0 *idx (byte) plot::y#0 [ plot::x#0 plot::y#0 plot::plotter_x#2 plot::$2 ]
[32] (byte~) plot::$4 ← (const byte[]) plot_yhi#0 *idx (byte) plot::y#0 [ plot::x#0 plot::plotter#1 plot::$3 plot::$4 ] [32] (byte*) plot::plotter_y#1 ← (byte) 0 hi= (byte~) plot::$2 [ plot::x#0 plot::y#0 plot::plotter_x#2 plot::plotter_y#1 ]
[33] (byte~) plot::$5 ← (byte~) plot::$3 + (byte~) plot::$4 [ plot::x#0 plot::plotter#1 plot::$5 ] [33] (byte~) plot::$3 ← (const byte[]) plot_ylo#0 *idx (byte) plot::y#0 [ plot::x#0 plot::plotter_x#2 plot::plotter_y#1 plot::$3 ]
[34] (byte*) plot::plotter#2 ← (byte*) plot::plotter#1 hi= (byte~) plot::$5 [ plot::x#0 plot::plotter#2 ] [34] (byte*) plot::plotter_y#2 ← (byte*) plot::plotter_y#1 lo= (byte~) plot::$3 [ plot::x#0 plot::plotter_x#2 plot::plotter_y#2 ]
[35] (byte~) plot::$6 ← * (byte*) plot::plotter#2 [ plot::x#0 plot::plotter#2 plot::$6 ] [35] (byte*) plot::plotter#0 ← (byte*) plot::plotter_x#2 + (byte*) plot::plotter_y#2 [ plot::x#0 plot::plotter#0 ]
[36] (byte~) plot::$7 ← (const byte[]) plot_bit#0 *idx (byte) plot::x#0 [ plot::plotter#2 plot::$6 plot::$7 ] [36] (byte~) plot::$5 ← * (byte*) plot::plotter#0 [ plot::x#0 plot::plotter#0 plot::$5 ]
[37] (byte~) plot::$8 ← (byte~) plot::$6 | (byte~) plot::$7 [ plot::plotter#2 plot::$8 ] [37] (byte~) plot::$6 ← (const byte[]) plot_bit#0 *idx (byte) plot::x#0 [ plot::plotter#0 plot::$5 plot::$6 ]
[38] *((byte*) plot::plotter#2) ← (byte~) plot::$8 [ ] [38] (byte~) plot::$7 ← (byte~) plot::$5 | (byte~) plot::$6 [ plot::plotter#0 plot::$7 ]
[39] *((byte*) plot::plotter#0) ← (byte~) plot::$7 [ ]
to:plot::@return to:plot::@return
plot::@return: scope:[plot] from plot plot::@return: scope:[plot] from plot
[39] return [ ] [40] return [ ]
to:@return to:@return
initplottables: scope:[initplottables] from main::@1 initplottables: scope:[initplottables] from main::@1
[40] phi() [ ] [41] phi() [ ]
to:initplottables::@1 to:initplottables::@1
initplottables::@1: scope:[initplottables] from initplottables initplottables::@2 initplottables::@1: scope:[initplottables] from initplottables initplottables::@2
[41] (byte) initplottables::bit#3 ← phi( initplottables/(byte) 128 initplottables::@2/(byte) initplottables::bit#4 ) [ initplottables::x#2 initplottables::bit#3 ] [42] (byte) initplottables::bit#3 ← phi( initplottables/(byte) 128 initplottables::@2/(byte) initplottables::bit#4 ) [ initplottables::x#2 initplottables::bit#3 ]
[41] (byte) initplottables::x#2 ← phi( initplottables/(byte) 0 initplottables::@2/(byte) initplottables::x#1 ) [ initplottables::x#2 initplottables::bit#3 ] [42] (byte) initplottables::x#2 ← phi( initplottables/(byte) 0 initplottables::@2/(byte) initplottables::x#1 ) [ initplottables::x#2 initplottables::bit#3 ]
[42] (byte~) initplottables::$0 ← (byte) initplottables::x#2 & (byte) 248 [ initplottables::x#2 initplottables::bit#3 initplottables::$0 ] [43] (byte~) initplottables::$0 ← (byte) initplottables::x#2 & (byte) 248 [ initplottables::x#2 initplottables::bit#3 initplottables::$0 ]
[43] *((const byte[]) plot_xlo#0 + (byte) initplottables::x#2) ← (byte~) initplottables::$0 [ initplottables::x#2 initplottables::bit#3 ] [44] *((const byte[]) plot_xlo#0 + (byte) initplottables::x#2) ← (byte~) initplottables::$0 [ initplottables::x#2 initplottables::bit#3 ]
[44] *((const byte[]) plot_xhi#0 + (byte) initplottables::x#2) ← >(const byte*) BITMAP#0 [ initplottables::x#2 initplottables::bit#3 ] [45] *((const byte[]) plot_xhi#0 + (byte) initplottables::x#2) ← >(const byte*) BITMAP#0 [ initplottables::x#2 initplottables::bit#3 ]
[45] *((const byte[]) plot_bit#0 + (byte) initplottables::x#2) ← (byte) initplottables::bit#3 [ initplottables::x#2 initplottables::bit#3 ] [46] *((const byte[]) plot_bit#0 + (byte) initplottables::x#2) ← (byte) initplottables::bit#3 [ initplottables::x#2 initplottables::bit#3 ]
[46] (byte) initplottables::bit#1 ← (byte) initplottables::bit#3 >> (byte) 1 [ initplottables::x#2 initplottables::bit#1 ] [47] (byte) initplottables::bit#1 ← (byte) initplottables::bit#3 >> (byte) 1 [ initplottables::x#2 initplottables::bit#1 ]
[47] if((byte) initplottables::bit#1!=(byte) 0) goto initplottables::@10 [ initplottables::x#2 ] [48] if((byte) initplottables::bit#1!=(byte) 0) goto initplottables::@10 [ initplottables::x#2 ]
to:initplottables::@2 to:initplottables::@2
initplottables::@2: scope:[initplottables] from initplottables::@1 initplottables::@10 initplottables::@2: scope:[initplottables] from initplottables::@1 initplottables::@10
[48] (byte) initplottables::bit#4 ← phi( initplottables::@10/(byte) initplottables::bit#1 initplottables::@1/(byte) 128 ) [ initplottables::x#2 initplottables::bit#4 ] [49] (byte) initplottables::bit#4 ← phi( initplottables::@10/(byte) initplottables::bit#1 initplottables::@1/(byte) 128 ) [ initplottables::x#2 initplottables::bit#4 ]
[49] (byte) initplottables::x#1 ← ++ (byte) initplottables::x#2 [ initplottables::x#1 initplottables::bit#4 ] [50] (byte) initplottables::x#1 ← ++ (byte) initplottables::x#2 [ initplottables::x#1 initplottables::bit#4 ]
[50] if((byte) initplottables::x#1!=(byte) 0) goto initplottables::@1 [ initplottables::x#1 initplottables::bit#4 ] [51] if((byte) initplottables::x#1!=(byte) 0) goto initplottables::@1 [ initplottables::x#1 initplottables::bit#4 ]
to:initplottables::@3 to:initplottables::@3
initplottables::@3: scope:[initplottables] from initplottables::@2 initplottables::@4 initplottables::@3: scope:[initplottables] from initplottables::@2 initplottables::@4
[51] (byte*) initplottables::yoffs#2 ← phi( initplottables::@4/(byte*) initplottables::yoffs#4 initplottables::@2/(byte) 0 ) [ initplottables::y#2 initplottables::yoffs#2 ] [52] (byte*) initplottables::yoffs#2 ← phi( initplottables::@4/(byte*) initplottables::yoffs#4 initplottables::@2/(byte) 0 ) [ initplottables::y#2 initplottables::yoffs#2 ]
[51] (byte) initplottables::y#2 ← phi( initplottables::@4/(byte) initplottables::y#1 initplottables::@2/(byte) 0 ) [ initplottables::y#2 initplottables::yoffs#2 ] [52] (byte) initplottables::y#2 ← phi( initplottables::@4/(byte) initplottables::y#1 initplottables::@2/(byte) 0 ) [ initplottables::y#2 initplottables::yoffs#2 ]
[52] (byte~) initplottables::$6 ← (byte) initplottables::y#2 & (byte) 7 [ initplottables::y#2 initplottables::yoffs#2 initplottables::$6 ] [53] (byte~) initplottables::$6 ← (byte) initplottables::y#2 & (byte) 7 [ initplottables::y#2 initplottables::yoffs#2 initplottables::$6 ]
[53] (byte~) initplottables::$7 ← < (byte*) initplottables::yoffs#2 [ initplottables::y#2 initplottables::yoffs#2 initplottables::$6 initplottables::$7 ] [54] (byte~) initplottables::$7 ← < (byte*) initplottables::yoffs#2 [ initplottables::y#2 initplottables::yoffs#2 initplottables::$6 initplottables::$7 ]
[54] (byte~) initplottables::$8 ← (byte~) initplottables::$6 | (byte~) initplottables::$7 [ initplottables::y#2 initplottables::yoffs#2 initplottables::$8 ] [55] (byte~) initplottables::$8 ← (byte~) initplottables::$6 | (byte~) initplottables::$7 [ initplottables::y#2 initplottables::yoffs#2 initplottables::$8 ]
[55] *((const byte[]) plot_ylo#0 + (byte) initplottables::y#2) ← (byte~) initplottables::$8 [ initplottables::y#2 initplottables::yoffs#2 ] [56] *((const byte[]) plot_ylo#0 + (byte) initplottables::y#2) ← (byte~) initplottables::$8 [ initplottables::y#2 initplottables::yoffs#2 ]
[56] (byte~) initplottables::$9 ← > (byte*) initplottables::yoffs#2 [ initplottables::y#2 initplottables::yoffs#2 initplottables::$9 ] [57] (byte~) initplottables::$9 ← > (byte*) initplottables::yoffs#2 [ initplottables::y#2 initplottables::yoffs#2 initplottables::$9 ]
[57] *((const byte[]) plot_yhi#0 + (byte) initplottables::y#2) ← (byte~) initplottables::$9 [ initplottables::y#2 initplottables::yoffs#2 ] [58] *((const byte[]) plot_yhi#0 + (byte) initplottables::y#2) ← (byte~) initplottables::$9 [ initplottables::y#2 initplottables::yoffs#2 ]
[58] (byte~) initplottables::$10 ← (byte) initplottables::y#2 & (byte) 7 [ initplottables::y#2 initplottables::yoffs#2 initplottables::$10 ] [59] (byte~) initplottables::$10 ← (byte) initplottables::y#2 & (byte) 7 [ initplottables::y#2 initplottables::yoffs#2 initplottables::$10 ]
[59] if((byte~) initplottables::$10!=(byte) 7) goto initplottables::@4 [ initplottables::y#2 initplottables::yoffs#2 ] [60] if((byte~) initplottables::$10!=(byte) 7) goto initplottables::@4 [ initplottables::y#2 initplottables::yoffs#2 ]
to:initplottables::@7 to:initplottables::@7
initplottables::@7: scope:[initplottables] from initplottables::@3 initplottables::@7: scope:[initplottables] from initplottables::@3
[60] (byte*) initplottables::yoffs#1 ← (byte*) initplottables::yoffs#2 + (word) 320 [ initplottables::y#2 initplottables::yoffs#1 ] [61] (byte*) initplottables::yoffs#1 ← (byte*) initplottables::yoffs#2 + (word) 320 [ initplottables::y#2 initplottables::yoffs#1 ]
to:initplottables::@4 to:initplottables::@4
initplottables::@4: scope:[initplottables] from initplottables::@3 initplottables::@7 initplottables::@4: scope:[initplottables] from initplottables::@3 initplottables::@7
[61] (byte*) initplottables::yoffs#4 ← phi( initplottables::@3/(byte*) initplottables::yoffs#2 initplottables::@7/(byte*) initplottables::yoffs#1 ) [ initplottables::y#2 initplottables::yoffs#4 ] [62] (byte*) initplottables::yoffs#4 ← phi( initplottables::@3/(byte*) initplottables::yoffs#2 initplottables::@7/(byte*) initplottables::yoffs#1 ) [ initplottables::y#2 initplottables::yoffs#4 ]
[62] (byte) initplottables::y#1 ← ++ (byte) initplottables::y#2 [ initplottables::y#1 initplottables::yoffs#4 ] [63] (byte) initplottables::y#1 ← ++ (byte) initplottables::y#2 [ initplottables::y#1 initplottables::yoffs#4 ]
[63] if((byte) initplottables::y#1!=(byte) 0) goto initplottables::@3 [ initplottables::y#1 initplottables::yoffs#4 ] [64] if((byte) initplottables::y#1!=(byte) 0) goto initplottables::@3 [ initplottables::y#1 initplottables::yoffs#4 ]
to:initplottables::@return to:initplottables::@return
initplottables::@return: scope:[initplottables] from initplottables::@4 initplottables::@return: scope:[initplottables] from initplottables::@4
[64] return [ ] [65] return [ ]
to:@return to:@return
initplottables::@10: scope:[initplottables] from initplottables::@1 initplottables::@10: scope:[initplottables] from initplottables::@1
to:initplottables::@2 to:initplottables::@2
initscreen: scope:[initscreen] from main initscreen: scope:[initscreen] from main
[65] phi() [ ] [66] phi() [ ]
to:initscreen::@1 to:initscreen::@1
initscreen::@1: scope:[initscreen] from initscreen initscreen::@1 initscreen::@1: scope:[initscreen] from initscreen initscreen::@1
[66] (byte*) initscreen::b#2 ← phi( initscreen/(const byte*) BITMAP#0 initscreen::@1/(byte*) initscreen::b#1 ) [ initscreen::b#2 ] [67] (byte*) initscreen::b#2 ← phi( initscreen/(const byte*) BITMAP#0 initscreen::@1/(byte*) initscreen::b#1 ) [ initscreen::b#2 ]
[67] *((byte*) initscreen::b#2) ← (byte) 0 [ initscreen::b#2 ] [68] *((byte*) initscreen::b#2) ← (byte) 0 [ initscreen::b#2 ]
[68] (byte*) initscreen::b#1 ← ++ (byte*) initscreen::b#2 [ initscreen::b#1 ] [69] (byte*) initscreen::b#1 ← ++ (byte*) initscreen::b#2 [ initscreen::b#1 ]
[69] if((byte*) initscreen::b#1!=(const byte*) BITMAP#0+(word) 8192) goto initscreen::@1 [ initscreen::b#1 ] [70] if((byte*) initscreen::b#1!=(const byte*) BITMAP#0+(word) 8192) goto initscreen::@1 [ initscreen::b#1 ]
to:initscreen::@2 to:initscreen::@2
initscreen::@2: scope:[initscreen] from initscreen::@1 initscreen::@2 initscreen::@2: scope:[initscreen] from initscreen::@1 initscreen::@2
[70] (byte*) initscreen::c#2 ← phi( initscreen::@2/(byte*) initscreen::c#1 initscreen::@1/(const byte*) SCREEN#0 ) [ initscreen::c#2 ] [71] (byte*) initscreen::c#2 ← phi( initscreen::@2/(byte*) initscreen::c#1 initscreen::@1/(const byte*) SCREEN#0 ) [ initscreen::c#2 ]
[71] *((byte*) initscreen::c#2) ← (byte) 20 [ initscreen::c#2 ] [72] *((byte*) initscreen::c#2) ← (byte) 20 [ initscreen::c#2 ]
[72] (byte*) initscreen::c#1 ← ++ (byte*) initscreen::c#2 [ initscreen::c#1 ] [73] (byte*) initscreen::c#1 ← ++ (byte*) initscreen::c#2 [ initscreen::c#1 ]
[73] if((byte*) initscreen::c#1!=(const byte*) SCREEN#0+(word) 1024) goto initscreen::@2 [ initscreen::c#1 ] [74] if((byte*) initscreen::c#1!=(const byte*) SCREEN#0+(word) 1024) goto initscreen::@2 [ initscreen::c#1 ]
to:initscreen::@return to:initscreen::@return
initscreen::@return: scope:[initscreen] from initscreen::@2 initscreen::@return: scope:[initscreen] from initscreen::@2
[74] return [ ] [75] return [ ]
to:@return to:@return

File diff suppressed because it is too large Load Diff

View File

@ -109,23 +109,26 @@
(label) main::@3 (label) main::@3
(label) main::@return (label) main::@return
(void()) plot((byte) plot::x , (byte) plot::y) (void()) plot((byte) plot::x , (byte) plot::y)
(byte~) plot::$0 $0 zp ZP_BYTE:10 2.0 (byte~) plot::$0 reg byte a 4.0
(byte~) plot::$1 reg byte a 4.0 (byte~) plot::$1 reg byte a 4.0
(byte~) plot::$2 reg byte a 4.0 (byte~) plot::$2 reg byte a 4.0
(byte~) plot::$3 $3 zp ZP_BYTE:10 2.0 (byte~) plot::$3 reg byte a 4.0
(byte~) plot::$4 reg byte a 4.0 (byte~) plot::$5 $5 zp ZP_BYTE:12 2.0
(byte~) plot::$5 reg byte a 4.0 (byte~) plot::$6 reg byte a 4.0
(byte~) plot::$6 $6 zp ZP_BYTE:10 2.0
(byte~) plot::$7 reg byte a 4.0 (byte~) plot::$7 reg byte a 4.0
(byte~) plot::$8 reg byte a 4.0
(label) plot::@return (label) plot::@return
(byte*) plot::plotter (byte*) plot::plotter
(byte*) plot::plotter#1 plotter zp ZP_PTR_BYTE:6 1.0 (byte*) plot::plotter#0 plotter zp ZP_PTR_BYTE:6 1.5
(byte*) plot::plotter#2 plotter zp ZP_PTR_BYTE:6 1.5 (byte*) plot::plotter_x
(byte*) plot::plotter_x#1 plotter_x zp ZP_PTR_BYTE:6 2.0
(byte*) plot::plotter_x#2 plotter_x zp ZP_PTR_BYTE:6 0.8
(byte*) plot::plotter_y
(byte*) plot::plotter_y#1 plotter_y zp ZP_PTR_BYTE:10 2.0
(byte*) plot::plotter_y#2 plotter_y zp ZP_PTR_BYTE:10 4.0
(byte) plot::x (byte) plot::x
(byte) plot::x#0 reg byte x 1.5454545454545456 (byte) plot::x#0 reg byte x 1.4166666666666667
(byte) plot::y (byte) plot::y
(byte) plot::y#0 reg byte y 2.5 (byte) plot::y#0 reg byte y 2.142857142857143
(byte[]) plot_bit (byte[]) plot_bit
(const byte[]) plot_bit#0 plot_bit = (word) 5120 (const byte[]) plot_bit#0 plot_bit = (word) 5120
(byte[]) plot_xhi (byte[]) plot_xhi
@ -145,19 +148,20 @@ zp ZP_BYTE:5 [ line::e#3 line::e#0 line::e#6 line::e#2 line::e#1 ]
reg byte x [ initplottables::x#2 initplottables::x#1 ] reg byte x [ initplottables::x#2 initplottables::x#1 ]
reg byte y [ initplottables::bit#3 initplottables::bit#4 initplottables::bit#1 ] reg byte y [ initplottables::bit#3 initplottables::bit#4 initplottables::bit#1 ]
reg byte x [ initplottables::y#2 initplottables::y#1 ] reg byte x [ initplottables::y#2 initplottables::y#1 ]
zp ZP_PTR_BYTE:6 [ initplottables::yoffs#2 initplottables::yoffs#4 initplottables::yoffs#1 initscreen::b#2 initscreen::b#1 initscreen::c#2 initscreen::c#1 plot::plotter#1 plot::plotter#2 ] zp ZP_PTR_BYTE:6 [ initplottables::yoffs#2 initplottables::yoffs#4 initplottables::yoffs#1 initscreen::b#2 initscreen::b#1 initscreen::c#2 initscreen::c#1 plot::plotter_x#1 plot::plotter_x#2 plot::plotter#0 ]
zp ZP_BYTE:8 [ line::xd#0 ] zp ZP_BYTE:8 [ line::xd#0 ]
zp ZP_BYTE:9 [ line::yd#0 ] zp ZP_BYTE:9 [ line::yd#0 ]
reg byte x [ plot::x#0 ] reg byte x [ plot::x#0 ]
reg byte y [ plot::y#0 ] reg byte y [ plot::y#0 ]
reg byte a [ line::$10 ] reg byte a [ line::$10 ]
zp ZP_BYTE:10 [ plot::$0 plot::$3 plot::$6 ] reg byte a [ plot::$0 ]
reg byte a [ plot::$1 ] reg byte a [ plot::$1 ]
reg byte a [ plot::$2 ] reg byte a [ plot::$2 ]
reg byte a [ plot::$4 ] zp ZP_PTR_BYTE:10 [ plot::plotter_y#1 plot::plotter_y#2 ]
reg byte a [ plot::$5 ] reg byte a [ plot::$3 ]
zp ZP_BYTE:12 [ plot::$5 ]
reg byte a [ plot::$6 ]
reg byte a [ plot::$7 ] reg byte a [ plot::$7 ]
reg byte a [ plot::$8 ]
reg byte a [ initplottables::$0 ] reg byte a [ initplottables::$0 ]
reg byte a [ initplottables::$7 ] reg byte a [ initplottables::$7 ]
reg byte a [ initplottables::$8 ] reg byte a [ initplottables::$8 ]