1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-12-20 23:30:43 +00:00

Animated voronoi. Added fragments as needed.

This commit is contained in:
jespergravgaard 2017-08-07 21:23:35 +02:00
parent 772a2a3761
commit 3eaed1c946
35 changed files with 4331 additions and 1392 deletions

View File

@ -84,17 +84,17 @@ public class AsmFragmentManager {
} }
if(signature.contains("_lt_xby_then_")) { if(signature.contains("_lt_xby_then_")) {
int pos = signature.indexOf("_lt_xby_then_"); int pos = signature.indexOf("_lt_xby_then_");
String subSignature = "xby_gte_"+signature.substring(0, pos)+"_then_"+signature.substring(pos+13); String subSignature = "xby_ge_"+signature.substring(0, pos)+"_then_"+signature.substring(pos+13);
return loadOrSynthesizeFragment(subSignature); return loadOrSynthesizeFragment(subSignature);
} }
if(signature.contains("_lt_yby_then_")) { if(signature.contains("_lt_yby_then_")) {
int pos = signature.indexOf("_lt_yby_then_"); int pos = signature.indexOf("_lt_yby_then_");
String subSignature = "yby_gte_"+signature.substring(0, pos)+"_then_"+signature.substring(pos+13); String subSignature = "yby_ge_"+signature.substring(0, pos)+"_then_"+signature.substring(pos+13);
return loadOrSynthesizeFragment(subSignature); return loadOrSynthesizeFragment(subSignature);
} }
if(signature.contains("_lt_aby_then_")) { if(signature.contains("_lt_aby_then_")) {
int pos = signature.indexOf("_lt_aby_then_"); int pos = signature.indexOf("_lt_aby_then_");
String subSignature = "aby_gte_"+signature.substring(0, pos)+"_then_"+signature.substring(pos+13); String subSignature = "aby_ge_"+signature.substring(0, pos)+"_then_"+signature.substring(pos+13);
return loadOrSynthesizeFragment(subSignature); return loadOrSynthesizeFragment(subSignature);
} }

View File

@ -0,0 +1,2 @@
sec
sbc #1

View File

@ -0,0 +1,3 @@
txa
sec
sbc #1

View File

@ -0,0 +1,3 @@
txa
clc
adc #1

View File

@ -0,0 +1,3 @@
tya
sec
sbc #1

View File

@ -0,0 +1,3 @@
tya
clc
adc #1

View File

@ -0,0 +1,3 @@
lda {zpby1}
sec
sbc #1

View File

@ -0,0 +1,2 @@
cmp #{coby1}
beq {la1}

View File

@ -0,0 +1,2 @@
txa
dex

View File

@ -0,0 +1,3 @@
tya
tax
inx

View File

@ -0,0 +1,2 @@
ldx {zpby1}
dex

View File

@ -0,0 +1,2 @@
cpx #{coby1}
beq {la1}

View File

@ -0,0 +1,2 @@
tya
dey

View File

@ -0,0 +1,3 @@
txa
tay
iny

View File

@ -0,0 +1,2 @@
ldy {zpby1}
dey

View File

@ -0,0 +1,2 @@
cpy #{coby1}
beq {la1}

View File

@ -0,0 +1,2 @@
sta {zpby1}
dec {zpby1}

View File

@ -0,0 +1,2 @@
sty {zpby1}
dec {zpby1}

View File

@ -0,0 +1,2 @@
sty {zpby1}
inc {zpby1}

View File

@ -0,0 +1,3 @@
lda {zpby1}
cmp #{coby1}
beq {la1}

View File

@ -0,0 +1,3 @@
lda {zpby1}
cmp #{coby1}
bcs {la1}

View File

