1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-04-11 04:37:29 +00:00

Updated to C types.

This commit is contained in:
jespergravgaard 2020-02-01 10:48:47 +01:00
parent bb3be5655c
commit 7665387333
5 changed files with 1038 additions and 1095 deletions

View File

@ -2,22 +2,17 @@
import "c64"
import "multiplexer-irq"
// Location of screen & sprites
char* SCREEN = $400;
char* SCREEN = 0x0400;
char* SPRITE = $2000;
kickasm(pc SPRITE, resource "balloon.png") {{
char[0x40] align(0x40)SPRITE = kickasm(resource "balloon.png") {{
.var pic = LoadPicture("balloon.png", List().add($000000, $ffffff))
.for (var y=0; y<21; y++)
.for (var x=0;x<3; x++)
.byte pic.getSinglecolorByte(x,y)
}}
}};
char[0x100] align(0x100) YSIN = kickasm {{
.var min = 50
.var max = 250-21
.var ampl = max-min;
.for(var i=0;i<256;i++)
.byte round(min+(ampl/2)+(ampl/2)*sin(toRadians(360*i/256)))
.fill $100, round(139.5+89.5*sin(toRadians(360*i/256)))
}};
void main() {
@ -89,7 +84,7 @@ void loop() {
plexSort();
*BORDERCOL = GREEN;
framedone = false;
*VIC_CONTROL &=$7f;
*RASTER = $0;
*VIC_CONTROL &=0x7f;
*RASTER = 0x0;
}
}

View File

@ -32,7 +32,6 @@
.const PLEX_COUNT = $20
// The address of the sprite pointers on the current screen (screen+$3f8).
.label PLEX_SCREEN_PTR = $400+$3f8
.label SPRITE = $2000
.label plex_show_idx = 7
.label plex_sprite_idx = 6
.label plex_sprite_msb = 9
@ -170,7 +169,7 @@ init: {
sta.z xp+1
ldx #0
__b1:
lda #SPRITE/$40
lda #$ff&SPRITE/$40
sta PLEX_PTR,x
txa
asl
@ -320,13 +319,16 @@ plexShowSprite: {
}
// Contains the Y-position where each sprite is free again. PLEX_FREE_YPOS[s] holds the Y-position where sprite s is free to use again.
PLEX_FREE_YPOS: .fill 8, 0
.align $40
SPRITE:
.var pic = LoadPicture("balloon.png", List().add($000000, $ffffff))
.for (var y=0; y<21; y++)
.for (var x=0;x<3; x++)
.byte pic.getSinglecolorByte(x,y)
.align $100
YSIN:
.var min = 50
.var max = 250-21
.var ampl = max-min;
.for(var i=0;i<256;i++)
.byte round(min+(ampl/2)+(ampl/2)*sin(toRadians(360*i/256)))
.fill $100, round(139.5+89.5*sin(toRadians(360*i/256)))
// The x-positions of the multiplexer sprites ($000-$1ff)
PLEX_XPOS: .fill 2*PLEX_COUNT, 0
@ -336,9 +338,3 @@ YSIN:
PLEX_PTR: .fill PLEX_COUNT, 0
// Indexes of the plex-sprites sorted by sprite y-position. Each call to plexSort() will fix the sorting if changes to the Y-positions have ruined it.
PLEX_SORTED_IDX: .fill PLEX_COUNT, 0
.pc = SPRITE "SPRITE"
.var pic = LoadPicture("balloon.png", List().add($000000, $ffffff))
.for (var y=0; y<21; y++)
.for (var x=0;x<3; x++)
.byte pic.getSinglecolorByte(x,y)

View File

@ -10,256 +10,249 @@
[4] (byte) plex_free_next#31 ← (byte) 0
to:@3
@3: scope:[] from @2
kickasm(location (const byte*) SPRITE) {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff))
.for (var y=0; y<21; y++)
.for (var x=0;x<3; x++)
.byte pic.getSinglecolorByte(x,y)
}}
[5] (bool) framedone#17 ← true
to:@4
@4: scope:[] from @3
[6] (bool) framedone#17 ← true
to:@5
@5: scope:[] from @4
[7] phi()
[8] call main
[6] phi()
[7] call main
to:@end
@end: scope:[] from @5
[9] phi()
@end: scope:[] from @4
[8] phi()
(void()) main()
main: scope:[main] from @5
main: scope:[main] from @4
asm { sei }
[11] call init
[10] call init
to:main::@1
main::@1: scope:[main] from main
[12] phi()
[13] call loop
[11] phi()
[12] call loop
to:main::@return
main::@return: scope:[main] from main::@1
[14] return
[13] return
to:@return
(void()) loop()
loop: scope:[loop] from main::@1
[15] phi()
[14] phi()
to:loop::@1
loop::@1: scope:[loop] from loop loop::@6
[16] (byte) loop::sin_idx#6 ← phi( loop/(byte) 0 loop::@6/(byte) loop::sin_idx#1 )
[16] (byte) plex_free_next#10 ← phi( loop/(byte) plex_free_next#31 loop::@6/(byte) plex_free_next#0 )
[16] (byte) plex_sprite_msb#11 ← phi( loop/(byte) plex_sprite_msb#0 loop::@6/(byte) plex_sprite_msb#1 )
[16] (byte) plex_sprite_idx#10 ← phi( loop/(byte) plex_sprite_idx#0 loop::@6/(byte) plex_sprite_idx#1 )
[16] (byte) plex_show_idx#10 ← phi( loop/(byte) plex_show_idx#0 loop::@6/(byte) plex_show_idx#1 )
[16] (bool) framedone#12 ← phi( loop/(bool) framedone#17 loop::@6/(bool) framedone#5 )
[15] (byte) loop::sin_idx#6 ← phi( loop/(byte) 0 loop::@6/(byte) loop::sin_idx#1 )
[15] (byte) plex_free_next#10 ← phi( loop/(byte) plex_free_next#31 loop::@6/(byte) plex_free_next#0 )
[15] (byte) plex_sprite_msb#11 ← phi( loop/(byte) plex_sprite_msb#0 loop::@6/(byte) plex_sprite_msb#1 )
[15] (byte) plex_sprite_idx#10 ← phi( loop/(byte) plex_sprite_idx#0 loop::@6/(byte) plex_sprite_idx#1 )
[15] (byte) plex_show_idx#10 ← phi( loop/(byte) plex_show_idx#0 loop::@6/(byte) plex_show_idx#1 )
[15] (bool) framedone#12 ← phi( loop/(bool) framedone#17 loop::@6/(bool) framedone#5 )
to:loop::@2
loop::@2: scope:[loop] from loop::@1 loop::@2
[17] if((bool) framedone#12) goto loop::@3
[16] if((bool) framedone#12) goto loop::@3
to:loop::@2
loop::@3: scope:[loop] from loop::@2
[18] *((const byte*) BORDERCOL) ← (const byte) RED
[19] (byte~) loop::y_idx#4 ← (byte) loop::sin_idx#6
[17] *((const byte*) BORDERCOL) ← (const byte) RED
[18] (byte~) loop::y_idx#4 ← (byte) loop::sin_idx#6
to:loop::@4
loop::@4: scope:[loop] from loop::@3 loop::@4
[20] (byte) loop::sy#2 ← phi( loop::@4/(byte) loop::sy#1 loop::@3/(byte) 0 )
[20] (byte) loop::y_idx#2 ← phi( loop::@4/(byte) loop::y_idx#1 loop::@3/(byte~) loop::y_idx#4 )
[21] *((const byte[PLEX_COUNT]) PLEX_YPOS + (byte) loop::sy#2) ← *((const byte[$100]) YSIN + (byte) loop::y_idx#2)
[22] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte) 8
[23] (byte) loop::sy#1 ← ++ (byte) loop::sy#2
[24] if((byte) loop::sy#1!=(const byte) PLEX_COUNT-(byte) 1+(byte) 1) goto loop::@4
[19] (byte) loop::sy#2 ← phi( loop::@4/(byte) loop::sy#1 loop::@3/(byte) 0 )
[19] (byte) loop::y_idx#2 ← phi( loop::@4/(byte) loop::y_idx#1 loop::@3/(byte~) loop::y_idx#4 )
[20] *((const byte[PLEX_COUNT]) PLEX_YPOS + (byte) loop::sy#2) ← *((const byte[$100]) YSIN + (byte) loop::y_idx#2)
[21] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte) 8
[22] (byte) loop::sy#1 ← ++ (byte) loop::sy#2
[23] if((byte) loop::sy#1!=(const byte) PLEX_COUNT-(byte) 1+(byte) 1) goto loop::@4
to:loop::@5
loop::@5: scope:[loop] from loop::@4
[25] (byte) loop::sin_idx#1 ← (byte) loop::sin_idx#6 + (byte) 1
[26] *((const byte*) BORDERCOL) ← ++ *((const byte*) BORDERCOL)
[27] call plexSort
[24] (byte) loop::sin_idx#1 ← (byte) loop::sin_idx#6 + (byte) 1
[25] *((const byte*) BORDERCOL) ← ++ *((const byte*) BORDERCOL)
[26] call plexSort
to:loop::@6
loop::@6: scope:[loop] from loop::@5
[28] *((const byte*) BORDERCOL) ← (const byte) GREEN
[29] (bool) framedone#5 ← false
[30] *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) & (byte) $7f
[31] *((const byte*) RASTER) ← (byte) 0
[27] *((const byte*) BORDERCOL) ← (const byte) GREEN
[28] (bool) framedone#5 ← false
[29] *((const byte*) VIC_CONTROL) ← *((const byte*) VIC_CONTROL) & (byte) $7f
[30] *((const byte*) RASTER) ← (byte) 0
to:loop::@1
(void()) plexSort()
plexSort: scope:[plexSort] from loop::@5
[32] phi()
[31] phi()
to:plexSort::@1
plexSort::@1: scope:[plexSort] from plexSort plexSort::@2
[33] (byte) plexSort::m#2 ← phi( plexSort/(byte) 0 plexSort::@2/(byte) plexSort::m#1 )
[34] (byte) plexSort::nxt_idx#0 ← *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2)
[35] (byte) plexSort::nxt_y#0 ← *((const byte[PLEX_COUNT]) PLEX_YPOS + (byte) plexSort::nxt_idx#0)
[36] if((byte) plexSort::nxt_y#0>=*((const byte[PLEX_COUNT]) PLEX_YPOS + *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2
[32] (byte) plexSort::m#2 ← phi( plexSort/(byte) 0 plexSort::@2/(byte) plexSort::m#1 )
[33] (byte) plexSort::nxt_idx#0 ← *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2)
[34] (byte) plexSort::nxt_y#0 ← *((const byte[PLEX_COUNT]) PLEX_YPOS + (byte) plexSort::nxt_idx#0)
[35] if((byte) plexSort::nxt_y#0>=*((const byte[PLEX_COUNT]) PLEX_YPOS + *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2
to:plexSort::@5
plexSort::@5: scope:[plexSort] from plexSort::@1
[37] (byte~) plexSort::s#6 ← (byte) plexSort::m#2
[36] (byte~) plexSort::s#6 ← (byte) plexSort::m#2
to:plexSort::@3
plexSort::@3: scope:[plexSort] from plexSort::@5 plexSort::@7
[38] (byte) plexSort::s#3 ← phi( plexSort::@7/(byte) plexSort::s#1 plexSort::@5/(byte~) plexSort::s#6 )
[39] *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plexSort::s#3)
[40] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3
[41] if((byte) plexSort::s#1==(byte) $ff) goto plexSort::@4
[37] (byte) plexSort::s#3 ← phi( plexSort::@7/(byte) plexSort::s#1 plexSort::@5/(byte~) plexSort::s#6 )
[38] *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plexSort::s#3)
[39] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3
[40] if((byte) plexSort::s#1==(byte) $ff) goto plexSort::@4
to:plexSort::@7
plexSort::@7: scope:[plexSort] from plexSort::@3
[42] if((byte) plexSort::nxt_y#0<*((const byte[PLEX_COUNT]) PLEX_YPOS + *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3
[41] if((byte) plexSort::nxt_y#0<*((const byte[PLEX_COUNT]) PLEX_YPOS + *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3
to:plexSort::@4
plexSort::@4: scope:[plexSort] from plexSort::@3 plexSort::@7
[43] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1
[44] *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0
[42] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1
[43] *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0
to:plexSort::@2
plexSort::@2: scope:[plexSort] from plexSort::@1 plexSort::@4
[45] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2
[46] if((byte) plexSort::m#1!=(const byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1
[44] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2
[45] if((byte) plexSort::m#1!=(const byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1
to:plexSort::@6
plexSort::@6: scope:[plexSort] from plexSort::@2
[47] (byte) plex_show_idx#1 ← (byte) 0
[48] (byte) plex_sprite_idx#1 ← (byte) 0
[49] (byte) plex_sprite_msb#1 ← (byte) 1
[46] (byte) plex_show_idx#1 ← (byte) 0
[47] (byte) plex_sprite_idx#1 ← (byte) 0
[48] (byte) plex_sprite_msb#1 ← (byte) 1
to:plexSort::plexFreePrepare1
plexSort::plexFreePrepare1: scope:[plexSort] from plexSort::@6
[50] phi()
[49] phi()
to:plexSort::plexFreePrepare1_@1
plexSort::plexFreePrepare1_@1: scope:[plexSort] from plexSort::plexFreePrepare1 plexSort::plexFreePrepare1_@1
[51] (byte) plexSort::plexFreePrepare1_s#2 ← phi( plexSort::plexFreePrepare1/(byte) 0 plexSort::plexFreePrepare1_@1/(byte) plexSort::plexFreePrepare1_s#1 )
[52] *((const byte[8]) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0
[53] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2
[54] if((byte) plexSort::plexFreePrepare1_s#1!=(byte) 8) goto plexSort::plexFreePrepare1_@1
[50] (byte) plexSort::plexFreePrepare1_s#2 ← phi( plexSort::plexFreePrepare1/(byte) 0 plexSort::plexFreePrepare1_@1/(byte) plexSort::plexFreePrepare1_s#1 )
[51] *((const byte[8]) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0
[52] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2
[53] if((byte) plexSort::plexFreePrepare1_s#1!=(byte) 8) goto plexSort::plexFreePrepare1_@1
to:plexSort::plexFreePrepare1_@2
plexSort::plexFreePrepare1_@2: scope:[plexSort] from plexSort::plexFreePrepare1_@1
[55] (byte) plex_free_next#0 ← (byte) 0
[54] (byte) plex_free_next#0 ← (byte) 0
to:plexSort::@return
plexSort::@return: scope:[plexSort] from plexSort::plexFreePrepare1_@2
[56] return
[55] return
to:@return
(void()) init()
init: scope:[init] from main
[57] *((const byte*) D011) ← (const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3
[58] call plexInit
[56] *((const byte*) D011) ← (const byte) VIC_DEN|(const byte) VIC_RSEL|(byte) 3
[57] call plexInit
to:init::@1
init::@1: scope:[init] from init init::@1
[59] (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init/(byte) $20 )
[59] (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init/(byte) 0 )
[60] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40
[61] (byte~) init::$9 ← (byte) init::sx#2 << (byte) 1
[62] *((const word[PLEX_COUNT]) PLEX_XPOS + (byte~) init::$9) ← (word) init::xp#2
[63] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9
[64] (byte) init::sx#1 ← ++ (byte) init::sx#2
[65] if((byte) init::sx#1!=(const byte) PLEX_COUNT-(byte) 1+(byte) 1) goto init::@1
[58] (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init/(byte) $20 )
[58] (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init/(byte) 0 )
[59] *((const byte[PLEX_COUNT]) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte[$40]) SPRITE/(byte) $40
[60] (byte~) init::$9 ← (byte) init::sx#2 << (byte) 1
[61] *((const word[PLEX_COUNT]) PLEX_XPOS + (byte~) init::$9) ← (word) init::xp#2
[62] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9
[63] (byte) init::sx#1 ← ++ (byte) init::sx#2
[64] if((byte) init::sx#1!=(const byte) PLEX_COUNT-(byte) 1+(byte) 1) goto init::@1
to:init::@2
init::@2: scope:[init] from init::@1
[66] *((const byte*) SPRITES_ENABLE) ← (byte) $ff
[65] *((const byte*) SPRITES_ENABLE) ← (byte) $ff
to:init::@3
init::@3: scope:[init] from init::@2 init::@3
[67] (byte) init::ss#2 ← phi( init::@2/(byte) 0 init::@3/(byte) init::ss#1 )
[68] *((const byte*) SPRITES_COLS + (byte) init::ss#2) ← (const byte) GREEN
[69] (byte) init::ss#1 ← ++ (byte) init::ss#2
[70] if((byte) init::ss#1!=(byte) 8) goto init::@3
[66] (byte) init::ss#2 ← phi( init::@2/(byte) 0 init::@3/(byte) init::ss#1 )
[67] *((const byte*) SPRITES_COLS + (byte) init::ss#2) ← (const byte) GREEN
[68] (byte) init::ss#1 ← ++ (byte) init::ss#2
[69] if((byte) init::ss#1!=(byte) 8) goto init::@3
to:init::@4
init::@4: scope:[init] from init::@3
asm { sei }
[72] *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR
[73] *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER
[74] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER
[75] *((const void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq()
[71] *((const byte*) CIA1_INTERRUPT) ← (const byte) CIA_INTERRUPT_CLEAR
[72] *((const byte*) IRQ_ENABLE) ← (const byte) IRQ_RASTER
[73] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER
[74] *((const void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq()
asm { cli }
to:init::@return
init::@return: scope:[init] from init::@4
[77] return
[76] return
to:@return
(void()) plexInit((byte*) plexInit::screen)
plexInit: scope:[plexInit] from init
[78] phi()
[77] phi()
to:plexInit::plexSetScreen1
plexInit::plexSetScreen1: scope:[plexInit] from plexInit
[79] phi()
[78] phi()
to:plexInit::@1
plexInit::@1: scope:[plexInit] from plexInit::@1 plexInit::plexSetScreen1
[80] (byte) plexInit::i#2 ← phi( plexInit::@1/(byte) plexInit::i#1 plexInit::plexSetScreen1/(byte) 0 )
[81] *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plexInit::i#2) ← (byte) plexInit::i#2
[82] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2
[83] if((byte) plexInit::i#1!=(const byte) PLEX_COUNT-(byte) 1+(byte) 1) goto plexInit::@1
[79] (byte) plexInit::i#2 ← phi( plexInit::@1/(byte) plexInit::i#1 plexInit::plexSetScreen1/(byte) 0 )
[80] *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plexInit::i#2) ← (byte) plexInit::i#2
[81] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2
[82] if((byte) plexInit::i#1!=(const byte) PLEX_COUNT-(byte) 1+(byte) 1) goto plexInit::@1
to:plexInit::@return
plexInit::@return: scope:[plexInit] from plexInit::@1
[84] return
[83] return
to:@return
interrupt(KERNEL_MIN)(void()) plex_irq()
plex_irq: scope:[plex_irq] from
[85] *((const byte*) BORDERCOL) ← (const byte) WHITE
[84] *((const byte*) BORDERCOL) ← (const byte) WHITE
to:plex_irq::@3
plex_irq::@3: scope:[plex_irq] from plex_irq plex_irq::@7
[86] (byte) plex_sprite_msb#28 ← phi( plex_irq/(byte) plex_sprite_msb#0 plex_irq::@7/(byte) plex_sprite_msb#17 )
[86] (byte) plex_free_next#27 ← phi( plex_irq/(byte) plex_free_next#31 plex_irq::@7/(byte~) plexShowSprite::plexFreeAdd1_$2 )
[86] (byte) plex_show_idx#27 ← phi( plex_irq/(byte) plex_show_idx#0 plex_irq::@7/(byte) plex_show_idx#16 )
[86] (byte) plex_sprite_idx#25 ← phi( plex_irq/(byte) plex_sprite_idx#0 plex_irq::@7/(byte~) plexShowSprite::$6 )
[87] call plexShowSprite
[85] (byte) plex_sprite_msb#28 ← phi( plex_irq/(byte) plex_sprite_msb#0 plex_irq::@7/(byte) plex_sprite_msb#17 )
[85] (byte) plex_free_next#27 ← phi( plex_irq/(byte) plex_free_next#31 plex_irq::@7/(byte~) plexShowSprite::plexFreeAdd1_$2 )
[85] (byte) plex_show_idx#27 ← phi( plex_irq/(byte) plex_show_idx#0 plex_irq::@7/(byte) plex_show_idx#16 )
[85] (byte) plex_sprite_idx#25 ← phi( plex_irq/(byte) plex_sprite_idx#0 plex_irq::@7/(byte~) plexShowSprite::$6 )
[86] call plexShowSprite
to:plex_irq::plexFreeNextYpos1
plex_irq::plexFreeNextYpos1: scope:[plex_irq] from plex_irq::@3
[88] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte[8]) PLEX_FREE_YPOS + (byte~) plexShowSprite::plexFreeAdd1_$2)
[87] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte[8]) PLEX_FREE_YPOS + (byte~) plexShowSprite::plexFreeAdd1_$2)
to:plex_irq::@6
plex_irq::@6: scope:[plex_irq] from plex_irq::plexFreeNextYpos1
[89] (byte~) plex_irq::$4 ← *((const byte*) RASTER) + (byte) 2
[90] if((byte) plex_show_idx#16>=(const byte) PLEX_COUNT) goto plex_irq::@4
[88] (byte~) plex_irq::$4 ← *((const byte*) RASTER) + (byte) 2
[89] if((byte) plex_show_idx#16>=(const byte) PLEX_COUNT) goto plex_irq::@4
to:plex_irq::@7
plex_irq::@7: scope:[plex_irq] from plex_irq::@6
[91] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3
[90] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3
to:plex_irq::@4
plex_irq::@4: scope:[plex_irq] from plex_irq::@6 plex_irq::@7
[92] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER
[93] if((byte) plex_show_idx#16<(const byte) PLEX_COUNT) goto plex_irq::@1
[91] *((const byte*) IRQ_STATUS) ← (const byte) IRQ_RASTER
[92] if((byte) plex_show_idx#16<(const byte) PLEX_COUNT) goto plex_irq::@1
to:plex_irq::@5
plex_irq::@5: scope:[plex_irq] from plex_irq::@4
[94] (bool) framedone#3 ← true
[93] (bool) framedone#3 ← true
to:plex_irq::@2
plex_irq::@2: scope:[plex_irq] from plex_irq::@1 plex_irq::@5
[95] (bool) framedone#10 ← phi( plex_irq::@1/(bool) framedone#17 plex_irq::@5/(bool) framedone#3 )
[96] *((const byte*) BORDERCOL) ← (byte) 0
[94] (bool) framedone#10 ← phi( plex_irq::@1/(bool) framedone#17 plex_irq::@5/(bool) framedone#3 )
[95] *((const byte*) BORDERCOL) ← (byte) 0
to:plex_irq::@return
plex_irq::@return: scope:[plex_irq] from plex_irq::@2
[97] return
[96] return
to:@return
plex_irq::@1: scope:[plex_irq] from plex_irq::@4
[98] *((const byte*) RASTER) ← (byte) plex_irq::plexFreeNextYpos1_return#0
[97] *((const byte*) RASTER) ← (byte) plex_irq::plexFreeNextYpos1_return#0
to:plex_irq::@2
(void()) plexShowSprite()
plexShowSprite: scope:[plexShowSprite] from plex_irq::@3
[99] (byte) plexShowSprite::plex_sprite_idx2#0 ← (byte) plex_sprite_idx#25 << (byte) 1
[100] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte[PLEX_COUNT]) PLEX_YPOS + *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plex_show_idx#27))
[101] *((const byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0
[98] (byte) plexShowSprite::plex_sprite_idx2#0 ← (byte) plex_sprite_idx#25 << (byte) 1
[99] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte[PLEX_COUNT]) PLEX_YPOS + *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plex_show_idx#27))
[100] *((const byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0
to:plexShowSprite::plexFreeAdd1
plexShowSprite::plexFreeAdd1: scope:[plexShowSprite] from plexShowSprite
[102] (byte~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte) $15
[103] *((const byte[8]) PLEX_FREE_YPOS + (byte) plex_free_next#27) ← (byte~) plexShowSprite::plexFreeAdd1_$0
[104] (byte~) plexShowSprite::plexFreeAdd1_$1 ← (byte) plex_free_next#27 + (byte) 1
[105] (byte~) plexShowSprite::plexFreeAdd1_$2 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7
[101] (byte~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte) $15
[102] *((const byte[8]) PLEX_FREE_YPOS + (byte) plex_free_next#27) ← (byte~) plexShowSprite::plexFreeAdd1_$0
[103] (byte~) plexShowSprite::plexFreeAdd1_$1 ← (byte) plex_free_next#27 + (byte) 1
[104] (byte~) plexShowSprite::plexFreeAdd1_$2 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7
to:plexShowSprite::@5
plexShowSprite::@5: scope:[plexShowSprite] from plexShowSprite::plexFreeAdd1
[106] *((const byte*) PLEX_SCREEN_PTR#0 + (byte) plex_sprite_idx#25) ← *((const byte[PLEX_COUNT]) PLEX_PTR + *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plex_show_idx#27))
[107] (byte) plexShowSprite::xpos_idx#0 ← *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plex_show_idx#27)
[108] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1
[109] (byte~) plexShowSprite::$2 ← < *((const word[PLEX_COUNT]) PLEX_XPOS + (byte~) plexShowSprite::$11)
[110] *((const byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2
[111] (byte~) plexShowSprite::$3 ← > *((const word[PLEX_COUNT]) PLEX_XPOS + (byte~) plexShowSprite::$11)
[112] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1
[105] *((const byte*) PLEX_SCREEN_PTR#0 + (byte) plex_sprite_idx#25) ← *((const byte[PLEX_COUNT]) PLEX_PTR + *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plex_show_idx#27))
[106] (byte) plexShowSprite::xpos_idx#0 ← *((const byte[PLEX_COUNT]) PLEX_SORTED_IDX + (byte) plex_show_idx#27)
[107] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1
[108] (byte~) plexShowSprite::$2 ← < *((const word[PLEX_COUNT]) PLEX_XPOS + (byte~) plexShowSprite::$11)
[109] *((const byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2
[110] (byte~) plexShowSprite::$3 ← > *((const word[PLEX_COUNT]) PLEX_XPOS + (byte~) plexShowSprite::$11)
[111] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1
to:plexShowSprite::@3
plexShowSprite::@3: scope:[plexShowSprite] from plexShowSprite::@5
[113] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (byte) plex_sprite_msb#28
[114] *((const byte*) SPRITES_XMSB) ← *((const byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9
[112] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (byte) plex_sprite_msb#28
[113] *((const byte*) SPRITES_XMSB) ← *((const byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9
to:plexShowSprite::@2
plexShowSprite::@2: scope:[plexShowSprite] from plexShowSprite::@1 plexShowSprite::@3
[115] (byte~) plexShowSprite::$5 ← (byte) plex_sprite_idx#25 + (byte) 1
[116] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7
[117] (byte) plex_show_idx#16 ← ++ (byte) plex_show_idx#27
[118] (byte) plex_sprite_msb#3 ← (byte) plex_sprite_msb#28 << (byte) 1
[119] if((byte) plex_sprite_msb#3!=(byte) 0) goto plexShowSprite::@return
[114] (byte~) plexShowSprite::$5 ← (byte) plex_sprite_idx#25 + (byte) 1
[115] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7
[116] (byte) plex_show_idx#16 ← ++ (byte) plex_show_idx#27
[117] (byte) plex_sprite_msb#3 ← (byte) plex_sprite_msb#28 << (byte) 1
[118] if((byte) plex_sprite_msb#3!=(byte) 0) goto plexShowSprite::@return
to:plexShowSprite::@4
plexShowSprite::@4: scope:[plexShowSprite] from plexShowSprite::@2
[120] (byte) plex_sprite_msb#4 ← (byte) 1
[119] (byte) plex_sprite_msb#4 ← (byte) 1
to:plexShowSprite::@return
plexShowSprite::@return: scope:[plexShowSprite] from plexShowSprite::@2 plexShowSprite::@4
[121] (byte) plex_sprite_msb#17 ← phi( plexShowSprite::@2/(byte) plex_sprite_msb#3 plexShowSprite::@4/(byte) plex_sprite_msb#4 )
[122] return
[120] (byte) plex_sprite_msb#17 ← phi( plexShowSprite::@2/(byte) plex_sprite_msb#3 plexShowSprite::@4/(byte) plex_sprite_msb#4 )
[121] return
to:@return
plexShowSprite::@1: scope:[plexShowSprite] from plexShowSprite::@5
[123] *((const byte*) SPRITES_XMSB) ← *((const byte*) SPRITES_XMSB) | (byte) plex_sprite_msb#28
[122] *((const byte*) SPRITES_XMSB) ← *((const byte*) SPRITES_XMSB) | (byte) plex_sprite_msb#28
to:plexShowSprite::@2

File diff suppressed because it is too large Load Diff

View File

@ -2,7 +2,6 @@
(label) @2
(label) @3
(label) @4
(label) @5
(label) @begin
(label) @end
(const byte*) BORDERCOL BORDERCOL = (byte*) 53280
@ -24,7 +23,11 @@
(const byte[PLEX_COUNT]) PLEX_YPOS PLEX_YPOS = { fill( PLEX_COUNT, 0) }
(const byte*) RASTER RASTER = (byte*) 53266
(const byte) RED RED = (byte) 2
(const byte*) SPRITE SPRITE = (byte*) 8192
(const byte[$40]) SPRITE SPRITE = kickasm {{ .var pic = LoadPicture("balloon.png", List().add($000000, $ffffff))
.for (var y=0; y<21; y++)
.for (var x=0;x<3; x++)
.byte pic.getSinglecolorByte(x,y)
}}
(const byte*) SPRITES_COLS SPRITES_COLS = (byte*) 53287
(const byte*) SPRITES_ENABLE SPRITES_ENABLE = (byte*) 53269
(const byte*) SPRITES_XMSB SPRITES_XMSB = (byte*) 53264
@ -34,11 +37,7 @@
(const byte) VIC_DEN VIC_DEN = (byte) $10
(const byte) VIC_RSEL VIC_RSEL = (byte) 8
(const byte) WHITE WHITE = (byte) 1
(const byte[$100]) YSIN YSIN = kickasm {{ .var min = 50
.var max = 250-21
.var ampl = max-min;
.for(var i=0;i<256;i++)
.byte round(min+(ampl/2)+(ampl/2)*sin(toRadians(360*i/256)))
(const byte[$100]) YSIN YSIN = kickasm {{ .fill $100, round(139.5+89.5*sin(toRadians(360*i/256)))
}}
(bool) framedone
(bool) framedone#10 framedone zp ZP_BOOL:10 40.0
@ -146,7 +145,7 @@
(byte) plex_free_next#0 plex_free_next zp ZP_BYTE:8 1.8571428571428572
(byte) plex_free_next#10 plex_free_next zp ZP_BYTE:8 130.0
(byte) plex_free_next#27 plex_free_next zp ZP_BYTE:8 2.8333333333333335
(byte) plex_free_next#31 plex_free_next zp ZP_BYTE:8 0.6666666666666666
(byte) plex_free_next#31 plex_free_next zp ZP_BYTE:8 0.75
interrupt(KERNEL_MIN)(void()) plex_irq()
(byte~) plex_irq::$4 $4 zp ZP_BYTE:13 11.0
(label) plex_irq::@1
@ -162,18 +161,18 @@ interrupt(KERNEL_MIN)(void()) plex_irq()
(byte) plex_irq::plexFreeNextYpos1_return#0 reg byte x 4.0
(byte) plex_irq::rasterY
(byte) plex_show_idx
(byte) plex_show_idx#0 plex_show_idx zp ZP_BYTE:7 0.5
(byte) plex_show_idx#0 plex_show_idx zp ZP_BYTE:7 0.5454545454545454
(byte) plex_show_idx#1 plex_show_idx zp ZP_BYTE:7 0.8666666666666666
(byte) plex_show_idx#10 plex_show_idx zp ZP_BYTE:7 130.0
(byte) plex_show_idx#16 plex_show_idx zp ZP_BYTE:7 2.1666666666666665
(byte) plex_show_idx#27 plex_show_idx zp ZP_BYTE:7 1.05
(byte) plex_sprite_idx
(byte) plex_sprite_idx#0 plex_sprite_idx zp ZP_BYTE:6 0.5454545454545454
(byte) plex_sprite_idx#0 plex_sprite_idx zp ZP_BYTE:6 0.6000000000000001
(byte) plex_sprite_idx#1 plex_sprite_idx zp ZP_BYTE:6 0.9285714285714286
(byte) plex_sprite_idx#10 plex_sprite_idx zp ZP_BYTE:6 130.0
(byte) plex_sprite_idx#25 plex_sprite_idx zp ZP_BYTE:6 1.0555555555555558
(byte) plex_sprite_msb
(byte) plex_sprite_msb#0 plex_sprite_msb zp ZP_BYTE:9 0.6000000000000001
(byte) plex_sprite_msb#0 plex_sprite_msb zp ZP_BYTE:9 0.6666666666666666
(byte) plex_sprite_msb#1 plex_sprite_msb zp ZP_BYTE:9 1.0
(byte) plex_sprite_msb#11 plex_sprite_msb zp ZP_BYTE:9 130.0
(byte) plex_sprite_msb#17 plex_sprite_msb zp ZP_BYTE:9 2.142857142857143