@ -74,14 +74,14 @@ public class Pass3RegisterUpliftCombinations extends Pass2Base {
} }
} }
} }
// Save the best combination in the equivalence class if(bestCombination!=null) {
bestCombination.store(getProgram().getLiveRangeEquivalenceClassSet()); // Save the best combination in the equivalence class
getLog().append("Uplifting [" + upliftScope.getScopeRef() + "] best " + bestScore + " combination " + bestCombination.toString()); bestCombination.store(getProgram().getLiveRangeEquivalenceClassSet());
getLog().append("Uplifting [" + upliftScope.getScopeRef() + "] best " + bestScore + " combination " + bestCombination.toString());
}
if(combinationIterator.hasNext()) { if(combinationIterator.hasNext()) {
getLog().append("Limited combination testing to "+countCombinations+" combinations of "+combinationIterator.getNumIterations()+" possible."); getLog().append("Limited combination testing to "+countCombinations+" combinations of "+combinationIterator.getNumIterations()+" possible.");
} }
} }
if (unknownFragments.size() > 0) { if (unknownFragments.size() > 0) {

View File

@ -52,9 +52,84 @@ addpoint_from_B7:
main__B1: main__B1:
jsr render jsr render
main__B9: main__B9:
jsr animate
main__B10:
jmp main__B1 jmp main__B1
main__Breturn: main__Breturn:
rts rts
animate:
lda 4096
clc
adc #1
sta 4096
lda 4096
cmp #40
beq animate__B1
animate__B2:
lda 4352
clc
adc #1
sta 4352
lda 4352
cmp #25
beq animate__B3
animate__B4:
ldx 4097
dex
stx 4097
lda 4097
cmp #255
beq animate__B5
animate__B6:
lda 4354
clc
adc #1
sta 4354
lda 4354
cmp #25
beq animate__B7
animate__B8:
ldx 4355
dex
stx 4355
lda 4355
cmp #255
beq animate__B9
animate__Breturn:
rts
animate__B9:
lda #25
sta 4355
lda 4099
clc
adc #7
sta 4099
lda 4099
cmp #40
bcs animate__B11
jmp animate__Breturn
animate__B11:
lda 4099
sec
sbc #40
sta 4099
jmp animate__Breturn
animate__B7:
lda #0
sta 4354
jmp animate__B8
animate__B5:
lda #40
sta 4097
jmp animate__B6
animate__B3:
lda #0
sta 4352
jmp animate__B4
animate__B1:
lda #0
sta 4096
jmp animate__B2
render: render:
render__B1_from_render: render__B1_from_render:
lda #<1024 lda #<1024

View File

@ -20,105 +20,171 @@ main::@6: from main::@5
main::@7: from main::@6 main::@7: from main::@6
[6] call addpoint param-assignment [ findcol::return#0 ] [6] call addpoint param-assignment [ findcol::return#0 ]
to:main::@1 to:main::@1
main::@1: from main::@7 main::@9 main::@1: from main::@10 main::@7
[7] call render param-assignment [ findcol::return#0 ] [7] call render param-assignment [ findcol::return#0 ]
to:main::@9 to:main::@9
main::@9: from main::@1 main::@9: from main::@1
[8] if(true) goto main::@1 [ findcol::return#0 ] [8] call animate param-assignment [ findcol::return#0 ]
to:main::@10
main::@10: from main::@9
[9] if(true) goto main::@1 [ findcol::return#0 ]
to:main::@return to:main::@return
main::@return: from main::@9 main::@return: from main::@10
[9] return [ findcol::return#0 ] [10] return [ findcol::return#0 ]
to:@RETURN to:@RETURN
animate: from main::@9
[11] (byte~) animate::$0 ← * (word) 4096 [ animate::$0 findcol::return#0 ]
[12] (byte~) animate::$1 ← (byte~) animate::$0 + (byte) 1 [ animate::$1 findcol::return#0 ]
[13] *((word) 4096) ← (byte~) animate::$1 [ findcol::return#0 ]
[14] (byte~) animate::$2 ← * (word) 4096 [ animate::$2 findcol::return#0 ]
[15] if((byte~) animate::$2==(byte) 40) goto animate::@1 [ findcol::return#0 ]
to:animate::@2
animate::@2: from animate animate::@1
[16] (byte~) animate::$4 ← * (word) 4352 [ animate::$4 findcol::return#0 ]
[17] (byte~) animate::$5 ← (byte~) animate::$4 + (byte) 1 [ animate::$5 findcol::return#0 ]
[18] *((word) 4352) ← (byte~) animate::$5 [ findcol::return#0 ]
[19] (byte~) animate::$6 ← * (word) 4352 [ animate::$6 findcol::return#0 ]
[20] if((byte~) animate::$6==(byte) 25) goto animate::@3 [ findcol::return#0 ]
to:animate::@4
animate::@4: from animate::@2 animate::@3
[21] (byte~) animate::$8 ← * (word) 4097 [ animate::$8 findcol::return#0 ]
[22] (byte~) animate::$9 ← (byte~) animate::$8 - (byte) 1 [ animate::$9 findcol::return#0 ]
[23] *((word) 4097) ← (byte~) animate::$9 [ findcol::return#0 ]
[24] (byte~) animate::$10 ← * (word) 4097 [ animate::$10 findcol::return#0 ]
[25] if((byte~) animate::$10==(byte) 255) goto animate::@5 [ findcol::return#0 ]
to:animate::@6
animate::@6: from animate::@4 animate::@5
[26] (byte~) animate::$12 ← * (word) 4354 [ animate::$12 findcol::return#0 ]
[27] (byte~) animate::$13 ← (byte~) animate::$12 + (byte) 1 [ animate::$13 findcol::return#0 ]
[28] *((word) 4354) ← (byte~) animate::$13 [ findcol::return#0 ]
[29] (byte~) animate::$14 ← * (word) 4354 [ animate::$14 findcol::return#0 ]
[30] if((byte~) animate::$14==(byte) 25) goto animate::@7 [ findcol::return#0 ]
to:animate::@8
animate::@8: from animate::@6 animate::@7
[31] (byte~) animate::$16 ← * (word) 4355 [ animate::$16 findcol::return#0 ]
[32] (byte~) animate::$17 ← (byte~) animate::$16 - (byte) 1 [ animate::$17 findcol::return#0 ]
[33] *((word) 4355) ← (byte~) animate::$17 [ findcol::return#0 ]
[34] (byte~) animate::$18 ← * (word) 4355 [ animate::$18 findcol::return#0 ]
[35] if((byte~) animate::$18==(byte) 255) goto animate::@9 [ findcol::return#0 ]
to:animate::@return
animate::@return: from animate::@11 animate::@8 animate::@9
[36] return [ findcol::return#0 ]
to:@RETURN
animate::@9: from animate::@8
[37] *((word) 4355) ← (byte) 25 [ findcol::return#0 ]
[38] (byte~) animate::$20 ← * (word) 4099 [ animate::$20 findcol::return#0 ]
[39] (byte~) animate::$21 ← (byte~) animate::$20 + (byte) 7 [ animate::$21 findcol::return#0 ]
[40] *((word) 4099) ← (byte~) animate::$21 [ findcol::return#0 ]
[41] (byte~) animate::$22 ← * (word) 4099 [ animate::$22 findcol::return#0 ]
[42] if((byte~) animate::$22>=(byte) 40) goto animate::@11 [ findcol::return#0 ]
to:animate::@return
animate::@11: from animate::@9
[43] (byte~) animate::$24 ← * (word) 4099 [ animate::$24 findcol::return#0 ]
[44] (byte~) animate::$25 ← (byte~) animate::$24 - (byte) 40 [ animate::$25 findcol::return#0 ]
[45] *((word) 4099) ← (byte~) animate::$25 [ findcol::return#0 ]
to:animate::@return
animate::@7: from animate::@6
[46] *((word) 4354) ← (byte) 0 [ findcol::return#0 ]
to:animate::@8
animate::@5: from animate::@4
[47] *((word) 4097) ← (byte) 40 [ findcol::return#0 ]
to:animate::@6
animate::@3: from animate::@2
[48] *((word) 4352) ← (byte) 0 [ findcol::return#0 ]
to:animate::@4
animate::@1: from animate
[49] *((word) 4096) ← (byte) 0 [ findcol::return#0 ]
to:animate::@2
render: from main::@1 render: from main::@1
to:render::@1 to:render::@1
render::@1: from render render::@3 render::@1: from render render::@3
[10] (byte*) render::chrline#2 ← phi( render/(word) 1024 render::@3/(byte*) render::chrline#1 ) [ render::y#2 findcol::return#0 render::colline#2 render::chrline#2 ] [50] (byte*) render::chrline#2 ← phi( render/(word) 1024 render::@3/(byte*) render::chrline#1 ) [ render::y#2 findcol::return#0 render::colline#2 render::chrline#2 ]
[10] (byte*) render::colline#2 ← phi( render/(word) 55296 render::@3/(byte*) render::colline#1 ) [ render::y#2 findcol::return#0 render::colline#2 render::chrline#2 ] [50] (byte*) render::colline#2 ← phi( render/(word) 55296 render::@3/(byte*) render::colline#1 ) [ render::y#2 findcol::return#0 render::colline#2 render::chrline#2 ]
[10] (byte) render::y#2 ← phi( render/(byte) 0 render::@3/(byte) render::y#1 ) [ render::y#2 findcol::return#0 render::colline#2 render::chrline#2 ] [50] (byte) render::y#2 ← phi( render/(byte) 0 render::@3/(byte) render::y#1 ) [ render::y#2 findcol::return#0 render::colline#2 render::chrline#2 ]
to:render::@2 to:render::@2
render::@2: from render::@1 render::@5 render::@2: from render::@1 render::@5
[11] (byte) render::x#2 ← phi( render::@1/(byte) 0 render::@5/(byte) render::x#1 ) [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 ] [51] (byte) render::x#2 ← phi( render::@1/(byte) 0 render::@5/(byte) render::x#1 ) [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 ]
[12] (byte) findcol::x#0 ← (byte) render::x#2 [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 findcol::x#0 ] [52] (byte) findcol::x#0 ← (byte) render::x#2 [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 findcol::x#0 ]
[13] (byte) findcol::y#0 ← (byte) render::y#2 [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 findcol::x#0 findcol::y#0 ] [53] (byte) findcol::y#0 ← (byte) render::y#2 [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 findcol::x#0 findcol::y#0 ]
[14] call findcol param-assignment [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 findcol::x#0 findcol::y#0 ] [54] call findcol param-assignment [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 findcol::x#0 findcol::y#0 ]
to:render::@5 to:render::@5
render::@5: from render::@2 render::@5: from render::@2
[15] (byte) render::col#0 ← (byte) findcol::return#0 [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::col#0 render::chrline#2 ] [55] (byte) render::col#0 ← (byte) findcol::return#0 [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::col#0 render::chrline#2 ]
[16] *((byte*) render::colline#2 + (byte) render::x#2) ← (byte) render::col#0 [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 ] [56] *((byte*) render::colline#2 + (byte) render::x#2) ← (byte) render::col#0 [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 ]
[17] *((byte*) render::chrline#2 + (byte) render::x#2) ← (byte) 230 [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 ] [57] *((byte*) render::chrline#2 + (byte) render::x#2) ← (byte) 230 [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 ]
[18] (byte) render::x#1 ← ++ (byte) render::x#2 [ render::x#1 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 ] [58] (byte) render::x#1 ← ++ (byte) render::x#2 [ render::x#1 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 ]
[19] if((byte) render::x#1<(byte) 40) goto render::@2 [ render::x#1 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 ] [59] if((byte) render::x#1<(byte) 40) goto render::@2 [ render::x#1 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 ]
to:render::@3 to:render::@3
render::@3: from render::@5 render::@3: from render::@5
[20] (byte*) render::chrline#1 ← (byte*) render::chrline#2 + (byte) 40 [ render::chrline#1 render::y#2 findcol::return#0 render::colline#2 ] [60] (byte*) render::chrline#1 ← (byte*) render::chrline#2 + (byte) 40 [ render::chrline#1 render::y#2 findcol::return#0 render::colline#2 ]
[21] (byte*) render::colline#1 ← (byte*) render::colline#2 + (byte) 40 [ render::colline#1 render::chrline#1 render::y#2 findcol::return#0 ] [61] (byte*) render::colline#1 ← (byte*) render::colline#2 + (byte) 40 [ render::colline#1 render::chrline#1 render::y#2 findcol::return#0 ]
[22] (byte) render::y#1 ← ++ (byte) render::y#2 [ render::y#1 render::colline#1 render::chrline#1 findcol::return#0 ] [62] (byte) render::y#1 ← ++ (byte) render::y#2 [ render::y#1 render::colline#1 render::chrline#1 findcol::return#0 ]
[23] if((byte) render::y#1<(byte) 25) goto render::@1 [ render::y#1 render::colline#1 render::chrline#1 findcol::return#0 ] [63] if((byte) render::y#1<(byte) 25) goto render::@1 [ render::y#1 render::colline#1 render::chrline#1 findcol::return#0 ]
to:render::@return to:render::@return
render::@return: from render::@3 render::@return: from render::@3
[24] return [ findcol::return#0 ] [64] return [ findcol::return#0 ]
to:@RETURN to:@RETURN
findcol: from render::@2 findcol: from render::@2
to:findcol::@1 to:findcol::@1
findcol::@1: from findcol findcol::@13 findcol::@1: from findcol findcol::@13
[25] (byte) findcol::mincol#11 ← phi( findcol/(byte) 0 findcol::@13/(byte) findcol::mincol#2 ) [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::mindiff#10 findcol::mincol#11 ] [65] (byte) findcol::mincol#11 ← phi( findcol/(byte) 0 findcol::@13/(byte) findcol::mincol#2 ) [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::mindiff#10 findcol::mincol#11 ]
[25] (byte) findcol::mindiff#10 ← phi( findcol/(byte) 255 findcol::@13/(byte) findcol::mindiff#11 ) [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::mindiff#10 findcol::mincol#11 ] [65] (byte) findcol::mindiff#10 ← phi( findcol/(byte) 255 findcol::@13/(byte) findcol::mindiff#11 ) [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::mindiff#10 findcol::mincol#11 ]
[25] (byte) findcol::i#12 ← phi( findcol/(byte) 0 findcol::@13/(byte) findcol::i#1 ) [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::mindiff#10 findcol::mincol#11 ] [65] (byte) findcol::i#12 ← phi( findcol/(byte) 0 findcol::@13/(byte) findcol::i#1 ) [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::mindiff#10 findcol::mincol#11 ]
[26] (byte) findcol::xp#0 ← (word) 4096 *idx (byte) findcol::i#12 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::xp#0 findcol::y#0 findcol::mindiff#10 findcol::mincol#11 ] [66] (byte) findcol::xp#0 ← (word) 4096 *idx (byte) findcol::i#12 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::xp#0 findcol::y#0 findcol::mindiff#10 findcol::mincol#11 ]
[27] (byte) findcol::yp#0 ← (word) 4352 *idx (byte) findcol::i#12 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::xp#0 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 ] [67] (byte) findcol::yp#0 ← (word) 4352 *idx (byte) findcol::i#12 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::xp#0 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 ]
[28] if((byte) findcol::x#0==(byte) findcol::xp#0) goto findcol::@2 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::xp#0 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 ] [68] if((byte) findcol::x#0==(byte) findcol::xp#0) goto findcol::@2 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::xp#0 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 ]
to:findcol::@3 to:findcol::@3
findcol::@3: from findcol::@1 findcol::@2 findcol::@3: from findcol::@1 findcol::@2
[29] if((byte) findcol::x#0<(byte) findcol::xp#0) goto findcol::@6 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::xp#0 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 ] [69] if((byte) findcol::x#0<(byte) findcol::xp#0) goto findcol::@6 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::xp#0 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 ]
to:findcol::@7 to:findcol::@7
findcol::@7: from findcol::@3 findcol::@7: from findcol::@3
[30] (byte) findcol::diff#1 ← (byte) findcol::x#0 - (byte) findcol::xp#0 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::diff#1 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 ] [70] (byte) findcol::diff#1 ← (byte) findcol::x#0 - (byte) findcol::xp#0 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::diff#1 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 ]
to:findcol::@8 to:findcol::@8
findcol::@8: from findcol::@6 findcol::@7 findcol::@8: from findcol::@6 findcol::@7
[31] (byte) findcol::diff#4 ← phi( findcol::@6/(byte) findcol::diff#0 findcol::@7/(byte) findcol::diff#1 ) [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::yp#0 findcol::diff#4 findcol::mindiff#10 findcol::mincol#11 ] [71] (byte) findcol::diff#4 ← phi( findcol::@6/(byte) findcol::diff#0 findcol::@7/(byte) findcol::diff#1 ) [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::yp#0 findcol::diff#4 findcol::mindiff#10 findcol::mincol#11 ]
[32] if((byte) findcol::y#0<(byte) findcol::yp#0) goto findcol::@9 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::yp#0 findcol::diff#4 findcol::mindiff#10 findcol::mincol#11 ] [72] if((byte) findcol::y#0<(byte) findcol::yp#0) goto findcol::@9 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::yp#0 findcol::diff#4 findcol::mindiff#10 findcol::mincol#11 ]
to:findcol::@10 to:findcol::@10
findcol::@10: from findcol::@8 findcol::@10: from findcol::@8
[33] (byte~) findcol::$10 ← (byte) findcol::y#0 - (byte) findcol::yp#0 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#4 findcol::$10 findcol::mindiff#10 findcol::mincol#11 ] [73] (byte~) findcol::$10 ← (byte) findcol::y#0 - (byte) findcol::yp#0 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#4 findcol::$10 findcol::mindiff#10 findcol::mincol#11 ]
[34] (byte) findcol::diff#3 ← (byte) findcol::diff#4 + (byte~) findcol::$10 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#3 findcol::mindiff#10 findcol::mincol#11 ] [74] (byte) findcol::diff#3 ← (byte) findcol::diff#4 + (byte~) findcol::$10 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#3 findcol::mindiff#10 findcol::mincol#11 ]
to:findcol::@11 to:findcol::@11
findcol::@11: from findcol::@10 findcol::@9 findcol::@11: from findcol::@10 findcol::@9
[35] (byte) findcol::diff#6 ← phi( findcol::@10/(byte) findcol::diff#3 findcol::@9/(byte) findcol::diff#2 ) [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#6 findcol::mindiff#10 findcol::mincol#11 ] [75] (byte) findcol::diff#6 ← phi( findcol::@10/(byte) findcol::diff#3 findcol::@9/(byte) findcol::diff#2 ) [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#6 findcol::mindiff#10 findcol::mincol#11 ]
[36] if((byte) findcol::diff#6<(byte) findcol::mindiff#10) goto findcol::@12 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#6 findcol::mindiff#10 findcol::mincol#11 ] [76] if((byte) findcol::diff#6<(byte) findcol::mindiff#10) goto findcol::@12 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#6 findcol::mindiff#10 findcol::mincol#11 ]
to:findcol::@13 to:findcol::@13
findcol::@13: from findcol::@11 findcol::@12 findcol::@13: from findcol::@11 findcol::@12
[37] (byte) findcol::mindiff#11 ← phi( findcol::@11/(byte) findcol::mindiff#10 findcol::@12/(byte~) findcol::diff#13 ) [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::mindiff#11 findcol::mincol#2 findcol::i#12 findcol::x#0 findcol::y#0 ] [77] (byte) findcol::mindiff#11 ← phi( findcol::@11/(byte) findcol::mindiff#10 findcol::@12/(byte~) findcol::diff#13 ) [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::mindiff#11 findcol::mincol#2 findcol::i#12 findcol::x#0 findcol::y#0 ]
[37] (byte) findcol::mincol#2 ← phi( findcol::@11/(byte) findcol::mincol#11 findcol::@12/(byte) findcol::mincol#1 ) [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::mindiff#11 findcol::mincol#2 findcol::i#12 findcol::x#0 findcol::y#0 ] [77] (byte) findcol::mincol#2 ← phi( findcol::@11/(byte) findcol::mincol#11 findcol::@12/(byte) findcol::mincol#1 ) [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::mindiff#11 findcol::mincol#2 findcol::i#12 findcol::x#0 findcol::y#0 ]
[38] (byte) findcol::i#1 ← ++ (byte) findcol::i#12 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#1 findcol::mindiff#11 findcol::mincol#2 findcol::x#0 findcol::y#0 ] [78] (byte) findcol::i#1 ← ++ (byte) findcol::i#12 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#1 findcol::mindiff#11 findcol::mincol#2 findcol::x#0 findcol::y#0 ]
[39] if((byte) findcol::i#1<(byte) 6) goto findcol::@1 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#1 findcol::mindiff#11 findcol::mincol#2 findcol::x#0 findcol::y#0 ] [79] if((byte) findcol::i#1<(byte) 6) goto findcol::@1 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#1 findcol::mindiff#11 findcol::mincol#2 findcol::x#0 findcol::y#0 ]
to:findcol::@return to:findcol::@return
findcol::@return: from findcol::@13 findcol::@2 findcol::@return: from findcol::@13 findcol::@2
[40] (byte) findcol::return#0 ← phi( findcol::@13/(byte) findcol::mincol#2 findcol::@2/(byte) 0 ) [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 findcol::x#0 findcol::y#0 ] [80] (byte) findcol::return#0 ← phi( findcol::@13/(byte) findcol::mincol#2 findcol::@2/(byte) 0 ) [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 findcol::x#0 findcol::y#0 ]
[41] return [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 findcol::x#0 findcol::y#0 ] [81] return [ render::x#2 render::y#2 findcol::return#0 render::colline#2 render::chrline#2 findcol::x#0 findcol::y#0 ]
to:@RETURN to:@RETURN
findcol::@12: from findcol::@11 findcol::@12: from findcol::@11
[42] (byte) findcol::mincol#1 ← (word) 4608 *idx (byte) findcol::i#12 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#6 findcol::mincol#1 ] [82] (byte) findcol::mincol#1 ← (word) 4608 *idx (byte) findcol::i#12 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#6 findcol::mincol#1 ]
[43] (byte~) findcol::diff#13 ← (byte) findcol::diff#6 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::mincol#1 findcol::diff#13 ] [83] (byte~) findcol::diff#13 ← (byte) findcol::diff#6 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::mincol#1 findcol::diff#13 ]
to:findcol::@13 to:findcol::@13
findcol::@9: from findcol::@8 findcol::@9: from findcol::@8
[44] (byte~) findcol::$8 ← (byte) findcol::yp#0 - (byte) findcol::y#0 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#4 findcol::mindiff#10 findcol::mincol#11 findcol::$8 ] [84] (byte~) findcol::$8 ← (byte) findcol::yp#0 - (byte) findcol::y#0 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#4 findcol::mindiff#10 findcol::mincol#11 findcol::$8 ]
[45] (byte) findcol::diff#2 ← (byte) findcol::diff#4 + (byte~) findcol::$8 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#2 findcol::mindiff#10 findcol::mincol#11 ] [85] (byte) findcol::diff#2 ← (byte) findcol::diff#4 + (byte~) findcol::$8 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::y#0 findcol::diff#2 findcol::mindiff#10 findcol::mincol#11 ]
to:findcol::@11 to:findcol::@11
findcol::@6: from findcol::@3 findcol::@6: from findcol::@3
[46] (byte) findcol::diff#0 ← (byte) findcol::xp#0 - (byte) findcol::x#0 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::diff#0 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 ] [86] (byte) findcol::diff#0 ← (byte) findcol::xp#0 - (byte) findcol::x#0 [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::diff#0 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 ]
to:findcol::@8 to:findcol::@8
findcol::@2: from findcol::@1 findcol::@2: from findcol::@1
[47] if((byte) findcol::y#0==(byte) findcol::yp#0) goto findcol::@return [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::xp#0 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 ] [87] if((byte) findcol::y#0==(byte) findcol::yp#0) goto findcol::@return [ render::x#2 render::y#2 render::colline#2 render::chrline#2 findcol::i#12 findcol::x#0 findcol::xp#0 findcol::y#0 findcol::yp#0 findcol::mindiff#10 findcol::mincol#11 ]
to:findcol::@3 to:findcol::@3
addpoint: from main main::@3 main::@4 main::@5 main::@6 main::@7 addpoint: from main main::@3 main::@4 main::@5 main::@6 main::@7
[48] (byte) addpoint::c#6 ← phi( main/(byte) 1 main::@3/(byte) 2 main::@4/(byte) 3 main::@5/(byte) 4 main::@6/(byte) 5 main::@7/(byte) 7 ) [ findcol::return#0 addpoint::idx#6 addpoint::x#6 addpoint::y#6 addpoint::c#6 ] [88] (byte) addpoint::c#6 ← phi( main/(byte) 1 main::@3/(byte) 2 main::@4/(byte) 3 main::@5/(byte) 4 main::@6/(byte) 5 main::@7/(byte) 7 ) [ findcol::return#0 addpoint::idx#6 addpoint::x#6 addpoint::y#6 addpoint::c#6 ]
[48] (byte) addpoint::y#6 ← phi( main/(byte) 5 main::@3/(byte) 8 main::@4/(byte) 14 main::@5/(byte) 2 main::@6/(byte) 17 main::@7/(byte) 22 ) [ findcol::return#0 addpoint::idx#6 addpoint::x#6 addpoint::y#6 addpoint::c#6 ] [88] (byte) addpoint::y#6 ← phi( main/(byte) 5 main::@3/(byte) 8 main::@4/(byte) 14 main::@5/(byte) 2 main::@6/(byte) 17 main::@7/(byte) 22 ) [ findcol::return#0 addpoint::idx#6 addpoint::x#6 addpoint::y#6 addpoint::c#6 ]
[48] (byte) addpoint::idx#6 ← phi( main/(byte) 0 main::@3/(byte) 1 main::@4/(byte) 2 main::@5/(byte) 3 main::@6/(byte) 4 main::@7/(byte) 5 ) [ findcol::return#0 addpoint::idx#6 addpoint::x#6 addpoint::y#6 addpoint::c#6 ] [88] (byte) addpoint::idx#6 ← phi( main/(byte) 0 main::@3/(byte) 1 main::@4/(byte) 2 main::@5/(byte) 3 main::@6/(byte) 4 main::@7/(byte) 5 ) [ findcol::return#0 addpoint::idx#6 addpoint::x#6 addpoint::y#6 addpoint::c#6 ]
[48] (byte) addpoint::x#6 ← phi( main/(byte) 5 main::@3/(byte) 15 main::@4/(byte) 6 main::@5/(byte) 34 main::@6/(byte) 21 main::@7/(byte) 31 ) [ findcol::return#0 addpoint::idx#6 addpoint::x#6 addpoint::y#6 addpoint::c#6 ] [88] (byte) addpoint::x#6 ← phi( main/(byte) 5 main::@3/(byte) 15 main::@4/(byte) 6 main::@5/(byte) 34 main::@6/(byte) 21 main::@7/(byte) 31 ) [ findcol::return#0 addpoint::idx#6 addpoint::x#6 addpoint::y#6 addpoint::c#6 ]
[49] *((word) 4096 + (byte) addpoint::idx#6) ← (byte) addpoint::x#6 [ findcol::return#0 addpoint::idx#6 addpoint::y#6 addpoint::c#6 ] [89] *((word) 4096 + (byte) addpoint::idx#6) ← (byte) addpoint::x#6 [ findcol::return#0 addpoint::idx#6 addpoint::y#6 addpoint::c#6 ]
[50] *((word) 4352 + (byte) addpoint::idx#6) ← (byte) addpoint::y#6 [ findcol::return#0 addpoint::idx#6 addpoint::c#6 ] [90] *((word) 4352 + (byte) addpoint::idx#6) ← (byte) addpoint::y#6 [ findcol::return#0 addpoint::idx#6 addpoint::c#6 ]
[51] *((word) 4608 + (byte) addpoint::idx#6) ← (byte) addpoint::c#6 [ findcol::return#0 ] [91] *((word) 4608 + (byte) addpoint::idx#6) ← (byte) addpoint::c#6 [ findcol::return#0 ]
to:addpoint::@return to:addpoint::@return
addpoint::@return: from addpoint addpoint::@return: from addpoint
[52] return [ findcol::return#0 ] [92] return [ findcol::return#0 ]
to:@RETURN to:@RETURN

File diff suppressed because it is too large Load Diff

View File

@ -16,6 +16,38 @@
(byte) addpoint::x#6 reg byte a 2.0 (byte) addpoint::x#6 reg byte a 2.0
(byte) addpoint::y (byte) addpoint::y
(byte) addpoint::y#6 reg byte x 1.0 (byte) addpoint::y#6 reg byte x 1.0
(void()) animate()
(byte~) animate::$0 reg byte a 4.0
(byte~) animate::$1 reg byte a 4.0
(byte~) animate::$10 reg byte a 4.0
(byte~) animate::$12 reg byte a 4.0
(byte~) animate::$13 reg byte a 4.0
(byte~) animate::$14 reg byte a 4.0
(byte~) animate::$16 reg byte x 4.0
(byte~) animate::$17 reg byte x 4.0
(byte~) animate::$18 reg byte a 4.0
(byte~) animate::$2 reg byte a 4.0
(byte~) animate::$20 reg byte a 4.0
(byte~) animate::$21 reg byte a 4.0
(byte~) animate::$22 reg byte a 4.0
(byte~) animate::$24 reg byte a 4.0
(byte~) animate::$25 reg byte a 4.0
(byte~) animate::$4 reg byte a 4.0
(byte~) animate::$5 reg byte a 4.0
(byte~) animate::$6 reg byte a 4.0
(byte~) animate::$8 reg byte x 4.0
(byte~) animate::$9 reg byte x 4.0
(label) animate::@1
(label) animate::@11
(label) animate::@2
(label) animate::@3
(label) animate::@4
(label) animate::@5
(label) animate::@6
(label) animate::@7
(label) animate::@8
(label) animate::@9
(label) animate::@return
(byte()) findcol((byte) findcol::x , (byte) findcol::y) (byte()) findcol((byte) findcol::x , (byte) findcol::y)
(byte~) findcol::$10 reg byte a 20002.0 (byte~) findcol::$10 reg byte a 20002.0
(byte~) findcol::$8 reg byte a 20002.0 (byte~) findcol::$8 reg byte a 20002.0
@ -50,7 +82,7 @@
(byte) findcol::mindiff#10 zp byte:8 1875.1875 (byte) findcol::mindiff#10 zp byte:8 1875.1875
(byte) findcol::mindiff#11 zp byte:8 10001.0 (byte) findcol::mindiff#11 zp byte:8 10001.0
(byte) findcol::return (byte) findcol::return
(byte) findcol::return#0 zp byte:10 343.8125 (byte) findcol::return#0 zp byte:10 152.80555555555554
(byte) findcol::x (byte) findcol::x
(byte) findcol::x#0 zp byte:11 1577.1153846153845 (byte) findcol::x#0 zp byte:11 1577.1153846153845
(byte) findcol::xp (byte) findcol::xp
@ -61,6 +93,7 @@
(byte) findcol::yp#0 reg byte x 6250.625 (byte) findcol::yp#0 reg byte x 6250.625
(void()) main() (void()) main()
(label) main::@1 (label) main::@1
(label) main::@10
(label) main::@3 (label) main::@3
(label) main::@4 (label) main::@4
(label) main::@5 (label) main::@5
@ -102,6 +135,26 @@ zp byte:10 [ findcol::return#0 findcol::mincol#11 findcol::mincol#2 findcol::min
reg byte a [ addpoint::x#6 ] reg byte a [ addpoint::x#6 ]
reg byte y [ addpoint::idx#6 ] reg byte y [ addpoint::idx#6 ]
reg byte x [ addpoint::y#6 ] reg byte x [ addpoint::y#6 ]
reg byte a [ animate::$0 ]
reg byte a [ animate::$1 ]
reg byte a [ animate::$2 ]
reg byte a [ animate::$4 ]
reg byte a [ animate::$5 ]
reg byte a [ animate::$6 ]
reg byte x [ animate::$8 ]
reg byte x [ animate::$9 ]
reg byte a [ animate::$10 ]
reg byte a [ animate::$12 ]
reg byte a [ animate::$13 ]
reg byte a [ animate::$14 ]
reg byte x [ animate::$16 ]
reg byte x [ animate::$17 ]
reg byte a [ animate::$18 ]
reg byte a [ animate::$20 ]
reg byte a [ animate::$21 ]
reg byte a [ animate::$22 ]
reg byte a [ animate::$24 ]
reg byte a [ animate::$25 ]
zp byte:11 [ findcol::x#0 ] zp byte:11 [ findcol::x#0 ]
zp byte:12 [ findcol::y#0 ] zp byte:12 [ findcol::y#0 ]
reg byte a [ render::col#0 ] reg byte a [ render::col#0 ]

View File

@ -23,9 +23,37 @@ void main() {
addpoint(5, 31, 22, 7); addpoint(5, 31, 22, 7);
do { do {
render(); render();
animate();
} while(true) } while(true)
} }
void animate() {
XPOS[0] = XPOS[0]+1;
if(XPOS[0]==40) {
XPOS[0] = 0;
}
YPOS[0] = YPOS[0]+1;
if(YPOS[0]==25) {
YPOS[0] = 0;
}
XPOS[1] = XPOS[1]-1;
if(XPOS[1]==255) {
XPOS[1] = 40;
}
YPOS[2] = YPOS[2]+1;
if(YPOS[2]==25) {
YPOS[2] = 0;
}
YPOS[3] = YPOS[3]-1;
if(YPOS[3]==255) {
YPOS[3] = 25;
XPOS[3] = XPOS[3]+7;
if(XPOS[3]>=40) {
XPOS[3] = XPOS[3]-40;
}
}
}
void addpoint(byte idx, byte x, byte y, byte c) { void addpoint(byte idx, byte x, byte y, byte c) {
XPOS[idx] = x; XPOS[idx] = x;
YPOS[idx] = y; YPOS[idx] = y;