From 90fccdebef94af254422040ce07f8271693e2b66 Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Tue, 31 Mar 2020 09:55:49 +0200 Subject: [PATCH] Working on font 2x2 to sprite converter. --- src/main/kc/stdlib/multiplexer.kc | 50 +- .../dk/camelot64/kickc/test/TestPrograms.java | 8 +- .../kc/complex/elefont/elefont-sprites.kc | 55 - .../complex/spritescroller/multiplexer-irq.kc | 140 + .../complex/spritescroller/spritescroller.kc | 201 + .../multiplexer-irq/simple-multiplexer-irq.kc | 10 +- src/test/ref/complex/prebob/vogel-sprites.asm | 6 +- src/test/ref/complex/prebob/vogel-sprites.log | 6 +- .../complex/spritescroller/spritescroller.asm | 758 ++ .../complex/spritescroller/spritescroller.cfg | 390 + .../complex/spritescroller/spritescroller.log | 7567 +++++++++++++++++ .../complex/spritescroller/spritescroller.sym | 319 + .../multiplexer/simple-multiplexer.asm | 6 +- .../multiplexer/simple-multiplexer.log | 6 +- .../simple-multiplexer-irq.asm | 21 +- .../simple-multiplexer-irq.cfg | 173 +- .../simple-multiplexer-irq.log | 1245 +-- .../simple-multiplexer-irq.sym | 12 +- 18 files changed, 10172 insertions(+), 801 deletions(-) delete mode 100644 src/test/kc/complex/elefont/elefont-sprites.kc create mode 100644 src/test/kc/complex/spritescroller/multiplexer-irq.kc create mode 100644 src/test/kc/complex/spritescroller/spritescroller.kc create mode 100644 src/test/ref/complex/spritescroller/spritescroller.asm create mode 100644 src/test/ref/complex/spritescroller/spritescroller.cfg create mode 100644 src/test/ref/complex/spritescroller/spritescroller.log create mode 100644 src/test/ref/complex/spritescroller/spritescroller.sym diff --git a/src/main/kc/stdlib/multiplexer.kc b/src/main/kc/stdlib/multiplexer.kc index 3608bf6a4..879009195 100644 --- a/src/main/kc/stdlib/multiplexer.kc +++ b/src/main/kc/stdlib/multiplexer.kc @@ -15,42 +15,42 @@ import "c64" // The number of sprites in the multiplexer -const byte PLEX_COUNT = 32; +const char PLEX_COUNT = 32; // The x-positions of the multiplexer sprites ($000-$1ff) -word PLEX_XPOS[PLEX_COUNT]; +unsigned int PLEX_XPOS[PLEX_COUNT]; // The y-positions of the multiplexer sprites. -byte PLEX_YPOS[PLEX_COUNT]; +char PLEX_YPOS[PLEX_COUNT]; // The sprite pointers for the multiplexed sprites -byte PLEX_PTR[PLEX_COUNT]; +char PLEX_PTR[PLEX_COUNT]; // The address of the sprite pointers on the current screen (screen+$3f8). -byte* PLEX_SCREEN_PTR = $400+$3f8; +char* PLEX_SCREEN_PTR = $400+$3f8; // 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. -byte PLEX_SORTED_IDX[PLEX_COUNT]; +char PLEX_SORTED_IDX[PLEX_COUNT]; // Variables controlling the showing of sprites // The index in the PLEX tables of the next sprite to show -byte plex_show_idx=0; +char plex_show_idx=0; // The index the next sprite to use for showing (sprites are used round-robin) -byte plex_sprite_idx=0; +char plex_sprite_idx=0; // The MSB bit of the next sprite to use for showing -byte plex_sprite_msb=1; +char plex_sprite_msb=1; // Initialize the multiplexer data structures -void plexInit(byte* screen) { +void plexInit(char* screen) { plexSetScreen(screen); - for(byte i: 0..PLEX_COUNT-1) { + for(char i: 0..PLEX_COUNT-1) { PLEX_SORTED_IDX[i] = i; } } // Set the address of the current screen used for setting sprite pointers (at screen+$3f8) -inline void plexSetScreen(byte* screen) { +inline void plexSetScreen(char* screen) { PLEX_SCREEN_PTR = screen+$3f8; } @@ -64,12 +64,12 @@ inline void plexSetScreen(byte* screen) { // elements before the marker are shifted right one at a time until encountering one smaller than the current one. // It is then inserted at the spot. Now the marker can move forward. void plexSort() { - for(byte m: 0..PLEX_COUNT-2) { - byte nxt_idx = PLEX_SORTED_IDX[m+1]; - byte nxt_y = PLEX_YPOS[nxt_idx]; + for(char m: 0..PLEX_COUNT-2) { + char nxt_idx = PLEX_SORTED_IDX[m+1]; + char nxt_y = PLEX_YPOS[nxt_idx]; if(nxt_yPLEX_XPOS[xpos_idx]!=0) { *SPRITES_XMSB |= plex_sprite_msb; @@ -110,31 +110,31 @@ void plexShowSprite() { } // Get the y-position of the next sprite to show -inline byte plexShowNextYpos() { +inline char plexShowNextYpos() { return PLEX_YPOS[PLEX_SORTED_IDX[plex_show_idx]]; } // 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. -byte PLEX_FREE_YPOS[8]; +char PLEX_FREE_YPOS[8]; // The index of the sprite that is free next. Since sprites are used round-robin this moves forward each time a sprite is shown. -byte plex_free_next = 0; +char plex_free_next = 0; // Prepare for a new frame. Initialize free to zero for all sprites. inline void plexFreePrepare() { - for( byte s: 0..7) { + for( char s: 0..7) { PLEX_FREE_YPOS[s] = 0; } plex_free_next = 0; } // Get the Y-position where the next sprite to be shown is free to use. -inline byte plexFreeNextYpos() { +inline char plexFreeNextYpos() { return PLEX_FREE_YPOS[plex_free_next]; } // Update the data structure to reflect that a sprite has been shown. This sprite will be free again after 21 lines. -inline void plexFreeAdd(byte ypos) { +inline void plexFreeAdd(char ypos) { PLEX_FREE_YPOS[plex_free_next] = ypos+21; plex_free_next = (plex_free_next+1)&7; } \ No newline at end of file diff --git a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java index 9a33350f9..52931550c 100644 --- a/src/test/java/dk/camelot64/kickc/test/TestPrograms.java +++ b/src/test/java/dk/camelot64/kickc/test/TestPrograms.java @@ -198,10 +198,10 @@ public class TestPrograms { assertError("constant-prepost", "Constant value contains a pre/post-modifier"); } - //@Test - //public void testElefont() throws IOException, URISyntaxException { - // compileAndCompare("complex/elefont/elefont-sprites", log()); - //} + @Test + public void testSpriteScroller() throws IOException, URISyntaxException { + compileAndCompare("complex/spritescroller/spritescroller"); + } @Test public void testGridBobs() throws IOException, URISyntaxException { diff --git a/src/test/kc/complex/elefont/elefont-sprites.kc b/src/test/kc/complex/elefont/elefont-sprites.kc deleted file mode 100644 index d75036338..000000000 --- a/src/test/kc/complex/elefont/elefont-sprites.kc +++ /dev/null @@ -1,55 +0,0 @@ -// Put a 2x2 font into sprites and show on screen - -import "c64" - -char * const CHARSET_DEFAULT = 0x1000; -char * const ELEFONT = 0x2000; -char * const SPRITES = 0x3000; -char * const SCREEN = 0x0400; -char * const SCREEN_SPRITES = SCREEN + SPRITE_PTRS; - - -kickasm(pc ELEFONT, resource "elefont.bin") {{ - .import binary "elefont.bin" -}} - -void main() { - *D018 = toD018(SCREEN, CHARSET_DEFAULT); - font_2x2_to_sprites(ELEFONT, SPRITES, 64); - *SPRITES_ENABLE = 1; - SPRITES_XPOS[0] = 100; - SPRITES_YPOS[0] = 100; - SPRITES_COLS[0] = WHITE; - SCREEN_SPRITES[0] = toSpritePtr(SPRITES)+1; -} - -// Convert a 2x2-font to sprites -// - font_2x2 The source 2x2-font -// - sprites The destination sprites -// - num_chars The number of chars to convert -void font_2x2_to_sprites(char* font_2x2, char* sprites, char num_chars) { - char * char_current = font_2x2; - char * sprite = sprites; - for(char c=0;cPLEX_XPOS[xpos_idx]!=0) { + *SPRITES_XMSB |= plex_sprite_msb; + } else { + *SPRITES_XMSB &= (0xff^plex_sprite_msb); + } + plex_sprite_idx = (plex_sprite_idx+1)&7; + plex_show_idx++; + plex_sprite_msb <<=1; + if(plex_sprite_msb==0) { + plex_sprite_msb = 1; + } +} + +// Get the y-position of the next sprite to show +inline char plexShowNextYpos() { + return PLEX_YPOS[PLEX_SORTED_IDX[plex_show_idx]]; +} + +// 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. +char PLEX_FREE_YPOS[8]; + +// The index of the sprite that is free next. Since sprites are used round-robin this moves forward each time a sprite is shown. +volatile char plex_free_next = 0; + +// Prepare for a new frame. Initialize free to zero for all sprites. +inline void plexFreePrepare() { + for( char s: 0..7) { + PLEX_FREE_YPOS[s] = 0; + } + plex_free_next = 0; +} + +// Get the Y-position where the next sprite to be shown is free to use. +inline char plexFreeNextYpos() { + return PLEX_FREE_YPOS[plex_free_next]; +} + +// Update the data structure to reflect that a sprite has been shown. This sprite will be free again after 21 lines. +inline void plexFreeAdd(char ypos) { + PLEX_FREE_YPOS[plex_free_next] = ypos+21; + plex_free_next = (plex_free_next+1)&7; +} \ No newline at end of file diff --git a/src/test/kc/complex/spritescroller/spritescroller.kc b/src/test/kc/complex/spritescroller/spritescroller.kc new file mode 100644 index 000000000..a00dc51fb --- /dev/null +++ b/src/test/kc/complex/spritescroller/spritescroller.kc @@ -0,0 +1,201 @@ +// Put a 2x2 font into sprites and show it on screen +import "c64" +import "multiplexer-irq" + +char * const CHARSET_DEFAULT = 0x1000; +char * const FONT = 0x2000; +char * const SPRITES = 0x3000; +char * const SCREEN = 0x0400; +char * const SCREEN_SPRITES = SCREEN + SPRITE_PTRS; + +// Show raster time used +const char DEBUG = 0; + +//kickasm(pc FONT, resource "elefont.bin") {{ +// .import binary "elefont.bin" +//}} + +char align(0x100) YSIN[0x100] = kickasm {{ + .fill $100, round(142+89.5*sin(toRadians(360*i/256))) +}}; + +void main() { + + // Create 2x2 font from CHARGEN + asm { sei } + *PROCPORT = PROCPORT_RAM_CHARROM; + font_2x2(CHARGEN, FONT); + *PROCPORT = PROCPORT_BASIC_KERNEL_IO; + asm { cli } + + // Convert font to sprites + font_2x2_to_sprites(FONT, SPRITES, 64); + + // Initialize the multiplexer + plexInit(SCREEN); + + // Show screen + *D018 = toD018(SCREEN, CHARSET_DEFAULT); + + // Set the x-positions & pointers + unsigned int xp = 24; + char sprite = toSpritePtr(SPRITES); + for(char s: 0..PLEX_COUNT-1) { + PLEX_PTR[s] = sprite++; + PLEX_XPOS[s] = xp; + xp += 10; + } + // Enable & initialize sprites + *SPRITES_ENABLE = 0xff; + for(char s: 0..7) { + SPRITES_COLS[s] = WHITE; + } + + // Move the sprites + plexSine(); + // Sort the sprites by y-position + plexSort(); + + // Enable the plex IRQ + asm { sei } + // Disable CIA 1 Timer IRQ + *CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR; + // Set raster line to 0x00 + *VIC_CONTROL &=0x7f; + *RASTER = 0x28; + // Enable Raster Interrupt + *IRQ_ENABLE = IRQ_RASTER; + // Acknowledge any IRQ + *IRQ_STATUS = IRQ_RASTER; + // Set the IRQ routine + *KERNEL_IRQ = &plex_irq; + asm { cli } + + // Move & Sort - when needed! + while(true) { + while(!framedone) { + } + //*BORDERCOL = RED; + // Move the sprites + plexSine(); + // Sort the sprites by y-position + plexSort(); + //*BORDERCOL = GREEN; + framedone = false; + } +} + +// Y-sine index +char sin_idx = 0; + +// Move the plex sprites in an Y-sine +void plexSine() { + // Assign sinus positions + char y_idx = sin_idx; + for(char sy: 0..PLEX_COUNT-1) { + PLEX_YPOS[sy] = YSIN[y_idx]; + y_idx += 8; + } + sin_idx +=1; +} + +volatile bool framedone = false; + +// Show sprites from the multiplexer, rescheduling the IRQ as many times as needed +interrupt(kernel_min) void plex_irq() { + asm { sei } + //*BORDERCOL = WHITE; + // Show sprites until finding one that should not be shown until a few raster lines later + char rasterY; + do { + plexShowSprite(); + rasterY = plexFreeNextYpos(); + } while (plex_show_idx < PLEX_COUNT && rasterY < *RASTER+3); + + if (plex_show_idxglyph_bits_2x2; + next_2x2_left[l2+1] = >glyph_bits_2x2; + next_2x2_right[l2] = (SCREEN&$3fff)*4)|(>CHARSET_DEFAULT)/4&$f + .label sprite = 4 + // Set the x-positions & pointers + .label xp = 2 + // asm + // Create 2x2 font from CHARGEN + sei + // *PROCPORT = PROCPORT_RAM_CHARROM + lda #PROCPORT_RAM_CHARROM + sta PROCPORT + // font_2x2(CHARGEN, FONT) + jsr font_2x2 + // *PROCPORT = PROCPORT_BASIC_KERNEL_IO + lda #PROCPORT_BASIC_KERNEL_IO + sta PROCPORT + // asm + cli + // font_2x2_to_sprites(FONT, SPRITES, 64) + // Convert font to sprites + jsr font_2x2_to_sprites + // plexInit(SCREEN) + // Initialize the multiplexer + jsr plexInit + // *D018 = toD018(SCREEN, CHARSET_DEFAULT) + // Show screen + lda #toD0181_return + sta D018 + lda #<$18 + sta.z xp + lda #>$18 + sta.z xp+1 + ldx #0 + lda #toSpritePtr1_return + sta.z sprite + __b1: + // PLEX_PTR[s] = sprite++ + lda.z sprite + sta PLEX_PTR,x + // PLEX_PTR[s] = sprite++; + inc.z sprite + // PLEX_XPOS[s] = xp + txa + asl + tay + lda.z xp + sta PLEX_XPOS,y + lda.z xp+1 + sta PLEX_XPOS+1,y + // xp += 10 + lda #$a + clc + adc.z xp + sta.z xp + bcc !+ + inc.z xp+1 + !: + // for(char s: 0..PLEX_COUNT-1) + inx + cpx #PLEX_COUNT-1+1 + bne __b1 + // *SPRITES_ENABLE = 0xff + // Enable & initialize sprites + lda #$ff + sta SPRITES_ENABLE + ldx #0 + __b3: + // SPRITES_COLS[s] = WHITE + lda #WHITE + sta SPRITES_COLS,x + // for(char s: 0..7) + inx + cpx #8 + bne __b3 + // plexSine() + // Move the sprites + lda #0 + sta.z sin_idx + jsr plexSine + // plexSort() + // Sort the sprites by y-position + jsr plexSort + // asm + // Enable the plex IRQ + sei + // *CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR + // Disable CIA 1 Timer IRQ + lda #CIA_INTERRUPT_CLEAR + sta CIA1_INTERRUPT + // *VIC_CONTROL &=0x7f + // Set raster line to 0x00 + lda #$7f + and VIC_CONTROL + sta VIC_CONTROL + // *RASTER = 0x28 + lda #$28 + sta RASTER + // *IRQ_ENABLE = IRQ_RASTER + // Enable Raster Interrupt + lda #IRQ_RASTER + sta IRQ_ENABLE + // *IRQ_STATUS = IRQ_RASTER + // Acknowledge any IRQ + sta IRQ_STATUS + // *KERNEL_IRQ = &plex_irq + // Set the IRQ routine + lda #plex_irq + sta KERNEL_IRQ+1 + // asm + cli + __b5: + // while(!framedone) + lda.z framedone + cmp #0 + bne __b6 + jmp __b5 + __b6: + // plexSine() + //*BORDERCOL = RED; + // Move the sprites + jsr plexSine + // plexSort() + // Sort the sprites by y-position + jsr plexSort + // framedone = false + //*BORDERCOL = GREEN; + lda #0 + sta.z framedone + jmp __b5 +} +// Ensure that the indices in PLEX_SORTED_IDX is sorted based on the y-positions in PLEX_YPOS +// Assumes that the positions are nearly sorted already (as each sprite just moves a bit) +// Uses an insertion sort: +// 1. Moves a marker (m) from the start to end of the array. Every time the marker moves forward all elements before the marker are sorted correctly. +// 2a. If the next element after the marker is larger that the current element +// the marker can be moved forwards (as the sorting is correct). +// 2b. If the next element after the marker is smaller than the current element: +// elements before the marker are shifted right one at a time until encountering one smaller than the current one. +// It is then inserted at the spot. Now the marker can move forward. +plexSort: { + .label nxt_idx = $16 + .label nxt_y = $17 + .label m = 5 + lda #0 + sta.z m + __b1: + // nxt_idx = PLEX_SORTED_IDX[m+1] + ldy.z m + lda PLEX_SORTED_IDX+1,y + sta.z nxt_idx + // nxt_y = PLEX_YPOS[nxt_idx] + tay + lda PLEX_YPOS,y + sta.z nxt_y + // if(nxt_ySPRITES + sta.z sprite+1 + lda #FONT + sta.z char_current+1 + lda #0 + sta.z c + __b1: + // for(char c=0;c$40*8 + sta.z char_right+1 + lda.z char_current + sta.z char_left + lda.z char_current+1 + sta.z char_left+1 + lda #0 + sta.z sprite_idx + tax + __b3: + // i&7 + lda #7 + sax.z __3 + // sprite[sprite_idx++] = char_left[i&7] + ldy.z __3 + lda (char_left),y + ldy.z sprite_idx + sta (sprite),y + // sprite[sprite_idx++] = char_left[i&7]; + inc.z sprite_idx + // sprite[sprite_idx++] = char_right[i&7] + ldy.z __3 + lda (char_right),y + ldy.z sprite_idx + sta (sprite),y + // sprite[sprite_idx++] = char_right[i&7]; + iny + // sprite[sprite_idx++] = 0x00 + lda #0 + sta (sprite),y + // sprite[sprite_idx++] = 0x00; + iny + sty.z sprite_idx + // if(i==7) + cpx #7 + beq __b4 + // if(i==15) + cpx #$f + bne __b5 + lda #FONT+' '*8 + sta.z char_right+1 + lda #FONT+' '*8 + sta.z char_left+1 + __b5: + // for(char i: 0..20) + inx + cpx #$15 + bne __b3 + // char_current += 8 + lda #8 + clc + adc.z char_current + sta.z char_current + bcc !+ + inc.z char_current+1 + !: + // sprite += 0x40 + lda #$40 + clc + adc.z sprite + sta.z sprite + bcc !+ + inc.z sprite+1 + !: + // for(char c=0;c$80*8 + sta.z char_left+1 + // char_right = char_current + 0xc0*8 + lda.z char_current + clc + adc #<$c0*8 + sta.z char_right + lda.z char_current+1 + adc #>$c0*8 + sta.z char_right+1 + jmp __b5 +} +// Create a 2x2-font by doubling all pixels of the 64 first chars +// The font layout is: +// - 0x00 - 0x3f Upper left glyphs +// - 0x40 - 0x7f Upper right glyphs +// - 0x80 - 0xbf Lower left glyphs +// - 0xc0 - 0xff Lower right glyphs +font_2x2: { + .label __5 = $f + .label __7 = $f + .label next_2x2_left = 6 + .label next_2x2_right = $d + .label glyph_bits = $18 + .label glyph_bits_2x2 = $f + .label l2 = $17 + .label l = $16 + .label next_2x2_left_1 = $b + .label next_2x2 = 6 + .label next_original = 8 + .label c = $a + lda #0 + sta.z c + lda #CHARGEN + sta.z next_original+1 + lda #FONT + sta.z next_2x2_left+1 + __b1: + // next_2x2_right = next_2x2 + 0x40*8 + lda.z next_2x2_left + clc + adc #<$40*8 + sta.z next_2x2_right + lda.z next_2x2_left+1 + adc #>$40*8 + sta.z next_2x2_right+1 + lda.z next_2x2_left + sta.z next_2x2_left_1 + lda.z next_2x2_left+1 + sta.z next_2x2_left_1+1 + lda #0 + sta.z l2 + sta.z l + __b2: + // glyph_bits = next_original[l] + ldy.z l + lda (next_original),y + sta.z glyph_bits + ldy #0 + tya + sta.z glyph_bits_2x2 + sta.z glyph_bits_2x2+1 + __b3: + // glyph_bits&0x80 + lda #$80 + and.z glyph_bits + // (glyph_bits&0x80)?1uc:0uc + cmp #0 + bne __b4 + ldx #0 + jmp __b5 + __b4: + // (glyph_bits&0x80)?1uc:0uc + ldx #1 + __b5: + // glyph_bits_2x2<<1 + asl.z __5 + rol.z __5+1 + // glyph_bits_2x2 = glyph_bits_2x2<<1|glyph_bit + txa + ora.z glyph_bits_2x2 + sta.z glyph_bits_2x2 + // glyph_bits_2x2<<1 + asl.z __7 + rol.z __7+1 + // glyph_bits_2x2 = glyph_bits_2x2<<1|glyph_bit + txa + ora.z glyph_bits_2x2 + sta.z glyph_bits_2x2 + // glyph_bits <<= 1 + // Move to next bit + asl.z glyph_bits + // for(char b: 0..7) + iny + cpy #8 + bne __b3 + // >glyph_bits_2x2 + lda.z glyph_bits_2x2+1 + // next_2x2_left[l2] = >glyph_bits_2x2 + // Put the generated 2x2-line into the 2x2-font twice + ldy.z l2 + sta (next_2x2_left_1),y + // l2+1 + iny + // next_2x2_left[l2+1] = >glyph_bits_2x2 + sta (next_2x2_left_1),y + // $80*8 + sta.z next_2x2_left_1+1 + // next_2x2_right = next_2x2 + 0xc0*8 + lda.z next_2x2_left + clc + adc #<$c0*8 + sta.z next_2x2_right + lda.z next_2x2_left+1 + adc #>$c0*8 + sta.z next_2x2_right+1 + lda #0 + sta.z l2 + __b8: + // for(char l: 0..7) + inc.z l + lda #8 + cmp.z l + bne __b2 + // next_2x2 += 8 + clc + adc.z next_2x2 + sta.z next_2x2 + bcc !+ + inc.z next_2x2+1 + !: + // next_original += 8 + lda #8 + clc + adc.z next_original + sta.z next_original + bcc !+ + inc.z next_original+1 + !: + // for(char c: 0..0x3f) + inc.z c + lda #$40 + cmp.z c + beq !__b1+ + jmp __b1 + !__b1: + // } + rts +} +// Show sprites from the multiplexer, rescheduling the IRQ as many times as needed +plex_irq: { + .label __4 = $19 + // asm + sei + __b3: + // plexShowSprite() + jsr plexShowSprite + // return PLEX_FREE_YPOS[plex_free_next]; + ldy.z plex_free_next + ldx PLEX_FREE_YPOS,y + // *RASTER+3 + lda #3 + clc + adc RASTER + sta.z __4 + // while (plex_show_idx < PLEX_COUNT && rasterY < *RASTER+3) + lda.z plex_show_idx + cmp #PLEX_COUNT + bcs __b4 + cpx.z __4 + bcc __b3 + __b4: + // if (plex_show_idxPLEX_XPOS[xpos_idx] + lda PLEX_XPOS+1,x + // if(>PLEX_XPOS[xpos_idx]!=0) + cmp #0 + bne __b1 + // 0xff^plex_sprite_msb + lda #$ff + eor.z plex_sprite_msb + // *SPRITES_XMSB &= (0xff^plex_sprite_msb) + and SPRITES_XMSB + sta SPRITES_XMSB + __b2: + // plex_sprite_idx+1 + ldx.z plex_sprite_idx + inx + // (plex_sprite_idx+1)&7 + txa + and #7 + // plex_sprite_idx = (plex_sprite_idx+1)&7 + sta.z plex_sprite_idx + // plex_show_idx++; + inc.z plex_show_idx + // plex_sprite_msb <<=1 + asl.z plex_sprite_msb + // if(plex_sprite_msb==0) + lda.z plex_sprite_msb + cmp #0 + bne __breturn + // plex_sprite_msb = 1 + lda #1 + sta.z plex_sprite_msb + __breturn: + // } + rts + __b1: + // *SPRITES_XMSB |= plex_sprite_msb + lda SPRITES_XMSB + ora.z plex_sprite_msb + sta SPRITES_XMSB + jmp __b2 +} + // The x-positions of the multiplexer sprites (0x000-0x1ff) + PLEX_XPOS: .fill 2*PLEX_COUNT, 0 + // The y-positions of the multiplexer sprites. + PLEX_YPOS: .fill PLEX_COUNT, 0 + // The sprite pointers for the multiplexed sprites + 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 + // 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 + //kickasm(pc FONT, resource "elefont.bin") {{ + // .import binary "elefont.bin" + //}} + .align $100 +YSIN: +.fill $100, round(142+89.5*sin(toRadians(360*i/256))) + diff --git a/src/test/ref/complex/spritescroller/spritescroller.cfg b/src/test/ref/complex/spritescroller/spritescroller.cfg new file mode 100644 index 000000000..045013ae4 --- /dev/null +++ b/src/test/ref/complex/spritescroller/spritescroller.cfg @@ -0,0 +1,390 @@ +@begin: scope:[] from + [0] phi() + to:@1 +@1: scope:[] from @begin + [1] (volatile byte) plex_show_idx ← (byte) 0 + [2] (volatile byte) plex_sprite_idx ← (byte) 0 + [3] (volatile byte) plex_sprite_msb ← (byte) 1 + to:@2 +@2: scope:[] from @1 + [4] (volatile byte) plex_free_next ← (byte) 0 + to:@3 +@3: scope:[] from @2 + [5] (volatile bool) framedone ← false + to:@4 +@4: scope:[] from @3 + [6] phi() + [7] call main + to:@end +@end: scope:[] from @4 + [8] phi() + +(void()) main() +main: scope:[main] from @4 + asm { sei } + [10] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_CHARROM + [11] call font_2x2 + to:main::@8 +main::@8: scope:[main] from main + [12] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_BASIC_KERNEL_IO + asm { cli } + [14] call font_2x2_to_sprites + to:main::@9 +main::@9: scope:[main] from main::@8 + [15] phi() + [16] call plexInit + to:main::toD0181 +main::toD0181: scope:[main] from main::@9 + [17] phi() + to:main::@7 +main::@7: scope:[main] from main::toD0181 + [18] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 + to:main::toSpritePtr1 +main::toSpritePtr1: scope:[main] from main::@7 + [19] phi() + to:main::@1 +main::@1: scope:[main] from main::@1 main::toSpritePtr1 + [20] (word) main::xp#2 ← phi( main::@1/(word) main::xp#1 main::toSpritePtr1/(word) $18 ) + [20] (byte) main::s#2 ← phi( main::@1/(byte) main::s#1 main::toSpritePtr1/(byte) 0 ) + [20] (byte) main::sprite#2 ← phi( main::@1/(byte) main::sprite#1 main::toSpritePtr1/(const byte) main::toSpritePtr1_return#0 ) + [21] *((const byte*) PLEX_PTR + (byte) main::s#2) ← (byte) main::sprite#2 + [22] (byte) main::sprite#1 ← ++ (byte) main::sprite#2 + [23] (byte~) main::$12 ← (byte) main::s#2 << (byte) 1 + [24] *((const word*) PLEX_XPOS + (byte~) main::$12) ← (word) main::xp#2 + [25] (word) main::xp#1 ← (word) main::xp#2 + (byte) $a + [26] (byte) main::s#1 ← ++ (byte) main::s#2 + [27] if((byte) main::s#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto main::@1 + to:main::@2 +main::@2: scope:[main] from main::@1 + [28] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff + to:main::@3 +main::@3: scope:[main] from main::@2 main::@3 + [29] (byte) main::s1#2 ← phi( main::@2/(byte) 0 main::@3/(byte) main::s1#1 ) + [30] *((const nomodify byte*) SPRITES_COLS + (byte) main::s1#2) ← (const nomodify byte) WHITE + [31] (byte) main::s1#1 ← ++ (byte) main::s1#2 + [32] if((byte) main::s1#1!=(byte) 8) goto main::@3 + to:main::@4 +main::@4: scope:[main] from main::@3 + [33] phi() + [34] call plexSine + to:main::@10 +main::@10: scope:[main] from main::@4 + [35] phi() + [36] call plexSort + to:main::@11 +main::@11: scope:[main] from main::@10 + asm { sei } + [38] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR + [39] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f + [40] *((const nomodify byte*) RASTER) ← (byte) $28 + [41] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER + [42] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER + [43] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() + asm { cli } + to:main::@5 +main::@5: scope:[main] from main::@11 main::@13 main::@5 + [45] if((volatile bool) framedone) goto main::@6 + to:main::@5 +main::@6: scope:[main] from main::@5 + [46] phi() + [47] call plexSine + to:main::@12 +main::@12: scope:[main] from main::@6 + [48] phi() + [49] call plexSort + to:main::@13 +main::@13: scope:[main] from main::@12 + [50] (volatile bool) framedone ← false + to:main::@5 + +(void()) plexSort() +plexSort: scope:[plexSort] from main::@10 main::@12 + [51] phi() + to:plexSort::@1 +plexSort::@1: scope:[plexSort] from plexSort plexSort::@2 + [52] (byte) plexSort::m#2 ← phi( plexSort/(byte) 0 plexSort::@2/(byte) plexSort::m#1 ) + [53] (byte) plexSort::nxt_idx#0 ← *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2) + [54] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0) + [55] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 + to:plexSort::@5 +plexSort::@5: scope:[plexSort] from plexSort::@1 + [56] (byte) plexSort::s#6 ← (byte) plexSort::m#2 + to:plexSort::@3 +plexSort::@3: scope:[plexSort] from plexSort::@5 plexSort::@7 + [57] (byte) plexSort::s#3 ← phi( plexSort::@7/(byte) plexSort::s#1 plexSort::@5/(byte) plexSort::s#6 ) + [58] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) + [59] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 + [60] if((byte) plexSort::s#1==(byte) $ff) goto plexSort::@4 + to:plexSort::@7 +plexSort::@7: scope:[plexSort] from plexSort::@3 + [61] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 + to:plexSort::@4 +plexSort::@4: scope:[plexSort] from plexSort::@3 plexSort::@7 + [62] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 + [63] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 + to:plexSort::@2 +plexSort::@2: scope:[plexSort] from plexSort::@1 plexSort::@4 + [64] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 + [65] if((byte) plexSort::m#1!=(const nomodify byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1 + to:plexSort::@6 +plexSort::@6: scope:[plexSort] from plexSort::@2 + [66] (volatile byte) plex_show_idx ← (byte) 0 + [67] (volatile byte) plex_sprite_idx ← (byte) 0 + [68] (volatile byte) plex_sprite_msb ← (byte) 1 + to:plexSort::plexFreePrepare1 +plexSort::plexFreePrepare1: scope:[plexSort] from plexSort::@6 + [69] phi() + to:plexSort::plexFreePrepare1_@1 +plexSort::plexFreePrepare1_@1: scope:[plexSort] from plexSort::plexFreePrepare1 plexSort::plexFreePrepare1_@1 + [70] (byte) plexSort::plexFreePrepare1_s#2 ← phi( plexSort::plexFreePrepare1/(byte) 0 plexSort::plexFreePrepare1_@1/(byte) plexSort::plexFreePrepare1_s#1 ) + [71] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 + [72] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 + [73] 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 + [74] (volatile byte) plex_free_next ← (byte) 0 + to:plexSort::@return +plexSort::@return: scope:[plexSort] from plexSort::plexFreePrepare1_@2 + [75] return + to:@return + +(void()) plexSine() +plexSine: scope:[plexSine] from main::@4 main::@6 + [76] (byte) sin_idx#10 ← phi( main::@6/(byte) sin_idx#12 main::@4/(byte) 0 ) + [77] (byte) plexSine::y_idx#0 ← (byte) sin_idx#10 + to:plexSine::@1 +plexSine::@1: scope:[plexSine] from plexSine plexSine::@1 + [78] (byte) plexSine::sy#2 ← phi( plexSine/(byte) 0 plexSine::@1/(byte) plexSine::sy#1 ) + [78] (byte) plexSine::y_idx#2 ← phi( plexSine/(byte) plexSine::y_idx#0 plexSine::@1/(byte) plexSine::y_idx#1 ) + [79] *((const byte*) PLEX_YPOS + (byte) plexSine::sy#2) ← *((const byte*) YSIN + (byte) plexSine::y_idx#2) + [80] (byte) plexSine::y_idx#1 ← (byte) plexSine::y_idx#2 + (byte) 8 + [81] (byte) plexSine::sy#1 ← ++ (byte) plexSine::sy#2 + [82] if((byte) plexSine::sy#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto plexSine::@1 + to:plexSine::@2 +plexSine::@2: scope:[plexSine] from plexSine::@1 + [83] (byte) sin_idx#12 ← (byte) sin_idx#10 + (byte) 1 + to:plexSine::@return +plexSine::@return: scope:[plexSine] from plexSine::@2 + [84] return + to:@return + +(void()) plexInit((byte*) plexInit::screen) +plexInit: scope:[plexInit] from main::@9 + [85] phi() + to:plexInit::plexSetScreen1 +plexInit::plexSetScreen1: scope:[plexInit] from plexInit + [86] phi() + to:plexInit::@1 +plexInit::@1: scope:[plexInit] from plexInit::@1 plexInit::plexSetScreen1 + [87] (byte) plexInit::i#2 ← phi( plexInit::@1/(byte) plexInit::i#1 plexInit::plexSetScreen1/(byte) 0 ) + [88] *((const byte*) PLEX_SORTED_IDX + (byte) plexInit::i#2) ← (byte) plexInit::i#2 + [89] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2 + [90] if((byte) plexInit::i#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto plexInit::@1 + to:plexInit::@return +plexInit::@return: scope:[plexInit] from plexInit::@1 + [91] return + to:@return + +(void()) font_2x2_to_sprites((byte*) font_2x2_to_sprites::font_2x2 , (byte*) font_2x2_to_sprites::sprites , (byte) font_2x2_to_sprites::num_chars) +font_2x2_to_sprites: scope:[font_2x2_to_sprites] from main::@8 + [92] phi() + to:font_2x2_to_sprites::@1 +font_2x2_to_sprites::@1: scope:[font_2x2_to_sprites] from font_2x2_to_sprites font_2x2_to_sprites::@7 + [93] (byte*) font_2x2_to_sprites::sprite#4 ← phi( font_2x2_to_sprites/(const nomodify byte*) SPRITES font_2x2_to_sprites::@7/(byte*) font_2x2_to_sprites::sprite#1 ) + [93] (byte*) font_2x2_to_sprites::char_current#2 ← phi( font_2x2_to_sprites/(const nomodify byte*) FONT font_2x2_to_sprites::@7/(byte*) font_2x2_to_sprites::char_current#1 ) + [93] (byte) font_2x2_to_sprites::c#2 ← phi( font_2x2_to_sprites/(byte) 0 font_2x2_to_sprites::@7/(byte) font_2x2_to_sprites::c#1 ) + [94] if((byte) font_2x2_to_sprites::c#2<(const byte) font_2x2_to_sprites::num_chars#0) goto font_2x2_to_sprites::@2 + to:font_2x2_to_sprites::@return +font_2x2_to_sprites::@return: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@1 + [95] return + to:@return +font_2x2_to_sprites::@2: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@1 + [96] (byte*) font_2x2_to_sprites::char_right#0 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $40*(number) 8 + [97] (byte*) font_2x2_to_sprites::char_left#6 ← (byte*) font_2x2_to_sprites::char_current#2 + to:font_2x2_to_sprites::@3 +font_2x2_to_sprites::@3: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@2 font_2x2_to_sprites::@5 + [98] (byte*) font_2x2_to_sprites::char_right#3 ← phi( font_2x2_to_sprites::@2/(byte*) font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::@5/(byte*) font_2x2_to_sprites::char_right#4 ) + [98] (byte) font_2x2_to_sprites::sprite_idx#4 ← phi( font_2x2_to_sprites::@2/(byte) 0 font_2x2_to_sprites::@5/(byte) font_2x2_to_sprites::sprite_idx#3 ) + [98] (byte*) font_2x2_to_sprites::char_left#3 ← phi( font_2x2_to_sprites::@2/(byte*) font_2x2_to_sprites::char_left#6 font_2x2_to_sprites::@5/(byte*) font_2x2_to_sprites::char_left#4 ) + [98] (byte) font_2x2_to_sprites::i#2 ← phi( font_2x2_to_sprites::@2/(byte) 0 font_2x2_to_sprites::@5/(byte) font_2x2_to_sprites::i#1 ) + [99] (byte~) font_2x2_to_sprites::$3 ← (byte) font_2x2_to_sprites::i#2 & (byte) 7 + [100] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#4) ← *((byte*) font_2x2_to_sprites::char_left#3 + (byte~) font_2x2_to_sprites::$3) + [101] (byte) font_2x2_to_sprites::sprite_idx#1 ← ++ (byte) font_2x2_to_sprites::sprite_idx#4 + [102] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#1) ← *((byte*) font_2x2_to_sprites::char_right#3 + (byte~) font_2x2_to_sprites::$3) + [103] (byte) font_2x2_to_sprites::sprite_idx#2 ← ++ (byte) font_2x2_to_sprites::sprite_idx#1 + [104] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#2) ← (byte) 0 + [105] (byte) font_2x2_to_sprites::sprite_idx#3 ← ++ (byte) font_2x2_to_sprites::sprite_idx#2 + [106] if((byte) font_2x2_to_sprites::i#2==(byte) 7) goto font_2x2_to_sprites::@4 + to:font_2x2_to_sprites::@6 +font_2x2_to_sprites::@6: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@3 + [107] if((byte) font_2x2_to_sprites::i#2!=(byte) $f) goto font_2x2_to_sprites::@8 + to:font_2x2_to_sprites::@5 +font_2x2_to_sprites::@8: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@6 + [108] phi() + to:font_2x2_to_sprites::@5 +font_2x2_to_sprites::@5: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@4 font_2x2_to_sprites::@6 font_2x2_to_sprites::@8 + [109] (byte*) font_2x2_to_sprites::char_right#4 ← phi( font_2x2_to_sprites::@4/(byte*) font_2x2_to_sprites::char_right#1 font_2x2_to_sprites::@8/(byte*) font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::@6/(const nomodify byte*) FONT+(byte) ' '*(byte) 8 ) + [109] (byte*) font_2x2_to_sprites::char_left#4 ← phi( font_2x2_to_sprites::@4/(byte*) font_2x2_to_sprites::char_left#1 font_2x2_to_sprites::@8/(byte*) font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::@6/(const nomodify byte*) FONT+(byte) ' '*(byte) 8 ) + [110] (byte) font_2x2_to_sprites::i#1 ← ++ (byte) font_2x2_to_sprites::i#2 + [111] if((byte) font_2x2_to_sprites::i#1!=(byte) $15) goto font_2x2_to_sprites::@3 + to:font_2x2_to_sprites::@7 +font_2x2_to_sprites::@7: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@5 + [112] (byte*) font_2x2_to_sprites::char_current#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (byte) 8 + [113] (byte*) font_2x2_to_sprites::sprite#1 ← (byte*) font_2x2_to_sprites::sprite#4 + (byte) $40 + [114] (byte) font_2x2_to_sprites::c#1 ← ++ (byte) font_2x2_to_sprites::c#2 + to:font_2x2_to_sprites::@1 +font_2x2_to_sprites::@4: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@3 + [115] (byte*) font_2x2_to_sprites::char_left#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $80*(number) 8 + [116] (byte*) font_2x2_to_sprites::char_right#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $c0*(number) 8 + to:font_2x2_to_sprites::@5 + +(void()) font_2x2((byte*) font_2x2::font_original , (byte*) font_2x2::font_2x2) +font_2x2: scope:[font_2x2] from main + [117] phi() + to:font_2x2::@1 +font_2x2::@1: scope:[font_2x2] from font_2x2 font_2x2::@9 + [118] (byte) font_2x2::c#11 ← phi( font_2x2/(byte) 0 font_2x2::@9/(byte) font_2x2::c#1 ) + [118] (byte*) font_2x2::next_original#4 ← phi( font_2x2/(const nomodify byte*) CHARGEN font_2x2::@9/(byte*) font_2x2::next_original#1 ) + [118] (byte*) font_2x2::next_2x2_left#0 ← phi( font_2x2/(const nomodify byte*) FONT font_2x2::@9/(byte*) font_2x2::next_2x2#1 ) + [119] (byte*) font_2x2::next_2x2_right#0 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $40*(number) 8 + [120] (byte*) font_2x2::next_2x2_left#10 ← (byte*) font_2x2::next_2x2_left#0 + to:font_2x2::@2 +font_2x2::@2: scope:[font_2x2] from font_2x2::@1 font_2x2::@8 + [121] (byte*) font_2x2::next_2x2_right#7 ← phi( font_2x2::@1/(byte*) font_2x2::next_2x2_right#0 font_2x2::@8/(byte*) font_2x2::next_2x2_right#8 ) + [121] (byte) font_2x2::l2#8 ← phi( font_2x2::@1/(byte) 0 font_2x2::@8/(byte) font_2x2::l2#9 ) + [121] (byte*) font_2x2::next_2x2_left#7 ← phi( font_2x2::@1/(byte*) font_2x2::next_2x2_left#10 font_2x2::@8/(byte*) font_2x2::next_2x2_left#8 ) + [121] (byte) font_2x2::l#2 ← phi( font_2x2::@1/(byte) 0 font_2x2::@8/(byte) font_2x2::l#1 ) + [122] (byte) font_2x2::glyph_bits#0 ← *((byte*) font_2x2::next_original#4 + (byte) font_2x2::l#2) + to:font_2x2::@3 +font_2x2::@3: scope:[font_2x2] from font_2x2::@2 font_2x2::@5 + [123] (byte) font_2x2::b#2 ← phi( font_2x2::@2/(byte) 0 font_2x2::@5/(byte) font_2x2::b#1 ) + [123] (word) font_2x2::glyph_bits_2x2#3 ← phi( font_2x2::@2/(word) 0 font_2x2::@5/(word) font_2x2::glyph_bits_2x2#2 ) + [123] (byte) font_2x2::glyph_bits#2 ← phi( font_2x2::@2/(byte) font_2x2::glyph_bits#0 font_2x2::@5/(byte) font_2x2::glyph_bits#1 ) + [124] (byte~) font_2x2::$1 ← (byte) font_2x2::glyph_bits#2 & (byte) $80 + [125] if((byte) 0!=(byte~) font_2x2::$1) goto font_2x2::@4 + to:font_2x2::@5 +font_2x2::@4: scope:[font_2x2] from font_2x2::@3 + [126] phi() + to:font_2x2::@5 +font_2x2::@5: scope:[font_2x2] from font_2x2::@3 font_2x2::@4 + [127] (byte) font_2x2::glyph_bit#0 ← phi( font_2x2::@4/(byte) 1 font_2x2::@3/(byte) 0 ) + [128] (word~) font_2x2::$5 ← (word) font_2x2::glyph_bits_2x2#3 << (byte) 1 + [129] (word) font_2x2::glyph_bits_2x2#1 ← (word~) font_2x2::$5 | (byte) font_2x2::glyph_bit#0 + [130] (word~) font_2x2::$7 ← (word) font_2x2::glyph_bits_2x2#1 << (byte) 1 + [131] (word) font_2x2::glyph_bits_2x2#2 ← (word~) font_2x2::$7 | (byte) font_2x2::glyph_bit#0 + [132] (byte) font_2x2::glyph_bits#1 ← (byte) font_2x2::glyph_bits#2 << (byte) 1 + [133] (byte) font_2x2::b#1 ← ++ (byte) font_2x2::b#2 + [134] if((byte) font_2x2::b#1!=(byte) 8) goto font_2x2::@3 + to:font_2x2::@6 +font_2x2::@6: scope:[font_2x2] from font_2x2::@5 + [135] (byte~) font_2x2::$12 ← > (word) font_2x2::glyph_bits_2x2#2 + [136] *((byte*) font_2x2::next_2x2_left#7 + (byte) font_2x2::l2#8) ← (byte~) font_2x2::$12 + [137] (byte~) font_2x2::$11 ← (byte) font_2x2::l2#8 + (byte) 1 + [138] *((byte*) font_2x2::next_2x2_left#7 + (byte~) font_2x2::$11) ← (byte~) font_2x2::$12 + [139] (byte~) font_2x2::$15 ← < (word) font_2x2::glyph_bits_2x2#2 + [140] *((byte*) font_2x2::next_2x2_right#7 + (byte) font_2x2::l2#8) ← (byte~) font_2x2::$15 + [141] (byte~) font_2x2::$14 ← (byte) font_2x2::l2#8 + (byte) 1 + [142] *((byte*) font_2x2::next_2x2_right#7 + (byte~) font_2x2::$14) ← (byte~) font_2x2::$15 + [143] (byte) font_2x2::l2#1 ← (byte) font_2x2::l2#8 + (byte) 2 + [144] if((byte) font_2x2::l2#1!=(byte) 8) goto font_2x2::@8 + to:font_2x2::@7 +font_2x2::@7: scope:[font_2x2] from font_2x2::@6 + [145] (byte*) font_2x2::next_2x2_left#1 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $80*(number) 8 + [146] (byte*) font_2x2::next_2x2_right#1 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $c0*(number) 8 + to:font_2x2::@8 +font_2x2::@8: scope:[font_2x2] from font_2x2::@6 font_2x2::@7 + [147] (byte*) font_2x2::next_2x2_right#8 ← phi( font_2x2::@7/(byte*) font_2x2::next_2x2_right#1 font_2x2::@6/(byte*) font_2x2::next_2x2_right#7 ) + [147] (byte) font_2x2::l2#9 ← phi( font_2x2::@7/(byte) 0 font_2x2::@6/(byte) font_2x2::l2#1 ) + [147] (byte*) font_2x2::next_2x2_left#8 ← phi( font_2x2::@7/(byte*) font_2x2::next_2x2_left#1 font_2x2::@6/(byte*) font_2x2::next_2x2_left#7 ) + [148] (byte) font_2x2::l#1 ← ++ (byte) font_2x2::l#2 + [149] if((byte) font_2x2::l#1!=(byte) 8) goto font_2x2::@2 + to:font_2x2::@9 +font_2x2::@9: scope:[font_2x2] from font_2x2::@8 + [150] (byte*) font_2x2::next_2x2#1 ← (byte*) font_2x2::next_2x2_left#0 + (byte) 8 + [151] (byte*) font_2x2::next_original#1 ← (byte*) font_2x2::next_original#4 + (byte) 8 + [152] (byte) font_2x2::c#1 ← ++ (byte) font_2x2::c#11 + [153] if((byte) font_2x2::c#1!=(byte) $40) goto font_2x2::@1 + to:font_2x2::@return +font_2x2::@return: scope:[font_2x2] from font_2x2::@9 + [154] return + to:@return + +interrupt(KERNEL_MIN)(void()) plex_irq() +plex_irq: scope:[plex_irq] from + asm { sei } + to:plex_irq::@3 +plex_irq::@3: scope:[plex_irq] from plex_irq plex_irq::@7 + [156] phi() + [157] call plexShowSprite + to:plex_irq::plexFreeNextYpos1 +plex_irq::plexFreeNextYpos1: scope:[plex_irq] from plex_irq::@3 + [158] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) + to:plex_irq::@6 +plex_irq::@6: scope:[plex_irq] from plex_irq::plexFreeNextYpos1 + [159] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 3 + [160] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 + to:plex_irq::@7 +plex_irq::@7: scope:[plex_irq] from plex_irq::@6 + [161] 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 + [162] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 + to:plex_irq::@5 +plex_irq::@5: scope:[plex_irq] from plex_irq::@4 + [163] *((const nomodify byte*) RASTER) ← (byte) $28 + [164] (volatile bool) framedone ← true + to:plex_irq::@2 +plex_irq::@2: scope:[plex_irq] from plex_irq::@1 plex_irq::@5 + [165] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER + asm { cli } + to:plex_irq::@return +plex_irq::@return: scope:[plex_irq] from plex_irq::@2 + [167] return + to:@return +plex_irq::@1: scope:[plex_irq] from plex_irq::@4 + [168] *((const nomodify byte*) RASTER) ← (byte) plex_irq::plexFreeNextYpos1_return#0 + to:plex_irq::@2 + +(void()) plexShowSprite() +plexShowSprite: scope:[plexShowSprite] from plex_irq::@3 + [169] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 + [170] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) + [171] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + to:plexShowSprite::plexFreeAdd1 +plexShowSprite::plexFreeAdd1: scope:[plexShowSprite] from plexShowSprite + [172] (byte~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte) $15 + [173] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 + [174] (byte~) plexShowSprite::plexFreeAdd1_$1 ← (volatile byte) plex_free_next + (byte) 1 + [175] (byte~) plexShowSprite::plexFreeAdd1_$2 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7 + [176] (volatile byte) plex_free_next ← (byte~) plexShowSprite::plexFreeAdd1_$2 + to:plexShowSprite::@5 +plexShowSprite::@5: scope:[plexShowSprite] from plexShowSprite::plexFreeAdd1 + [177] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) + [178] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) + [179] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 + [180] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) + [181] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 + [182] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) + [183] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1 + to:plexShowSprite::@3 +plexShowSprite::@3: scope:[plexShowSprite] from plexShowSprite::@5 + [184] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb + [185] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 + to:plexShowSprite::@2 +plexShowSprite::@2: scope:[plexShowSprite] from plexShowSprite::@1 plexShowSprite::@3 + [186] (byte~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (byte) 1 + [187] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7 + [188] (volatile byte) plex_sprite_idx ← (byte~) plexShowSprite::$6 + [189] (volatile byte) plex_show_idx ← ++ (volatile byte) plex_show_idx + [190] (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (byte) 1 + [191] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return + to:plexShowSprite::@4 +plexShowSprite::@4: scope:[plexShowSprite] from plexShowSprite::@2 + [192] (volatile byte) plex_sprite_msb ← (byte) 1 + to:plexShowSprite::@return +plexShowSprite::@return: scope:[plexShowSprite] from plexShowSprite::@2 plexShowSprite::@4 + [193] return + to:@return +plexShowSprite::@1: scope:[plexShowSprite] from plexShowSprite::@5 + [194] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb + to:plexShowSprite::@2 diff --git a/src/test/ref/complex/spritescroller/spritescroller.log b/src/test/ref/complex/spritescroller/spritescroller.log new file mode 100644 index 000000000..115479275 --- /dev/null +++ b/src/test/ref/complex/spritescroller/spritescroller.log @@ -0,0 +1,7567 @@ +Resolved forward reference plex_irq to interrupt(KERNEL_MIN)(void()) plex_irq() +Resolved forward reference framedone to (volatile bool) framedone +Resolved forward reference framedone to (volatile bool) framedone +Fixing pointer array-indexing *((const word*) PLEX_XPOS + (byte) plexShowSprite::xpos_idx) +Fixing pointer array-indexing *((const word*) PLEX_XPOS + (byte) plexShowSprite::xpos_idx) +Fixing pointer array-indexing *((const word*) PLEX_XPOS + (byte) main::s) +Warning! Adding boolean cast to non-boolean condition (number~) font_2x2::$1 +Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx +Inlined call call plexSetScreen (byte*) plexInit::screen +Inlined call call plexFreePrepare +Inlined call call plexFreeAdd (byte) plexShowSprite::ypos +Inlined call (byte~) main::$3 ← call toD018 (const nomodify byte*) SCREEN (const nomodify byte*) CHARSET_DEFAULT +Inlined call (byte~) main::$4 ← call toSpritePtr (const nomodify byte*) SPRITES +Inlined call (byte~) plex_irq::$2 ← call plexFreeNextYpos +Culled Empty Block (label) @1 +Culled Empty Block (label) @2 +Culled Empty Block (label) @3 +Culled Empty Block (label) plexInit::plexSetScreen1_@return +Culled Empty Block (label) plexInit::@2 +Culled Empty Block (label) @5 +Culled Empty Block (label) @6 +Culled Empty Block (label) plexSort::plexFreePrepare1_@return +Culled Empty Block (label) plexSort::@7 +Culled Empty Block (label) @7 +Culled Empty Block (label) plexShowSprite::plexFreeAdd1_@return +Culled Empty Block (label) plexShowSprite::@5 +Culled Empty Block (label) plexShowSprite::@3 +Culled Empty Block (label) @8 +Culled Empty Block (label) @10 +Culled Empty Block (label) @11 +Culled Empty Block (label) @12 +Culled Empty Block (label) main::toD0181_@1 +Culled Empty Block (label) main::toSpritePtr1_@1 +Culled Empty Block (label) main::@6 +Culled Empty Block (label) main::@15 +Culled Empty Block (label) main::@7 +Culled Empty Block (label) main::@16 +Culled Empty Block (label) main::@9 +Culled Empty Block (label) main::@11 +Culled Empty Block (label) main::@12 +Culled Empty Block (label) main::@13 +Culled Empty Block (label) main::@14 +Culled Empty Block (label) plex_irq::plexFreeNextYpos1_@1 +Culled Empty Block (label) plex_irq::@6 +Culled Empty Block (label) @15 +Culled Empty Block (label) font_2x2_to_sprites::@13 +Culled Empty Block (label) font_2x2_to_sprites::@3 +Culled Empty Block (label) font_2x2_to_sprites::@14 +Culled Empty Block (label) font_2x2_to_sprites::@6 +Culled Empty Block (label) font_2x2_to_sprites::@10 +Culled Empty Block (label) font_2x2_to_sprites::@12 +Culled Empty Block (label) @16 +Culled Empty Block (label) font_2x2::@7 +Culled Empty Block (label) font_2x2::@8 +Culled Empty Block (label) font_2x2::@13 + +CONTROL FLOW GRAPH SSA +@begin: scope:[] from + to:@4 +@4: scope:[] from @begin + (byte*) PLEX_SCREEN_PTR#0 ← (byte*)(number) $400+(number) $3f8 + (volatile byte) plex_show_idx ← (byte) 0 + (volatile byte) plex_sprite_idx ← (byte) 0 + (volatile byte) plex_sprite_msb ← (byte) 1 + to:@9 + +(void()) plexInit((byte*) plexInit::screen) +plexInit: scope:[plexInit] from main::@20 + (byte*) plexInit::screen#1 ← phi( main::@20/(byte*) plexInit::screen#0 ) + (byte*) plexInit::plexSetScreen1_screen#0 ← (byte*) plexInit::screen#1 + to:plexInit::plexSetScreen1 +plexInit::plexSetScreen1: scope:[plexInit] from plexInit + (byte*) plexInit::plexSetScreen1_screen#1 ← phi( plexInit/(byte*) plexInit::plexSetScreen1_screen#0 ) + (byte*~) plexInit::plexSetScreen1_$0 ← (byte*) plexInit::plexSetScreen1_screen#1 + (number) $3f8 + (byte*) PLEX_SCREEN_PTR#1 ← (byte*~) plexInit::plexSetScreen1_$0 + to:plexInit::@3 +plexInit::@3: scope:[plexInit] from plexInit::plexSetScreen1 + (byte*) PLEX_SCREEN_PTR#16 ← phi( plexInit::plexSetScreen1/(byte*) PLEX_SCREEN_PTR#1 ) + (byte) plexInit::i#0 ← (byte) 0 + to:plexInit::@1 +plexInit::@1: scope:[plexInit] from plexInit::@1 plexInit::@3 + (byte*) PLEX_SCREEN_PTR#11 ← phi( plexInit::@1/(byte*) PLEX_SCREEN_PTR#11 plexInit::@3/(byte*) PLEX_SCREEN_PTR#16 ) + (byte) plexInit::i#2 ← phi( plexInit::@1/(byte) plexInit::i#1 plexInit::@3/(byte) plexInit::i#0 ) + *((const byte*) PLEX_SORTED_IDX + (byte) plexInit::i#2) ← (byte) plexInit::i#2 + (byte) plexInit::i#1 ← (byte) plexInit::i#2 + rangenext(0,PLEX_COUNT-1) + (bool~) plexInit::$1 ← (byte) plexInit::i#1 != rangelast(0,PLEX_COUNT-1) + if((bool~) plexInit::$1) goto plexInit::@1 + to:plexInit::@return +plexInit::@return: scope:[plexInit] from plexInit::@1 + (byte*) PLEX_SCREEN_PTR#6 ← phi( plexInit::@1/(byte*) PLEX_SCREEN_PTR#11 ) + (byte*) PLEX_SCREEN_PTR#2 ← (byte*) PLEX_SCREEN_PTR#6 + return + to:@return + +(void()) plexSort() +plexSort: scope:[plexSort] from main::@22 main::@24 + (byte) plexSort::m#0 ← (byte) 0 + to:plexSort::@1 +plexSort::@1: scope:[plexSort] from plexSort plexSort::@2 + (byte) plexSort::m#2 ← phi( plexSort/(byte) plexSort::m#0 plexSort::@2/(byte) plexSort::m#1 ) + (number~) plexSort::$1 ← (byte) plexSort::m#2 + (number) 1 + (byte) plexSort::nxt_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (number~) plexSort::$1) + (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0) + (bool~) plexSort::$2 ← (byte) plexSort::nxt_y#0 < *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2)) + (bool~) plexSort::$3 ← ! (bool~) plexSort::$2 + if((bool~) plexSort::$3) goto plexSort::@2 + to:plexSort::@5 +plexSort::@2: scope:[plexSort] from plexSort::@1 plexSort::@4 + (byte) plexSort::m#3 ← phi( plexSort::@1/(byte) plexSort::m#2 plexSort::@4/(byte) plexSort::m#5 ) + (byte) plexSort::m#1 ← (byte) plexSort::m#3 + rangenext(0,PLEX_COUNT-2) + (bool~) plexSort::$8 ← (byte) plexSort::m#1 != rangelast(0,PLEX_COUNT-2) + if((bool~) plexSort::$8) goto plexSort::@1 + to:plexSort::@6 +plexSort::@5: scope:[plexSort] from plexSort::@1 + (byte) plexSort::nxt_idx#3 ← phi( plexSort::@1/(byte) plexSort::nxt_idx#0 ) + (byte) plexSort::nxt_y#2 ← phi( plexSort::@1/(byte) plexSort::nxt_y#0 ) + (byte) plexSort::m#4 ← phi( plexSort::@1/(byte) plexSort::m#2 ) + (byte) plexSort::s#0 ← (byte) plexSort::m#4 + to:plexSort::@3 +plexSort::@3: scope:[plexSort] from plexSort::@3 plexSort::@5 + (byte) plexSort::m#6 ← phi( plexSort::@3/(byte) plexSort::m#6 plexSort::@5/(byte) plexSort::m#4 ) + (byte) plexSort::nxt_idx#2 ← phi( plexSort::@3/(byte) plexSort::nxt_idx#2 plexSort::@5/(byte) plexSort::nxt_idx#3 ) + (byte) plexSort::nxt_y#1 ← phi( plexSort::@3/(byte) plexSort::nxt_y#1 plexSort::@5/(byte) plexSort::nxt_y#2 ) + (byte) plexSort::s#3 ← phi( plexSort::@3/(byte) plexSort::s#1 plexSort::@5/(byte) plexSort::s#0 ) + (number~) plexSort::$4 ← (byte) plexSort::s#3 + (number) 1 + *((const byte*) PLEX_SORTED_IDX + (number~) plexSort::$4) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) + (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 + (bool~) plexSort::$5 ← (byte) plexSort::s#1 != (number) $ff + (bool~) plexSort::$6 ← (byte) plexSort::nxt_y#1 < *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1)) + (bool~) plexSort::$7 ← (bool~) plexSort::$5 && (bool~) plexSort::$6 + if((bool~) plexSort::$7) goto plexSort::@3 + to:plexSort::@4 +plexSort::@4: scope:[plexSort] from plexSort::@3 + (byte) plexSort::m#5 ← phi( plexSort::@3/(byte) plexSort::m#6 ) + (byte) plexSort::nxt_idx#1 ← phi( plexSort::@3/(byte) plexSort::nxt_idx#2 ) + (byte) plexSort::s#4 ← phi( plexSort::@3/(byte) plexSort::s#1 ) + (byte) plexSort::s#2 ← ++ (byte) plexSort::s#4 + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#1 + to:plexSort::@2 +plexSort::@6: scope:[plexSort] from plexSort::@2 + (volatile byte) plex_show_idx ← (number) 0 + (volatile byte) plex_sprite_idx ← (number) 0 + (volatile byte) plex_sprite_msb ← (number) 1 + to:plexSort::plexFreePrepare1 +plexSort::plexFreePrepare1: scope:[plexSort] from plexSort::@6 + (byte) plexSort::plexFreePrepare1_s#0 ← (byte) 0 + to:plexSort::plexFreePrepare1_@1 +plexSort::plexFreePrepare1_@1: scope:[plexSort] from plexSort::plexFreePrepare1 plexSort::plexFreePrepare1_@1 + (byte) plexSort::plexFreePrepare1_s#2 ← phi( plexSort::plexFreePrepare1/(byte) plexSort::plexFreePrepare1_s#0 plexSort::plexFreePrepare1_@1/(byte) plexSort::plexFreePrepare1_s#1 ) + *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (number) 0 + (byte) plexSort::plexFreePrepare1_s#1 ← (byte) plexSort::plexFreePrepare1_s#2 + rangenext(0,7) + (bool~) plexSort::plexFreePrepare1_$0 ← (byte) plexSort::plexFreePrepare1_s#1 != rangelast(0,7) + if((bool~) plexSort::plexFreePrepare1_$0) goto plexSort::plexFreePrepare1_@1 + to:plexSort::plexFreePrepare1_@2 +plexSort::plexFreePrepare1_@2: scope:[plexSort] from plexSort::plexFreePrepare1_@1 + (volatile byte) plex_free_next ← (number) 0 + to:plexSort::@return +plexSort::@return: scope:[plexSort] from plexSort::plexFreePrepare1_@2 + return + to:@return + +(void()) plexShowSprite() +plexShowSprite: scope:[plexShowSprite] from plex_irq::@3 + (byte*) PLEX_SCREEN_PTR#17 ← phi( plex_irq::@3/(byte*) PLEX_SCREEN_PTR#22 ) + (number~) plexShowSprite::$0 ← (volatile byte) plex_sprite_idx * (number) 2 + (byte) plexShowSprite::plex_sprite_idx2#0 ← (number~) plexShowSprite::$0 + (byte) plexShowSprite::ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) + *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::ypos#0 + (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← (byte) plexShowSprite::ypos#0 + to:plexShowSprite::plexFreeAdd1 +plexShowSprite::plexFreeAdd1: scope:[plexShowSprite] from plexShowSprite + (byte) plexShowSprite::plex_sprite_idx2#2 ← phi( plexShowSprite/(byte) plexShowSprite::plex_sprite_idx2#0 ) + (byte*) PLEX_SCREEN_PTR#12 ← phi( plexShowSprite/(byte*) PLEX_SCREEN_PTR#17 ) + (byte) plexShowSprite::plexFreeAdd1_ypos#1 ← phi( plexShowSprite/(byte) plexShowSprite::plexFreeAdd1_ypos#0 ) + (number~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#1 + (number) $15 + *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (number~) plexShowSprite::plexFreeAdd1_$0 + (number~) plexShowSprite::plexFreeAdd1_$1 ← (volatile byte) plex_free_next + (number) 1 + (number~) plexShowSprite::plexFreeAdd1_$2 ← (number~) plexShowSprite::plexFreeAdd1_$1 & (number) 7 + (volatile byte) plex_free_next ← (number~) plexShowSprite::plexFreeAdd1_$2 + to:plexShowSprite::@7 +plexShowSprite::@7: scope:[plexShowSprite] from plexShowSprite::plexFreeAdd1 + (byte) plexShowSprite::plex_sprite_idx2#1 ← phi( plexShowSprite::plexFreeAdd1/(byte) plexShowSprite::plex_sprite_idx2#2 ) + (byte*) PLEX_SCREEN_PTR#7 ← phi( plexShowSprite::plexFreeAdd1/(byte*) PLEX_SCREEN_PTR#12 ) + *((byte*) PLEX_SCREEN_PTR#7 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) + (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) + (byte~) plexShowSprite::$10 ← (byte) plexShowSprite::xpos_idx#0 * (const byte) SIZEOF_WORD + (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$10) + *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#1) ← (byte~) plexShowSprite::$2 + (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 * (const byte) SIZEOF_WORD + (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) + (bool~) plexShowSprite::$4 ← (byte~) plexShowSprite::$3 != (number) 0 + if((bool~) plexShowSprite::$4) goto plexShowSprite::@1 + to:plexShowSprite::@4 +plexShowSprite::@1: scope:[plexShowSprite] from plexShowSprite::@7 + *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb + to:plexShowSprite::@2 +plexShowSprite::@4: scope:[plexShowSprite] from plexShowSprite::@7 + (number~) plexShowSprite::$9 ← (number) $ff ^ (volatile byte) plex_sprite_msb + *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (number~) plexShowSprite::$9 + to:plexShowSprite::@2 +plexShowSprite::@2: scope:[plexShowSprite] from plexShowSprite::@1 plexShowSprite::@4 + (number~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (number) 1 + (number~) plexShowSprite::$6 ← (number~) plexShowSprite::$5 & (number) 7 + (volatile byte) plex_sprite_idx ← (number~) plexShowSprite::$6 + (volatile byte) plex_show_idx ← ++ (volatile byte) plex_show_idx + (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (number) 1 + (bool~) plexShowSprite::$7 ← (volatile byte) plex_sprite_msb == (number) 0 + (bool~) plexShowSprite::$8 ← ! (bool~) plexShowSprite::$7 + if((bool~) plexShowSprite::$8) goto plexShowSprite::@return + to:plexShowSprite::@6 +plexShowSprite::@6: scope:[plexShowSprite] from plexShowSprite::@2 + (volatile byte) plex_sprite_msb ← (number) 1 + to:plexShowSprite::@return +plexShowSprite::@return: scope:[plexShowSprite] from plexShowSprite::@2 plexShowSprite::@6 + return + to:@return +@9: scope:[] from @4 + (byte*) PLEX_SCREEN_PTR#29 ← phi( @4/(byte*) PLEX_SCREEN_PTR#0 ) + (volatile byte) plex_free_next ← (byte) 0 + to:@13 + +(void()) main() +main: scope:[main] from @17 + (byte) sin_idx#35 ← phi( @17/(byte) sin_idx#18 ) + (byte*) PLEX_SCREEN_PTR#23 ← phi( @17/(byte*) PLEX_SCREEN_PTR#15 ) + asm { sei } + *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_CHARROM + (byte*) font_2x2::font_original#0 ← (const nomodify byte*) CHARGEN + (byte*) font_2x2::font_2x2#0 ← (const nomodify byte*) FONT + call font_2x2 + to:main::@19 +main::@19: scope:[main] from main + (byte) sin_idx#34 ← phi( main/(byte) sin_idx#35 ) + (byte*) PLEX_SCREEN_PTR#18 ← phi( main/(byte*) PLEX_SCREEN_PTR#23 ) + *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_BASIC_KERNEL_IO + asm { cli } + (byte*) font_2x2_to_sprites::font_2x2#0 ← (const nomodify byte*) FONT + (byte*) font_2x2_to_sprites::sprites#0 ← (const nomodify byte*) SPRITES + (byte) font_2x2_to_sprites::num_chars#0 ← (number) $40 + call font_2x2_to_sprites + to:main::@20 +main::@20: scope:[main] from main::@19 + (byte) sin_idx#33 ← phi( main::@19/(byte) sin_idx#34 ) + (byte*) PLEX_SCREEN_PTR#13 ← phi( main::@19/(byte*) PLEX_SCREEN_PTR#18 ) + (byte*) plexInit::screen#0 ← (const nomodify byte*) SCREEN + call plexInit + to:main::@21 +main::@21: scope:[main] from main::@20 + (byte) sin_idx#32 ← phi( main::@20/(byte) sin_idx#33 ) + (byte*) PLEX_SCREEN_PTR#8 ← phi( main::@20/(byte*) PLEX_SCREEN_PTR#2 ) + (byte*) PLEX_SCREEN_PTR#3 ← (byte*) PLEX_SCREEN_PTR#8 + (byte*) main::toD0181_screen#0 ← (const nomodify byte*) SCREEN + (byte*) main::toD0181_gfx#0 ← (const nomodify byte*) CHARSET_DEFAULT + to:main::toD0181 +main::toD0181: scope:[main] from main::@21 + (byte*) PLEX_SCREEN_PTR#44 ← phi( main::@21/(byte*) PLEX_SCREEN_PTR#3 ) + (byte) sin_idx#31 ← phi( main::@21/(byte) sin_idx#32 ) + (byte*) main::toD0181_gfx#1 ← phi( main::@21/(byte*) main::toD0181_gfx#0 ) + (byte*) main::toD0181_screen#1 ← phi( main::@21/(byte*) main::toD0181_screen#0 ) + (word~) main::toD0181_$0 ← ((word)) (byte*) main::toD0181_screen#1 + (number~) main::toD0181_$1 ← (word~) main::toD0181_$0 & (number) $3fff + (number~) main::toD0181_$2 ← (number~) main::toD0181_$1 * (number) 4 + (number~) main::toD0181_$3 ← > (number~) main::toD0181_$2 + (word~) main::toD0181_$4 ← ((word)) (byte*) main::toD0181_gfx#1 + (byte~) main::toD0181_$5 ← > (word~) main::toD0181_$4 + (number~) main::toD0181_$6 ← (byte~) main::toD0181_$5 / (number) 4 + (number~) main::toD0181_$7 ← (number~) main::toD0181_$6 & (number) $f + (number~) main::toD0181_$8 ← (number~) main::toD0181_$3 | (number~) main::toD0181_$7 + (byte) main::toD0181_return#0 ← (number~) main::toD0181_$8 + to:main::toD0181_@return +main::toD0181_@return: scope:[main] from main::toD0181 + (byte*) PLEX_SCREEN_PTR#43 ← phi( main::toD0181/(byte*) PLEX_SCREEN_PTR#44 ) + (byte) sin_idx#30 ← phi( main::toD0181/(byte) sin_idx#31 ) + (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::@17 +main::@17: scope:[main] from main::toD0181_@return + (byte*) PLEX_SCREEN_PTR#42 ← phi( main::toD0181_@return/(byte*) PLEX_SCREEN_PTR#43 ) + (byte) sin_idx#29 ← phi( main::toD0181_@return/(byte) sin_idx#30 ) + (byte) main::toD0181_return#3 ← phi( main::toD0181_@return/(byte) main::toD0181_return#1 ) + (byte~) main::$3 ← (byte) main::toD0181_return#3 + *((const nomodify byte*) D018) ← (byte~) main::$3 + (word) main::xp#0 ← (word) $18 + (byte*) main::toSpritePtr1_sprite#0 ← (const nomodify byte*) SPRITES + to:main::toSpritePtr1 +main::toSpritePtr1: scope:[main] from main::@17 + (byte*) PLEX_SCREEN_PTR#41 ← phi( main::@17/(byte*) PLEX_SCREEN_PTR#42 ) + (byte) sin_idx#28 ← phi( main::@17/(byte) sin_idx#29 ) + (word) main::xp#5 ← phi( main::@17/(word) main::xp#0 ) + (byte*) main::toSpritePtr1_sprite#1 ← phi( main::@17/(byte*) main::toSpritePtr1_sprite#0 ) + (word~) main::toSpritePtr1_$0 ← ((word)) (byte*) main::toSpritePtr1_sprite#1 + (number~) main::toSpritePtr1_$1 ← (word~) main::toSpritePtr1_$0 / (number) $40 + (byte~) main::toSpritePtr1_$2 ← ((byte)) (number~) main::toSpritePtr1_$1 + (byte) main::toSpritePtr1_return#0 ← (byte~) main::toSpritePtr1_$2 + to:main::toSpritePtr1_@return +main::toSpritePtr1_@return: scope:[main] from main::toSpritePtr1 + (byte*) PLEX_SCREEN_PTR#40 ← phi( main::toSpritePtr1/(byte*) PLEX_SCREEN_PTR#41 ) + (byte) sin_idx#27 ← phi( main::toSpritePtr1/(byte) sin_idx#28 ) + (word) main::xp#4 ← phi( main::toSpritePtr1/(word) main::xp#5 ) + (byte) main::toSpritePtr1_return#2 ← phi( main::toSpritePtr1/(byte) main::toSpritePtr1_return#0 ) + (byte) main::toSpritePtr1_return#1 ← (byte) main::toSpritePtr1_return#2 + to:main::@18 +main::@18: scope:[main] from main::toSpritePtr1_@return + (byte*) PLEX_SCREEN_PTR#39 ← phi( main::toSpritePtr1_@return/(byte*) PLEX_SCREEN_PTR#40 ) + (byte) sin_idx#26 ← phi( main::toSpritePtr1_@return/(byte) sin_idx#27 ) + (word) main::xp#3 ← phi( main::toSpritePtr1_@return/(word) main::xp#4 ) + (byte) main::toSpritePtr1_return#3 ← phi( main::toSpritePtr1_@return/(byte) main::toSpritePtr1_return#1 ) + (byte~) main::$4 ← (byte) main::toSpritePtr1_return#3 + (byte) main::sprite#0 ← (byte~) main::$4 + (byte) main::s#0 ← (byte) 0 + to:main::@1 +main::@1: scope:[main] from main::@1 main::@18 + (byte*) PLEX_SCREEN_PTR#37 ← phi( main::@1/(byte*) PLEX_SCREEN_PTR#37 main::@18/(byte*) PLEX_SCREEN_PTR#39 ) + (byte) sin_idx#25 ← phi( main::@1/(byte) sin_idx#25 main::@18/(byte) sin_idx#26 ) + (word) main::xp#2 ← phi( main::@1/(word) main::xp#1 main::@18/(word) main::xp#3 ) + (byte) main::s#2 ← phi( main::@1/(byte) main::s#1 main::@18/(byte) main::s#0 ) + (byte) main::sprite#2 ← phi( main::@1/(byte) main::sprite#1 main::@18/(byte) main::sprite#0 ) + *((const byte*) PLEX_PTR + (byte) main::s#2) ← (byte) main::sprite#2 + (byte) main::sprite#1 ← ++ (byte) main::sprite#2 + (byte~) main::$12 ← (byte) main::s#2 * (const byte) SIZEOF_WORD + *((const word*) PLEX_XPOS + (byte~) main::$12) ← (word) main::xp#2 + (word) main::xp#1 ← (word) main::xp#2 + (number) $a + (byte) main::s#1 ← (byte) main::s#2 + rangenext(0,PLEX_COUNT-1) + (bool~) main::$7 ← (byte) main::s#1 != rangelast(0,PLEX_COUNT-1) + if((bool~) main::$7) goto main::@1 + to:main::@2 +main::@2: scope:[main] from main::@1 + (byte*) PLEX_SCREEN_PTR#35 ← phi( main::@1/(byte*) PLEX_SCREEN_PTR#37 ) + (byte) sin_idx#24 ← phi( main::@1/(byte) sin_idx#25 ) + *((const nomodify byte*) SPRITES_ENABLE) ← (number) $ff + (byte) main::s1#0 ← (byte) 0 + to:main::@3 +main::@3: scope:[main] from main::@2 main::@3 + (byte*) PLEX_SCREEN_PTR#32 ← phi( main::@2/(byte*) PLEX_SCREEN_PTR#35 main::@3/(byte*) PLEX_SCREEN_PTR#32 ) + (byte) sin_idx#19 ← phi( main::@2/(byte) sin_idx#24 main::@3/(byte) sin_idx#19 ) + (byte) main::s1#2 ← phi( main::@2/(byte) main::s1#0 main::@3/(byte) main::s1#1 ) + *((const nomodify byte*) SPRITES_COLS + (byte) main::s1#2) ← (const nomodify byte) WHITE + (byte) main::s1#1 ← (byte) main::s1#2 + rangenext(0,7) + (bool~) main::$8 ← (byte) main::s1#1 != rangelast(0,7) + if((bool~) main::$8) goto main::@3 + to:main::@4 +main::@4: scope:[main] from main::@3 + (byte*) PLEX_SCREEN_PTR#27 ← phi( main::@3/(byte*) PLEX_SCREEN_PTR#32 ) + (byte) sin_idx#14 ← phi( main::@3/(byte) sin_idx#19 ) + call plexSine + to:main::@22 +main::@22: scope:[main] from main::@4 + (byte*) PLEX_SCREEN_PTR#24 ← phi( main::@4/(byte*) PLEX_SCREEN_PTR#27 ) + (byte) sin_idx#7 ← phi( main::@4/(byte) sin_idx#5 ) + (byte) sin_idx#0 ← (byte) sin_idx#7 + call plexSort + to:main::@23 +main::@23: scope:[main] from main::@22 + (byte) sin_idx#20 ← phi( main::@22/(byte) sin_idx#0 ) + (byte*) PLEX_SCREEN_PTR#19 ← phi( main::@22/(byte*) PLEX_SCREEN_PTR#24 ) + asm { sei } + *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR + *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (number) $7f + *((const nomodify byte*) RASTER) ← (number) $28 + *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER + *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER + *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() + asm { cli } + to:main::@5 +main::@5: scope:[main] from main::@23 main::@25 + (byte) sin_idx#16 ← phi( main::@23/(byte) sin_idx#20 main::@25/(byte) sin_idx#21 ) + (byte*) PLEX_SCREEN_PTR#14 ← phi( main::@23/(byte*) PLEX_SCREEN_PTR#19 main::@25/(byte*) PLEX_SCREEN_PTR#20 ) + if(true) goto main::@8 + to:main::@return +main::@8: scope:[main] from main::@5 main::@8 + (byte*) PLEX_SCREEN_PTR#33 ← phi( main::@5/(byte*) PLEX_SCREEN_PTR#14 main::@8/(byte*) PLEX_SCREEN_PTR#33 ) + (byte) sin_idx#22 ← phi( main::@5/(byte) sin_idx#16 main::@8/(byte) sin_idx#22 ) + (bool~) main::$9 ← ! (volatile bool) framedone + if((bool~) main::$9) goto main::@8 + to:main::@10 +main::@10: scope:[main] from main::@8 + (byte*) PLEX_SCREEN_PTR#28 ← phi( main::@8/(byte*) PLEX_SCREEN_PTR#33 ) + (byte) sin_idx#15 ← phi( main::@8/(byte) sin_idx#22 ) + call plexSine + to:main::@24 +main::@24: scope:[main] from main::@10 + (byte*) PLEX_SCREEN_PTR#25 ← phi( main::@10/(byte*) PLEX_SCREEN_PTR#28 ) + (byte) sin_idx#8 ← phi( main::@10/(byte) sin_idx#5 ) + (byte) sin_idx#1 ← (byte) sin_idx#8 + call plexSort + to:main::@25 +main::@25: scope:[main] from main::@24 + (byte) sin_idx#21 ← phi( main::@24/(byte) sin_idx#1 ) + (byte*) PLEX_SCREEN_PTR#20 ← phi( main::@24/(byte*) PLEX_SCREEN_PTR#25 ) + (volatile bool) framedone ← false + to:main::@5 +main::@return: scope:[main] from main::@5 + (byte) sin_idx#9 ← phi( main::@5/(byte) sin_idx#16 ) + (byte*) PLEX_SCREEN_PTR#9 ← phi( main::@5/(byte*) PLEX_SCREEN_PTR#14 ) + (byte*) PLEX_SCREEN_PTR#4 ← (byte*) PLEX_SCREEN_PTR#9 + (byte) sin_idx#2 ← (byte) sin_idx#9 + return + to:@return +@13: scope:[] from @9 + (byte*) PLEX_SCREEN_PTR#26 ← phi( @9/(byte*) PLEX_SCREEN_PTR#29 ) + (byte) sin_idx#3 ← (byte) 0 + to:@14 + +(void()) plexSine() +plexSine: scope:[plexSine] from main::@10 main::@4 + (byte) sin_idx#10 ← phi( main::@10/(byte) sin_idx#15 main::@4/(byte) sin_idx#14 ) + (byte) plexSine::y_idx#0 ← (byte) sin_idx#10 + (byte) plexSine::sy#0 ← (byte) 0 + to:plexSine::@1 +plexSine::@1: scope:[plexSine] from plexSine plexSine::@1 + (byte) sin_idx#17 ← phi( plexSine/(byte) sin_idx#10 plexSine::@1/(byte) sin_idx#17 ) + (byte) plexSine::sy#2 ← phi( plexSine/(byte) plexSine::sy#0 plexSine::@1/(byte) plexSine::sy#1 ) + (byte) plexSine::y_idx#2 ← phi( plexSine/(byte) plexSine::y_idx#0 plexSine::@1/(byte) plexSine::y_idx#1 ) + *((const byte*) PLEX_YPOS + (byte) plexSine::sy#2) ← *((const byte*) YSIN + (byte) plexSine::y_idx#2) + (byte) plexSine::y_idx#1 ← (byte) plexSine::y_idx#2 + (number) 8 + (byte) plexSine::sy#1 ← (byte) plexSine::sy#2 + rangenext(0,PLEX_COUNT-1) + (bool~) plexSine::$0 ← (byte) plexSine::sy#1 != rangelast(0,PLEX_COUNT-1) + if((bool~) plexSine::$0) goto plexSine::@1 + to:plexSine::@2 +plexSine::@2: scope:[plexSine] from plexSine::@1 + (byte) sin_idx#11 ← phi( plexSine::@1/(byte) sin_idx#17 ) + (byte) sin_idx#4 ← (byte) sin_idx#11 + (number) 1 + to:plexSine::@return +plexSine::@return: scope:[plexSine] from plexSine::@2 + (byte) sin_idx#12 ← phi( plexSine::@2/(byte) sin_idx#4 ) + (byte) sin_idx#5 ← (byte) sin_idx#12 + return + to:@return +@14: scope:[] from @13 + (byte) sin_idx#23 ← phi( @13/(byte) sin_idx#3 ) + (byte*) PLEX_SCREEN_PTR#21 ← phi( @13/(byte*) PLEX_SCREEN_PTR#26 ) + (volatile bool) framedone ← false + to:@17 + +interrupt(KERNEL_MIN)(void()) plex_irq() +plex_irq: scope:[plex_irq] from + (byte*) PLEX_SCREEN_PTR#30 ← phi( @17/(byte*) PLEX_SCREEN_PTR#15 ) + asm { sei } + (byte) plex_irq::rasterY#0 ← (byte) 0 + to:plex_irq::@3 +plex_irq::@3: scope:[plex_irq] from plex_irq plex_irq::@7 + (byte*) PLEX_SCREEN_PTR#22 ← phi( plex_irq/(byte*) PLEX_SCREEN_PTR#30 plex_irq::@7/(byte*) PLEX_SCREEN_PTR#31 ) + call plexShowSprite + to:plex_irq::@8 +plex_irq::@8: scope:[plex_irq] from plex_irq::@3 + (byte*) PLEX_SCREEN_PTR#38 ← phi( plex_irq::@3/(byte*) PLEX_SCREEN_PTR#22 ) + to:plex_irq::plexFreeNextYpos1 +plex_irq::plexFreeNextYpos1: scope:[plex_irq] from plex_irq::@8 + (byte*) PLEX_SCREEN_PTR#36 ← phi( plex_irq::@8/(byte*) PLEX_SCREEN_PTR#38 ) + (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) + to:plex_irq::plexFreeNextYpos1_@return +plex_irq::plexFreeNextYpos1_@return: scope:[plex_irq] from plex_irq::plexFreeNextYpos1 + (byte*) PLEX_SCREEN_PTR#34 ← phi( plex_irq::plexFreeNextYpos1/(byte*) PLEX_SCREEN_PTR#36 ) + (byte) plex_irq::plexFreeNextYpos1_return#2 ← phi( plex_irq::plexFreeNextYpos1/(byte) plex_irq::plexFreeNextYpos1_return#0 ) + (byte) plex_irq::plexFreeNextYpos1_return#1 ← (byte) plex_irq::plexFreeNextYpos1_return#2 + to:plex_irq::@7 +plex_irq::@7: scope:[plex_irq] from plex_irq::plexFreeNextYpos1_@return + (byte*) PLEX_SCREEN_PTR#31 ← phi( plex_irq::plexFreeNextYpos1_@return/(byte*) PLEX_SCREEN_PTR#34 ) + (byte) plex_irq::plexFreeNextYpos1_return#3 ← phi( plex_irq::plexFreeNextYpos1_@return/(byte) plex_irq::plexFreeNextYpos1_return#1 ) + (byte~) plex_irq::$2 ← (byte) plex_irq::plexFreeNextYpos1_return#3 + (byte) plex_irq::rasterY#1 ← (byte~) plex_irq::$2 + (bool~) plex_irq::$3 ← (volatile byte) plex_show_idx < (const nomodify byte) PLEX_COUNT + (number~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (number) 3 + (bool~) plex_irq::$5 ← (byte) plex_irq::rasterY#1 < (number~) plex_irq::$4 + (bool~) plex_irq::$6 ← (bool~) plex_irq::$3 && (bool~) plex_irq::$5 + if((bool~) plex_irq::$6) goto plex_irq::@3 + to:plex_irq::@4 +plex_irq::@4: scope:[plex_irq] from plex_irq::@7 + (byte) plex_irq::rasterY#3 ← phi( plex_irq::@7/(byte) plex_irq::rasterY#1 ) + (bool~) plex_irq::$0 ← (volatile byte) plex_show_idx < (const nomodify byte) PLEX_COUNT + if((bool~) plex_irq::$0) goto plex_irq::@1 + to:plex_irq::@5 +plex_irq::@1: scope:[plex_irq] from plex_irq::@4 + (byte) plex_irq::rasterY#2 ← phi( plex_irq::@4/(byte) plex_irq::rasterY#3 ) + *((const nomodify byte*) RASTER) ← (byte) plex_irq::rasterY#2 + to:plex_irq::@2 +plex_irq::@5: scope:[plex_irq] from plex_irq::@4 + *((const nomodify byte*) RASTER) ← (number) $28 + (volatile bool) framedone ← true + to:plex_irq::@2 +plex_irq::@2: scope:[plex_irq] from plex_irq::@1 plex_irq::@5 + *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER + asm { cli } + to:plex_irq::@return +plex_irq::@return: scope:[plex_irq] from plex_irq::@2 + return + to:@return + +(void()) font_2x2_to_sprites((byte*) font_2x2_to_sprites::font_2x2 , (byte*) font_2x2_to_sprites::sprites , (byte) font_2x2_to_sprites::num_chars) +font_2x2_to_sprites: scope:[font_2x2_to_sprites] from main::@19 + (byte) font_2x2_to_sprites::num_chars#2 ← phi( main::@19/(byte) font_2x2_to_sprites::num_chars#0 ) + (byte*) font_2x2_to_sprites::sprites#1 ← phi( main::@19/(byte*) font_2x2_to_sprites::sprites#0 ) + (byte*) font_2x2_to_sprites::font_2x2#1 ← phi( main::@19/(byte*) font_2x2_to_sprites::font_2x2#0 ) + (byte*) font_2x2_to_sprites::char_current#0 ← (byte*) font_2x2_to_sprites::font_2x2#1 + (byte*) font_2x2_to_sprites::sprite#0 ← (byte*) font_2x2_to_sprites::sprites#1 + (byte) font_2x2_to_sprites::c#0 ← (byte) 0 + to:font_2x2_to_sprites::@1 +font_2x2_to_sprites::@1: scope:[font_2x2_to_sprites] from font_2x2_to_sprites font_2x2_to_sprites::@11 + (byte*) font_2x2_to_sprites::font_2x2#7 ← phi( font_2x2_to_sprites/(byte*) font_2x2_to_sprites::font_2x2#1 font_2x2_to_sprites::@11/(byte*) font_2x2_to_sprites::font_2x2#9 ) + (byte*) font_2x2_to_sprites::sprite#6 ← phi( font_2x2_to_sprites/(byte*) font_2x2_to_sprites::sprite#0 font_2x2_to_sprites::@11/(byte*) font_2x2_to_sprites::sprite#1 ) + (byte*) font_2x2_to_sprites::char_current#5 ← phi( font_2x2_to_sprites/(byte*) font_2x2_to_sprites::char_current#0 font_2x2_to_sprites::@11/(byte*) font_2x2_to_sprites::char_current#1 ) + (byte) font_2x2_to_sprites::num_chars#1 ← phi( font_2x2_to_sprites/(byte) font_2x2_to_sprites::num_chars#2 font_2x2_to_sprites::@11/(byte) font_2x2_to_sprites::num_chars#3 ) + (byte) font_2x2_to_sprites::c#2 ← phi( font_2x2_to_sprites/(byte) font_2x2_to_sprites::c#0 font_2x2_to_sprites::@11/(byte) font_2x2_to_sprites::c#1 ) + (bool~) font_2x2_to_sprites::$0 ← (byte) font_2x2_to_sprites::c#2 < (byte) font_2x2_to_sprites::num_chars#1 + if((bool~) font_2x2_to_sprites::$0) goto font_2x2_to_sprites::@2 + to:font_2x2_to_sprites::@return +font_2x2_to_sprites::@2: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@1 + (byte) font_2x2_to_sprites::num_chars#9 ← phi( font_2x2_to_sprites::@1/(byte) font_2x2_to_sprites::num_chars#1 ) + (byte) font_2x2_to_sprites::c#9 ← phi( font_2x2_to_sprites::@1/(byte) font_2x2_to_sprites::c#2 ) + (byte*) font_2x2_to_sprites::font_2x2#5 ← phi( font_2x2_to_sprites::@1/(byte*) font_2x2_to_sprites::font_2x2#7 ) + (byte*) font_2x2_to_sprites::sprite#4 ← phi( font_2x2_to_sprites::@1/(byte*) font_2x2_to_sprites::sprite#6 ) + (byte*) font_2x2_to_sprites::char_current#2 ← phi( font_2x2_to_sprites::@1/(byte*) font_2x2_to_sprites::char_current#5 ) + (byte*) font_2x2_to_sprites::char_left#0 ← (byte*) font_2x2_to_sprites::char_current#2 + (byte*~) font_2x2_to_sprites::$1 ← (byte*) font_2x2_to_sprites::char_current#2 + (number) $40*(number) 8 + (byte*) font_2x2_to_sprites::char_right#0 ← (byte*~) font_2x2_to_sprites::$1 + (byte) font_2x2_to_sprites::sprite_idx#0 ← (byte) 0 + (byte) font_2x2_to_sprites::i#0 ← (byte) 0 + to:font_2x2_to_sprites::@4 +font_2x2_to_sprites::@4: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@2 font_2x2_to_sprites::@7 + (byte) font_2x2_to_sprites::num_chars#8 ← phi( font_2x2_to_sprites::@2/(byte) font_2x2_to_sprites::num_chars#9 font_2x2_to_sprites::@7/(byte) font_2x2_to_sprites::num_chars#4 ) + (byte) font_2x2_to_sprites::c#8 ← phi( font_2x2_to_sprites::@2/(byte) font_2x2_to_sprites::c#9 font_2x2_to_sprites::@7/(byte) font_2x2_to_sprites::c#4 ) + (byte*) font_2x2_to_sprites::font_2x2#4 ← phi( font_2x2_to_sprites::@2/(byte*) font_2x2_to_sprites::font_2x2#5 font_2x2_to_sprites::@7/(byte*) font_2x2_to_sprites::font_2x2#6 ) + (byte*) font_2x2_to_sprites::char_current#6 ← phi( font_2x2_to_sprites::@2/(byte*) font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::@7/(byte*) font_2x2_to_sprites::char_current#7 ) + (byte*) font_2x2_to_sprites::char_right#3 ← phi( font_2x2_to_sprites::@2/(byte*) font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::@7/(byte*) font_2x2_to_sprites::char_right#4 ) + (byte) font_2x2_to_sprites::sprite_idx#4 ← phi( font_2x2_to_sprites::@2/(byte) font_2x2_to_sprites::sprite_idx#0 font_2x2_to_sprites::@7/(byte) font_2x2_to_sprites::sprite_idx#5 ) + (byte*) font_2x2_to_sprites::sprite#2 ← phi( font_2x2_to_sprites::@2/(byte*) font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::@7/(byte*) font_2x2_to_sprites::sprite#5 ) + (byte*) font_2x2_to_sprites::char_left#3 ← phi( font_2x2_to_sprites::@2/(byte*) font_2x2_to_sprites::char_left#0 font_2x2_to_sprites::@7/(byte*) font_2x2_to_sprites::char_left#4 ) + (byte) font_2x2_to_sprites::i#2 ← phi( font_2x2_to_sprites::@2/(byte) font_2x2_to_sprites::i#0 font_2x2_to_sprites::@7/(byte) font_2x2_to_sprites::i#1 ) + (number~) font_2x2_to_sprites::$2 ← (byte) font_2x2_to_sprites::i#2 & (number) 7 + *((byte*) font_2x2_to_sprites::sprite#2 + (byte) font_2x2_to_sprites::sprite_idx#4) ← *((byte*) font_2x2_to_sprites::char_left#3 + (number~) font_2x2_to_sprites::$2) + (byte) font_2x2_to_sprites::sprite_idx#1 ← ++ (byte) font_2x2_to_sprites::sprite_idx#4 + (number~) font_2x2_to_sprites::$3 ← (byte) font_2x2_to_sprites::i#2 & (number) 7 + *((byte*) font_2x2_to_sprites::sprite#2 + (byte) font_2x2_to_sprites::sprite_idx#1) ← *((byte*) font_2x2_to_sprites::char_right#3 + (number~) font_2x2_to_sprites::$3) + (byte) font_2x2_to_sprites::sprite_idx#2 ← ++ (byte) font_2x2_to_sprites::sprite_idx#1 + *((byte*) font_2x2_to_sprites::sprite#2 + (byte) font_2x2_to_sprites::sprite_idx#2) ← (number) 0 + (byte) font_2x2_to_sprites::sprite_idx#3 ← ++ (byte) font_2x2_to_sprites::sprite_idx#2 + (bool~) font_2x2_to_sprites::$4 ← (byte) font_2x2_to_sprites::i#2 == (number) 7 + if((bool~) font_2x2_to_sprites::$4) goto font_2x2_to_sprites::@5 + to:font_2x2_to_sprites::@8 +font_2x2_to_sprites::@5: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@4 + (byte*) font_2x2_to_sprites::font_2x2#8 ← phi( font_2x2_to_sprites::@4/(byte*) font_2x2_to_sprites::font_2x2#4 ) + (byte) font_2x2_to_sprites::num_chars#5 ← phi( font_2x2_to_sprites::@4/(byte) font_2x2_to_sprites::num_chars#8 ) + (byte) font_2x2_to_sprites::c#5 ← phi( font_2x2_to_sprites::@4/(byte) font_2x2_to_sprites::c#8 ) + (byte) font_2x2_to_sprites::sprite_idx#6 ← phi( font_2x2_to_sprites::@4/(byte) font_2x2_to_sprites::sprite_idx#3 ) + (byte*) font_2x2_to_sprites::sprite#7 ← phi( font_2x2_to_sprites::@4/(byte*) font_2x2_to_sprites::sprite#2 ) + (byte) font_2x2_to_sprites::i#5 ← phi( font_2x2_to_sprites::@4/(byte) font_2x2_to_sprites::i#2 ) + (byte*) font_2x2_to_sprites::char_current#3 ← phi( font_2x2_to_sprites::@4/(byte*) font_2x2_to_sprites::char_current#6 ) + (byte*~) font_2x2_to_sprites::$9 ← (byte*) font_2x2_to_sprites::char_current#3 + (number) $80*(number) 8 + (byte*) font_2x2_to_sprites::char_left#1 ← (byte*~) font_2x2_to_sprites::$9 + (byte*~) font_2x2_to_sprites::$10 ← (byte*) font_2x2_to_sprites::char_current#3 + (number) $c0*(number) 8 + (byte*) font_2x2_to_sprites::char_right#1 ← (byte*~) font_2x2_to_sprites::$10 + to:font_2x2_to_sprites::@7 +font_2x2_to_sprites::@8: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@4 + (byte) font_2x2_to_sprites::num_chars#6 ← phi( font_2x2_to_sprites::@4/(byte) font_2x2_to_sprites::num_chars#8 ) + (byte) font_2x2_to_sprites::c#6 ← phi( font_2x2_to_sprites::@4/(byte) font_2x2_to_sprites::c#8 ) + (byte*) font_2x2_to_sprites::char_current#8 ← phi( font_2x2_to_sprites::@4/(byte*) font_2x2_to_sprites::char_current#6 ) + (byte*) font_2x2_to_sprites::char_right#5 ← phi( font_2x2_to_sprites::@4/(byte*) font_2x2_to_sprites::char_right#3 ) + (byte) font_2x2_to_sprites::sprite_idx#7 ← phi( font_2x2_to_sprites::@4/(byte) font_2x2_to_sprites::sprite_idx#3 ) + (byte*) font_2x2_to_sprites::sprite#8 ← phi( font_2x2_to_sprites::@4/(byte*) font_2x2_to_sprites::sprite#2 ) + (byte*) font_2x2_to_sprites::char_left#5 ← phi( font_2x2_to_sprites::@4/(byte*) font_2x2_to_sprites::char_left#3 ) + (byte*) font_2x2_to_sprites::font_2x2#3 ← phi( font_2x2_to_sprites::@4/(byte*) font_2x2_to_sprites::font_2x2#4 ) + (byte) font_2x2_to_sprites::i#3 ← phi( font_2x2_to_sprites::@4/(byte) font_2x2_to_sprites::i#2 ) + (bool~) font_2x2_to_sprites::$5 ← (byte) font_2x2_to_sprites::i#3 == (number) $f + (bool~) font_2x2_to_sprites::$6 ← ! (bool~) font_2x2_to_sprites::$5 + if((bool~) font_2x2_to_sprites::$6) goto font_2x2_to_sprites::@7 + to:font_2x2_to_sprites::@9 +font_2x2_to_sprites::@9: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@8 + (byte) font_2x2_to_sprites::num_chars#7 ← phi( font_2x2_to_sprites::@8/(byte) font_2x2_to_sprites::num_chars#6 ) + (byte) font_2x2_to_sprites::c#7 ← phi( font_2x2_to_sprites::@8/(byte) font_2x2_to_sprites::c#6 ) + (byte*) font_2x2_to_sprites::char_current#9 ← phi( font_2x2_to_sprites::@8/(byte*) font_2x2_to_sprites::char_current#8 ) + (byte) font_2x2_to_sprites::sprite_idx#8 ← phi( font_2x2_to_sprites::@8/(byte) font_2x2_to_sprites::sprite_idx#7 ) + (byte*) font_2x2_to_sprites::sprite#9 ← phi( font_2x2_to_sprites::@8/(byte*) font_2x2_to_sprites::sprite#8 ) + (byte) font_2x2_to_sprites::i#6 ← phi( font_2x2_to_sprites::@8/(byte) font_2x2_to_sprites::i#3 ) + (byte*) font_2x2_to_sprites::font_2x2#2 ← phi( font_2x2_to_sprites::@8/(byte*) font_2x2_to_sprites::font_2x2#3 ) + (byte*~) font_2x2_to_sprites::$7 ← (byte*) font_2x2_to_sprites::font_2x2#2 + (byte) ' '*(number) 8 + (byte*) font_2x2_to_sprites::char_left#2 ← (byte*~) font_2x2_to_sprites::$7 + (byte*~) font_2x2_to_sprites::$8 ← (byte*) font_2x2_to_sprites::font_2x2#2 + (byte) ' '*(number) 8 + (byte*) font_2x2_to_sprites::char_right#2 ← (byte*~) font_2x2_to_sprites::$8 + to:font_2x2_to_sprites::@7 +font_2x2_to_sprites::@7: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@5 font_2x2_to_sprites::@8 font_2x2_to_sprites::@9 + (byte*) font_2x2_to_sprites::font_2x2#6 ← phi( font_2x2_to_sprites::@5/(byte*) font_2x2_to_sprites::font_2x2#8 font_2x2_to_sprites::@8/(byte*) font_2x2_to_sprites::font_2x2#3 font_2x2_to_sprites::@9/(byte*) font_2x2_to_sprites::font_2x2#2 ) + (byte) font_2x2_to_sprites::num_chars#4 ← phi( font_2x2_to_sprites::@5/(byte) font_2x2_to_sprites::num_chars#5 font_2x2_to_sprites::@8/(byte) font_2x2_to_sprites::num_chars#6 font_2x2_to_sprites::@9/(byte) font_2x2_to_sprites::num_chars#7 ) + (byte) font_2x2_to_sprites::c#4 ← phi( font_2x2_to_sprites::@5/(byte) font_2x2_to_sprites::c#5 font_2x2_to_sprites::@8/(byte) font_2x2_to_sprites::c#6 font_2x2_to_sprites::@9/(byte) font_2x2_to_sprites::c#7 ) + (byte*) font_2x2_to_sprites::char_current#7 ← phi( font_2x2_to_sprites::@5/(byte*) font_2x2_to_sprites::char_current#3 font_2x2_to_sprites::@8/(byte*) font_2x2_to_sprites::char_current#8 font_2x2_to_sprites::@9/(byte*) font_2x2_to_sprites::char_current#9 ) + (byte*) font_2x2_to_sprites::char_right#4 ← phi( font_2x2_to_sprites::@5/(byte*) font_2x2_to_sprites::char_right#1 font_2x2_to_sprites::@8/(byte*) font_2x2_to_sprites::char_right#5 font_2x2_to_sprites::@9/(byte*) font_2x2_to_sprites::char_right#2 ) + (byte) font_2x2_to_sprites::sprite_idx#5 ← phi( font_2x2_to_sprites::@5/(byte) font_2x2_to_sprites::sprite_idx#6 font_2x2_to_sprites::@8/(byte) font_2x2_to_sprites::sprite_idx#7 font_2x2_to_sprites::@9/(byte) font_2x2_to_sprites::sprite_idx#8 ) + (byte*) font_2x2_to_sprites::sprite#5 ← phi( font_2x2_to_sprites::@5/(byte*) font_2x2_to_sprites::sprite#7 font_2x2_to_sprites::@8/(byte*) font_2x2_to_sprites::sprite#8 font_2x2_to_sprites::@9/(byte*) font_2x2_to_sprites::sprite#9 ) + (byte*) font_2x2_to_sprites::char_left#4 ← phi( font_2x2_to_sprites::@5/(byte*) font_2x2_to_sprites::char_left#1 font_2x2_to_sprites::@8/(byte*) font_2x2_to_sprites::char_left#5 font_2x2_to_sprites::@9/(byte*) font_2x2_to_sprites::char_left#2 ) + (byte) font_2x2_to_sprites::i#4 ← phi( font_2x2_to_sprites::@5/(byte) font_2x2_to_sprites::i#5 font_2x2_to_sprites::@8/(byte) font_2x2_to_sprites::i#3 font_2x2_to_sprites::@9/(byte) font_2x2_to_sprites::i#6 ) + (byte) font_2x2_to_sprites::i#1 ← (byte) font_2x2_to_sprites::i#4 + rangenext(0,$14) + (bool~) font_2x2_to_sprites::$11 ← (byte) font_2x2_to_sprites::i#1 != rangelast(0,$14) + if((bool~) font_2x2_to_sprites::$11) goto font_2x2_to_sprites::@4 + to:font_2x2_to_sprites::@11 +font_2x2_to_sprites::@11: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@7 + (byte*) font_2x2_to_sprites::font_2x2#9 ← phi( font_2x2_to_sprites::@7/(byte*) font_2x2_to_sprites::font_2x2#6 ) + (byte) font_2x2_to_sprites::num_chars#3 ← phi( font_2x2_to_sprites::@7/(byte) font_2x2_to_sprites::num_chars#4 ) + (byte) font_2x2_to_sprites::c#3 ← phi( font_2x2_to_sprites::@7/(byte) font_2x2_to_sprites::c#4 ) + (byte*) font_2x2_to_sprites::sprite#3 ← phi( font_2x2_to_sprites::@7/(byte*) font_2x2_to_sprites::sprite#5 ) + (byte*) font_2x2_to_sprites::char_current#4 ← phi( font_2x2_to_sprites::@7/(byte*) font_2x2_to_sprites::char_current#7 ) + (byte*) font_2x2_to_sprites::char_current#1 ← (byte*) font_2x2_to_sprites::char_current#4 + (number) 8 + (byte*) font_2x2_to_sprites::sprite#1 ← (byte*) font_2x2_to_sprites::sprite#3 + (number) $40 + (byte) font_2x2_to_sprites::c#1 ← ++ (byte) font_2x2_to_sprites::c#3 + to:font_2x2_to_sprites::@1 +font_2x2_to_sprites::@return: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@1 + return + to:@return + +(void()) font_2x2((byte*) font_2x2::font_original , (byte*) font_2x2::font_2x2) +font_2x2: scope:[font_2x2] from main + (byte*) font_2x2::font_2x2#1 ← phi( main/(byte*) font_2x2::font_2x2#0 ) + (byte*) font_2x2::font_original#1 ← phi( main/(byte*) font_2x2::font_original#0 ) + (byte*) font_2x2::next_original#0 ← (byte*) font_2x2::font_original#1 + (byte*) font_2x2::next_2x2#0 ← (byte*) font_2x2::font_2x2#1 + (byte) font_2x2::c#0 ← (byte) 0 + to:font_2x2::@1 +font_2x2::@1: scope:[font_2x2] from font_2x2 font_2x2::@12 + (byte) font_2x2::c#11 ← phi( font_2x2/(byte) font_2x2::c#0 font_2x2::@12/(byte) font_2x2::c#1 ) + (byte*) font_2x2::next_original#4 ← phi( font_2x2/(byte*) font_2x2::next_original#0 font_2x2::@12/(byte*) font_2x2::next_original#1 ) + (byte*) font_2x2::next_2x2#2 ← phi( font_2x2/(byte*) font_2x2::next_2x2#0 font_2x2::@12/(byte*) font_2x2::next_2x2#1 ) + (byte*) font_2x2::next_2x2_left#0 ← (byte*) font_2x2::next_2x2#2 + (byte*~) font_2x2::$0 ← (byte*) font_2x2::next_2x2#2 + (number) $40*(number) 8 + (byte*) font_2x2::next_2x2_right#0 ← (byte*~) font_2x2::$0 + (byte) font_2x2::l2#0 ← (byte) 0 + (byte) font_2x2::l#0 ← (byte) 0 + to:font_2x2::@2 +font_2x2::@2: scope:[font_2x2] from font_2x2::@1 font_2x2::@11 + (byte) font_2x2::c#10 ← phi( font_2x2::@1/(byte) font_2x2::c#11 font_2x2::@11/(byte) font_2x2::c#3 ) + (byte*) font_2x2::next_2x2#11 ← phi( font_2x2::@1/(byte*) font_2x2::next_2x2#2 font_2x2::@11/(byte*) font_2x2::next_2x2#6 ) + (byte*) font_2x2::next_2x2_right#7 ← phi( font_2x2::@1/(byte*) font_2x2::next_2x2_right#0 font_2x2::@11/(byte*) font_2x2::next_2x2_right#8 ) + (byte) font_2x2::l2#8 ← phi( font_2x2::@1/(byte) font_2x2::l2#0 font_2x2::@11/(byte) font_2x2::l2#9 ) + (byte*) font_2x2::next_2x2_left#7 ← phi( font_2x2::@1/(byte*) font_2x2::next_2x2_left#0 font_2x2::@11/(byte*) font_2x2::next_2x2_left#8 ) + (byte) font_2x2::l#2 ← phi( font_2x2::@1/(byte) font_2x2::l#0 font_2x2::@11/(byte) font_2x2::l#1 ) + (byte*) font_2x2::next_original#2 ← phi( font_2x2::@1/(byte*) font_2x2::next_original#4 font_2x2::@11/(byte*) font_2x2::next_original#5 ) + (byte) font_2x2::glyph_bits#0 ← *((byte*) font_2x2::next_original#2 + (byte) font_2x2::l#2) + (word) font_2x2::glyph_bits_2x2#0 ← (word) 0 + (byte) font_2x2::b#0 ← (byte) 0 + to:font_2x2::@3 +font_2x2::@3: scope:[font_2x2] from font_2x2::@2 font_2x2::@6 + (byte) font_2x2::c#9 ← phi( font_2x2::@2/(byte) font_2x2::c#10 font_2x2::@6/(byte) font_2x2::c#6 ) + (byte*) font_2x2::next_original#11 ← phi( font_2x2::@2/(byte*) font_2x2::next_original#2 font_2x2::@6/(byte*) font_2x2::next_original#8 ) + (byte*) font_2x2::next_2x2#10 ← phi( font_2x2::@2/(byte*) font_2x2::next_2x2#11 font_2x2::@6/(byte*) font_2x2::next_2x2#7 ) + (byte) font_2x2::l#9 ← phi( font_2x2::@2/(byte) font_2x2::l#2 font_2x2::@6/(byte) font_2x2::l#6 ) + (byte*) font_2x2::next_2x2_right#6 ← phi( font_2x2::@2/(byte*) font_2x2::next_2x2_right#7 font_2x2::@6/(byte*) font_2x2::next_2x2_right#3 ) + (byte) font_2x2::l2#7 ← phi( font_2x2::@2/(byte) font_2x2::l2#8 font_2x2::@6/(byte) font_2x2::l2#4 ) + (byte*) font_2x2::next_2x2_left#6 ← phi( font_2x2::@2/(byte*) font_2x2::next_2x2_left#7 font_2x2::@6/(byte*) font_2x2::next_2x2_left#3 ) + (byte) font_2x2::b#5 ← phi( font_2x2::@2/(byte) font_2x2::b#0 font_2x2::@6/(byte) font_2x2::b#1 ) + (word) font_2x2::glyph_bits_2x2#7 ← phi( font_2x2::@2/(word) font_2x2::glyph_bits_2x2#0 font_2x2::@6/(word) font_2x2::glyph_bits_2x2#2 ) + (byte) font_2x2::glyph_bits#2 ← phi( font_2x2::@2/(byte) font_2x2::glyph_bits#0 font_2x2::@6/(byte) font_2x2::glyph_bits#1 ) + (number~) font_2x2::$1 ← (byte) font_2x2::glyph_bits#2 & (number) $80 + (bool~) font_2x2::$22 ← (number) 0 != (number~) font_2x2::$1 + if((bool~) font_2x2::$22) goto font_2x2::@4 + to:font_2x2::@5 +font_2x2::@4: scope:[font_2x2] from font_2x2::@3 + (byte) font_2x2::c#7 ← phi( font_2x2::@3/(byte) font_2x2::c#9 ) + (byte*) font_2x2::next_original#9 ← phi( font_2x2::@3/(byte*) font_2x2::next_original#11 ) + (byte*) font_2x2::next_2x2#8 ← phi( font_2x2::@3/(byte*) font_2x2::next_2x2#10 ) + (byte) font_2x2::l#7 ← phi( font_2x2::@3/(byte) font_2x2::l#9 ) + (byte*) font_2x2::next_2x2_right#4 ← phi( font_2x2::@3/(byte*) font_2x2::next_2x2_right#6 ) + (byte) font_2x2::l2#5 ← phi( font_2x2::@3/(byte) font_2x2::l2#7 ) + (byte*) font_2x2::next_2x2_left#4 ← phi( font_2x2::@3/(byte*) font_2x2::next_2x2_left#6 ) + (byte) font_2x2::b#3 ← phi( font_2x2::@3/(byte) font_2x2::b#5 ) + (byte) font_2x2::glyph_bits#4 ← phi( font_2x2::@3/(byte) font_2x2::glyph_bits#2 ) + (word) font_2x2::glyph_bits_2x2#5 ← phi( font_2x2::@3/(word) font_2x2::glyph_bits_2x2#7 ) + (byte~) font_2x2::$3 ← (byte) 1 + to:font_2x2::@6 +font_2x2::@5: scope:[font_2x2] from font_2x2::@3 + (byte) font_2x2::c#8 ← phi( font_2x2::@3/(byte) font_2x2::c#9 ) + (byte*) font_2x2::next_original#10 ← phi( font_2x2::@3/(byte*) font_2x2::next_original#11 ) + (byte*) font_2x2::next_2x2#9 ← phi( font_2x2::@3/(byte*) font_2x2::next_2x2#10 ) + (byte) font_2x2::l#8 ← phi( font_2x2::@3/(byte) font_2x2::l#9 ) + (byte*) font_2x2::next_2x2_right#5 ← phi( font_2x2::@3/(byte*) font_2x2::next_2x2_right#6 ) + (byte) font_2x2::l2#6 ← phi( font_2x2::@3/(byte) font_2x2::l2#7 ) + (byte*) font_2x2::next_2x2_left#5 ← phi( font_2x2::@3/(byte*) font_2x2::next_2x2_left#6 ) + (byte) font_2x2::b#4 ← phi( font_2x2::@3/(byte) font_2x2::b#5 ) + (byte) font_2x2::glyph_bits#5 ← phi( font_2x2::@3/(byte) font_2x2::glyph_bits#2 ) + (word) font_2x2::glyph_bits_2x2#6 ← phi( font_2x2::@3/(word) font_2x2::glyph_bits_2x2#7 ) + (byte~) font_2x2::$2 ← (byte) 0 + to:font_2x2::@6 +font_2x2::@6: scope:[font_2x2] from font_2x2::@4 font_2x2::@5 + (byte) font_2x2::c#6 ← phi( font_2x2::@4/(byte) font_2x2::c#7 font_2x2::@5/(byte) font_2x2::c#8 ) + (byte*) font_2x2::next_original#8 ← phi( font_2x2::@4/(byte*) font_2x2::next_original#9 font_2x2::@5/(byte*) font_2x2::next_original#10 ) + (byte*) font_2x2::next_2x2#7 ← phi( font_2x2::@4/(byte*) font_2x2::next_2x2#8 font_2x2::@5/(byte*) font_2x2::next_2x2#9 ) + (byte) font_2x2::l#6 ← phi( font_2x2::@4/(byte) font_2x2::l#7 font_2x2::@5/(byte) font_2x2::l#8 ) + (byte*) font_2x2::next_2x2_right#3 ← phi( font_2x2::@4/(byte*) font_2x2::next_2x2_right#4 font_2x2::@5/(byte*) font_2x2::next_2x2_right#5 ) + (byte) font_2x2::l2#4 ← phi( font_2x2::@4/(byte) font_2x2::l2#5 font_2x2::@5/(byte) font_2x2::l2#6 ) + (byte*) font_2x2::next_2x2_left#3 ← phi( font_2x2::@4/(byte*) font_2x2::next_2x2_left#4 font_2x2::@5/(byte*) font_2x2::next_2x2_left#5 ) + (byte) font_2x2::b#2 ← phi( font_2x2::@4/(byte) font_2x2::b#3 font_2x2::@5/(byte) font_2x2::b#4 ) + (byte) font_2x2::glyph_bits#3 ← phi( font_2x2::@4/(byte) font_2x2::glyph_bits#4 font_2x2::@5/(byte) font_2x2::glyph_bits#5 ) + (word) font_2x2::glyph_bits_2x2#3 ← phi( font_2x2::@4/(word) font_2x2::glyph_bits_2x2#5 font_2x2::@5/(word) font_2x2::glyph_bits_2x2#6 ) + (byte~) font_2x2::$4 ← phi( font_2x2::@4/(byte~) font_2x2::$3 font_2x2::@5/(byte~) font_2x2::$2 ) + (byte) font_2x2::glyph_bit#0 ← (byte~) font_2x2::$4 + (word~) font_2x2::$5 ← (word) font_2x2::glyph_bits_2x2#3 << (number) 1 + (word~) font_2x2::$6 ← (word~) font_2x2::$5 | (byte) font_2x2::glyph_bit#0 + (word) font_2x2::glyph_bits_2x2#1 ← (word~) font_2x2::$6 + (word~) font_2x2::$7 ← (word) font_2x2::glyph_bits_2x2#1 << (number) 1 + (word~) font_2x2::$8 ← (word~) font_2x2::$7 | (byte) font_2x2::glyph_bit#0 + (word) font_2x2::glyph_bits_2x2#2 ← (word~) font_2x2::$8 + (byte) font_2x2::glyph_bits#1 ← (byte) font_2x2::glyph_bits#3 << (number) 1 + (byte) font_2x2::b#1 ← (byte) font_2x2::b#2 + rangenext(0,7) + (bool~) font_2x2::$9 ← (byte) font_2x2::b#1 != rangelast(0,7) + if((bool~) font_2x2::$9) goto font_2x2::@3 + to:font_2x2::@9 +font_2x2::@9: scope:[font_2x2] from font_2x2::@6 + (byte) font_2x2::c#5 ← phi( font_2x2::@6/(byte) font_2x2::c#6 ) + (byte*) font_2x2::next_original#7 ← phi( font_2x2::@6/(byte*) font_2x2::next_original#8 ) + (byte*) font_2x2::next_2x2#5 ← phi( font_2x2::@6/(byte*) font_2x2::next_2x2#7 ) + (byte) font_2x2::l#5 ← phi( font_2x2::@6/(byte) font_2x2::l#6 ) + (byte*) font_2x2::next_2x2_right#2 ← phi( font_2x2::@6/(byte*) font_2x2::next_2x2_right#3 ) + (byte) font_2x2::l2#3 ← phi( font_2x2::@6/(byte) font_2x2::l2#4 ) + (byte*) font_2x2::next_2x2_left#2 ← phi( font_2x2::@6/(byte*) font_2x2::next_2x2_left#3 ) + (word) font_2x2::glyph_bits_2x2#4 ← phi( font_2x2::@6/(word) font_2x2::glyph_bits_2x2#2 ) + (byte~) font_2x2::$10 ← > (word) font_2x2::glyph_bits_2x2#4 + *((byte*) font_2x2::next_2x2_left#2 + (byte) font_2x2::l2#3) ← (byte~) font_2x2::$10 + (number~) font_2x2::$11 ← (byte) font_2x2::l2#3 + (number) 1 + (byte~) font_2x2::$12 ← > (word) font_2x2::glyph_bits_2x2#4 + *((byte*) font_2x2::next_2x2_left#2 + (number~) font_2x2::$11) ← (byte~) font_2x2::$12 + (byte~) font_2x2::$13 ← < (word) font_2x2::glyph_bits_2x2#4 + *((byte*) font_2x2::next_2x2_right#2 + (byte) font_2x2::l2#3) ← (byte~) font_2x2::$13 + (number~) font_2x2::$14 ← (byte) font_2x2::l2#3 + (number) 1 + (byte~) font_2x2::$15 ← < (word) font_2x2::glyph_bits_2x2#4 + *((byte*) font_2x2::next_2x2_right#2 + (number~) font_2x2::$14) ← (byte~) font_2x2::$15 + (byte) font_2x2::l2#1 ← (byte) font_2x2::l2#3 + (number) 2 + (bool~) font_2x2::$16 ← (byte) font_2x2::l2#1 == (number) 8 + (bool~) font_2x2::$17 ← ! (bool~) font_2x2::$16 + if((bool~) font_2x2::$17) goto font_2x2::@11 + to:font_2x2::@10 +font_2x2::@11: scope:[font_2x2] from font_2x2::@10 font_2x2::@9 + (byte*) font_2x2::next_2x2_right#8 ← phi( font_2x2::@10/(byte*) font_2x2::next_2x2_right#1 font_2x2::@9/(byte*) font_2x2::next_2x2_right#2 ) + (byte) font_2x2::l2#9 ← phi( font_2x2::@10/(byte) font_2x2::l2#2 font_2x2::@9/(byte) font_2x2::l2#1 ) + (byte*) font_2x2::next_2x2_left#8 ← phi( font_2x2::@10/(byte*) font_2x2::next_2x2_left#1 font_2x2::@9/(byte*) font_2x2::next_2x2_left#2 ) + (byte) font_2x2::c#3 ← phi( font_2x2::@10/(byte) font_2x2::c#4 font_2x2::@9/(byte) font_2x2::c#5 ) + (byte*) font_2x2::next_2x2#6 ← phi( font_2x2::@10/(byte*) font_2x2::next_2x2#3 font_2x2::@9/(byte*) font_2x2::next_2x2#5 ) + (byte*) font_2x2::next_original#5 ← phi( font_2x2::@10/(byte*) font_2x2::next_original#6 font_2x2::@9/(byte*) font_2x2::next_original#7 ) + (byte) font_2x2::l#3 ← phi( font_2x2::@10/(byte) font_2x2::l#4 font_2x2::@9/(byte) font_2x2::l#5 ) + (byte) font_2x2::l#1 ← (byte) font_2x2::l#3 + rangenext(0,7) + (bool~) font_2x2::$20 ← (byte) font_2x2::l#1 != rangelast(0,7) + if((bool~) font_2x2::$20) goto font_2x2::@2 + to:font_2x2::@12 +font_2x2::@10: scope:[font_2x2] from font_2x2::@9 + (byte) font_2x2::c#4 ← phi( font_2x2::@9/(byte) font_2x2::c#5 ) + (byte*) font_2x2::next_original#6 ← phi( font_2x2::@9/(byte*) font_2x2::next_original#7 ) + (byte) font_2x2::l#4 ← phi( font_2x2::@9/(byte) font_2x2::l#5 ) + (byte*) font_2x2::next_2x2#3 ← phi( font_2x2::@9/(byte*) font_2x2::next_2x2#5 ) + (byte*~) font_2x2::$18 ← (byte*) font_2x2::next_2x2#3 + (number) $80*(number) 8 + (byte*) font_2x2::next_2x2_left#1 ← (byte*~) font_2x2::$18 + (byte*~) font_2x2::$19 ← (byte*) font_2x2::next_2x2#3 + (number) $c0*(number) 8 + (byte*) font_2x2::next_2x2_right#1 ← (byte*~) font_2x2::$19 + (byte) font_2x2::l2#2 ← (number) 0 + to:font_2x2::@11 +font_2x2::@12: scope:[font_2x2] from font_2x2::@11 + (byte) font_2x2::c#2 ← phi( font_2x2::@11/(byte) font_2x2::c#3 ) + (byte*) font_2x2::next_original#3 ← phi( font_2x2::@11/(byte*) font_2x2::next_original#5 ) + (byte*) font_2x2::next_2x2#4 ← phi( font_2x2::@11/(byte*) font_2x2::next_2x2#6 ) + (byte*) font_2x2::next_2x2#1 ← (byte*) font_2x2::next_2x2#4 + (number) 8 + (byte*) font_2x2::next_original#1 ← (byte*) font_2x2::next_original#3 + (number) 8 + (byte) font_2x2::c#1 ← (byte) font_2x2::c#2 + rangenext(0,$3f) + (bool~) font_2x2::$21 ← (byte) font_2x2::c#1 != rangelast(0,$3f) + if((bool~) font_2x2::$21) goto font_2x2::@1 + to:font_2x2::@return +font_2x2::@return: scope:[font_2x2] from font_2x2::@12 + return + to:@return +@17: scope:[] from @14 + (byte) sin_idx#18 ← phi( @14/(byte) sin_idx#23 ) + (byte*) PLEX_SCREEN_PTR#15 ← phi( @14/(byte*) PLEX_SCREEN_PTR#21 ) + call main + to:@18 +@18: scope:[] from @17 + (byte) sin_idx#13 ← phi( @17/(byte) sin_idx#2 ) + (byte*) PLEX_SCREEN_PTR#10 ← phi( @17/(byte*) PLEX_SCREEN_PTR#4 ) + (byte*) PLEX_SCREEN_PTR#5 ← (byte*) PLEX_SCREEN_PTR#10 + (byte) sin_idx#6 ← (byte) sin_idx#13 + to:@end +@end: scope:[] from @18 + +SYMBOL TABLE SSA +(label) @13 +(label) @14 +(label) @17 +(label) @18 +(label) @4 +(label) @9 +(label) @begin +(label) @end +(const nomodify byte*) CHARGEN = (byte*)(number) $d000 +(const nomodify byte*) CHARSET_DEFAULT = (byte*)(number) $1000 +(const nomodify byte*) CIA1_INTERRUPT = (byte*)(number) $dc0d +(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f +(const nomodify byte*) D018 = (byte*)(number) $d018 +(const nomodify byte*) FONT = (byte*)(number) $2000 +(const nomodify byte*) IRQ_ENABLE = (byte*)(number) $d01a +(const nomodify byte) IRQ_RASTER = (byte) 1 +(const nomodify byte*) IRQ_STATUS = (byte*)(number) $d019 +(const nomodify void()**) KERNEL_IRQ = (void()**)(number) $314 +(const nomodify byte) PLEX_COUNT = (byte) $20 +(const byte*) PLEX_FREE_YPOS[(number) 8] = { fill( 8, 0) } +(const byte*) PLEX_PTR[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) } +(byte*) PLEX_SCREEN_PTR +(byte*) PLEX_SCREEN_PTR#0 +(byte*) PLEX_SCREEN_PTR#1 +(byte*) PLEX_SCREEN_PTR#10 +(byte*) PLEX_SCREEN_PTR#11 +(byte*) PLEX_SCREEN_PTR#12 +(byte*) PLEX_SCREEN_PTR#13 +(byte*) PLEX_SCREEN_PTR#14 +(byte*) PLEX_SCREEN_PTR#15 +(byte*) PLEX_SCREEN_PTR#16 +(byte*) PLEX_SCREEN_PTR#17 +(byte*) PLEX_SCREEN_PTR#18 +(byte*) PLEX_SCREEN_PTR#19 +(byte*) PLEX_SCREEN_PTR#2 +(byte*) PLEX_SCREEN_PTR#20 +(byte*) PLEX_SCREEN_PTR#21 +(byte*) PLEX_SCREEN_PTR#22 +(byte*) PLEX_SCREEN_PTR#23 +(byte*) PLEX_SCREEN_PTR#24 +(byte*) PLEX_SCREEN_PTR#25 +(byte*) PLEX_SCREEN_PTR#26 +(byte*) PLEX_SCREEN_PTR#27 +(byte*) PLEX_SCREEN_PTR#28 +(byte*) PLEX_SCREEN_PTR#29 +(byte*) PLEX_SCREEN_PTR#3 +(byte*) PLEX_SCREEN_PTR#30 +(byte*) PLEX_SCREEN_PTR#31 +(byte*) PLEX_SCREEN_PTR#32 +(byte*) PLEX_SCREEN_PTR#33 +(byte*) PLEX_SCREEN_PTR#34 +(byte*) PLEX_SCREEN_PTR#35 +(byte*) PLEX_SCREEN_PTR#36 +(byte*) PLEX_SCREEN_PTR#37 +(byte*) PLEX_SCREEN_PTR#38 +(byte*) PLEX_SCREEN_PTR#39 +(byte*) PLEX_SCREEN_PTR#4 +(byte*) PLEX_SCREEN_PTR#40 +(byte*) PLEX_SCREEN_PTR#41 +(byte*) PLEX_SCREEN_PTR#42 +(byte*) PLEX_SCREEN_PTR#43 +(byte*) PLEX_SCREEN_PTR#44 +(byte*) PLEX_SCREEN_PTR#5 +(byte*) PLEX_SCREEN_PTR#6 +(byte*) PLEX_SCREEN_PTR#7 +(byte*) PLEX_SCREEN_PTR#8 +(byte*) PLEX_SCREEN_PTR#9 +(const byte*) PLEX_SORTED_IDX[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) } +(const word*) PLEX_XPOS[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) } +(const byte*) PLEX_YPOS[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) } +(const nomodify byte*) PROCPORT = (byte*)(number) 1 +(const nomodify byte) PROCPORT_BASIC_KERNEL_IO = (byte) 7 +(const nomodify byte) PROCPORT_RAM_CHARROM = (byte) 1 +(const nomodify byte*) RASTER = (byte*)(number) $d012 +(const nomodify byte*) SCREEN = (byte*)(number) $400 +(const byte) SIZEOF_WORD = (byte) 2 +(const nomodify byte*) SPRITES = (byte*)(number) $3000 +(const nomodify byte*) SPRITES_COLS = (byte*)(number) $d027 +(const nomodify byte*) SPRITES_ENABLE = (byte*)(number) $d015 +(const nomodify byte*) SPRITES_XMSB = (byte*)(number) $d010 +(const nomodify byte*) SPRITES_XPOS = (byte*)(number) $d000 +(const nomodify byte*) SPRITES_YPOS = (byte*)(number) $d001 +(const nomodify byte*) VIC_CONTROL = (byte*)(number) $d011 +(const nomodify byte) WHITE = (byte) 1 +(const byte*) YSIN[(number) $100] = kickasm {{ .fill $100, round(142+89.5*sin(toRadians(360*i/256))) + }} +(void()) font_2x2((byte*) font_2x2::font_original , (byte*) font_2x2::font_2x2) +(byte*~) font_2x2::$0 +(number~) font_2x2::$1 +(byte~) font_2x2::$10 +(number~) font_2x2::$11 +(byte~) font_2x2::$12 +(byte~) font_2x2::$13 +(number~) font_2x2::$14 +(byte~) font_2x2::$15 +(bool~) font_2x2::$16 +(bool~) font_2x2::$17 +(byte*~) font_2x2::$18 +(byte*~) font_2x2::$19 +(byte~) font_2x2::$2 +(bool~) font_2x2::$20 +(bool~) font_2x2::$21 +(bool~) font_2x2::$22 +(byte~) font_2x2::$3 +(byte~) font_2x2::$4 +(word~) font_2x2::$5 +(word~) font_2x2::$6 +(word~) font_2x2::$7 +(word~) font_2x2::$8 +(bool~) font_2x2::$9 +(label) font_2x2::@1 +(label) font_2x2::@10 +(label) font_2x2::@11 +(label) font_2x2::@12 +(label) font_2x2::@2 +(label) font_2x2::@3 +(label) font_2x2::@4 +(label) font_2x2::@5 +(label) font_2x2::@6 +(label) font_2x2::@9 +(label) font_2x2::@return +(byte) font_2x2::b +(byte) font_2x2::b#0 +(byte) font_2x2::b#1 +(byte) font_2x2::b#2 +(byte) font_2x2::b#3 +(byte) font_2x2::b#4 +(byte) font_2x2::b#5 +(byte) font_2x2::c +(byte) font_2x2::c#0 +(byte) font_2x2::c#1 +(byte) font_2x2::c#10 +(byte) font_2x2::c#11 +(byte) font_2x2::c#2 +(byte) font_2x2::c#3 +(byte) font_2x2::c#4 +(byte) font_2x2::c#5 +(byte) font_2x2::c#6 +(byte) font_2x2::c#7 +(byte) font_2x2::c#8 +(byte) font_2x2::c#9 +(byte*) font_2x2::font_2x2 +(byte*) font_2x2::font_2x2#0 +(byte*) font_2x2::font_2x2#1 +(byte*) font_2x2::font_original +(byte*) font_2x2::font_original#0 +(byte*) font_2x2::font_original#1 +(byte) font_2x2::glyph_bit +(byte) font_2x2::glyph_bit#0 +(byte) font_2x2::glyph_bits +(byte) font_2x2::glyph_bits#0 +(byte) font_2x2::glyph_bits#1 +(byte) font_2x2::glyph_bits#2 +(byte) font_2x2::glyph_bits#3 +(byte) font_2x2::glyph_bits#4 +(byte) font_2x2::glyph_bits#5 +(word) font_2x2::glyph_bits_2x2 +(word) font_2x2::glyph_bits_2x2#0 +(word) font_2x2::glyph_bits_2x2#1 +(word) font_2x2::glyph_bits_2x2#2 +(word) font_2x2::glyph_bits_2x2#3 +(word) font_2x2::glyph_bits_2x2#4 +(word) font_2x2::glyph_bits_2x2#5 +(word) font_2x2::glyph_bits_2x2#6 +(word) font_2x2::glyph_bits_2x2#7 +(byte) font_2x2::l +(byte) font_2x2::l#0 +(byte) font_2x2::l#1 +(byte) font_2x2::l#2 +(byte) font_2x2::l#3 +(byte) font_2x2::l#4 +(byte) font_2x2::l#5 +(byte) font_2x2::l#6 +(byte) font_2x2::l#7 +(byte) font_2x2::l#8 +(byte) font_2x2::l#9 +(byte) font_2x2::l2 +(byte) font_2x2::l2#0 +(byte) font_2x2::l2#1 +(byte) font_2x2::l2#2 +(byte) font_2x2::l2#3 +(byte) font_2x2::l2#4 +(byte) font_2x2::l2#5 +(byte) font_2x2::l2#6 +(byte) font_2x2::l2#7 +(byte) font_2x2::l2#8 +(byte) font_2x2::l2#9 +(byte*) font_2x2::next_2x2 +(byte*) font_2x2::next_2x2#0 +(byte*) font_2x2::next_2x2#1 +(byte*) font_2x2::next_2x2#10 +(byte*) font_2x2::next_2x2#11 +(byte*) font_2x2::next_2x2#2 +(byte*) font_2x2::next_2x2#3 +(byte*) font_2x2::next_2x2#4 +(byte*) font_2x2::next_2x2#5 +(byte*) font_2x2::next_2x2#6 +(byte*) font_2x2::next_2x2#7 +(byte*) font_2x2::next_2x2#8 +(byte*) font_2x2::next_2x2#9 +(byte*) font_2x2::next_2x2_left +(byte*) font_2x2::next_2x2_left#0 +(byte*) font_2x2::next_2x2_left#1 +(byte*) font_2x2::next_2x2_left#2 +(byte*) font_2x2::next_2x2_left#3 +(byte*) font_2x2::next_2x2_left#4 +(byte*) font_2x2::next_2x2_left#5 +(byte*) font_2x2::next_2x2_left#6 +(byte*) font_2x2::next_2x2_left#7 +(byte*) font_2x2::next_2x2_left#8 +(byte*) font_2x2::next_2x2_right +(byte*) font_2x2::next_2x2_right#0 +(byte*) font_2x2::next_2x2_right#1 +(byte*) font_2x2::next_2x2_right#2 +(byte*) font_2x2::next_2x2_right#3 +(byte*) font_2x2::next_2x2_right#4 +(byte*) font_2x2::next_2x2_right#5 +(byte*) font_2x2::next_2x2_right#6 +(byte*) font_2x2::next_2x2_right#7 +(byte*) font_2x2::next_2x2_right#8 +(byte*) font_2x2::next_original +(byte*) font_2x2::next_original#0 +(byte*) font_2x2::next_original#1 +(byte*) font_2x2::next_original#10 +(byte*) font_2x2::next_original#11 +(byte*) font_2x2::next_original#2 +(byte*) font_2x2::next_original#3 +(byte*) font_2x2::next_original#4 +(byte*) font_2x2::next_original#5 +(byte*) font_2x2::next_original#6 +(byte*) font_2x2::next_original#7 +(byte*) font_2x2::next_original#8 +(byte*) font_2x2::next_original#9 +(void()) font_2x2_to_sprites((byte*) font_2x2_to_sprites::font_2x2 , (byte*) font_2x2_to_sprites::sprites , (byte) font_2x2_to_sprites::num_chars) +(bool~) font_2x2_to_sprites::$0 +(byte*~) font_2x2_to_sprites::$1 +(byte*~) font_2x2_to_sprites::$10 +(bool~) font_2x2_to_sprites::$11 +(number~) font_2x2_to_sprites::$2 +(number~) font_2x2_to_sprites::$3 +(bool~) font_2x2_to_sprites::$4 +(bool~) font_2x2_to_sprites::$5 +(bool~) font_2x2_to_sprites::$6 +(byte*~) font_2x2_to_sprites::$7 +(byte*~) font_2x2_to_sprites::$8 +(byte*~) font_2x2_to_sprites::$9 +(label) font_2x2_to_sprites::@1 +(label) font_2x2_to_sprites::@11 +(label) font_2x2_to_sprites::@2 +(label) font_2x2_to_sprites::@4 +(label) font_2x2_to_sprites::@5 +(label) font_2x2_to_sprites::@7 +(label) font_2x2_to_sprites::@8 +(label) font_2x2_to_sprites::@9 +(label) font_2x2_to_sprites::@return +(byte) font_2x2_to_sprites::c +(byte) font_2x2_to_sprites::c#0 +(byte) font_2x2_to_sprites::c#1 +(byte) font_2x2_to_sprites::c#2 +(byte) font_2x2_to_sprites::c#3 +(byte) font_2x2_to_sprites::c#4 +(byte) font_2x2_to_sprites::c#5 +(byte) font_2x2_to_sprites::c#6 +(byte) font_2x2_to_sprites::c#7 +(byte) font_2x2_to_sprites::c#8 +(byte) font_2x2_to_sprites::c#9 +(byte*) font_2x2_to_sprites::char_current +(byte*) font_2x2_to_sprites::char_current#0 +(byte*) font_2x2_to_sprites::char_current#1 +(byte*) font_2x2_to_sprites::char_current#2 +(byte*) font_2x2_to_sprites::char_current#3 +(byte*) font_2x2_to_sprites::char_current#4 +(byte*) font_2x2_to_sprites::char_current#5 +(byte*) font_2x2_to_sprites::char_current#6 +(byte*) font_2x2_to_sprites::char_current#7 +(byte*) font_2x2_to_sprites::char_current#8 +(byte*) font_2x2_to_sprites::char_current#9 +(byte*) font_2x2_to_sprites::char_left +(byte*) font_2x2_to_sprites::char_left#0 +(byte*) font_2x2_to_sprites::char_left#1 +(byte*) font_2x2_to_sprites::char_left#2 +(byte*) font_2x2_to_sprites::char_left#3 +(byte*) font_2x2_to_sprites::char_left#4 +(byte*) font_2x2_to_sprites::char_left#5 +(byte*) font_2x2_to_sprites::char_right +(byte*) font_2x2_to_sprites::char_right#0 +(byte*) font_2x2_to_sprites::char_right#1 +(byte*) font_2x2_to_sprites::char_right#2 +(byte*) font_2x2_to_sprites::char_right#3 +(byte*) font_2x2_to_sprites::char_right#4 +(byte*) font_2x2_to_sprites::char_right#5 +(byte*) font_2x2_to_sprites::font_2x2 +(byte*) font_2x2_to_sprites::font_2x2#0 +(byte*) font_2x2_to_sprites::font_2x2#1 +(byte*) font_2x2_to_sprites::font_2x2#2 +(byte*) font_2x2_to_sprites::font_2x2#3 +(byte*) font_2x2_to_sprites::font_2x2#4 +(byte*) font_2x2_to_sprites::font_2x2#5 +(byte*) font_2x2_to_sprites::font_2x2#6 +(byte*) font_2x2_to_sprites::font_2x2#7 +(byte*) font_2x2_to_sprites::font_2x2#8 +(byte*) font_2x2_to_sprites::font_2x2#9 +(byte) font_2x2_to_sprites::i +(byte) font_2x2_to_sprites::i#0 +(byte) font_2x2_to_sprites::i#1 +(byte) font_2x2_to_sprites::i#2 +(byte) font_2x2_to_sprites::i#3 +(byte) font_2x2_to_sprites::i#4 +(byte) font_2x2_to_sprites::i#5 +(byte) font_2x2_to_sprites::i#6 +(byte) font_2x2_to_sprites::num_chars +(byte) font_2x2_to_sprites::num_chars#0 +(byte) font_2x2_to_sprites::num_chars#1 +(byte) font_2x2_to_sprites::num_chars#2 +(byte) font_2x2_to_sprites::num_chars#3 +(byte) font_2x2_to_sprites::num_chars#4 +(byte) font_2x2_to_sprites::num_chars#5 +(byte) font_2x2_to_sprites::num_chars#6 +(byte) font_2x2_to_sprites::num_chars#7 +(byte) font_2x2_to_sprites::num_chars#8 +(byte) font_2x2_to_sprites::num_chars#9 +(byte*) font_2x2_to_sprites::sprite +(byte*) font_2x2_to_sprites::sprite#0 +(byte*) font_2x2_to_sprites::sprite#1 +(byte*) font_2x2_to_sprites::sprite#2 +(byte*) font_2x2_to_sprites::sprite#3 +(byte*) font_2x2_to_sprites::sprite#4 +(byte*) font_2x2_to_sprites::sprite#5 +(byte*) font_2x2_to_sprites::sprite#6 +(byte*) font_2x2_to_sprites::sprite#7 +(byte*) font_2x2_to_sprites::sprite#8 +(byte*) font_2x2_to_sprites::sprite#9 +(byte) font_2x2_to_sprites::sprite_idx +(byte) font_2x2_to_sprites::sprite_idx#0 +(byte) font_2x2_to_sprites::sprite_idx#1 +(byte) font_2x2_to_sprites::sprite_idx#2 +(byte) font_2x2_to_sprites::sprite_idx#3 +(byte) font_2x2_to_sprites::sprite_idx#4 +(byte) font_2x2_to_sprites::sprite_idx#5 +(byte) font_2x2_to_sprites::sprite_idx#6 +(byte) font_2x2_to_sprites::sprite_idx#7 +(byte) font_2x2_to_sprites::sprite_idx#8 +(byte*) font_2x2_to_sprites::sprites +(byte*) font_2x2_to_sprites::sprites#0 +(byte*) font_2x2_to_sprites::sprites#1 +(volatile bool) framedone loadstore +(void()) main() +(byte~) main::$12 +(byte~) main::$3 +(byte~) main::$4 +(bool~) main::$7 +(bool~) main::$8 +(bool~) main::$9 +(label) main::@1 +(label) main::@10 +(label) main::@17 +(label) main::@18 +(label) main::@19 +(label) main::@2 +(label) main::@20 +(label) main::@21 +(label) main::@22 +(label) main::@23 +(label) main::@24 +(label) main::@25 +(label) main::@3 +(label) main::@4 +(label) main::@5 +(label) main::@8 +(label) main::@return +(byte) main::s +(byte) main::s#0 +(byte) main::s#1 +(byte) main::s#2 +(byte) main::s1 +(byte) main::s1#0 +(byte) main::s1#1 +(byte) main::s1#2 +(byte) main::sprite +(byte) main::sprite#0 +(byte) main::sprite#1 +(byte) main::sprite#2 +(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 +(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::toSpritePtr1 +(word~) main::toSpritePtr1_$0 +(number~) main::toSpritePtr1_$1 +(byte~) main::toSpritePtr1_$2 +(label) main::toSpritePtr1_@return +(byte) main::toSpritePtr1_return +(byte) main::toSpritePtr1_return#0 +(byte) main::toSpritePtr1_return#1 +(byte) main::toSpritePtr1_return#2 +(byte) main::toSpritePtr1_return#3 +(byte*) main::toSpritePtr1_sprite +(byte*) main::toSpritePtr1_sprite#0 +(byte*) main::toSpritePtr1_sprite#1 +(word) main::xp +(word) main::xp#0 +(word) main::xp#1 +(word) main::xp#2 +(word) main::xp#3 +(word) main::xp#4 +(word) main::xp#5 +(void()) plexInit((byte*) plexInit::screen) +(bool~) plexInit::$1 +(label) plexInit::@1 +(label) plexInit::@3 +(label) plexInit::@return +(byte) plexInit::i +(byte) plexInit::i#0 +(byte) plexInit::i#1 +(byte) plexInit::i#2 +(label) plexInit::plexSetScreen1 +(byte*~) plexInit::plexSetScreen1_$0 +(byte*) plexInit::plexSetScreen1_screen +(byte*) plexInit::plexSetScreen1_screen#0 +(byte*) plexInit::plexSetScreen1_screen#1 +(byte*) plexInit::screen +(byte*) plexInit::screen#0 +(byte*) plexInit::screen#1 +(void()) plexShowSprite() +(number~) plexShowSprite::$0 +(byte~) plexShowSprite::$10 +(byte~) plexShowSprite::$11 +(byte~) plexShowSprite::$2 +(byte~) plexShowSprite::$3 +(bool~) plexShowSprite::$4 +(number~) plexShowSprite::$5 +(number~) plexShowSprite::$6 +(bool~) plexShowSprite::$7 +(bool~) plexShowSprite::$8 +(number~) plexShowSprite::$9 +(label) plexShowSprite::@1 +(label) plexShowSprite::@2 +(label) plexShowSprite::@4 +(label) plexShowSprite::@6 +(label) plexShowSprite::@7 +(label) plexShowSprite::@return +(label) plexShowSprite::plexFreeAdd1 +(number~) plexShowSprite::plexFreeAdd1_$0 +(number~) plexShowSprite::plexFreeAdd1_$1 +(number~) plexShowSprite::plexFreeAdd1_$2 +(byte) plexShowSprite::plexFreeAdd1_ypos +(byte) plexShowSprite::plexFreeAdd1_ypos#0 +(byte) plexShowSprite::plexFreeAdd1_ypos#1 +(byte) plexShowSprite::plex_sprite_idx2 +(byte) plexShowSprite::plex_sprite_idx2#0 +(byte) plexShowSprite::plex_sprite_idx2#1 +(byte) plexShowSprite::plex_sprite_idx2#2 +(byte) plexShowSprite::xpos_idx +(byte) plexShowSprite::xpos_idx#0 +(byte) plexShowSprite::ypos +(byte) plexShowSprite::ypos#0 +(void()) plexSine() +(bool~) plexSine::$0 +(label) plexSine::@1 +(label) plexSine::@2 +(label) plexSine::@return +(byte) plexSine::sy +(byte) plexSine::sy#0 +(byte) plexSine::sy#1 +(byte) plexSine::sy#2 +(byte) plexSine::y_idx +(byte) plexSine::y_idx#0 +(byte) plexSine::y_idx#1 +(byte) plexSine::y_idx#2 +(void()) plexSort() +(number~) plexSort::$1 +(bool~) plexSort::$2 +(bool~) plexSort::$3 +(number~) plexSort::$4 +(bool~) plexSort::$5 +(bool~) plexSort::$6 +(bool~) plexSort::$7 +(bool~) plexSort::$8 +(label) plexSort::@1 +(label) plexSort::@2 +(label) plexSort::@3 +(label) plexSort::@4 +(label) plexSort::@5 +(label) plexSort::@6 +(label) plexSort::@return +(byte) plexSort::m +(byte) plexSort::m#0 +(byte) plexSort::m#1 +(byte) plexSort::m#2 +(byte) plexSort::m#3 +(byte) plexSort::m#4 +(byte) plexSort::m#5 +(byte) plexSort::m#6 +(byte) plexSort::nxt_idx +(byte) plexSort::nxt_idx#0 +(byte) plexSort::nxt_idx#1 +(byte) plexSort::nxt_idx#2 +(byte) plexSort::nxt_idx#3 +(byte) plexSort::nxt_y +(byte) plexSort::nxt_y#0 +(byte) plexSort::nxt_y#1 +(byte) plexSort::nxt_y#2 +(label) plexSort::plexFreePrepare1 +(bool~) plexSort::plexFreePrepare1_$0 +(label) plexSort::plexFreePrepare1_@1 +(label) plexSort::plexFreePrepare1_@2 +(byte) plexSort::plexFreePrepare1_s +(byte) plexSort::plexFreePrepare1_s#0 +(byte) plexSort::plexFreePrepare1_s#1 +(byte) plexSort::plexFreePrepare1_s#2 +(byte) plexSort::s +(byte) plexSort::s#0 +(byte) plexSort::s#1 +(byte) plexSort::s#2 +(byte) plexSort::s#3 +(byte) plexSort::s#4 +(volatile byte) plex_free_next loadstore +interrupt(KERNEL_MIN)(void()) plex_irq() +(bool~) plex_irq::$0 +(byte~) plex_irq::$2 +(bool~) plex_irq::$3 +(number~) plex_irq::$4 +(bool~) plex_irq::$5 +(bool~) plex_irq::$6 +(label) plex_irq::@1 +(label) plex_irq::@2 +(label) plex_irq::@3 +(label) plex_irq::@4 +(label) plex_irq::@5 +(label) plex_irq::@7 +(label) plex_irq::@8 +(label) plex_irq::@return +(label) plex_irq::plexFreeNextYpos1 +(label) plex_irq::plexFreeNextYpos1_@return +(byte) plex_irq::plexFreeNextYpos1_return +(byte) plex_irq::plexFreeNextYpos1_return#0 +(byte) plex_irq::plexFreeNextYpos1_return#1 +(byte) plex_irq::plexFreeNextYpos1_return#2 +(byte) plex_irq::plexFreeNextYpos1_return#3 +(byte) plex_irq::rasterY +(byte) plex_irq::rasterY#0 +(byte) plex_irq::rasterY#1 +(byte) plex_irq::rasterY#2 +(byte) plex_irq::rasterY#3 +(volatile byte) plex_show_idx loadstore +(volatile byte) plex_sprite_idx loadstore +(volatile byte) plex_sprite_msb loadstore +(byte) sin_idx +(byte) sin_idx#0 +(byte) sin_idx#1 +(byte) sin_idx#10 +(byte) sin_idx#11 +(byte) sin_idx#12 +(byte) sin_idx#13 +(byte) sin_idx#14 +(byte) sin_idx#15 +(byte) sin_idx#16 +(byte) sin_idx#17 +(byte) sin_idx#18 +(byte) sin_idx#19 +(byte) sin_idx#2 +(byte) sin_idx#20 +(byte) sin_idx#21 +(byte) sin_idx#22 +(byte) sin_idx#23 +(byte) sin_idx#24 +(byte) sin_idx#25 +(byte) sin_idx#26 +(byte) sin_idx#27 +(byte) sin_idx#28 +(byte) sin_idx#29 +(byte) sin_idx#3 +(byte) sin_idx#30 +(byte) sin_idx#31 +(byte) sin_idx#32 +(byte) sin_idx#33 +(byte) sin_idx#34 +(byte) sin_idx#35 +(byte) sin_idx#4 +(byte) sin_idx#5 +(byte) sin_idx#6 +(byte) sin_idx#7 +(byte) sin_idx#8 +(byte) sin_idx#9 + +Adding number conversion cast (unumber) $3f8 in (byte*~) plexInit::plexSetScreen1_$0 ← (byte*) plexInit::plexSetScreen1_screen#1 + (number) $3f8 +Adding number conversion cast (unumber) 1 in (byte) plexInit::i#1 ← (byte) plexInit::i#2 + rangenext(0,PLEX_COUNT-1) +Adding number conversion cast (unumber) 1 in (number~) plexSort::$1 ← (byte) plexSort::m#2 + (number) 1 +Adding number conversion cast (unumber) plexSort::$1 in (number~) plexSort::$1 ← (byte) plexSort::m#2 + (unumber)(number) 1 +Adding number conversion cast (unumber) 2 in (byte) plexSort::m#1 ← (byte) plexSort::m#3 + rangenext(0,PLEX_COUNT-2) +Adding number conversion cast (unumber) 1 in (number~) plexSort::$4 ← (byte) plexSort::s#3 + (number) 1 +Adding number conversion cast (unumber) plexSort::$4 in (number~) plexSort::$4 ← (byte) plexSort::s#3 + (unumber)(number) 1 +Adding number conversion cast (unumber) $ff in (bool~) plexSort::$5 ← (byte) plexSort::s#1 != (number) $ff +Adding number conversion cast (unumber) 0 in (volatile byte) plex_show_idx ← (number) 0 +Adding number conversion cast (unumber) 0 in (volatile byte) plex_sprite_idx ← (number) 0 +Adding number conversion cast (unumber) 1 in (volatile byte) plex_sprite_msb ← (number) 1 +Adding number conversion cast (unumber) 0 in *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (number) 0 +Adding number conversion cast (unumber) 0 in (volatile byte) plex_free_next ← (number) 0 +Adding number conversion cast (unumber) 2 in (number~) plexShowSprite::$0 ← (volatile byte) plex_sprite_idx * (number) 2 +Adding number conversion cast (unumber) plexShowSprite::$0 in (number~) plexShowSprite::$0 ← (volatile byte) plex_sprite_idx * (unumber)(number) 2 +Adding number conversion cast (unumber) $15 in (number~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#1 + (number) $15 +Adding number conversion cast (unumber) plexShowSprite::plexFreeAdd1_$0 in (number~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#1 + (unumber)(number) $15 +Adding number conversion cast (unumber) 1 in (number~) plexShowSprite::plexFreeAdd1_$1 ← (volatile byte) plex_free_next + (number) 1 +Adding number conversion cast (unumber) plexShowSprite::plexFreeAdd1_$1 in (number~) plexShowSprite::plexFreeAdd1_$1 ← (volatile byte) plex_free_next + (unumber)(number) 1 +Adding number conversion cast (unumber) 7 in (number~) plexShowSprite::plexFreeAdd1_$2 ← (unumber~) plexShowSprite::plexFreeAdd1_$1 & (number) 7 +Adding number conversion cast (unumber) plexShowSprite::plexFreeAdd1_$2 in (number~) plexShowSprite::plexFreeAdd1_$2 ← (unumber~) plexShowSprite::plexFreeAdd1_$1 & (unumber)(number) 7 +Adding number conversion cast (unumber) 0 in (bool~) plexShowSprite::$4 ← (byte~) plexShowSprite::$3 != (number) 0 +Adding number conversion cast (unumber) $ff in (number~) plexShowSprite::$9 ← (number) $ff ^ (volatile byte) plex_sprite_msb +Adding number conversion cast (unumber) plexShowSprite::$9 in (number~) plexShowSprite::$9 ← (unumber)(number) $ff ^ (volatile byte) plex_sprite_msb +Adding number conversion cast (unumber) 1 in (number~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (number) 1 +Adding number conversion cast (unumber) plexShowSprite::$5 in (number~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (unumber)(number) 1 +Adding number conversion cast (unumber) 7 in (number~) plexShowSprite::$6 ← (unumber~) plexShowSprite::$5 & (number) 7 +Adding number conversion cast (unumber) plexShowSprite::$6 in (number~) plexShowSprite::$6 ← (unumber~) plexShowSprite::$5 & (unumber)(number) 7 +Adding number conversion cast (unumber) 1 in (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (number) 1 +Adding number conversion cast (unumber) 0 in (bool~) plexShowSprite::$7 ← (volatile byte) plex_sprite_msb == (number) 0 +Adding number conversion cast (unumber) 1 in (volatile byte) plex_sprite_msb ← (number) 1 +Adding number conversion cast (unumber) $40 in (byte) font_2x2_to_sprites::num_chars#0 ← (number) $40 +Adding number conversion cast (unumber) $3fff in (number~) main::toD0181_$1 ← (word~) main::toD0181_$0 & (number) $3fff +Adding number conversion cast (unumber) main::toD0181_$1 in (number~) main::toD0181_$1 ← (word~) main::toD0181_$0 & (unumber)(number) $3fff +Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$2 ← (unumber~) main::toD0181_$1 * (number) 4 +Adding number conversion cast (unumber) main::toD0181_$2 in (number~) main::toD0181_$2 ← (unumber~) main::toD0181_$1 * (unumber)(number) 4 +Adding number conversion cast (unumber) main::toD0181_$3 in (number~) main::toD0181_$3 ← > (unumber~) main::toD0181_$2 +Adding number conversion cast (unumber) 4 in (number~) main::toD0181_$6 ← (byte~) main::toD0181_$5 / (number) 4 +Adding number conversion cast (unumber) main::toD0181_$6 in (number~) main::toD0181_$6 ← (byte~) main::toD0181_$5 / (unumber)(number) 4 +Adding number conversion cast (unumber) $f in (number~) main::toD0181_$7 ← (unumber~) main::toD0181_$6 & (number) $f +Adding number conversion cast (unumber) main::toD0181_$7 in (number~) main::toD0181_$7 ← (unumber~) main::toD0181_$6 & (unumber)(number) $f +Adding number conversion cast (unumber) main::toD0181_$8 in (number~) main::toD0181_$8 ← (unumber~) main::toD0181_$3 | (unumber~) main::toD0181_$7 +Adding number conversion cast (unumber) $40 in (number~) main::toSpritePtr1_$1 ← (word~) main::toSpritePtr1_$0 / (number) $40 +Adding number conversion cast (unumber) main::toSpritePtr1_$1 in (number~) main::toSpritePtr1_$1 ← (word~) main::toSpritePtr1_$0 / (unumber)(number) $40 +Adding number conversion cast (unumber) $a in (word) main::xp#1 ← (word) main::xp#2 + (number) $a +Adding number conversion cast (unumber) 1 in (byte) main::s#1 ← (byte) main::s#2 + rangenext(0,PLEX_COUNT-1) +Adding number conversion cast (unumber) $ff in *((const nomodify byte*) SPRITES_ENABLE) ← (number) $ff +Adding number conversion cast (unumber) $7f in *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (number) $7f +Adding number conversion cast (unumber) $28 in *((const nomodify byte*) RASTER) ← (number) $28 +Adding number conversion cast (unumber) 8 in (byte) plexSine::y_idx#1 ← (byte) plexSine::y_idx#2 + (number) 8 +Adding number conversion cast (unumber) 1 in (byte) plexSine::sy#1 ← (byte) plexSine::sy#2 + rangenext(0,PLEX_COUNT-1) +Adding number conversion cast (unumber) 1 in (byte) sin_idx#4 ← (byte) sin_idx#11 + (number) 1 +Adding number conversion cast (unumber) 3 in (number~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (number) 3 +Adding number conversion cast (unumber) plex_irq::$4 in (number~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (unumber)(number) 3 +Adding number conversion cast (unumber) $28 in *((const nomodify byte*) RASTER) ← (number) $28 +Adding number conversion cast (unumber) $40*8 in (byte*~) font_2x2_to_sprites::$1 ← (byte*) font_2x2_to_sprites::char_current#2 + (number) $40*(number) 8 +Adding number conversion cast (unumber) 7 in (number~) font_2x2_to_sprites::$2 ← (byte) font_2x2_to_sprites::i#2 & (number) 7 +Adding number conversion cast (unumber) font_2x2_to_sprites::$2 in (number~) font_2x2_to_sprites::$2 ← (byte) font_2x2_to_sprites::i#2 & (unumber)(number) 7 +Adding number conversion cast (unumber) 7 in (number~) font_2x2_to_sprites::$3 ← (byte) font_2x2_to_sprites::i#2 & (number) 7 +Adding number conversion cast (unumber) font_2x2_to_sprites::$3 in (number~) font_2x2_to_sprites::$3 ← (byte) font_2x2_to_sprites::i#2 & (unumber)(number) 7 +Adding number conversion cast (unumber) 0 in *((byte*) font_2x2_to_sprites::sprite#2 + (byte) font_2x2_to_sprites::sprite_idx#2) ← (number) 0 +Adding number conversion cast (unumber) 7 in (bool~) font_2x2_to_sprites::$4 ← (byte) font_2x2_to_sprites::i#2 == (number) 7 +Adding number conversion cast (unumber) $80*8 in (byte*~) font_2x2_to_sprites::$9 ← (byte*) font_2x2_to_sprites::char_current#3 + (number) $80*(number) 8 +Adding number conversion cast (unumber) $c0*8 in (byte*~) font_2x2_to_sprites::$10 ← (byte*) font_2x2_to_sprites::char_current#3 + (number) $c0*(number) 8 +Adding number conversion cast (unumber) $f in (bool~) font_2x2_to_sprites::$5 ← (byte) font_2x2_to_sprites::i#3 == (number) $f +Adding number conversion cast (unumber) ' '*8 in (byte*~) font_2x2_to_sprites::$7 ← (byte*) font_2x2_to_sprites::font_2x2#2 + (byte) ' '*(number) 8 +Adding number conversion cast (unumber) 8 in (byte*~) font_2x2_to_sprites::$7 ← (byte*) font_2x2_to_sprites::font_2x2#2 + (unumber)(byte) ' '*(number) 8 +Adding number conversion cast (unumber) ' '*8 in (byte*~) font_2x2_to_sprites::$8 ← (byte*) font_2x2_to_sprites::font_2x2#2 + (byte) ' '*(number) 8 +Adding number conversion cast (unumber) 8 in (byte*~) font_2x2_to_sprites::$8 ← (byte*) font_2x2_to_sprites::font_2x2#2 + (unumber)(byte) ' '*(number) 8 +Adding number conversion cast (unumber) 8 in (byte*) font_2x2_to_sprites::char_current#1 ← (byte*) font_2x2_to_sprites::char_current#4 + (number) 8 +Adding number conversion cast (unumber) $40 in (byte*) font_2x2_to_sprites::sprite#1 ← (byte*) font_2x2_to_sprites::sprite#3 + (number) $40 +Adding number conversion cast (unumber) $40*8 in (byte*~) font_2x2::$0 ← (byte*) font_2x2::next_2x2#2 + (number) $40*(number) 8 +Adding number conversion cast (unumber) $80 in (number~) font_2x2::$1 ← (byte) font_2x2::glyph_bits#2 & (number) $80 +Adding number conversion cast (unumber) font_2x2::$1 in (number~) font_2x2::$1 ← (byte) font_2x2::glyph_bits#2 & (unumber)(number) $80 +Adding number conversion cast (unumber) 0 in (bool~) font_2x2::$22 ← (number) 0 != (unumber~) font_2x2::$1 +Adding number conversion cast (unumber) 1 in (word~) font_2x2::$5 ← (word) font_2x2::glyph_bits_2x2#3 << (number) 1 +Adding number conversion cast (unumber) 1 in (word~) font_2x2::$7 ← (word) font_2x2::glyph_bits_2x2#1 << (number) 1 +Adding number conversion cast (unumber) 1 in (byte) font_2x2::glyph_bits#1 ← (byte) font_2x2::glyph_bits#3 << (number) 1 +Adding number conversion cast (unumber) 1 in (number~) font_2x2::$11 ← (byte) font_2x2::l2#3 + (number) 1 +Adding number conversion cast (unumber) font_2x2::$11 in (number~) font_2x2::$11 ← (byte) font_2x2::l2#3 + (unumber)(number) 1 +Adding number conversion cast (unumber) 1 in (number~) font_2x2::$14 ← (byte) font_2x2::l2#3 + (number) 1 +Adding number conversion cast (unumber) font_2x2::$14 in (number~) font_2x2::$14 ← (byte) font_2x2::l2#3 + (unumber)(number) 1 +Adding number conversion cast (unumber) 2 in (byte) font_2x2::l2#1 ← (byte) font_2x2::l2#3 + (number) 2 +Adding number conversion cast (unumber) 8 in (bool~) font_2x2::$16 ← (byte) font_2x2::l2#1 == (number) 8 +Adding number conversion cast (unumber) $80*8 in (byte*~) font_2x2::$18 ← (byte*) font_2x2::next_2x2#3 + (number) $80*(number) 8 +Adding number conversion cast (unumber) $c0*8 in (byte*~) font_2x2::$19 ← (byte*) font_2x2::next_2x2#3 + (number) $c0*(number) 8 +Adding number conversion cast (unumber) 0 in (byte) font_2x2::l2#2 ← (number) 0 +Adding number conversion cast (unumber) 8 in (byte*) font_2x2::next_2x2#1 ← (byte*) font_2x2::next_2x2#4 + (number) 8 +Adding number conversion cast (unumber) 8 in (byte*) font_2x2::next_original#1 ← (byte*) font_2x2::next_original#3 + (number) 8 +Successful SSA optimization PassNAddNumberTypeConversions +Inlining cast (volatile byte) plex_show_idx ← (unumber)(number) 0 +Inlining cast (volatile byte) plex_sprite_idx ← (unumber)(number) 0 +Inlining cast (volatile byte) plex_sprite_msb ← (unumber)(number) 1 +Inlining cast *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (unumber)(number) 0 +Inlining cast (volatile byte) plex_free_next ← (unumber)(number) 0 +Inlining cast (volatile byte) plex_sprite_msb ← (unumber)(number) 1 +Inlining cast (byte) font_2x2_to_sprites::num_chars#0 ← (unumber)(number) $40 +Inlining cast (word~) main::toD0181_$0 ← (word)(byte*) main::toD0181_screen#1 +Inlining cast (word~) main::toD0181_$4 ← (word)(byte*) main::toD0181_gfx#1 +Inlining cast (word~) main::toSpritePtr1_$0 ← (word)(byte*) main::toSpritePtr1_sprite#1 +Inlining cast (byte~) main::toSpritePtr1_$2 ← (byte)(unumber~) main::toSpritePtr1_$1 +Inlining cast *((const nomodify byte*) SPRITES_ENABLE) ← (unumber)(number) $ff +Inlining cast *((const nomodify byte*) RASTER) ← (unumber)(number) $28 +Inlining cast *((const nomodify byte*) RASTER) ← (unumber)(number) $28 +Inlining cast *((byte*) font_2x2_to_sprites::sprite#2 + (byte) font_2x2_to_sprites::sprite_idx#2) ← (unumber)(number) 0 +Inlining cast (byte) font_2x2::l2#2 ← (unumber)(number) 0 +Successful SSA optimization Pass2InlineCast +Simplifying constant pointer cast (byte*) 1 +Simplifying constant pointer cast (byte*) 53248 +Simplifying constant pointer cast (byte*) 53248 +Simplifying constant pointer cast (byte*) 53249 +Simplifying constant pointer cast (byte*) 53264 +Simplifying constant pointer cast (byte*) 53266 +Simplifying constant pointer cast (byte*) 53269 +Simplifying constant pointer cast (byte*) 53287 +Simplifying constant pointer cast (byte*) 53265 +Simplifying constant pointer cast (byte*) 53272 +Simplifying constant pointer cast (byte*) 53273 +Simplifying constant pointer cast (byte*) 53274 +Simplifying constant pointer cast (byte*) 56333 +Simplifying constant pointer cast (void()**) 788 +Simplifying constant pointer cast (byte*) 4096 +Simplifying constant pointer cast (byte*) 8192 +Simplifying constant pointer cast (byte*) 12288 +Simplifying constant pointer cast (byte*) 1024 +Simplifying constant integer cast $3f8 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 2 +Simplifying constant integer cast 1 +Simplifying constant integer cast $ff +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 0 +Simplifying constant integer cast 2 +Simplifying constant integer cast $15 +Simplifying constant integer cast 1 +Simplifying constant integer cast 7 +Simplifying constant integer cast 0 +Simplifying constant integer cast $ff +Simplifying constant integer cast 1 +Simplifying constant integer cast 7 +Simplifying constant integer cast 1 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +Simplifying constant integer cast $40 +Simplifying constant integer cast $3fff +Simplifying constant integer cast 4 +Simplifying constant integer cast 4 +Simplifying constant integer cast $f +Simplifying constant integer cast $40 +Simplifying constant integer cast $a +Simplifying constant integer cast 1 +Simplifying constant integer cast $ff +Simplifying constant integer cast $7f +Simplifying constant integer cast $28 +Simplifying constant integer cast 8 +Simplifying constant integer cast 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 3 +Simplifying constant integer cast $28 +Simplifying constant integer cast 7 +Simplifying constant integer cast 7 +Simplifying constant integer cast 0 +Simplifying constant integer cast 7 +Simplifying constant integer cast $f +Simplifying constant integer cast (byte) ' '*(unumber)(number) 8 +Simplifying constant integer cast 8 +Simplifying constant integer cast (byte) ' '*(unumber)(number) 8 +Simplifying constant integer cast 8 +Simplifying constant integer cast 8 +Simplifying constant integer cast $40 +Simplifying constant integer cast $80 +Simplifying constant integer cast 0 +Simplifying constant integer cast 1 +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 8 +Simplifying constant integer cast 0 +Simplifying constant integer cast 8 +Simplifying constant integer cast 8 +Successful SSA optimization PassNCastSimplification +Finalized unsigned number type (word) $3f8 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) $ff +Finalized unsigned number type (byte) 0 +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) 2 +Finalized unsigned number type (byte) $15 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) $ff +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) $40 +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) $40 +Finalized unsigned number type (byte) $a +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) $ff +Finalized unsigned number type (byte) $7f +Finalized unsigned number type (byte) $28 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 3 +Finalized unsigned number type (byte) $28 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 7 +Finalized unsigned number type (byte) $f +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) $40 +Finalized unsigned number type (byte) $80 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 2 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) 8 +Successful SSA optimization PassNFinalizeNumberTypeConversions +Inferred type updated to byte in (unumber~) plexSort::$1 ← (byte) plexSort::m#2 + (byte) 1 +Inferred type updated to byte in (unumber~) plexSort::$4 ← (byte) plexSort::s#3 + (byte) 1 +Inferred type updated to byte in (unumber~) plexShowSprite::$0 ← (volatile byte) plex_sprite_idx * (byte) 2 +Inferred type updated to byte in (unumber~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#1 + (byte) $15 +Inferred type updated to byte in (unumber~) plexShowSprite::plexFreeAdd1_$1 ← (volatile byte) plex_free_next + (byte) 1 +Inferred type updated to byte in (unumber~) plexShowSprite::plexFreeAdd1_$2 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7 +Inferred type updated to byte in (unumber~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb +Inferred type updated to byte in (unumber~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (byte) 1 +Inferred type updated to byte in (unumber~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7 +Inferred type updated to word in (unumber~) main::toD0181_$1 ← (word~) main::toD0181_$0 & (word) $3fff +Inferred type updated to word in (unumber~) main::toD0181_$2 ← (word~) main::toD0181_$1 * (byte) 4 +Inferred type updated to byte in (unumber~) main::toD0181_$3 ← > (word~) main::toD0181_$2 +Inferred type updated to byte in (unumber~) main::toD0181_$6 ← (byte~) main::toD0181_$5 / (byte) 4 +Inferred type updated to byte in (unumber~) main::toD0181_$7 ← (byte~) main::toD0181_$6 & (byte) $f +Inferred type updated to byte in (unumber~) main::toD0181_$8 ← (byte~) main::toD0181_$3 | (byte~) main::toD0181_$7 +Inferred type updated to word in (unumber~) main::toSpritePtr1_$1 ← (word~) main::toSpritePtr1_$0 / (byte) $40 +Inferred type updated to byte in (unumber~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 3 +Inferred type updated to byte in (unumber~) font_2x2_to_sprites::$2 ← (byte) font_2x2_to_sprites::i#2 & (byte) 7 +Inferred type updated to byte in (unumber~) font_2x2_to_sprites::$3 ← (byte) font_2x2_to_sprites::i#2 & (byte) 7 +Inferred type updated to byte in (unumber~) font_2x2::$1 ← (byte) font_2x2::glyph_bits#2 & (byte) $80 +Inferred type updated to byte in (unumber~) font_2x2::$11 ← (byte) font_2x2::l2#3 + (byte) 1 +Inferred type updated to byte in (unumber~) font_2x2::$14 ← (byte) font_2x2::l2#3 + (byte) 1 +Inversing boolean not [25] (bool~) plexSort::$3 ← (byte) plexSort::nxt_y#0 >= *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2)) from [24] (bool~) plexSort::$2 ← (byte) plexSort::nxt_y#0 < *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2)) +Inversing boolean not [86] (bool~) plexShowSprite::$8 ← (volatile byte) plex_sprite_msb != (byte) 0 from [85] (bool~) plexShowSprite::$7 ← (volatile byte) plex_sprite_msb == (byte) 0 +Inversing boolean not [265] (bool~) font_2x2_to_sprites::$6 ← (byte) font_2x2_to_sprites::i#3 != (byte) $f from [264] (bool~) font_2x2_to_sprites::$5 ← (byte) font_2x2_to_sprites::i#3 == (byte) $f +Inversing boolean not [328] (bool~) font_2x2::$17 ← (byte) font_2x2::l2#1 != (byte) 8 from [327] (bool~) font_2x2::$16 ← (byte) font_2x2::l2#1 == (byte) 8 +Successful SSA optimization Pass2UnaryNotSimplification +Alias candidate removed (volatile)plex_free_next = plexShowSprite::plexFreeAdd1_$2 +Alias candidate removed (volatile)plex_sprite_idx = plexShowSprite::$6 +Alias plexInit::plexSetScreen1_screen#0 = plexInit::screen#1 plexInit::plexSetScreen1_screen#1 +Alias PLEX_SCREEN_PTR#1 = plexInit::plexSetScreen1_$0 PLEX_SCREEN_PTR#16 +Alias PLEX_SCREEN_PTR#11 = PLEX_SCREEN_PTR#6 PLEX_SCREEN_PTR#2 +Alias plexSort::m#2 = plexSort::m#4 plexSort::s#0 +Alias plexSort::nxt_y#0 = plexSort::nxt_y#2 +Alias plexSort::nxt_idx#0 = plexSort::nxt_idx#3 +Alias plexSort::s#1 = plexSort::s#4 +Alias plexSort::nxt_idx#1 = plexSort::nxt_idx#2 +Alias plexSort::m#5 = plexSort::m#6 +Alias plexShowSprite::plex_sprite_idx2#0 = plexShowSprite::$0 plexShowSprite::plex_sprite_idx2#2 plexShowSprite::plex_sprite_idx2#1 +Alias plexShowSprite::plexFreeAdd1_ypos#0 = plexShowSprite::ypos#0 plexShowSprite::plexFreeAdd1_ypos#1 +Alias PLEX_SCREEN_PTR#12 = PLEX_SCREEN_PTR#17 PLEX_SCREEN_PTR#7 +Alias PLEX_SCREEN_PTR#0 = PLEX_SCREEN_PTR#29 PLEX_SCREEN_PTR#26 PLEX_SCREEN_PTR#21 PLEX_SCREEN_PTR#15 +Alias PLEX_SCREEN_PTR#13 = PLEX_SCREEN_PTR#18 PLEX_SCREEN_PTR#23 +Alias sin_idx#26 = sin_idx#34 sin_idx#35 sin_idx#33 sin_idx#32 sin_idx#31 sin_idx#30 sin_idx#29 sin_idx#28 sin_idx#27 +Alias PLEX_SCREEN_PTR#3 = PLEX_SCREEN_PTR#8 PLEX_SCREEN_PTR#44 PLEX_SCREEN_PTR#43 PLEX_SCREEN_PTR#42 PLEX_SCREEN_PTR#41 PLEX_SCREEN_PTR#40 PLEX_SCREEN_PTR#39 +Alias main::toD0181_screen#0 = main::toD0181_screen#1 +Alias main::toD0181_gfx#0 = main::toD0181_gfx#1 +Alias main::toD0181_return#0 = main::toD0181_$8 main::toD0181_return#2 main::toD0181_return#1 main::toD0181_return#3 main::$3 +Alias main::toSpritePtr1_sprite#0 = main::toSpritePtr1_sprite#1 +Alias main::xp#0 = main::xp#5 main::xp#4 main::xp#3 +Alias main::toSpritePtr1_return#0 = main::toSpritePtr1_$2 main::toSpritePtr1_return#2 main::toSpritePtr1_return#1 main::toSpritePtr1_return#3 main::$4 main::sprite#0 +Alias sin_idx#24 = sin_idx#25 +Alias PLEX_SCREEN_PTR#35 = PLEX_SCREEN_PTR#37 +Alias sin_idx#14 = sin_idx#19 +Alias PLEX_SCREEN_PTR#19 = PLEX_SCREEN_PTR#27 PLEX_SCREEN_PTR#32 PLEX_SCREEN_PTR#24 +Alias sin_idx#0 = sin_idx#7 sin_idx#20 +Alias sin_idx#15 = sin_idx#22 +Alias PLEX_SCREEN_PTR#20 = PLEX_SCREEN_PTR#28 PLEX_SCREEN_PTR#33 PLEX_SCREEN_PTR#25 +Alias sin_idx#1 = sin_idx#8 sin_idx#21 +Alias PLEX_SCREEN_PTR#14 = PLEX_SCREEN_PTR#9 PLEX_SCREEN_PTR#4 +Alias sin_idx#16 = sin_idx#9 sin_idx#2 +Alias sin_idx#11 = sin_idx#17 +Alias sin_idx#12 = sin_idx#4 sin_idx#5 +Alias sin_idx#18 = sin_idx#23 sin_idx#3 +Alias PLEX_SCREEN_PTR#22 = PLEX_SCREEN_PTR#38 PLEX_SCREEN_PTR#36 PLEX_SCREEN_PTR#34 PLEX_SCREEN_PTR#31 +Alias plex_irq::plexFreeNextYpos1_return#0 = plex_irq::plexFreeNextYpos1_return#2 plex_irq::plexFreeNextYpos1_return#1 plex_irq::plexFreeNextYpos1_return#3 plex_irq::$2 plex_irq::rasterY#1 plex_irq::rasterY#3 plex_irq::rasterY#2 +Alias font_2x2_to_sprites::char_current#0 = font_2x2_to_sprites::font_2x2#1 +Alias font_2x2_to_sprites::sprite#0 = font_2x2_to_sprites::sprites#1 +Alias font_2x2_to_sprites::char_current#2 = font_2x2_to_sprites::char_current#5 font_2x2_to_sprites::char_left#0 +Alias font_2x2_to_sprites::sprite#4 = font_2x2_to_sprites::sprite#6 +Alias font_2x2_to_sprites::font_2x2#5 = font_2x2_to_sprites::font_2x2#7 +Alias font_2x2_to_sprites::c#2 = font_2x2_to_sprites::c#9 +Alias font_2x2_to_sprites::num_chars#1 = font_2x2_to_sprites::num_chars#9 +Alias font_2x2_to_sprites::char_right#0 = font_2x2_to_sprites::$1 +Alias font_2x2_to_sprites::char_current#3 = font_2x2_to_sprites::char_current#6 font_2x2_to_sprites::char_current#8 font_2x2_to_sprites::char_current#9 +Alias font_2x2_to_sprites::i#2 = font_2x2_to_sprites::i#5 font_2x2_to_sprites::i#3 font_2x2_to_sprites::i#6 +Alias font_2x2_to_sprites::sprite#2 = font_2x2_to_sprites::sprite#7 font_2x2_to_sprites::sprite#8 font_2x2_to_sprites::sprite#9 +Alias font_2x2_to_sprites::sprite_idx#3 = font_2x2_to_sprites::sprite_idx#6 font_2x2_to_sprites::sprite_idx#7 font_2x2_to_sprites::sprite_idx#8 +Alias font_2x2_to_sprites::c#5 = font_2x2_to_sprites::c#8 font_2x2_to_sprites::c#6 font_2x2_to_sprites::c#7 +Alias font_2x2_to_sprites::num_chars#5 = font_2x2_to_sprites::num_chars#8 font_2x2_to_sprites::num_chars#6 font_2x2_to_sprites::num_chars#7 +Alias font_2x2_to_sprites::font_2x2#2 = font_2x2_to_sprites::font_2x2#8 font_2x2_to_sprites::font_2x2#4 font_2x2_to_sprites::font_2x2#3 +Alias font_2x2_to_sprites::char_left#1 = font_2x2_to_sprites::$9 +Alias font_2x2_to_sprites::char_right#1 = font_2x2_to_sprites::$10 +Alias font_2x2_to_sprites::char_left#3 = font_2x2_to_sprites::char_left#5 +Alias font_2x2_to_sprites::char_right#3 = font_2x2_to_sprites::char_right#5 +Alias font_2x2_to_sprites::char_left#2 = font_2x2_to_sprites::$7 +Alias font_2x2_to_sprites::char_right#2 = font_2x2_to_sprites::$8 +Alias font_2x2_to_sprites::char_current#4 = font_2x2_to_sprites::char_current#7 +Alias font_2x2_to_sprites::sprite#3 = font_2x2_to_sprites::sprite#5 +Alias font_2x2_to_sprites::c#3 = font_2x2_to_sprites::c#4 +Alias font_2x2_to_sprites::num_chars#3 = font_2x2_to_sprites::num_chars#4 +Alias font_2x2_to_sprites::font_2x2#6 = font_2x2_to_sprites::font_2x2#9 +Alias font_2x2::next_original#0 = font_2x2::font_original#1 +Alias font_2x2::next_2x2#0 = font_2x2::font_2x2#1 +Alias font_2x2::next_2x2_left#0 = font_2x2::next_2x2#2 +Alias font_2x2::next_2x2_right#0 = font_2x2::$0 +Alias font_2x2::glyph_bits_2x2#5 = font_2x2::glyph_bits_2x2#7 font_2x2::glyph_bits_2x2#6 +Alias font_2x2::glyph_bits#2 = font_2x2::glyph_bits#4 font_2x2::glyph_bits#5 +Alias font_2x2::b#3 = font_2x2::b#5 font_2x2::b#4 +Alias font_2x2::next_2x2_left#4 = font_2x2::next_2x2_left#6 font_2x2::next_2x2_left#5 +Alias font_2x2::l2#5 = font_2x2::l2#7 font_2x2::l2#6 +Alias font_2x2::next_2x2_right#4 = font_2x2::next_2x2_right#6 font_2x2::next_2x2_right#5 +Alias font_2x2::l#7 = font_2x2::l#9 font_2x2::l#8 +Alias font_2x2::next_2x2#10 = font_2x2::next_2x2#8 font_2x2::next_2x2#9 +Alias font_2x2::next_original#10 = font_2x2::next_original#9 font_2x2::next_original#11 +Alias font_2x2::c#7 = font_2x2::c#9 font_2x2::c#8 +Alias font_2x2::glyph_bit#0 = font_2x2::$4 +Alias font_2x2::glyph_bits_2x2#1 = font_2x2::$6 +Alias font_2x2::glyph_bits_2x2#2 = font_2x2::$8 font_2x2::glyph_bits_2x2#4 +Alias font_2x2::next_2x2_left#2 = font_2x2::next_2x2_left#3 +Alias font_2x2::l2#3 = font_2x2::l2#4 +Alias font_2x2::next_2x2_right#2 = font_2x2::next_2x2_right#3 +Alias font_2x2::l#4 = font_2x2::l#5 font_2x2::l#6 +Alias font_2x2::next_2x2#3 = font_2x2::next_2x2#5 font_2x2::next_2x2#7 +Alias font_2x2::next_original#6 = font_2x2::next_original#7 font_2x2::next_original#8 +Alias font_2x2::c#4 = font_2x2::c#5 font_2x2::c#6 +Alias font_2x2::next_2x2_left#1 = font_2x2::$18 +Alias font_2x2::next_2x2_right#1 = font_2x2::$19 +Alias font_2x2::next_2x2#4 = font_2x2::next_2x2#6 +Alias font_2x2::next_original#3 = font_2x2::next_original#5 +Alias font_2x2::c#2 = font_2x2::c#3 +Alias PLEX_SCREEN_PTR#10 = PLEX_SCREEN_PTR#5 +Alias sin_idx#13 = sin_idx#6 +Successful SSA optimization Pass2AliasElimination +Alias candidate removed (volatile)plex_free_next = plexShowSprite::plexFreeAdd1_$2 +Alias candidate removed (volatile)plex_sprite_idx = plexShowSprite::$6 +Alias font_2x2_to_sprites::i#2 = font_2x2_to_sprites::i#4 +Alias font_2x2_to_sprites::sprite#2 = font_2x2_to_sprites::sprite#3 +Alias font_2x2_to_sprites::sprite_idx#3 = font_2x2_to_sprites::sprite_idx#5 +Alias font_2x2_to_sprites::char_current#3 = font_2x2_to_sprites::char_current#4 +Alias font_2x2_to_sprites::c#3 = font_2x2_to_sprites::c#5 +Alias font_2x2_to_sprites::num_chars#3 = font_2x2_to_sprites::num_chars#5 +Alias font_2x2_to_sprites::font_2x2#2 = font_2x2_to_sprites::font_2x2#6 +Alias font_2x2::glyph_bits_2x2#3 = font_2x2::glyph_bits_2x2#5 +Alias font_2x2::glyph_bits#2 = font_2x2::glyph_bits#3 +Alias font_2x2::b#2 = font_2x2::b#3 +Alias font_2x2::next_2x2_left#2 = font_2x2::next_2x2_left#4 +Alias font_2x2::l2#3 = font_2x2::l2#5 +Alias font_2x2::next_2x2_right#2 = font_2x2::next_2x2_right#4 +Alias font_2x2::l#3 = font_2x2::l#4 font_2x2::l#7 +Alias font_2x2::next_2x2#10 = font_2x2::next_2x2#3 font_2x2::next_2x2#4 +Alias font_2x2::next_original#10 = font_2x2::next_original#6 font_2x2::next_original#3 +Alias font_2x2::c#2 = font_2x2::c#4 font_2x2::c#7 +Successful SSA optimization Pass2AliasElimination +Alias candidate removed (volatile)plex_free_next = plexShowSprite::plexFreeAdd1_$2 +Alias candidate removed (volatile)plex_sprite_idx = plexShowSprite::$6 +Identical Phi Values (byte*) plexInit::plexSetScreen1_screen#0 (byte*) plexInit::screen#0 +Identical Phi Values (byte*) PLEX_SCREEN_PTR#11 (byte*) PLEX_SCREEN_PTR#1 +Identical Phi Values (byte) plexSort::nxt_y#1 (byte) plexSort::nxt_y#0 +Identical Phi Values (byte) plexSort::nxt_idx#1 (byte) plexSort::nxt_idx#0 +Identical Phi Values (byte) plexSort::m#5 (byte) plexSort::m#2 +Identical Phi Values (byte*) PLEX_SCREEN_PTR#12 (byte*) PLEX_SCREEN_PTR#22 +Identical Phi Values (byte*) PLEX_SCREEN_PTR#13 (byte*) PLEX_SCREEN_PTR#0 +Identical Phi Values (byte) sin_idx#26 (byte) sin_idx#18 +Identical Phi Values (byte*) PLEX_SCREEN_PTR#3 (byte*) PLEX_SCREEN_PTR#11 +Identical Phi Values (byte) sin_idx#24 (byte) sin_idx#26 +Identical Phi Values (byte*) PLEX_SCREEN_PTR#35 (byte*) PLEX_SCREEN_PTR#3 +Identical Phi Values (byte) sin_idx#14 (byte) sin_idx#24 +Identical Phi Values (byte*) PLEX_SCREEN_PTR#19 (byte*) PLEX_SCREEN_PTR#35 +Identical Phi Values (byte) sin_idx#0 (byte) sin_idx#12 +Identical Phi Values (byte) sin_idx#15 (byte) sin_idx#16 +Identical Phi Values (byte*) PLEX_SCREEN_PTR#20 (byte*) PLEX_SCREEN_PTR#14 +Identical Phi Values (byte) sin_idx#1 (byte) sin_idx#12 +Identical Phi Values (byte) sin_idx#11 (byte) sin_idx#10 +Identical Phi Values (byte*) PLEX_SCREEN_PTR#30 (byte*) PLEX_SCREEN_PTR#0 +Identical Phi Values (byte*) PLEX_SCREEN_PTR#22 (byte*) PLEX_SCREEN_PTR#30 +Identical Phi Values (byte*) font_2x2_to_sprites::char_current#0 (byte*) font_2x2_to_sprites::font_2x2#0 +Identical Phi Values (byte*) font_2x2_to_sprites::sprite#0 (byte*) font_2x2_to_sprites::sprites#0 +Identical Phi Values (byte) font_2x2_to_sprites::num_chars#2 (byte) font_2x2_to_sprites::num_chars#0 +Identical Phi Values (byte*) font_2x2_to_sprites::sprite#2 (byte*) font_2x2_to_sprites::sprite#4 +Identical Phi Values (byte*) font_2x2_to_sprites::char_current#3 (byte*) font_2x2_to_sprites::char_current#2 +Identical Phi Values (byte*) font_2x2_to_sprites::font_2x2#2 (byte*) font_2x2_to_sprites::font_2x2#5 +Identical Phi Values (byte) font_2x2_to_sprites::c#3 (byte) font_2x2_to_sprites::c#2 +Identical Phi Values (byte) font_2x2_to_sprites::num_chars#3 (byte) font_2x2_to_sprites::num_chars#1 +Identical Phi Values (byte*) font_2x2::next_original#0 (byte*) font_2x2::font_original#0 +Identical Phi Values (byte*) font_2x2::next_2x2#0 (byte*) font_2x2::font_2x2#0 +Identical Phi Values (byte*) font_2x2::next_2x2_left#2 (byte*) font_2x2::next_2x2_left#7 +Identical Phi Values (byte) font_2x2::l2#3 (byte) font_2x2::l2#8 +Identical Phi Values (byte*) font_2x2::next_2x2_right#2 (byte*) font_2x2::next_2x2_right#7 +Identical Phi Values (byte) font_2x2::l#3 (byte) font_2x2::l#2 +Identical Phi Values (byte*) font_2x2::next_2x2#10 (byte*) font_2x2::next_2x2#11 +Identical Phi Values (byte*) font_2x2::next_original#10 (byte*) font_2x2::next_original#2 +Identical Phi Values (byte) font_2x2::c#2 (byte) font_2x2::c#10 +Identical Phi Values (byte*) PLEX_SCREEN_PTR#10 (byte*) PLEX_SCREEN_PTR#14 +Identical Phi Values (byte) sin_idx#13 (byte) sin_idx#16 +Successful SSA optimization Pass2IdenticalPhiElimination +Identical Phi Values (byte) plexSort::m#3 (byte) plexSort::m#2 +Identical Phi Values (byte*) PLEX_SCREEN_PTR#14 (byte*) PLEX_SCREEN_PTR#1 +Identical Phi Values (byte) sin_idx#16 (byte) sin_idx#12 +Identical Phi Values (byte) font_2x2_to_sprites::num_chars#1 (byte) font_2x2_to_sprites::num_chars#0 +Identical Phi Values (byte*) font_2x2_to_sprites::font_2x2#5 (byte*) font_2x2_to_sprites::font_2x2#0 +Identical Phi Values (byte*) font_2x2::next_original#2 (byte*) font_2x2::next_original#4 +Identical Phi Values (byte*) font_2x2::next_2x2#11 (byte*) font_2x2::next_2x2_left#0 +Identical Phi Values (byte) font_2x2::c#10 (byte) font_2x2::c#11 +Successful SSA optimization Pass2IdenticalPhiElimination +Identified duplicate assignment right side [73] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 * (const byte) SIZEOF_WORD +Identified duplicate assignment right side [251] (byte~) font_2x2_to_sprites::$3 ← (byte) font_2x2_to_sprites::i#2 & (byte) 7 +Identified duplicate assignment right side [319] (byte~) font_2x2::$12 ← > (word) font_2x2::glyph_bits_2x2#2 +Identified duplicate assignment right side [324] (byte~) font_2x2::$15 ← < (word) font_2x2::glyph_bits_2x2#2 +Successful SSA optimization Pass2DuplicateRValueIdentification +Simple Condition (bool~) plexInit::$1 [11] if((byte) plexInit::i#1!=rangelast(0,PLEX_COUNT-1)) goto plexInit::@1 +Simple Condition (bool~) plexSort::$3 [19] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 +Simple Condition (bool~) plexSort::$8 [23] if((byte) plexSort::m#1!=rangelast(0,PLEX_COUNT-2)) goto plexSort::@1 +Simple Condition (bool~) plexSort::plexFreePrepare1_$0 [42] if((byte) plexSort::plexFreePrepare1_s#1!=rangelast(0,7)) goto plexSort::plexFreePrepare1_@1 +Simple Condition (bool~) plexShowSprite::$4 [62] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1 +Simple Condition (bool~) plexShowSprite::$8 [72] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return +Simple Condition (bool~) main::$7 [117] if((byte) main::s#1!=rangelast(0,PLEX_COUNT-1)) goto main::@1 +Simple Condition (bool~) main::$8 [124] if((byte) main::s1#1!=rangelast(0,7)) goto main::@3 +Simple Condition (bool~) plexSine::$0 [155] if((byte) plexSine::sy#1!=rangelast(0,PLEX_COUNT-1)) goto plexSine::@1 +Simple Condition (bool~) plex_irq::$0 [171] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 +Simple Condition (bool~) font_2x2_to_sprites::$0 [182] if((byte) font_2x2_to_sprites::c#2<(byte) font_2x2_to_sprites::num_chars#0) goto font_2x2_to_sprites::@2 +Simple Condition (bool~) font_2x2_to_sprites::$4 [196] if((byte) font_2x2_to_sprites::i#2==(byte) 7) goto font_2x2_to_sprites::@5 +Simple Condition (bool~) font_2x2_to_sprites::$6 [200] if((byte) font_2x2_to_sprites::i#2!=(byte) $f) goto font_2x2_to_sprites::@7 +Simple Condition (bool~) font_2x2_to_sprites::$11 [206] if((byte) font_2x2_to_sprites::i#1!=rangelast(0,$14)) goto font_2x2_to_sprites::@4 +Simple Condition (bool~) font_2x2::$22 [224] if((byte) 0!=(byte~) font_2x2::$1) goto font_2x2::@4 +Simple Condition (bool~) font_2x2::$9 [235] if((byte) font_2x2::b#1!=rangelast(0,7)) goto font_2x2::@3 +Simple Condition (bool~) font_2x2::$17 [248] if((byte) font_2x2::l2#1!=(byte) 8) goto font_2x2::@11 +Simple Condition (bool~) font_2x2::$20 [252] if((byte) font_2x2::l#1!=rangelast(0,7)) goto font_2x2::@2 +Simple Condition (bool~) font_2x2::$21 [260] if((byte) font_2x2::c#1!=rangelast(0,$3f)) goto font_2x2::@1 +Successful SSA optimization Pass2ConditionalJumpSimplification +Rewriting && if()-condition to two if()s [30] (bool~) plexSort::$7 ← (bool~) plexSort::$5 && (bool~) plexSort::$6 +Rewriting ! if()-condition to reversed if() [139] (bool~) main::$9 ← ! (volatile bool) framedone +Rewriting && if()-condition to two if()s [168] (bool~) plex_irq::$6 ← (bool~) plex_irq::$3 && (bool~) plex_irq::$5 +Successful SSA optimization Pass2ConditionalAndOrRewriting +Constant (const byte*) PLEX_SCREEN_PTR#0 = (byte*)$400+$3f8 +Constant (const byte) plexInit::i#0 = 0 +Constant (const byte) plexSort::m#0 = 0 +Constant (const byte) plexSort::plexFreePrepare1_s#0 = 0 +Constant (const byte*) font_2x2::font_original#0 = CHARGEN +Constant (const byte*) font_2x2::font_2x2#0 = FONT +Constant (const byte*) font_2x2_to_sprites::font_2x2#0 = FONT +Constant (const byte*) font_2x2_to_sprites::sprites#0 = SPRITES +Constant (const byte) font_2x2_to_sprites::num_chars#0 = $40 +Constant (const byte*) plexInit::screen#0 = SCREEN +Constant (const byte*) main::toD0181_screen#0 = SCREEN +Constant (const byte*) main::toD0181_gfx#0 = CHARSET_DEFAULT +Constant (const word) main::xp#0 = $18 +Constant (const byte*) main::toSpritePtr1_sprite#0 = SPRITES +Constant (const byte) main::s#0 = 0 +Constant (const byte) main::s1#0 = 0 +Constant (const byte) sin_idx#18 = 0 +Constant (const byte) plexSine::sy#0 = 0 +Constant (const byte) plex_irq::rasterY#0 = 0 +Constant (const byte) font_2x2_to_sprites::c#0 = 0 +Constant (const byte) font_2x2_to_sprites::sprite_idx#0 = 0 +Constant (const byte) font_2x2_to_sprites::i#0 = 0 +Constant (const byte) font_2x2::c#0 = 0 +Constant (const byte) font_2x2::l2#0 = 0 +Constant (const byte) font_2x2::l#0 = 0 +Constant (const word) font_2x2::glyph_bits_2x2#0 = 0 +Constant (const byte) font_2x2::b#0 = 0 +Constant (const byte) font_2x2::$3 = 1 +Constant (const byte) font_2x2::$2 = 0 +Constant (const byte) font_2x2::l2#2 = 0 +Successful SSA optimization Pass2ConstantIdentification +Constant (const word) main::toD0181_$0 = (word)main::toD0181_screen#0 +Constant (const word) main::toD0181_$4 = (word)main::toD0181_gfx#0 +Constant (const word) main::toSpritePtr1_$0 = (word)main::toSpritePtr1_sprite#0 +Successful SSA optimization Pass2ConstantIdentification +if() condition always true - replacing block destination [137] if(true) goto main::@8 +Successful SSA optimization Pass2ConstantIfs +Resolved ranged next value [9] plexInit::i#1 ← ++ plexInit::i#2 to ++ +Resolved ranged comparison value [11] if(plexInit::i#1!=rangelast(0,PLEX_COUNT-1)) goto plexInit::@1 to (const nomodify byte) PLEX_COUNT-(byte) 1+(number) 1 +Resolved ranged next value [21] plexSort::m#1 ← ++ plexSort::m#2 to ++ +Resolved ranged comparison value [23] if(plexSort::m#1!=rangelast(0,PLEX_COUNT-2)) goto plexSort::@1 to (const nomodify byte) PLEX_COUNT-(byte) 2+(number) 1 +Resolved ranged next value [40] plexSort::plexFreePrepare1_s#1 ← ++ plexSort::plexFreePrepare1_s#2 to ++ +Resolved ranged comparison value [42] if(plexSort::plexFreePrepare1_s#1!=rangelast(0,7)) goto plexSort::plexFreePrepare1_@1 to (number) 8 +Resolved ranged next value [115] main::s#1 ← ++ main::s#2 to ++ +Resolved ranged comparison value [117] if(main::s#1!=rangelast(0,PLEX_COUNT-1)) goto main::@1 to (const nomodify byte) PLEX_COUNT-(byte) 1+(number) 1 +Resolved ranged next value [122] main::s1#1 ← ++ main::s1#2 to ++ +Resolved ranged comparison value [124] if(main::s1#1!=rangelast(0,7)) goto main::@3 to (number) 8 +Resolved ranged next value [153] plexSine::sy#1 ← ++ plexSine::sy#2 to ++ +Resolved ranged comparison value [155] if(plexSine::sy#1!=rangelast(0,PLEX_COUNT-1)) goto plexSine::@1 to (const nomodify byte) PLEX_COUNT-(byte) 1+(number) 1 +Resolved ranged next value [204] font_2x2_to_sprites::i#1 ← ++ font_2x2_to_sprites::i#2 to ++ +Resolved ranged comparison value [206] if(font_2x2_to_sprites::i#1!=rangelast(0,$14)) goto font_2x2_to_sprites::@4 to (number) $15 +Resolved ranged next value [233] font_2x2::b#1 ← ++ font_2x2::b#2 to ++ +Resolved ranged comparison value [235] if(font_2x2::b#1!=rangelast(0,7)) goto font_2x2::@3 to (number) 8 +Resolved ranged next value [250] font_2x2::l#1 ← ++ font_2x2::l#2 to ++ +Resolved ranged comparison value [252] if(font_2x2::l#1!=rangelast(0,7)) goto font_2x2::@2 to (number) 8 +Resolved ranged next value [258] font_2x2::c#1 ← ++ font_2x2::c#11 to ++ +Resolved ranged comparison value [260] if(font_2x2::c#1!=rangelast(0,$3f)) goto font_2x2::@1 to (number) $40 +Eliminating unused variable (byte*) PLEX_SCREEN_PTR#1 and assignment [3] (byte*) PLEX_SCREEN_PTR#1 ← (const byte*) plexInit::screen#0 + (word) $3f8 +Eliminating unused constant (const byte) plex_irq::rasterY#0 +Successful SSA optimization PassNEliminateUnusedVars +Eliminating unused constant (const byte*) plexInit::screen#0 +Successful SSA optimization PassNEliminateUnusedVars +Removing unused block main::@return +Successful SSA optimization Pass2EliminateUnusedBlocks +Adding number conversion cast (unumber) PLEX_COUNT-1+1 in if((byte) plexInit::i#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(number) 1) goto plexInit::@1 +Adding number conversion cast (unumber) 1 in if((byte) plexInit::i#1!=(unumber)(const nomodify byte) PLEX_COUNT-(byte) 1+(number) 1) goto plexInit::@1 +Adding number conversion cast (unumber) PLEX_COUNT-2+1 in if((byte) plexSort::m#1!=(const nomodify byte) PLEX_COUNT-(byte) 2+(number) 1) goto plexSort::@1 +Adding number conversion cast (unumber) 1 in if((byte) plexSort::m#1!=(unumber)(const nomodify byte) PLEX_COUNT-(byte) 2+(number) 1) goto plexSort::@1 +Adding number conversion cast (unumber) 8 in if((byte) plexSort::plexFreePrepare1_s#1!=(number) 8) goto plexSort::plexFreePrepare1_@1 +Adding number conversion cast (unumber) PLEX_COUNT-1+1 in if((byte) main::s#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(number) 1) goto main::@1 +Adding number conversion cast (unumber) 1 in if((byte) main::s#1!=(unumber)(const nomodify byte) PLEX_COUNT-(byte) 1+(number) 1) goto main::@1 +Adding number conversion cast (unumber) 8 in if((byte) main::s1#1!=(number) 8) goto main::@3 +Adding number conversion cast (unumber) PLEX_COUNT-1+1 in if((byte) plexSine::sy#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(number) 1) goto plexSine::@1 +Adding number conversion cast (unumber) 1 in if((byte) plexSine::sy#1!=(unumber)(const nomodify byte) PLEX_COUNT-(byte) 1+(number) 1) goto plexSine::@1 +Adding number conversion cast (unumber) $15 in if((byte) font_2x2_to_sprites::i#1!=(number) $15) goto font_2x2_to_sprites::@4 +Adding number conversion cast (unumber) 8 in if((byte) font_2x2::b#1!=(number) 8) goto font_2x2::@3 +Adding number conversion cast (unumber) 8 in if((byte) font_2x2::l#1!=(number) 8) goto font_2x2::@2 +Adding number conversion cast (unumber) $40 in if((byte) font_2x2::c#1!=(number) $40) goto font_2x2::@1 +Successful SSA optimization PassNAddNumberTypeConversions +Simplifying constant integer cast (const nomodify byte) PLEX_COUNT-(byte) 1+(unumber)(number) 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast (const nomodify byte) PLEX_COUNT-(byte) 2+(unumber)(number) 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 8 +Simplifying constant integer cast (const nomodify byte) PLEX_COUNT-(byte) 1+(unumber)(number) 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast 8 +Simplifying constant integer cast (const nomodify byte) PLEX_COUNT-(byte) 1+(unumber)(number) 1 +Simplifying constant integer cast 1 +Simplifying constant integer cast $15 +Simplifying constant integer cast 8 +Simplifying constant integer cast 8 +Simplifying constant integer cast $40 +Successful SSA optimization PassNCastSimplification +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) 1 +Finalized unsigned number type (byte) $15 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) 8 +Finalized unsigned number type (byte) $40 +Successful SSA optimization PassNFinalizeNumberTypeConversions +Alias candidate removed (volatile)plex_free_next = plexShowSprite::plexFreeAdd1_$2 +Alias candidate removed (volatile)plex_sprite_idx = plexShowSprite::$6 +Alias plexShowSprite::$11 = plexShowSprite::$10 +Alias font_2x2_to_sprites::$3 = font_2x2_to_sprites::$2 +Alias font_2x2::$12 = font_2x2::$10 +Alias font_2x2::$15 = font_2x2::$13 +Successful SSA optimization Pass2AliasElimination +Alias candidate removed (volatile)plex_free_next = plexShowSprite::plexFreeAdd1_$2 +Alias candidate removed (volatile)plex_sprite_idx = plexShowSprite::$6 +Simple Condition (bool~) plexSort::$5 [21] if((byte) plexSort::s#1!=(byte) $ff) goto plexSort::@8 +Simple Condition (bool~) plex_irq::$3 [120] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@9 +Simple Condition (bool~) plexSort::$6 [188] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 +Simple Condition (bool~) plex_irq::$5 [189] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3 +Successful SSA optimization Pass2ConditionalJumpSimplification +Negating conditional jump and destination [21] if((byte) plexSort::s#1==(byte) $ff) goto plexSort::@4 +Negating conditional jump and destination [120] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 +Successful SSA optimization Pass2ConditionalJumpSequenceImprovement +Constant right-side identified [67] (word~) main::toD0181_$1 ← (const word) main::toD0181_$0 & (word) $3fff +Constant right-side identified [70] (byte~) main::toD0181_$5 ← > (const word) main::toD0181_$4 +Constant right-side identified [75] (word~) main::toSpritePtr1_$1 ← (const word) main::toSpritePtr1_$0 / (byte) $40 +Constant right-side identified [143] (byte*) font_2x2_to_sprites::char_left#2 ← (const byte*) font_2x2_to_sprites::font_2x2#0 + (byte) ' '*(byte) 8 +Constant right-side identified [144] (byte*) font_2x2_to_sprites::char_right#2 ← (const byte*) font_2x2_to_sprites::font_2x2#0 + (byte) ' '*(byte) 8 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const word) main::toD0181_$1 = main::toD0181_$0&$3fff +Constant (const byte) main::toD0181_$5 = >main::toD0181_$4 +Constant (const word) main::toSpritePtr1_$1 = main::toSpritePtr1_$0/$40 +Constant (const byte*) font_2x2_to_sprites::char_left#2 = font_2x2_to_sprites::font_2x2#0+' '*8 +Constant (const byte*) font_2x2_to_sprites::char_right#2 = font_2x2_to_sprites::font_2x2#0+' '*8 +Successful SSA optimization Pass2ConstantIdentification +Constant (const byte) main::toSpritePtr1_return#0 = (byte)main::toSpritePtr1_$1 +Successful SSA optimization Pass2ConstantIdentification +Alias candidate removed (volatile)plex_free_next = plexShowSprite::plexFreeAdd1_$2 +Alias candidate removed (volatile)plex_sprite_idx = plexShowSprite::$6 +Constant right-side identified [65] (word~) main::toD0181_$2 ← (const word) main::toD0181_$1 * (byte) 4 +Constant right-side identified [67] (byte~) main::toD0181_$6 ← (const byte) main::toD0181_$5 / (byte) 4 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const word) main::toD0181_$2 = main::toD0181_$1*4 +Constant (const byte) main::toD0181_$6 = main::toD0181_$5/4 +Successful SSA optimization Pass2ConstantIdentification +Alias candidate removed (volatile)plex_free_next = plexShowSprite::plexFreeAdd1_$2 +Alias candidate removed (volatile)plex_sprite_idx = plexShowSprite::$6 +Constant right-side identified [65] (byte~) main::toD0181_$3 ← > (const word) main::toD0181_$2 +Constant right-side identified [66] (byte~) main::toD0181_$7 ← (const byte) main::toD0181_$6 & (byte) $f +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const byte) main::toD0181_$3 = >main::toD0181_$2 +Constant (const byte) main::toD0181_$7 = main::toD0181_$6&$f +Successful SSA optimization Pass2ConstantIdentification +Alias candidate removed (volatile)plex_free_next = plexShowSprite::plexFreeAdd1_$2 +Alias candidate removed (volatile)plex_sprite_idx = plexShowSprite::$6 +Constant right-side identified [65] (byte) main::toD0181_return#0 ← (const byte) main::toD0181_$3 | (const byte) main::toD0181_$7 +Successful SSA optimization Pass2ConstantRValueConsolidation +Constant (const byte) main::toD0181_return#0 = main::toD0181_$3|main::toD0181_$7 +Successful SSA optimization Pass2ConstantIdentification +Alias candidate removed (volatile)plex_free_next = plexShowSprite::plexFreeAdd1_$2 +Alias candidate removed (volatile)plex_sprite_idx = plexShowSprite::$6 +Rewriting multiplication to use shift [31] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx * (byte) 2 +Rewriting multiplication to use shift [41] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 * (const byte) SIZEOF_WORD +Rewriting multiplication to use shift [69] (byte~) main::$12 ← (byte) main::s#2 * (const byte) SIZEOF_WORD +Successful SSA optimization Pass2MultiplyToShiftRewriting +Inlining constant with var siblings (const byte) plexInit::i#0 +Inlining constant with var siblings (const byte) plexSort::m#0 +Inlining constant with var siblings (const byte) plexSort::plexFreePrepare1_s#0 +Inlining constant with var siblings (const word) main::xp#0 +Inlining constant with var siblings (const byte) main::s#0 +Inlining constant with var siblings (const byte) main::s1#0 +Inlining constant with var siblings (const byte) plexSine::sy#0 +Inlining constant with var siblings (const byte) font_2x2_to_sprites::c#0 +Inlining constant with var siblings (const byte) font_2x2_to_sprites::sprite_idx#0 +Inlining constant with var siblings (const byte) font_2x2_to_sprites::i#0 +Inlining constant with var siblings (const byte*) font_2x2_to_sprites::char_left#2 +Inlining constant with var siblings (const byte*) font_2x2_to_sprites::char_right#2 +Inlining constant with var siblings (const byte) font_2x2::c#0 +Inlining constant with var siblings (const byte) font_2x2::l2#0 +Inlining constant with var siblings (const byte) font_2x2::l#0 +Inlining constant with var siblings (const word) font_2x2::glyph_bits_2x2#0 +Inlining constant with var siblings (const byte) font_2x2::b#0 +Inlining constant with var siblings (const byte) font_2x2::l2#2 +Inlining constant with var siblings (const byte) sin_idx#18 +Constant inlined main::xp#0 = (word) $18 +Constant inlined main::toD0181_screen#0 = (const nomodify byte*) SCREEN +Constant inlined main::toD0181_gfx#0 = (const nomodify byte*) CHARSET_DEFAULT +Constant inlined main::toSpritePtr1_$0 = (word)(const nomodify byte*) SPRITES +Constant inlined plexSort::plexFreePrepare1_s#0 = (byte) 0 +Constant inlined plexInit::i#0 = (byte) 0 +Constant inlined plexSort::m#0 = (byte) 0 +Constant inlined font_2x2::glyph_bits_2x2#0 = (word) 0 +Constant inlined font_2x2::l2#0 = (byte) 0 +Constant inlined font_2x2::font_2x2#0 = (const nomodify byte*) FONT +Constant inlined sin_idx#18 = (byte) 0 +Constant inlined font_2x2::l2#2 = (byte) 0 +Constant inlined font_2x2_to_sprites::char_right#2 = (const nomodify byte*) FONT+(byte) ' '*(byte) 8 +Constant inlined main::toSpritePtr1_$1 = (word)(const nomodify byte*) SPRITES/(byte) $40 +Constant inlined font_2x2_to_sprites::font_2x2#0 = (const nomodify byte*) FONT +Constant inlined plexSine::sy#0 = (byte) 0 +Constant inlined main::s1#0 = (byte) 0 +Constant inlined main::toSpritePtr1_sprite#0 = (const nomodify byte*) SPRITES +Constant inlined font_2x2::$2 = (byte) 0 +Constant inlined font_2x2::$3 = (byte) 1 +Constant inlined main::s#0 = (byte) 0 +Constant inlined font_2x2::b#0 = (byte) 0 +Constant inlined font_2x2_to_sprites::i#0 = (byte) 0 +Constant inlined main::toD0181_$7 = >(word)(const nomodify byte*) CHARSET_DEFAULT/(byte) 4&(byte) $f +Constant inlined font_2x2::c#0 = (byte) 0 +Constant inlined main::toD0181_$2 = (word)(const nomodify byte*) SCREEN&(word) $3fff*(byte) 4 +Constant inlined font_2x2_to_sprites::c#0 = (byte) 0 +Constant inlined main::toD0181_$1 = (word)(const nomodify byte*) SCREEN&(word) $3fff +Constant inlined main::toD0181_$0 = (word)(const nomodify byte*) SCREEN +Constant inlined main::toD0181_$6 = >(word)(const nomodify byte*) CHARSET_DEFAULT/(byte) 4 +Constant inlined main::toD0181_$5 = >(word)(const nomodify byte*) CHARSET_DEFAULT +Constant inlined font_2x2_to_sprites::char_left#2 = (const nomodify byte*) FONT+(byte) ' '*(byte) 8 +Constant inlined main::toD0181_$4 = (word)(const nomodify byte*) CHARSET_DEFAULT +Constant inlined main::toD0181_$3 = >(word)(const nomodify byte*) SCREEN&(word) $3fff*(byte) 4 +Constant inlined font_2x2::l#0 = (byte) 0 +Constant inlined font_2x2_to_sprites::sprites#0 = (const nomodify byte*) SPRITES +Constant inlined font_2x2::font_original#0 = (const nomodify byte*) CHARGEN +Constant inlined font_2x2_to_sprites::sprite_idx#0 = (byte) 0 +Successful SSA optimization Pass2ConstantInlining +Consolidated array index constant in assignment *(PLEX_SORTED_IDX+1 + plexSort::$1) +Consolidated array index constant in assignment *(PLEX_SORTED_IDX+1 + plexSort::$4) +Successful SSA optimization Pass2ConstantAdditionElimination +Alias candidate removed (volatile)plex_free_next = plexShowSprite::plexFreeAdd1_$2 +Alias candidate removed (volatile)plex_sprite_idx = plexShowSprite::$6 +Alias plexSort::m#2 = plexSort::$1 +Alias plexSort::s#3 = plexSort::$4 +Successful SSA optimization Pass2AliasElimination +Alias candidate removed (volatile)plex_free_next = plexShowSprite::plexFreeAdd1_$2 +Alias candidate removed (volatile)plex_sprite_idx = plexShowSprite::$6 +Eliminating unused constant (const byte) SIZEOF_WORD +Successful SSA optimization PassNEliminateUnusedVars +Alias candidate removed (volatile)plex_free_next = plexShowSprite::plexFreeAdd1_$2 +Alias candidate removed (volatile)plex_sprite_idx = plexShowSprite::$6 +Added new block during phi lifting plexInit::@4(between plexInit::@1 and plexInit::@1) +Added new block during phi lifting plexSort::@9(between plexSort::@2 and plexSort::@1) +Added new block during phi lifting plexSort::@10(between plexSort::@8 and plexSort::@3) +Added new block during phi lifting plexSort::@11(between plexSort::plexFreePrepare1_@1 and plexSort::plexFreePrepare1_@1) +Added new block during phi lifting main::@26(between main::@1 and main::@1) +Added new block during phi lifting main::@27(between main::@3 and main::@3) +Added new block during phi lifting plexSine::@3(between plexSine::@1 and plexSine::@1) +Added new block during phi lifting font_2x2_to_sprites::@15(between font_2x2_to_sprites::@7 and font_2x2_to_sprites::@4) +Added new block during phi lifting font_2x2_to_sprites::@16(between font_2x2_to_sprites::@8 and font_2x2_to_sprites::@7) +Added new block during phi lifting font_2x2::@14(between font_2x2::@12 and font_2x2::@1) +Added new block during phi lifting font_2x2::@15(between font_2x2::@11 and font_2x2::@2) +Added new block during phi lifting font_2x2::@16(between font_2x2::@6 and font_2x2::@3) +Added new block during phi lifting font_2x2::@17(between font_2x2::@9 and font_2x2::@11) +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @13 +Adding NOP phi() at start of @17 +Adding NOP phi() at start of @18 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main::@20 +Adding NOP phi() at start of main::@21 +Adding NOP phi() at start of main::toD0181 +Adding NOP phi() at start of main::toD0181_@return +Adding NOP phi() at start of main::toSpritePtr1 +Adding NOP phi() at start of main::toSpritePtr1_@return +Adding NOP phi() at start of main::@18 +Adding NOP phi() at start of main::@4 +Adding NOP phi() at start of main::@22 +Adding NOP phi() at start of main::@5 +Adding NOP phi() at start of main::@24 +Adding NOP phi() at start of plexSort +Adding NOP phi() at start of plexSort::plexFreePrepare1 +Adding NOP phi() at start of plexInit +Adding NOP phi() at start of plexInit::plexSetScreen1 +Adding NOP phi() at start of plexInit::@3 +Adding NOP phi() at start of font_2x2_to_sprites +Adding NOP phi() at start of font_2x2_to_sprites::@9 +Adding NOP phi() at start of font_2x2 +Adding NOP phi() at start of font_2x2::@5 +Adding NOP phi() at start of font_2x2::@4 +Adding NOP phi() at start of plex_irq::@3 +Adding NOP phi() at start of plex_irq::@8 +Adding NOP phi() at start of plex_irq::plexFreeNextYpos1_@return +CALL GRAPH +Calls in [] to main:8 +Calls in [main] to font_2x2:13 font_2x2_to_sprites:16 plexInit:18 plexSine:40 plexSort:42 plexSine:54 plexSort:56 +Calls in [plex_irq] to plexShowSprite:206 + +Created 34 initial phi equivalence classes +Coalesced [53] sin_idx#36 ← sin_idx#12 +Coalesced [58] main::s1#3 ← main::s1#1 +Coalesced [59] main::sprite#3 ← main::sprite#1 +Coalesced [60] main::s#3 ← main::s#1 +Coalesced [61] main::xp#6 ← main::xp#1 +Not coalescing [67] plexSort::s#6 ← plexSort::m#2 +Coalesced [87] plexSort::plexFreePrepare1_s#3 ← plexSort::plexFreePrepare1_s#1 +Coalesced [88] plexSort::m#7 ← plexSort::m#1 +Coalesced [89] plexSort::s#5 ← plexSort::s#1 +Coalesced [92] plexSine::y_idx#3 ← plexSine::y_idx#0 +Coalesced [100] plexSine::y_idx#4 ← plexSine::y_idx#1 +Coalesced [101] plexSine::sy#3 ← plexSine::sy#1 +Coalesced [110] plexInit::i#3 ← plexInit::i#1 +Not coalescing [116] font_2x2_to_sprites::char_left#6 ← font_2x2_to_sprites::char_current#2 +Coalesced [117] font_2x2_to_sprites::char_right#6 ← font_2x2_to_sprites::char_right#0 +Coalesced [135] font_2x2_to_sprites::c#10 ← font_2x2_to_sprites::c#1 +Coalesced [136] font_2x2_to_sprites::char_current#10 ← font_2x2_to_sprites::char_current#1 +Coalesced [137] font_2x2_to_sprites::sprite#10 ← font_2x2_to_sprites::sprite#1 +Coalesced [138] font_2x2_to_sprites::i#7 ← font_2x2_to_sprites::i#1 +Coalesced [139] font_2x2_to_sprites::char_left#7 ← font_2x2_to_sprites::char_left#4 +Coalesced [140] font_2x2_to_sprites::sprite_idx#9 ← font_2x2_to_sprites::sprite_idx#3 +Coalesced [141] font_2x2_to_sprites::char_right#7 ← font_2x2_to_sprites::char_right#4 +Coalesced (already) [142] font_2x2_to_sprites::char_left#9 ← font_2x2_to_sprites::char_left#3 +Coalesced (already) [143] font_2x2_to_sprites::char_right#9 ← font_2x2_to_sprites::char_right#3 +Coalesced [146] font_2x2_to_sprites::char_left#8 ← font_2x2_to_sprites::char_left#1 +Coalesced [147] font_2x2_to_sprites::char_right#8 ← font_2x2_to_sprites::char_right#1 +Not coalescing [151] font_2x2::next_2x2_left#10 ← font_2x2::next_2x2_left#0 +Coalesced [152] font_2x2::next_2x2_right#9 ← font_2x2::next_2x2_right#0 +Coalesced [155] font_2x2::glyph_bits#6 ← font_2x2::glyph_bits#0 +Coalesced [180] font_2x2::next_2x2_left#12 ← font_2x2::next_2x2_left#1 +Coalesced [181] font_2x2::next_2x2_right#11 ← font_2x2::next_2x2_right#1 +Coalesced [190] font_2x2::next_2x2_left#9 ← font_2x2::next_2x2#1 +Coalesced [191] font_2x2::next_original#12 ← font_2x2::next_original#1 +Coalesced [192] font_2x2::c#12 ← font_2x2::c#1 +Coalesced [193] font_2x2::l#10 ← font_2x2::l#1 +Coalesced [194] font_2x2::next_2x2_left#11 ← font_2x2::next_2x2_left#8 +Coalesced [195] font_2x2::l2#10 ← font_2x2::l2#9 +Coalesced [196] font_2x2::next_2x2_right#10 ← font_2x2::next_2x2_right#8 +Coalesced (already) [197] font_2x2::next_2x2_left#13 ← font_2x2::next_2x2_left#7 +Coalesced [198] font_2x2::l2#11 ← font_2x2::l2#1 +Coalesced (already) [199] font_2x2::next_2x2_right#12 ← font_2x2::next_2x2_right#7 +Coalesced [200] font_2x2::glyph_bits#7 ← font_2x2::glyph_bits#1 +Coalesced [201] font_2x2::glyph_bits_2x2#8 ← font_2x2::glyph_bits_2x2#2 +Coalesced [202] font_2x2::b#6 ← font_2x2::b#1 +Coalesced down to 29 phi equivalence classes +Culled Empty Block (label) @13 +Culled Empty Block (label) @18 +Culled Empty Block (label) main::@21 +Culled Empty Block (label) main::toD0181_@return +Culled Empty Block (label) main::toSpritePtr1_@return +Culled Empty Block (label) main::@18 +Culled Empty Block (label) main::@5 +Culled Empty Block (label) main::@27 +Culled Empty Block (label) main::@26 +Culled Empty Block (label) plexSort::@11 +Culled Empty Block (label) plexSort::@9 +Culled Empty Block (label) plexSort::@10 +Culled Empty Block (label) plexSine::@3 +Culled Empty Block (label) plexInit::@3 +Culled Empty Block (label) plexInit::@4 +Culled Empty Block (label) font_2x2_to_sprites::@9 +Culled Empty Block (label) font_2x2_to_sprites::@15 +Culled Empty Block (label) font_2x2::@5 +Culled Empty Block (label) font_2x2::@14 +Culled Empty Block (label) font_2x2::@15 +Culled Empty Block (label) font_2x2::@17 +Culled Empty Block (label) font_2x2::@16 +Culled Empty Block (label) plex_irq::@8 +Culled Empty Block (label) plex_irq::plexFreeNextYpos1_@return +Renumbering block @4 to @1 +Renumbering block @9 to @2 +Renumbering block @14 to @3 +Renumbering block @17 to @4 +Renumbering block plexSort::@8 to plexSort::@7 +Renumbering block plexShowSprite::@4 to plexShowSprite::@3 +Renumbering block plexShowSprite::@6 to plexShowSprite::@4 +Renumbering block plexShowSprite::@7 to plexShowSprite::@5 +Renumbering block main::@8 to main::@5 +Renumbering block main::@10 to main::@6 +Renumbering block main::@17 to main::@7 +Renumbering block main::@19 to main::@8 +Renumbering block main::@20 to main::@9 +Renumbering block main::@22 to main::@10 +Renumbering block main::@23 to main::@11 +Renumbering block main::@24 to main::@12 +Renumbering block main::@25 to main::@13 +Renumbering block plex_irq::@7 to plex_irq::@6 +Renumbering block plex_irq::@9 to plex_irq::@7 +Renumbering block font_2x2_to_sprites::@4 to font_2x2_to_sprites::@3 +Renumbering block font_2x2_to_sprites::@5 to font_2x2_to_sprites::@4 +Renumbering block font_2x2_to_sprites::@7 to font_2x2_to_sprites::@5 +Renumbering block font_2x2_to_sprites::@8 to font_2x2_to_sprites::@6 +Renumbering block font_2x2_to_sprites::@11 to font_2x2_to_sprites::@7 +Renumbering block font_2x2_to_sprites::@16 to font_2x2_to_sprites::@8 +Renumbering block font_2x2::@6 to font_2x2::@5 +Renumbering block font_2x2::@9 to font_2x2::@6 +Renumbering block font_2x2::@10 to font_2x2::@7 +Renumbering block font_2x2::@11 to font_2x2::@8 +Renumbering block font_2x2::@12 to font_2x2::@9 +Adding NOP phi() at start of @begin +Adding NOP phi() at start of @4 +Adding NOP phi() at start of @end +Adding NOP phi() at start of main::@9 +Adding NOP phi() at start of main::toD0181 +Adding NOP phi() at start of main::toSpritePtr1 +Adding NOP phi() at start of main::@4 +Adding NOP phi() at start of main::@10 +Adding NOP phi() at start of main::@6 +Adding NOP phi() at start of main::@12 +Adding NOP phi() at start of plexSort +Adding NOP phi() at start of plexSort::plexFreePrepare1 +Adding NOP phi() at start of plexInit +Adding NOP phi() at start of plexInit::plexSetScreen1 +Adding NOP phi() at start of font_2x2_to_sprites +Adding NOP phi() at start of font_2x2_to_sprites::@8 +Adding NOP phi() at start of font_2x2 +Adding NOP phi() at start of font_2x2::@4 +Adding NOP phi() at start of plex_irq::@3 + +FINAL CONTROL FLOW GRAPH +@begin: scope:[] from + [0] phi() + to:@1 +@1: scope:[] from @begin + [1] (volatile byte) plex_show_idx ← (byte) 0 + [2] (volatile byte) plex_sprite_idx ← (byte) 0 + [3] (volatile byte) plex_sprite_msb ← (byte) 1 + to:@2 +@2: scope:[] from @1 + [4] (volatile byte) plex_free_next ← (byte) 0 + to:@3 +@3: scope:[] from @2 + [5] (volatile bool) framedone ← false + to:@4 +@4: scope:[] from @3 + [6] phi() + [7] call main + to:@end +@end: scope:[] from @4 + [8] phi() + +(void()) main() +main: scope:[main] from @4 + asm { sei } + [10] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_CHARROM + [11] call font_2x2 + to:main::@8 +main::@8: scope:[main] from main + [12] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_BASIC_KERNEL_IO + asm { cli } + [14] call font_2x2_to_sprites + to:main::@9 +main::@9: scope:[main] from main::@8 + [15] phi() + [16] call plexInit + to:main::toD0181 +main::toD0181: scope:[main] from main::@9 + [17] phi() + to:main::@7 +main::@7: scope:[main] from main::toD0181 + [18] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 + to:main::toSpritePtr1 +main::toSpritePtr1: scope:[main] from main::@7 + [19] phi() + to:main::@1 +main::@1: scope:[main] from main::@1 main::toSpritePtr1 + [20] (word) main::xp#2 ← phi( main::@1/(word) main::xp#1 main::toSpritePtr1/(word) $18 ) + [20] (byte) main::s#2 ← phi( main::@1/(byte) main::s#1 main::toSpritePtr1/(byte) 0 ) + [20] (byte) main::sprite#2 ← phi( main::@1/(byte) main::sprite#1 main::toSpritePtr1/(const byte) main::toSpritePtr1_return#0 ) + [21] *((const byte*) PLEX_PTR + (byte) main::s#2) ← (byte) main::sprite#2 + [22] (byte) main::sprite#1 ← ++ (byte) main::sprite#2 + [23] (byte~) main::$12 ← (byte) main::s#2 << (byte) 1 + [24] *((const word*) PLEX_XPOS + (byte~) main::$12) ← (word) main::xp#2 + [25] (word) main::xp#1 ← (word) main::xp#2 + (byte) $a + [26] (byte) main::s#1 ← ++ (byte) main::s#2 + [27] if((byte) main::s#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto main::@1 + to:main::@2 +main::@2: scope:[main] from main::@1 + [28] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff + to:main::@3 +main::@3: scope:[main] from main::@2 main::@3 + [29] (byte) main::s1#2 ← phi( main::@2/(byte) 0 main::@3/(byte) main::s1#1 ) + [30] *((const nomodify byte*) SPRITES_COLS + (byte) main::s1#2) ← (const nomodify byte) WHITE + [31] (byte) main::s1#1 ← ++ (byte) main::s1#2 + [32] if((byte) main::s1#1!=(byte) 8) goto main::@3 + to:main::@4 +main::@4: scope:[main] from main::@3 + [33] phi() + [34] call plexSine + to:main::@10 +main::@10: scope:[main] from main::@4 + [35] phi() + [36] call plexSort + to:main::@11 +main::@11: scope:[main] from main::@10 + asm { sei } + [38] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR + [39] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f + [40] *((const nomodify byte*) RASTER) ← (byte) $28 + [41] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER + [42] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER + [43] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() + asm { cli } + to:main::@5 +main::@5: scope:[main] from main::@11 main::@13 main::@5 + [45] if((volatile bool) framedone) goto main::@6 + to:main::@5 +main::@6: scope:[main] from main::@5 + [46] phi() + [47] call plexSine + to:main::@12 +main::@12: scope:[main] from main::@6 + [48] phi() + [49] call plexSort + to:main::@13 +main::@13: scope:[main] from main::@12 + [50] (volatile bool) framedone ← false + to:main::@5 + +(void()) plexSort() +plexSort: scope:[plexSort] from main::@10 main::@12 + [51] phi() + to:plexSort::@1 +plexSort::@1: scope:[plexSort] from plexSort plexSort::@2 + [52] (byte) plexSort::m#2 ← phi( plexSort/(byte) 0 plexSort::@2/(byte) plexSort::m#1 ) + [53] (byte) plexSort::nxt_idx#0 ← *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2) + [54] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0) + [55] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 + to:plexSort::@5 +plexSort::@5: scope:[plexSort] from plexSort::@1 + [56] (byte) plexSort::s#6 ← (byte) plexSort::m#2 + to:plexSort::@3 +plexSort::@3: scope:[plexSort] from plexSort::@5 plexSort::@7 + [57] (byte) plexSort::s#3 ← phi( plexSort::@7/(byte) plexSort::s#1 plexSort::@5/(byte) plexSort::s#6 ) + [58] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) + [59] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 + [60] if((byte) plexSort::s#1==(byte) $ff) goto plexSort::@4 + to:plexSort::@7 +plexSort::@7: scope:[plexSort] from plexSort::@3 + [61] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 + to:plexSort::@4 +plexSort::@4: scope:[plexSort] from plexSort::@3 plexSort::@7 + [62] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 + [63] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 + to:plexSort::@2 +plexSort::@2: scope:[plexSort] from plexSort::@1 plexSort::@4 + [64] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 + [65] if((byte) plexSort::m#1!=(const nomodify byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1 + to:plexSort::@6 +plexSort::@6: scope:[plexSort] from plexSort::@2 + [66] (volatile byte) plex_show_idx ← (byte) 0 + [67] (volatile byte) plex_sprite_idx ← (byte) 0 + [68] (volatile byte) plex_sprite_msb ← (byte) 1 + to:plexSort::plexFreePrepare1 +plexSort::plexFreePrepare1: scope:[plexSort] from plexSort::@6 + [69] phi() + to:plexSort::plexFreePrepare1_@1 +plexSort::plexFreePrepare1_@1: scope:[plexSort] from plexSort::plexFreePrepare1 plexSort::plexFreePrepare1_@1 + [70] (byte) plexSort::plexFreePrepare1_s#2 ← phi( plexSort::plexFreePrepare1/(byte) 0 plexSort::plexFreePrepare1_@1/(byte) plexSort::plexFreePrepare1_s#1 ) + [71] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 + [72] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 + [73] 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 + [74] (volatile byte) plex_free_next ← (byte) 0 + to:plexSort::@return +plexSort::@return: scope:[plexSort] from plexSort::plexFreePrepare1_@2 + [75] return + to:@return + +(void()) plexSine() +plexSine: scope:[plexSine] from main::@4 main::@6 + [76] (byte) sin_idx#10 ← phi( main::@6/(byte) sin_idx#12 main::@4/(byte) 0 ) + [77] (byte) plexSine::y_idx#0 ← (byte) sin_idx#10 + to:plexSine::@1 +plexSine::@1: scope:[plexSine] from plexSine plexSine::@1 + [78] (byte) plexSine::sy#2 ← phi( plexSine/(byte) 0 plexSine::@1/(byte) plexSine::sy#1 ) + [78] (byte) plexSine::y_idx#2 ← phi( plexSine/(byte) plexSine::y_idx#0 plexSine::@1/(byte) plexSine::y_idx#1 ) + [79] *((const byte*) PLEX_YPOS + (byte) plexSine::sy#2) ← *((const byte*) YSIN + (byte) plexSine::y_idx#2) + [80] (byte) plexSine::y_idx#1 ← (byte) plexSine::y_idx#2 + (byte) 8 + [81] (byte) plexSine::sy#1 ← ++ (byte) plexSine::sy#2 + [82] if((byte) plexSine::sy#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto plexSine::@1 + to:plexSine::@2 +plexSine::@2: scope:[plexSine] from plexSine::@1 + [83] (byte) sin_idx#12 ← (byte) sin_idx#10 + (byte) 1 + to:plexSine::@return +plexSine::@return: scope:[plexSine] from plexSine::@2 + [84] return + to:@return + +(void()) plexInit((byte*) plexInit::screen) +plexInit: scope:[plexInit] from main::@9 + [85] phi() + to:plexInit::plexSetScreen1 +plexInit::plexSetScreen1: scope:[plexInit] from plexInit + [86] phi() + to:plexInit::@1 +plexInit::@1: scope:[plexInit] from plexInit::@1 plexInit::plexSetScreen1 + [87] (byte) plexInit::i#2 ← phi( plexInit::@1/(byte) plexInit::i#1 plexInit::plexSetScreen1/(byte) 0 ) + [88] *((const byte*) PLEX_SORTED_IDX + (byte) plexInit::i#2) ← (byte) plexInit::i#2 + [89] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2 + [90] if((byte) plexInit::i#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto plexInit::@1 + to:plexInit::@return +plexInit::@return: scope:[plexInit] from plexInit::@1 + [91] return + to:@return + +(void()) font_2x2_to_sprites((byte*) font_2x2_to_sprites::font_2x2 , (byte*) font_2x2_to_sprites::sprites , (byte) font_2x2_to_sprites::num_chars) +font_2x2_to_sprites: scope:[font_2x2_to_sprites] from main::@8 + [92] phi() + to:font_2x2_to_sprites::@1 +font_2x2_to_sprites::@1: scope:[font_2x2_to_sprites] from font_2x2_to_sprites font_2x2_to_sprites::@7 + [93] (byte*) font_2x2_to_sprites::sprite#4 ← phi( font_2x2_to_sprites/(const nomodify byte*) SPRITES font_2x2_to_sprites::@7/(byte*) font_2x2_to_sprites::sprite#1 ) + [93] (byte*) font_2x2_to_sprites::char_current#2 ← phi( font_2x2_to_sprites/(const nomodify byte*) FONT font_2x2_to_sprites::@7/(byte*) font_2x2_to_sprites::char_current#1 ) + [93] (byte) font_2x2_to_sprites::c#2 ← phi( font_2x2_to_sprites/(byte) 0 font_2x2_to_sprites::@7/(byte) font_2x2_to_sprites::c#1 ) + [94] if((byte) font_2x2_to_sprites::c#2<(const byte) font_2x2_to_sprites::num_chars#0) goto font_2x2_to_sprites::@2 + to:font_2x2_to_sprites::@return +font_2x2_to_sprites::@return: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@1 + [95] return + to:@return +font_2x2_to_sprites::@2: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@1 + [96] (byte*) font_2x2_to_sprites::char_right#0 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $40*(number) 8 + [97] (byte*) font_2x2_to_sprites::char_left#6 ← (byte*) font_2x2_to_sprites::char_current#2 + to:font_2x2_to_sprites::@3 +font_2x2_to_sprites::@3: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@2 font_2x2_to_sprites::@5 + [98] (byte*) font_2x2_to_sprites::char_right#3 ← phi( font_2x2_to_sprites::@2/(byte*) font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::@5/(byte*) font_2x2_to_sprites::char_right#4 ) + [98] (byte) font_2x2_to_sprites::sprite_idx#4 ← phi( font_2x2_to_sprites::@2/(byte) 0 font_2x2_to_sprites::@5/(byte) font_2x2_to_sprites::sprite_idx#3 ) + [98] (byte*) font_2x2_to_sprites::char_left#3 ← phi( font_2x2_to_sprites::@2/(byte*) font_2x2_to_sprites::char_left#6 font_2x2_to_sprites::@5/(byte*) font_2x2_to_sprites::char_left#4 ) + [98] (byte) font_2x2_to_sprites::i#2 ← phi( font_2x2_to_sprites::@2/(byte) 0 font_2x2_to_sprites::@5/(byte) font_2x2_to_sprites::i#1 ) + [99] (byte~) font_2x2_to_sprites::$3 ← (byte) font_2x2_to_sprites::i#2 & (byte) 7 + [100] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#4) ← *((byte*) font_2x2_to_sprites::char_left#3 + (byte~) font_2x2_to_sprites::$3) + [101] (byte) font_2x2_to_sprites::sprite_idx#1 ← ++ (byte) font_2x2_to_sprites::sprite_idx#4 + [102] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#1) ← *((byte*) font_2x2_to_sprites::char_right#3 + (byte~) font_2x2_to_sprites::$3) + [103] (byte) font_2x2_to_sprites::sprite_idx#2 ← ++ (byte) font_2x2_to_sprites::sprite_idx#1 + [104] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#2) ← (byte) 0 + [105] (byte) font_2x2_to_sprites::sprite_idx#3 ← ++ (byte) font_2x2_to_sprites::sprite_idx#2 + [106] if((byte) font_2x2_to_sprites::i#2==(byte) 7) goto font_2x2_to_sprites::@4 + to:font_2x2_to_sprites::@6 +font_2x2_to_sprites::@6: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@3 + [107] if((byte) font_2x2_to_sprites::i#2!=(byte) $f) goto font_2x2_to_sprites::@8 + to:font_2x2_to_sprites::@5 +font_2x2_to_sprites::@8: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@6 + [108] phi() + to:font_2x2_to_sprites::@5 +font_2x2_to_sprites::@5: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@4 font_2x2_to_sprites::@6 font_2x2_to_sprites::@8 + [109] (byte*) font_2x2_to_sprites::char_right#4 ← phi( font_2x2_to_sprites::@4/(byte*) font_2x2_to_sprites::char_right#1 font_2x2_to_sprites::@8/(byte*) font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::@6/(const nomodify byte*) FONT+(byte) ' '*(byte) 8 ) + [109] (byte*) font_2x2_to_sprites::char_left#4 ← phi( font_2x2_to_sprites::@4/(byte*) font_2x2_to_sprites::char_left#1 font_2x2_to_sprites::@8/(byte*) font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::@6/(const nomodify byte*) FONT+(byte) ' '*(byte) 8 ) + [110] (byte) font_2x2_to_sprites::i#1 ← ++ (byte) font_2x2_to_sprites::i#2 + [111] if((byte) font_2x2_to_sprites::i#1!=(byte) $15) goto font_2x2_to_sprites::@3 + to:font_2x2_to_sprites::@7 +font_2x2_to_sprites::@7: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@5 + [112] (byte*) font_2x2_to_sprites::char_current#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (byte) 8 + [113] (byte*) font_2x2_to_sprites::sprite#1 ← (byte*) font_2x2_to_sprites::sprite#4 + (byte) $40 + [114] (byte) font_2x2_to_sprites::c#1 ← ++ (byte) font_2x2_to_sprites::c#2 + to:font_2x2_to_sprites::@1 +font_2x2_to_sprites::@4: scope:[font_2x2_to_sprites] from font_2x2_to_sprites::@3 + [115] (byte*) font_2x2_to_sprites::char_left#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $80*(number) 8 + [116] (byte*) font_2x2_to_sprites::char_right#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $c0*(number) 8 + to:font_2x2_to_sprites::@5 + +(void()) font_2x2((byte*) font_2x2::font_original , (byte*) font_2x2::font_2x2) +font_2x2: scope:[font_2x2] from main + [117] phi() + to:font_2x2::@1 +font_2x2::@1: scope:[font_2x2] from font_2x2 font_2x2::@9 + [118] (byte) font_2x2::c#11 ← phi( font_2x2/(byte) 0 font_2x2::@9/(byte) font_2x2::c#1 ) + [118] (byte*) font_2x2::next_original#4 ← phi( font_2x2/(const nomodify byte*) CHARGEN font_2x2::@9/(byte*) font_2x2::next_original#1 ) + [118] (byte*) font_2x2::next_2x2_left#0 ← phi( font_2x2/(const nomodify byte*) FONT font_2x2::@9/(byte*) font_2x2::next_2x2#1 ) + [119] (byte*) font_2x2::next_2x2_right#0 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $40*(number) 8 + [120] (byte*) font_2x2::next_2x2_left#10 ← (byte*) font_2x2::next_2x2_left#0 + to:font_2x2::@2 +font_2x2::@2: scope:[font_2x2] from font_2x2::@1 font_2x2::@8 + [121] (byte*) font_2x2::next_2x2_right#7 ← phi( font_2x2::@1/(byte*) font_2x2::next_2x2_right#0 font_2x2::@8/(byte*) font_2x2::next_2x2_right#8 ) + [121] (byte) font_2x2::l2#8 ← phi( font_2x2::@1/(byte) 0 font_2x2::@8/(byte) font_2x2::l2#9 ) + [121] (byte*) font_2x2::next_2x2_left#7 ← phi( font_2x2::@1/(byte*) font_2x2::next_2x2_left#10 font_2x2::@8/(byte*) font_2x2::next_2x2_left#8 ) + [121] (byte) font_2x2::l#2 ← phi( font_2x2::@1/(byte) 0 font_2x2::@8/(byte) font_2x2::l#1 ) + [122] (byte) font_2x2::glyph_bits#0 ← *((byte*) font_2x2::next_original#4 + (byte) font_2x2::l#2) + to:font_2x2::@3 +font_2x2::@3: scope:[font_2x2] from font_2x2::@2 font_2x2::@5 + [123] (byte) font_2x2::b#2 ← phi( font_2x2::@2/(byte) 0 font_2x2::@5/(byte) font_2x2::b#1 ) + [123] (word) font_2x2::glyph_bits_2x2#3 ← phi( font_2x2::@2/(word) 0 font_2x2::@5/(word) font_2x2::glyph_bits_2x2#2 ) + [123] (byte) font_2x2::glyph_bits#2 ← phi( font_2x2::@2/(byte) font_2x2::glyph_bits#0 font_2x2::@5/(byte) font_2x2::glyph_bits#1 ) + [124] (byte~) font_2x2::$1 ← (byte) font_2x2::glyph_bits#2 & (byte) $80 + [125] if((byte) 0!=(byte~) font_2x2::$1) goto font_2x2::@4 + to:font_2x2::@5 +font_2x2::@4: scope:[font_2x2] from font_2x2::@3 + [126] phi() + to:font_2x2::@5 +font_2x2::@5: scope:[font_2x2] from font_2x2::@3 font_2x2::@4 + [127] (byte) font_2x2::glyph_bit#0 ← phi( font_2x2::@4/(byte) 1 font_2x2::@3/(byte) 0 ) + [128] (word~) font_2x2::$5 ← (word) font_2x2::glyph_bits_2x2#3 << (byte) 1 + [129] (word) font_2x2::glyph_bits_2x2#1 ← (word~) font_2x2::$5 | (byte) font_2x2::glyph_bit#0 + [130] (word~) font_2x2::$7 ← (word) font_2x2::glyph_bits_2x2#1 << (byte) 1 + [131] (word) font_2x2::glyph_bits_2x2#2 ← (word~) font_2x2::$7 | (byte) font_2x2::glyph_bit#0 + [132] (byte) font_2x2::glyph_bits#1 ← (byte) font_2x2::glyph_bits#2 << (byte) 1 + [133] (byte) font_2x2::b#1 ← ++ (byte) font_2x2::b#2 + [134] if((byte) font_2x2::b#1!=(byte) 8) goto font_2x2::@3 + to:font_2x2::@6 +font_2x2::@6: scope:[font_2x2] from font_2x2::@5 + [135] (byte~) font_2x2::$12 ← > (word) font_2x2::glyph_bits_2x2#2 + [136] *((byte*) font_2x2::next_2x2_left#7 + (byte) font_2x2::l2#8) ← (byte~) font_2x2::$12 + [137] (byte~) font_2x2::$11 ← (byte) font_2x2::l2#8 + (byte) 1 + [138] *((byte*) font_2x2::next_2x2_left#7 + (byte~) font_2x2::$11) ← (byte~) font_2x2::$12 + [139] (byte~) font_2x2::$15 ← < (word) font_2x2::glyph_bits_2x2#2 + [140] *((byte*) font_2x2::next_2x2_right#7 + (byte) font_2x2::l2#8) ← (byte~) font_2x2::$15 + [141] (byte~) font_2x2::$14 ← (byte) font_2x2::l2#8 + (byte) 1 + [142] *((byte*) font_2x2::next_2x2_right#7 + (byte~) font_2x2::$14) ← (byte~) font_2x2::$15 + [143] (byte) font_2x2::l2#1 ← (byte) font_2x2::l2#8 + (byte) 2 + [144] if((byte) font_2x2::l2#1!=(byte) 8) goto font_2x2::@8 + to:font_2x2::@7 +font_2x2::@7: scope:[font_2x2] from font_2x2::@6 + [145] (byte*) font_2x2::next_2x2_left#1 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $80*(number) 8 + [146] (byte*) font_2x2::next_2x2_right#1 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $c0*(number) 8 + to:font_2x2::@8 +font_2x2::@8: scope:[font_2x2] from font_2x2::@6 font_2x2::@7 + [147] (byte*) font_2x2::next_2x2_right#8 ← phi( font_2x2::@7/(byte*) font_2x2::next_2x2_right#1 font_2x2::@6/(byte*) font_2x2::next_2x2_right#7 ) + [147] (byte) font_2x2::l2#9 ← phi( font_2x2::@7/(byte) 0 font_2x2::@6/(byte) font_2x2::l2#1 ) + [147] (byte*) font_2x2::next_2x2_left#8 ← phi( font_2x2::@7/(byte*) font_2x2::next_2x2_left#1 font_2x2::@6/(byte*) font_2x2::next_2x2_left#7 ) + [148] (byte) font_2x2::l#1 ← ++ (byte) font_2x2::l#2 + [149] if((byte) font_2x2::l#1!=(byte) 8) goto font_2x2::@2 + to:font_2x2::@9 +font_2x2::@9: scope:[font_2x2] from font_2x2::@8 + [150] (byte*) font_2x2::next_2x2#1 ← (byte*) font_2x2::next_2x2_left#0 + (byte) 8 + [151] (byte*) font_2x2::next_original#1 ← (byte*) font_2x2::next_original#4 + (byte) 8 + [152] (byte) font_2x2::c#1 ← ++ (byte) font_2x2::c#11 + [153] if((byte) font_2x2::c#1!=(byte) $40) goto font_2x2::@1 + to:font_2x2::@return +font_2x2::@return: scope:[font_2x2] from font_2x2::@9 + [154] return + to:@return + +interrupt(KERNEL_MIN)(void()) plex_irq() +plex_irq: scope:[plex_irq] from + asm { sei } + to:plex_irq::@3 +plex_irq::@3: scope:[plex_irq] from plex_irq plex_irq::@7 + [156] phi() + [157] call plexShowSprite + to:plex_irq::plexFreeNextYpos1 +plex_irq::plexFreeNextYpos1: scope:[plex_irq] from plex_irq::@3 + [158] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) + to:plex_irq::@6 +plex_irq::@6: scope:[plex_irq] from plex_irq::plexFreeNextYpos1 + [159] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 3 + [160] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 + to:plex_irq::@7 +plex_irq::@7: scope:[plex_irq] from plex_irq::@6 + [161] 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 + [162] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 + to:plex_irq::@5 +plex_irq::@5: scope:[plex_irq] from plex_irq::@4 + [163] *((const nomodify byte*) RASTER) ← (byte) $28 + [164] (volatile bool) framedone ← true + to:plex_irq::@2 +plex_irq::@2: scope:[plex_irq] from plex_irq::@1 plex_irq::@5 + [165] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER + asm { cli } + to:plex_irq::@return +plex_irq::@return: scope:[plex_irq] from plex_irq::@2 + [167] return + to:@return +plex_irq::@1: scope:[plex_irq] from plex_irq::@4 + [168] *((const nomodify byte*) RASTER) ← (byte) plex_irq::plexFreeNextYpos1_return#0 + to:plex_irq::@2 + +(void()) plexShowSprite() +plexShowSprite: scope:[plexShowSprite] from plex_irq::@3 + [169] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 + [170] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) + [171] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + to:plexShowSprite::plexFreeAdd1 +plexShowSprite::plexFreeAdd1: scope:[plexShowSprite] from plexShowSprite + [172] (byte~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte) $15 + [173] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 + [174] (byte~) plexShowSprite::plexFreeAdd1_$1 ← (volatile byte) plex_free_next + (byte) 1 + [175] (byte~) plexShowSprite::plexFreeAdd1_$2 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7 + [176] (volatile byte) plex_free_next ← (byte~) plexShowSprite::plexFreeAdd1_$2 + to:plexShowSprite::@5 +plexShowSprite::@5: scope:[plexShowSprite] from plexShowSprite::plexFreeAdd1 + [177] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) + [178] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) + [179] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 + [180] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) + [181] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 + [182] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) + [183] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1 + to:plexShowSprite::@3 +plexShowSprite::@3: scope:[plexShowSprite] from plexShowSprite::@5 + [184] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb + [185] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 + to:plexShowSprite::@2 +plexShowSprite::@2: scope:[plexShowSprite] from plexShowSprite::@1 plexShowSprite::@3 + [186] (byte~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (byte) 1 + [187] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7 + [188] (volatile byte) plex_sprite_idx ← (byte~) plexShowSprite::$6 + [189] (volatile byte) plex_show_idx ← ++ (volatile byte) plex_show_idx + [190] (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (byte) 1 + [191] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return + to:plexShowSprite::@4 +plexShowSprite::@4: scope:[plexShowSprite] from plexShowSprite::@2 + [192] (volatile byte) plex_sprite_msb ← (byte) 1 + to:plexShowSprite::@return +plexShowSprite::@return: scope:[plexShowSprite] from plexShowSprite::@2 plexShowSprite::@4 + [193] return + to:@return +plexShowSprite::@1: scope:[plexShowSprite] from plexShowSprite::@5 + [194] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb + to:plexShowSprite::@2 + + +VARIABLE REGISTER WEIGHTS +(byte*) PLEX_SCREEN_PTR +(void()) font_2x2((byte*) font_2x2::font_original , (byte*) font_2x2::font_2x2) +(byte~) font_2x2::$1 200002.0 +(byte~) font_2x2::$11 20002.0 +(byte~) font_2x2::$12 10001.0 +(byte~) font_2x2::$14 20002.0 +(byte~) font_2x2::$15 10001.0 +(word~) font_2x2::$5 200002.0 +(word~) font_2x2::$7 200002.0 +(byte) font_2x2::b +(byte) font_2x2::b#1 150001.5 +(byte) font_2x2::b#2 20000.2 +(byte) font_2x2::c +(byte) font_2x2::c#1 1501.5 +(byte) font_2x2::c#11 58.88235294117647 +(byte*) font_2x2::font_2x2 +(byte*) font_2x2::font_original +(byte) font_2x2::glyph_bit +(byte) font_2x2::glyph_bit#0 50000.5 +(byte) font_2x2::glyph_bits +(byte) font_2x2::glyph_bits#0 20002.0 +(byte) font_2x2::glyph_bits#1 66667.33333333333 +(byte) font_2x2::glyph_bits#2 34444.88888888889 +(word) font_2x2::glyph_bits_2x2 +(word) font_2x2::glyph_bits_2x2#1 200002.0 +(word) font_2x2::glyph_bits_2x2#2 27500.5 +(word) font_2x2::glyph_bits_2x2#3 40000.4 +(byte) font_2x2::l +(byte) font_2x2::l#1 15001.5 +(byte) font_2x2::l#2 1111.2222222222222 +(byte) font_2x2::l2 +(byte) font_2x2::l2#1 15001.5 +(byte) font_2x2::l2#8 2727.5454545454545 +(byte) font_2x2::l2#9 6667.333333333333 +(byte*) font_2x2::next_2x2 +(byte*) font_2x2::next_2x2#1 500.5 +(byte*) font_2x2::next_2x2_left +(byte*) font_2x2::next_2x2_left#0 750.1875 +(byte*) font_2x2::next_2x2_left#1 10001.0 +(byte*) font_2x2::next_2x2_left#10 2002.0 +(byte*) font_2x2::next_2x2_left#7 1708.5416666666665 +(byte*) font_2x2::next_2x2_left#8 10001.0 +(byte*) font_2x2::next_2x2_right +(byte*) font_2x2::next_2x2_right#0 1001.0 +(byte*) font_2x2::next_2x2_right#1 20002.0 +(byte*) font_2x2::next_2x2_right#7 1708.5416666666665 +(byte*) font_2x2::next_2x2_right#8 10001.0 +(byte*) font_2x2::next_original +(byte*) font_2x2::next_original#1 667.3333333333334 +(byte*) font_2x2::next_original#4 363.7272727272727 +(void()) font_2x2_to_sprites((byte*) font_2x2_to_sprites::font_2x2 , (byte*) font_2x2_to_sprites::sprites , (byte) font_2x2_to_sprites::num_chars) +(byte~) font_2x2_to_sprites::$3 10001.0 +(byte) font_2x2_to_sprites::c +(byte) font_2x2_to_sprites::c#1 2002.0 +(byte) font_2x2_to_sprites::c#2 136.5 +(byte*) font_2x2_to_sprites::char_current +(byte*) font_2x2_to_sprites::char_current#1 667.3333333333334 +(byte*) font_2x2_to_sprites::char_current#2 1200.3 +(byte*) font_2x2_to_sprites::char_left +(byte*) font_2x2_to_sprites::char_left#1 10001.0 +(byte*) font_2x2_to_sprites::char_left#3 2818.5454545454545 +(byte*) font_2x2_to_sprites::char_left#4 10001.0 +(byte*) font_2x2_to_sprites::char_left#6 2002.0 +(byte*) font_2x2_to_sprites::char_right +(byte*) font_2x2_to_sprites::char_right#0 1001.0 +(byte*) font_2x2_to_sprites::char_right#1 20002.0 +(byte*) font_2x2_to_sprites::char_right#3 2818.5454545454545 +(byte*) font_2x2_to_sprites::char_right#4 10001.0 +(byte*) font_2x2_to_sprites::font_2x2 +(byte) font_2x2_to_sprites::i +(byte) font_2x2_to_sprites::i#1 15001.5 +(byte) font_2x2_to_sprites::i#2 3571.7857142857147 +(byte) font_2x2_to_sprites::num_chars +(byte*) font_2x2_to_sprites::sprite +(byte*) font_2x2_to_sprites::sprite#1 1001.0 +(byte*) font_2x2_to_sprites::sprite#4 1524.047619047619 +(byte) font_2x2_to_sprites::sprite_idx +(byte) font_2x2_to_sprites::sprite_idx#1 15001.5 +(byte) font_2x2_to_sprites::sprite_idx#2 15001.5 +(byte) font_2x2_to_sprites::sprite_idx#3 2222.4444444444443 +(byte) font_2x2_to_sprites::sprite_idx#4 10001.0 +(byte*) font_2x2_to_sprites::sprites +(volatile bool) framedone loadstore 27.65 +(void()) main() +(byte~) main::$12 202.0 +(byte) main::s +(byte) main::s#1 151.5 +(byte) main::s#2 67.33333333333333 +(byte) main::s1 +(byte) main::s1#1 151.5 +(byte) main::s1#2 151.5 +(byte) main::sprite +(byte) main::sprite#1 33.666666666666664 +(byte) main::sprite#2 151.5 +(byte*) main::toD0181_gfx +(byte) main::toD0181_return +(byte*) main::toD0181_screen +(byte) main::toSpritePtr1_return +(byte*) main::toSpritePtr1_sprite +(word) main::xp +(word) main::xp#1 67.33333333333333 +(word) main::xp#2 60.599999999999994 +(void()) plexInit((byte*) plexInit::screen) +(byte) plexInit::i +(byte) plexInit::i#1 1501.5 +(byte) plexInit::i#2 2002.0 +(byte*) plexInit::plexSetScreen1_screen +(byte*) plexInit::screen +(void()) plexShowSprite() +(byte~) plexShowSprite::$11 101.0 +(byte~) plexShowSprite::$2 202.0 +(byte~) plexShowSprite::$3 202.0 +(byte~) plexShowSprite::$5 202.0 +(byte~) plexShowSprite::$6 202.0 +(byte~) plexShowSprite::$9 202.0 +(byte~) plexShowSprite::plexFreeAdd1_$0 202.0 +(byte~) plexShowSprite::plexFreeAdd1_$1 202.0 +(byte~) plexShowSprite::plexFreeAdd1_$2 202.0 +(byte) plexShowSprite::plexFreeAdd1_ypos +(byte) plexShowSprite::plexFreeAdd1_ypos#0 151.5 +(byte) plexShowSprite::plex_sprite_idx2 +(byte) plexShowSprite::plex_sprite_idx2#0 25.25 +(byte) plexShowSprite::xpos_idx +(byte) plexShowSprite::xpos_idx#0 202.0 +(byte) plexShowSprite::ypos +(void()) plexSine() +(byte) plexSine::sy +(byte) plexSine::sy#1 150001.5 +(byte) plexSine::sy#2 100001.0 +(byte) plexSine::y_idx +(byte) plexSine::y_idx#0 2002.0 +(byte) plexSine::y_idx#1 66667.33333333333 +(byte) plexSine::y_idx#2 150502.0 +(void()) plexSort() +(byte) plexSort::m +(byte) plexSort::m#1 150001.5 +(byte) plexSort::m#2 41667.08333333333 +(byte) plexSort::nxt_idx +(byte) plexSort::nxt_idx#0 30000.300000000003 +(byte) plexSort::nxt_y +(byte) plexSort::nxt_y#0 150000.375 +(byte) plexSort::plexFreePrepare1_s +(byte) plexSort::plexFreePrepare1_s#1 150001.5 +(byte) plexSort::plexFreePrepare1_s#2 150001.5 +(byte) plexSort::s +(byte) plexSort::s#1 1366668.3333333335 +(byte) plexSort::s#2 200002.0 +(byte) plexSort::s#3 2050002.5 +(byte) plexSort::s#6 200002.0 +(volatile byte) plex_free_next loadstore 42.48387096774193 +interrupt(KERNEL_MIN)(void()) plex_irq() +(byte~) plex_irq::$4 11.0 +(byte) plex_irq::plexFreeNextYpos1_return +(byte) plex_irq::plexFreeNextYpos1_return#0 4.800000000000001 +(byte) plex_irq::rasterY +(volatile byte) plex_show_idx loadstore 46.0909090909091 +(volatile byte) plex_sprite_idx loadstore 45.387096774193544 +(volatile byte) plex_sprite_msb loadstore 48.757575757575765 +(byte) sin_idx +(byte) sin_idx#10 300.42857142857144 +(byte) sin_idx#12 58.0 + +Initial phi equivalence classes +[ main::sprite#2 main::sprite#1 ] +[ main::s#2 main::s#1 ] +[ main::xp#2 main::xp#1 ] +[ main::s1#2 main::s1#1 ] +[ plexSort::m#2 plexSort::m#1 ] +[ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] +[ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] +[ sin_idx#10 sin_idx#12 ] +[ plexSine::y_idx#2 plexSine::y_idx#0 plexSine::y_idx#1 ] +[ plexSine::sy#2 plexSine::sy#1 ] +[ plexInit::i#2 plexInit::i#1 ] +[ font_2x2_to_sprites::c#2 font_2x2_to_sprites::c#1 ] +[ font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::char_current#1 ] +[ font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::sprite#1 ] +[ font_2x2_to_sprites::i#2 font_2x2_to_sprites::i#1 ] +[ font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_left#6 font_2x2_to_sprites::char_left#4 font_2x2_to_sprites::char_left#1 ] +[ font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::sprite_idx#3 ] +[ font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_right#4 font_2x2_to_sprites::char_right#1 ] +[ font_2x2::next_2x2_left#0 font_2x2::next_2x2#1 ] +[ font_2x2::next_original#4 font_2x2::next_original#1 ] +[ font_2x2::c#11 font_2x2::c#1 ] +[ font_2x2::l#2 font_2x2::l#1 ] +[ font_2x2::next_2x2_left#7 font_2x2::next_2x2_left#10 font_2x2::next_2x2_left#8 font_2x2::next_2x2_left#1 ] +[ font_2x2::l2#8 font_2x2::l2#9 font_2x2::l2#1 ] +[ font_2x2::next_2x2_right#7 font_2x2::next_2x2_right#0 font_2x2::next_2x2_right#8 font_2x2::next_2x2_right#1 ] +[ font_2x2::glyph_bits#2 font_2x2::glyph_bits#0 font_2x2::glyph_bits#1 ] +[ font_2x2::glyph_bits_2x2#3 font_2x2::glyph_bits_2x2#2 ] +[ font_2x2::b#2 font_2x2::b#1 ] +[ font_2x2::glyph_bit#0 ] +Added variable plex_show_idx to live range equivalence class [ plex_show_idx ] +Added variable plex_sprite_idx to live range equivalence class [ plex_sprite_idx ] +Added variable plex_sprite_msb to live range equivalence class [ plex_sprite_msb ] +Added variable plex_free_next to live range equivalence class [ plex_free_next ] +Added variable framedone to live range equivalence class [ framedone ] +Added variable main::$12 to live range equivalence class [ main::$12 ] +Added variable plexSort::nxt_idx#0 to live range equivalence class [ plexSort::nxt_idx#0 ] +Added variable plexSort::nxt_y#0 to live range equivalence class [ plexSort::nxt_y#0 ] +Added variable plexSort::s#2 to live range equivalence class [ plexSort::s#2 ] +Added variable font_2x2_to_sprites::$3 to live range equivalence class [ font_2x2_to_sprites::$3 ] +Added variable font_2x2_to_sprites::sprite_idx#1 to live range equivalence class [ font_2x2_to_sprites::sprite_idx#1 ] +Added variable font_2x2_to_sprites::sprite_idx#2 to live range equivalence class [ font_2x2_to_sprites::sprite_idx#2 ] +Added variable font_2x2::$1 to live range equivalence class [ font_2x2::$1 ] +Added variable font_2x2::$5 to live range equivalence class [ font_2x2::$5 ] +Added variable font_2x2::glyph_bits_2x2#1 to live range equivalence class [ font_2x2::glyph_bits_2x2#1 ] +Added variable font_2x2::$7 to live range equivalence class [ font_2x2::$7 ] +Added variable font_2x2::$12 to live range equivalence class [ font_2x2::$12 ] +Added variable font_2x2::$11 to live range equivalence class [ font_2x2::$11 ] +Added variable font_2x2::$15 to live range equivalence class [ font_2x2::$15 ] +Added variable font_2x2::$14 to live range equivalence class [ font_2x2::$14 ] +Added variable plex_irq::plexFreeNextYpos1_return#0 to live range equivalence class [ plex_irq::plexFreeNextYpos1_return#0 ] +Added variable plex_irq::$4 to live range equivalence class [ plex_irq::$4 ] +Added variable plexShowSprite::plex_sprite_idx2#0 to live range equivalence class [ plexShowSprite::plex_sprite_idx2#0 ] +Added variable plexShowSprite::plexFreeAdd1_ypos#0 to live range equivalence class [ plexShowSprite::plexFreeAdd1_ypos#0 ] +Added variable plexShowSprite::plexFreeAdd1_$0 to live range equivalence class [ plexShowSprite::plexFreeAdd1_$0 ] +Added variable plexShowSprite::plexFreeAdd1_$1 to live range equivalence class [ plexShowSprite::plexFreeAdd1_$1 ] +Added variable plexShowSprite::plexFreeAdd1_$2 to live range equivalence class [ plexShowSprite::plexFreeAdd1_$2 ] +Added variable plexShowSprite::xpos_idx#0 to live range equivalence class [ plexShowSprite::xpos_idx#0 ] +Added variable plexShowSprite::$11 to live range equivalence class [ plexShowSprite::$11 ] +Added variable plexShowSprite::$2 to live range equivalence class [ plexShowSprite::$2 ] +Added variable plexShowSprite::$3 to live range equivalence class [ plexShowSprite::$3 ] +Added variable plexShowSprite::$9 to live range equivalence class [ plexShowSprite::$9 ] +Added variable plexShowSprite::$5 to live range equivalence class [ plexShowSprite::$5 ] +Added variable plexShowSprite::$6 to live range equivalence class [ plexShowSprite::$6 ] +Complete equivalence classes +[ main::sprite#2 main::sprite#1 ] +[ main::s#2 main::s#1 ] +[ main::xp#2 main::xp#1 ] +[ main::s1#2 main::s1#1 ] +[ plexSort::m#2 plexSort::m#1 ] +[ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] +[ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] +[ sin_idx#10 sin_idx#12 ] +[ plexSine::y_idx#2 plexSine::y_idx#0 plexSine::y_idx#1 ] +[ plexSine::sy#2 plexSine::sy#1 ] +[ plexInit::i#2 plexInit::i#1 ] +[ font_2x2_to_sprites::c#2 font_2x2_to_sprites::c#1 ] +[ font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::char_current#1 ] +[ font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::sprite#1 ] +[ font_2x2_to_sprites::i#2 font_2x2_to_sprites::i#1 ] +[ font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_left#6 font_2x2_to_sprites::char_left#4 font_2x2_to_sprites::char_left#1 ] +[ font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::sprite_idx#3 ] +[ font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_right#4 font_2x2_to_sprites::char_right#1 ] +[ font_2x2::next_2x2_left#0 font_2x2::next_2x2#1 ] +[ font_2x2::next_original#4 font_2x2::next_original#1 ] +[ font_2x2::c#11 font_2x2::c#1 ] +[ font_2x2::l#2 font_2x2::l#1 ] +[ font_2x2::next_2x2_left#7 font_2x2::next_2x2_left#10 font_2x2::next_2x2_left#8 font_2x2::next_2x2_left#1 ] +[ font_2x2::l2#8 font_2x2::l2#9 font_2x2::l2#1 ] +[ font_2x2::next_2x2_right#7 font_2x2::next_2x2_right#0 font_2x2::next_2x2_right#8 font_2x2::next_2x2_right#1 ] +[ font_2x2::glyph_bits#2 font_2x2::glyph_bits#0 font_2x2::glyph_bits#1 ] +[ font_2x2::glyph_bits_2x2#3 font_2x2::glyph_bits_2x2#2 ] +[ font_2x2::b#2 font_2x2::b#1 ] +[ font_2x2::glyph_bit#0 ] +[ plex_show_idx ] +[ plex_sprite_idx ] +[ plex_sprite_msb ] +[ plex_free_next ] +[ framedone ] +[ main::$12 ] +[ plexSort::nxt_idx#0 ] +[ plexSort::nxt_y#0 ] +[ plexSort::s#2 ] +[ font_2x2_to_sprites::$3 ] +[ font_2x2_to_sprites::sprite_idx#1 ] +[ font_2x2_to_sprites::sprite_idx#2 ] +[ font_2x2::$1 ] +[ font_2x2::$5 ] +[ font_2x2::glyph_bits_2x2#1 ] +[ font_2x2::$7 ] +[ font_2x2::$12 ] +[ font_2x2::$11 ] +[ font_2x2::$15 ] +[ font_2x2::$14 ] +[ plex_irq::plexFreeNextYpos1_return#0 ] +[ plex_irq::$4 ] +[ plexShowSprite::plex_sprite_idx2#0 ] +[ plexShowSprite::plexFreeAdd1_ypos#0 ] +[ plexShowSprite::plexFreeAdd1_$0 ] +[ plexShowSprite::plexFreeAdd1_$1 ] +[ plexShowSprite::plexFreeAdd1_$2 ] +[ plexShowSprite::xpos_idx#0 ] +[ plexShowSprite::$11 ] +[ plexShowSprite::$2 ] +[ plexShowSprite::$3 ] +[ plexShowSprite::$9 ] +[ plexShowSprite::$5 ] +[ plexShowSprite::$6 ] +Allocated zp[1]:2 [ main::sprite#2 main::sprite#1 ] +Allocated zp[1]:3 [ main::s#2 main::s#1 ] +Allocated zp[2]:4 [ main::xp#2 main::xp#1 ] +Allocated zp[1]:6 [ main::s1#2 main::s1#1 ] +Allocated zp[1]:7 [ plexSort::m#2 plexSort::m#1 ] +Allocated zp[1]:8 [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] +Allocated zp[1]:9 [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] +Allocated zp[1]:10 [ sin_idx#10 sin_idx#12 ] +Allocated zp[1]:11 [ plexSine::y_idx#2 plexSine::y_idx#0 plexSine::y_idx#1 ] +Allocated zp[1]:12 [ plexSine::sy#2 plexSine::sy#1 ] +Allocated zp[1]:13 [ plexInit::i#2 plexInit::i#1 ] +Allocated zp[1]:14 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::c#1 ] +Allocated zp[2]:15 [ font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::char_current#1 ] +Allocated zp[2]:17 [ font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::sprite#1 ] +Allocated zp[1]:19 [ font_2x2_to_sprites::i#2 font_2x2_to_sprites::i#1 ] +Allocated zp[2]:20 [ font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_left#6 font_2x2_to_sprites::char_left#4 font_2x2_to_sprites::char_left#1 ] +Allocated zp[1]:22 [ font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::sprite_idx#3 ] +Allocated zp[2]:23 [ font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_right#4 font_2x2_to_sprites::char_right#1 ] +Allocated zp[2]:25 [ font_2x2::next_2x2_left#0 font_2x2::next_2x2#1 ] +Allocated zp[2]:27 [ font_2x2::next_original#4 font_2x2::next_original#1 ] +Allocated zp[1]:29 [ font_2x2::c#11 font_2x2::c#1 ] +Allocated zp[1]:30 [ font_2x2::l#2 font_2x2::l#1 ] +Allocated zp[2]:31 [ font_2x2::next_2x2_left#7 font_2x2::next_2x2_left#10 font_2x2::next_2x2_left#8 font_2x2::next_2x2_left#1 ] +Allocated zp[1]:33 [ font_2x2::l2#8 font_2x2::l2#9 font_2x2::l2#1 ] +Allocated zp[2]:34 [ font_2x2::next_2x2_right#7 font_2x2::next_2x2_right#0 font_2x2::next_2x2_right#8 font_2x2::next_2x2_right#1 ] +Allocated zp[1]:36 [ font_2x2::glyph_bits#2 font_2x2::glyph_bits#0 font_2x2::glyph_bits#1 ] +Allocated zp[2]:37 [ font_2x2::glyph_bits_2x2#3 font_2x2::glyph_bits_2x2#2 ] +Allocated zp[1]:39 [ font_2x2::b#2 font_2x2::b#1 ] +Allocated zp[1]:40 [ font_2x2::glyph_bit#0 ] +Allocated zp[1]:41 [ plex_show_idx ] +Allocated zp[1]:42 [ plex_sprite_idx ] +Allocated zp[1]:43 [ plex_sprite_msb ] +Allocated zp[1]:44 [ plex_free_next ] +Allocated zp[1]:45 [ framedone ] +Allocated zp[1]:46 [ main::$12 ] +Allocated zp[1]:47 [ plexSort::nxt_idx#0 ] +Allocated zp[1]:48 [ plexSort::nxt_y#0 ] +Allocated zp[1]:49 [ plexSort::s#2 ] +Allocated zp[1]:50 [ font_2x2_to_sprites::$3 ] +Allocated zp[1]:51 [ font_2x2_to_sprites::sprite_idx#1 ] +Allocated zp[1]:52 [ font_2x2_to_sprites::sprite_idx#2 ] +Allocated zp[1]:53 [ font_2x2::$1 ] +Allocated zp[2]:54 [ font_2x2::$5 ] +Allocated zp[2]:56 [ font_2x2::glyph_bits_2x2#1 ] +Allocated zp[2]:58 [ font_2x2::$7 ] +Allocated zp[1]:60 [ font_2x2::$12 ] +Allocated zp[1]:61 [ font_2x2::$11 ] +Allocated zp[1]:62 [ font_2x2::$15 ] +Allocated zp[1]:63 [ font_2x2::$14 ] +Allocated zp[1]:64 [ plex_irq::plexFreeNextYpos1_return#0 ] +Allocated zp[1]:65 [ plex_irq::$4 ] +Allocated zp[1]:66 [ plexShowSprite::plex_sprite_idx2#0 ] +Allocated zp[1]:67 [ plexShowSprite::plexFreeAdd1_ypos#0 ] +Allocated zp[1]:68 [ plexShowSprite::plexFreeAdd1_$0 ] +Allocated zp[1]:69 [ plexShowSprite::plexFreeAdd1_$1 ] +Allocated zp[1]:70 [ plexShowSprite::plexFreeAdd1_$2 ] +Allocated zp[1]:71 [ plexShowSprite::xpos_idx#0 ] +Allocated zp[1]:72 [ plexShowSprite::$11 ] +Allocated zp[1]:73 [ plexShowSprite::$2 ] +Allocated zp[1]:74 [ plexShowSprite::$3 ] +Allocated zp[1]:75 [ plexShowSprite::$9 ] +Allocated zp[1]:76 [ plexShowSprite::$5 ] +Allocated zp[1]:77 [ plexShowSprite::$6 ] + +INITIAL ASM +Target platform is c64basic / MOS6502X + // File Comments +// Put a 2x2 font into sprites and show it on screen + // Upstart +.pc = $801 "Basic" +:BasicUpstart(__bbegin) +.pc = $80d "Program" + // Global Constants & labels + // Processor Port Register controlling RAM/ROM configuration and the datasette + .label PROCPORT = 1 + // RAM in $A000, $E000 CHAR ROM in $D000 + .const PROCPORT_RAM_CHARROM = 1 + // BASIC in $A000, I/O in $D000, KERNEL in $E000 + .const PROCPORT_BASIC_KERNEL_IO = 7 + // The address of the CHARGEN character set + .label CHARGEN = $d000 + .label SPRITES_XPOS = $d000 + .label SPRITES_YPOS = $d001 + .label SPRITES_XMSB = $d010 + .label RASTER = $d012 + .label SPRITES_ENABLE = $d015 + .label SPRITES_COLS = $d027 + .label VIC_CONTROL = $d011 + .label D018 = $d018 + // VIC II IRQ Status Register + .label IRQ_STATUS = $d019 + // VIC II IRQ Enable Register + .label IRQ_ENABLE = $d01a + // Bits for the IRQ Status/Enable Registers + .const IRQ_RASTER = 1 + // CIA#1 Interrupt Status & Control Register + .label CIA1_INTERRUPT = $dc0d + // Value that disables all CIA interrupts when stored to the CIA Interrupt registers + .const CIA_INTERRUPT_CLEAR = $7f + // The vector used when the KERNAL serves IRQ interrupts + .label KERNEL_IRQ = $314 + .const WHITE = 1 + // The number of sprites in the multiplexer + .const PLEX_COUNT = $20 + .label CHARSET_DEFAULT = $1000 + .label FONT = $2000 + .label SPRITES = $3000 + .label SCREEN = $400 + // The address of the sprite pointers on the current screen (screen+0x3f8). + .label PLEX_SCREEN_PTR = $400+$3f8 + .label plex_show_idx = $29 + .label plex_sprite_idx = $2a + .label plex_sprite_msb = $2b + .label plex_free_next = $2c + .label framedone = $2d + // Y-sine index + .label sin_idx = $a + // @begin +__bbegin: + jmp __b1 + // @1 +__b1: + // [1] (volatile byte) plex_show_idx ← (byte) 0 -- vbuz1=vbuc1 + // The index in the PLEX tables of the next sprite to show + lda #0 + sta.z plex_show_idx + // [2] (volatile byte) plex_sprite_idx ← (byte) 0 -- vbuz1=vbuc1 + // The index the next sprite to use for showing (sprites are used round-robin) + lda #0 + sta.z plex_sprite_idx + // [3] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 + // The MSB bit of the next sprite to use for showing + lda #1 + sta.z plex_sprite_msb + jmp __b2 + // @2 +__b2: + // [4] (volatile byte) plex_free_next ← (byte) 0 -- vbuz1=vbuc1 + // The index of the sprite that is free next. Since sprites are used round-robin this moves forward each time a sprite is shown. + lda #0 + sta.z plex_free_next + jmp __b3 + // @3 +__b3: + // [5] (volatile bool) framedone ← false -- vboz1=vboc1 + lda #0 + sta.z framedone + // [6] phi from @3 to @4 [phi:@3->@4] +__b4_from___b3: + jmp __b4 + // @4 +__b4: + // [7] call main + jsr main + // [8] phi from @4 to @end [phi:@4->@end] +__bend_from___b4: + jmp __bend + // @end +__bend: + // main +main: { + .const toSpritePtr1_return = SPRITES/$40 + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET_DEFAULT)/4&$f + .label __12 = $2e + .label sprite = 2 + // Set the x-positions & pointers + .label xp = 4 + .label s = 3 + .label s1 = 6 + // asm { sei } + // Create 2x2 font from CHARGEN + sei + // [10] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_CHARROM -- _deref_pbuc1=vbuc2 + lda #PROCPORT_RAM_CHARROM + sta PROCPORT + // [11] call font_2x2 + // [117] phi from main to font_2x2 [phi:main->font_2x2] + font_2x2_from_main: + jsr font_2x2 + jmp __b8 + // main::@8 + __b8: + // [12] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_BASIC_KERNEL_IO -- _deref_pbuc1=vbuc2 + lda #PROCPORT_BASIC_KERNEL_IO + sta PROCPORT + // asm { cli } + cli + // [14] call font_2x2_to_sprites + // Convert font to sprites + // [92] phi from main::@8 to font_2x2_to_sprites [phi:main::@8->font_2x2_to_sprites] + font_2x2_to_sprites_from___b8: + jsr font_2x2_to_sprites + // [15] phi from main::@8 to main::@9 [phi:main::@8->main::@9] + __b9_from___b8: + jmp __b9 + // main::@9 + __b9: + // [16] call plexInit + // Initialize the multiplexer + // [85] phi from main::@9 to plexInit [phi:main::@9->plexInit] + plexInit_from___b9: + jsr plexInit + // [17] phi from main::@9 to main::toD0181 [phi:main::@9->main::toD0181] + toD0181_from___b9: + jmp toD0181 + // main::toD0181 + toD0181: + jmp __b7 + // main::@7 + __b7: + // [18] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 + // Show screen + lda #toD0181_return + sta D018 + // [19] phi from main::@7 to main::toSpritePtr1 [phi:main::@7->main::toSpritePtr1] + toSpritePtr1_from___b7: + jmp toSpritePtr1 + // main::toSpritePtr1 + toSpritePtr1: + // [20] phi from main::toSpritePtr1 to main::@1 [phi:main::toSpritePtr1->main::@1] + __b1_from_toSpritePtr1: + // [20] phi (word) main::xp#2 = (word) $18 [phi:main::toSpritePtr1->main::@1#0] -- vwuz1=vwuc1 + lda #<$18 + sta.z xp + lda #>$18 + sta.z xp+1 + // [20] phi (byte) main::s#2 = (byte) 0 [phi:main::toSpritePtr1->main::@1#1] -- vbuz1=vbuc1 + lda #0 + sta.z s + // [20] phi (byte) main::sprite#2 = (const byte) main::toSpritePtr1_return#0 [phi:main::toSpritePtr1->main::@1#2] -- vbuz1=vbuc1 + lda #toSpritePtr1_return + sta.z sprite + jmp __b1 + // [20] phi from main::@1 to main::@1 [phi:main::@1->main::@1] + __b1_from___b1: + // [20] phi (word) main::xp#2 = (word) main::xp#1 [phi:main::@1->main::@1#0] -- register_copy + // [20] phi (byte) main::s#2 = (byte) main::s#1 [phi:main::@1->main::@1#1] -- register_copy + // [20] phi (byte) main::sprite#2 = (byte) main::sprite#1 [phi:main::@1->main::@1#2] -- register_copy + jmp __b1 + // main::@1 + __b1: + // [21] *((const byte*) PLEX_PTR + (byte) main::s#2) ← (byte) main::sprite#2 -- pbuc1_derefidx_vbuz1=vbuz2 + lda.z sprite + ldy.z s + sta PLEX_PTR,y + // [22] (byte) main::sprite#1 ← ++ (byte) main::sprite#2 -- vbuz1=_inc_vbuz1 + inc.z sprite + // [23] (byte~) main::$12 ← (byte) main::s#2 << (byte) 1 -- vbuz1=vbuz2_rol_1 + lda.z s + asl + sta.z __12 + // [24] *((const word*) PLEX_XPOS + (byte~) main::$12) ← (word) main::xp#2 -- pwuc1_derefidx_vbuz1=vwuz2 + ldy.z __12 + lda.z xp + sta PLEX_XPOS,y + lda.z xp+1 + sta PLEX_XPOS+1,y + // [25] (word) main::xp#1 ← (word) main::xp#2 + (byte) $a -- vwuz1=vwuz1_plus_vbuc1 + lda #$a + clc + adc.z xp + sta.z xp + bcc !+ + inc.z xp+1 + !: + // [26] (byte) main::s#1 ← ++ (byte) main::s#2 -- vbuz1=_inc_vbuz1 + inc.z s + // [27] if((byte) main::s#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto main::@1 -- vbuz1_neq_vbuc1_then_la1 + lda #PLEX_COUNT-1+1 + cmp.z s + bne __b1_from___b1 + jmp __b2 + // main::@2 + __b2: + // [28] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2 + // Enable & initialize sprites + lda #$ff + sta SPRITES_ENABLE + // [29] phi from main::@2 to main::@3 [phi:main::@2->main::@3] + __b3_from___b2: + // [29] phi (byte) main::s1#2 = (byte) 0 [phi:main::@2->main::@3#0] -- vbuz1=vbuc1 + lda #0 + sta.z s1 + jmp __b3 + // [29] phi from main::@3 to main::@3 [phi:main::@3->main::@3] + __b3_from___b3: + // [29] phi (byte) main::s1#2 = (byte) main::s1#1 [phi:main::@3->main::@3#0] -- register_copy + jmp __b3 + // main::@3 + __b3: + // [30] *((const nomodify byte*) SPRITES_COLS + (byte) main::s1#2) ← (const nomodify byte) WHITE -- pbuc1_derefidx_vbuz1=vbuc2 + lda #WHITE + ldy.z s1 + sta SPRITES_COLS,y + // [31] (byte) main::s1#1 ← ++ (byte) main::s1#2 -- vbuz1=_inc_vbuz1 + inc.z s1 + // [32] if((byte) main::s1#1!=(byte) 8) goto main::@3 -- vbuz1_neq_vbuc1_then_la1 + lda #8 + cmp.z s1 + bne __b3_from___b3 + // [33] phi from main::@3 to main::@4 [phi:main::@3->main::@4] + __b4_from___b3: + jmp __b4 + // main::@4 + __b4: + // [34] call plexSine + // Move the sprites + // [76] phi from main::@4 to plexSine [phi:main::@4->plexSine] + plexSine_from___b4: + // [76] phi (byte) sin_idx#10 = (byte) 0 [phi:main::@4->plexSine#0] -- vbuz1=vbuc1 + lda #0 + sta.z sin_idx + jsr plexSine + // [35] phi from main::@4 to main::@10 [phi:main::@4->main::@10] + __b10_from___b4: + jmp __b10 + // main::@10 + __b10: + // [36] call plexSort + // Sort the sprites by y-position + // [51] phi from main::@10 to plexSort [phi:main::@10->plexSort] + plexSort_from___b10: + jsr plexSort + jmp __b11 + // main::@11 + __b11: + // asm { sei } + // Enable the plex IRQ + sei + // [38] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 + // Disable CIA 1 Timer IRQ + lda #CIA_INTERRUPT_CLEAR + sta CIA1_INTERRUPT + // [39] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // Set raster line to 0x00 + lda #$7f + and VIC_CONTROL + sta VIC_CONTROL + // [40] *((const nomodify byte*) RASTER) ← (byte) $28 -- _deref_pbuc1=vbuc2 + lda #$28 + sta RASTER + // [41] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // Enable Raster Interrupt + lda #IRQ_RASTER + sta IRQ_ENABLE + // [42] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // Acknowledge any IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + // [43] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() -- _deref_pptc1=pprc2 + // Set the IRQ routine + lda #plex_irq + sta KERNEL_IRQ+1 + // asm { cli } + cli + jmp __b5 + // main::@5 + __b5: + // [45] if((volatile bool) framedone) goto main::@6 -- vboz1_then_la1 + lda.z framedone + cmp #0 + bne __b6_from___b5 + jmp __b5 + // [46] phi from main::@5 to main::@6 [phi:main::@5->main::@6] + __b6_from___b5: + jmp __b6 + // main::@6 + __b6: + // [47] call plexSine + //*BORDERCOL = RED; + // Move the sprites + // [76] phi from main::@6 to plexSine [phi:main::@6->plexSine] + plexSine_from___b6: + // [76] phi (byte) sin_idx#10 = (byte) sin_idx#12 [phi:main::@6->plexSine#0] -- register_copy + jsr plexSine + // [48] phi from main::@6 to main::@12 [phi:main::@6->main::@12] + __b12_from___b6: + jmp __b12 + // main::@12 + __b12: + // [49] call plexSort + // Sort the sprites by y-position + // [51] phi from main::@12 to plexSort [phi:main::@12->plexSort] + plexSort_from___b12: + jsr plexSort + jmp __b13 + // main::@13 + __b13: + // [50] (volatile bool) framedone ← false -- vboz1=vboc1 + //*BORDERCOL = GREEN; + lda #0 + sta.z framedone + jmp __b5 +} + // plexSort +// Ensure that the indices in PLEX_SORTED_IDX is sorted based on the y-positions in PLEX_YPOS +// Assumes that the positions are nearly sorted already (as each sprite just moves a bit) +// Uses an insertion sort: +// 1. Moves a marker (m) from the start to end of the array. Every time the marker moves forward all elements before the marker are sorted correctly. +// 2a. If the next element after the marker is larger that the current element +// the marker can be moved forwards (as the sorting is correct). +// 2b. If the next element after the marker is smaller than the current element: +// elements before the marker are shifted right one at a time until encountering one smaller than the current one. +// It is then inserted at the spot. Now the marker can move forward. +plexSort: { + .label nxt_idx = $2f + .label nxt_y = $30 + .label m = 7 + .label s = 8 + .label s_1 = $31 + .label plexFreePrepare1_s = 9 + // [52] phi from plexSort to plexSort::@1 [phi:plexSort->plexSort::@1] + __b1_from_plexSort: + // [52] phi (byte) plexSort::m#2 = (byte) 0 [phi:plexSort->plexSort::@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z m + jmp __b1 + // [52] phi from plexSort::@2 to plexSort::@1 [phi:plexSort::@2->plexSort::@1] + __b1_from___b2: + // [52] phi (byte) plexSort::m#2 = (byte) plexSort::m#1 [phi:plexSort::@2->plexSort::@1#0] -- register_copy + jmp __b1 + // plexSort::@1 + __b1: + // [53] (byte) plexSort::nxt_idx#0 ← *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2) -- vbuz1=pbuc1_derefidx_vbuz2 + ldy.z m + lda PLEX_SORTED_IDX+1,y + sta.z nxt_idx + // [54] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0) -- vbuz1=pbuc1_derefidx_vbuz2 + ldy.z nxt_idx + lda PLEX_YPOS,y + sta.z nxt_y + // [55] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 -- vbuz1_ge_pbuc1_derefidx_(pbuc2_derefidx_vbuz2)_then_la1 + lda.z nxt_y + ldx.z m + ldy PLEX_SORTED_IDX,x + cmp PLEX_YPOS,y + bcs __b2 + jmp __b5 + // plexSort::@5 + __b5: + // [56] (byte) plexSort::s#6 ← (byte) plexSort::m#2 -- vbuz1=vbuz2 + lda.z m + sta.z s + // [57] phi from plexSort::@5 plexSort::@7 to plexSort::@3 [phi:plexSort::@5/plexSort::@7->plexSort::@3] + __b3_from___b5: + __b3_from___b7: + // [57] phi (byte) plexSort::s#3 = (byte) plexSort::s#6 [phi:plexSort::@5/plexSort::@7->plexSort::@3#0] -- register_copy + jmp __b3 + // plexSort::@3 + __b3: + // [58] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + ldy.z s + lda PLEX_SORTED_IDX,y + sta PLEX_SORTED_IDX+1,y + // [59] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 -- vbuz1=_dec_vbuz1 + dec.z s + // [60] if((byte) plexSort::s#1==(byte) $ff) goto plexSort::@4 -- vbuz1_eq_vbuc1_then_la1 + lda #$ff + cmp.z s + beq __b4 + jmp __b7 + // plexSort::@7 + __b7: + // [61] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 -- vbuz1_lt_pbuc1_derefidx_(pbuc2_derefidx_vbuz2)_then_la1 + lda.z nxt_y + ldx.z s + ldy PLEX_SORTED_IDX,x + cmp PLEX_YPOS,y + bcc __b3_from___b7 + jmp __b4 + // plexSort::@4 + __b4: + // [62] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 -- vbuz1=_inc_vbuz2 + ldy.z s + iny + sty.z s_1 + // [63] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 -- pbuc1_derefidx_vbuz1=vbuz2 + lda.z nxt_idx + ldy.z s_1 + sta PLEX_SORTED_IDX,y + jmp __b2 + // plexSort::@2 + __b2: + // [64] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 -- vbuz1=_inc_vbuz1 + inc.z m + // [65] if((byte) plexSort::m#1!=(const nomodify byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1 -- vbuz1_neq_vbuc1_then_la1 + lda #PLEX_COUNT-2+1 + cmp.z m + bne __b1_from___b2 + jmp __b6 + // plexSort::@6 + __b6: + // [66] (volatile byte) plex_show_idx ← (byte) 0 -- vbuz1=vbuc1 + // Prepare for showing the sprites + lda #0 + sta.z plex_show_idx + // [67] (volatile byte) plex_sprite_idx ← (byte) 0 -- vbuz1=vbuc1 + lda #0 + sta.z plex_sprite_idx + // [68] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 + lda #1 + sta.z plex_sprite_msb + // [69] phi from plexSort::@6 to plexSort::plexFreePrepare1 [phi:plexSort::@6->plexSort::plexFreePrepare1] + plexFreePrepare1_from___b6: + jmp plexFreePrepare1 + // plexSort::plexFreePrepare1 + plexFreePrepare1: + // [70] phi from plexSort::plexFreePrepare1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1] + plexFreePrepare1___b1_from_plexFreePrepare1: + // [70] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) 0 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z plexFreePrepare1_s + jmp plexFreePrepare1___b1 + // [70] phi from plexSort::plexFreePrepare1_@1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1] + plexFreePrepare1___b1_from_plexFreePrepare1___b1: + // [70] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) plexSort::plexFreePrepare1_s#1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1#0] -- register_copy + jmp plexFreePrepare1___b1 + // plexSort::plexFreePrepare1_@1 + plexFreePrepare1___b1: + // [71] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 + lda #0 + ldy.z plexFreePrepare1_s + sta PLEX_FREE_YPOS,y + // [72] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 -- vbuz1=_inc_vbuz1 + inc.z plexFreePrepare1_s + // [73] if((byte) plexSort::plexFreePrepare1_s#1!=(byte) 8) goto plexSort::plexFreePrepare1_@1 -- vbuz1_neq_vbuc1_then_la1 + lda #8 + cmp.z plexFreePrepare1_s + bne plexFreePrepare1___b1_from_plexFreePrepare1___b1 + jmp plexFreePrepare1___b2 + // plexSort::plexFreePrepare1_@2 + plexFreePrepare1___b2: + // [74] (volatile byte) plex_free_next ← (byte) 0 -- vbuz1=vbuc1 + lda #0 + sta.z plex_free_next + jmp __breturn + // plexSort::@return + __breturn: + // [75] return + rts +} + // plexSine +// Move the plex sprites in an Y-sine +plexSine: { + .label y_idx = $b + .label sy = $c + // [77] (byte) plexSine::y_idx#0 ← (byte) sin_idx#10 -- vbuz1=vbuz2 + // Assign sinus positions + lda.z sin_idx + sta.z y_idx + // [78] phi from plexSine to plexSine::@1 [phi:plexSine->plexSine::@1] + __b1_from_plexSine: + // [78] phi (byte) plexSine::sy#2 = (byte) 0 [phi:plexSine->plexSine::@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z sy + // [78] phi (byte) plexSine::y_idx#2 = (byte) plexSine::y_idx#0 [phi:plexSine->plexSine::@1#1] -- register_copy + jmp __b1 + // [78] phi from plexSine::@1 to plexSine::@1 [phi:plexSine::@1->plexSine::@1] + __b1_from___b1: + // [78] phi (byte) plexSine::sy#2 = (byte) plexSine::sy#1 [phi:plexSine::@1->plexSine::@1#0] -- register_copy + // [78] phi (byte) plexSine::y_idx#2 = (byte) plexSine::y_idx#1 [phi:plexSine::@1->plexSine::@1#1] -- register_copy + jmp __b1 + // plexSine::@1 + __b1: + // [79] *((const byte*) PLEX_YPOS + (byte) plexSine::sy#2) ← *((const byte*) YSIN + (byte) plexSine::y_idx#2) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz2 + ldy.z y_idx + lda YSIN,y + ldy.z sy + sta PLEX_YPOS,y + // [80] (byte) plexSine::y_idx#1 ← (byte) plexSine::y_idx#2 + (byte) 8 -- vbuz1=vbuz1_plus_vbuc1 + lax.z y_idx + axs #-[8] + stx.z y_idx + // [81] (byte) plexSine::sy#1 ← ++ (byte) plexSine::sy#2 -- vbuz1=_inc_vbuz1 + inc.z sy + // [82] if((byte) plexSine::sy#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto plexSine::@1 -- vbuz1_neq_vbuc1_then_la1 + lda #PLEX_COUNT-1+1 + cmp.z sy + bne __b1_from___b1 + jmp __b2 + // plexSine::@2 + __b2: + // [83] (byte) sin_idx#12 ← (byte) sin_idx#10 + (byte) 1 -- vbuz1=vbuz1_plus_1 + inc.z sin_idx + jmp __breturn + // plexSine::@return + __breturn: + // [84] return + rts +} + // plexInit +// Initialize the multiplexer data structures +plexInit: { + .label i = $d + // [86] phi from plexInit to plexInit::plexSetScreen1 [phi:plexInit->plexInit::plexSetScreen1] + plexSetScreen1_from_plexInit: + jmp plexSetScreen1 + // plexInit::plexSetScreen1 + plexSetScreen1: + // [87] phi from plexInit::plexSetScreen1 to plexInit::@1 [phi:plexInit::plexSetScreen1->plexInit::@1] + __b1_from_plexSetScreen1: + // [87] phi (byte) plexInit::i#2 = (byte) 0 [phi:plexInit::plexSetScreen1->plexInit::@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z i + jmp __b1 + // [87] phi from plexInit::@1 to plexInit::@1 [phi:plexInit::@1->plexInit::@1] + __b1_from___b1: + // [87] phi (byte) plexInit::i#2 = (byte) plexInit::i#1 [phi:plexInit::@1->plexInit::@1#0] -- register_copy + jmp __b1 + // plexInit::@1 + __b1: + // [88] *((const byte*) PLEX_SORTED_IDX + (byte) plexInit::i#2) ← (byte) plexInit::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 + ldy.z i + tya + sta PLEX_SORTED_IDX,y + // [89] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2 -- vbuz1=_inc_vbuz1 + inc.z i + // [90] if((byte) plexInit::i#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto plexInit::@1 -- vbuz1_neq_vbuc1_then_la1 + lda #PLEX_COUNT-1+1 + cmp.z i + bne __b1_from___b1 + jmp __breturn + // plexInit::@return + __breturn: + // [91] return + rts +} + // font_2x2_to_sprites +// Convert a 2x2-font to sprites +// - font_2x2 The source 2x2-font +// - sprites The destination sprites +// - num_chars The number of chars to convert +font_2x2_to_sprites: { + .const num_chars = $40 + .label __3 = $32 + .label char_right = $17 + .label sprite_idx = $33 + .label sprite_idx_1 = $34 + .label sprite_idx_2 = $16 + .label char_left = $14 + .label i = $13 + .label char_current = $f + .label sprite = $11 + .label c = $e + // [93] phi from font_2x2_to_sprites to font_2x2_to_sprites::@1 [phi:font_2x2_to_sprites->font_2x2_to_sprites::@1] + __b1_from_font_2x2_to_sprites: + // [93] phi (byte*) font_2x2_to_sprites::sprite#4 = (const nomodify byte*) SPRITES [phi:font_2x2_to_sprites->font_2x2_to_sprites::@1#0] -- pbuz1=pbuc1 + lda #SPRITES + sta.z sprite+1 + // [93] phi (byte*) font_2x2_to_sprites::char_current#2 = (const nomodify byte*) FONT [phi:font_2x2_to_sprites->font_2x2_to_sprites::@1#1] -- pbuz1=pbuc1 + lda #FONT + sta.z char_current+1 + // [93] phi (byte) font_2x2_to_sprites::c#2 = (byte) 0 [phi:font_2x2_to_sprites->font_2x2_to_sprites::@1#2] -- vbuz1=vbuc1 + lda #0 + sta.z c + jmp __b1 + // font_2x2_to_sprites::@1 + __b1: + // [94] if((byte) font_2x2_to_sprites::c#2<(const byte) font_2x2_to_sprites::num_chars#0) goto font_2x2_to_sprites::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z c + cmp #num_chars + bcc __b2 + jmp __breturn + // font_2x2_to_sprites::@return + __breturn: + // [95] return + rts + // font_2x2_to_sprites::@2 + __b2: + // [96] (byte*) font_2x2_to_sprites::char_right#0 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $40*(number) 8 -- pbuz1=pbuz2_plus_vwuc1 + lda.z char_current + clc + adc #<$40*8 + sta.z char_right + lda.z char_current+1 + adc #>$40*8 + sta.z char_right+1 + // [97] (byte*) font_2x2_to_sprites::char_left#6 ← (byte*) font_2x2_to_sprites::char_current#2 -- pbuz1=pbuz2 + lda.z char_current + sta.z char_left + lda.z char_current+1 + sta.z char_left+1 + // [98] phi from font_2x2_to_sprites::@2 to font_2x2_to_sprites::@3 [phi:font_2x2_to_sprites::@2->font_2x2_to_sprites::@3] + __b3_from___b2: + // [98] phi (byte*) font_2x2_to_sprites::char_right#3 = (byte*) font_2x2_to_sprites::char_right#0 [phi:font_2x2_to_sprites::@2->font_2x2_to_sprites::@3#0] -- register_copy + // [98] phi (byte) font_2x2_to_sprites::sprite_idx#4 = (byte) 0 [phi:font_2x2_to_sprites::@2->font_2x2_to_sprites::@3#1] -- vbuz1=vbuc1 + lda #0 + sta.z sprite_idx_2 + // [98] phi (byte*) font_2x2_to_sprites::char_left#3 = (byte*) font_2x2_to_sprites::char_left#6 [phi:font_2x2_to_sprites::@2->font_2x2_to_sprites::@3#2] -- register_copy + // [98] phi (byte) font_2x2_to_sprites::i#2 = (byte) 0 [phi:font_2x2_to_sprites::@2->font_2x2_to_sprites::@3#3] -- vbuz1=vbuc1 + lda #0 + sta.z i + jmp __b3 + // [98] phi from font_2x2_to_sprites::@5 to font_2x2_to_sprites::@3 [phi:font_2x2_to_sprites::@5->font_2x2_to_sprites::@3] + __b3_from___b5: + // [98] phi (byte*) font_2x2_to_sprites::char_right#3 = (byte*) font_2x2_to_sprites::char_right#4 [phi:font_2x2_to_sprites::@5->font_2x2_to_sprites::@3#0] -- register_copy + // [98] phi (byte) font_2x2_to_sprites::sprite_idx#4 = (byte) font_2x2_to_sprites::sprite_idx#3 [phi:font_2x2_to_sprites::@5->font_2x2_to_sprites::@3#1] -- register_copy + // [98] phi (byte*) font_2x2_to_sprites::char_left#3 = (byte*) font_2x2_to_sprites::char_left#4 [phi:font_2x2_to_sprites::@5->font_2x2_to_sprites::@3#2] -- register_copy + // [98] phi (byte) font_2x2_to_sprites::i#2 = (byte) font_2x2_to_sprites::i#1 [phi:font_2x2_to_sprites::@5->font_2x2_to_sprites::@3#3] -- register_copy + jmp __b3 + // font_2x2_to_sprites::@3 + __b3: + // [99] (byte~) font_2x2_to_sprites::$3 ← (byte) font_2x2_to_sprites::i#2 & (byte) 7 -- vbuz1=vbuz2_band_vbuc1 + lda #7 + and.z i + sta.z __3 + // [100] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#4) ← *((byte*) font_2x2_to_sprites::char_left#3 + (byte~) font_2x2_to_sprites::$3) -- pbuz1_derefidx_vbuz2=pbuz3_derefidx_vbuz4 + ldy.z __3 + lda (char_left),y + ldy.z sprite_idx_2 + sta (sprite),y + // [101] (byte) font_2x2_to_sprites::sprite_idx#1 ← ++ (byte) font_2x2_to_sprites::sprite_idx#4 -- vbuz1=_inc_vbuz2 + ldy.z sprite_idx_2 + iny + sty.z sprite_idx + // [102] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#1) ← *((byte*) font_2x2_to_sprites::char_right#3 + (byte~) font_2x2_to_sprites::$3) -- pbuz1_derefidx_vbuz2=pbuz3_derefidx_vbuz4 + ldy.z __3 + lda (char_right),y + ldy.z sprite_idx + sta (sprite),y + // [103] (byte) font_2x2_to_sprites::sprite_idx#2 ← ++ (byte) font_2x2_to_sprites::sprite_idx#1 -- vbuz1=_inc_vbuz2 + ldy.z sprite_idx + iny + sty.z sprite_idx_1 + // [104] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#2) ← (byte) 0 -- pbuz1_derefidx_vbuz2=vbuc1 + lda #0 + ldy.z sprite_idx_1 + sta (sprite),y + // [105] (byte) font_2x2_to_sprites::sprite_idx#3 ← ++ (byte) font_2x2_to_sprites::sprite_idx#2 -- vbuz1=_inc_vbuz2 + ldy.z sprite_idx_1 + iny + sty.z sprite_idx_2 + // [106] if((byte) font_2x2_to_sprites::i#2==(byte) 7) goto font_2x2_to_sprites::@4 -- vbuz1_eq_vbuc1_then_la1 + lda #7 + cmp.z i + beq __b4 + jmp __b6 + // font_2x2_to_sprites::@6 + __b6: + // [107] if((byte) font_2x2_to_sprites::i#2!=(byte) $f) goto font_2x2_to_sprites::@8 -- vbuz1_neq_vbuc1_then_la1 + lda #$f + cmp.z i + bne __b8_from___b6 + // [109] phi from font_2x2_to_sprites::@6 to font_2x2_to_sprites::@5 [phi:font_2x2_to_sprites::@6->font_2x2_to_sprites::@5] + __b5_from___b6: + // [109] phi (byte*) font_2x2_to_sprites::char_right#4 = (const nomodify byte*) FONT+(byte) ' '*(byte) 8 [phi:font_2x2_to_sprites::@6->font_2x2_to_sprites::@5#0] -- pbuz1=pbuc1 + lda #FONT+' '*8 + sta.z char_right+1 + // [109] phi (byte*) font_2x2_to_sprites::char_left#4 = (const nomodify byte*) FONT+(byte) ' '*(byte) 8 [phi:font_2x2_to_sprites::@6->font_2x2_to_sprites::@5#1] -- pbuz1=pbuc1 + lda #FONT+' '*8 + sta.z char_left+1 + jmp __b5 + // [108] phi from font_2x2_to_sprites::@6 to font_2x2_to_sprites::@8 [phi:font_2x2_to_sprites::@6->font_2x2_to_sprites::@8] + __b8_from___b6: + jmp __b8 + // font_2x2_to_sprites::@8 + __b8: + // [109] phi from font_2x2_to_sprites::@4 font_2x2_to_sprites::@8 to font_2x2_to_sprites::@5 [phi:font_2x2_to_sprites::@4/font_2x2_to_sprites::@8->font_2x2_to_sprites::@5] + __b5_from___b4: + __b5_from___b8: + // [109] phi (byte*) font_2x2_to_sprites::char_right#4 = (byte*) font_2x2_to_sprites::char_right#1 [phi:font_2x2_to_sprites::@4/font_2x2_to_sprites::@8->font_2x2_to_sprites::@5#0] -- register_copy + // [109] phi (byte*) font_2x2_to_sprites::char_left#4 = (byte*) font_2x2_to_sprites::char_left#1 [phi:font_2x2_to_sprites::@4/font_2x2_to_sprites::@8->font_2x2_to_sprites::@5#1] -- register_copy + jmp __b5 + // font_2x2_to_sprites::@5 + __b5: + // [110] (byte) font_2x2_to_sprites::i#1 ← ++ (byte) font_2x2_to_sprites::i#2 -- vbuz1=_inc_vbuz1 + inc.z i + // [111] if((byte) font_2x2_to_sprites::i#1!=(byte) $15) goto font_2x2_to_sprites::@3 -- vbuz1_neq_vbuc1_then_la1 + lda #$15 + cmp.z i + bne __b3_from___b5 + jmp __b7 + // font_2x2_to_sprites::@7 + __b7: + // [112] (byte*) font_2x2_to_sprites::char_current#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (byte) 8 -- pbuz1=pbuz1_plus_vbuc1 + lda #8 + clc + adc.z char_current + sta.z char_current + bcc !+ + inc.z char_current+1 + !: + // [113] (byte*) font_2x2_to_sprites::sprite#1 ← (byte*) font_2x2_to_sprites::sprite#4 + (byte) $40 -- pbuz1=pbuz1_plus_vbuc1 + lda #$40 + clc + adc.z sprite + sta.z sprite + bcc !+ + inc.z sprite+1 + !: + // [114] (byte) font_2x2_to_sprites::c#1 ← ++ (byte) font_2x2_to_sprites::c#2 -- vbuz1=_inc_vbuz1 + inc.z c + // [93] phi from font_2x2_to_sprites::@7 to font_2x2_to_sprites::@1 [phi:font_2x2_to_sprites::@7->font_2x2_to_sprites::@1] + __b1_from___b7: + // [93] phi (byte*) font_2x2_to_sprites::sprite#4 = (byte*) font_2x2_to_sprites::sprite#1 [phi:font_2x2_to_sprites::@7->font_2x2_to_sprites::@1#0] -- register_copy + // [93] phi (byte*) font_2x2_to_sprites::char_current#2 = (byte*) font_2x2_to_sprites::char_current#1 [phi:font_2x2_to_sprites::@7->font_2x2_to_sprites::@1#1] -- register_copy + // [93] phi (byte) font_2x2_to_sprites::c#2 = (byte) font_2x2_to_sprites::c#1 [phi:font_2x2_to_sprites::@7->font_2x2_to_sprites::@1#2] -- register_copy + jmp __b1 + // font_2x2_to_sprites::@4 + __b4: + // [115] (byte*) font_2x2_to_sprites::char_left#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $80*(number) 8 -- pbuz1=pbuz2_plus_vwuc1 + lda.z char_current + clc + adc #<$80*8 + sta.z char_left + lda.z char_current+1 + adc #>$80*8 + sta.z char_left+1 + // [116] (byte*) font_2x2_to_sprites::char_right#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $c0*(number) 8 -- pbuz1=pbuz2_plus_vwuc1 + lda.z char_current + clc + adc #<$c0*8 + sta.z char_right + lda.z char_current+1 + adc #>$c0*8 + sta.z char_right+1 + jmp __b5_from___b4 +} + // font_2x2 +// Create a 2x2-font by doubling all pixels of the 64 first chars +// The font layout is: +// - 0x00 - 0x3f Upper left glyphs +// - 0x40 - 0x7f Upper right glyphs +// - 0x80 - 0xbf Lower left glyphs +// - 0xc0 - 0xff Lower right glyphs +font_2x2: { + .label __1 = $35 + .label __5 = $36 + .label __7 = $3a + .label __11 = $3d + .label __12 = $3c + .label __14 = $3f + .label __15 = $3e + .label next_2x2_left = $19 + .label next_2x2_right = $22 + .label glyph_bits = $24 + .label glyph_bit = $28 + .label glyph_bits_2x2 = $38 + .label glyph_bits_2x2_1 = $25 + .label b = $27 + .label l2 = $21 + .label l = $1e + .label next_2x2_left_1 = $1f + .label next_2x2 = $19 + .label next_original = $1b + .label c = $1d + // [118] phi from font_2x2 to font_2x2::@1 [phi:font_2x2->font_2x2::@1] + __b1_from_font_2x2: + // [118] phi (byte) font_2x2::c#11 = (byte) 0 [phi:font_2x2->font_2x2::@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z c + // [118] phi (byte*) font_2x2::next_original#4 = (const nomodify byte*) CHARGEN [phi:font_2x2->font_2x2::@1#1] -- pbuz1=pbuc1 + lda #CHARGEN + sta.z next_original+1 + // [118] phi (byte*) font_2x2::next_2x2_left#0 = (const nomodify byte*) FONT [phi:font_2x2->font_2x2::@1#2] -- pbuz1=pbuc1 + lda #FONT + sta.z next_2x2_left+1 + jmp __b1 + // [118] phi from font_2x2::@9 to font_2x2::@1 [phi:font_2x2::@9->font_2x2::@1] + __b1_from___b9: + // [118] phi (byte) font_2x2::c#11 = (byte) font_2x2::c#1 [phi:font_2x2::@9->font_2x2::@1#0] -- register_copy + // [118] phi (byte*) font_2x2::next_original#4 = (byte*) font_2x2::next_original#1 [phi:font_2x2::@9->font_2x2::@1#1] -- register_copy + // [118] phi (byte*) font_2x2::next_2x2_left#0 = (byte*) font_2x2::next_2x2#1 [phi:font_2x2::@9->font_2x2::@1#2] -- register_copy + jmp __b1 + // font_2x2::@1 + __b1: + // [119] (byte*) font_2x2::next_2x2_right#0 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $40*(number) 8 -- pbuz1=pbuz2_plus_vwuc1 + lda.z next_2x2_left + clc + adc #<$40*8 + sta.z next_2x2_right + lda.z next_2x2_left+1 + adc #>$40*8 + sta.z next_2x2_right+1 + // [120] (byte*) font_2x2::next_2x2_left#10 ← (byte*) font_2x2::next_2x2_left#0 -- pbuz1=pbuz2 + lda.z next_2x2_left + sta.z next_2x2_left_1 + lda.z next_2x2_left+1 + sta.z next_2x2_left_1+1 + // [121] phi from font_2x2::@1 to font_2x2::@2 [phi:font_2x2::@1->font_2x2::@2] + __b2_from___b1: + // [121] phi (byte*) font_2x2::next_2x2_right#7 = (byte*) font_2x2::next_2x2_right#0 [phi:font_2x2::@1->font_2x2::@2#0] -- register_copy + // [121] phi (byte) font_2x2::l2#8 = (byte) 0 [phi:font_2x2::@1->font_2x2::@2#1] -- vbuz1=vbuc1 + lda #0 + sta.z l2 + // [121] phi (byte*) font_2x2::next_2x2_left#7 = (byte*) font_2x2::next_2x2_left#10 [phi:font_2x2::@1->font_2x2::@2#2] -- register_copy + // [121] phi (byte) font_2x2::l#2 = (byte) 0 [phi:font_2x2::@1->font_2x2::@2#3] -- vbuz1=vbuc1 + lda #0 + sta.z l + jmp __b2 + // [121] phi from font_2x2::@8 to font_2x2::@2 [phi:font_2x2::@8->font_2x2::@2] + __b2_from___b8: + // [121] phi (byte*) font_2x2::next_2x2_right#7 = (byte*) font_2x2::next_2x2_right#8 [phi:font_2x2::@8->font_2x2::@2#0] -- register_copy + // [121] phi (byte) font_2x2::l2#8 = (byte) font_2x2::l2#9 [phi:font_2x2::@8->font_2x2::@2#1] -- register_copy + // [121] phi (byte*) font_2x2::next_2x2_left#7 = (byte*) font_2x2::next_2x2_left#8 [phi:font_2x2::@8->font_2x2::@2#2] -- register_copy + // [121] phi (byte) font_2x2::l#2 = (byte) font_2x2::l#1 [phi:font_2x2::@8->font_2x2::@2#3] -- register_copy + jmp __b2 + // font_2x2::@2 + __b2: + // [122] (byte) font_2x2::glyph_bits#0 ← *((byte*) font_2x2::next_original#4 + (byte) font_2x2::l#2) -- vbuz1=pbuz2_derefidx_vbuz3 + ldy.z l + lda (next_original),y + sta.z glyph_bits + // [123] phi from font_2x2::@2 to font_2x2::@3 [phi:font_2x2::@2->font_2x2::@3] + __b3_from___b2: + // [123] phi (byte) font_2x2::b#2 = (byte) 0 [phi:font_2x2::@2->font_2x2::@3#0] -- vbuz1=vbuc1 + lda #0 + sta.z b + // [123] phi (word) font_2x2::glyph_bits_2x2#3 = (word) 0 [phi:font_2x2::@2->font_2x2::@3#1] -- vwuz1=vwuc1 + lda #<0 + sta.z glyph_bits_2x2_1 + lda #>0 + sta.z glyph_bits_2x2_1+1 + // [123] phi (byte) font_2x2::glyph_bits#2 = (byte) font_2x2::glyph_bits#0 [phi:font_2x2::@2->font_2x2::@3#2] -- register_copy + jmp __b3 + // [123] phi from font_2x2::@5 to font_2x2::@3 [phi:font_2x2::@5->font_2x2::@3] + __b3_from___b5: + // [123] phi (byte) font_2x2::b#2 = (byte) font_2x2::b#1 [phi:font_2x2::@5->font_2x2::@3#0] -- register_copy + // [123] phi (word) font_2x2::glyph_bits_2x2#3 = (word) font_2x2::glyph_bits_2x2#2 [phi:font_2x2::@5->font_2x2::@3#1] -- register_copy + // [123] phi (byte) font_2x2::glyph_bits#2 = (byte) font_2x2::glyph_bits#1 [phi:font_2x2::@5->font_2x2::@3#2] -- register_copy + jmp __b3 + // font_2x2::@3 + __b3: + // [124] (byte~) font_2x2::$1 ← (byte) font_2x2::glyph_bits#2 & (byte) $80 -- vbuz1=vbuz2_band_vbuc1 + lda #$80 + and.z glyph_bits + sta.z __1 + // [125] if((byte) 0!=(byte~) font_2x2::$1) goto font_2x2::@4 -- vbuc1_neq_vbuz1_then_la1 + lda #0 + cmp.z __1 + bne __b4_from___b3 + // [127] phi from font_2x2::@3 to font_2x2::@5 [phi:font_2x2::@3->font_2x2::@5] + __b5_from___b3: + // [127] phi (byte) font_2x2::glyph_bit#0 = (byte) 0 [phi:font_2x2::@3->font_2x2::@5#0] -- vbuz1=vbuc1 + lda #0 + sta.z glyph_bit + jmp __b5 + // [126] phi from font_2x2::@3 to font_2x2::@4 [phi:font_2x2::@3->font_2x2::@4] + __b4_from___b3: + jmp __b4 + // font_2x2::@4 + __b4: + // [127] phi from font_2x2::@4 to font_2x2::@5 [phi:font_2x2::@4->font_2x2::@5] + __b5_from___b4: + // [127] phi (byte) font_2x2::glyph_bit#0 = (byte) 1 [phi:font_2x2::@4->font_2x2::@5#0] -- vbuz1=vbuc1 + lda #1 + sta.z glyph_bit + jmp __b5 + // font_2x2::@5 + __b5: + // [128] (word~) font_2x2::$5 ← (word) font_2x2::glyph_bits_2x2#3 << (byte) 1 -- vwuz1=vwuz2_rol_1 + lda.z glyph_bits_2x2_1 + asl + sta.z __5 + lda.z glyph_bits_2x2_1+1 + rol + sta.z __5+1 + // [129] (word) font_2x2::glyph_bits_2x2#1 ← (word~) font_2x2::$5 | (byte) font_2x2::glyph_bit#0 -- vwuz1=vwuz2_bor_vbuz3 + lda.z glyph_bit + ora.z __5 + sta.z glyph_bits_2x2 + lda.z __5+1 + sta.z glyph_bits_2x2+1 + // [130] (word~) font_2x2::$7 ← (word) font_2x2::glyph_bits_2x2#1 << (byte) 1 -- vwuz1=vwuz2_rol_1 + lda.z glyph_bits_2x2 + asl + sta.z __7 + lda.z glyph_bits_2x2+1 + rol + sta.z __7+1 + // [131] (word) font_2x2::glyph_bits_2x2#2 ← (word~) font_2x2::$7 | (byte) font_2x2::glyph_bit#0 -- vwuz1=vwuz2_bor_vbuz3 + lda.z glyph_bit + ora.z __7 + sta.z glyph_bits_2x2_1 + lda.z __7+1 + sta.z glyph_bits_2x2_1+1 + // [132] (byte) font_2x2::glyph_bits#1 ← (byte) font_2x2::glyph_bits#2 << (byte) 1 -- vbuz1=vbuz1_rol_1 + // Move to next bit + asl.z glyph_bits + // [133] (byte) font_2x2::b#1 ← ++ (byte) font_2x2::b#2 -- vbuz1=_inc_vbuz1 + inc.z b + // [134] if((byte) font_2x2::b#1!=(byte) 8) goto font_2x2::@3 -- vbuz1_neq_vbuc1_then_la1 + lda #8 + cmp.z b + bne __b3_from___b5 + jmp __b6 + // font_2x2::@6 + __b6: + // [135] (byte~) font_2x2::$12 ← > (word) font_2x2::glyph_bits_2x2#2 -- vbuz1=_hi_vwuz2 + lda.z glyph_bits_2x2_1+1 + sta.z __12 + // [136] *((byte*) font_2x2::next_2x2_left#7 + (byte) font_2x2::l2#8) ← (byte~) font_2x2::$12 -- pbuz1_derefidx_vbuz2=vbuz3 + // Put the generated 2x2-line into the 2x2-font twice + lda.z __12 + ldy.z l2 + sta (next_2x2_left_1),y + // [137] (byte~) font_2x2::$11 ← (byte) font_2x2::l2#8 + (byte) 1 -- vbuz1=vbuz2_plus_1 + ldy.z l2 + iny + sty.z __11 + // [138] *((byte*) font_2x2::next_2x2_left#7 + (byte~) font_2x2::$11) ← (byte~) font_2x2::$12 -- pbuz1_derefidx_vbuz2=vbuz3 + lda.z __12 + ldy.z __11 + sta (next_2x2_left_1),y + // [139] (byte~) font_2x2::$15 ← < (word) font_2x2::glyph_bits_2x2#2 -- vbuz1=_lo_vwuz2 + lda.z glyph_bits_2x2_1 + sta.z __15 + // [140] *((byte*) font_2x2::next_2x2_right#7 + (byte) font_2x2::l2#8) ← (byte~) font_2x2::$15 -- pbuz1_derefidx_vbuz2=vbuz3 + lda.z __15 + ldy.z l2 + sta (next_2x2_right),y + // [141] (byte~) font_2x2::$14 ← (byte) font_2x2::l2#8 + (byte) 1 -- vbuz1=vbuz2_plus_1 + ldy.z l2 + iny + sty.z __14 + // [142] *((byte*) font_2x2::next_2x2_right#7 + (byte~) font_2x2::$14) ← (byte~) font_2x2::$15 -- pbuz1_derefidx_vbuz2=vbuz3 + lda.z __15 + ldy.z __14 + sta (next_2x2_right),y + // [143] (byte) font_2x2::l2#1 ← (byte) font_2x2::l2#8 + (byte) 2 -- vbuz1=vbuz1_plus_2 + lda.z l2 + clc + adc #2 + sta.z l2 + // [144] if((byte) font_2x2::l2#1!=(byte) 8) goto font_2x2::@8 -- vbuz1_neq_vbuc1_then_la1 + lda #8 + cmp.z l2 + bne __b8_from___b6 + jmp __b7 + // font_2x2::@7 + __b7: + // [145] (byte*) font_2x2::next_2x2_left#1 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $80*(number) 8 -- pbuz1=pbuz2_plus_vwuc1 + lda.z next_2x2_left + clc + adc #<$80*8 + sta.z next_2x2_left_1 + lda.z next_2x2_left+1 + adc #>$80*8 + sta.z next_2x2_left_1+1 + // [146] (byte*) font_2x2::next_2x2_right#1 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $c0*(number) 8 -- pbuz1=pbuz2_plus_vwuc1 + lda.z next_2x2_left + clc + adc #<$c0*8 + sta.z next_2x2_right + lda.z next_2x2_left+1 + adc #>$c0*8 + sta.z next_2x2_right+1 + // [147] phi from font_2x2::@7 to font_2x2::@8 [phi:font_2x2::@7->font_2x2::@8] + __b8_from___b7: + // [147] phi (byte*) font_2x2::next_2x2_right#8 = (byte*) font_2x2::next_2x2_right#1 [phi:font_2x2::@7->font_2x2::@8#0] -- register_copy + // [147] phi (byte) font_2x2::l2#9 = (byte) 0 [phi:font_2x2::@7->font_2x2::@8#1] -- vbuz1=vbuc1 + lda #0 + sta.z l2 + // [147] phi (byte*) font_2x2::next_2x2_left#8 = (byte*) font_2x2::next_2x2_left#1 [phi:font_2x2::@7->font_2x2::@8#2] -- register_copy + jmp __b8 + // [147] phi from font_2x2::@6 to font_2x2::@8 [phi:font_2x2::@6->font_2x2::@8] + __b8_from___b6: + // [147] phi (byte*) font_2x2::next_2x2_right#8 = (byte*) font_2x2::next_2x2_right#7 [phi:font_2x2::@6->font_2x2::@8#0] -- register_copy + // [147] phi (byte) font_2x2::l2#9 = (byte) font_2x2::l2#1 [phi:font_2x2::@6->font_2x2::@8#1] -- register_copy + // [147] phi (byte*) font_2x2::next_2x2_left#8 = (byte*) font_2x2::next_2x2_left#7 [phi:font_2x2::@6->font_2x2::@8#2] -- register_copy + jmp __b8 + // font_2x2::@8 + __b8: + // [148] (byte) font_2x2::l#1 ← ++ (byte) font_2x2::l#2 -- vbuz1=_inc_vbuz1 + inc.z l + // [149] if((byte) font_2x2::l#1!=(byte) 8) goto font_2x2::@2 -- vbuz1_neq_vbuc1_then_la1 + lda #8 + cmp.z l + bne __b2_from___b8 + jmp __b9 + // font_2x2::@9 + __b9: + // [150] (byte*) font_2x2::next_2x2#1 ← (byte*) font_2x2::next_2x2_left#0 + (byte) 8 -- pbuz1=pbuz1_plus_vbuc1 + lda #8 + clc + adc.z next_2x2 + sta.z next_2x2 + bcc !+ + inc.z next_2x2+1 + !: + // [151] (byte*) font_2x2::next_original#1 ← (byte*) font_2x2::next_original#4 + (byte) 8 -- pbuz1=pbuz1_plus_vbuc1 + lda #8 + clc + adc.z next_original + sta.z next_original + bcc !+ + inc.z next_original+1 + !: + // [152] (byte) font_2x2::c#1 ← ++ (byte) font_2x2::c#11 -- vbuz1=_inc_vbuz1 + inc.z c + // [153] if((byte) font_2x2::c#1!=(byte) $40) goto font_2x2::@1 -- vbuz1_neq_vbuc1_then_la1 + lda #$40 + cmp.z c + bne __b1_from___b9 + jmp __breturn + // font_2x2::@return + __breturn: + // [154] return + rts +} + // plex_irq +// Show sprites from the multiplexer, rescheduling the IRQ as many times as needed +plex_irq: { + .label __4 = $41 + .label plexFreeNextYpos1_return = $40 + // entry interrupt(KERNEL_MIN) + // asm { sei } + sei + // [156] phi from plex_irq plex_irq::@7 to plex_irq::@3 [phi:plex_irq/plex_irq::@7->plex_irq::@3] + __b3_from_plex_irq: + __b3_from___b7: + jmp __b3 + // plex_irq::@3 + __b3: + // [157] call plexShowSprite + jsr plexShowSprite + jmp plexFreeNextYpos1 + // plex_irq::plexFreeNextYpos1 + plexFreeNextYpos1: + // [158] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) -- vbuz1=pbuc1_derefidx_vbuz2 + ldy.z plex_free_next + lda PLEX_FREE_YPOS,y + sta.z plexFreeNextYpos1_return + jmp __b6 + // plex_irq::@6 + __b6: + // [159] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 3 -- vbuz1=_deref_pbuc1_plus_vbuc2 + lda #3 + clc + adc RASTER + sta.z __4 + // [160] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 -- vbuz1_ge_vbuc1_then_la1 + lda.z plex_show_idx + cmp #PLEX_COUNT + bcs __b4 + jmp __b7 + // plex_irq::@7 + __b7: + // [161] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3 -- vbuz1_lt_vbuz2_then_la1 + lda.z plexFreeNextYpos1_return + cmp.z __4 + bcc __b3_from___b7 + jmp __b4 + // plex_irq::@4 + __b4: + // [162] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 -- vbuz1_lt_vbuc1_then_la1 + lda.z plex_show_idx + cmp #PLEX_COUNT + bcc __b1 + jmp __b5 + // plex_irq::@5 + __b5: + // [163] *((const nomodify byte*) RASTER) ← (byte) $28 -- _deref_pbuc1=vbuc2 + // Reset the raster IRQ to the top of the screen + lda #$28 + sta RASTER + // [164] (volatile bool) framedone ← true -- vboz1=vboc1 + lda #1 + sta.z framedone + jmp __b2 + // plex_irq::@2 + __b2: + // [165] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // Acknowledge the IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + // asm { cli } + //*BORDERCOL = 0; + cli + jmp __breturn + // plex_irq::@return + __breturn: + // [167] return - exit interrupt(KERNEL_MIN) + jmp $ea81 + // plex_irq::@1 + __b1: + // [168] *((const nomodify byte*) RASTER) ← (byte) plex_irq::plexFreeNextYpos1_return#0 -- _deref_pbuc1=vbuz1 + // Set raster IRQ line to the next sprite Y-position + lda.z plexFreeNextYpos1_return + sta RASTER + jmp __b2 +} + // plexShowSprite +// Show the next sprite. +// plexSort() prepares showing the sprites +plexShowSprite: { + .label __2 = $49 + .label __3 = $4a + .label __5 = $4c + .label __6 = $4d + .label __9 = $4b + .label __11 = $48 + .label plexFreeAdd1___0 = $44 + .label plexFreeAdd1___1 = $45 + .label plexFreeAdd1___2 = $46 + .label plex_sprite_idx2 = $42 + .label plexFreeAdd1_ypos = $43 + .label xpos_idx = $47 + // [169] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 -- vbuz1=vbuz2_rol_1 + lda.z plex_sprite_idx + asl + sta.z plex_sprite_idx2 + // [170] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) -- vbuz1=pbuc1_derefidx_(pbuc2_derefidx_vbuz2) + ldx.z plex_show_idx + ldy PLEX_SORTED_IDX,x + ldx PLEX_YPOS,y + stx.z plexFreeAdd1_ypos + // [171] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 -- pbuc1_derefidx_vbuz1=vbuz2 + lda.z plexFreeAdd1_ypos + ldy.z plex_sprite_idx2 + sta SPRITES_YPOS,y + jmp plexFreeAdd1 + // plexShowSprite::plexFreeAdd1 + plexFreeAdd1: + // [172] (byte~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte) $15 -- vbuz1=vbuz2_plus_vbuc1 + lax.z plexFreeAdd1_ypos + axs #-[$15] + stx.z plexFreeAdd1___0 + // [173] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 -- pbuc1_derefidx_vbuz1=vbuz2 + lda.z plexFreeAdd1___0 + ldy.z plex_free_next + sta PLEX_FREE_YPOS,y + // [174] (byte~) plexShowSprite::plexFreeAdd1_$1 ← (volatile byte) plex_free_next + (byte) 1 -- vbuz1=vbuz2_plus_1 + ldy.z plex_free_next + iny + sty.z plexFreeAdd1___1 + // [175] (byte~) plexShowSprite::plexFreeAdd1_$2 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7 -- vbuz1=vbuz2_band_vbuc1 + lda #7 + and.z plexFreeAdd1___1 + sta.z plexFreeAdd1___2 + // [176] (volatile byte) plex_free_next ← (byte~) plexShowSprite::plexFreeAdd1_$2 -- vbuz1=vbuz2 + lda.z plexFreeAdd1___2 + sta.z plex_free_next + jmp __b5 + // plexShowSprite::@5 + __b5: + // [177] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_(pbuc3_derefidx_vbuz2) + ldx.z plex_show_idx + ldy PLEX_SORTED_IDX,x + lda PLEX_PTR,y + ldx.z plex_sprite_idx + sta PLEX_SCREEN_PTR,x + // [178] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) -- vbuz1=pbuc1_derefidx_vbuz2 + ldy.z plex_show_idx + lda PLEX_SORTED_IDX,y + sta.z xpos_idx + // [179] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 -- vbuz1=vbuz2_rol_1 + lda.z xpos_idx + asl + sta.z __11 + // [180] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) -- vbuz1=_lo_pwuc1_derefidx_vbuz2 + ldy.z __11 + lda PLEX_XPOS,y + sta.z __2 + // [181] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 -- pbuc1_derefidx_vbuz1=vbuz2 + lda.z __2 + ldy.z plex_sprite_idx2 + sta SPRITES_XPOS,y + // [182] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) -- vbuz1=_hi_pwuc1_derefidx_vbuz2 + ldy.z __11 + lda PLEX_XPOS+1,y + sta.z __3 + // [183] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1 -- vbuz1_neq_0_then_la1 + lda.z __3 + cmp #0 + bne __b1 + jmp __b3 + // plexShowSprite::@3 + __b3: + // [184] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb -- vbuz1=vbuc1_bxor_vbuz2 + lda #$ff + eor.z plex_sprite_msb + sta.z __9 + // [185] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 -- _deref_pbuc1=_deref_pbuc1_band_vbuz1 + lda SPRITES_XMSB + and.z __9 + sta SPRITES_XMSB + jmp __b2 + // plexShowSprite::@2 + __b2: + // [186] (byte~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (byte) 1 -- vbuz1=vbuz2_plus_1 + ldy.z plex_sprite_idx + iny + sty.z __5 + // [187] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7 -- vbuz1=vbuz2_band_vbuc1 + lda #7 + and.z __5 + sta.z __6 + // [188] (volatile byte) plex_sprite_idx ← (byte~) plexShowSprite::$6 -- vbuz1=vbuz2 + lda.z __6 + sta.z plex_sprite_idx + // [189] (volatile byte) plex_show_idx ← ++ (volatile byte) plex_show_idx -- vbuz1=_inc_vbuz1 + inc.z plex_show_idx + // [190] (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (byte) 1 -- vbuz1=vbuz1_rol_1 + asl.z plex_sprite_msb + // [191] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return -- vbuz1_neq_0_then_la1 + lda.z plex_sprite_msb + cmp #0 + bne __breturn + jmp __b4 + // plexShowSprite::@4 + __b4: + // [192] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 + lda #1 + sta.z plex_sprite_msb + jmp __breturn + // plexShowSprite::@return + __breturn: + // [193] return + rts + // plexShowSprite::@1 + __b1: + // [194] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 + lda SPRITES_XMSB + ora.z plex_sprite_msb + sta SPRITES_XMSB + jmp __b2 +} + // File Data + // The x-positions of the multiplexer sprites (0x000-0x1ff) + PLEX_XPOS: .fill 2*PLEX_COUNT, 0 + // The y-positions of the multiplexer sprites. + PLEX_YPOS: .fill PLEX_COUNT, 0 + // The sprite pointers for the multiplexed sprites + 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 + // 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 + //kickasm(pc FONT, resource "elefont.bin") {{ + // .import binary "elefont.bin" + //}} + .align $100 +YSIN: +.fill $100, round(142+89.5*sin(toRadians(360*i/256))) + + +REGISTER UPLIFT POTENTIAL REGISTERS +Statement [1] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [2] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [3] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [4] (volatile byte) plex_free_next ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [5] (volatile bool) framedone ← false [ framedone ] ( [ framedone ] { } ) always clobbers reg byte a +Statement [10] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_CHARROM [ framedone ] ( main:7 [ framedone ] { } ) always clobbers reg byte a +Statement [12] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_BASIC_KERNEL_IO [ framedone ] ( main:7 [ framedone ] { } ) always clobbers reg byte a +Statement [18] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 [ framedone ] ( main:7 [ framedone ] { } ) always clobbers reg byte a +Statement [23] (byte~) main::$12 ← (byte) main::s#2 << (byte) 1 [ framedone main::s#2 main::xp#2 main::sprite#1 main::$12 ] ( main:7 [ framedone main::s#2 main::xp#2 main::sprite#1 main::$12 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:3 [ main::s#2 main::s#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::sprite#2 main::sprite#1 ] +Statement [24] *((const word*) PLEX_XPOS + (byte~) main::$12) ← (word) main::xp#2 [ framedone main::s#2 main::xp#2 main::sprite#1 ] ( main:7 [ framedone main::s#2 main::xp#2 main::sprite#1 ] { } ) always clobbers reg byte a +Statement [25] (word) main::xp#1 ← (word) main::xp#2 + (byte) $a [ framedone main::s#2 main::sprite#1 main::xp#1 ] ( main:7 [ framedone main::s#2 main::sprite#1 main::xp#1 ] { } ) always clobbers reg byte a +Statement [28] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ framedone ] ( main:7 [ framedone ] { } ) always clobbers reg byte a +Statement [30] *((const nomodify byte*) SPRITES_COLS + (byte) main::s1#2) ← (const nomodify byte) WHITE [ framedone main::s1#2 ] ( main:7 [ framedone main::s1#2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:6 [ main::s1#2 main::s1#1 ] +Statement [38] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:10 [ sin_idx#10 sin_idx#12 ] +Statement [39] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [40] *((const nomodify byte*) RASTER) ← (byte) $28 [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [41] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [42] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [43] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [45] if((volatile bool) framedone) goto main::@6 [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [50] (volatile bool) framedone ← false [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [58] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] ( main:7::plexSort:36 [ framedone sin_idx#12 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] { } main:7::plexSort:49 [ sin_idx#12 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:7 [ plexSort::m#2 plexSort::m#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:47 [ plexSort::nxt_idx#0 ] +Removing always clobbered register reg byte a as potential for zp[1]:48 [ plexSort::nxt_y#0 ] +Removing always clobbered register reg byte a as potential for zp[1]:8 [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] +Statement [61] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] ( main:7::plexSort:36 [ framedone sin_idx#12 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] { } main:7::plexSort:49 [ sin_idx#12 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] { } ) always clobbers reg byte a +Statement [63] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 [ plexSort::m#2 ] ( main:7::plexSort:36 [ framedone sin_idx#12 plexSort::m#2 ] { } main:7::plexSort:49 [ sin_idx#12 plexSort::m#2 ] { } ) always clobbers reg byte a +Statement [66] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( main:7::plexSort:36 [ framedone sin_idx#12 ] { } main:7::plexSort:49 [ sin_idx#12 ] { } ) always clobbers reg byte a +Statement [67] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( main:7::plexSort:36 [ framedone sin_idx#12 ] { } main:7::plexSort:49 [ sin_idx#12 ] { } ) always clobbers reg byte a +Statement [68] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( main:7::plexSort:36 [ framedone sin_idx#12 ] { } main:7::plexSort:49 [ sin_idx#12 ] { } ) always clobbers reg byte a +Statement [71] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 [ plexSort::plexFreePrepare1_s#2 ] ( main:7::plexSort:36 [ framedone sin_idx#12 plexSort::plexFreePrepare1_s#2 ] { } main:7::plexSort:49 [ sin_idx#12 plexSort::plexFreePrepare1_s#2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:9 [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] +Statement [74] (volatile byte) plex_free_next ← (byte) 0 [ ] ( main:7::plexSort:36 [ framedone sin_idx#12 ] { } main:7::plexSort:49 [ sin_idx#12 ] { } ) always clobbers reg byte a +Statement [79] *((const byte*) PLEX_YPOS + (byte) plexSine::sy#2) ← *((const byte*) YSIN + (byte) plexSine::y_idx#2) [ sin_idx#10 plexSine::y_idx#2 plexSine::sy#2 ] ( main:7::plexSine:34 [ framedone sin_idx#10 plexSine::y_idx#2 plexSine::sy#2 ] { } main:7::plexSine:47 [ sin_idx#10 plexSine::y_idx#2 plexSine::sy#2 ] { { sin_idx#10 = sin_idx#12 } } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:11 [ plexSine::y_idx#2 plexSine::y_idx#0 plexSine::y_idx#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:12 [ plexSine::sy#2 plexSine::sy#1 ] +Statement [80] (byte) plexSine::y_idx#1 ← (byte) plexSine::y_idx#2 + (byte) 8 [ sin_idx#10 plexSine::sy#2 plexSine::y_idx#1 ] ( main:7::plexSine:34 [ framedone sin_idx#10 plexSine::sy#2 plexSine::y_idx#1 ] { } main:7::plexSine:47 [ sin_idx#10 plexSine::sy#2 plexSine::y_idx#1 ] { { sin_idx#10 = sin_idx#12 } } ) always clobbers reg byte a +Statement [96] (byte*) font_2x2_to_sprites::char_right#0 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $40*(number) 8 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_right#0 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_right#0 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:14 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::c#1 ] +Statement [97] (byte*) font_2x2_to_sprites::char_left#6 ← (byte*) font_2x2_to_sprites::char_current#2 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_left#6 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_left#6 ] { } ) always clobbers reg byte a +Statement [100] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#4) ← *((byte*) font_2x2_to_sprites::char_left#3 + (byte~) font_2x2_to_sprites::$3) [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::$3 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::$3 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:19 [ font_2x2_to_sprites::i#2 font_2x2_to_sprites::i#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:22 [ font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::sprite_idx#3 ] +Removing always clobbered register reg byte a as potential for zp[1]:50 [ font_2x2_to_sprites::$3 ] +Statement [102] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#1) ← *((byte*) font_2x2_to_sprites::char_right#3 + (byte~) font_2x2_to_sprites::$3) [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::sprite_idx#1 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::sprite_idx#1 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:51 [ font_2x2_to_sprites::sprite_idx#1 ] +Statement [104] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#2) ← (byte) 0 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::sprite_idx#2 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::sprite_idx#2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:52 [ font_2x2_to_sprites::sprite_idx#2 ] +Statement [112] (byte*) font_2x2_to_sprites::char_current#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (byte) 8 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_current#1 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_current#1 ] { } ) always clobbers reg byte a +Statement [113] (byte*) font_2x2_to_sprites::sprite#1 ← (byte*) font_2x2_to_sprites::sprite#4 + (byte) $40 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#1 font_2x2_to_sprites::sprite#1 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#1 font_2x2_to_sprites::sprite#1 ] { } ) always clobbers reg byte a +Statement [115] (byte*) font_2x2_to_sprites::char_left#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $80*(number) 8 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::sprite_idx#3 font_2x2_to_sprites::char_left#1 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::sprite_idx#3 font_2x2_to_sprites::char_left#1 ] { } ) always clobbers reg byte a +Statement [116] (byte*) font_2x2_to_sprites::char_right#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $c0*(number) 8 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::sprite_idx#3 font_2x2_to_sprites::char_left#1 font_2x2_to_sprites::char_right#1 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::sprite_idx#3 font_2x2_to_sprites::char_left#1 font_2x2_to_sprites::char_right#1 ] { } ) always clobbers reg byte a +Statement [119] (byte*) font_2x2::next_2x2_right#0 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $40*(number) 8 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2_right#0 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2_right#0 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:29 [ font_2x2::c#11 font_2x2::c#1 ] +Statement [120] (byte*) font_2x2::next_2x2_left#10 ← (byte*) font_2x2::next_2x2_left#0 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2_right#0 font_2x2::next_2x2_left#10 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2_right#0 font_2x2::next_2x2_left#10 ] { } ) always clobbers reg byte a +Statement [122] (byte) font_2x2::glyph_bits#0 ← *((byte*) font_2x2::next_original#4 + (byte) font_2x2::l#2) [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#0 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#0 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:30 [ font_2x2::l#2 font_2x2::l#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:33 [ font_2x2::l2#8 font_2x2::l2#9 font_2x2::l2#1 ] +Statement [128] (word~) font_2x2::$5 ← (word) font_2x2::glyph_bits_2x2#3 << (byte) 1 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::$5 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::$5 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:36 [ font_2x2::glyph_bits#2 font_2x2::glyph_bits#0 font_2x2::glyph_bits#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:39 [ font_2x2::b#2 font_2x2::b#1 ] +Removing always clobbered register reg byte a as potential for zp[1]:40 [ font_2x2::glyph_bit#0 ] +Statement [129] (word) font_2x2::glyph_bits_2x2#1 ← (word~) font_2x2::$5 | (byte) font_2x2::glyph_bit#0 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::glyph_bits_2x2#1 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::glyph_bits_2x2#1 ] { } ) always clobbers reg byte a +Statement [130] (word~) font_2x2::$7 ← (word) font_2x2::glyph_bits_2x2#1 << (byte) 1 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::$7 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::$7 ] { } ) always clobbers reg byte a +Statement [131] (word) font_2x2::glyph_bits_2x2#2 ← (word~) font_2x2::$7 | (byte) font_2x2::glyph_bit#0 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bits_2x2#2 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bits_2x2#2 ] { } ) always clobbers reg byte a +Statement [145] (byte*) font_2x2::next_2x2_left#1 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $80*(number) 8 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#1 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#1 ] { } ) always clobbers reg byte a +Statement [146] (byte*) font_2x2::next_2x2_right#1 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $c0*(number) 8 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#1 font_2x2::next_2x2_right#1 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#1 font_2x2::next_2x2_right#1 ] { } ) always clobbers reg byte a +Statement [150] (byte*) font_2x2::next_2x2#1 ← (byte*) font_2x2::next_2x2_left#0 + (byte) 8 [ font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2#1 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2#1 ] { } ) always clobbers reg byte a +Statement [151] (byte*) font_2x2::next_original#1 ← (byte*) font_2x2::next_original#4 + (byte) 8 [ font_2x2::c#11 font_2x2::next_2x2#1 font_2x2::next_original#1 ] ( main:7::font_2x2:11 [ framedone font_2x2::c#11 font_2x2::next_2x2#1 font_2x2::next_original#1 ] { } ) always clobbers reg byte a +Statement [158] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte y +Statement [159] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 3 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:64 [ plex_irq::plexFreeNextYpos1_return#0 ] +Statement [160] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:65 [ plex_irq::$4 ] +Statement [162] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 [ plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte a +Statement [163] *((const nomodify byte*) RASTER) ← (byte) $28 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [164] (volatile bool) framedone ← true [ ] ( [ ] { } ) always clobbers reg byte a +Statement [165] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ ] ( [ ] { } ) always clobbers reg byte a +Statement [169] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a +Statement [170] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte x reg byte y +Removing always clobbered register reg byte x as potential for zp[1]:66 [ plexShowSprite::plex_sprite_idx2#0 ] +Removing always clobbered register reg byte y as potential for zp[1]:66 [ plexShowSprite::plex_sprite_idx2#0 ] +Statement [173] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte y +Statement [177] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a reg byte x reg byte y +Removing always clobbered register reg byte a as potential for zp[1]:66 [ plexShowSprite::plex_sprite_idx2#0 ] +Statement [178] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] { } ) always clobbers reg byte y +Statement [179] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] { } ) always clobbers reg byte a +Statement [180] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] { } ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp[1]:72 [ plexShowSprite::$11 ] +Statement [181] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] { } ) always clobbers reg byte y +Removing always clobbered register reg byte y as potential for zp[1]:72 [ plexShowSprite::$11 ] +Statement [182] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] { } ) always clobbers reg byte a +Statement [184] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] { } ) always clobbers reg byte a +Statement [185] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [191] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [192] (volatile byte) plex_sprite_msb ← (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [194] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [1] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [2] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [3] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [4] (volatile byte) plex_free_next ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [5] (volatile bool) framedone ← false [ framedone ] ( [ framedone ] { } ) always clobbers reg byte a +Statement [10] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_CHARROM [ framedone ] ( main:7 [ framedone ] { } ) always clobbers reg byte a +Statement [12] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_BASIC_KERNEL_IO [ framedone ] ( main:7 [ framedone ] { } ) always clobbers reg byte a +Statement [18] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 [ framedone ] ( main:7 [ framedone ] { } ) always clobbers reg byte a +Statement [21] *((const byte*) PLEX_PTR + (byte) main::s#2) ← (byte) main::sprite#2 [ framedone main::sprite#2 main::s#2 main::xp#2 ] ( main:7 [ framedone main::sprite#2 main::s#2 main::xp#2 ] { } ) always clobbers reg byte a +Statement [23] (byte~) main::$12 ← (byte) main::s#2 << (byte) 1 [ framedone main::s#2 main::xp#2 main::sprite#1 main::$12 ] ( main:7 [ framedone main::s#2 main::xp#2 main::sprite#1 main::$12 ] { } ) always clobbers reg byte a +Statement [24] *((const word*) PLEX_XPOS + (byte~) main::$12) ← (word) main::xp#2 [ framedone main::s#2 main::xp#2 main::sprite#1 ] ( main:7 [ framedone main::s#2 main::xp#2 main::sprite#1 ] { } ) always clobbers reg byte a +Statement [25] (word) main::xp#1 ← (word) main::xp#2 + (byte) $a [ framedone main::s#2 main::sprite#1 main::xp#1 ] ( main:7 [ framedone main::s#2 main::sprite#1 main::xp#1 ] { } ) always clobbers reg byte a +Statement [28] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ framedone ] ( main:7 [ framedone ] { } ) always clobbers reg byte a +Statement [30] *((const nomodify byte*) SPRITES_COLS + (byte) main::s1#2) ← (const nomodify byte) WHITE [ framedone main::s1#2 ] ( main:7 [ framedone main::s1#2 ] { } ) always clobbers reg byte a +Statement [38] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [39] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [40] *((const nomodify byte*) RASTER) ← (byte) $28 [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [41] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [42] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [43] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [45] if((volatile bool) framedone) goto main::@6 [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [50] (volatile bool) framedone ← false [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [55] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 ] ( main:7::plexSort:36 [ framedone sin_idx#12 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 ] { } main:7::plexSort:49 [ sin_idx#12 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 ] { } ) always clobbers reg byte a +Statement [58] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] ( main:7::plexSort:36 [ framedone sin_idx#12 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] { } main:7::plexSort:49 [ sin_idx#12 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] { } ) always clobbers reg byte a +Statement [61] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] ( main:7::plexSort:36 [ framedone sin_idx#12 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] { } main:7::plexSort:49 [ sin_idx#12 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] { } ) always clobbers reg byte a +Statement [63] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 [ plexSort::m#2 ] ( main:7::plexSort:36 [ framedone sin_idx#12 plexSort::m#2 ] { } main:7::plexSort:49 [ sin_idx#12 plexSort::m#2 ] { } ) always clobbers reg byte a +Statement [66] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( main:7::plexSort:36 [ framedone sin_idx#12 ] { } main:7::plexSort:49 [ sin_idx#12 ] { } ) always clobbers reg byte a +Statement [67] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( main:7::plexSort:36 [ framedone sin_idx#12 ] { } main:7::plexSort:49 [ sin_idx#12 ] { } ) always clobbers reg byte a +Statement [68] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( main:7::plexSort:36 [ framedone sin_idx#12 ] { } main:7::plexSort:49 [ sin_idx#12 ] { } ) always clobbers reg byte a +Statement [71] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 [ plexSort::plexFreePrepare1_s#2 ] ( main:7::plexSort:36 [ framedone sin_idx#12 plexSort::plexFreePrepare1_s#2 ] { } main:7::plexSort:49 [ sin_idx#12 plexSort::plexFreePrepare1_s#2 ] { } ) always clobbers reg byte a +Statement [74] (volatile byte) plex_free_next ← (byte) 0 [ ] ( main:7::plexSort:36 [ framedone sin_idx#12 ] { } main:7::plexSort:49 [ sin_idx#12 ] { } ) always clobbers reg byte a +Statement [79] *((const byte*) PLEX_YPOS + (byte) plexSine::sy#2) ← *((const byte*) YSIN + (byte) plexSine::y_idx#2) [ sin_idx#10 plexSine::y_idx#2 plexSine::sy#2 ] ( main:7::plexSine:34 [ framedone sin_idx#10 plexSine::y_idx#2 plexSine::sy#2 ] { } main:7::plexSine:47 [ sin_idx#10 plexSine::y_idx#2 plexSine::sy#2 ] { { sin_idx#10 = sin_idx#12 } } ) always clobbers reg byte a +Statement [80] (byte) plexSine::y_idx#1 ← (byte) plexSine::y_idx#2 + (byte) 8 [ sin_idx#10 plexSine::sy#2 plexSine::y_idx#1 ] ( main:7::plexSine:34 [ framedone sin_idx#10 plexSine::sy#2 plexSine::y_idx#1 ] { } main:7::plexSine:47 [ sin_idx#10 plexSine::sy#2 plexSine::y_idx#1 ] { { sin_idx#10 = sin_idx#12 } } ) always clobbers reg byte a +Statement [96] (byte*) font_2x2_to_sprites::char_right#0 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $40*(number) 8 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_right#0 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_right#0 ] { } ) always clobbers reg byte a +Statement [97] (byte*) font_2x2_to_sprites::char_left#6 ← (byte*) font_2x2_to_sprites::char_current#2 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_left#6 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_left#6 ] { } ) always clobbers reg byte a +Statement [99] (byte~) font_2x2_to_sprites::$3 ← (byte) font_2x2_to_sprites::i#2 & (byte) 7 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::$3 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::$3 ] { } ) always clobbers reg byte a +Statement [100] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#4) ← *((byte*) font_2x2_to_sprites::char_left#3 + (byte~) font_2x2_to_sprites::$3) [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::$3 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::$3 ] { } ) always clobbers reg byte a +Statement [102] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#1) ← *((byte*) font_2x2_to_sprites::char_right#3 + (byte~) font_2x2_to_sprites::$3) [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::sprite_idx#1 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::sprite_idx#1 ] { } ) always clobbers reg byte a +Statement [104] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#2) ← (byte) 0 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::sprite_idx#2 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::sprite_idx#2 ] { } ) always clobbers reg byte a +Statement [112] (byte*) font_2x2_to_sprites::char_current#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (byte) 8 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_current#1 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_current#1 ] { } ) always clobbers reg byte a +Statement [113] (byte*) font_2x2_to_sprites::sprite#1 ← (byte*) font_2x2_to_sprites::sprite#4 + (byte) $40 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#1 font_2x2_to_sprites::sprite#1 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#1 font_2x2_to_sprites::sprite#1 ] { } ) always clobbers reg byte a +Statement [115] (byte*) font_2x2_to_sprites::char_left#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $80*(number) 8 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::sprite_idx#3 font_2x2_to_sprites::char_left#1 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::sprite_idx#3 font_2x2_to_sprites::char_left#1 ] { } ) always clobbers reg byte a +Statement [116] (byte*) font_2x2_to_sprites::char_right#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $c0*(number) 8 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::sprite_idx#3 font_2x2_to_sprites::char_left#1 font_2x2_to_sprites::char_right#1 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::sprite_idx#3 font_2x2_to_sprites::char_left#1 font_2x2_to_sprites::char_right#1 ] { } ) always clobbers reg byte a +Statement [119] (byte*) font_2x2::next_2x2_right#0 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $40*(number) 8 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2_right#0 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2_right#0 ] { } ) always clobbers reg byte a +Statement [120] (byte*) font_2x2::next_2x2_left#10 ← (byte*) font_2x2::next_2x2_left#0 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2_right#0 font_2x2::next_2x2_left#10 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2_right#0 font_2x2::next_2x2_left#10 ] { } ) always clobbers reg byte a +Statement [122] (byte) font_2x2::glyph_bits#0 ← *((byte*) font_2x2::next_original#4 + (byte) font_2x2::l#2) [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#0 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#0 ] { } ) always clobbers reg byte a +Statement [124] (byte~) font_2x2::$1 ← (byte) font_2x2::glyph_bits#2 & (byte) $80 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::glyph_bits_2x2#3 font_2x2::b#2 font_2x2::$1 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::glyph_bits_2x2#3 font_2x2::b#2 font_2x2::$1 ] { } ) always clobbers reg byte a +Statement [128] (word~) font_2x2::$5 ← (word) font_2x2::glyph_bits_2x2#3 << (byte) 1 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::$5 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::$5 ] { } ) always clobbers reg byte a +Statement [129] (word) font_2x2::glyph_bits_2x2#1 ← (word~) font_2x2::$5 | (byte) font_2x2::glyph_bit#0 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::glyph_bits_2x2#1 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::glyph_bits_2x2#1 ] { } ) always clobbers reg byte a +Statement [130] (word~) font_2x2::$7 ← (word) font_2x2::glyph_bits_2x2#1 << (byte) 1 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::$7 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::$7 ] { } ) always clobbers reg byte a +Statement [131] (word) font_2x2::glyph_bits_2x2#2 ← (word~) font_2x2::$7 | (byte) font_2x2::glyph_bit#0 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bits_2x2#2 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bits_2x2#2 ] { } ) always clobbers reg byte a +Statement [145] (byte*) font_2x2::next_2x2_left#1 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $80*(number) 8 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#1 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#1 ] { } ) always clobbers reg byte a +Statement [146] (byte*) font_2x2::next_2x2_right#1 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $c0*(number) 8 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#1 font_2x2::next_2x2_right#1 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#1 font_2x2::next_2x2_right#1 ] { } ) always clobbers reg byte a +Statement [150] (byte*) font_2x2::next_2x2#1 ← (byte*) font_2x2::next_2x2_left#0 + (byte) 8 [ font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2#1 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2#1 ] { } ) always clobbers reg byte a +Statement [151] (byte*) font_2x2::next_original#1 ← (byte*) font_2x2::next_original#4 + (byte) 8 [ font_2x2::c#11 font_2x2::next_2x2#1 font_2x2::next_original#1 ] ( main:7::font_2x2:11 [ framedone font_2x2::c#11 font_2x2::next_2x2#1 font_2x2::next_original#1 ] { } ) always clobbers reg byte a +Statement [158] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte y +Statement [159] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 3 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] { } ) always clobbers reg byte a +Statement [160] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] { } ) always clobbers reg byte a +Statement [162] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 [ plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte a +Statement [163] *((const nomodify byte*) RASTER) ← (byte) $28 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [164] (volatile bool) framedone ← true [ ] ( [ ] { } ) always clobbers reg byte a +Statement [165] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ ] ( [ ] { } ) always clobbers reg byte a +Statement [169] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a +Statement [170] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte x reg byte y +Statement [171] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte y +Removing always clobbered register reg byte y as potential for zp[1]:67 [ plexShowSprite::plexFreeAdd1_ypos#0 ] +Statement [173] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte y +Statement [177] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a reg byte x reg byte y +Statement [178] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] { } ) always clobbers reg byte y +Statement [179] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] { } ) always clobbers reg byte a +Statement [180] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] { } ) always clobbers reg byte a +Statement [181] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] { } ) always clobbers reg byte y +Statement [182] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] { } ) always clobbers reg byte a +Statement [184] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] { } ) always clobbers reg byte a +Statement [185] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [191] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [192] (volatile byte) plex_sprite_msb ← (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [194] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [1] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [2] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [3] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [4] (volatile byte) plex_free_next ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [5] (volatile bool) framedone ← false [ framedone ] ( [ framedone ] { } ) always clobbers reg byte a +Statement [10] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_CHARROM [ framedone ] ( main:7 [ framedone ] { } ) always clobbers reg byte a +Statement [12] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_BASIC_KERNEL_IO [ framedone ] ( main:7 [ framedone ] { } ) always clobbers reg byte a +Statement [18] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 [ framedone ] ( main:7 [ framedone ] { } ) always clobbers reg byte a +Statement [21] *((const byte*) PLEX_PTR + (byte) main::s#2) ← (byte) main::sprite#2 [ framedone main::sprite#2 main::s#2 main::xp#2 ] ( main:7 [ framedone main::sprite#2 main::s#2 main::xp#2 ] { } ) always clobbers reg byte a +Statement [23] (byte~) main::$12 ← (byte) main::s#2 << (byte) 1 [ framedone main::s#2 main::xp#2 main::sprite#1 main::$12 ] ( main:7 [ framedone main::s#2 main::xp#2 main::sprite#1 main::$12 ] { } ) always clobbers reg byte a +Statement [24] *((const word*) PLEX_XPOS + (byte~) main::$12) ← (word) main::xp#2 [ framedone main::s#2 main::xp#2 main::sprite#1 ] ( main:7 [ framedone main::s#2 main::xp#2 main::sprite#1 ] { } ) always clobbers reg byte a +Statement [25] (word) main::xp#1 ← (word) main::xp#2 + (byte) $a [ framedone main::s#2 main::sprite#1 main::xp#1 ] ( main:7 [ framedone main::s#2 main::sprite#1 main::xp#1 ] { } ) always clobbers reg byte a +Statement [28] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ framedone ] ( main:7 [ framedone ] { } ) always clobbers reg byte a +Statement [30] *((const nomodify byte*) SPRITES_COLS + (byte) main::s1#2) ← (const nomodify byte) WHITE [ framedone main::s1#2 ] ( main:7 [ framedone main::s1#2 ] { } ) always clobbers reg byte a +Statement [38] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [39] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [40] *((const nomodify byte*) RASTER) ← (byte) $28 [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [41] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [42] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [43] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [45] if((volatile bool) framedone) goto main::@6 [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [50] (volatile bool) framedone ← false [ framedone sin_idx#12 ] ( main:7 [ framedone sin_idx#12 ] { } ) always clobbers reg byte a +Statement [55] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 ] ( main:7::plexSort:36 [ framedone sin_idx#12 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 ] { } main:7::plexSort:49 [ sin_idx#12 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 ] { } ) always clobbers reg byte a +Statement [58] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] ( main:7::plexSort:36 [ framedone sin_idx#12 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] { } main:7::plexSort:49 [ sin_idx#12 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] { } ) always clobbers reg byte a +Statement [61] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] ( main:7::plexSort:36 [ framedone sin_idx#12 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] { } main:7::plexSort:49 [ sin_idx#12 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] { } ) always clobbers reg byte a +Statement [63] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 [ plexSort::m#2 ] ( main:7::plexSort:36 [ framedone sin_idx#12 plexSort::m#2 ] { } main:7::plexSort:49 [ sin_idx#12 plexSort::m#2 ] { } ) always clobbers reg byte a +Statement [66] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( main:7::plexSort:36 [ framedone sin_idx#12 ] { } main:7::plexSort:49 [ sin_idx#12 ] { } ) always clobbers reg byte a +Statement [67] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( main:7::plexSort:36 [ framedone sin_idx#12 ] { } main:7::plexSort:49 [ sin_idx#12 ] { } ) always clobbers reg byte a +Statement [68] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( main:7::plexSort:36 [ framedone sin_idx#12 ] { } main:7::plexSort:49 [ sin_idx#12 ] { } ) always clobbers reg byte a +Statement [71] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 [ plexSort::plexFreePrepare1_s#2 ] ( main:7::plexSort:36 [ framedone sin_idx#12 plexSort::plexFreePrepare1_s#2 ] { } main:7::plexSort:49 [ sin_idx#12 plexSort::plexFreePrepare1_s#2 ] { } ) always clobbers reg byte a +Statement [74] (volatile byte) plex_free_next ← (byte) 0 [ ] ( main:7::plexSort:36 [ framedone sin_idx#12 ] { } main:7::plexSort:49 [ sin_idx#12 ] { } ) always clobbers reg byte a +Statement [79] *((const byte*) PLEX_YPOS + (byte) plexSine::sy#2) ← *((const byte*) YSIN + (byte) plexSine::y_idx#2) [ sin_idx#10 plexSine::y_idx#2 plexSine::sy#2 ] ( main:7::plexSine:34 [ framedone sin_idx#10 plexSine::y_idx#2 plexSine::sy#2 ] { } main:7::plexSine:47 [ sin_idx#10 plexSine::y_idx#2 plexSine::sy#2 ] { { sin_idx#10 = sin_idx#12 } } ) always clobbers reg byte a +Statement [80] (byte) plexSine::y_idx#1 ← (byte) plexSine::y_idx#2 + (byte) 8 [ sin_idx#10 plexSine::sy#2 plexSine::y_idx#1 ] ( main:7::plexSine:34 [ framedone sin_idx#10 plexSine::sy#2 plexSine::y_idx#1 ] { } main:7::plexSine:47 [ sin_idx#10 plexSine::sy#2 plexSine::y_idx#1 ] { { sin_idx#10 = sin_idx#12 } } ) always clobbers reg byte a +Statement [96] (byte*) font_2x2_to_sprites::char_right#0 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $40*(number) 8 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_right#0 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_right#0 ] { } ) always clobbers reg byte a +Statement [97] (byte*) font_2x2_to_sprites::char_left#6 ← (byte*) font_2x2_to_sprites::char_current#2 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_left#6 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_left#6 ] { } ) always clobbers reg byte a +Statement [99] (byte~) font_2x2_to_sprites::$3 ← (byte) font_2x2_to_sprites::i#2 & (byte) 7 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::$3 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::$3 ] { } ) always clobbers reg byte a +Statement [100] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#4) ← *((byte*) font_2x2_to_sprites::char_left#3 + (byte~) font_2x2_to_sprites::$3) [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::$3 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::$3 ] { } ) always clobbers reg byte a +Statement [102] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#1) ← *((byte*) font_2x2_to_sprites::char_right#3 + (byte~) font_2x2_to_sprites::$3) [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::sprite_idx#1 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::sprite_idx#1 ] { } ) always clobbers reg byte a +Statement [104] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#2) ← (byte) 0 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::sprite_idx#2 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::sprite_idx#2 ] { } ) always clobbers reg byte a +Statement [112] (byte*) font_2x2_to_sprites::char_current#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (byte) 8 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_current#1 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::char_current#1 ] { } ) always clobbers reg byte a +Statement [113] (byte*) font_2x2_to_sprites::sprite#1 ← (byte*) font_2x2_to_sprites::sprite#4 + (byte) $40 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#1 font_2x2_to_sprites::sprite#1 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#1 font_2x2_to_sprites::sprite#1 ] { } ) always clobbers reg byte a +Statement [115] (byte*) font_2x2_to_sprites::char_left#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $80*(number) 8 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::sprite_idx#3 font_2x2_to_sprites::char_left#1 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::sprite_idx#3 font_2x2_to_sprites::char_left#1 ] { } ) always clobbers reg byte a +Statement [116] (byte*) font_2x2_to_sprites::char_right#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $c0*(number) 8 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::sprite_idx#3 font_2x2_to_sprites::char_left#1 font_2x2_to_sprites::char_right#1 ] ( main:7::font_2x2_to_sprites:14 [ framedone font_2x2_to_sprites::c#2 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::i#2 font_2x2_to_sprites::sprite_idx#3 font_2x2_to_sprites::char_left#1 font_2x2_to_sprites::char_right#1 ] { } ) always clobbers reg byte a +Statement [119] (byte*) font_2x2::next_2x2_right#0 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $40*(number) 8 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2_right#0 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2_right#0 ] { } ) always clobbers reg byte a +Statement [120] (byte*) font_2x2::next_2x2_left#10 ← (byte*) font_2x2::next_2x2_left#0 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2_right#0 font_2x2::next_2x2_left#10 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2_right#0 font_2x2::next_2x2_left#10 ] { } ) always clobbers reg byte a +Statement [122] (byte) font_2x2::glyph_bits#0 ← *((byte*) font_2x2::next_original#4 + (byte) font_2x2::l#2) [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#0 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#0 ] { } ) always clobbers reg byte a +Statement [124] (byte~) font_2x2::$1 ← (byte) font_2x2::glyph_bits#2 & (byte) $80 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::glyph_bits_2x2#3 font_2x2::b#2 font_2x2::$1 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::glyph_bits_2x2#3 font_2x2::b#2 font_2x2::$1 ] { } ) always clobbers reg byte a +Statement [128] (word~) font_2x2::$5 ← (word) font_2x2::glyph_bits_2x2#3 << (byte) 1 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::$5 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::$5 ] { } ) always clobbers reg byte a +Statement [129] (word) font_2x2::glyph_bits_2x2#1 ← (word~) font_2x2::$5 | (byte) font_2x2::glyph_bit#0 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::glyph_bits_2x2#1 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::glyph_bits_2x2#1 ] { } ) always clobbers reg byte a +Statement [130] (word~) font_2x2::$7 ← (word) font_2x2::glyph_bits_2x2#1 << (byte) 1 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::$7 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bit#0 font_2x2::$7 ] { } ) always clobbers reg byte a +Statement [131] (word) font_2x2::glyph_bits_2x2#2 ← (word~) font_2x2::$7 | (byte) font_2x2::glyph_bit#0 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bits_2x2#2 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#7 font_2x2::l2#8 font_2x2::next_2x2_right#7 font_2x2::glyph_bits#2 font_2x2::b#2 font_2x2::glyph_bits_2x2#2 ] { } ) always clobbers reg byte a +Statement [145] (byte*) font_2x2::next_2x2_left#1 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $80*(number) 8 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#1 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#1 ] { } ) always clobbers reg byte a +Statement [146] (byte*) font_2x2::next_2x2_right#1 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $c0*(number) 8 [ font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#1 font_2x2::next_2x2_right#1 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_2x2_left#0 font_2x2::next_original#4 font_2x2::c#11 font_2x2::l#2 font_2x2::next_2x2_left#1 font_2x2::next_2x2_right#1 ] { } ) always clobbers reg byte a +Statement [150] (byte*) font_2x2::next_2x2#1 ← (byte*) font_2x2::next_2x2_left#0 + (byte) 8 [ font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2#1 ] ( main:7::font_2x2:11 [ framedone font_2x2::next_original#4 font_2x2::c#11 font_2x2::next_2x2#1 ] { } ) always clobbers reg byte a +Statement [151] (byte*) font_2x2::next_original#1 ← (byte*) font_2x2::next_original#4 + (byte) 8 [ font_2x2::c#11 font_2x2::next_2x2#1 font_2x2::next_original#1 ] ( main:7::font_2x2:11 [ framedone font_2x2::c#11 font_2x2::next_2x2#1 font_2x2::next_original#1 ] { } ) always clobbers reg byte a +Statement [158] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte y +Statement [159] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 3 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] { } ) always clobbers reg byte a +Statement [160] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] { } ) always clobbers reg byte a +Statement [162] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 [ plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte a +Statement [163] *((const nomodify byte*) RASTER) ← (byte) $28 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [164] (volatile bool) framedone ← true [ ] ( [ ] { } ) always clobbers reg byte a +Statement [165] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ ] ( [ ] { } ) always clobbers reg byte a +Statement [169] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a +Statement [170] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte x reg byte y +Statement [171] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte y +Statement [173] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte y +Statement [177] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a reg byte x reg byte y +Statement [178] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] { } ) always clobbers reg byte y +Statement [179] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] { } ) always clobbers reg byte a +Statement [180] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] { } ) always clobbers reg byte a +Statement [181] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] { } ) always clobbers reg byte y +Statement [182] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] { } ) always clobbers reg byte a +Statement [184] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] { } ) always clobbers reg byte a +Statement [185] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [191] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [192] (volatile byte) plex_sprite_msb ← (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [194] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:157 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Potential registers zp[1]:2 [ main::sprite#2 main::sprite#1 ] : zp[1]:2 , reg byte x , reg byte y , +Potential registers zp[1]:3 [ main::s#2 main::s#1 ] : zp[1]:3 , reg byte x , reg byte y , +Potential registers zp[2]:4 [ main::xp#2 main::xp#1 ] : zp[2]:4 , +Potential registers zp[1]:6 [ main::s1#2 main::s1#1 ] : zp[1]:6 , reg byte x , reg byte y , +Potential registers zp[1]:7 [ plexSort::m#2 plexSort::m#1 ] : zp[1]:7 , reg byte x , reg byte y , +Potential registers zp[1]:8 [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] : zp[1]:8 , reg byte x , reg byte y , +Potential registers zp[1]:9 [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] : zp[1]:9 , reg byte x , reg byte y , +Potential registers zp[1]:10 [ sin_idx#10 sin_idx#12 ] : zp[1]:10 , reg byte x , reg byte y , +Potential registers zp[1]:11 [ plexSine::y_idx#2 plexSine::y_idx#0 plexSine::y_idx#1 ] : zp[1]:11 , reg byte x , reg byte y , +Potential registers zp[1]:12 [ plexSine::sy#2 plexSine::sy#1 ] : zp[1]:12 , reg byte x , reg byte y , +Potential registers zp[1]:13 [ plexInit::i#2 plexInit::i#1 ] : zp[1]:13 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:14 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::c#1 ] : zp[1]:14 , reg byte x , reg byte y , +Potential registers zp[2]:15 [ font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::char_current#1 ] : zp[2]:15 , +Potential registers zp[2]:17 [ font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::sprite#1 ] : zp[2]:17 , +Potential registers zp[1]:19 [ font_2x2_to_sprites::i#2 font_2x2_to_sprites::i#1 ] : zp[1]:19 , reg byte x , reg byte y , +Potential registers zp[2]:20 [ font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_left#6 font_2x2_to_sprites::char_left#4 font_2x2_to_sprites::char_left#1 ] : zp[2]:20 , +Potential registers zp[1]:22 [ font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::sprite_idx#3 ] : zp[1]:22 , reg byte x , reg byte y , +Potential registers zp[2]:23 [ font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_right#4 font_2x2_to_sprites::char_right#1 ] : zp[2]:23 , +Potential registers zp[2]:25 [ font_2x2::next_2x2_left#0 font_2x2::next_2x2#1 ] : zp[2]:25 , +Potential registers zp[2]:27 [ font_2x2::next_original#4 font_2x2::next_original#1 ] : zp[2]:27 , +Potential registers zp[1]:29 [ font_2x2::c#11 font_2x2::c#1 ] : zp[1]:29 , reg byte x , reg byte y , +Potential registers zp[1]:30 [ font_2x2::l#2 font_2x2::l#1 ] : zp[1]:30 , reg byte x , reg byte y , +Potential registers zp[2]:31 [ font_2x2::next_2x2_left#7 font_2x2::next_2x2_left#10 font_2x2::next_2x2_left#8 font_2x2::next_2x2_left#1 ] : zp[2]:31 , +Potential registers zp[1]:33 [ font_2x2::l2#8 font_2x2::l2#9 font_2x2::l2#1 ] : zp[1]:33 , reg byte x , reg byte y , +Potential registers zp[2]:34 [ font_2x2::next_2x2_right#7 font_2x2::next_2x2_right#0 font_2x2::next_2x2_right#8 font_2x2::next_2x2_right#1 ] : zp[2]:34 , +Potential registers zp[1]:36 [ font_2x2::glyph_bits#2 font_2x2::glyph_bits#0 font_2x2::glyph_bits#1 ] : zp[1]:36 , reg byte x , reg byte y , +Potential registers zp[2]:37 [ font_2x2::glyph_bits_2x2#3 font_2x2::glyph_bits_2x2#2 ] : zp[2]:37 , +Potential registers zp[1]:39 [ font_2x2::b#2 font_2x2::b#1 ] : zp[1]:39 , reg byte x , reg byte y , +Potential registers zp[1]:40 [ font_2x2::glyph_bit#0 ] : zp[1]:40 , reg byte x , reg byte y , +Potential registers zp[1]:41 [ plex_show_idx ] : zp[1]:41 , +Potential registers zp[1]:42 [ plex_sprite_idx ] : zp[1]:42 , +Potential registers zp[1]:43 [ plex_sprite_msb ] : zp[1]:43 , +Potential registers zp[1]:44 [ plex_free_next ] : zp[1]:44 , +Potential registers zp[1]:45 [ framedone ] : zp[1]:45 , +Potential registers zp[1]:46 [ main::$12 ] : zp[1]:46 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:47 [ plexSort::nxt_idx#0 ] : zp[1]:47 , reg byte x , reg byte y , +Potential registers zp[1]:48 [ plexSort::nxt_y#0 ] : zp[1]:48 , reg byte x , reg byte y , +Potential registers zp[1]:49 [ plexSort::s#2 ] : zp[1]:49 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:50 [ font_2x2_to_sprites::$3 ] : zp[1]:50 , reg byte x , reg byte y , +Potential registers zp[1]:51 [ font_2x2_to_sprites::sprite_idx#1 ] : zp[1]:51 , reg byte x , reg byte y , +Potential registers zp[1]:52 [ font_2x2_to_sprites::sprite_idx#2 ] : zp[1]:52 , reg byte x , reg byte y , +Potential registers zp[1]:53 [ font_2x2::$1 ] : zp[1]:53 , reg byte a , reg byte x , reg byte y , +Potential registers zp[2]:54 [ font_2x2::$5 ] : zp[2]:54 , +Potential registers zp[2]:56 [ font_2x2::glyph_bits_2x2#1 ] : zp[2]:56 , +Potential registers zp[2]:58 [ font_2x2::$7 ] : zp[2]:58 , +Potential registers zp[1]:60 [ font_2x2::$12 ] : zp[1]:60 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:61 [ font_2x2::$11 ] : zp[1]:61 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:62 [ font_2x2::$15 ] : zp[1]:62 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:63 [ font_2x2::$14 ] : zp[1]:63 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:64 [ plex_irq::plexFreeNextYpos1_return#0 ] : zp[1]:64 , reg byte x , reg byte y , +Potential registers zp[1]:65 [ plex_irq::$4 ] : zp[1]:65 , reg byte x , reg byte y , +Potential registers zp[1]:66 [ plexShowSprite::plex_sprite_idx2#0 ] : zp[1]:66 , +Potential registers zp[1]:67 [ plexShowSprite::plexFreeAdd1_ypos#0 ] : zp[1]:67 , reg byte a , reg byte x , +Potential registers zp[1]:68 [ plexShowSprite::plexFreeAdd1_$0 ] : zp[1]:68 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:69 [ plexShowSprite::plexFreeAdd1_$1 ] : zp[1]:69 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:70 [ plexShowSprite::plexFreeAdd1_$2 ] : zp[1]:70 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:71 [ plexShowSprite::xpos_idx#0 ] : zp[1]:71 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:72 [ plexShowSprite::$11 ] : zp[1]:72 , reg byte x , +Potential registers zp[1]:73 [ plexShowSprite::$2 ] : zp[1]:73 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:74 [ plexShowSprite::$3 ] : zp[1]:74 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:75 [ plexShowSprite::$9 ] : zp[1]:75 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:76 [ plexShowSprite::$5 ] : zp[1]:76 , reg byte a , reg byte x , reg byte y , +Potential registers zp[1]:77 [ plexShowSprite::$6 ] : zp[1]:77 , reg byte a , reg byte x , reg byte y , + +REGISTER UPLIFT SCOPES +Uplift Scope [plexSort] 3,616,672.83: zp[1]:8 [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] 300,003: zp[1]:9 [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] 200,002: zp[1]:49 [ plexSort::s#2 ] 191,668.58: zp[1]:7 [ plexSort::m#2 plexSort::m#1 ] 150,000.38: zp[1]:48 [ plexSort::nxt_y#0 ] 30,000.3: zp[1]:47 [ plexSort::nxt_idx#0 ] +Uplift Scope [font_2x2] 200,002: zp[1]:53 [ font_2x2::$1 ] 200,002: zp[2]:54 [ font_2x2::$5 ] 200,002: zp[2]:56 [ font_2x2::glyph_bits_2x2#1 ] 200,002: zp[2]:58 [ font_2x2::$7 ] 170,001.7: zp[1]:39 [ font_2x2::b#2 font_2x2::b#1 ] 121,114.22: zp[1]:36 [ font_2x2::glyph_bits#2 font_2x2::glyph_bits#0 font_2x2::glyph_bits#1 ] 67,500.9: zp[2]:37 [ font_2x2::glyph_bits_2x2#3 font_2x2::glyph_bits_2x2#2 ] 50,000.5: zp[1]:40 [ font_2x2::glyph_bit#0 ] 32,712.54: zp[2]:34 [ font_2x2::next_2x2_right#7 font_2x2::next_2x2_right#0 font_2x2::next_2x2_right#8 font_2x2::next_2x2_right#1 ] 24,396.38: zp[1]:33 [ font_2x2::l2#8 font_2x2::l2#9 font_2x2::l2#1 ] 23,712.54: zp[2]:31 [ font_2x2::next_2x2_left#7 font_2x2::next_2x2_left#10 font_2x2::next_2x2_left#8 font_2x2::next_2x2_left#1 ] 20,002: zp[1]:61 [ font_2x2::$11 ] 20,002: zp[1]:63 [ font_2x2::$14 ] 16,112.72: zp[1]:30 [ font_2x2::l#2 font_2x2::l#1 ] 10,001: zp[1]:60 [ font_2x2::$12 ] 10,001: zp[1]:62 [ font_2x2::$15 ] 1,560.38: zp[1]:29 [ font_2x2::c#11 font_2x2::c#1 ] 1,250.69: zp[2]:25 [ font_2x2::next_2x2_left#0 font_2x2::next_2x2#1 ] 1,031.06: zp[2]:27 [ font_2x2::next_original#4 font_2x2::next_original#1 ] +Uplift Scope [plexSine] 250,002.5: zp[1]:12 [ plexSine::sy#2 plexSine::sy#1 ] 219,171.33: zp[1]:11 [ plexSine::y_idx#2 plexSine::y_idx#0 plexSine::y_idx#1 ] +Uplift Scope [font_2x2_to_sprites] 33,822.55: zp[2]:23 [ font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_right#4 font_2x2_to_sprites::char_right#1 ] 24,822.55: zp[2]:20 [ font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_left#6 font_2x2_to_sprites::char_left#4 font_2x2_to_sprites::char_left#1 ] 18,573.29: zp[1]:19 [ font_2x2_to_sprites::i#2 font_2x2_to_sprites::i#1 ] 15,001.5: zp[1]:51 [ font_2x2_to_sprites::sprite_idx#1 ] 15,001.5: zp[1]:52 [ font_2x2_to_sprites::sprite_idx#2 ] 12,223.44: zp[1]:22 [ font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::sprite_idx#3 ] 10,001: zp[1]:50 [ font_2x2_to_sprites::$3 ] 2,525.05: zp[2]:17 [ font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::sprite#1 ] 2,138.5: zp[1]:14 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::c#1 ] 1,867.63: zp[2]:15 [ font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::char_current#1 ] +Uplift Scope [plexInit] 3,503.5: zp[1]:13 [ plexInit::i#2 plexInit::i#1 ] +Uplift Scope [plexShowSprite] 202: zp[1]:68 [ plexShowSprite::plexFreeAdd1_$0 ] 202: zp[1]:69 [ plexShowSprite::plexFreeAdd1_$1 ] 202: zp[1]:70 [ plexShowSprite::plexFreeAdd1_$2 ] 202: zp[1]:71 [ plexShowSprite::xpos_idx#0 ] 202: zp[1]:73 [ plexShowSprite::$2 ] 202: zp[1]:74 [ plexShowSprite::$3 ] 202: zp[1]:75 [ plexShowSprite::$9 ] 202: zp[1]:76 [ plexShowSprite::$5 ] 202: zp[1]:77 [ plexShowSprite::$6 ] 151.5: zp[1]:67 [ plexShowSprite::plexFreeAdd1_ypos#0 ] 101: zp[1]:72 [ plexShowSprite::$11 ] 25.25: zp[1]:66 [ plexShowSprite::plex_sprite_idx2#0 ] +Uplift Scope [main] 303: zp[1]:6 [ main::s1#2 main::s1#1 ] 218.83: zp[1]:3 [ main::s#2 main::s#1 ] 202: zp[1]:46 [ main::$12 ] 185.17: zp[1]:2 [ main::sprite#2 main::sprite#1 ] 127.93: zp[2]:4 [ main::xp#2 main::xp#1 ] +Uplift Scope [] 358.43: zp[1]:10 [ sin_idx#10 sin_idx#12 ] 48.76: zp[1]:43 [ plex_sprite_msb ] 46.09: zp[1]:41 [ plex_show_idx ] 45.39: zp[1]:42 [ plex_sprite_idx ] 42.48: zp[1]:44 [ plex_free_next ] 27.65: zp[1]:45 [ framedone ] +Uplift Scope [plex_irq] 11: zp[1]:65 [ plex_irq::$4 ] 4.8: zp[1]:64 [ plex_irq::plexFreeNextYpos1_return#0 ] + +Uplifting [plexSort] best 237905 combination reg byte x [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] reg byte x [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] reg byte x [ plexSort::s#2 ] zp[1]:7 [ plexSort::m#2 plexSort::m#1 ] zp[1]:48 [ plexSort::nxt_y#0 ] zp[1]:47 [ plexSort::nxt_idx#0 ] +Limited combination testing to 100 combinations of 972 possible. +Uplifting [font_2x2] best 214905 combination reg byte a [ font_2x2::$1 ] zp[2]:54 [ font_2x2::$5 ] zp[2]:56 [ font_2x2::glyph_bits_2x2#1 ] zp[2]:58 [ font_2x2::$7 ] reg byte y [ font_2x2::b#2 font_2x2::b#1 ] zp[1]:36 [ font_2x2::glyph_bits#2 font_2x2::glyph_bits#0 font_2x2::glyph_bits#1 ] zp[2]:37 [ font_2x2::glyph_bits_2x2#3 font_2x2::glyph_bits_2x2#2 ] reg byte x [ font_2x2::glyph_bit#0 ] zp[2]:34 [ font_2x2::next_2x2_right#7 font_2x2::next_2x2_right#0 font_2x2::next_2x2_right#8 font_2x2::next_2x2_right#1 ] zp[1]:33 [ font_2x2::l2#8 font_2x2::l2#9 font_2x2::l2#1 ] zp[2]:31 [ font_2x2::next_2x2_left#7 font_2x2::next_2x2_left#10 font_2x2::next_2x2_left#8 font_2x2::next_2x2_left#1 ] zp[1]:61 [ font_2x2::$11 ] zp[1]:63 [ font_2x2::$14 ] zp[1]:30 [ font_2x2::l#2 font_2x2::l#1 ] zp[1]:60 [ font_2x2::$12 ] zp[1]:62 [ font_2x2::$15 ] zp[1]:29 [ font_2x2::c#11 font_2x2::c#1 ] zp[2]:25 [ font_2x2::next_2x2_left#0 font_2x2::next_2x2#1 ] zp[2]:27 [ font_2x2::next_original#4 font_2x2::next_original#1 ] +Limited combination testing to 100 combinations of 746496 possible. +Uplifting [plexSine] best 213002 combination reg byte y [ plexSine::sy#2 plexSine::sy#1 ] reg byte x [ plexSine::y_idx#2 plexSine::y_idx#0 plexSine::y_idx#1 ] +Uplifting [font_2x2_to_sprites] best 210302 combination zp[2]:23 [ font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_right#4 font_2x2_to_sprites::char_right#1 ] zp[2]:20 [ font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_left#6 font_2x2_to_sprites::char_left#4 font_2x2_to_sprites::char_left#1 ] reg byte x [ font_2x2_to_sprites::i#2 font_2x2_to_sprites::i#1 ] zp[1]:51 [ font_2x2_to_sprites::sprite_idx#1 ] reg byte y [ font_2x2_to_sprites::sprite_idx#2 ] zp[1]:22 [ font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::sprite_idx#3 ] zp[1]:50 [ font_2x2_to_sprites::$3 ] zp[2]:17 [ font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::sprite#1 ] zp[1]:14 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::c#1 ] zp[2]:15 [ font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::char_current#1 ] +Limited combination testing to 100 combinations of 729 possible. +Uplifting [plexInit] best 210182 combination reg byte x [ plexInit::i#2 plexInit::i#1 ] +Uplifting [plexShowSprite] best 210162 combination reg byte a [ plexShowSprite::plexFreeAdd1_$0 ] reg byte a [ plexShowSprite::plexFreeAdd1_$1 ] reg byte a [ plexShowSprite::plexFreeAdd1_$2 ] reg byte a [ plexShowSprite::xpos_idx#0 ] zp[1]:73 [ plexShowSprite::$2 ] zp[1]:74 [ plexShowSprite::$3 ] zp[1]:75 [ plexShowSprite::$9 ] zp[1]:76 [ plexShowSprite::$5 ] zp[1]:77 [ plexShowSprite::$6 ] zp[1]:67 [ plexShowSprite::plexFreeAdd1_ypos#0 ] zp[1]:72 [ plexShowSprite::$11 ] zp[1]:66 [ plexShowSprite::plex_sprite_idx2#0 ] +Limited combination testing to 100 combinations of 1572864 possible. +Uplifting [main] best 209872 combination reg byte x [ main::s1#2 main::s1#1 ] reg byte x [ main::s#2 main::s#1 ] reg byte a [ main::$12 ] zp[1]:2 [ main::sprite#2 main::sprite#1 ] zp[2]:4 [ main::xp#2 main::xp#1 ] +Limited combination testing to 100 combinations of 108 possible. +Uplifting [] best 209872 combination zp[1]:10 [ sin_idx#10 sin_idx#12 ] zp[1]:43 [ plex_sprite_msb ] zp[1]:41 [ plex_show_idx ] zp[1]:42 [ plex_sprite_idx ] zp[1]:44 [ plex_free_next ] zp[1]:45 [ framedone ] +Uplifting [plex_irq] best 209809 combination zp[1]:65 [ plex_irq::$4 ] reg byte x [ plex_irq::plexFreeNextYpos1_return#0 ] +Attempting to uplift remaining variables inzp[1]:7 [ plexSort::m#2 plexSort::m#1 ] +Uplifting [plexSort] best 209809 combination zp[1]:7 [ plexSort::m#2 plexSort::m#1 ] +Attempting to uplift remaining variables inzp[1]:48 [ plexSort::nxt_y#0 ] +Uplifting [plexSort] best 209809 combination zp[1]:48 [ plexSort::nxt_y#0 ] +Attempting to uplift remaining variables inzp[1]:36 [ font_2x2::glyph_bits#2 font_2x2::glyph_bits#0 font_2x2::glyph_bits#1 ] +Uplifting [font_2x2] best 209809 combination zp[1]:36 [ font_2x2::glyph_bits#2 font_2x2::glyph_bits#0 font_2x2::glyph_bits#1 ] +Attempting to uplift remaining variables inzp[1]:47 [ plexSort::nxt_idx#0 ] +Uplifting [plexSort] best 209809 combination zp[1]:47 [ plexSort::nxt_idx#0 ] +Attempting to uplift remaining variables inzp[1]:33 [ font_2x2::l2#8 font_2x2::l2#9 font_2x2::l2#1 ] +Uplifting [font_2x2] best 209809 combination zp[1]:33 [ font_2x2::l2#8 font_2x2::l2#9 font_2x2::l2#1 ] +Attempting to uplift remaining variables inzp[1]:61 [ font_2x2::$11 ] +Uplifting [font_2x2] best 209209 combination reg byte y [ font_2x2::$11 ] +Attempting to uplift remaining variables inzp[1]:63 [ font_2x2::$14 ] +Uplifting [font_2x2] best 208609 combination reg byte y [ font_2x2::$14 ] +Attempting to uplift remaining variables inzp[1]:30 [ font_2x2::l#2 font_2x2::l#1 ] +Uplifting [font_2x2] best 208609 combination zp[1]:30 [ font_2x2::l#2 font_2x2::l#1 ] +Attempting to uplift remaining variables inzp[1]:51 [ font_2x2_to_sprites::sprite_idx#1 ] +Uplifting [font_2x2_to_sprites] best 208609 combination zp[1]:51 [ font_2x2_to_sprites::sprite_idx#1 ] +Attempting to uplift remaining variables inzp[1]:22 [ font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::sprite_idx#3 ] +Uplifting [font_2x2_to_sprites] best 208609 combination zp[1]:22 [ font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::sprite_idx#3 ] +Attempting to uplift remaining variables inzp[1]:50 [ font_2x2_to_sprites::$3 ] +Uplifting [font_2x2_to_sprites] best 208609 combination zp[1]:50 [ font_2x2_to_sprites::$3 ] +Attempting to uplift remaining variables inzp[1]:60 [ font_2x2::$12 ] +Uplifting [font_2x2] best 207709 combination reg byte a [ font_2x2::$12 ] +Attempting to uplift remaining variables inzp[1]:62 [ font_2x2::$15 ] +Uplifting [font_2x2] best 206809 combination reg byte a [ font_2x2::$15 ] +Attempting to uplift remaining variables inzp[1]:14 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::c#1 ] +Uplifting [font_2x2_to_sprites] best 206809 combination zp[1]:14 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::c#1 ] +Attempting to uplift remaining variables inzp[1]:29 [ font_2x2::c#11 font_2x2::c#1 ] +Uplifting [font_2x2] best 206809 combination zp[1]:29 [ font_2x2::c#11 font_2x2::c#1 ] +Attempting to uplift remaining variables inzp[1]:10 [ sin_idx#10 sin_idx#12 ] +Uplifting [] best 206809 combination zp[1]:10 [ sin_idx#10 sin_idx#12 ] +Attempting to uplift remaining variables inzp[1]:73 [ plexShowSprite::$2 ] +Uplifting [plexShowSprite] best 206803 combination reg byte a [ plexShowSprite::$2 ] +Attempting to uplift remaining variables inzp[1]:74 [ plexShowSprite::$3 ] +Uplifting [plexShowSprite] best 206797 combination reg byte a [ plexShowSprite::$3 ] +Attempting to uplift remaining variables inzp[1]:75 [ plexShowSprite::$9 ] +Uplifting [plexShowSprite] best 206791 combination reg byte a [ plexShowSprite::$9 ] +Attempting to uplift remaining variables inzp[1]:76 [ plexShowSprite::$5 ] +Uplifting [plexShowSprite] best 206785 combination reg byte x [ plexShowSprite::$5 ] +Attempting to uplift remaining variables inzp[1]:77 [ plexShowSprite::$6 ] +Uplifting [plexShowSprite] best 206781 combination reg byte a [ plexShowSprite::$6 ] +Attempting to uplift remaining variables inzp[1]:2 [ main::sprite#2 main::sprite#1 ] +Uplifting [main] best 206781 combination zp[1]:2 [ main::sprite#2 main::sprite#1 ] +Attempting to uplift remaining variables inzp[1]:67 [ plexShowSprite::plexFreeAdd1_ypos#0 ] +Uplifting [plexShowSprite] best 206772 combination reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ] +Attempting to uplift remaining variables inzp[1]:72 [ plexShowSprite::$11 ] +Uplifting [plexShowSprite] best 206765 combination reg byte x [ plexShowSprite::$11 ] +Attempting to uplift remaining variables inzp[1]:43 [ plex_sprite_msb ] +Uplifting [] best 206765 combination zp[1]:43 [ plex_sprite_msb ] +Attempting to uplift remaining variables inzp[1]:41 [ plex_show_idx ] +Uplifting [] best 206765 combination zp[1]:41 [ plex_show_idx ] +Attempting to uplift remaining variables inzp[1]:42 [ plex_sprite_idx ] +Uplifting [] best 206765 combination zp[1]:42 [ plex_sprite_idx ] +Attempting to uplift remaining variables inzp[1]:44 [ plex_free_next ] +Uplifting [] best 206765 combination zp[1]:44 [ plex_free_next ] +Attempting to uplift remaining variables inzp[1]:45 [ framedone ] +Uplifting [] best 206765 combination zp[1]:45 [ framedone ] +Attempting to uplift remaining variables inzp[1]:66 [ plexShowSprite::plex_sprite_idx2#0 ] +Uplifting [plexShowSprite] best 206765 combination zp[1]:66 [ plexShowSprite::plex_sprite_idx2#0 ] +Attempting to uplift remaining variables inzp[1]:65 [ plex_irq::$4 ] +Uplifting [plex_irq] best 206765 combination zp[1]:65 [ plex_irq::$4 ] +Coalescing zero page register [ zp[1]:22 [ font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::sprite_idx#3 ] ] with [ zp[1]:51 [ font_2x2_to_sprites::sprite_idx#1 ] ] - score: 1 +Coalescing zero page register [ zp[2]:37 [ font_2x2::glyph_bits_2x2#3 font_2x2::glyph_bits_2x2#2 ] ] with [ zp[2]:54 [ font_2x2::$5 ] ] - score: 1 +Coalescing zero page register [ zp[2]:37 [ font_2x2::glyph_bits_2x2#3 font_2x2::glyph_bits_2x2#2 font_2x2::$5 ] ] with [ zp[2]:58 [ font_2x2::$7 ] ] - score: 1 +Coalescing zero page register [ zp[2]:37 [ font_2x2::glyph_bits_2x2#3 font_2x2::glyph_bits_2x2#2 font_2x2::$5 font_2x2::$7 ] ] with [ zp[2]:56 [ font_2x2::glyph_bits_2x2#1 ] ] - score: 2 +Coalescing zero page register [ zp[1]:10 [ sin_idx#10 sin_idx#12 ] ] with [ zp[1]:2 [ main::sprite#2 main::sprite#1 ] ] +Coalescing zero page register [ zp[1]:14 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::c#1 ] ] with [ zp[1]:7 [ plexSort::m#2 plexSort::m#1 ] ] +Coalescing zero page register [ zp[2]:25 [ font_2x2::next_2x2_left#0 font_2x2::next_2x2#1 ] ] with [ zp[2]:15 [ font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::char_current#1 ] ] +Coalescing zero page register [ zp[2]:27 [ font_2x2::next_original#4 font_2x2::next_original#1 ] ] with [ zp[2]:17 [ font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::sprite#1 ] ] +Coalescing zero page register [ zp[1]:29 [ font_2x2::c#11 font_2x2::c#1 ] ] with [ zp[1]:22 [ font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::sprite_idx#3 font_2x2_to_sprites::sprite_idx#1 ] ] +Coalescing zero page register [ zp[2]:31 [ font_2x2::next_2x2_left#7 font_2x2::next_2x2_left#10 font_2x2::next_2x2_left#8 font_2x2::next_2x2_left#1 ] ] with [ zp[2]:20 [ font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_left#6 font_2x2_to_sprites::char_left#4 font_2x2_to_sprites::char_left#1 ] ] +Coalescing zero page register [ zp[2]:34 [ font_2x2::next_2x2_right#7 font_2x2::next_2x2_right#0 font_2x2::next_2x2_right#8 font_2x2::next_2x2_right#1 ] ] with [ zp[2]:23 [ font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_right#4 font_2x2_to_sprites::char_right#1 ] ] +Coalescing zero page register [ zp[1]:47 [ plexSort::nxt_idx#0 ] ] with [ zp[1]:30 [ font_2x2::l#2 font_2x2::l#1 ] ] +Coalescing zero page register [ zp[1]:48 [ plexSort::nxt_y#0 ] ] with [ zp[1]:33 [ font_2x2::l2#8 font_2x2::l2#9 font_2x2::l2#1 ] ] +Coalescing zero page register [ zp[1]:50 [ font_2x2_to_sprites::$3 ] ] with [ zp[1]:36 [ font_2x2::glyph_bits#2 font_2x2::glyph_bits#0 font_2x2::glyph_bits#1 ] ] +Allocated (was zp[2]:4) zp[2]:2 [ main::xp#2 main::xp#1 ] +Allocated (was zp[1]:10) zp[1]:4 [ sin_idx#10 sin_idx#12 main::sprite#2 main::sprite#1 ] +Allocated (was zp[1]:14) zp[1]:5 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::c#1 plexSort::m#2 plexSort::m#1 ] +Allocated (was zp[2]:25) zp[2]:6 [ font_2x2::next_2x2_left#0 font_2x2::next_2x2#1 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::char_current#1 ] +Allocated (was zp[2]:27) zp[2]:8 [ font_2x2::next_original#4 font_2x2::next_original#1 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::sprite#1 ] +Allocated (was zp[1]:29) zp[1]:10 [ font_2x2::c#11 font_2x2::c#1 font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::sprite_idx#3 font_2x2_to_sprites::sprite_idx#1 ] +Allocated (was zp[2]:31) zp[2]:11 [ font_2x2::next_2x2_left#7 font_2x2::next_2x2_left#10 font_2x2::next_2x2_left#8 font_2x2::next_2x2_left#1 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_left#6 font_2x2_to_sprites::char_left#4 font_2x2_to_sprites::char_left#1 ] +Allocated (was zp[2]:34) zp[2]:13 [ font_2x2::next_2x2_right#7 font_2x2::next_2x2_right#0 font_2x2::next_2x2_right#8 font_2x2::next_2x2_right#1 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_right#4 font_2x2_to_sprites::char_right#1 ] +Allocated (was zp[2]:37) zp[2]:15 [ font_2x2::glyph_bits_2x2#3 font_2x2::glyph_bits_2x2#2 font_2x2::$5 font_2x2::$7 font_2x2::glyph_bits_2x2#1 ] +Allocated (was zp[1]:41) zp[1]:17 [ plex_show_idx ] +Allocated (was zp[1]:42) zp[1]:18 [ plex_sprite_idx ] +Allocated (was zp[1]:43) zp[1]:19 [ plex_sprite_msb ] +Allocated (was zp[1]:44) zp[1]:20 [ plex_free_next ] +Allocated (was zp[1]:45) zp[1]:21 [ framedone ] +Allocated (was zp[1]:47) zp[1]:22 [ plexSort::nxt_idx#0 font_2x2::l#2 font_2x2::l#1 ] +Allocated (was zp[1]:48) zp[1]:23 [ plexSort::nxt_y#0 font_2x2::l2#8 font_2x2::l2#9 font_2x2::l2#1 ] +Allocated (was zp[1]:50) zp[1]:24 [ font_2x2_to_sprites::$3 font_2x2::glyph_bits#2 font_2x2::glyph_bits#0 font_2x2::glyph_bits#1 ] +Allocated (was zp[1]:65) zp[1]:25 [ plex_irq::$4 ] +Allocated (was zp[1]:66) zp[1]:26 [ plexShowSprite::plex_sprite_idx2#0 ] + +ASSEMBLER BEFORE OPTIMIZATION + // File Comments +// Put a 2x2 font into sprites and show it on screen + // Upstart +.pc = $801 "Basic" +:BasicUpstart(__bbegin) +.pc = $80d "Program" + // Global Constants & labels + // Processor Port Register controlling RAM/ROM configuration and the datasette + .label PROCPORT = 1 + // RAM in $A000, $E000 CHAR ROM in $D000 + .const PROCPORT_RAM_CHARROM = 1 + // BASIC in $A000, I/O in $D000, KERNEL in $E000 + .const PROCPORT_BASIC_KERNEL_IO = 7 + // The address of the CHARGEN character set + .label CHARGEN = $d000 + .label SPRITES_XPOS = $d000 + .label SPRITES_YPOS = $d001 + .label SPRITES_XMSB = $d010 + .label RASTER = $d012 + .label SPRITES_ENABLE = $d015 + .label SPRITES_COLS = $d027 + .label VIC_CONTROL = $d011 + .label D018 = $d018 + // VIC II IRQ Status Register + .label IRQ_STATUS = $d019 + // VIC II IRQ Enable Register + .label IRQ_ENABLE = $d01a + // Bits for the IRQ Status/Enable Registers + .const IRQ_RASTER = 1 + // CIA#1 Interrupt Status & Control Register + .label CIA1_INTERRUPT = $dc0d + // Value that disables all CIA interrupts when stored to the CIA Interrupt registers + .const CIA_INTERRUPT_CLEAR = $7f + // The vector used when the KERNAL serves IRQ interrupts + .label KERNEL_IRQ = $314 + .const WHITE = 1 + // The number of sprites in the multiplexer + .const PLEX_COUNT = $20 + .label CHARSET_DEFAULT = $1000 + .label FONT = $2000 + .label SPRITES = $3000 + .label SCREEN = $400 + // The address of the sprite pointers on the current screen (screen+0x3f8). + .label PLEX_SCREEN_PTR = $400+$3f8 + .label plex_show_idx = $11 + .label plex_sprite_idx = $12 + .label plex_sprite_msb = $13 + .label plex_free_next = $14 + .label framedone = $15 + // Y-sine index + .label sin_idx = 4 + // @begin +__bbegin: + jmp __b1 + // @1 +__b1: + // [1] (volatile byte) plex_show_idx ← (byte) 0 -- vbuz1=vbuc1 + // The index in the PLEX tables of the next sprite to show + lda #0 + sta.z plex_show_idx + // [2] (volatile byte) plex_sprite_idx ← (byte) 0 -- vbuz1=vbuc1 + // The index the next sprite to use for showing (sprites are used round-robin) + lda #0 + sta.z plex_sprite_idx + // [3] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 + // The MSB bit of the next sprite to use for showing + lda #1 + sta.z plex_sprite_msb + jmp __b2 + // @2 +__b2: + // [4] (volatile byte) plex_free_next ← (byte) 0 -- vbuz1=vbuc1 + // The index of the sprite that is free next. Since sprites are used round-robin this moves forward each time a sprite is shown. + lda #0 + sta.z plex_free_next + jmp __b3 + // @3 +__b3: + // [5] (volatile bool) framedone ← false -- vboz1=vboc1 + lda #0 + sta.z framedone + // [6] phi from @3 to @4 [phi:@3->@4] +__b4_from___b3: + jmp __b4 + // @4 +__b4: + // [7] call main + jsr main + // [8] phi from @4 to @end [phi:@4->@end] +__bend_from___b4: + jmp __bend + // @end +__bend: + // main +main: { + .const toSpritePtr1_return = SPRITES/$40 + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET_DEFAULT)/4&$f + .label sprite = 4 + // Set the x-positions & pointers + .label xp = 2 + // asm { sei } + // Create 2x2 font from CHARGEN + sei + // [10] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_CHARROM -- _deref_pbuc1=vbuc2 + lda #PROCPORT_RAM_CHARROM + sta PROCPORT + // [11] call font_2x2 + // [117] phi from main to font_2x2 [phi:main->font_2x2] + font_2x2_from_main: + jsr font_2x2 + jmp __b8 + // main::@8 + __b8: + // [12] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_BASIC_KERNEL_IO -- _deref_pbuc1=vbuc2 + lda #PROCPORT_BASIC_KERNEL_IO + sta PROCPORT + // asm { cli } + cli + // [14] call font_2x2_to_sprites + // Convert font to sprites + // [92] phi from main::@8 to font_2x2_to_sprites [phi:main::@8->font_2x2_to_sprites] + font_2x2_to_sprites_from___b8: + jsr font_2x2_to_sprites + // [15] phi from main::@8 to main::@9 [phi:main::@8->main::@9] + __b9_from___b8: + jmp __b9 + // main::@9 + __b9: + // [16] call plexInit + // Initialize the multiplexer + // [85] phi from main::@9 to plexInit [phi:main::@9->plexInit] + plexInit_from___b9: + jsr plexInit + // [17] phi from main::@9 to main::toD0181 [phi:main::@9->main::toD0181] + toD0181_from___b9: + jmp toD0181 + // main::toD0181 + toD0181: + jmp __b7 + // main::@7 + __b7: + // [18] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 + // Show screen + lda #toD0181_return + sta D018 + // [19] phi from main::@7 to main::toSpritePtr1 [phi:main::@7->main::toSpritePtr1] + toSpritePtr1_from___b7: + jmp toSpritePtr1 + // main::toSpritePtr1 + toSpritePtr1: + // [20] phi from main::toSpritePtr1 to main::@1 [phi:main::toSpritePtr1->main::@1] + __b1_from_toSpritePtr1: + // [20] phi (word) main::xp#2 = (word) $18 [phi:main::toSpritePtr1->main::@1#0] -- vwuz1=vwuc1 + lda #<$18 + sta.z xp + lda #>$18 + sta.z xp+1 + // [20] phi (byte) main::s#2 = (byte) 0 [phi:main::toSpritePtr1->main::@1#1] -- vbuxx=vbuc1 + ldx #0 + // [20] phi (byte) main::sprite#2 = (const byte) main::toSpritePtr1_return#0 [phi:main::toSpritePtr1->main::@1#2] -- vbuz1=vbuc1 + lda #toSpritePtr1_return + sta.z sprite + jmp __b1 + // [20] phi from main::@1 to main::@1 [phi:main::@1->main::@1] + __b1_from___b1: + // [20] phi (word) main::xp#2 = (word) main::xp#1 [phi:main::@1->main::@1#0] -- register_copy + // [20] phi (byte) main::s#2 = (byte) main::s#1 [phi:main::@1->main::@1#1] -- register_copy + // [20] phi (byte) main::sprite#2 = (byte) main::sprite#1 [phi:main::@1->main::@1#2] -- register_copy + jmp __b1 + // main::@1 + __b1: + // [21] *((const byte*) PLEX_PTR + (byte) main::s#2) ← (byte) main::sprite#2 -- pbuc1_derefidx_vbuxx=vbuz1 + lda.z sprite + sta PLEX_PTR,x + // [22] (byte) main::sprite#1 ← ++ (byte) main::sprite#2 -- vbuz1=_inc_vbuz1 + inc.z sprite + // [23] (byte~) main::$12 ← (byte) main::s#2 << (byte) 1 -- vbuaa=vbuxx_rol_1 + txa + asl + // [24] *((const word*) PLEX_XPOS + (byte~) main::$12) ← (word) main::xp#2 -- pwuc1_derefidx_vbuaa=vwuz1 + tay + lda.z xp + sta PLEX_XPOS,y + lda.z xp+1 + sta PLEX_XPOS+1,y + // [25] (word) main::xp#1 ← (word) main::xp#2 + (byte) $a -- vwuz1=vwuz1_plus_vbuc1 + lda #$a + clc + adc.z xp + sta.z xp + bcc !+ + inc.z xp+1 + !: + // [26] (byte) main::s#1 ← ++ (byte) main::s#2 -- vbuxx=_inc_vbuxx + inx + // [27] if((byte) main::s#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 + cpx #PLEX_COUNT-1+1 + bne __b1_from___b1 + jmp __b2 + // main::@2 + __b2: + // [28] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2 + // Enable & initialize sprites + lda #$ff + sta SPRITES_ENABLE + // [29] phi from main::@2 to main::@3 [phi:main::@2->main::@3] + __b3_from___b2: + // [29] phi (byte) main::s1#2 = (byte) 0 [phi:main::@2->main::@3#0] -- vbuxx=vbuc1 + ldx #0 + jmp __b3 + // [29] phi from main::@3 to main::@3 [phi:main::@3->main::@3] + __b3_from___b3: + // [29] phi (byte) main::s1#2 = (byte) main::s1#1 [phi:main::@3->main::@3#0] -- register_copy + jmp __b3 + // main::@3 + __b3: + // [30] *((const nomodify byte*) SPRITES_COLS + (byte) main::s1#2) ← (const nomodify byte) WHITE -- pbuc1_derefidx_vbuxx=vbuc2 + lda #WHITE + sta SPRITES_COLS,x + // [31] (byte) main::s1#1 ← ++ (byte) main::s1#2 -- vbuxx=_inc_vbuxx + inx + // [32] if((byte) main::s1#1!=(byte) 8) goto main::@3 -- vbuxx_neq_vbuc1_then_la1 + cpx #8 + bne __b3_from___b3 + // [33] phi from main::@3 to main::@4 [phi:main::@3->main::@4] + __b4_from___b3: + jmp __b4 + // main::@4 + __b4: + // [34] call plexSine + // Move the sprites + // [76] phi from main::@4 to plexSine [phi:main::@4->plexSine] + plexSine_from___b4: + // [76] phi (byte) sin_idx#10 = (byte) 0 [phi:main::@4->plexSine#0] -- vbuz1=vbuc1 + lda #0 + sta.z sin_idx + jsr plexSine + // [35] phi from main::@4 to main::@10 [phi:main::@4->main::@10] + __b10_from___b4: + jmp __b10 + // main::@10 + __b10: + // [36] call plexSort + // Sort the sprites by y-position + // [51] phi from main::@10 to plexSort [phi:main::@10->plexSort] + plexSort_from___b10: + jsr plexSort + jmp __b11 + // main::@11 + __b11: + // asm { sei } + // Enable the plex IRQ + sei + // [38] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 + // Disable CIA 1 Timer IRQ + lda #CIA_INTERRUPT_CLEAR + sta CIA1_INTERRUPT + // [39] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // Set raster line to 0x00 + lda #$7f + and VIC_CONTROL + sta VIC_CONTROL + // [40] *((const nomodify byte*) RASTER) ← (byte) $28 -- _deref_pbuc1=vbuc2 + lda #$28 + sta RASTER + // [41] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // Enable Raster Interrupt + lda #IRQ_RASTER + sta IRQ_ENABLE + // [42] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // Acknowledge any IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + // [43] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() -- _deref_pptc1=pprc2 + // Set the IRQ routine + lda #plex_irq + sta KERNEL_IRQ+1 + // asm { cli } + cli + jmp __b5 + // main::@5 + __b5: + // [45] if((volatile bool) framedone) goto main::@6 -- vboz1_then_la1 + lda.z framedone + cmp #0 + bne __b6_from___b5 + jmp __b5 + // [46] phi from main::@5 to main::@6 [phi:main::@5->main::@6] + __b6_from___b5: + jmp __b6 + // main::@6 + __b6: + // [47] call plexSine + //*BORDERCOL = RED; + // Move the sprites + // [76] phi from main::@6 to plexSine [phi:main::@6->plexSine] + plexSine_from___b6: + // [76] phi (byte) sin_idx#10 = (byte) sin_idx#12 [phi:main::@6->plexSine#0] -- register_copy + jsr plexSine + // [48] phi from main::@6 to main::@12 [phi:main::@6->main::@12] + __b12_from___b6: + jmp __b12 + // main::@12 + __b12: + // [49] call plexSort + // Sort the sprites by y-position + // [51] phi from main::@12 to plexSort [phi:main::@12->plexSort] + plexSort_from___b12: + jsr plexSort + jmp __b13 + // main::@13 + __b13: + // [50] (volatile bool) framedone ← false -- vboz1=vboc1 + //*BORDERCOL = GREEN; + lda #0 + sta.z framedone + jmp __b5 +} + // plexSort +// Ensure that the indices in PLEX_SORTED_IDX is sorted based on the y-positions in PLEX_YPOS +// Assumes that the positions are nearly sorted already (as each sprite just moves a bit) +// Uses an insertion sort: +// 1. Moves a marker (m) from the start to end of the array. Every time the marker moves forward all elements before the marker are sorted correctly. +// 2a. If the next element after the marker is larger that the current element +// the marker can be moved forwards (as the sorting is correct). +// 2b. If the next element after the marker is smaller than the current element: +// elements before the marker are shifted right one at a time until encountering one smaller than the current one. +// It is then inserted at the spot. Now the marker can move forward. +plexSort: { + .label nxt_idx = $16 + .label nxt_y = $17 + .label m = 5 + // [52] phi from plexSort to plexSort::@1 [phi:plexSort->plexSort::@1] + __b1_from_plexSort: + // [52] phi (byte) plexSort::m#2 = (byte) 0 [phi:plexSort->plexSort::@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z m + jmp __b1 + // [52] phi from plexSort::@2 to plexSort::@1 [phi:plexSort::@2->plexSort::@1] + __b1_from___b2: + // [52] phi (byte) plexSort::m#2 = (byte) plexSort::m#1 [phi:plexSort::@2->plexSort::@1#0] -- register_copy + jmp __b1 + // plexSort::@1 + __b1: + // [53] (byte) plexSort::nxt_idx#0 ← *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2) -- vbuz1=pbuc1_derefidx_vbuz2 + ldy.z m + lda PLEX_SORTED_IDX+1,y + sta.z nxt_idx + // [54] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0) -- vbuz1=pbuc1_derefidx_vbuz2 + ldy.z nxt_idx + lda PLEX_YPOS,y + sta.z nxt_y + // [55] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 -- vbuz1_ge_pbuc1_derefidx_(pbuc2_derefidx_vbuz2)_then_la1 + lda.z nxt_y + ldx.z m + ldy PLEX_SORTED_IDX,x + cmp PLEX_YPOS,y + bcs __b2 + jmp __b5 + // plexSort::@5 + __b5: + // [56] (byte) plexSort::s#6 ← (byte) plexSort::m#2 -- vbuxx=vbuz1 + ldx.z m + // [57] phi from plexSort::@5 plexSort::@7 to plexSort::@3 [phi:plexSort::@5/plexSort::@7->plexSort::@3] + __b3_from___b5: + __b3_from___b7: + // [57] phi (byte) plexSort::s#3 = (byte) plexSort::s#6 [phi:plexSort::@5/plexSort::@7->plexSort::@3#0] -- register_copy + jmp __b3 + // plexSort::@3 + __b3: + // [58] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + lda PLEX_SORTED_IDX,x + sta PLEX_SORTED_IDX+1,x + // [59] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 -- vbuxx=_dec_vbuxx + dex + // [60] if((byte) plexSort::s#1==(byte) $ff) goto plexSort::@4 -- vbuxx_eq_vbuc1_then_la1 + cpx #$ff + beq __b4 + jmp __b7 + // plexSort::@7 + __b7: + // [61] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 -- vbuz1_lt_pbuc1_derefidx_(pbuc2_derefidx_vbuxx)_then_la1 + lda.z nxt_y + ldy PLEX_SORTED_IDX,x + cmp PLEX_YPOS,y + bcc __b3_from___b7 + jmp __b4 + // plexSort::@4 + __b4: + // [62] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 -- vbuxx=_inc_vbuxx + inx + // [63] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 -- pbuc1_derefidx_vbuxx=vbuz1 + lda.z nxt_idx + sta PLEX_SORTED_IDX,x + jmp __b2 + // plexSort::@2 + __b2: + // [64] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 -- vbuz1=_inc_vbuz1 + inc.z m + // [65] if((byte) plexSort::m#1!=(const nomodify byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1 -- vbuz1_neq_vbuc1_then_la1 + lda #PLEX_COUNT-2+1 + cmp.z m + bne __b1_from___b2 + jmp __b6 + // plexSort::@6 + __b6: + // [66] (volatile byte) plex_show_idx ← (byte) 0 -- vbuz1=vbuc1 + // Prepare for showing the sprites + lda #0 + sta.z plex_show_idx + // [67] (volatile byte) plex_sprite_idx ← (byte) 0 -- vbuz1=vbuc1 + lda #0 + sta.z plex_sprite_idx + // [68] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 + lda #1 + sta.z plex_sprite_msb + // [69] phi from plexSort::@6 to plexSort::plexFreePrepare1 [phi:plexSort::@6->plexSort::plexFreePrepare1] + plexFreePrepare1_from___b6: + jmp plexFreePrepare1 + // plexSort::plexFreePrepare1 + plexFreePrepare1: + // [70] phi from plexSort::plexFreePrepare1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1] + plexFreePrepare1___b1_from_plexFreePrepare1: + // [70] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) 0 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1#0] -- vbuxx=vbuc1 + ldx #0 + jmp plexFreePrepare1___b1 + // [70] phi from plexSort::plexFreePrepare1_@1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1] + plexFreePrepare1___b1_from_plexFreePrepare1___b1: + // [70] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) plexSort::plexFreePrepare1_s#1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1#0] -- register_copy + jmp plexFreePrepare1___b1 + // plexSort::plexFreePrepare1_@1 + plexFreePrepare1___b1: + // [71] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 -- pbuc1_derefidx_vbuxx=vbuc2 + lda #0 + sta PLEX_FREE_YPOS,x + // [72] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 -- vbuxx=_inc_vbuxx + inx + // [73] if((byte) plexSort::plexFreePrepare1_s#1!=(byte) 8) goto plexSort::plexFreePrepare1_@1 -- vbuxx_neq_vbuc1_then_la1 + cpx #8 + bne plexFreePrepare1___b1_from_plexFreePrepare1___b1 + jmp plexFreePrepare1___b2 + // plexSort::plexFreePrepare1_@2 + plexFreePrepare1___b2: + // [74] (volatile byte) plex_free_next ← (byte) 0 -- vbuz1=vbuc1 + lda #0 + sta.z plex_free_next + jmp __breturn + // plexSort::@return + __breturn: + // [75] return + rts +} + // plexSine +// Move the plex sprites in an Y-sine +plexSine: { + // [77] (byte) plexSine::y_idx#0 ← (byte) sin_idx#10 -- vbuxx=vbuz1 + // Assign sinus positions + ldx.z sin_idx + // [78] phi from plexSine to plexSine::@1 [phi:plexSine->plexSine::@1] + __b1_from_plexSine: + // [78] phi (byte) plexSine::sy#2 = (byte) 0 [phi:plexSine->plexSine::@1#0] -- vbuyy=vbuc1 + ldy #0 + // [78] phi (byte) plexSine::y_idx#2 = (byte) plexSine::y_idx#0 [phi:plexSine->plexSine::@1#1] -- register_copy + jmp __b1 + // [78] phi from plexSine::@1 to plexSine::@1 [phi:plexSine::@1->plexSine::@1] + __b1_from___b1: + // [78] phi (byte) plexSine::sy#2 = (byte) plexSine::sy#1 [phi:plexSine::@1->plexSine::@1#0] -- register_copy + // [78] phi (byte) plexSine::y_idx#2 = (byte) plexSine::y_idx#1 [phi:plexSine::@1->plexSine::@1#1] -- register_copy + jmp __b1 + // plexSine::@1 + __b1: + // [79] *((const byte*) PLEX_YPOS + (byte) plexSine::sy#2) ← *((const byte*) YSIN + (byte) plexSine::y_idx#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuxx + lda YSIN,x + sta PLEX_YPOS,y + // [80] (byte) plexSine::y_idx#1 ← (byte) plexSine::y_idx#2 + (byte) 8 -- vbuxx=vbuxx_plus_vbuc1 + txa + axs #-[8] + // [81] (byte) plexSine::sy#1 ← ++ (byte) plexSine::sy#2 -- vbuyy=_inc_vbuyy + iny + // [82] if((byte) plexSine::sy#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto plexSine::@1 -- vbuyy_neq_vbuc1_then_la1 + cpy #PLEX_COUNT-1+1 + bne __b1_from___b1 + jmp __b2 + // plexSine::@2 + __b2: + // [83] (byte) sin_idx#12 ← (byte) sin_idx#10 + (byte) 1 -- vbuz1=vbuz1_plus_1 + inc.z sin_idx + jmp __breturn + // plexSine::@return + __breturn: + // [84] return + rts +} + // plexInit +// Initialize the multiplexer data structures +plexInit: { + // [86] phi from plexInit to plexInit::plexSetScreen1 [phi:plexInit->plexInit::plexSetScreen1] + plexSetScreen1_from_plexInit: + jmp plexSetScreen1 + // plexInit::plexSetScreen1 + plexSetScreen1: + // [87] phi from plexInit::plexSetScreen1 to plexInit::@1 [phi:plexInit::plexSetScreen1->plexInit::@1] + __b1_from_plexSetScreen1: + // [87] phi (byte) plexInit::i#2 = (byte) 0 [phi:plexInit::plexSetScreen1->plexInit::@1#0] -- vbuxx=vbuc1 + ldx #0 + jmp __b1 + // [87] phi from plexInit::@1 to plexInit::@1 [phi:plexInit::@1->plexInit::@1] + __b1_from___b1: + // [87] phi (byte) plexInit::i#2 = (byte) plexInit::i#1 [phi:plexInit::@1->plexInit::@1#0] -- register_copy + jmp __b1 + // plexInit::@1 + __b1: + // [88] *((const byte*) PLEX_SORTED_IDX + (byte) plexInit::i#2) ← (byte) plexInit::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta PLEX_SORTED_IDX,x + // [89] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2 -- vbuxx=_inc_vbuxx + inx + // [90] if((byte) plexInit::i#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto plexInit::@1 -- vbuxx_neq_vbuc1_then_la1 + cpx #PLEX_COUNT-1+1 + bne __b1_from___b1 + jmp __breturn + // plexInit::@return + __breturn: + // [91] return + rts +} + // font_2x2_to_sprites +// Convert a 2x2-font to sprites +// - font_2x2 The source 2x2-font +// - sprites The destination sprites +// - num_chars The number of chars to convert +font_2x2_to_sprites: { + .const num_chars = $40 + .label __3 = $18 + .label char_right = $d + .label sprite_idx = $a + .label char_left = $b + .label char_current = 6 + .label sprite = 8 + .label c = 5 + // [93] phi from font_2x2_to_sprites to font_2x2_to_sprites::@1 [phi:font_2x2_to_sprites->font_2x2_to_sprites::@1] + __b1_from_font_2x2_to_sprites: + // [93] phi (byte*) font_2x2_to_sprites::sprite#4 = (const nomodify byte*) SPRITES [phi:font_2x2_to_sprites->font_2x2_to_sprites::@1#0] -- pbuz1=pbuc1 + lda #SPRITES + sta.z sprite+1 + // [93] phi (byte*) font_2x2_to_sprites::char_current#2 = (const nomodify byte*) FONT [phi:font_2x2_to_sprites->font_2x2_to_sprites::@1#1] -- pbuz1=pbuc1 + lda #FONT + sta.z char_current+1 + // [93] phi (byte) font_2x2_to_sprites::c#2 = (byte) 0 [phi:font_2x2_to_sprites->font_2x2_to_sprites::@1#2] -- vbuz1=vbuc1 + lda #0 + sta.z c + jmp __b1 + // font_2x2_to_sprites::@1 + __b1: + // [94] if((byte) font_2x2_to_sprites::c#2<(const byte) font_2x2_to_sprites::num_chars#0) goto font_2x2_to_sprites::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z c + cmp #num_chars + bcc __b2 + jmp __breturn + // font_2x2_to_sprites::@return + __breturn: + // [95] return + rts + // font_2x2_to_sprites::@2 + __b2: + // [96] (byte*) font_2x2_to_sprites::char_right#0 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $40*(number) 8 -- pbuz1=pbuz2_plus_vwuc1 + lda.z char_current + clc + adc #<$40*8 + sta.z char_right + lda.z char_current+1 + adc #>$40*8 + sta.z char_right+1 + // [97] (byte*) font_2x2_to_sprites::char_left#6 ← (byte*) font_2x2_to_sprites::char_current#2 -- pbuz1=pbuz2 + lda.z char_current + sta.z char_left + lda.z char_current+1 + sta.z char_left+1 + // [98] phi from font_2x2_to_sprites::@2 to font_2x2_to_sprites::@3 [phi:font_2x2_to_sprites::@2->font_2x2_to_sprites::@3] + __b3_from___b2: + // [98] phi (byte*) font_2x2_to_sprites::char_right#3 = (byte*) font_2x2_to_sprites::char_right#0 [phi:font_2x2_to_sprites::@2->font_2x2_to_sprites::@3#0] -- register_copy + // [98] phi (byte) font_2x2_to_sprites::sprite_idx#4 = (byte) 0 [phi:font_2x2_to_sprites::@2->font_2x2_to_sprites::@3#1] -- vbuz1=vbuc1 + lda #0 + sta.z sprite_idx + // [98] phi (byte*) font_2x2_to_sprites::char_left#3 = (byte*) font_2x2_to_sprites::char_left#6 [phi:font_2x2_to_sprites::@2->font_2x2_to_sprites::@3#2] -- register_copy + // [98] phi (byte) font_2x2_to_sprites::i#2 = (byte) 0 [phi:font_2x2_to_sprites::@2->font_2x2_to_sprites::@3#3] -- vbuxx=vbuc1 + ldx #0 + jmp __b3 + // [98] phi from font_2x2_to_sprites::@5 to font_2x2_to_sprites::@3 [phi:font_2x2_to_sprites::@5->font_2x2_to_sprites::@3] + __b3_from___b5: + // [98] phi (byte*) font_2x2_to_sprites::char_right#3 = (byte*) font_2x2_to_sprites::char_right#4 [phi:font_2x2_to_sprites::@5->font_2x2_to_sprites::@3#0] -- register_copy + // [98] phi (byte) font_2x2_to_sprites::sprite_idx#4 = (byte) font_2x2_to_sprites::sprite_idx#3 [phi:font_2x2_to_sprites::@5->font_2x2_to_sprites::@3#1] -- register_copy + // [98] phi (byte*) font_2x2_to_sprites::char_left#3 = (byte*) font_2x2_to_sprites::char_left#4 [phi:font_2x2_to_sprites::@5->font_2x2_to_sprites::@3#2] -- register_copy + // [98] phi (byte) font_2x2_to_sprites::i#2 = (byte) font_2x2_to_sprites::i#1 [phi:font_2x2_to_sprites::@5->font_2x2_to_sprites::@3#3] -- register_copy + jmp __b3 + // font_2x2_to_sprites::@3 + __b3: + // [99] (byte~) font_2x2_to_sprites::$3 ← (byte) font_2x2_to_sprites::i#2 & (byte) 7 -- vbuz1=vbuxx_band_vbuc1 + lda #7 + sax.z __3 + // [100] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#4) ← *((byte*) font_2x2_to_sprites::char_left#3 + (byte~) font_2x2_to_sprites::$3) -- pbuz1_derefidx_vbuz2=pbuz3_derefidx_vbuz4 + ldy.z __3 + lda (char_left),y + ldy.z sprite_idx + sta (sprite),y + // [101] (byte) font_2x2_to_sprites::sprite_idx#1 ← ++ (byte) font_2x2_to_sprites::sprite_idx#4 -- vbuz1=_inc_vbuz1 + inc.z sprite_idx + // [102] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#1) ← *((byte*) font_2x2_to_sprites::char_right#3 + (byte~) font_2x2_to_sprites::$3) -- pbuz1_derefidx_vbuz2=pbuz3_derefidx_vbuz4 + ldy.z __3 + lda (char_right),y + ldy.z sprite_idx + sta (sprite),y + // [103] (byte) font_2x2_to_sprites::sprite_idx#2 ← ++ (byte) font_2x2_to_sprites::sprite_idx#1 -- vbuyy=_inc_vbuz1 + ldy.z sprite_idx + iny + // [104] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#2) ← (byte) 0 -- pbuz1_derefidx_vbuyy=vbuc1 + lda #0 + sta (sprite),y + // [105] (byte) font_2x2_to_sprites::sprite_idx#3 ← ++ (byte) font_2x2_to_sprites::sprite_idx#2 -- vbuz1=_inc_vbuyy + iny + sty.z sprite_idx + // [106] if((byte) font_2x2_to_sprites::i#2==(byte) 7) goto font_2x2_to_sprites::@4 -- vbuxx_eq_vbuc1_then_la1 + cpx #7 + beq __b4 + jmp __b6 + // font_2x2_to_sprites::@6 + __b6: + // [107] if((byte) font_2x2_to_sprites::i#2!=(byte) $f) goto font_2x2_to_sprites::@8 -- vbuxx_neq_vbuc1_then_la1 + cpx #$f + bne __b8_from___b6 + // [109] phi from font_2x2_to_sprites::@6 to font_2x2_to_sprites::@5 [phi:font_2x2_to_sprites::@6->font_2x2_to_sprites::@5] + __b5_from___b6: + // [109] phi (byte*) font_2x2_to_sprites::char_right#4 = (const nomodify byte*) FONT+(byte) ' '*(byte) 8 [phi:font_2x2_to_sprites::@6->font_2x2_to_sprites::@5#0] -- pbuz1=pbuc1 + lda #FONT+' '*8 + sta.z char_right+1 + // [109] phi (byte*) font_2x2_to_sprites::char_left#4 = (const nomodify byte*) FONT+(byte) ' '*(byte) 8 [phi:font_2x2_to_sprites::@6->font_2x2_to_sprites::@5#1] -- pbuz1=pbuc1 + lda #FONT+' '*8 + sta.z char_left+1 + jmp __b5 + // [108] phi from font_2x2_to_sprites::@6 to font_2x2_to_sprites::@8 [phi:font_2x2_to_sprites::@6->font_2x2_to_sprites::@8] + __b8_from___b6: + jmp __b8 + // font_2x2_to_sprites::@8 + __b8: + // [109] phi from font_2x2_to_sprites::@4 font_2x2_to_sprites::@8 to font_2x2_to_sprites::@5 [phi:font_2x2_to_sprites::@4/font_2x2_to_sprites::@8->font_2x2_to_sprites::@5] + __b5_from___b4: + __b5_from___b8: + // [109] phi (byte*) font_2x2_to_sprites::char_right#4 = (byte*) font_2x2_to_sprites::char_right#1 [phi:font_2x2_to_sprites::@4/font_2x2_to_sprites::@8->font_2x2_to_sprites::@5#0] -- register_copy + // [109] phi (byte*) font_2x2_to_sprites::char_left#4 = (byte*) font_2x2_to_sprites::char_left#1 [phi:font_2x2_to_sprites::@4/font_2x2_to_sprites::@8->font_2x2_to_sprites::@5#1] -- register_copy + jmp __b5 + // font_2x2_to_sprites::@5 + __b5: + // [110] (byte) font_2x2_to_sprites::i#1 ← ++ (byte) font_2x2_to_sprites::i#2 -- vbuxx=_inc_vbuxx + inx + // [111] if((byte) font_2x2_to_sprites::i#1!=(byte) $15) goto font_2x2_to_sprites::@3 -- vbuxx_neq_vbuc1_then_la1 + cpx #$15 + bne __b3_from___b5 + jmp __b7 + // font_2x2_to_sprites::@7 + __b7: + // [112] (byte*) font_2x2_to_sprites::char_current#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (byte) 8 -- pbuz1=pbuz1_plus_vbuc1 + lda #8 + clc + adc.z char_current + sta.z char_current + bcc !+ + inc.z char_current+1 + !: + // [113] (byte*) font_2x2_to_sprites::sprite#1 ← (byte*) font_2x2_to_sprites::sprite#4 + (byte) $40 -- pbuz1=pbuz1_plus_vbuc1 + lda #$40 + clc + adc.z sprite + sta.z sprite + bcc !+ + inc.z sprite+1 + !: + // [114] (byte) font_2x2_to_sprites::c#1 ← ++ (byte) font_2x2_to_sprites::c#2 -- vbuz1=_inc_vbuz1 + inc.z c + // [93] phi from font_2x2_to_sprites::@7 to font_2x2_to_sprites::@1 [phi:font_2x2_to_sprites::@7->font_2x2_to_sprites::@1] + __b1_from___b7: + // [93] phi (byte*) font_2x2_to_sprites::sprite#4 = (byte*) font_2x2_to_sprites::sprite#1 [phi:font_2x2_to_sprites::@7->font_2x2_to_sprites::@1#0] -- register_copy + // [93] phi (byte*) font_2x2_to_sprites::char_current#2 = (byte*) font_2x2_to_sprites::char_current#1 [phi:font_2x2_to_sprites::@7->font_2x2_to_sprites::@1#1] -- register_copy + // [93] phi (byte) font_2x2_to_sprites::c#2 = (byte) font_2x2_to_sprites::c#1 [phi:font_2x2_to_sprites::@7->font_2x2_to_sprites::@1#2] -- register_copy + jmp __b1 + // font_2x2_to_sprites::@4 + __b4: + // [115] (byte*) font_2x2_to_sprites::char_left#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $80*(number) 8 -- pbuz1=pbuz2_plus_vwuc1 + lda.z char_current + clc + adc #<$80*8 + sta.z char_left + lda.z char_current+1 + adc #>$80*8 + sta.z char_left+1 + // [116] (byte*) font_2x2_to_sprites::char_right#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $c0*(number) 8 -- pbuz1=pbuz2_plus_vwuc1 + lda.z char_current + clc + adc #<$c0*8 + sta.z char_right + lda.z char_current+1 + adc #>$c0*8 + sta.z char_right+1 + jmp __b5_from___b4 +} + // font_2x2 +// Create a 2x2-font by doubling all pixels of the 64 first chars +// The font layout is: +// - 0x00 - 0x3f Upper left glyphs +// - 0x40 - 0x7f Upper right glyphs +// - 0x80 - 0xbf Lower left glyphs +// - 0xc0 - 0xff Lower right glyphs +font_2x2: { + .label __5 = $f + .label __7 = $f + .label next_2x2_left = 6 + .label next_2x2_right = $d + .label glyph_bits = $18 + .label glyph_bits_2x2 = $f + .label l2 = $17 + .label l = $16 + .label next_2x2_left_1 = $b + .label next_2x2 = 6 + .label next_original = 8 + .label c = $a + // [118] phi from font_2x2 to font_2x2::@1 [phi:font_2x2->font_2x2::@1] + __b1_from_font_2x2: + // [118] phi (byte) font_2x2::c#11 = (byte) 0 [phi:font_2x2->font_2x2::@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z c + // [118] phi (byte*) font_2x2::next_original#4 = (const nomodify byte*) CHARGEN [phi:font_2x2->font_2x2::@1#1] -- pbuz1=pbuc1 + lda #CHARGEN + sta.z next_original+1 + // [118] phi (byte*) font_2x2::next_2x2_left#0 = (const nomodify byte*) FONT [phi:font_2x2->font_2x2::@1#2] -- pbuz1=pbuc1 + lda #FONT + sta.z next_2x2_left+1 + jmp __b1 + // [118] phi from font_2x2::@9 to font_2x2::@1 [phi:font_2x2::@9->font_2x2::@1] + __b1_from___b9: + // [118] phi (byte) font_2x2::c#11 = (byte) font_2x2::c#1 [phi:font_2x2::@9->font_2x2::@1#0] -- register_copy + // [118] phi (byte*) font_2x2::next_original#4 = (byte*) font_2x2::next_original#1 [phi:font_2x2::@9->font_2x2::@1#1] -- register_copy + // [118] phi (byte*) font_2x2::next_2x2_left#0 = (byte*) font_2x2::next_2x2#1 [phi:font_2x2::@9->font_2x2::@1#2] -- register_copy + jmp __b1 + // font_2x2::@1 + __b1: + // [119] (byte*) font_2x2::next_2x2_right#0 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $40*(number) 8 -- pbuz1=pbuz2_plus_vwuc1 + lda.z next_2x2_left + clc + adc #<$40*8 + sta.z next_2x2_right + lda.z next_2x2_left+1 + adc #>$40*8 + sta.z next_2x2_right+1 + // [120] (byte*) font_2x2::next_2x2_left#10 ← (byte*) font_2x2::next_2x2_left#0 -- pbuz1=pbuz2 + lda.z next_2x2_left + sta.z next_2x2_left_1 + lda.z next_2x2_left+1 + sta.z next_2x2_left_1+1 + // [121] phi from font_2x2::@1 to font_2x2::@2 [phi:font_2x2::@1->font_2x2::@2] + __b2_from___b1: + // [121] phi (byte*) font_2x2::next_2x2_right#7 = (byte*) font_2x2::next_2x2_right#0 [phi:font_2x2::@1->font_2x2::@2#0] -- register_copy + // [121] phi (byte) font_2x2::l2#8 = (byte) 0 [phi:font_2x2::@1->font_2x2::@2#1] -- vbuz1=vbuc1 + lda #0 + sta.z l2 + // [121] phi (byte*) font_2x2::next_2x2_left#7 = (byte*) font_2x2::next_2x2_left#10 [phi:font_2x2::@1->font_2x2::@2#2] -- register_copy + // [121] phi (byte) font_2x2::l#2 = (byte) 0 [phi:font_2x2::@1->font_2x2::@2#3] -- vbuz1=vbuc1 + lda #0 + sta.z l + jmp __b2 + // [121] phi from font_2x2::@8 to font_2x2::@2 [phi:font_2x2::@8->font_2x2::@2] + __b2_from___b8: + // [121] phi (byte*) font_2x2::next_2x2_right#7 = (byte*) font_2x2::next_2x2_right#8 [phi:font_2x2::@8->font_2x2::@2#0] -- register_copy + // [121] phi (byte) font_2x2::l2#8 = (byte) font_2x2::l2#9 [phi:font_2x2::@8->font_2x2::@2#1] -- register_copy + // [121] phi (byte*) font_2x2::next_2x2_left#7 = (byte*) font_2x2::next_2x2_left#8 [phi:font_2x2::@8->font_2x2::@2#2] -- register_copy + // [121] phi (byte) font_2x2::l#2 = (byte) font_2x2::l#1 [phi:font_2x2::@8->font_2x2::@2#3] -- register_copy + jmp __b2 + // font_2x2::@2 + __b2: + // [122] (byte) font_2x2::glyph_bits#0 ← *((byte*) font_2x2::next_original#4 + (byte) font_2x2::l#2) -- vbuz1=pbuz2_derefidx_vbuz3 + ldy.z l + lda (next_original),y + sta.z glyph_bits + // [123] phi from font_2x2::@2 to font_2x2::@3 [phi:font_2x2::@2->font_2x2::@3] + __b3_from___b2: + // [123] phi (byte) font_2x2::b#2 = (byte) 0 [phi:font_2x2::@2->font_2x2::@3#0] -- vbuyy=vbuc1 + ldy #0 + // [123] phi (word) font_2x2::glyph_bits_2x2#3 = (word) 0 [phi:font_2x2::@2->font_2x2::@3#1] -- vwuz1=vwuc1 + lda #<0 + sta.z glyph_bits_2x2 + lda #>0 + sta.z glyph_bits_2x2+1 + // [123] phi (byte) font_2x2::glyph_bits#2 = (byte) font_2x2::glyph_bits#0 [phi:font_2x2::@2->font_2x2::@3#2] -- register_copy + jmp __b3 + // [123] phi from font_2x2::@5 to font_2x2::@3 [phi:font_2x2::@5->font_2x2::@3] + __b3_from___b5: + // [123] phi (byte) font_2x2::b#2 = (byte) font_2x2::b#1 [phi:font_2x2::@5->font_2x2::@3#0] -- register_copy + // [123] phi (word) font_2x2::glyph_bits_2x2#3 = (word) font_2x2::glyph_bits_2x2#2 [phi:font_2x2::@5->font_2x2::@3#1] -- register_copy + // [123] phi (byte) font_2x2::glyph_bits#2 = (byte) font_2x2::glyph_bits#1 [phi:font_2x2::@5->font_2x2::@3#2] -- register_copy + jmp __b3 + // font_2x2::@3 + __b3: + // [124] (byte~) font_2x2::$1 ← (byte) font_2x2::glyph_bits#2 & (byte) $80 -- vbuaa=vbuz1_band_vbuc1 + lda #$80 + and.z glyph_bits + // [125] if((byte) 0!=(byte~) font_2x2::$1) goto font_2x2::@4 -- vbuc1_neq_vbuaa_then_la1 + cmp #0 + bne __b4_from___b3 + // [127] phi from font_2x2::@3 to font_2x2::@5 [phi:font_2x2::@3->font_2x2::@5] + __b5_from___b3: + // [127] phi (byte) font_2x2::glyph_bit#0 = (byte) 0 [phi:font_2x2::@3->font_2x2::@5#0] -- vbuxx=vbuc1 + ldx #0 + jmp __b5 + // [126] phi from font_2x2::@3 to font_2x2::@4 [phi:font_2x2::@3->font_2x2::@4] + __b4_from___b3: + jmp __b4 + // font_2x2::@4 + __b4: + // [127] phi from font_2x2::@4 to font_2x2::@5 [phi:font_2x2::@4->font_2x2::@5] + __b5_from___b4: + // [127] phi (byte) font_2x2::glyph_bit#0 = (byte) 1 [phi:font_2x2::@4->font_2x2::@5#0] -- vbuxx=vbuc1 + ldx #1 + jmp __b5 + // font_2x2::@5 + __b5: + // [128] (word~) font_2x2::$5 ← (word) font_2x2::glyph_bits_2x2#3 << (byte) 1 -- vwuz1=vwuz1_rol_1 + asl.z __5 + rol.z __5+1 + // [129] (word) font_2x2::glyph_bits_2x2#1 ← (word~) font_2x2::$5 | (byte) font_2x2::glyph_bit#0 -- vwuz1=vwuz1_bor_vbuxx + txa + ora.z glyph_bits_2x2 + sta.z glyph_bits_2x2 + // [130] (word~) font_2x2::$7 ← (word) font_2x2::glyph_bits_2x2#1 << (byte) 1 -- vwuz1=vwuz1_rol_1 + asl.z __7 + rol.z __7+1 + // [131] (word) font_2x2::glyph_bits_2x2#2 ← (word~) font_2x2::$7 | (byte) font_2x2::glyph_bit#0 -- vwuz1=vwuz1_bor_vbuxx + txa + ora.z glyph_bits_2x2 + sta.z glyph_bits_2x2 + // [132] (byte) font_2x2::glyph_bits#1 ← (byte) font_2x2::glyph_bits#2 << (byte) 1 -- vbuz1=vbuz1_rol_1 + // Move to next bit + asl.z glyph_bits + // [133] (byte) font_2x2::b#1 ← ++ (byte) font_2x2::b#2 -- vbuyy=_inc_vbuyy + iny + // [134] if((byte) font_2x2::b#1!=(byte) 8) goto font_2x2::@3 -- vbuyy_neq_vbuc1_then_la1 + cpy #8 + bne __b3_from___b5 + jmp __b6 + // font_2x2::@6 + __b6: + // [135] (byte~) font_2x2::$12 ← > (word) font_2x2::glyph_bits_2x2#2 -- vbuaa=_hi_vwuz1 + lda.z glyph_bits_2x2+1 + // [136] *((byte*) font_2x2::next_2x2_left#7 + (byte) font_2x2::l2#8) ← (byte~) font_2x2::$12 -- pbuz1_derefidx_vbuz2=vbuaa + // Put the generated 2x2-line into the 2x2-font twice + ldy.z l2 + sta (next_2x2_left_1),y + // [137] (byte~) font_2x2::$11 ← (byte) font_2x2::l2#8 + (byte) 1 -- vbuyy=vbuz1_plus_1 + ldy.z l2 + iny + // [138] *((byte*) font_2x2::next_2x2_left#7 + (byte~) font_2x2::$11) ← (byte~) font_2x2::$12 -- pbuz1_derefidx_vbuyy=vbuaa + sta (next_2x2_left_1),y + // [139] (byte~) font_2x2::$15 ← < (word) font_2x2::glyph_bits_2x2#2 -- vbuaa=_lo_vwuz1 + lda.z glyph_bits_2x2 + // [140] *((byte*) font_2x2::next_2x2_right#7 + (byte) font_2x2::l2#8) ← (byte~) font_2x2::$15 -- pbuz1_derefidx_vbuz2=vbuaa + ldy.z l2 + sta (next_2x2_right),y + // [141] (byte~) font_2x2::$14 ← (byte) font_2x2::l2#8 + (byte) 1 -- vbuyy=vbuz1_plus_1 + ldy.z l2 + iny + // [142] *((byte*) font_2x2::next_2x2_right#7 + (byte~) font_2x2::$14) ← (byte~) font_2x2::$15 -- pbuz1_derefidx_vbuyy=vbuaa + sta (next_2x2_right),y + // [143] (byte) font_2x2::l2#1 ← (byte) font_2x2::l2#8 + (byte) 2 -- vbuz1=vbuz1_plus_2 + lda.z l2 + clc + adc #2 + sta.z l2 + // [144] if((byte) font_2x2::l2#1!=(byte) 8) goto font_2x2::@8 -- vbuz1_neq_vbuc1_then_la1 + lda #8 + cmp.z l2 + bne __b8_from___b6 + jmp __b7 + // font_2x2::@7 + __b7: + // [145] (byte*) font_2x2::next_2x2_left#1 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $80*(number) 8 -- pbuz1=pbuz2_plus_vwuc1 + lda.z next_2x2_left + clc + adc #<$80*8 + sta.z next_2x2_left_1 + lda.z next_2x2_left+1 + adc #>$80*8 + sta.z next_2x2_left_1+1 + // [146] (byte*) font_2x2::next_2x2_right#1 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $c0*(number) 8 -- pbuz1=pbuz2_plus_vwuc1 + lda.z next_2x2_left + clc + adc #<$c0*8 + sta.z next_2x2_right + lda.z next_2x2_left+1 + adc #>$c0*8 + sta.z next_2x2_right+1 + // [147] phi from font_2x2::@7 to font_2x2::@8 [phi:font_2x2::@7->font_2x2::@8] + __b8_from___b7: + // [147] phi (byte*) font_2x2::next_2x2_right#8 = (byte*) font_2x2::next_2x2_right#1 [phi:font_2x2::@7->font_2x2::@8#0] -- register_copy + // [147] phi (byte) font_2x2::l2#9 = (byte) 0 [phi:font_2x2::@7->font_2x2::@8#1] -- vbuz1=vbuc1 + lda #0 + sta.z l2 + // [147] phi (byte*) font_2x2::next_2x2_left#8 = (byte*) font_2x2::next_2x2_left#1 [phi:font_2x2::@7->font_2x2::@8#2] -- register_copy + jmp __b8 + // [147] phi from font_2x2::@6 to font_2x2::@8 [phi:font_2x2::@6->font_2x2::@8] + __b8_from___b6: + // [147] phi (byte*) font_2x2::next_2x2_right#8 = (byte*) font_2x2::next_2x2_right#7 [phi:font_2x2::@6->font_2x2::@8#0] -- register_copy + // [147] phi (byte) font_2x2::l2#9 = (byte) font_2x2::l2#1 [phi:font_2x2::@6->font_2x2::@8#1] -- register_copy + // [147] phi (byte*) font_2x2::next_2x2_left#8 = (byte*) font_2x2::next_2x2_left#7 [phi:font_2x2::@6->font_2x2::@8#2] -- register_copy + jmp __b8 + // font_2x2::@8 + __b8: + // [148] (byte) font_2x2::l#1 ← ++ (byte) font_2x2::l#2 -- vbuz1=_inc_vbuz1 + inc.z l + // [149] if((byte) font_2x2::l#1!=(byte) 8) goto font_2x2::@2 -- vbuz1_neq_vbuc1_then_la1 + lda #8 + cmp.z l + bne __b2_from___b8 + jmp __b9 + // font_2x2::@9 + __b9: + // [150] (byte*) font_2x2::next_2x2#1 ← (byte*) font_2x2::next_2x2_left#0 + (byte) 8 -- pbuz1=pbuz1_plus_vbuc1 + lda #8 + clc + adc.z next_2x2 + sta.z next_2x2 + bcc !+ + inc.z next_2x2+1 + !: + // [151] (byte*) font_2x2::next_original#1 ← (byte*) font_2x2::next_original#4 + (byte) 8 -- pbuz1=pbuz1_plus_vbuc1 + lda #8 + clc + adc.z next_original + sta.z next_original + bcc !+ + inc.z next_original+1 + !: + // [152] (byte) font_2x2::c#1 ← ++ (byte) font_2x2::c#11 -- vbuz1=_inc_vbuz1 + inc.z c + // [153] if((byte) font_2x2::c#1!=(byte) $40) goto font_2x2::@1 -- vbuz1_neq_vbuc1_then_la1 + lda #$40 + cmp.z c + bne __b1_from___b9 + jmp __breturn + // font_2x2::@return + __breturn: + // [154] return + rts +} + // plex_irq +// Show sprites from the multiplexer, rescheduling the IRQ as many times as needed +plex_irq: { + .label __4 = $19 + // entry interrupt(KERNEL_MIN) + // asm { sei } + sei + // [156] phi from plex_irq plex_irq::@7 to plex_irq::@3 [phi:plex_irq/plex_irq::@7->plex_irq::@3] + __b3_from_plex_irq: + __b3_from___b7: + jmp __b3 + // plex_irq::@3 + __b3: + // [157] call plexShowSprite + jsr plexShowSprite + jmp plexFreeNextYpos1 + // plex_irq::plexFreeNextYpos1 + plexFreeNextYpos1: + // [158] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) -- vbuxx=pbuc1_derefidx_vbuz1 + ldy.z plex_free_next + ldx PLEX_FREE_YPOS,y + jmp __b6 + // plex_irq::@6 + __b6: + // [159] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 3 -- vbuz1=_deref_pbuc1_plus_vbuc2 + lda #3 + clc + adc RASTER + sta.z __4 + // [160] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 -- vbuz1_ge_vbuc1_then_la1 + lda.z plex_show_idx + cmp #PLEX_COUNT + bcs __b4 + jmp __b7 + // plex_irq::@7 + __b7: + // [161] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3 -- vbuxx_lt_vbuz1_then_la1 + cpx.z __4 + bcc __b3_from___b7 + jmp __b4 + // plex_irq::@4 + __b4: + // [162] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 -- vbuz1_lt_vbuc1_then_la1 + lda.z plex_show_idx + cmp #PLEX_COUNT + bcc __b1 + jmp __b5 + // plex_irq::@5 + __b5: + // [163] *((const nomodify byte*) RASTER) ← (byte) $28 -- _deref_pbuc1=vbuc2 + // Reset the raster IRQ to the top of the screen + lda #$28 + sta RASTER + // [164] (volatile bool) framedone ← true -- vboz1=vboc1 + lda #1 + sta.z framedone + jmp __b2 + // plex_irq::@2 + __b2: + // [165] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // Acknowledge the IRQ + lda #IRQ_RASTER + sta IRQ_STATUS + // asm { cli } + //*BORDERCOL = 0; + cli + jmp __breturn + // plex_irq::@return + __breturn: + // [167] return - exit interrupt(KERNEL_MIN) + jmp $ea81 + // plex_irq::@1 + __b1: + // [168] *((const nomodify byte*) RASTER) ← (byte) plex_irq::plexFreeNextYpos1_return#0 -- _deref_pbuc1=vbuxx + // Set raster IRQ line to the next sprite Y-position + stx RASTER + jmp __b2 +} + // plexShowSprite +// Show the next sprite. +// plexSort() prepares showing the sprites +plexShowSprite: { + .label plex_sprite_idx2 = $1a + // [169] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 -- vbuz1=vbuz2_rol_1 + lda.z plex_sprite_idx + asl + sta.z plex_sprite_idx2 + // [170] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) -- vbuaa=pbuc1_derefidx_(pbuc2_derefidx_vbuz1) + ldx.z plex_show_idx + ldy PLEX_SORTED_IDX,x + lda PLEX_YPOS,y + // [171] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 -- pbuc1_derefidx_vbuz1=vbuaa + ldy.z plex_sprite_idx2 + sta SPRITES_YPOS,y + jmp plexFreeAdd1 + // plexShowSprite::plexFreeAdd1 + plexFreeAdd1: + // [172] (byte~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte) $15 -- vbuaa=vbuaa_plus_vbuc1 + clc + adc #$15 + // [173] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 -- pbuc1_derefidx_vbuz1=vbuaa + ldy.z plex_free_next + sta PLEX_FREE_YPOS,y + // [174] (byte~) plexShowSprite::plexFreeAdd1_$1 ← (volatile byte) plex_free_next + (byte) 1 -- vbuaa=vbuz1_plus_1 + lda.z plex_free_next + clc + adc #1 + // [175] (byte~) plexShowSprite::plexFreeAdd1_$2 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7 -- vbuaa=vbuaa_band_vbuc1 + and #7 + // [176] (volatile byte) plex_free_next ← (byte~) plexShowSprite::plexFreeAdd1_$2 -- vbuz1=vbuaa + sta.z plex_free_next + jmp __b5 + // plexShowSprite::@5 + __b5: + // [177] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_(pbuc3_derefidx_vbuz2) + ldx.z plex_show_idx + ldy PLEX_SORTED_IDX,x + lda PLEX_PTR,y + ldx.z plex_sprite_idx + sta PLEX_SCREEN_PTR,x + // [178] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) -- vbuaa=pbuc1_derefidx_vbuz1 + ldy.z plex_show_idx + lda PLEX_SORTED_IDX,y + // [179] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 -- vbuxx=vbuaa_rol_1 + asl + tax + // [180] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) -- vbuaa=_lo_pwuc1_derefidx_vbuxx + lda PLEX_XPOS,x + // [181] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 -- pbuc1_derefidx_vbuz1=vbuaa + ldy.z plex_sprite_idx2 + sta SPRITES_XPOS,y + // [182] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) -- vbuaa=_hi_pwuc1_derefidx_vbuxx + lda PLEX_XPOS+1,x + // [183] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1 -- vbuaa_neq_0_then_la1 + cmp #0 + bne __b1 + jmp __b3 + // plexShowSprite::@3 + __b3: + // [184] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb -- vbuaa=vbuc1_bxor_vbuz1 + lda #$ff + eor.z plex_sprite_msb + // [185] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 -- _deref_pbuc1=_deref_pbuc1_band_vbuaa + and SPRITES_XMSB + sta SPRITES_XMSB + jmp __b2 + // plexShowSprite::@2 + __b2: + // [186] (byte~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (byte) 1 -- vbuxx=vbuz1_plus_1 + ldx.z plex_sprite_idx + inx + // [187] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7 -- vbuaa=vbuxx_band_vbuc1 + txa + and #7 + // [188] (volatile byte) plex_sprite_idx ← (byte~) plexShowSprite::$6 -- vbuz1=vbuaa + sta.z plex_sprite_idx + // [189] (volatile byte) plex_show_idx ← ++ (volatile byte) plex_show_idx -- vbuz1=_inc_vbuz1 + inc.z plex_show_idx + // [190] (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (byte) 1 -- vbuz1=vbuz1_rol_1 + asl.z plex_sprite_msb + // [191] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return -- vbuz1_neq_0_then_la1 + lda.z plex_sprite_msb + cmp #0 + bne __breturn + jmp __b4 + // plexShowSprite::@4 + __b4: + // [192] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 + lda #1 + sta.z plex_sprite_msb + jmp __breturn + // plexShowSprite::@return + __breturn: + // [193] return + rts + // plexShowSprite::@1 + __b1: + // [194] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 + lda SPRITES_XMSB + ora.z plex_sprite_msb + sta SPRITES_XMSB + jmp __b2 +} + // File Data + // The x-positions of the multiplexer sprites (0x000-0x1ff) + PLEX_XPOS: .fill 2*PLEX_COUNT, 0 + // The y-positions of the multiplexer sprites. + PLEX_YPOS: .fill PLEX_COUNT, 0 + // The sprite pointers for the multiplexed sprites + 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 + // 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 + //kickasm(pc FONT, resource "elefont.bin") {{ + // .import binary "elefont.bin" + //}} + .align $100 +YSIN: +.fill $100, round(142+89.5*sin(toRadians(360*i/256))) + + +ASSEMBLER OPTIMIZATIONS +Removing instruction jmp __b1 +Removing instruction jmp __b2 +Removing instruction jmp __b3 +Removing instruction jmp __b4 +Removing instruction jmp __bend +Removing instruction jmp __b8 +Removing instruction jmp __b9 +Removing instruction jmp toD0181 +Removing instruction jmp __b7 +Removing instruction jmp toSpritePtr1 +Removing instruction jmp __b1 +Removing instruction jmp __b2 +Removing instruction jmp __b3 +Removing instruction jmp __b4 +Removing instruction jmp __b10 +Removing instruction jmp __b11 +Removing instruction jmp __b5 +Removing instruction jmp __b6 +Removing instruction jmp __b12 +Removing instruction jmp __b13 +Removing instruction jmp __b1 +Removing instruction jmp __b5 +Removing instruction jmp __b3 +Removing instruction jmp __b7 +Removing instruction jmp __b4 +Removing instruction jmp __b2 +Removing instruction jmp __b6 +Removing instruction jmp plexFreePrepare1 +Removing instruction jmp plexFreePrepare1___b1 +Removing instruction jmp plexFreePrepare1___b2 +Removing instruction jmp __breturn +Removing instruction jmp __b1 +Removing instruction jmp __b2 +Removing instruction jmp __breturn +Removing instruction jmp plexSetScreen1 +Removing instruction jmp __b1 +Removing instruction jmp __breturn +Removing instruction jmp __b1 +Removing instruction jmp __breturn +Removing instruction jmp __b3 +Removing instruction jmp __b6 +Removing instruction jmp __b8 +Removing instruction jmp __b5 +Removing instruction jmp __b7 +Removing instruction jmp __b1 +Removing instruction jmp __b2 +Removing instruction jmp __b3 +Removing instruction jmp __b4 +Removing instruction jmp __b5 +Removing instruction jmp __b6 +Removing instruction jmp __b7 +Removing instruction jmp __b8 +Removing instruction jmp __b9 +Removing instruction jmp __breturn +Removing instruction jmp __b3 +Removing instruction jmp plexFreeNextYpos1 +Removing instruction jmp __b6 +Removing instruction jmp __b7 +Removing instruction jmp __b4 +Removing instruction jmp __b5 +Removing instruction jmp __b2 +Removing instruction jmp __breturn +Removing instruction jmp plexFreeAdd1 +Removing instruction jmp __b5 +Removing instruction jmp __b3 +Removing instruction jmp __b2 +Removing instruction jmp __b4 +Removing instruction jmp __breturn +Succesful ASM optimization Pass5NextJumpElimination +Removing instruction lda #0 +Removing instruction lda #IRQ_RASTER +Replacing instruction ldy.z nxt_idx with TAY +Removing instruction lda.z nxt_y +Removing instruction lda #0 +Replacing instruction ldx #0 with TAX +Removing instruction ldy.z sprite_idx +Removing instruction lda #0 +Replacing instruction lda #<0 with TYA +Removing instruction lda #>0 +Removing instruction ldy.z l2 +Removing instruction ldy.z l2 +Replacing instruction lda.z plex_free_next with TYA +Succesful ASM optimization Pass5UnnecesaryLoadElimination +Replacing label __b1_from___b1 with __b1 +Replacing label __b3_from___b3 with __b3 +Replacing label __b6_from___b5 with __b6 +Replacing label __b3_from___b7 with __b3 +Replacing label __b1_from___b2 with __b1 +Replacing label plexFreePrepare1___b1_from_plexFreePrepare1___b1 with plexFreePrepare1___b1 +Replacing label __b1_from___b1 with __b1 +Replacing label __b1_from___b1 with __b1 +Replacing label __b8_from___b6 with __b5 +Replacing label __b3_from___b5 with __b3 +Replacing label __b5_from___b4 with __b5 +Replacing label __b4_from___b3 with __b4 +Replacing label __b3_from___b5 with __b3 +Replacing label __b8_from___b6 with __b8 +Replacing label __b2_from___b8 with __b2 +Replacing label __b1_from___b9 with __b1 +Replacing label __b3_from___b7 with __b3 +Removing instruction __b1: +Removing instruction __b4_from___b3: +Removing instruction __bend_from___b4: +Removing instruction __b9_from___b8: +Removing instruction toD0181_from___b9: +Removing instruction toD0181: +Removing instruction toSpritePtr1_from___b7: +Removing instruction __b1_from_toSpritePtr1: +Removing instruction __b1_from___b1: +Removing instruction __b3_from___b3: +Removing instruction __b4_from___b3: +Removing instruction __b10_from___b4: +Removing instruction __b6_from___b5: +Removing instruction __b12_from___b6: +Removing instruction __b1_from___b2: +Removing instruction __b3_from___b5: +Removing instruction __b3_from___b7: +Removing instruction plexFreePrepare1_from___b6: +Removing instruction plexFreePrepare1___b1_from_plexFreePrepare1: +Removing instruction plexFreePrepare1___b1_from_plexFreePrepare1___b1: +Removing instruction __b1_from___b1: +Removing instruction plexSetScreen1_from_plexInit: +Removing instruction __b1_from_plexSetScreen1: +Removing instruction __b1_from___b1: +Removing instruction __b3_from___b5: +Removing instruction __b8_from___b6: +Removing instruction __b8: +Removing instruction __b5_from___b4: +Removing instruction __b5_from___b8: +Removing instruction __b1_from___b9: +Removing instruction __b2_from___b8: +Removing instruction __b3_from___b5: +Removing instruction __b4_from___b3: +Removing instruction __b5_from___b4: +Removing instruction __b8_from___b6: +Removing instruction __b3_from_plex_irq: +Removing instruction __b3_from___b7: +Succesful ASM optimization Pass5RedundantLabelElimination +Removing instruction __b2: +Removing instruction __b3: +Removing instruction __b4: +Removing instruction __bend: +Removing instruction font_2x2_from_main: +Removing instruction __b8: +Removing instruction font_2x2_to_sprites_from___b8: +Removing instruction __b9: +Removing instruction plexInit_from___b9: +Removing instruction __b7: +Removing instruction toSpritePtr1: +Removing instruction __b2: +Removing instruction __b3_from___b2: +Removing instruction __b4: +Removing instruction plexSine_from___b4: +Removing instruction __b10: +Removing instruction plexSort_from___b10: +Removing instruction __b11: +Removing instruction plexSine_from___b6: +Removing instruction __b12: +Removing instruction plexSort_from___b12: +Removing instruction __b13: +Removing instruction __b1_from_plexSort: +Removing instruction __b5: +Removing instruction __b7: +Removing instruction __b6: +Removing instruction plexFreePrepare1: +Removing instruction plexFreePrepare1___b2: +Removing instruction __breturn: +Removing instruction __b1_from_plexSine: +Removing instruction __b2: +Removing instruction __breturn: +Removing instruction plexSetScreen1: +Removing instruction __breturn: +Removing instruction __b1_from_font_2x2_to_sprites: +Removing instruction __breturn: +Removing instruction __b3_from___b2: +Removing instruction __b6: +Removing instruction __b5_from___b6: +Removing instruction __b7: +Removing instruction __b1_from___b7: +Removing instruction __b1_from_font_2x2: +Removing instruction __b2_from___b1: +Removing instruction __b3_from___b2: +Removing instruction __b5_from___b3: +Removing instruction __b6: +Removing instruction __b7: +Removing instruction __b8_from___b7: +Removing instruction __b9: +Removing instruction __breturn: +Removing instruction plexFreeNextYpos1: +Removing instruction __b6: +Removing instruction __b7: +Removing instruction __b5: +Removing instruction __breturn: +Removing instruction plexFreeAdd1: +Removing instruction __b5: +Removing instruction __b3: +Removing instruction __b4: +Succesful ASM optimization Pass5UnusedLabelElimination +Adding RTS to root block +Succesful ASM optimization Pass5AddMainRts +Removing instruction jmp __b1 +Removing instruction jmp __b3 +Removing instruction jmp __b1 +Removing instruction jmp plexFreePrepare1___b1 +Removing instruction jmp __b1 +Removing instruction jmp __b1 +Removing instruction jmp __b3 +Removing instruction jmp __b5 +Removing instruction jmp __b1 +Removing instruction jmp __b2 +Removing instruction jmp __b3 +Removing instruction jmp __b8 +Succesful ASM optimization Pass5NextJumpElimination +Removing instruction lda #0 +Removing instruction ldx.z m +Removing instruction lda #0 +Removing instruction lda #8 +Removing instruction ldx.z plex_show_idx +Succesful ASM optimization Pass5UnnecesaryLoadElimination +Fixing long branch [495] bne __b1 to beq + +FINAL SYMBOL TABLE +(label) @1 +(label) @2 +(label) @3 +(label) @4 +(label) @begin +(label) @end +(const nomodify byte*) CHARGEN = (byte*) 53248 +(const nomodify byte*) CHARSET_DEFAULT = (byte*) 4096 +(const nomodify byte*) CIA1_INTERRUPT = (byte*) 56333 +(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f +(const nomodify byte*) D018 = (byte*) 53272 +(const nomodify byte*) FONT = (byte*) 8192 +(const nomodify byte*) IRQ_ENABLE = (byte*) 53274 +(const nomodify byte) IRQ_RASTER = (byte) 1 +(const nomodify byte*) IRQ_STATUS = (byte*) 53273 +(const nomodify void()**) KERNEL_IRQ = (void()**) 788 +(const nomodify byte) PLEX_COUNT = (byte) $20 +(const byte*) PLEX_FREE_YPOS[(number) 8] = { fill( 8, 0) } +(const byte*) PLEX_PTR[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) } +(byte*) PLEX_SCREEN_PTR +(const byte*) PLEX_SCREEN_PTR#0 PLEX_SCREEN_PTR = (byte*)(number) $400+(number) $3f8 +(const byte*) PLEX_SORTED_IDX[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) } +(const word*) PLEX_XPOS[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) } +(const byte*) PLEX_YPOS[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) } +(const nomodify byte*) PROCPORT = (byte*) 1 +(const nomodify byte) PROCPORT_BASIC_KERNEL_IO = (byte) 7 +(const nomodify byte) PROCPORT_RAM_CHARROM = (byte) 1 +(const nomodify byte*) RASTER = (byte*) 53266 +(const nomodify byte*) SCREEN = (byte*) 1024 +(const nomodify byte*) SPRITES = (byte*) 12288 +(const nomodify byte*) SPRITES_COLS = (byte*) 53287 +(const nomodify byte*) SPRITES_ENABLE = (byte*) 53269 +(const nomodify byte*) SPRITES_XMSB = (byte*) 53264 +(const nomodify byte*) SPRITES_XPOS = (byte*) 53248 +(const nomodify byte*) SPRITES_YPOS = (byte*) 53249 +(const nomodify byte*) VIC_CONTROL = (byte*) 53265 +(const nomodify byte) WHITE = (byte) 1 +(const byte*) YSIN[(number) $100] = kickasm {{ .fill $100, round(142+89.5*sin(toRadians(360*i/256))) + }} +(void()) font_2x2((byte*) font_2x2::font_original , (byte*) font_2x2::font_2x2) +(byte~) font_2x2::$1 reg byte a 200002.0 +(byte~) font_2x2::$11 reg byte y 20002.0 +(byte~) font_2x2::$12 reg byte a 10001.0 +(byte~) font_2x2::$14 reg byte y 20002.0 +(byte~) font_2x2::$15 reg byte a 10001.0 +(word~) font_2x2::$5 zp[2]:15 200002.0 +(word~) font_2x2::$7 zp[2]:15 200002.0 +(label) font_2x2::@1 +(label) font_2x2::@2 +(label) font_2x2::@3 +(label) font_2x2::@4 +(label) font_2x2::@5 +(label) font_2x2::@6 +(label) font_2x2::@7 +(label) font_2x2::@8 +(label) font_2x2::@9 +(label) font_2x2::@return +(byte) font_2x2::b +(byte) font_2x2::b#1 reg byte y 150001.5 +(byte) font_2x2::b#2 reg byte y 20000.2 +(byte) font_2x2::c +(byte) font_2x2::c#1 c zp[1]:10 1501.5 +(byte) font_2x2::c#11 c zp[1]:10 58.88235294117647 +(byte*) font_2x2::font_2x2 +(byte*) font_2x2::font_original +(byte) font_2x2::glyph_bit +(byte) font_2x2::glyph_bit#0 reg byte x 50000.5 +(byte) font_2x2::glyph_bits +(byte) font_2x2::glyph_bits#0 glyph_bits zp[1]:24 20002.0 +(byte) font_2x2::glyph_bits#1 glyph_bits zp[1]:24 66667.33333333333 +(byte) font_2x2::glyph_bits#2 glyph_bits zp[1]:24 34444.88888888889 +(word) font_2x2::glyph_bits_2x2 +(word) font_2x2::glyph_bits_2x2#1 glyph_bits_2x2 zp[2]:15 200002.0 +(word) font_2x2::glyph_bits_2x2#2 glyph_bits_2x2 zp[2]:15 27500.5 +(word) font_2x2::glyph_bits_2x2#3 glyph_bits_2x2 zp[2]:15 40000.4 +(byte) font_2x2::l +(byte) font_2x2::l#1 l zp[1]:22 15001.5 +(byte) font_2x2::l#2 l zp[1]:22 1111.2222222222222 +(byte) font_2x2::l2 +(byte) font_2x2::l2#1 l2 zp[1]:23 15001.5 +(byte) font_2x2::l2#8 l2 zp[1]:23 2727.5454545454545 +(byte) font_2x2::l2#9 l2 zp[1]:23 6667.333333333333 +(byte*) font_2x2::next_2x2 +(byte*) font_2x2::next_2x2#1 next_2x2 zp[2]:6 500.5 +(byte*) font_2x2::next_2x2_left +(byte*) font_2x2::next_2x2_left#0 next_2x2_left zp[2]:6 750.1875 +(byte*) font_2x2::next_2x2_left#1 next_2x2_left_1 zp[2]:11 10001.0 +(byte*) font_2x2::next_2x2_left#10 next_2x2_left_1 zp[2]:11 2002.0 +(byte*) font_2x2::next_2x2_left#7 next_2x2_left_1 zp[2]:11 1708.5416666666665 +(byte*) font_2x2::next_2x2_left#8 next_2x2_left_1 zp[2]:11 10001.0 +(byte*) font_2x2::next_2x2_right +(byte*) font_2x2::next_2x2_right#0 next_2x2_right zp[2]:13 1001.0 +(byte*) font_2x2::next_2x2_right#1 next_2x2_right zp[2]:13 20002.0 +(byte*) font_2x2::next_2x2_right#7 next_2x2_right zp[2]:13 1708.5416666666665 +(byte*) font_2x2::next_2x2_right#8 next_2x2_right zp[2]:13 10001.0 +(byte*) font_2x2::next_original +(byte*) font_2x2::next_original#1 next_original zp[2]:8 667.3333333333334 +(byte*) font_2x2::next_original#4 next_original zp[2]:8 363.7272727272727 +(void()) font_2x2_to_sprites((byte*) font_2x2_to_sprites::font_2x2 , (byte*) font_2x2_to_sprites::sprites , (byte) font_2x2_to_sprites::num_chars) +(byte~) font_2x2_to_sprites::$3 zp[1]:24 10001.0 +(label) font_2x2_to_sprites::@1 +(label) font_2x2_to_sprites::@2 +(label) font_2x2_to_sprites::@3 +(label) font_2x2_to_sprites::@4 +(label) font_2x2_to_sprites::@5 +(label) font_2x2_to_sprites::@6 +(label) font_2x2_to_sprites::@7 +(label) font_2x2_to_sprites::@8 +(label) font_2x2_to_sprites::@return +(byte) font_2x2_to_sprites::c +(byte) font_2x2_to_sprites::c#1 c zp[1]:5 2002.0 +(byte) font_2x2_to_sprites::c#2 c zp[1]:5 136.5 +(byte*) font_2x2_to_sprites::char_current +(byte*) font_2x2_to_sprites::char_current#1 char_current zp[2]:6 667.3333333333334 +(byte*) font_2x2_to_sprites::char_current#2 char_current zp[2]:6 1200.3 +(byte*) font_2x2_to_sprites::char_left +(byte*) font_2x2_to_sprites::char_left#1 char_left zp[2]:11 10001.0 +(byte*) font_2x2_to_sprites::char_left#3 char_left zp[2]:11 2818.5454545454545 +(byte*) font_2x2_to_sprites::char_left#4 char_left zp[2]:11 10001.0 +(byte*) font_2x2_to_sprites::char_left#6 char_left zp[2]:11 2002.0 +(byte*) font_2x2_to_sprites::char_right +(byte*) font_2x2_to_sprites::char_right#0 char_right zp[2]:13 1001.0 +(byte*) font_2x2_to_sprites::char_right#1 char_right zp[2]:13 20002.0 +(byte*) font_2x2_to_sprites::char_right#3 char_right zp[2]:13 2818.5454545454545 +(byte*) font_2x2_to_sprites::char_right#4 char_right zp[2]:13 10001.0 +(byte*) font_2x2_to_sprites::font_2x2 +(byte) font_2x2_to_sprites::i +(byte) font_2x2_to_sprites::i#1 reg byte x 15001.5 +(byte) font_2x2_to_sprites::i#2 reg byte x 3571.7857142857147 +(byte) font_2x2_to_sprites::num_chars +(const byte) font_2x2_to_sprites::num_chars#0 num_chars = (byte) $40 +(byte*) font_2x2_to_sprites::sprite +(byte*) font_2x2_to_sprites::sprite#1 sprite zp[2]:8 1001.0 +(byte*) font_2x2_to_sprites::sprite#4 sprite zp[2]:8 1524.047619047619 +(byte) font_2x2_to_sprites::sprite_idx +(byte) font_2x2_to_sprites::sprite_idx#1 sprite_idx zp[1]:10 15001.5 +(byte) font_2x2_to_sprites::sprite_idx#2 reg byte y 15001.5 +(byte) font_2x2_to_sprites::sprite_idx#3 sprite_idx zp[1]:10 2222.4444444444443 +(byte) font_2x2_to_sprites::sprite_idx#4 sprite_idx zp[1]:10 10001.0 +(byte*) font_2x2_to_sprites::sprites +(volatile bool) framedone loadstore zp[1]:21 27.65 +(void()) main() +(byte~) main::$12 reg byte a 202.0 +(label) main::@1 +(label) main::@10 +(label) main::@11 +(label) main::@12 +(label) main::@13 +(label) main::@2 +(label) main::@3 +(label) main::@4 +(label) main::@5 +(label) main::@6 +(label) main::@7 +(label) main::@8 +(label) main::@9 +(byte) main::s +(byte) main::s#1 reg byte x 151.5 +(byte) main::s#2 reg byte x 67.33333333333333 +(byte) main::s1 +(byte) main::s1#1 reg byte x 151.5 +(byte) main::s1#2 reg byte x 151.5 +(byte) main::sprite +(byte) main::sprite#1 sprite zp[1]:4 33.666666666666664 +(byte) main::sprite#2 sprite zp[1]:4 151.5 +(label) main::toD0181 +(byte*) main::toD0181_gfx +(byte) main::toD0181_return +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const nomodify byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const nomodify byte*) CHARSET_DEFAULT/(byte) 4&(byte) $f +(byte*) main::toD0181_screen +(label) main::toSpritePtr1 +(byte) main::toSpritePtr1_return +(const byte) main::toSpritePtr1_return#0 toSpritePtr1_return = (byte)(word)(const nomodify byte*) SPRITES/(byte) $40 +(byte*) main::toSpritePtr1_sprite +(word) main::xp +(word) main::xp#1 xp zp[2]:2 67.33333333333333 +(word) main::xp#2 xp zp[2]:2 60.599999999999994 +(void()) plexInit((byte*) plexInit::screen) +(label) plexInit::@1 +(label) plexInit::@return +(byte) plexInit::i +(byte) plexInit::i#1 reg byte x 1501.5 +(byte) plexInit::i#2 reg byte x 2002.0 +(label) plexInit::plexSetScreen1 +(byte*) plexInit::plexSetScreen1_screen +(byte*) plexInit::screen +(void()) plexShowSprite() +(byte~) plexShowSprite::$11 reg byte x 101.0 +(byte~) plexShowSprite::$2 reg byte a 202.0 +(byte~) plexShowSprite::$3 reg byte a 202.0 +(byte~) plexShowSprite::$5 reg byte x 202.0 +(byte~) plexShowSprite::$6 reg byte a 202.0 +(byte~) plexShowSprite::$9 reg byte a 202.0 +(label) plexShowSprite::@1 +(label) plexShowSprite::@2 +(label) plexShowSprite::@3 +(label) plexShowSprite::@4 +(label) plexShowSprite::@5 +(label) plexShowSprite::@return +(label) plexShowSprite::plexFreeAdd1 +(byte~) plexShowSprite::plexFreeAdd1_$0 reg byte a 202.0 +(byte~) plexShowSprite::plexFreeAdd1_$1 reg byte a 202.0 +(byte~) plexShowSprite::plexFreeAdd1_$2 reg byte a 202.0 +(byte) plexShowSprite::plexFreeAdd1_ypos +(byte) plexShowSprite::plexFreeAdd1_ypos#0 reg byte a 151.5 +(byte) plexShowSprite::plex_sprite_idx2 +(byte) plexShowSprite::plex_sprite_idx2#0 plex_sprite_idx2 zp[1]:26 25.25 +(byte) plexShowSprite::xpos_idx +(byte) plexShowSprite::xpos_idx#0 reg byte a 202.0 +(byte) plexShowSprite::ypos +(void()) plexSine() +(label) plexSine::@1 +(label) plexSine::@2 +(label) plexSine::@return +(byte) plexSine::sy +(byte) plexSine::sy#1 reg byte y 150001.5 +(byte) plexSine::sy#2 reg byte y 100001.0 +(byte) plexSine::y_idx +(byte) plexSine::y_idx#0 reg byte x 2002.0 +(byte) plexSine::y_idx#1 reg byte x 66667.33333333333 +(byte) plexSine::y_idx#2 reg byte x 150502.0 +(void()) plexSort() +(label) plexSort::@1 +(label) plexSort::@2 +(label) plexSort::@3 +(label) plexSort::@4 +(label) plexSort::@5 +(label) plexSort::@6 +(label) plexSort::@7 +(label) plexSort::@return +(byte) plexSort::m +(byte) plexSort::m#1 m zp[1]:5 150001.5 +(byte) plexSort::m#2 m zp[1]:5 41667.08333333333 +(byte) plexSort::nxt_idx +(byte) plexSort::nxt_idx#0 nxt_idx zp[1]:22 30000.300000000003 +(byte) plexSort::nxt_y +(byte) plexSort::nxt_y#0 nxt_y zp[1]:23 150000.375 +(label) plexSort::plexFreePrepare1 +(label) plexSort::plexFreePrepare1_@1 +(label) plexSort::plexFreePrepare1_@2 +(byte) plexSort::plexFreePrepare1_s +(byte) plexSort::plexFreePrepare1_s#1 reg byte x 150001.5 +(byte) plexSort::plexFreePrepare1_s#2 reg byte x 150001.5 +(byte) plexSort::s +(byte) plexSort::s#1 reg byte x 1366668.3333333335 +(byte) plexSort::s#2 reg byte x 200002.0 +(byte) plexSort::s#3 reg byte x 2050002.5 +(byte) plexSort::s#6 reg byte x 200002.0 +(volatile byte) plex_free_next loadstore zp[1]:20 42.48387096774193 +interrupt(KERNEL_MIN)(void()) plex_irq() +(byte~) plex_irq::$4 zp[1]:25 11.0 +(label) plex_irq::@1 +(label) plex_irq::@2 +(label) plex_irq::@3 +(label) plex_irq::@4 +(label) plex_irq::@5 +(label) plex_irq::@6 +(label) plex_irq::@7 +(label) plex_irq::@return +(label) plex_irq::plexFreeNextYpos1 +(byte) plex_irq::plexFreeNextYpos1_return +(byte) plex_irq::plexFreeNextYpos1_return#0 reg byte x 4.800000000000001 +(byte) plex_irq::rasterY +(volatile byte) plex_show_idx loadstore zp[1]:17 46.0909090909091 +(volatile byte) plex_sprite_idx loadstore zp[1]:18 45.387096774193544 +(volatile byte) plex_sprite_msb loadstore zp[1]:19 48.757575757575765 +(byte) sin_idx +(byte) sin_idx#10 sin_idx zp[1]:4 300.42857142857144 +(byte) sin_idx#12 sin_idx zp[1]:4 58.0 + +reg byte x [ main::s#2 main::s#1 ] +zp[2]:2 [ main::xp#2 main::xp#1 ] +reg byte x [ main::s1#2 main::s1#1 ] +reg byte x [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] +reg byte x [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] +zp[1]:4 [ sin_idx#10 sin_idx#12 main::sprite#2 main::sprite#1 ] +reg byte x [ plexSine::y_idx#2 plexSine::y_idx#0 plexSine::y_idx#1 ] +reg byte y [ plexSine::sy#2 plexSine::sy#1 ] +reg byte x [ plexInit::i#2 plexInit::i#1 ] +zp[1]:5 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::c#1 plexSort::m#2 plexSort::m#1 ] +reg byte x [ font_2x2_to_sprites::i#2 font_2x2_to_sprites::i#1 ] +zp[2]:6 [ font_2x2::next_2x2_left#0 font_2x2::next_2x2#1 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::char_current#1 ] +zp[2]:8 [ font_2x2::next_original#4 font_2x2::next_original#1 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::sprite#1 ] +zp[1]:10 [ font_2x2::c#11 font_2x2::c#1 font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::sprite_idx#3 font_2x2_to_sprites::sprite_idx#1 ] +zp[2]:11 [ font_2x2::next_2x2_left#7 font_2x2::next_2x2_left#10 font_2x2::next_2x2_left#8 font_2x2::next_2x2_left#1 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_left#6 font_2x2_to_sprites::char_left#4 font_2x2_to_sprites::char_left#1 ] +zp[2]:13 [ font_2x2::next_2x2_right#7 font_2x2::next_2x2_right#0 font_2x2::next_2x2_right#8 font_2x2::next_2x2_right#1 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_right#4 font_2x2_to_sprites::char_right#1 ] +zp[2]:15 [ font_2x2::glyph_bits_2x2#3 font_2x2::glyph_bits_2x2#2 font_2x2::$5 font_2x2::$7 font_2x2::glyph_bits_2x2#1 ] +reg byte y [ font_2x2::b#2 font_2x2::b#1 ] +reg byte x [ font_2x2::glyph_bit#0 ] +zp[1]:17 [ plex_show_idx ] +zp[1]:18 [ plex_sprite_idx ] +zp[1]:19 [ plex_sprite_msb ] +zp[1]:20 [ plex_free_next ] +zp[1]:21 [ framedone ] +reg byte a [ main::$12 ] +zp[1]:22 [ plexSort::nxt_idx#0 font_2x2::l#2 font_2x2::l#1 ] +zp[1]:23 [ plexSort::nxt_y#0 font_2x2::l2#8 font_2x2::l2#9 font_2x2::l2#1 ] +reg byte x [ plexSort::s#2 ] +zp[1]:24 [ font_2x2_to_sprites::$3 font_2x2::glyph_bits#2 font_2x2::glyph_bits#0 font_2x2::glyph_bits#1 ] +reg byte y [ font_2x2_to_sprites::sprite_idx#2 ] +reg byte a [ font_2x2::$1 ] +reg byte a [ font_2x2::$12 ] +reg byte y [ font_2x2::$11 ] +reg byte a [ font_2x2::$15 ] +reg byte y [ font_2x2::$14 ] +reg byte x [ plex_irq::plexFreeNextYpos1_return#0 ] +zp[1]:25 [ plex_irq::$4 ] +zp[1]:26 [ plexShowSprite::plex_sprite_idx2#0 ] +reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ] +reg byte a [ plexShowSprite::plexFreeAdd1_$0 ] +reg byte a [ plexShowSprite::plexFreeAdd1_$1 ] +reg byte a [ plexShowSprite::plexFreeAdd1_$2 ] +reg byte a [ plexShowSprite::xpos_idx#0 ] +reg byte x [ plexShowSprite::$11 ] +reg byte a [ plexShowSprite::$2 ] +reg byte a [ plexShowSprite::$3 ] +reg byte a [ plexShowSprite::$9 ] +reg byte x [ plexShowSprite::$5 ] +reg byte a [ plexShowSprite::$6 ] + + +FINAL ASSEMBLER +Score: 146729 + + // File Comments +// Put a 2x2 font into sprites and show it on screen + // Upstart +.pc = $801 "Basic" +:BasicUpstart(__bbegin) +.pc = $80d "Program" + // Global Constants & labels + // Processor Port Register controlling RAM/ROM configuration and the datasette + .label PROCPORT = 1 + // RAM in $A000, $E000 CHAR ROM in $D000 + .const PROCPORT_RAM_CHARROM = 1 + // BASIC in $A000, I/O in $D000, KERNEL in $E000 + .const PROCPORT_BASIC_KERNEL_IO = 7 + // The address of the CHARGEN character set + .label CHARGEN = $d000 + .label SPRITES_XPOS = $d000 + .label SPRITES_YPOS = $d001 + .label SPRITES_XMSB = $d010 + .label RASTER = $d012 + .label SPRITES_ENABLE = $d015 + .label SPRITES_COLS = $d027 + .label VIC_CONTROL = $d011 + .label D018 = $d018 + // VIC II IRQ Status Register + .label IRQ_STATUS = $d019 + // VIC II IRQ Enable Register + .label IRQ_ENABLE = $d01a + // Bits for the IRQ Status/Enable Registers + .const IRQ_RASTER = 1 + // CIA#1 Interrupt Status & Control Register + .label CIA1_INTERRUPT = $dc0d + // Value that disables all CIA interrupts when stored to the CIA Interrupt registers + .const CIA_INTERRUPT_CLEAR = $7f + // The vector used when the KERNAL serves IRQ interrupts + .label KERNEL_IRQ = $314 + .const WHITE = 1 + // The number of sprites in the multiplexer + .const PLEX_COUNT = $20 + .label CHARSET_DEFAULT = $1000 + .label FONT = $2000 + .label SPRITES = $3000 + .label SCREEN = $400 + // The address of the sprite pointers on the current screen (screen+0x3f8). + .label PLEX_SCREEN_PTR = $400+$3f8 + .label plex_show_idx = $11 + .label plex_sprite_idx = $12 + .label plex_sprite_msb = $13 + .label plex_free_next = $14 + .label framedone = $15 + // Y-sine index + .label sin_idx = 4 + // @begin +__bbegin: + // @1 + // plex_show_idx=0 + // [1] (volatile byte) plex_show_idx ← (byte) 0 -- vbuz1=vbuc1 + // The index in the PLEX tables of the next sprite to show + lda #0 + sta.z plex_show_idx + // plex_sprite_idx=0 + // [2] (volatile byte) plex_sprite_idx ← (byte) 0 -- vbuz1=vbuc1 + // The index the next sprite to use for showing (sprites are used round-robin) + sta.z plex_sprite_idx + // plex_sprite_msb=1 + // [3] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 + // The MSB bit of the next sprite to use for showing + lda #1 + sta.z plex_sprite_msb + // @2 + // plex_free_next = 0 + // [4] (volatile byte) plex_free_next ← (byte) 0 -- vbuz1=vbuc1 + // The index of the sprite that is free next. Since sprites are used round-robin this moves forward each time a sprite is shown. + lda #0 + sta.z plex_free_next + // @3 + // framedone = false + // [5] (volatile bool) framedone ← false -- vboz1=vboc1 + sta.z framedone + // [6] phi from @3 to @4 [phi:@3->@4] + // @4 + // [7] call main + jsr main + rts + // [8] phi from @4 to @end [phi:@4->@end] + // @end + // main +main: { + .const toSpritePtr1_return = SPRITES/$40 + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>CHARSET_DEFAULT)/4&$f + .label sprite = 4 + // Set the x-positions & pointers + .label xp = 2 + // asm + // asm { sei } + // Create 2x2 font from CHARGEN + sei + // *PROCPORT = PROCPORT_RAM_CHARROM + // [10] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_CHARROM -- _deref_pbuc1=vbuc2 + lda #PROCPORT_RAM_CHARROM + sta PROCPORT + // font_2x2(CHARGEN, FONT) + // [11] call font_2x2 + // [117] phi from main to font_2x2 [phi:main->font_2x2] + jsr font_2x2 + // main::@8 + // *PROCPORT = PROCPORT_BASIC_KERNEL_IO + // [12] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_BASIC_KERNEL_IO -- _deref_pbuc1=vbuc2 + lda #PROCPORT_BASIC_KERNEL_IO + sta PROCPORT + // asm + // asm { cli } + cli + // font_2x2_to_sprites(FONT, SPRITES, 64) + // [14] call font_2x2_to_sprites + // Convert font to sprites + // [92] phi from main::@8 to font_2x2_to_sprites [phi:main::@8->font_2x2_to_sprites] + jsr font_2x2_to_sprites + // [15] phi from main::@8 to main::@9 [phi:main::@8->main::@9] + // main::@9 + // plexInit(SCREEN) + // [16] call plexInit + // Initialize the multiplexer + // [85] phi from main::@9 to plexInit [phi:main::@9->plexInit] + jsr plexInit + // [17] phi from main::@9 to main::toD0181 [phi:main::@9->main::toD0181] + // main::toD0181 + // main::@7 + // *D018 = toD018(SCREEN, CHARSET_DEFAULT) + // [18] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 -- _deref_pbuc1=vbuc2 + // Show screen + lda #toD0181_return + sta D018 + // [19] phi from main::@7 to main::toSpritePtr1 [phi:main::@7->main::toSpritePtr1] + // main::toSpritePtr1 + // [20] phi from main::toSpritePtr1 to main::@1 [phi:main::toSpritePtr1->main::@1] + // [20] phi (word) main::xp#2 = (word) $18 [phi:main::toSpritePtr1->main::@1#0] -- vwuz1=vwuc1 + lda #<$18 + sta.z xp + lda #>$18 + sta.z xp+1 + // [20] phi (byte) main::s#2 = (byte) 0 [phi:main::toSpritePtr1->main::@1#1] -- vbuxx=vbuc1 + ldx #0 + // [20] phi (byte) main::sprite#2 = (const byte) main::toSpritePtr1_return#0 [phi:main::toSpritePtr1->main::@1#2] -- vbuz1=vbuc1 + lda #toSpritePtr1_return + sta.z sprite + // [20] phi from main::@1 to main::@1 [phi:main::@1->main::@1] + // [20] phi (word) main::xp#2 = (word) main::xp#1 [phi:main::@1->main::@1#0] -- register_copy + // [20] phi (byte) main::s#2 = (byte) main::s#1 [phi:main::@1->main::@1#1] -- register_copy + // [20] phi (byte) main::sprite#2 = (byte) main::sprite#1 [phi:main::@1->main::@1#2] -- register_copy + // main::@1 + __b1: + // PLEX_PTR[s] = sprite++ + // [21] *((const byte*) PLEX_PTR + (byte) main::s#2) ← (byte) main::sprite#2 -- pbuc1_derefidx_vbuxx=vbuz1 + lda.z sprite + sta PLEX_PTR,x + // PLEX_PTR[s] = sprite++; + // [22] (byte) main::sprite#1 ← ++ (byte) main::sprite#2 -- vbuz1=_inc_vbuz1 + inc.z sprite + // PLEX_XPOS[s] = xp + // [23] (byte~) main::$12 ← (byte) main::s#2 << (byte) 1 -- vbuaa=vbuxx_rol_1 + txa + asl + // [24] *((const word*) PLEX_XPOS + (byte~) main::$12) ← (word) main::xp#2 -- pwuc1_derefidx_vbuaa=vwuz1 + tay + lda.z xp + sta PLEX_XPOS,y + lda.z xp+1 + sta PLEX_XPOS+1,y + // xp += 10 + // [25] (word) main::xp#1 ← (word) main::xp#2 + (byte) $a -- vwuz1=vwuz1_plus_vbuc1 + lda #$a + clc + adc.z xp + sta.z xp + bcc !+ + inc.z xp+1 + !: + // for(char s: 0..PLEX_COUNT-1) + // [26] (byte) main::s#1 ← ++ (byte) main::s#2 -- vbuxx=_inc_vbuxx + inx + // [27] if((byte) main::s#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto main::@1 -- vbuxx_neq_vbuc1_then_la1 + cpx #PLEX_COUNT-1+1 + bne __b1 + // main::@2 + // *SPRITES_ENABLE = 0xff + // [28] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2 + // Enable & initialize sprites + lda #$ff + sta SPRITES_ENABLE + // [29] phi from main::@2 to main::@3 [phi:main::@2->main::@3] + // [29] phi (byte) main::s1#2 = (byte) 0 [phi:main::@2->main::@3#0] -- vbuxx=vbuc1 + ldx #0 + // [29] phi from main::@3 to main::@3 [phi:main::@3->main::@3] + // [29] phi (byte) main::s1#2 = (byte) main::s1#1 [phi:main::@3->main::@3#0] -- register_copy + // main::@3 + __b3: + // SPRITES_COLS[s] = WHITE + // [30] *((const nomodify byte*) SPRITES_COLS + (byte) main::s1#2) ← (const nomodify byte) WHITE -- pbuc1_derefidx_vbuxx=vbuc2 + lda #WHITE + sta SPRITES_COLS,x + // for(char s: 0..7) + // [31] (byte) main::s1#1 ← ++ (byte) main::s1#2 -- vbuxx=_inc_vbuxx + inx + // [32] if((byte) main::s1#1!=(byte) 8) goto main::@3 -- vbuxx_neq_vbuc1_then_la1 + cpx #8 + bne __b3 + // [33] phi from main::@3 to main::@4 [phi:main::@3->main::@4] + // main::@4 + // plexSine() + // [34] call plexSine + // Move the sprites + // [76] phi from main::@4 to plexSine [phi:main::@4->plexSine] + // [76] phi (byte) sin_idx#10 = (byte) 0 [phi:main::@4->plexSine#0] -- vbuz1=vbuc1 + lda #0 + sta.z sin_idx + jsr plexSine + // [35] phi from main::@4 to main::@10 [phi:main::@4->main::@10] + // main::@10 + // plexSort() + // [36] call plexSort + // Sort the sprites by y-position + // [51] phi from main::@10 to plexSort [phi:main::@10->plexSort] + jsr plexSort + // main::@11 + // asm + // asm { sei } + // Enable the plex IRQ + sei + // *CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR + // [38] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 + // Disable CIA 1 Timer IRQ + lda #CIA_INTERRUPT_CLEAR + sta CIA1_INTERRUPT + // *VIC_CONTROL &=0x7f + // [39] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // Set raster line to 0x00 + lda #$7f + and VIC_CONTROL + sta VIC_CONTROL + // *RASTER = 0x28 + // [40] *((const nomodify byte*) RASTER) ← (byte) $28 -- _deref_pbuc1=vbuc2 + lda #$28 + sta RASTER + // *IRQ_ENABLE = IRQ_RASTER + // [41] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // Enable Raster Interrupt + lda #IRQ_RASTER + sta IRQ_ENABLE + // *IRQ_STATUS = IRQ_RASTER + // [42] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // Acknowledge any IRQ + sta IRQ_STATUS + // *KERNEL_IRQ = &plex_irq + // [43] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() -- _deref_pptc1=pprc2 + // Set the IRQ routine + lda #plex_irq + sta KERNEL_IRQ+1 + // asm + // asm { cli } + cli + // main::@5 + __b5: + // while(!framedone) + // [45] if((volatile bool) framedone) goto main::@6 -- vboz1_then_la1 + lda.z framedone + cmp #0 + bne __b6 + jmp __b5 + // [46] phi from main::@5 to main::@6 [phi:main::@5->main::@6] + // main::@6 + __b6: + // plexSine() + // [47] call plexSine + //*BORDERCOL = RED; + // Move the sprites + // [76] phi from main::@6 to plexSine [phi:main::@6->plexSine] + // [76] phi (byte) sin_idx#10 = (byte) sin_idx#12 [phi:main::@6->plexSine#0] -- register_copy + jsr plexSine + // [48] phi from main::@6 to main::@12 [phi:main::@6->main::@12] + // main::@12 + // plexSort() + // [49] call plexSort + // Sort the sprites by y-position + // [51] phi from main::@12 to plexSort [phi:main::@12->plexSort] + jsr plexSort + // main::@13 + // framedone = false + // [50] (volatile bool) framedone ← false -- vboz1=vboc1 + //*BORDERCOL = GREEN; + lda #0 + sta.z framedone + jmp __b5 +} + // plexSort +// Ensure that the indices in PLEX_SORTED_IDX is sorted based on the y-positions in PLEX_YPOS +// Assumes that the positions are nearly sorted already (as each sprite just moves a bit) +// Uses an insertion sort: +// 1. Moves a marker (m) from the start to end of the array. Every time the marker moves forward all elements before the marker are sorted correctly. +// 2a. If the next element after the marker is larger that the current element +// the marker can be moved forwards (as the sorting is correct). +// 2b. If the next element after the marker is smaller than the current element: +// elements before the marker are shifted right one at a time until encountering one smaller than the current one. +// It is then inserted at the spot. Now the marker can move forward. +plexSort: { + .label nxt_idx = $16 + .label nxt_y = $17 + .label m = 5 + // [52] phi from plexSort to plexSort::@1 [phi:plexSort->plexSort::@1] + // [52] phi (byte) plexSort::m#2 = (byte) 0 [phi:plexSort->plexSort::@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z m + // [52] phi from plexSort::@2 to plexSort::@1 [phi:plexSort::@2->plexSort::@1] + // [52] phi (byte) plexSort::m#2 = (byte) plexSort::m#1 [phi:plexSort::@2->plexSort::@1#0] -- register_copy + // plexSort::@1 + __b1: + // nxt_idx = PLEX_SORTED_IDX[m+1] + // [53] (byte) plexSort::nxt_idx#0 ← *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2) -- vbuz1=pbuc1_derefidx_vbuz2 + ldy.z m + lda PLEX_SORTED_IDX+1,y + sta.z nxt_idx + // nxt_y = PLEX_YPOS[nxt_idx] + // [54] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0) -- vbuz1=pbuc1_derefidx_vbuz2 + tay + lda PLEX_YPOS,y + sta.z nxt_y + // if(nxt_y=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 -- vbuz1_ge_pbuc1_derefidx_(pbuc2_derefidx_vbuz2)_then_la1 + ldx.z m + ldy PLEX_SORTED_IDX,x + cmp PLEX_YPOS,y + bcs __b2 + // plexSort::@5 + // [56] (byte) plexSort::s#6 ← (byte) plexSort::m#2 -- vbuxx=vbuz1 + // [57] phi from plexSort::@5 plexSort::@7 to plexSort::@3 [phi:plexSort::@5/plexSort::@7->plexSort::@3] + // [57] phi (byte) plexSort::s#3 = (byte) plexSort::s#6 [phi:plexSort::@5/plexSort::@7->plexSort::@3#0] -- register_copy + // plexSort::@3 + __b3: + // PLEX_SORTED_IDX[s+1] = PLEX_SORTED_IDX[s] + // [58] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + lda PLEX_SORTED_IDX,x + sta PLEX_SORTED_IDX+1,x + // s--; + // [59] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 -- vbuxx=_dec_vbuxx + dex + // while((s!=0xff) && (nxt_yplexSort::plexFreePrepare1] + // plexSort::plexFreePrepare1 + // [70] phi from plexSort::plexFreePrepare1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1] + // [70] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) 0 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1#0] -- vbuxx=vbuc1 + ldx #0 + // [70] phi from plexSort::plexFreePrepare1_@1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1] + // [70] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) plexSort::plexFreePrepare1_s#1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1#0] -- register_copy + // plexSort::plexFreePrepare1_@1 + plexFreePrepare1___b1: + // PLEX_FREE_YPOS[s] = 0 + // [71] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 -- pbuc1_derefidx_vbuxx=vbuc2 + lda #0 + sta PLEX_FREE_YPOS,x + // for( char s: 0..7) + // [72] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 -- vbuxx=_inc_vbuxx + inx + // [73] if((byte) plexSort::plexFreePrepare1_s#1!=(byte) 8) goto plexSort::plexFreePrepare1_@1 -- vbuxx_neq_vbuc1_then_la1 + cpx #8 + bne plexFreePrepare1___b1 + // plexSort::plexFreePrepare1_@2 + // plex_free_next = 0 + // [74] (volatile byte) plex_free_next ← (byte) 0 -- vbuz1=vbuc1 + sta.z plex_free_next + // plexSort::@return + // } + // [75] return + rts +} + // plexSine +// Move the plex sprites in an Y-sine +plexSine: { + // y_idx = sin_idx + // [77] (byte) plexSine::y_idx#0 ← (byte) sin_idx#10 -- vbuxx=vbuz1 + // Assign sinus positions + ldx.z sin_idx + // [78] phi from plexSine to plexSine::@1 [phi:plexSine->plexSine::@1] + // [78] phi (byte) plexSine::sy#2 = (byte) 0 [phi:plexSine->plexSine::@1#0] -- vbuyy=vbuc1 + ldy #0 + // [78] phi (byte) plexSine::y_idx#2 = (byte) plexSine::y_idx#0 [phi:plexSine->plexSine::@1#1] -- register_copy + // [78] phi from plexSine::@1 to plexSine::@1 [phi:plexSine::@1->plexSine::@1] + // [78] phi (byte) plexSine::sy#2 = (byte) plexSine::sy#1 [phi:plexSine::@1->plexSine::@1#0] -- register_copy + // [78] phi (byte) plexSine::y_idx#2 = (byte) plexSine::y_idx#1 [phi:plexSine::@1->plexSine::@1#1] -- register_copy + // plexSine::@1 + __b1: + // PLEX_YPOS[sy] = YSIN[y_idx] + // [79] *((const byte*) PLEX_YPOS + (byte) plexSine::sy#2) ← *((const byte*) YSIN + (byte) plexSine::y_idx#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuxx + lda YSIN,x + sta PLEX_YPOS,y + // y_idx += 8 + // [80] (byte) plexSine::y_idx#1 ← (byte) plexSine::y_idx#2 + (byte) 8 -- vbuxx=vbuxx_plus_vbuc1 + txa + axs #-[8] + // for(char sy: 0..PLEX_COUNT-1) + // [81] (byte) plexSine::sy#1 ← ++ (byte) plexSine::sy#2 -- vbuyy=_inc_vbuyy + iny + // [82] if((byte) plexSine::sy#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto plexSine::@1 -- vbuyy_neq_vbuc1_then_la1 + cpy #PLEX_COUNT-1+1 + bne __b1 + // plexSine::@2 + // sin_idx +=1 + // [83] (byte) sin_idx#12 ← (byte) sin_idx#10 + (byte) 1 -- vbuz1=vbuz1_plus_1 + inc.z sin_idx + // plexSine::@return + // } + // [84] return + rts +} + // plexInit +// Initialize the multiplexer data structures +plexInit: { + // [86] phi from plexInit to plexInit::plexSetScreen1 [phi:plexInit->plexInit::plexSetScreen1] + // plexInit::plexSetScreen1 + // [87] phi from plexInit::plexSetScreen1 to plexInit::@1 [phi:plexInit::plexSetScreen1->plexInit::@1] + // [87] phi (byte) plexInit::i#2 = (byte) 0 [phi:plexInit::plexSetScreen1->plexInit::@1#0] -- vbuxx=vbuc1 + ldx #0 + // [87] phi from plexInit::@1 to plexInit::@1 [phi:plexInit::@1->plexInit::@1] + // [87] phi (byte) plexInit::i#2 = (byte) plexInit::i#1 [phi:plexInit::@1->plexInit::@1#0] -- register_copy + // plexInit::@1 + __b1: + // PLEX_SORTED_IDX[i] = i + // [88] *((const byte*) PLEX_SORTED_IDX + (byte) plexInit::i#2) ← (byte) plexInit::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + txa + sta PLEX_SORTED_IDX,x + // for(char i: 0..PLEX_COUNT-1) + // [89] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2 -- vbuxx=_inc_vbuxx + inx + // [90] if((byte) plexInit::i#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto plexInit::@1 -- vbuxx_neq_vbuc1_then_la1 + cpx #PLEX_COUNT-1+1 + bne __b1 + // plexInit::@return + // } + // [91] return + rts +} + // font_2x2_to_sprites +// Convert a 2x2-font to sprites +// - font_2x2 The source 2x2-font +// - sprites The destination sprites +// - num_chars The number of chars to convert +font_2x2_to_sprites: { + .const num_chars = $40 + .label __3 = $18 + .label char_right = $d + .label sprite_idx = $a + .label char_left = $b + .label char_current = 6 + .label sprite = 8 + .label c = 5 + // [93] phi from font_2x2_to_sprites to font_2x2_to_sprites::@1 [phi:font_2x2_to_sprites->font_2x2_to_sprites::@1] + // [93] phi (byte*) font_2x2_to_sprites::sprite#4 = (const nomodify byte*) SPRITES [phi:font_2x2_to_sprites->font_2x2_to_sprites::@1#0] -- pbuz1=pbuc1 + lda #SPRITES + sta.z sprite+1 + // [93] phi (byte*) font_2x2_to_sprites::char_current#2 = (const nomodify byte*) FONT [phi:font_2x2_to_sprites->font_2x2_to_sprites::@1#1] -- pbuz1=pbuc1 + lda #FONT + sta.z char_current+1 + // [93] phi (byte) font_2x2_to_sprites::c#2 = (byte) 0 [phi:font_2x2_to_sprites->font_2x2_to_sprites::@1#2] -- vbuz1=vbuc1 + lda #0 + sta.z c + // font_2x2_to_sprites::@1 + __b1: + // for(char c=0;c$40*8 + sta.z char_right+1 + // [97] (byte*) font_2x2_to_sprites::char_left#6 ← (byte*) font_2x2_to_sprites::char_current#2 -- pbuz1=pbuz2 + lda.z char_current + sta.z char_left + lda.z char_current+1 + sta.z char_left+1 + // [98] phi from font_2x2_to_sprites::@2 to font_2x2_to_sprites::@3 [phi:font_2x2_to_sprites::@2->font_2x2_to_sprites::@3] + // [98] phi (byte*) font_2x2_to_sprites::char_right#3 = (byte*) font_2x2_to_sprites::char_right#0 [phi:font_2x2_to_sprites::@2->font_2x2_to_sprites::@3#0] -- register_copy + // [98] phi (byte) font_2x2_to_sprites::sprite_idx#4 = (byte) 0 [phi:font_2x2_to_sprites::@2->font_2x2_to_sprites::@3#1] -- vbuz1=vbuc1 + lda #0 + sta.z sprite_idx + // [98] phi (byte*) font_2x2_to_sprites::char_left#3 = (byte*) font_2x2_to_sprites::char_left#6 [phi:font_2x2_to_sprites::@2->font_2x2_to_sprites::@3#2] -- register_copy + // [98] phi (byte) font_2x2_to_sprites::i#2 = (byte) 0 [phi:font_2x2_to_sprites::@2->font_2x2_to_sprites::@3#3] -- vbuxx=vbuc1 + tax + // [98] phi from font_2x2_to_sprites::@5 to font_2x2_to_sprites::@3 [phi:font_2x2_to_sprites::@5->font_2x2_to_sprites::@3] + // [98] phi (byte*) font_2x2_to_sprites::char_right#3 = (byte*) font_2x2_to_sprites::char_right#4 [phi:font_2x2_to_sprites::@5->font_2x2_to_sprites::@3#0] -- register_copy + // [98] phi (byte) font_2x2_to_sprites::sprite_idx#4 = (byte) font_2x2_to_sprites::sprite_idx#3 [phi:font_2x2_to_sprites::@5->font_2x2_to_sprites::@3#1] -- register_copy + // [98] phi (byte*) font_2x2_to_sprites::char_left#3 = (byte*) font_2x2_to_sprites::char_left#4 [phi:font_2x2_to_sprites::@5->font_2x2_to_sprites::@3#2] -- register_copy + // [98] phi (byte) font_2x2_to_sprites::i#2 = (byte) font_2x2_to_sprites::i#1 [phi:font_2x2_to_sprites::@5->font_2x2_to_sprites::@3#3] -- register_copy + // font_2x2_to_sprites::@3 + __b3: + // i&7 + // [99] (byte~) font_2x2_to_sprites::$3 ← (byte) font_2x2_to_sprites::i#2 & (byte) 7 -- vbuz1=vbuxx_band_vbuc1 + lda #7 + sax.z __3 + // sprite[sprite_idx++] = char_left[i&7] + // [100] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#4) ← *((byte*) font_2x2_to_sprites::char_left#3 + (byte~) font_2x2_to_sprites::$3) -- pbuz1_derefidx_vbuz2=pbuz3_derefidx_vbuz4 + ldy.z __3 + lda (char_left),y + ldy.z sprite_idx + sta (sprite),y + // sprite[sprite_idx++] = char_left[i&7]; + // [101] (byte) font_2x2_to_sprites::sprite_idx#1 ← ++ (byte) font_2x2_to_sprites::sprite_idx#4 -- vbuz1=_inc_vbuz1 + inc.z sprite_idx + // sprite[sprite_idx++] = char_right[i&7] + // [102] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#1) ← *((byte*) font_2x2_to_sprites::char_right#3 + (byte~) font_2x2_to_sprites::$3) -- pbuz1_derefidx_vbuz2=pbuz3_derefidx_vbuz4 + ldy.z __3 + lda (char_right),y + ldy.z sprite_idx + sta (sprite),y + // sprite[sprite_idx++] = char_right[i&7]; + // [103] (byte) font_2x2_to_sprites::sprite_idx#2 ← ++ (byte) font_2x2_to_sprites::sprite_idx#1 -- vbuyy=_inc_vbuz1 + iny + // sprite[sprite_idx++] = 0x00 + // [104] *((byte*) font_2x2_to_sprites::sprite#4 + (byte) font_2x2_to_sprites::sprite_idx#2) ← (byte) 0 -- pbuz1_derefidx_vbuyy=vbuc1 + lda #0 + sta (sprite),y + // sprite[sprite_idx++] = 0x00; + // [105] (byte) font_2x2_to_sprites::sprite_idx#3 ← ++ (byte) font_2x2_to_sprites::sprite_idx#2 -- vbuz1=_inc_vbuyy + iny + sty.z sprite_idx + // if(i==7) + // [106] if((byte) font_2x2_to_sprites::i#2==(byte) 7) goto font_2x2_to_sprites::@4 -- vbuxx_eq_vbuc1_then_la1 + cpx #7 + beq __b4 + // font_2x2_to_sprites::@6 + // if(i==15) + // [107] if((byte) font_2x2_to_sprites::i#2!=(byte) $f) goto font_2x2_to_sprites::@8 -- vbuxx_neq_vbuc1_then_la1 + cpx #$f + bne __b5 + // [109] phi from font_2x2_to_sprites::@6 to font_2x2_to_sprites::@5 [phi:font_2x2_to_sprites::@6->font_2x2_to_sprites::@5] + // [109] phi (byte*) font_2x2_to_sprites::char_right#4 = (const nomodify byte*) FONT+(byte) ' '*(byte) 8 [phi:font_2x2_to_sprites::@6->font_2x2_to_sprites::@5#0] -- pbuz1=pbuc1 + lda #FONT+' '*8 + sta.z char_right+1 + // [109] phi (byte*) font_2x2_to_sprites::char_left#4 = (const nomodify byte*) FONT+(byte) ' '*(byte) 8 [phi:font_2x2_to_sprites::@6->font_2x2_to_sprites::@5#1] -- pbuz1=pbuc1 + lda #FONT+' '*8 + sta.z char_left+1 + // [108] phi from font_2x2_to_sprites::@6 to font_2x2_to_sprites::@8 [phi:font_2x2_to_sprites::@6->font_2x2_to_sprites::@8] + // font_2x2_to_sprites::@8 + // [109] phi from font_2x2_to_sprites::@4 font_2x2_to_sprites::@8 to font_2x2_to_sprites::@5 [phi:font_2x2_to_sprites::@4/font_2x2_to_sprites::@8->font_2x2_to_sprites::@5] + // [109] phi (byte*) font_2x2_to_sprites::char_right#4 = (byte*) font_2x2_to_sprites::char_right#1 [phi:font_2x2_to_sprites::@4/font_2x2_to_sprites::@8->font_2x2_to_sprites::@5#0] -- register_copy + // [109] phi (byte*) font_2x2_to_sprites::char_left#4 = (byte*) font_2x2_to_sprites::char_left#1 [phi:font_2x2_to_sprites::@4/font_2x2_to_sprites::@8->font_2x2_to_sprites::@5#1] -- register_copy + // font_2x2_to_sprites::@5 + __b5: + // for(char i: 0..20) + // [110] (byte) font_2x2_to_sprites::i#1 ← ++ (byte) font_2x2_to_sprites::i#2 -- vbuxx=_inc_vbuxx + inx + // [111] if((byte) font_2x2_to_sprites::i#1!=(byte) $15) goto font_2x2_to_sprites::@3 -- vbuxx_neq_vbuc1_then_la1 + cpx #$15 + bne __b3 + // font_2x2_to_sprites::@7 + // char_current += 8 + // [112] (byte*) font_2x2_to_sprites::char_current#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (byte) 8 -- pbuz1=pbuz1_plus_vbuc1 + lda #8 + clc + adc.z char_current + sta.z char_current + bcc !+ + inc.z char_current+1 + !: + // sprite += 0x40 + // [113] (byte*) font_2x2_to_sprites::sprite#1 ← (byte*) font_2x2_to_sprites::sprite#4 + (byte) $40 -- pbuz1=pbuz1_plus_vbuc1 + lda #$40 + clc + adc.z sprite + sta.z sprite + bcc !+ + inc.z sprite+1 + !: + // for(char c=0;cfont_2x2_to_sprites::@1] + // [93] phi (byte*) font_2x2_to_sprites::sprite#4 = (byte*) font_2x2_to_sprites::sprite#1 [phi:font_2x2_to_sprites::@7->font_2x2_to_sprites::@1#0] -- register_copy + // [93] phi (byte*) font_2x2_to_sprites::char_current#2 = (byte*) font_2x2_to_sprites::char_current#1 [phi:font_2x2_to_sprites::@7->font_2x2_to_sprites::@1#1] -- register_copy + // [93] phi (byte) font_2x2_to_sprites::c#2 = (byte) font_2x2_to_sprites::c#1 [phi:font_2x2_to_sprites::@7->font_2x2_to_sprites::@1#2] -- register_copy + jmp __b1 + // font_2x2_to_sprites::@4 + __b4: + // char_left = char_current + 0x80*8 + // [115] (byte*) font_2x2_to_sprites::char_left#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $80*(number) 8 -- pbuz1=pbuz2_plus_vwuc1 + lda.z char_current + clc + adc #<$80*8 + sta.z char_left + lda.z char_current+1 + adc #>$80*8 + sta.z char_left+1 + // char_right = char_current + 0xc0*8 + // [116] (byte*) font_2x2_to_sprites::char_right#1 ← (byte*) font_2x2_to_sprites::char_current#2 + (word)(number) $c0*(number) 8 -- pbuz1=pbuz2_plus_vwuc1 + lda.z char_current + clc + adc #<$c0*8 + sta.z char_right + lda.z char_current+1 + adc #>$c0*8 + sta.z char_right+1 + jmp __b5 +} + // font_2x2 +// Create a 2x2-font by doubling all pixels of the 64 first chars +// The font layout is: +// - 0x00 - 0x3f Upper left glyphs +// - 0x40 - 0x7f Upper right glyphs +// - 0x80 - 0xbf Lower left glyphs +// - 0xc0 - 0xff Lower right glyphs +font_2x2: { + .label __5 = $f + .label __7 = $f + .label next_2x2_left = 6 + .label next_2x2_right = $d + .label glyph_bits = $18 + .label glyph_bits_2x2 = $f + .label l2 = $17 + .label l = $16 + .label next_2x2_left_1 = $b + .label next_2x2 = 6 + .label next_original = 8 + .label c = $a + // [118] phi from font_2x2 to font_2x2::@1 [phi:font_2x2->font_2x2::@1] + // [118] phi (byte) font_2x2::c#11 = (byte) 0 [phi:font_2x2->font_2x2::@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z c + // [118] phi (byte*) font_2x2::next_original#4 = (const nomodify byte*) CHARGEN [phi:font_2x2->font_2x2::@1#1] -- pbuz1=pbuc1 + lda #CHARGEN + sta.z next_original+1 + // [118] phi (byte*) font_2x2::next_2x2_left#0 = (const nomodify byte*) FONT [phi:font_2x2->font_2x2::@1#2] -- pbuz1=pbuc1 + lda #FONT + sta.z next_2x2_left+1 + // [118] phi from font_2x2::@9 to font_2x2::@1 [phi:font_2x2::@9->font_2x2::@1] + // [118] phi (byte) font_2x2::c#11 = (byte) font_2x2::c#1 [phi:font_2x2::@9->font_2x2::@1#0] -- register_copy + // [118] phi (byte*) font_2x2::next_original#4 = (byte*) font_2x2::next_original#1 [phi:font_2x2::@9->font_2x2::@1#1] -- register_copy + // [118] phi (byte*) font_2x2::next_2x2_left#0 = (byte*) font_2x2::next_2x2#1 [phi:font_2x2::@9->font_2x2::@1#2] -- register_copy + // font_2x2::@1 + __b1: + // next_2x2_right = next_2x2 + 0x40*8 + // [119] (byte*) font_2x2::next_2x2_right#0 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $40*(number) 8 -- pbuz1=pbuz2_plus_vwuc1 + lda.z next_2x2_left + clc + adc #<$40*8 + sta.z next_2x2_right + lda.z next_2x2_left+1 + adc #>$40*8 + sta.z next_2x2_right+1 + // [120] (byte*) font_2x2::next_2x2_left#10 ← (byte*) font_2x2::next_2x2_left#0 -- pbuz1=pbuz2 + lda.z next_2x2_left + sta.z next_2x2_left_1 + lda.z next_2x2_left+1 + sta.z next_2x2_left_1+1 + // [121] phi from font_2x2::@1 to font_2x2::@2 [phi:font_2x2::@1->font_2x2::@2] + // [121] phi (byte*) font_2x2::next_2x2_right#7 = (byte*) font_2x2::next_2x2_right#0 [phi:font_2x2::@1->font_2x2::@2#0] -- register_copy + // [121] phi (byte) font_2x2::l2#8 = (byte) 0 [phi:font_2x2::@1->font_2x2::@2#1] -- vbuz1=vbuc1 + lda #0 + sta.z l2 + // [121] phi (byte*) font_2x2::next_2x2_left#7 = (byte*) font_2x2::next_2x2_left#10 [phi:font_2x2::@1->font_2x2::@2#2] -- register_copy + // [121] phi (byte) font_2x2::l#2 = (byte) 0 [phi:font_2x2::@1->font_2x2::@2#3] -- vbuz1=vbuc1 + sta.z l + // [121] phi from font_2x2::@8 to font_2x2::@2 [phi:font_2x2::@8->font_2x2::@2] + // [121] phi (byte*) font_2x2::next_2x2_right#7 = (byte*) font_2x2::next_2x2_right#8 [phi:font_2x2::@8->font_2x2::@2#0] -- register_copy + // [121] phi (byte) font_2x2::l2#8 = (byte) font_2x2::l2#9 [phi:font_2x2::@8->font_2x2::@2#1] -- register_copy + // [121] phi (byte*) font_2x2::next_2x2_left#7 = (byte*) font_2x2::next_2x2_left#8 [phi:font_2x2::@8->font_2x2::@2#2] -- register_copy + // [121] phi (byte) font_2x2::l#2 = (byte) font_2x2::l#1 [phi:font_2x2::@8->font_2x2::@2#3] -- register_copy + // font_2x2::@2 + __b2: + // glyph_bits = next_original[l] + // [122] (byte) font_2x2::glyph_bits#0 ← *((byte*) font_2x2::next_original#4 + (byte) font_2x2::l#2) -- vbuz1=pbuz2_derefidx_vbuz3 + ldy.z l + lda (next_original),y + sta.z glyph_bits + // [123] phi from font_2x2::@2 to font_2x2::@3 [phi:font_2x2::@2->font_2x2::@3] + // [123] phi (byte) font_2x2::b#2 = (byte) 0 [phi:font_2x2::@2->font_2x2::@3#0] -- vbuyy=vbuc1 + ldy #0 + // [123] phi (word) font_2x2::glyph_bits_2x2#3 = (word) 0 [phi:font_2x2::@2->font_2x2::@3#1] -- vwuz1=vwuc1 + tya + sta.z glyph_bits_2x2 + sta.z glyph_bits_2x2+1 + // [123] phi (byte) font_2x2::glyph_bits#2 = (byte) font_2x2::glyph_bits#0 [phi:font_2x2::@2->font_2x2::@3#2] -- register_copy + // [123] phi from font_2x2::@5 to font_2x2::@3 [phi:font_2x2::@5->font_2x2::@3] + // [123] phi (byte) font_2x2::b#2 = (byte) font_2x2::b#1 [phi:font_2x2::@5->font_2x2::@3#0] -- register_copy + // [123] phi (word) font_2x2::glyph_bits_2x2#3 = (word) font_2x2::glyph_bits_2x2#2 [phi:font_2x2::@5->font_2x2::@3#1] -- register_copy + // [123] phi (byte) font_2x2::glyph_bits#2 = (byte) font_2x2::glyph_bits#1 [phi:font_2x2::@5->font_2x2::@3#2] -- register_copy + // font_2x2::@3 + __b3: + // glyph_bits&0x80 + // [124] (byte~) font_2x2::$1 ← (byte) font_2x2::glyph_bits#2 & (byte) $80 -- vbuaa=vbuz1_band_vbuc1 + lda #$80 + and.z glyph_bits + // (glyph_bits&0x80)?1uc:0uc + // [125] if((byte) 0!=(byte~) font_2x2::$1) goto font_2x2::@4 -- vbuc1_neq_vbuaa_then_la1 + cmp #0 + bne __b4 + // [127] phi from font_2x2::@3 to font_2x2::@5 [phi:font_2x2::@3->font_2x2::@5] + // [127] phi (byte) font_2x2::glyph_bit#0 = (byte) 0 [phi:font_2x2::@3->font_2x2::@5#0] -- vbuxx=vbuc1 + ldx #0 + jmp __b5 + // [126] phi from font_2x2::@3 to font_2x2::@4 [phi:font_2x2::@3->font_2x2::@4] + // font_2x2::@4 + __b4: + // (glyph_bits&0x80)?1uc:0uc + // [127] phi from font_2x2::@4 to font_2x2::@5 [phi:font_2x2::@4->font_2x2::@5] + // [127] phi (byte) font_2x2::glyph_bit#0 = (byte) 1 [phi:font_2x2::@4->font_2x2::@5#0] -- vbuxx=vbuc1 + ldx #1 + // font_2x2::@5 + __b5: + // glyph_bits_2x2<<1 + // [128] (word~) font_2x2::$5 ← (word) font_2x2::glyph_bits_2x2#3 << (byte) 1 -- vwuz1=vwuz1_rol_1 + asl.z __5 + rol.z __5+1 + // glyph_bits_2x2 = glyph_bits_2x2<<1|glyph_bit + // [129] (word) font_2x2::glyph_bits_2x2#1 ← (word~) font_2x2::$5 | (byte) font_2x2::glyph_bit#0 -- vwuz1=vwuz1_bor_vbuxx + txa + ora.z glyph_bits_2x2 + sta.z glyph_bits_2x2 + // glyph_bits_2x2<<1 + // [130] (word~) font_2x2::$7 ← (word) font_2x2::glyph_bits_2x2#1 << (byte) 1 -- vwuz1=vwuz1_rol_1 + asl.z __7 + rol.z __7+1 + // glyph_bits_2x2 = glyph_bits_2x2<<1|glyph_bit + // [131] (word) font_2x2::glyph_bits_2x2#2 ← (word~) font_2x2::$7 | (byte) font_2x2::glyph_bit#0 -- vwuz1=vwuz1_bor_vbuxx + txa + ora.z glyph_bits_2x2 + sta.z glyph_bits_2x2 + // glyph_bits <<= 1 + // [132] (byte) font_2x2::glyph_bits#1 ← (byte) font_2x2::glyph_bits#2 << (byte) 1 -- vbuz1=vbuz1_rol_1 + // Move to next bit + asl.z glyph_bits + // for(char b: 0..7) + // [133] (byte) font_2x2::b#1 ← ++ (byte) font_2x2::b#2 -- vbuyy=_inc_vbuyy + iny + // [134] if((byte) font_2x2::b#1!=(byte) 8) goto font_2x2::@3 -- vbuyy_neq_vbuc1_then_la1 + cpy #8 + bne __b3 + // font_2x2::@6 + // >glyph_bits_2x2 + // [135] (byte~) font_2x2::$12 ← > (word) font_2x2::glyph_bits_2x2#2 -- vbuaa=_hi_vwuz1 + lda.z glyph_bits_2x2+1 + // next_2x2_left[l2] = >glyph_bits_2x2 + // [136] *((byte*) font_2x2::next_2x2_left#7 + (byte) font_2x2::l2#8) ← (byte~) font_2x2::$12 -- pbuz1_derefidx_vbuz2=vbuaa + // Put the generated 2x2-line into the 2x2-font twice + ldy.z l2 + sta (next_2x2_left_1),y + // l2+1 + // [137] (byte~) font_2x2::$11 ← (byte) font_2x2::l2#8 + (byte) 1 -- vbuyy=vbuz1_plus_1 + iny + // next_2x2_left[l2+1] = >glyph_bits_2x2 + // [138] *((byte*) font_2x2::next_2x2_left#7 + (byte~) font_2x2::$11) ← (byte~) font_2x2::$12 -- pbuz1_derefidx_vbuyy=vbuaa + sta (next_2x2_left_1),y + // $80*8 + sta.z next_2x2_left_1+1 + // next_2x2_right = next_2x2 + 0xc0*8 + // [146] (byte*) font_2x2::next_2x2_right#1 ← (byte*) font_2x2::next_2x2_left#0 + (word)(number) $c0*(number) 8 -- pbuz1=pbuz2_plus_vwuc1 + lda.z next_2x2_left + clc + adc #<$c0*8 + sta.z next_2x2_right + lda.z next_2x2_left+1 + adc #>$c0*8 + sta.z next_2x2_right+1 + // [147] phi from font_2x2::@7 to font_2x2::@8 [phi:font_2x2::@7->font_2x2::@8] + // [147] phi (byte*) font_2x2::next_2x2_right#8 = (byte*) font_2x2::next_2x2_right#1 [phi:font_2x2::@7->font_2x2::@8#0] -- register_copy + // [147] phi (byte) font_2x2::l2#9 = (byte) 0 [phi:font_2x2::@7->font_2x2::@8#1] -- vbuz1=vbuc1 + lda #0 + sta.z l2 + // [147] phi (byte*) font_2x2::next_2x2_left#8 = (byte*) font_2x2::next_2x2_left#1 [phi:font_2x2::@7->font_2x2::@8#2] -- register_copy + // [147] phi from font_2x2::@6 to font_2x2::@8 [phi:font_2x2::@6->font_2x2::@8] + // [147] phi (byte*) font_2x2::next_2x2_right#8 = (byte*) font_2x2::next_2x2_right#7 [phi:font_2x2::@6->font_2x2::@8#0] -- register_copy + // [147] phi (byte) font_2x2::l2#9 = (byte) font_2x2::l2#1 [phi:font_2x2::@6->font_2x2::@8#1] -- register_copy + // [147] phi (byte*) font_2x2::next_2x2_left#8 = (byte*) font_2x2::next_2x2_left#7 [phi:font_2x2::@6->font_2x2::@8#2] -- register_copy + // font_2x2::@8 + __b8: + // for(char l: 0..7) + // [148] (byte) font_2x2::l#1 ← ++ (byte) font_2x2::l#2 -- vbuz1=_inc_vbuz1 + inc.z l + // [149] if((byte) font_2x2::l#1!=(byte) 8) goto font_2x2::@2 -- vbuz1_neq_vbuc1_then_la1 + lda #8 + cmp.z l + bne __b2 + // font_2x2::@9 + // next_2x2 += 8 + // [150] (byte*) font_2x2::next_2x2#1 ← (byte*) font_2x2::next_2x2_left#0 + (byte) 8 -- pbuz1=pbuz1_plus_vbuc1 + clc + adc.z next_2x2 + sta.z next_2x2 + bcc !+ + inc.z next_2x2+1 + !: + // next_original += 8 + // [151] (byte*) font_2x2::next_original#1 ← (byte*) font_2x2::next_original#4 + (byte) 8 -- pbuz1=pbuz1_plus_vbuc1 + lda #8 + clc + adc.z next_original + sta.z next_original + bcc !+ + inc.z next_original+1 + !: + // for(char c: 0..0x3f) + // [152] (byte) font_2x2::c#1 ← ++ (byte) font_2x2::c#11 -- vbuz1=_inc_vbuz1 + inc.z c + // [153] if((byte) font_2x2::c#1!=(byte) $40) goto font_2x2::@1 -- vbuz1_neq_vbuc1_then_la1 + lda #$40 + cmp.z c + beq !__b1+ + jmp __b1 + !__b1: + // font_2x2::@return + // } + // [154] return + rts +} + // plex_irq +// Show sprites from the multiplexer, rescheduling the IRQ as many times as needed +plex_irq: { + .label __4 = $19 + // entry interrupt(KERNEL_MIN) + // asm + // asm { sei } + sei + // [156] phi from plex_irq plex_irq::@7 to plex_irq::@3 [phi:plex_irq/plex_irq::@7->plex_irq::@3] + // plex_irq::@3 + __b3: + // plexShowSprite() + // [157] call plexShowSprite + jsr plexShowSprite + // plex_irq::plexFreeNextYpos1 + // return PLEX_FREE_YPOS[plex_free_next]; + // [158] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) -- vbuxx=pbuc1_derefidx_vbuz1 + ldy.z plex_free_next + ldx PLEX_FREE_YPOS,y + // plex_irq::@6 + // *RASTER+3 + // [159] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 3 -- vbuz1=_deref_pbuc1_plus_vbuc2 + lda #3 + clc + adc RASTER + sta.z __4 + // while (plex_show_idx < PLEX_COUNT && rasterY < *RASTER+3) + // [160] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 -- vbuz1_ge_vbuc1_then_la1 + lda.z plex_show_idx + cmp #PLEX_COUNT + bcs __b4 + // plex_irq::@7 + // [161] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3 -- vbuxx_lt_vbuz1_then_la1 + cpx.z __4 + bcc __b3 + // plex_irq::@4 + __b4: + // if (plex_show_idxPLEX_XPOS[xpos_idx] + // [182] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) -- vbuaa=_hi_pwuc1_derefidx_vbuxx + lda PLEX_XPOS+1,x + // if(>PLEX_XPOS[xpos_idx]!=0) + // [183] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1 -- vbuaa_neq_0_then_la1 + cmp #0 + bne __b1 + // plexShowSprite::@3 + // 0xff^plex_sprite_msb + // [184] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb -- vbuaa=vbuc1_bxor_vbuz1 + lda #$ff + eor.z plex_sprite_msb + // *SPRITES_XMSB &= (0xff^plex_sprite_msb) + // [185] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 -- _deref_pbuc1=_deref_pbuc1_band_vbuaa + and SPRITES_XMSB + sta SPRITES_XMSB + // plexShowSprite::@2 + __b2: + // plex_sprite_idx+1 + // [186] (byte~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (byte) 1 -- vbuxx=vbuz1_plus_1 + ldx.z plex_sprite_idx + inx + // (plex_sprite_idx+1)&7 + // [187] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7 -- vbuaa=vbuxx_band_vbuc1 + txa + and #7 + // plex_sprite_idx = (plex_sprite_idx+1)&7 + // [188] (volatile byte) plex_sprite_idx ← (byte~) plexShowSprite::$6 -- vbuz1=vbuaa + sta.z plex_sprite_idx + // plex_show_idx++; + // [189] (volatile byte) plex_show_idx ← ++ (volatile byte) plex_show_idx -- vbuz1=_inc_vbuz1 + inc.z plex_show_idx + // plex_sprite_msb <<=1 + // [190] (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (byte) 1 -- vbuz1=vbuz1_rol_1 + asl.z plex_sprite_msb + // if(plex_sprite_msb==0) + // [191] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return -- vbuz1_neq_0_then_la1 + lda.z plex_sprite_msb + cmp #0 + bne __breturn + // plexShowSprite::@4 + // plex_sprite_msb = 1 + // [192] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 + lda #1 + sta.z plex_sprite_msb + // plexShowSprite::@return + __breturn: + // } + // [193] return + rts + // plexShowSprite::@1 + __b1: + // *SPRITES_XMSB |= plex_sprite_msb + // [194] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 + lda SPRITES_XMSB + ora.z plex_sprite_msb + sta SPRITES_XMSB + jmp __b2 +} + // File Data + // The x-positions of the multiplexer sprites (0x000-0x1ff) + PLEX_XPOS: .fill 2*PLEX_COUNT, 0 + // The y-positions of the multiplexer sprites. + PLEX_YPOS: .fill PLEX_COUNT, 0 + // The sprite pointers for the multiplexed sprites + 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 + // 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 + //kickasm(pc FONT, resource "elefont.bin") {{ + // .import binary "elefont.bin" + //}} + .align $100 +YSIN: +.fill $100, round(142+89.5*sin(toRadians(360*i/256))) + + diff --git a/src/test/ref/complex/spritescroller/spritescroller.sym b/src/test/ref/complex/spritescroller/spritescroller.sym new file mode 100644 index 000000000..12838b78c --- /dev/null +++ b/src/test/ref/complex/spritescroller/spritescroller.sym @@ -0,0 +1,319 @@ +(label) @1 +(label) @2 +(label) @3 +(label) @4 +(label) @begin +(label) @end +(const nomodify byte*) CHARGEN = (byte*) 53248 +(const nomodify byte*) CHARSET_DEFAULT = (byte*) 4096 +(const nomodify byte*) CIA1_INTERRUPT = (byte*) 56333 +(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f +(const nomodify byte*) D018 = (byte*) 53272 +(const nomodify byte*) FONT = (byte*) 8192 +(const nomodify byte*) IRQ_ENABLE = (byte*) 53274 +(const nomodify byte) IRQ_RASTER = (byte) 1 +(const nomodify byte*) IRQ_STATUS = (byte*) 53273 +(const nomodify void()**) KERNEL_IRQ = (void()**) 788 +(const nomodify byte) PLEX_COUNT = (byte) $20 +(const byte*) PLEX_FREE_YPOS[(number) 8] = { fill( 8, 0) } +(const byte*) PLEX_PTR[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) } +(byte*) PLEX_SCREEN_PTR +(const byte*) PLEX_SCREEN_PTR#0 PLEX_SCREEN_PTR = (byte*)(number) $400+(number) $3f8 +(const byte*) PLEX_SORTED_IDX[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) } +(const word*) PLEX_XPOS[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) } +(const byte*) PLEX_YPOS[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) } +(const nomodify byte*) PROCPORT = (byte*) 1 +(const nomodify byte) PROCPORT_BASIC_KERNEL_IO = (byte) 7 +(const nomodify byte) PROCPORT_RAM_CHARROM = (byte) 1 +(const nomodify byte*) RASTER = (byte*) 53266 +(const nomodify byte*) SCREEN = (byte*) 1024 +(const nomodify byte*) SPRITES = (byte*) 12288 +(const nomodify byte*) SPRITES_COLS = (byte*) 53287 +(const nomodify byte*) SPRITES_ENABLE = (byte*) 53269 +(const nomodify byte*) SPRITES_XMSB = (byte*) 53264 +(const nomodify byte*) SPRITES_XPOS = (byte*) 53248 +(const nomodify byte*) SPRITES_YPOS = (byte*) 53249 +(const nomodify byte*) VIC_CONTROL = (byte*) 53265 +(const nomodify byte) WHITE = (byte) 1 +(const byte*) YSIN[(number) $100] = kickasm {{ .fill $100, round(142+89.5*sin(toRadians(360*i/256))) + }} +(void()) font_2x2((byte*) font_2x2::font_original , (byte*) font_2x2::font_2x2) +(byte~) font_2x2::$1 reg byte a 200002.0 +(byte~) font_2x2::$11 reg byte y 20002.0 +(byte~) font_2x2::$12 reg byte a 10001.0 +(byte~) font_2x2::$14 reg byte y 20002.0 +(byte~) font_2x2::$15 reg byte a 10001.0 +(word~) font_2x2::$5 zp[2]:15 200002.0 +(word~) font_2x2::$7 zp[2]:15 200002.0 +(label) font_2x2::@1 +(label) font_2x2::@2 +(label) font_2x2::@3 +(label) font_2x2::@4 +(label) font_2x2::@5 +(label) font_2x2::@6 +(label) font_2x2::@7 +(label) font_2x2::@8 +(label) font_2x2::@9 +(label) font_2x2::@return +(byte) font_2x2::b +(byte) font_2x2::b#1 reg byte y 150001.5 +(byte) font_2x2::b#2 reg byte y 20000.2 +(byte) font_2x2::c +(byte) font_2x2::c#1 c zp[1]:10 1501.5 +(byte) font_2x2::c#11 c zp[1]:10 58.88235294117647 +(byte*) font_2x2::font_2x2 +(byte*) font_2x2::font_original +(byte) font_2x2::glyph_bit +(byte) font_2x2::glyph_bit#0 reg byte x 50000.5 +(byte) font_2x2::glyph_bits +(byte) font_2x2::glyph_bits#0 glyph_bits zp[1]:24 20002.0 +(byte) font_2x2::glyph_bits#1 glyph_bits zp[1]:24 66667.33333333333 +(byte) font_2x2::glyph_bits#2 glyph_bits zp[1]:24 34444.88888888889 +(word) font_2x2::glyph_bits_2x2 +(word) font_2x2::glyph_bits_2x2#1 glyph_bits_2x2 zp[2]:15 200002.0 +(word) font_2x2::glyph_bits_2x2#2 glyph_bits_2x2 zp[2]:15 27500.5 +(word) font_2x2::glyph_bits_2x2#3 glyph_bits_2x2 zp[2]:15 40000.4 +(byte) font_2x2::l +(byte) font_2x2::l#1 l zp[1]:22 15001.5 +(byte) font_2x2::l#2 l zp[1]:22 1111.2222222222222 +(byte) font_2x2::l2 +(byte) font_2x2::l2#1 l2 zp[1]:23 15001.5 +(byte) font_2x2::l2#8 l2 zp[1]:23 2727.5454545454545 +(byte) font_2x2::l2#9 l2 zp[1]:23 6667.333333333333 +(byte*) font_2x2::next_2x2 +(byte*) font_2x2::next_2x2#1 next_2x2 zp[2]:6 500.5 +(byte*) font_2x2::next_2x2_left +(byte*) font_2x2::next_2x2_left#0 next_2x2_left zp[2]:6 750.1875 +(byte*) font_2x2::next_2x2_left#1 next_2x2_left_1 zp[2]:11 10001.0 +(byte*) font_2x2::next_2x2_left#10 next_2x2_left_1 zp[2]:11 2002.0 +(byte*) font_2x2::next_2x2_left#7 next_2x2_left_1 zp[2]:11 1708.5416666666665 +(byte*) font_2x2::next_2x2_left#8 next_2x2_left_1 zp[2]:11 10001.0 +(byte*) font_2x2::next_2x2_right +(byte*) font_2x2::next_2x2_right#0 next_2x2_right zp[2]:13 1001.0 +(byte*) font_2x2::next_2x2_right#1 next_2x2_right zp[2]:13 20002.0 +(byte*) font_2x2::next_2x2_right#7 next_2x2_right zp[2]:13 1708.5416666666665 +(byte*) font_2x2::next_2x2_right#8 next_2x2_right zp[2]:13 10001.0 +(byte*) font_2x2::next_original +(byte*) font_2x2::next_original#1 next_original zp[2]:8 667.3333333333334 +(byte*) font_2x2::next_original#4 next_original zp[2]:8 363.7272727272727 +(void()) font_2x2_to_sprites((byte*) font_2x2_to_sprites::font_2x2 , (byte*) font_2x2_to_sprites::sprites , (byte) font_2x2_to_sprites::num_chars) +(byte~) font_2x2_to_sprites::$3 zp[1]:24 10001.0 +(label) font_2x2_to_sprites::@1 +(label) font_2x2_to_sprites::@2 +(label) font_2x2_to_sprites::@3 +(label) font_2x2_to_sprites::@4 +(label) font_2x2_to_sprites::@5 +(label) font_2x2_to_sprites::@6 +(label) font_2x2_to_sprites::@7 +(label) font_2x2_to_sprites::@8 +(label) font_2x2_to_sprites::@return +(byte) font_2x2_to_sprites::c +(byte) font_2x2_to_sprites::c#1 c zp[1]:5 2002.0 +(byte) font_2x2_to_sprites::c#2 c zp[1]:5 136.5 +(byte*) font_2x2_to_sprites::char_current +(byte*) font_2x2_to_sprites::char_current#1 char_current zp[2]:6 667.3333333333334 +(byte*) font_2x2_to_sprites::char_current#2 char_current zp[2]:6 1200.3 +(byte*) font_2x2_to_sprites::char_left +(byte*) font_2x2_to_sprites::char_left#1 char_left zp[2]:11 10001.0 +(byte*) font_2x2_to_sprites::char_left#3 char_left zp[2]:11 2818.5454545454545 +(byte*) font_2x2_to_sprites::char_left#4 char_left zp[2]:11 10001.0 +(byte*) font_2x2_to_sprites::char_left#6 char_left zp[2]:11 2002.0 +(byte*) font_2x2_to_sprites::char_right +(byte*) font_2x2_to_sprites::char_right#0 char_right zp[2]:13 1001.0 +(byte*) font_2x2_to_sprites::char_right#1 char_right zp[2]:13 20002.0 +(byte*) font_2x2_to_sprites::char_right#3 char_right zp[2]:13 2818.5454545454545 +(byte*) font_2x2_to_sprites::char_right#4 char_right zp[2]:13 10001.0 +(byte*) font_2x2_to_sprites::font_2x2 +(byte) font_2x2_to_sprites::i +(byte) font_2x2_to_sprites::i#1 reg byte x 15001.5 +(byte) font_2x2_to_sprites::i#2 reg byte x 3571.7857142857147 +(byte) font_2x2_to_sprites::num_chars +(const byte) font_2x2_to_sprites::num_chars#0 num_chars = (byte) $40 +(byte*) font_2x2_to_sprites::sprite +(byte*) font_2x2_to_sprites::sprite#1 sprite zp[2]:8 1001.0 +(byte*) font_2x2_to_sprites::sprite#4 sprite zp[2]:8 1524.047619047619 +(byte) font_2x2_to_sprites::sprite_idx +(byte) font_2x2_to_sprites::sprite_idx#1 sprite_idx zp[1]:10 15001.5 +(byte) font_2x2_to_sprites::sprite_idx#2 reg byte y 15001.5 +(byte) font_2x2_to_sprites::sprite_idx#3 sprite_idx zp[1]:10 2222.4444444444443 +(byte) font_2x2_to_sprites::sprite_idx#4 sprite_idx zp[1]:10 10001.0 +(byte*) font_2x2_to_sprites::sprites +(volatile bool) framedone loadstore zp[1]:21 27.65 +(void()) main() +(byte~) main::$12 reg byte a 202.0 +(label) main::@1 +(label) main::@10 +(label) main::@11 +(label) main::@12 +(label) main::@13 +(label) main::@2 +(label) main::@3 +(label) main::@4 +(label) main::@5 +(label) main::@6 +(label) main::@7 +(label) main::@8 +(label) main::@9 +(byte) main::s +(byte) main::s#1 reg byte x 151.5 +(byte) main::s#2 reg byte x 67.33333333333333 +(byte) main::s1 +(byte) main::s1#1 reg byte x 151.5 +(byte) main::s1#2 reg byte x 151.5 +(byte) main::sprite +(byte) main::sprite#1 sprite zp[1]:4 33.666666666666664 +(byte) main::sprite#2 sprite zp[1]:4 151.5 +(label) main::toD0181 +(byte*) main::toD0181_gfx +(byte) main::toD0181_return +(const byte) main::toD0181_return#0 toD0181_return = >(word)(const nomodify byte*) SCREEN&(word) $3fff*(byte) 4|>(word)(const nomodify byte*) CHARSET_DEFAULT/(byte) 4&(byte) $f +(byte*) main::toD0181_screen +(label) main::toSpritePtr1 +(byte) main::toSpritePtr1_return +(const byte) main::toSpritePtr1_return#0 toSpritePtr1_return = (byte)(word)(const nomodify byte*) SPRITES/(byte) $40 +(byte*) main::toSpritePtr1_sprite +(word) main::xp +(word) main::xp#1 xp zp[2]:2 67.33333333333333 +(word) main::xp#2 xp zp[2]:2 60.599999999999994 +(void()) plexInit((byte*) plexInit::screen) +(label) plexInit::@1 +(label) plexInit::@return +(byte) plexInit::i +(byte) plexInit::i#1 reg byte x 1501.5 +(byte) plexInit::i#2 reg byte x 2002.0 +(label) plexInit::plexSetScreen1 +(byte*) plexInit::plexSetScreen1_screen +(byte*) plexInit::screen +(void()) plexShowSprite() +(byte~) plexShowSprite::$11 reg byte x 101.0 +(byte~) plexShowSprite::$2 reg byte a 202.0 +(byte~) plexShowSprite::$3 reg byte a 202.0 +(byte~) plexShowSprite::$5 reg byte x 202.0 +(byte~) plexShowSprite::$6 reg byte a 202.0 +(byte~) plexShowSprite::$9 reg byte a 202.0 +(label) plexShowSprite::@1 +(label) plexShowSprite::@2 +(label) plexShowSprite::@3 +(label) plexShowSprite::@4 +(label) plexShowSprite::@5 +(label) plexShowSprite::@return +(label) plexShowSprite::plexFreeAdd1 +(byte~) plexShowSprite::plexFreeAdd1_$0 reg byte a 202.0 +(byte~) plexShowSprite::plexFreeAdd1_$1 reg byte a 202.0 +(byte~) plexShowSprite::plexFreeAdd1_$2 reg byte a 202.0 +(byte) plexShowSprite::plexFreeAdd1_ypos +(byte) plexShowSprite::plexFreeAdd1_ypos#0 reg byte a 151.5 +(byte) plexShowSprite::plex_sprite_idx2 +(byte) plexShowSprite::plex_sprite_idx2#0 plex_sprite_idx2 zp[1]:26 25.25 +(byte) plexShowSprite::xpos_idx +(byte) plexShowSprite::xpos_idx#0 reg byte a 202.0 +(byte) plexShowSprite::ypos +(void()) plexSine() +(label) plexSine::@1 +(label) plexSine::@2 +(label) plexSine::@return +(byte) plexSine::sy +(byte) plexSine::sy#1 reg byte y 150001.5 +(byte) plexSine::sy#2 reg byte y 100001.0 +(byte) plexSine::y_idx +(byte) plexSine::y_idx#0 reg byte x 2002.0 +(byte) plexSine::y_idx#1 reg byte x 66667.33333333333 +(byte) plexSine::y_idx#2 reg byte x 150502.0 +(void()) plexSort() +(label) plexSort::@1 +(label) plexSort::@2 +(label) plexSort::@3 +(label) plexSort::@4 +(label) plexSort::@5 +(label) plexSort::@6 +(label) plexSort::@7 +(label) plexSort::@return +(byte) plexSort::m +(byte) plexSort::m#1 m zp[1]:5 150001.5 +(byte) plexSort::m#2 m zp[1]:5 41667.08333333333 +(byte) plexSort::nxt_idx +(byte) plexSort::nxt_idx#0 nxt_idx zp[1]:22 30000.300000000003 +(byte) plexSort::nxt_y +(byte) plexSort::nxt_y#0 nxt_y zp[1]:23 150000.375 +(label) plexSort::plexFreePrepare1 +(label) plexSort::plexFreePrepare1_@1 +(label) plexSort::plexFreePrepare1_@2 +(byte) plexSort::plexFreePrepare1_s +(byte) plexSort::plexFreePrepare1_s#1 reg byte x 150001.5 +(byte) plexSort::plexFreePrepare1_s#2 reg byte x 150001.5 +(byte) plexSort::s +(byte) plexSort::s#1 reg byte x 1366668.3333333335 +(byte) plexSort::s#2 reg byte x 200002.0 +(byte) plexSort::s#3 reg byte x 2050002.5 +(byte) plexSort::s#6 reg byte x 200002.0 +(volatile byte) plex_free_next loadstore zp[1]:20 42.48387096774193 +interrupt(KERNEL_MIN)(void()) plex_irq() +(byte~) plex_irq::$4 zp[1]:25 11.0 +(label) plex_irq::@1 +(label) plex_irq::@2 +(label) plex_irq::@3 +(label) plex_irq::@4 +(label) plex_irq::@5 +(label) plex_irq::@6 +(label) plex_irq::@7 +(label) plex_irq::@return +(label) plex_irq::plexFreeNextYpos1 +(byte) plex_irq::plexFreeNextYpos1_return +(byte) plex_irq::plexFreeNextYpos1_return#0 reg byte x 4.800000000000001 +(byte) plex_irq::rasterY +(volatile byte) plex_show_idx loadstore zp[1]:17 46.0909090909091 +(volatile byte) plex_sprite_idx loadstore zp[1]:18 45.387096774193544 +(volatile byte) plex_sprite_msb loadstore zp[1]:19 48.757575757575765 +(byte) sin_idx +(byte) sin_idx#10 sin_idx zp[1]:4 300.42857142857144 +(byte) sin_idx#12 sin_idx zp[1]:4 58.0 + +reg byte x [ main::s#2 main::s#1 ] +zp[2]:2 [ main::xp#2 main::xp#1 ] +reg byte x [ main::s1#2 main::s1#1 ] +reg byte x [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] +reg byte x [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] +zp[1]:4 [ sin_idx#10 sin_idx#12 main::sprite#2 main::sprite#1 ] +reg byte x [ plexSine::y_idx#2 plexSine::y_idx#0 plexSine::y_idx#1 ] +reg byte y [ plexSine::sy#2 plexSine::sy#1 ] +reg byte x [ plexInit::i#2 plexInit::i#1 ] +zp[1]:5 [ font_2x2_to_sprites::c#2 font_2x2_to_sprites::c#1 plexSort::m#2 plexSort::m#1 ] +reg byte x [ font_2x2_to_sprites::i#2 font_2x2_to_sprites::i#1 ] +zp[2]:6 [ font_2x2::next_2x2_left#0 font_2x2::next_2x2#1 font_2x2_to_sprites::char_current#2 font_2x2_to_sprites::char_current#1 ] +zp[2]:8 [ font_2x2::next_original#4 font_2x2::next_original#1 font_2x2_to_sprites::sprite#4 font_2x2_to_sprites::sprite#1 ] +zp[1]:10 [ font_2x2::c#11 font_2x2::c#1 font_2x2_to_sprites::sprite_idx#4 font_2x2_to_sprites::sprite_idx#3 font_2x2_to_sprites::sprite_idx#1 ] +zp[2]:11 [ font_2x2::next_2x2_left#7 font_2x2::next_2x2_left#10 font_2x2::next_2x2_left#8 font_2x2::next_2x2_left#1 font_2x2_to_sprites::char_left#3 font_2x2_to_sprites::char_left#6 font_2x2_to_sprites::char_left#4 font_2x2_to_sprites::char_left#1 ] +zp[2]:13 [ font_2x2::next_2x2_right#7 font_2x2::next_2x2_right#0 font_2x2::next_2x2_right#8 font_2x2::next_2x2_right#1 font_2x2_to_sprites::char_right#3 font_2x2_to_sprites::char_right#0 font_2x2_to_sprites::char_right#4 font_2x2_to_sprites::char_right#1 ] +zp[2]:15 [ font_2x2::glyph_bits_2x2#3 font_2x2::glyph_bits_2x2#2 font_2x2::$5 font_2x2::$7 font_2x2::glyph_bits_2x2#1 ] +reg byte y [ font_2x2::b#2 font_2x2::b#1 ] +reg byte x [ font_2x2::glyph_bit#0 ] +zp[1]:17 [ plex_show_idx ] +zp[1]:18 [ plex_sprite_idx ] +zp[1]:19 [ plex_sprite_msb ] +zp[1]:20 [ plex_free_next ] +zp[1]:21 [ framedone ] +reg byte a [ main::$12 ] +zp[1]:22 [ plexSort::nxt_idx#0 font_2x2::l#2 font_2x2::l#1 ] +zp[1]:23 [ plexSort::nxt_y#0 font_2x2::l2#8 font_2x2::l2#9 font_2x2::l2#1 ] +reg byte x [ plexSort::s#2 ] +zp[1]:24 [ font_2x2_to_sprites::$3 font_2x2::glyph_bits#2 font_2x2::glyph_bits#0 font_2x2::glyph_bits#1 ] +reg byte y [ font_2x2_to_sprites::sprite_idx#2 ] +reg byte a [ font_2x2::$1 ] +reg byte a [ font_2x2::$12 ] +reg byte y [ font_2x2::$11 ] +reg byte a [ font_2x2::$15 ] +reg byte y [ font_2x2::$14 ] +reg byte x [ plex_irq::plexFreeNextYpos1_return#0 ] +zp[1]:25 [ plex_irq::$4 ] +zp[1]:26 [ plexShowSprite::plex_sprite_idx2#0 ] +reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ] +reg byte a [ plexShowSprite::plexFreeAdd1_$0 ] +reg byte a [ plexShowSprite::plexFreeAdd1_$1 ] +reg byte a [ plexShowSprite::plexFreeAdd1_$2 ] +reg byte a [ plexShowSprite::xpos_idx#0 ] +reg byte x [ plexShowSprite::$11 ] +reg byte a [ plexShowSprite::$2 ] +reg byte a [ plexShowSprite::$3 ] +reg byte a [ plexShowSprite::$9 ] +reg byte x [ plexShowSprite::$5 ] +reg byte a [ plexShowSprite::$6 ] diff --git a/src/test/ref/examples/multiplexer/simple-multiplexer.asm b/src/test/ref/examples/multiplexer/simple-multiplexer.asm index 483ba9bfc..3db60e43b 100644 --- a/src/test/ref/examples/multiplexer/simple-multiplexer.asm +++ b/src/test/ref/examples/multiplexer/simple-multiplexer.asm @@ -254,7 +254,7 @@ plexSort: { lda.z nxt_idx sta PLEX_SORTED_IDX,x __b2: - // for(byte m: 0..PLEX_COUNT-2) + // for(char m: 0..PLEX_COUNT-2) inc.z m lda #PLEX_COUNT-2+1 cmp.z m @@ -264,7 +264,7 @@ plexSort: { // PLEX_FREE_YPOS[s] = 0 lda #0 sta PLEX_FREE_YPOS,x - // for( byte s: 0..7) + // for( char s: 0..7) inx cpx #8 bne plexFreePrepare1___b1 @@ -333,7 +333,7 @@ plexInit: { // PLEX_SORTED_IDX[i] = i txa sta PLEX_SORTED_IDX,x - // for(byte i: 0..PLEX_COUNT-1) + // for(char i: 0..PLEX_COUNT-1) inx cpx #PLEX_COUNT-1+1 bne __b1 diff --git a/src/test/ref/examples/multiplexer/simple-multiplexer.log b/src/test/ref/examples/multiplexer/simple-multiplexer.log index de8155fb5..8228cd2d5 100644 --- a/src/test/ref/examples/multiplexer/simple-multiplexer.log +++ b/src/test/ref/examples/multiplexer/simple-multiplexer.log @@ -4218,7 +4218,7 @@ plexSort: { sta PLEX_SORTED_IDX,x // plexSort::@2 __b2: - // for(byte m: 0..PLEX_COUNT-2) + // for(char m: 0..PLEX_COUNT-2) // [73] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 -- vbuz1=_inc_vbuz1 inc.z m // [74] if((byte) plexSort::m#1!=(const nomodify byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1 -- vbuz1_neq_vbuc1_then_la1 @@ -4238,7 +4238,7 @@ plexSort: { // [77] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 -- pbuc1_derefidx_vbuxx=vbuc2 lda #0 sta PLEX_FREE_YPOS,x - // for( byte s: 0..7) + // for( char s: 0..7) // [78] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 -- vbuxx=_inc_vbuxx inx // [79] if((byte) plexSort::plexFreePrepare1_s#1!=(byte) 8) goto plexSort::plexFreePrepare1_@1 -- vbuxx_neq_vbuc1_then_la1 @@ -4349,7 +4349,7 @@ plexInit: { // [99] *((const byte*) PLEX_SORTED_IDX + (byte) plexInit::i#2) ← (byte) plexInit::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta PLEX_SORTED_IDX,x - // for(byte i: 0..PLEX_COUNT-1) + // for(char i: 0..PLEX_COUNT-1) // [100] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2 -- vbuxx=_inc_vbuxx inx // [101] if((byte) plexInit::i#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto plexInit::@1 -- vbuxx_neq_vbuc1_then_la1 diff --git a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.asm b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.asm index b90d57e91..8f893f2d9 100644 --- a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.asm +++ b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.asm @@ -109,13 +109,6 @@ loop: { // framedone = false lda #0 sta.z framedone - // *VIC_CONTROL &=0x7f - lda #$7f - and VIC_CONTROL - sta VIC_CONTROL - // *RASTER = 0x0 - lda #0 - sta RASTER jmp __b2 } // Ensure that the indices in PLEX_SORTED_IDX is sorted based on the y-positions in PLEX_YPOS @@ -263,6 +256,13 @@ init: { sta KERNEL_IRQ lda #>plex_irq sta KERNEL_IRQ+1 + // *VIC_CONTROL &=0x7f + lda #$7f + and VIC_CONTROL + sta VIC_CONTROL + // *RASTER = 0x0 + lda #0 + sta RASTER // asm cli // } @@ -284,6 +284,8 @@ plexInit: { } plex_irq: { .label __4 = $d + // asm + sei // *BORDERCOL = WHITE lda #WHITE sta BORDERCOL @@ -312,6 +314,9 @@ plex_irq: { lda.z plex_show_idx cmp #PLEX_COUNT bcc __b1 + // *RASTER = 0 + lda #0 + sta RASTER // framedone = true lda #1 sta.z framedone @@ -319,6 +324,8 @@ plex_irq: { // *BORDERCOL = 0 lda #0 sta BORDERCOL + // asm + cli // } jmp $ea81 __b1: diff --git a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.cfg b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.cfg index 677b6487d..00e1d3986 100644 --- a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.cfg +++ b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.cfg @@ -62,91 +62,91 @@ loop::@5: scope:[loop] from loop::@4 loop::@6: scope:[loop] from loop::@5 [27] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) GREEN [28] (volatile bool) framedone ← false - [29] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f - [30] *((const nomodify byte*) RASTER) ← (byte) 0 to:loop::@1 (void()) plexSort() plexSort: scope:[plexSort] from loop::@5 - [31] phi() + [29] phi() to:plexSort::@1 plexSort::@1: scope:[plexSort] from plexSort 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_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2) - [34] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0) - [35] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 + [30] (byte) plexSort::m#2 ← phi( plexSort/(byte) 0 plexSort::@2/(byte) plexSort::m#1 ) + [31] (byte) plexSort::nxt_idx#0 ← *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2) + [32] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0) + [33] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 to:plexSort::@5 plexSort::@5: scope:[plexSort] from plexSort::@1 - [36] (byte) plexSort::s#6 ← (byte) plexSort::m#2 + [34] (byte) plexSort::s#6 ← (byte) plexSort::m#2 to:plexSort::@3 plexSort::@3: scope:[plexSort] from plexSort::@5 plexSort::@7 - [37] (byte) plexSort::s#3 ← phi( plexSort::@7/(byte) plexSort::s#1 plexSort::@5/(byte) plexSort::s#6 ) - [38] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) 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 + [35] (byte) plexSort::s#3 ← phi( plexSort::@7/(byte) plexSort::s#1 plexSort::@5/(byte) plexSort::s#6 ) + [36] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) + [37] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 + [38] if((byte) plexSort::s#1==(byte) $ff) goto plexSort::@4 to:plexSort::@7 plexSort::@7: scope:[plexSort] from plexSort::@3 - [41] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 + [39] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 to:plexSort::@4 plexSort::@4: scope:[plexSort] from plexSort::@3 plexSort::@7 - [42] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 - [43] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 + [40] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 + [41] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 to:plexSort::@2 plexSort::@2: scope:[plexSort] from plexSort::@1 plexSort::@4 - [44] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 - [45] if((byte) plexSort::m#1!=(const nomodify byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1 + [42] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 + [43] if((byte) plexSort::m#1!=(const nomodify byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1 to:plexSort::@6 plexSort::@6: scope:[plexSort] from plexSort::@2 - [46] (volatile byte) plex_show_idx ← (byte) 0 - [47] (volatile byte) plex_sprite_idx ← (byte) 0 - [48] (volatile byte) plex_sprite_msb ← (byte) 1 + [44] (volatile byte) plex_show_idx ← (byte) 0 + [45] (volatile byte) plex_sprite_idx ← (byte) 0 + [46] (volatile byte) plex_sprite_msb ← (byte) 1 to:plexSort::plexFreePrepare1 plexSort::plexFreePrepare1: scope:[plexSort] from plexSort::@6 - [49] phi() + [47] phi() to:plexSort::plexFreePrepare1_@1 plexSort::plexFreePrepare1_@1: scope:[plexSort] from plexSort::plexFreePrepare1 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*) 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 + [48] (byte) plexSort::plexFreePrepare1_s#2 ← phi( plexSort::plexFreePrepare1/(byte) 0 plexSort::plexFreePrepare1_@1/(byte) plexSort::plexFreePrepare1_s#1 ) + [49] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 + [50] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 + [51] 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 - [54] (volatile byte) plex_free_next ← (byte) 0 + [52] (volatile byte) plex_free_next ← (byte) 0 to:plexSort::@return plexSort::@return: scope:[plexSort] from plexSort::plexFreePrepare1_@2 - [55] return + [53] return to:@return (void()) init() init: scope:[init] from main - [56] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 - [57] call plexInit + [54] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 + [55] call plexInit to:init::@1 init::@1: scope:[init] from init init::@1 - [58] (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init/(word) $20 ) - [58] (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init/(byte) 0 ) - [59] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 - [60] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1 - [61] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (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 nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto init::@1 + [56] (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init/(word) $20 ) + [56] (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init/(byte) 0 ) + [57] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 + [58] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1 + [59] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (word) init::xp#2 + [60] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 + [61] (byte) init::sx#1 ← ++ (byte) init::sx#2 + [62] if((byte) init::sx#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto init::@1 to:init::@2 init::@2: scope:[init] from init::@1 - [65] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff + [63] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff to:init::@3 init::@3: scope:[init] from init::@2 init::@3 - [66] (byte) init::ss#2 ← phi( init::@2/(byte) 0 init::@3/(byte) init::ss#1 ) - [67] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN - [68] (byte) init::ss#1 ← ++ (byte) init::ss#2 - [69] if((byte) init::ss#1!=(byte) 8) goto init::@3 + [64] (byte) init::ss#2 ← phi( init::@2/(byte) 0 init::@3/(byte) init::ss#1 ) + [65] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN + [66] (byte) init::ss#1 ← ++ (byte) init::ss#2 + [67] if((byte) init::ss#1!=(byte) 8) goto init::@3 to:init::@4 init::@4: scope:[init] from init::@3 asm { sei } - [71] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR - [72] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER - [73] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER - [74] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() + [69] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR + [70] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER + [71] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER + [72] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() + [73] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f + [74] *((const nomodify byte*) RASTER) ← (byte) 0 asm { cli } to:init::@return init::@return: scope:[init] from init::@4 @@ -172,79 +172,82 @@ plexInit::@return: scope:[plexInit] from plexInit::@1 interrupt(KERNEL_MIN)(void()) plex_irq() plex_irq: scope:[plex_irq] from - [84] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE + asm { sei } + [85] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE to:plex_irq::@3 plex_irq::@3: scope:[plex_irq] from plex_irq plex_irq::@7 - [85] phi() - [86] call plexShowSprite + [86] phi() + [87] call plexShowSprite to:plex_irq::plexFreeNextYpos1 plex_irq::plexFreeNextYpos1: scope:[plex_irq] from plex_irq::@3 - [87] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) + [88] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) to:plex_irq::@6 plex_irq::@6: scope:[plex_irq] from plex_irq::plexFreeNextYpos1 - [88] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 2 - [89] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 + [89] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 2 + [90] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 to:plex_irq::@7 plex_irq::@7: scope:[plex_irq] from plex_irq::@6 - [90] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3 + [91] 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 - [91] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER - [92] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 + [92] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER + [93] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 to:plex_irq::@5 plex_irq::@5: scope:[plex_irq] from plex_irq::@4 - [93] (volatile bool) framedone ← true + [94] *((const nomodify byte*) RASTER) ← (byte) 0 + [95] (volatile bool) framedone ← true to:plex_irq::@2 plex_irq::@2: scope:[plex_irq] from plex_irq::@1 plex_irq::@5 - [94] *((const nomodify byte*) BORDERCOL) ← (byte) 0 + [96] *((const nomodify byte*) BORDERCOL) ← (byte) 0 + asm { cli } to:plex_irq::@return plex_irq::@return: scope:[plex_irq] from plex_irq::@2 - [95] return + [98] return to:@return plex_irq::@1: scope:[plex_irq] from plex_irq::@4 - [96] *((const nomodify byte*) RASTER) ← (byte) plex_irq::plexFreeNextYpos1_return#0 + [99] *((const nomodify byte*) RASTER) ← (byte) plex_irq::plexFreeNextYpos1_return#0 to:plex_irq::@2 (void()) plexShowSprite() plexShowSprite: scope:[plexShowSprite] from plex_irq::@3 - [97] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 - [98] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) - [99] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + [100] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 + [101] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) + [102] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 to:plexShowSprite::plexFreeAdd1 plexShowSprite::plexFreeAdd1: scope:[plexShowSprite] from plexShowSprite - [100] (byte~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte) $15 - [101] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 - [102] (byte~) plexShowSprite::plexFreeAdd1_$1 ← (volatile byte) plex_free_next + (byte) 1 - [103] (byte~) plexShowSprite::plexFreeAdd1_$2 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7 - [104] (volatile byte) plex_free_next ← (byte~) plexShowSprite::plexFreeAdd1_$2 + [103] (byte~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte) $15 + [104] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 + [105] (byte~) plexShowSprite::plexFreeAdd1_$1 ← (volatile byte) plex_free_next + (byte) 1 + [106] (byte~) plexShowSprite::plexFreeAdd1_$2 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7 + [107] (volatile byte) plex_free_next ← (byte~) plexShowSprite::plexFreeAdd1_$2 to:plexShowSprite::@5 plexShowSprite::@5: scope:[plexShowSprite] from plexShowSprite::plexFreeAdd1 - [105] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) - [106] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) - [107] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 - [108] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) - [109] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 - [110] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) - [111] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1 + [108] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) + [109] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) + [110] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 + [111] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) + [112] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 + [113] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) + [114] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1 to:plexShowSprite::@3 plexShowSprite::@3: scope:[plexShowSprite] from plexShowSprite::@5 - [112] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb - [113] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 + [115] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb + [116] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 to:plexShowSprite::@2 plexShowSprite::@2: scope:[plexShowSprite] from plexShowSprite::@1 plexShowSprite::@3 - [114] (byte~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (byte) 1 - [115] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7 - [116] (volatile byte) plex_sprite_idx ← (byte~) plexShowSprite::$6 - [117] (volatile byte) plex_show_idx ← ++ (volatile byte) plex_show_idx - [118] (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (byte) 1 - [119] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return + [117] (byte~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (byte) 1 + [118] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7 + [119] (volatile byte) plex_sprite_idx ← (byte~) plexShowSprite::$6 + [120] (volatile byte) plex_show_idx ← ++ (volatile byte) plex_show_idx + [121] (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (byte) 1 + [122] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return to:plexShowSprite::@4 plexShowSprite::@4: scope:[plexShowSprite] from plexShowSprite::@2 - [120] (volatile byte) plex_sprite_msb ← (byte) 1 + [123] (volatile byte) plex_sprite_msb ← (byte) 1 to:plexShowSprite::@return plexShowSprite::@return: scope:[plexShowSprite] from plexShowSprite::@2 plexShowSprite::@4 - [121] return + [124] return to:@return plexShowSprite::@1: scope:[plexShowSprite] from plexShowSprite::@5 - [122] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb + [125] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb to:plexShowSprite::@2 diff --git a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.log b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.log index 8549190dd..1784e34de 100644 --- a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.log +++ b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.log @@ -269,6 +269,8 @@ init::@4: scope:[init] from init::@3 *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() + *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (number) $7f + *((const nomodify byte*) RASTER) ← (number) 0 asm { cli } to:init::@return init::@return: scope:[init] from init::@4 @@ -284,8 +286,9 @@ init::@return: scope:[init] from init::@4 interrupt(KERNEL_MIN)(void()) plex_irq() plex_irq: scope:[plex_irq] from (byte*) PLEX_SCREEN_PTR#30 ← phi( @16/(byte*) PLEX_SCREEN_PTR#21 ) - (byte) plex_irq::rasterY#0 ← (byte) 0 + asm { sei } *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE + (byte) plex_irq::rasterY#0 ← (byte) 0 to:plex_irq::@3 plex_irq::@3: scope:[plex_irq] from plex_irq plex_irq::@7 (byte*) PLEX_SCREEN_PTR#26 ← phi( plex_irq/(byte*) PLEX_SCREEN_PTR#30 plex_irq::@7/(byte*) PLEX_SCREEN_PTR#31 ) @@ -325,10 +328,12 @@ plex_irq::@1: scope:[plex_irq] from plex_irq::@4 *((const nomodify byte*) RASTER) ← (byte) plex_irq::rasterY#2 to:plex_irq::@2 plex_irq::@5: scope:[plex_irq] from plex_irq::@4 + *((const nomodify byte*) RASTER) ← (number) 0 (volatile bool) framedone ← true to:plex_irq::@2 plex_irq::@2: scope:[plex_irq] from plex_irq::@1 plex_irq::@5 *((const nomodify byte*) BORDERCOL) ← (number) 0 + asm { cli } to:plex_irq::@return plex_irq::@return: scope:[plex_irq] from plex_irq::@2 return @@ -373,8 +378,6 @@ loop::@15: scope:[loop] from loop::@11 (byte) loop::sin_idx#7 ← phi( loop::@11/(byte) loop::sin_idx#1 ) *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) GREEN (volatile bool) framedone ← false - *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (number) $7f - *((const nomodify byte*) RASTER) ← (number) 0 to:loop::@1 loop::@return: scope:[loop] from loop::@1 return @@ -688,14 +691,15 @@ Adding number conversion cast (unumber) $40 in *((const byte*) PLEX_PTR + (byte) Adding number conversion cast (unumber) 9 in (word) init::xp#1 ← (word) init::xp#2 + (number) 9 Adding number conversion cast (unumber) 1 in (byte) init::sx#1 ← (byte) init::sx#2 + rangenext(0,PLEX_COUNT-1) Adding number conversion cast (unumber) $ff in *((const nomodify byte*) SPRITES_ENABLE) ← (number) $ff +Adding number conversion cast (unumber) $7f in *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (number) $7f +Adding number conversion cast (unumber) 0 in *((const nomodify byte*) RASTER) ← (number) 0 Adding number conversion cast (unumber) 2 in (number~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (number) 2 Adding number conversion cast (unumber) plex_irq::$4 in (number~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (unumber)(number) 2 +Adding number conversion cast (unumber) 0 in *((const nomodify byte*) RASTER) ← (number) 0 Adding number conversion cast (unumber) 0 in *((const nomodify byte*) BORDERCOL) ← (number) 0 Adding number conversion cast (unumber) 8 in (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (number) 8 Adding number conversion cast (unumber) 1 in (byte) loop::sy#1 ← (byte) loop::sy#2 + rangenext(0,PLEX_COUNT-1) Adding number conversion cast (unumber) 1 in (byte) loop::sin_idx#1 ← (byte) loop::sin_idx#3 + (number) 1 -Adding number conversion cast (unumber) $7f in *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (number) $7f -Adding number conversion cast (unumber) 0 in *((const nomodify byte*) RASTER) ← (number) 0 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast (volatile byte) plex_show_idx ← (unumber)(number) 0 Inlining cast (volatile byte) plex_sprite_idx ← (unumber)(number) 0 @@ -705,8 +709,9 @@ Inlining cast (volatile byte) plex_free_next ← (unumber)(number) 0 Inlining cast (volatile byte) plex_sprite_msb ← (unumber)(number) 1 Inlining cast *((const nomodify byte*) D011) ← (unumber)(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(unumber)(number) 3 Inlining cast *((const nomodify byte*) SPRITES_ENABLE) ← (unumber)(number) $ff -Inlining cast *((const nomodify byte*) BORDERCOL) ← (unumber)(number) 0 Inlining cast *((const nomodify byte*) RASTER) ← (unumber)(number) 0 +Inlining cast *((const nomodify byte*) RASTER) ← (unumber)(number) 0 +Inlining cast *((const nomodify byte*) BORDERCOL) ← (unumber)(number) 0 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 53248 Simplifying constant pointer cast (byte*) 53249 @@ -750,13 +755,14 @@ Simplifying constant integer cast $40 Simplifying constant integer cast 9 Simplifying constant integer cast 1 Simplifying constant integer cast $ff +Simplifying constant integer cast $7f +Simplifying constant integer cast 0 Simplifying constant integer cast 2 Simplifying constant integer cast 0 +Simplifying constant integer cast 0 Simplifying constant integer cast 8 Simplifying constant integer cast 1 Simplifying constant integer cast 1 -Simplifying constant integer cast $7f -Simplifying constant integer cast 0 Successful SSA optimization PassNCastSimplification Finalized unsigned number type (word) $3f8 Finalized unsigned number type (byte) 1 @@ -785,13 +791,14 @@ Finalized unsigned number type (byte) $40 Finalized unsigned number type (byte) 9 Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) $ff +Finalized unsigned number type (byte) $7f +Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 2 Finalized unsigned number type (byte) 0 +Finalized unsigned number type (byte) 0 Finalized unsigned number type (byte) 8 Finalized unsigned number type (byte) 1 Finalized unsigned number type (byte) 1 -Finalized unsigned number type (byte) $7f -Finalized unsigned number type (byte) 0 Successful SSA optimization PassNFinalizeNumberTypeConversions Inferred type updated to byte in (unumber~) plexSort::$1 ← (byte) plexSort::m#2 + (byte) 1 Inferred type updated to byte in (unumber~) plexSort::$4 ← (byte) plexSort::s#3 + (byte) 1 @@ -864,12 +871,12 @@ Simple Condition (bool~) plexShowSprite::$4 [62] if((byte~) plexShowSprite::$3!= Simple Condition (bool~) plexShowSprite::$8 [72] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return Simple Condition (bool~) init::$1 [96] if((byte) init::sx#1!=rangelast(0,PLEX_COUNT-1)) goto init::@1 Simple Condition (bool~) init::$2 [103] if((byte) init::ss#1!=rangelast(0,7)) goto init::@3 -Simple Condition (bool~) plex_irq::$0 [125] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 -Simple Condition (bool~) loop::$1 [143] if((byte) loop::sy#1!=rangelast(0,PLEX_COUNT-1)) goto loop::@10 +Simple Condition (bool~) plex_irq::$0 [128] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 +Simple Condition (bool~) loop::$1 [148] if((byte) loop::sy#1!=rangelast(0,PLEX_COUNT-1)) goto loop::@10 Successful SSA optimization Pass2ConditionalJumpSimplification Rewriting && if()-condition to two if()s [30] (bool~) plexSort::$7 ← (bool~) plexSort::$5 && (bool~) plexSort::$6 -Rewriting && if()-condition to two if()s [121] (bool~) plex_irq::$6 ← (bool~) plex_irq::$3 && (bool~) plex_irq::$5 -Rewriting ! if()-condition to reversed if() [134] (bool~) loop::$0 ← ! (volatile bool) framedone +Rewriting && if()-condition to two if()s [124] (bool~) plex_irq::$6 ← (bool~) plex_irq::$3 && (bool~) plex_irq::$5 +Rewriting ! if()-condition to reversed if() [139] (bool~) loop::$0 ← ! (volatile bool) framedone Successful SSA optimization Pass2ConditionalAndOrRewriting Constant (const byte*) PLEX_SCREEN_PTR#0 = (byte*)$400+$3f8 Constant (const byte) plexInit::i#0 = 0 @@ -883,7 +890,7 @@ Constant (const byte) plex_irq::rasterY#0 = 0 Constant (const byte) loop::sin_idx#0 = 0 Constant (const byte) loop::sy#0 = 0 Successful SSA optimization Pass2ConstantIdentification -if() condition always true - replacing block destination [132] if(true) goto loop::@4 +if() condition always true - replacing block destination [137] if(true) goto loop::@4 Successful SSA optimization Pass2ConstantIfs Resolved ranged next value [9] plexInit::i#1 ← ++ plexInit::i#2 to ++ Resolved ranged comparison value [11] if(plexInit::i#1!=rangelast(0,PLEX_COUNT-1)) goto plexInit::@1 to (const nomodify byte) PLEX_COUNT-(byte) 1+(number) 1 @@ -895,8 +902,8 @@ Resolved ranged next value [94] init::sx#1 ← ++ init::sx#2 to ++ Resolved ranged comparison value [96] if(init::sx#1!=rangelast(0,PLEX_COUNT-1)) goto init::@1 to (const nomodify byte) PLEX_COUNT-(byte) 1+(number) 1 Resolved ranged next value [101] init::ss#1 ← ++ init::ss#2 to ++ Resolved ranged comparison value [103] if(init::ss#1!=rangelast(0,7)) goto init::@3 to (number) 8 -Resolved ranged next value [141] loop::sy#1 ← ++ loop::sy#2 to ++ -Resolved ranged comparison value [143] if(loop::sy#1!=rangelast(0,PLEX_COUNT-1)) goto loop::@10 to (const nomodify byte) PLEX_COUNT-(byte) 1+(number) 1 +Resolved ranged next value [146] loop::sy#1 ← ++ loop::sy#2 to ++ +Resolved ranged comparison value [148] if(loop::sy#1!=rangelast(0,PLEX_COUNT-1)) goto loop::@10 to (const nomodify byte) PLEX_COUNT-(byte) 1+(number) 1 Eliminating unused variable (byte*) PLEX_SCREEN_PTR#1 and assignment [3] (byte*) PLEX_SCREEN_PTR#1 ← (const byte*) plexInit::screen#0 + (word) $3f8 Eliminating unused constant (const byte) plex_irq::rasterY#0 Successful SSA optimization PassNEliminateUnusedVars @@ -942,12 +949,12 @@ Successful SSA optimization Pass2AliasElimination Alias candidate removed (volatile)plex_free_next = plexShowSprite::plexFreeAdd1_$2 Alias candidate removed (volatile)plex_sprite_idx = plexShowSprite::$6 Simple Condition (bool~) plexSort::$5 [21] if((byte) plexSort::s#1!=(byte) $ff) goto plexSort::@8 -Simple Condition (bool~) plex_irq::$3 [92] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@9 -Simple Condition (bool~) plexSort::$6 [115] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 -Simple Condition (bool~) plex_irq::$5 [116] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3 +Simple Condition (bool~) plex_irq::$3 [95] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@9 +Simple Condition (bool~) plexSort::$6 [118] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 +Simple Condition (bool~) plex_irq::$5 [119] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3 Successful SSA optimization Pass2ConditionalJumpSimplification Negating conditional jump and destination [21] if((byte) plexSort::s#1==(byte) $ff) goto plexSort::@4 -Negating conditional jump and destination [92] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 +Negating conditional jump and destination [95] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 Successful SSA optimization Pass2ConditionalJumpSequenceImprovement Alias candidate removed (volatile)plex_free_next = plexShowSprite::plexFreeAdd1_$2 Alias candidate removed (volatile)plex_sprite_idx = plexShowSprite::$6 @@ -1013,18 +1020,18 @@ CALL GRAPH Calls in [] to main:7 Calls in [main] to init:11 loop:13 Calls in [loop] to plexSort:28 -Calls in [init] to plexInit:65 -Calls in [plex_irq] to plexShowSprite:100 +Calls in [init] to plexInit:63 +Calls in [plex_irq] to plexShowSprite:101 Created 10 initial phi equivalence classes Not coalescing [20] loop::y_idx#4 ← loop::sin_idx#6 -Coalesced [33] loop::sin_idx#8 ← loop::sin_idx#1 -Coalesced [34] loop::y_idx#3 ← loop::y_idx#1 -Coalesced [35] loop::sy#3 ← loop::sy#1 -Not coalescing [41] plexSort::s#6 ← plexSort::m#2 -Coalesced [61] plexSort::plexFreePrepare1_s#3 ← plexSort::plexFreePrepare1_s#1 -Coalesced [62] plexSort::m#7 ← plexSort::m#1 -Coalesced [63] plexSort::s#5 ← plexSort::s#1 +Coalesced [31] loop::sin_idx#8 ← loop::sin_idx#1 +Coalesced [32] loop::y_idx#3 ← loop::y_idx#1 +Coalesced [33] loop::sy#3 ← loop::sy#1 +Not coalescing [39] plexSort::s#6 ← plexSort::m#2 +Coalesced [59] plexSort::plexFreePrepare1_s#3 ← plexSort::plexFreePrepare1_s#1 +Coalesced [60] plexSort::m#7 ← plexSort::m#1 +Coalesced [61] plexSort::s#5 ← plexSort::s#1 Coalesced [86] init::ss#3 ← init::ss#1 Coalesced [87] init::sx#3 ← init::sx#1 Coalesced [88] init::xp#3 ← init::xp#1 @@ -1134,91 +1141,91 @@ loop::@5: scope:[loop] from loop::@4 loop::@6: scope:[loop] from loop::@5 [27] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) GREEN [28] (volatile bool) framedone ← false - [29] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f - [30] *((const nomodify byte*) RASTER) ← (byte) 0 to:loop::@1 (void()) plexSort() plexSort: scope:[plexSort] from loop::@5 - [31] phi() + [29] phi() to:plexSort::@1 plexSort::@1: scope:[plexSort] from plexSort 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_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2) - [34] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0) - [35] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 + [30] (byte) plexSort::m#2 ← phi( plexSort/(byte) 0 plexSort::@2/(byte) plexSort::m#1 ) + [31] (byte) plexSort::nxt_idx#0 ← *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2) + [32] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0) + [33] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 to:plexSort::@5 plexSort::@5: scope:[plexSort] from plexSort::@1 - [36] (byte) plexSort::s#6 ← (byte) plexSort::m#2 + [34] (byte) plexSort::s#6 ← (byte) plexSort::m#2 to:plexSort::@3 plexSort::@3: scope:[plexSort] from plexSort::@5 plexSort::@7 - [37] (byte) plexSort::s#3 ← phi( plexSort::@7/(byte) plexSort::s#1 plexSort::@5/(byte) plexSort::s#6 ) - [38] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) 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 + [35] (byte) plexSort::s#3 ← phi( plexSort::@7/(byte) plexSort::s#1 plexSort::@5/(byte) plexSort::s#6 ) + [36] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) + [37] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 + [38] if((byte) plexSort::s#1==(byte) $ff) goto plexSort::@4 to:plexSort::@7 plexSort::@7: scope:[plexSort] from plexSort::@3 - [41] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 + [39] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 to:plexSort::@4 plexSort::@4: scope:[plexSort] from plexSort::@3 plexSort::@7 - [42] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 - [43] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 + [40] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 + [41] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 to:plexSort::@2 plexSort::@2: scope:[plexSort] from plexSort::@1 plexSort::@4 - [44] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 - [45] if((byte) plexSort::m#1!=(const nomodify byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1 + [42] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 + [43] if((byte) plexSort::m#1!=(const nomodify byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1 to:plexSort::@6 plexSort::@6: scope:[plexSort] from plexSort::@2 - [46] (volatile byte) plex_show_idx ← (byte) 0 - [47] (volatile byte) plex_sprite_idx ← (byte) 0 - [48] (volatile byte) plex_sprite_msb ← (byte) 1 + [44] (volatile byte) plex_show_idx ← (byte) 0 + [45] (volatile byte) plex_sprite_idx ← (byte) 0 + [46] (volatile byte) plex_sprite_msb ← (byte) 1 to:plexSort::plexFreePrepare1 plexSort::plexFreePrepare1: scope:[plexSort] from plexSort::@6 - [49] phi() + [47] phi() to:plexSort::plexFreePrepare1_@1 plexSort::plexFreePrepare1_@1: scope:[plexSort] from plexSort::plexFreePrepare1 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*) 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 + [48] (byte) plexSort::plexFreePrepare1_s#2 ← phi( plexSort::plexFreePrepare1/(byte) 0 plexSort::plexFreePrepare1_@1/(byte) plexSort::plexFreePrepare1_s#1 ) + [49] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 + [50] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 + [51] 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 - [54] (volatile byte) plex_free_next ← (byte) 0 + [52] (volatile byte) plex_free_next ← (byte) 0 to:plexSort::@return plexSort::@return: scope:[plexSort] from plexSort::plexFreePrepare1_@2 - [55] return + [53] return to:@return (void()) init() init: scope:[init] from main - [56] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 - [57] call plexInit + [54] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 + [55] call plexInit to:init::@1 init::@1: scope:[init] from init init::@1 - [58] (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init/(word) $20 ) - [58] (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init/(byte) 0 ) - [59] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 - [60] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1 - [61] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (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 nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto init::@1 + [56] (word) init::xp#2 ← phi( init::@1/(word) init::xp#1 init/(word) $20 ) + [56] (byte) init::sx#2 ← phi( init::@1/(byte) init::sx#1 init/(byte) 0 ) + [57] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 + [58] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1 + [59] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (word) init::xp#2 + [60] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 + [61] (byte) init::sx#1 ← ++ (byte) init::sx#2 + [62] if((byte) init::sx#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto init::@1 to:init::@2 init::@2: scope:[init] from init::@1 - [65] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff + [63] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff to:init::@3 init::@3: scope:[init] from init::@2 init::@3 - [66] (byte) init::ss#2 ← phi( init::@2/(byte) 0 init::@3/(byte) init::ss#1 ) - [67] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN - [68] (byte) init::ss#1 ← ++ (byte) init::ss#2 - [69] if((byte) init::ss#1!=(byte) 8) goto init::@3 + [64] (byte) init::ss#2 ← phi( init::@2/(byte) 0 init::@3/(byte) init::ss#1 ) + [65] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN + [66] (byte) init::ss#1 ← ++ (byte) init::ss#2 + [67] if((byte) init::ss#1!=(byte) 8) goto init::@3 to:init::@4 init::@4: scope:[init] from init::@3 asm { sei } - [71] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR - [72] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER - [73] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER - [74] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() + [69] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR + [70] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER + [71] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER + [72] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() + [73] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f + [74] *((const nomodify byte*) RASTER) ← (byte) 0 asm { cli } to:init::@return init::@return: scope:[init] from init::@4 @@ -1244,87 +1251,90 @@ plexInit::@return: scope:[plexInit] from plexInit::@1 interrupt(KERNEL_MIN)(void()) plex_irq() plex_irq: scope:[plex_irq] from - [84] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE + asm { sei } + [85] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE to:plex_irq::@3 plex_irq::@3: scope:[plex_irq] from plex_irq plex_irq::@7 - [85] phi() - [86] call plexShowSprite + [86] phi() + [87] call plexShowSprite to:plex_irq::plexFreeNextYpos1 plex_irq::plexFreeNextYpos1: scope:[plex_irq] from plex_irq::@3 - [87] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) + [88] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) to:plex_irq::@6 plex_irq::@6: scope:[plex_irq] from plex_irq::plexFreeNextYpos1 - [88] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 2 - [89] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 + [89] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 2 + [90] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 to:plex_irq::@7 plex_irq::@7: scope:[plex_irq] from plex_irq::@6 - [90] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3 + [91] 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 - [91] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER - [92] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 + [92] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER + [93] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 to:plex_irq::@5 plex_irq::@5: scope:[plex_irq] from plex_irq::@4 - [93] (volatile bool) framedone ← true + [94] *((const nomodify byte*) RASTER) ← (byte) 0 + [95] (volatile bool) framedone ← true to:plex_irq::@2 plex_irq::@2: scope:[plex_irq] from plex_irq::@1 plex_irq::@5 - [94] *((const nomodify byte*) BORDERCOL) ← (byte) 0 + [96] *((const nomodify byte*) BORDERCOL) ← (byte) 0 + asm { cli } to:plex_irq::@return plex_irq::@return: scope:[plex_irq] from plex_irq::@2 - [95] return + [98] return to:@return plex_irq::@1: scope:[plex_irq] from plex_irq::@4 - [96] *((const nomodify byte*) RASTER) ← (byte) plex_irq::plexFreeNextYpos1_return#0 + [99] *((const nomodify byte*) RASTER) ← (byte) plex_irq::plexFreeNextYpos1_return#0 to:plex_irq::@2 (void()) plexShowSprite() plexShowSprite: scope:[plexShowSprite] from plex_irq::@3 - [97] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 - [98] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) - [99] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + [100] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 + [101] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) + [102] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 to:plexShowSprite::plexFreeAdd1 plexShowSprite::plexFreeAdd1: scope:[plexShowSprite] from plexShowSprite - [100] (byte~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte) $15 - [101] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 - [102] (byte~) plexShowSprite::plexFreeAdd1_$1 ← (volatile byte) plex_free_next + (byte) 1 - [103] (byte~) plexShowSprite::plexFreeAdd1_$2 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7 - [104] (volatile byte) plex_free_next ← (byte~) plexShowSprite::plexFreeAdd1_$2 + [103] (byte~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte) $15 + [104] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 + [105] (byte~) plexShowSprite::plexFreeAdd1_$1 ← (volatile byte) plex_free_next + (byte) 1 + [106] (byte~) plexShowSprite::plexFreeAdd1_$2 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7 + [107] (volatile byte) plex_free_next ← (byte~) plexShowSprite::plexFreeAdd1_$2 to:plexShowSprite::@5 plexShowSprite::@5: scope:[plexShowSprite] from plexShowSprite::plexFreeAdd1 - [105] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) - [106] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) - [107] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 - [108] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) - [109] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 - [110] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) - [111] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1 + [108] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) + [109] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) + [110] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 + [111] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) + [112] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 + [113] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) + [114] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1 to:plexShowSprite::@3 plexShowSprite::@3: scope:[plexShowSprite] from plexShowSprite::@5 - [112] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb - [113] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 + [115] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb + [116] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 to:plexShowSprite::@2 plexShowSprite::@2: scope:[plexShowSprite] from plexShowSprite::@1 plexShowSprite::@3 - [114] (byte~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (byte) 1 - [115] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7 - [116] (volatile byte) plex_sprite_idx ← (byte~) plexShowSprite::$6 - [117] (volatile byte) plex_show_idx ← ++ (volatile byte) plex_show_idx - [118] (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (byte) 1 - [119] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return + [117] (byte~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (byte) 1 + [118] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7 + [119] (volatile byte) plex_sprite_idx ← (byte~) plexShowSprite::$6 + [120] (volatile byte) plex_show_idx ← ++ (volatile byte) plex_show_idx + [121] (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (byte) 1 + [122] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return to:plexShowSprite::@4 plexShowSprite::@4: scope:[plexShowSprite] from plexShowSprite::@2 - [120] (volatile byte) plex_sprite_msb ← (byte) 1 + [123] (volatile byte) plex_sprite_msb ← (byte) 1 to:plexShowSprite::@return plexShowSprite::@return: scope:[plexShowSprite] from plexShowSprite::@2 plexShowSprite::@4 - [121] return + [124] return to:@return plexShowSprite::@1: scope:[plexShowSprite] from plexShowSprite::@5 - [122] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb + [125] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb to:plexShowSprite::@2 VARIABLE REGISTER WEIGHTS (byte*) PLEX_SCREEN_PTR -(volatile bool) framedone loadstore 1000.5454545454544 +(volatile bool) framedone loadstore 1222.8888888888887 (void()) init() (byte~) init::$3 2002.0 (byte) init::ss @@ -1338,7 +1348,7 @@ VARIABLE REGISTER WEIGHTS (word) init::xp#2 750.75 (void()) loop() (byte) loop::sin_idx -(byte) loop::sin_idx#1 286.0 +(byte) loop::sin_idx#1 400.4 (byte) loop::sin_idx#6 333.6666666666667 (byte) loop::sy (byte) loop::sy#1 15001.5 @@ -1387,15 +1397,15 @@ VARIABLE REGISTER WEIGHTS (byte) plexSort::s#2 2000002.0 (byte) plexSort::s#3 2.05000025E7 (byte) plexSort::s#6 2000002.0 -(volatile byte) plex_free_next loadstore 332.80645161290323 +(volatile byte) plex_free_next loadstore 322.40625 interrupt(KERNEL_MIN)(void()) plex_irq() (byte~) plex_irq::$4 11.0 (byte) plex_irq::plexFreeNextYpos1_return (byte) plex_irq::plexFreeNextYpos1_return#0 4.0 (byte) plex_irq::rasterY -(volatile byte) plex_show_idx loadstore 309.44117647058835 -(volatile byte) plex_sprite_idx loadstore 335.7096774193548 -(volatile byte) plex_sprite_msb loadstore 321.4848484848485 +(volatile byte) plex_show_idx loadstore 300.6000000000001 +(volatile byte) plex_sprite_idx loadstore 325.21875 +(volatile byte) plex_sprite_msb loadstore 312.029411764706 Initial phi equivalence classes [ loop::sin_idx#6 loop::sin_idx#1 ] @@ -1674,7 +1684,7 @@ loop: { // [25] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BORDERCOL // [26] call plexSort - // [31] phi from loop::@5 to plexSort [phi:loop::@5->plexSort] + // [29] phi from loop::@5 to plexSort [phi:loop::@5->plexSort] plexSort_from___b5: jsr plexSort jmp __b6 @@ -1686,13 +1696,6 @@ loop: { // [28] (volatile bool) framedone ← false -- vboz1=vboc1 lda #0 sta.z framedone - // [29] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 - lda #$7f - and VIC_CONTROL - sta VIC_CONTROL - // [30] *((const nomodify byte*) RASTER) ← (byte) 0 -- _deref_pbuc1=vbuc2 - lda #0 - sta RASTER // [15] phi from loop::@6 to loop::@1 [phi:loop::@6->loop::@1] __b1_from___b6: // [15] phi (byte) loop::sin_idx#6 = (byte) loop::sin_idx#1 [phi:loop::@6->loop::@1#0] -- register_copy @@ -1715,27 +1718,27 @@ plexSort: { .label s = 6 .label s_1 = $14 .label plexFreePrepare1_s = 7 - // [32] phi from plexSort to plexSort::@1 [phi:plexSort->plexSort::@1] + // [30] phi from plexSort to plexSort::@1 [phi:plexSort->plexSort::@1] __b1_from_plexSort: - // [32] phi (byte) plexSort::m#2 = (byte) 0 [phi:plexSort->plexSort::@1#0] -- vbuz1=vbuc1 + // [30] phi (byte) plexSort::m#2 = (byte) 0 [phi:plexSort->plexSort::@1#0] -- vbuz1=vbuc1 lda #0 sta.z m jmp __b1 - // [32] phi from plexSort::@2 to plexSort::@1 [phi:plexSort::@2->plexSort::@1] + // [30] phi from plexSort::@2 to plexSort::@1 [phi:plexSort::@2->plexSort::@1] __b1_from___b2: - // [32] phi (byte) plexSort::m#2 = (byte) plexSort::m#1 [phi:plexSort::@2->plexSort::@1#0] -- register_copy + // [30] phi (byte) plexSort::m#2 = (byte) plexSort::m#1 [phi:plexSort::@2->plexSort::@1#0] -- register_copy jmp __b1 // plexSort::@1 __b1: - // [33] (byte) plexSort::nxt_idx#0 ← *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2) -- vbuz1=pbuc1_derefidx_vbuz2 + // [31] (byte) plexSort::nxt_idx#0 ← *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2) -- vbuz1=pbuc1_derefidx_vbuz2 ldy.z m lda PLEX_SORTED_IDX+1,y sta.z nxt_idx - // [34] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0) -- vbuz1=pbuc1_derefidx_vbuz2 + // [32] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0) -- vbuz1=pbuc1_derefidx_vbuz2 ldy.z nxt_idx lda PLEX_YPOS,y sta.z nxt_y - // [35] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 -- vbuz1_ge_pbuc1_derefidx_(pbuc2_derefidx_vbuz2)_then_la1 + // [33] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 -- vbuz1_ge_pbuc1_derefidx_(pbuc2_derefidx_vbuz2)_then_la1 lda.z nxt_y ldx.z m ldy PLEX_SORTED_IDX,x @@ -1744,30 +1747,30 @@ plexSort: { jmp __b5 // plexSort::@5 __b5: - // [36] (byte) plexSort::s#6 ← (byte) plexSort::m#2 -- vbuz1=vbuz2 + // [34] (byte) plexSort::s#6 ← (byte) plexSort::m#2 -- vbuz1=vbuz2 lda.z m sta.z s - // [37] phi from plexSort::@5 plexSort::@7 to plexSort::@3 [phi:plexSort::@5/plexSort::@7->plexSort::@3] + // [35] phi from plexSort::@5 plexSort::@7 to plexSort::@3 [phi:plexSort::@5/plexSort::@7->plexSort::@3] __b3_from___b5: __b3_from___b7: - // [37] phi (byte) plexSort::s#3 = (byte) plexSort::s#6 [phi:plexSort::@5/plexSort::@7->plexSort::@3#0] -- register_copy + // [35] phi (byte) plexSort::s#3 = (byte) plexSort::s#6 [phi:plexSort::@5/plexSort::@7->plexSort::@3#0] -- register_copy jmp __b3 // plexSort::@3 __b3: - // [38] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + // [36] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy.z s lda PLEX_SORTED_IDX,y sta PLEX_SORTED_IDX+1,y - // [39] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 -- vbuz1=_dec_vbuz1 + // [37] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 -- vbuz1=_dec_vbuz1 dec.z s - // [40] if((byte) plexSort::s#1==(byte) $ff) goto plexSort::@4 -- vbuz1_eq_vbuc1_then_la1 + // [38] if((byte) plexSort::s#1==(byte) $ff) goto plexSort::@4 -- vbuz1_eq_vbuc1_then_la1 lda #$ff cmp.z s beq __b4 jmp __b7 // plexSort::@7 __b7: - // [41] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 -- vbuz1_lt_pbuc1_derefidx_(pbuc2_derefidx_vbuz2)_then_la1 + // [39] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 -- vbuz1_lt_pbuc1_derefidx_(pbuc2_derefidx_vbuz2)_then_la1 lda.z nxt_y ldx.z s ldy PLEX_SORTED_IDX,x @@ -1776,73 +1779,73 @@ plexSort: { jmp __b4 // plexSort::@4 __b4: - // [42] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 -- vbuz1=_inc_vbuz2 + // [40] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 -- vbuz1=_inc_vbuz2 ldy.z s iny sty.z s_1 - // [43] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 -- pbuc1_derefidx_vbuz1=vbuz2 + // [41] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z nxt_idx ldy.z s_1 sta PLEX_SORTED_IDX,y jmp __b2 // plexSort::@2 __b2: - // [44] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 -- vbuz1=_inc_vbuz1 + // [42] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 -- vbuz1=_inc_vbuz1 inc.z m - // [45] if((byte) plexSort::m#1!=(const nomodify byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1 -- vbuz1_neq_vbuc1_then_la1 + // [43] if((byte) plexSort::m#1!=(const nomodify byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1 -- vbuz1_neq_vbuc1_then_la1 lda #PLEX_COUNT-2+1 cmp.z m bne __b1_from___b2 jmp __b6 // plexSort::@6 __b6: - // [46] (volatile byte) plex_show_idx ← (byte) 0 -- vbuz1=vbuc1 + // [44] (volatile byte) plex_show_idx ← (byte) 0 -- vbuz1=vbuc1 // Prepare for showing the sprites lda #0 sta.z plex_show_idx - // [47] (volatile byte) plex_sprite_idx ← (byte) 0 -- vbuz1=vbuc1 + // [45] (volatile byte) plex_sprite_idx ← (byte) 0 -- vbuz1=vbuc1 lda #0 sta.z plex_sprite_idx - // [48] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 + // [46] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 lda #1 sta.z plex_sprite_msb - // [49] phi from plexSort::@6 to plexSort::plexFreePrepare1 [phi:plexSort::@6->plexSort::plexFreePrepare1] + // [47] phi from plexSort::@6 to plexSort::plexFreePrepare1 [phi:plexSort::@6->plexSort::plexFreePrepare1] plexFreePrepare1_from___b6: jmp plexFreePrepare1 // plexSort::plexFreePrepare1 plexFreePrepare1: - // [50] phi from plexSort::plexFreePrepare1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1] + // [48] phi from plexSort::plexFreePrepare1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1] plexFreePrepare1___b1_from_plexFreePrepare1: - // [50] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) 0 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1#0] -- vbuz1=vbuc1 + // [48] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) 0 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1#0] -- vbuz1=vbuc1 lda #0 sta.z plexFreePrepare1_s jmp plexFreePrepare1___b1 - // [50] phi from plexSort::plexFreePrepare1_@1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1] + // [48] phi from plexSort::plexFreePrepare1_@1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1] plexFreePrepare1___b1_from_plexFreePrepare1___b1: - // [50] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) plexSort::plexFreePrepare1_s#1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1#0] -- register_copy + // [48] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) plexSort::plexFreePrepare1_s#1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1#0] -- register_copy jmp plexFreePrepare1___b1 // plexSort::plexFreePrepare1_@1 plexFreePrepare1___b1: - // [51] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [49] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 -- pbuc1_derefidx_vbuz1=vbuc2 lda #0 ldy.z plexFreePrepare1_s sta PLEX_FREE_YPOS,y - // [52] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 -- vbuz1=_inc_vbuz1 + // [50] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 -- vbuz1=_inc_vbuz1 inc.z plexFreePrepare1_s - // [53] if((byte) plexSort::plexFreePrepare1_s#1!=(byte) 8) goto plexSort::plexFreePrepare1_@1 -- vbuz1_neq_vbuc1_then_la1 + // [51] if((byte) plexSort::plexFreePrepare1_s#1!=(byte) 8) goto plexSort::plexFreePrepare1_@1 -- vbuz1_neq_vbuc1_then_la1 lda #8 cmp.z plexFreePrepare1_s bne plexFreePrepare1___b1_from_plexFreePrepare1___b1 jmp plexFreePrepare1___b2 // plexSort::plexFreePrepare1_@2 plexFreePrepare1___b2: - // [54] (volatile byte) plex_free_next ← (byte) 0 -- vbuz1=vbuc1 + // [52] (volatile byte) plex_free_next ← (byte) 0 -- vbuz1=vbuc1 lda #0 sta.z plex_free_next jmp __breturn // plexSort::@return __breturn: - // [55] return + // [53] return rts } // init @@ -1853,47 +1856,47 @@ init: { .label xp = 9 .label sx = 8 .label ss = $b - // [56] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 -- _deref_pbuc1=vbuc2 + // [54] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 -- _deref_pbuc1=vbuc2 lda #VIC_DEN|VIC_RSEL|3 sta D011 - // [57] call plexInit + // [55] call plexInit // Initialize the multiplexer // [77] phi from init to plexInit [phi:init->plexInit] plexInit_from_init: jsr plexInit - // [58] phi from init to init::@1 [phi:init->init::@1] + // [56] phi from init to init::@1 [phi:init->init::@1] __b1_from_init: - // [58] phi (word) init::xp#2 = (word) $20 [phi:init->init::@1#0] -- vwuz1=vwuc1 + // [56] phi (word) init::xp#2 = (word) $20 [phi:init->init::@1#0] -- vwuz1=vwuc1 lda #<$20 sta.z xp lda #>$20 sta.z xp+1 - // [58] phi (byte) init::sx#2 = (byte) 0 [phi:init->init::@1#1] -- vbuz1=vbuc1 + // [56] phi (byte) init::sx#2 = (byte) 0 [phi:init->init::@1#1] -- vbuz1=vbuc1 lda #0 sta.z sx jmp __b1 - // [58] phi from init::@1 to init::@1 [phi:init::@1->init::@1] + // [56] phi from init::@1 to init::@1 [phi:init::@1->init::@1] __b1_from___b1: - // [58] phi (word) init::xp#2 = (word) init::xp#1 [phi:init::@1->init::@1#0] -- register_copy - // [58] phi (byte) init::sx#2 = (byte) init::sx#1 [phi:init::@1->init::@1#1] -- register_copy + // [56] phi (word) init::xp#2 = (word) init::xp#1 [phi:init::@1->init::@1#0] -- register_copy + // [56] phi (byte) init::sx#2 = (byte) init::sx#1 [phi:init::@1->init::@1#1] -- register_copy jmp __b1 // init::@1 __b1: - // [59] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuz1=vbuc2 + // [57] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuz1=vbuc2 lda #$ff&SPRITE/$40 ldy.z sx sta PLEX_PTR,y - // [60] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1 -- vbuz1=vbuz2_rol_1 + // [58] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1 -- vbuz1=vbuz2_rol_1 lda.z sx asl sta.z __3 - // [61] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (word) init::xp#2 -- pwuc1_derefidx_vbuz1=vwuz2 + // [59] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (word) init::xp#2 -- pwuc1_derefidx_vbuz1=vwuz2 ldy.z __3 lda.z xp sta PLEX_XPOS,y lda.z xp+1 sta PLEX_XPOS+1,y - // [62] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 -- vwuz1=vwuz1_plus_vbuc1 + // [60] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 -- vwuz1=vwuz1_plus_vbuc1 lda #9 clc adc.z xp @@ -1901,38 +1904,38 @@ init: { bcc !+ inc.z xp+1 !: - // [63] (byte) init::sx#1 ← ++ (byte) init::sx#2 -- vbuz1=_inc_vbuz1 + // [61] (byte) init::sx#1 ← ++ (byte) init::sx#2 -- vbuz1=_inc_vbuz1 inc.z sx - // [64] if((byte) init::sx#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto init::@1 -- vbuz1_neq_vbuc1_then_la1 + // [62] if((byte) init::sx#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto init::@1 -- vbuz1_neq_vbuc1_then_la1 lda #PLEX_COUNT-1+1 cmp.z sx bne __b1_from___b1 jmp __b2 // init::@2 __b2: - // [65] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2 + // [63] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2 // Enable & initialize sprites lda #$ff sta SPRITES_ENABLE - // [66] phi from init::@2 to init::@3 [phi:init::@2->init::@3] + // [64] phi from init::@2 to init::@3 [phi:init::@2->init::@3] __b3_from___b2: - // [66] phi (byte) init::ss#2 = (byte) 0 [phi:init::@2->init::@3#0] -- vbuz1=vbuc1 + // [64] phi (byte) init::ss#2 = (byte) 0 [phi:init::@2->init::@3#0] -- vbuz1=vbuc1 lda #0 sta.z ss jmp __b3 - // [66] phi from init::@3 to init::@3 [phi:init::@3->init::@3] + // [64] phi from init::@3 to init::@3 [phi:init::@3->init::@3] __b3_from___b3: - // [66] phi (byte) init::ss#2 = (byte) init::ss#1 [phi:init::@3->init::@3#0] -- register_copy + // [64] phi (byte) init::ss#2 = (byte) init::ss#1 [phi:init::@3->init::@3#0] -- register_copy jmp __b3 // init::@3 __b3: - // [67] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN -- pbuc1_derefidx_vbuz1=vbuc2 + // [65] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN -- pbuc1_derefidx_vbuz1=vbuc2 lda #GREEN ldy.z ss sta SPRITES_COLS,y - // [68] (byte) init::ss#1 ← ++ (byte) init::ss#2 -- vbuz1=_inc_vbuz1 + // [66] (byte) init::ss#1 ← ++ (byte) init::ss#2 -- vbuz1=_inc_vbuz1 inc.z ss - // [69] if((byte) init::ss#1!=(byte) 8) goto init::@3 -- vbuz1_neq_vbuc1_then_la1 + // [67] if((byte) init::ss#1!=(byte) 8) goto init::@3 -- vbuz1_neq_vbuc1_then_la1 lda #8 cmp.z ss bne __b3_from___b3 @@ -1942,20 +1945,27 @@ init: { // asm { sei } // enable the interrupt sei - // [71] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 + // [69] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 lda #CIA_INTERRUPT_CLEAR sta CIA1_INTERRUPT - // [72] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // [70] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 lda #IRQ_RASTER sta IRQ_ENABLE - // [73] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // [71] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 lda #IRQ_RASTER sta IRQ_STATUS - // [74] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() -- _deref_pptc1=pprc2 + // [72] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() -- _deref_pptc1=pprc2 lda #plex_irq sta KERNEL_IRQ+1 + // [73] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + lda #$7f + and VIC_CONTROL + sta VIC_CONTROL + // [74] *((const nomodify byte*) RASTER) ← (byte) 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta RASTER // asm { cli } cli jmp __breturn @@ -2006,73 +2016,80 @@ plex_irq: { .label __4 = $17 .label plexFreeNextYpos1_return = $16 // entry interrupt(KERNEL_MIN) - // [84] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2 + // asm { sei } + sei + // [85] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2 lda #WHITE sta BORDERCOL - // [85] phi from plex_irq plex_irq::@7 to plex_irq::@3 [phi:plex_irq/plex_irq::@7->plex_irq::@3] + // [86] phi from plex_irq plex_irq::@7 to plex_irq::@3 [phi:plex_irq/plex_irq::@7->plex_irq::@3] __b3_from_plex_irq: __b3_from___b7: jmp __b3 // plex_irq::@3 __b3: - // [86] call plexShowSprite + // [87] call plexShowSprite jsr plexShowSprite jmp plexFreeNextYpos1 // plex_irq::plexFreeNextYpos1 plexFreeNextYpos1: - // [87] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) -- vbuz1=pbuc1_derefidx_vbuz2 + // [88] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) -- vbuz1=pbuc1_derefidx_vbuz2 ldy.z plex_free_next lda PLEX_FREE_YPOS,y sta.z plexFreeNextYpos1_return jmp __b6 // plex_irq::@6 __b6: - // [88] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 2 -- vbuz1=_deref_pbuc1_plus_2 + // [89] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 2 -- vbuz1=_deref_pbuc1_plus_2 lda RASTER clc adc #2 sta.z __4 - // [89] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 -- vbuz1_ge_vbuc1_then_la1 + // [90] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 -- vbuz1_ge_vbuc1_then_la1 lda.z plex_show_idx cmp #PLEX_COUNT bcs __b4 jmp __b7 // plex_irq::@7 __b7: - // [90] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3 -- vbuz1_lt_vbuz2_then_la1 + // [91] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3 -- vbuz1_lt_vbuz2_then_la1 lda.z plexFreeNextYpos1_return cmp.z __4 bcc __b3_from___b7 jmp __b4 // plex_irq::@4 __b4: - // [91] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // [92] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 lda #IRQ_RASTER sta IRQ_STATUS - // [92] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 -- vbuz1_lt_vbuc1_then_la1 + // [93] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 -- vbuz1_lt_vbuc1_then_la1 lda.z plex_show_idx cmp #PLEX_COUNT bcc __b1 jmp __b5 // plex_irq::@5 __b5: - // [93] (volatile bool) framedone ← true -- vboz1=vboc1 + // [94] *((const nomodify byte*) RASTER) ← (byte) 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta RASTER + // [95] (volatile bool) framedone ← true -- vboz1=vboc1 lda #1 sta.z framedone jmp __b2 // plex_irq::@2 __b2: - // [94] *((const nomodify byte*) BORDERCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 + // [96] *((const nomodify byte*) BORDERCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 lda #0 sta BORDERCOL + // asm { cli } + cli jmp __breturn // plex_irq::@return __breturn: - // [95] return - exit interrupt(KERNEL_MIN) + // [98] return - exit interrupt(KERNEL_MIN) jmp $ea81 // plex_irq::@1 __b1: - // [96] *((const nomodify byte*) RASTER) ← (byte) plex_irq::plexFreeNextYpos1_return#0 -- _deref_pbuc1=vbuz1 + // [99] *((const nomodify byte*) RASTER) ← (byte) plex_irq::plexFreeNextYpos1_return#0 -- _deref_pbuc1=vbuz1 lda.z plexFreeNextYpos1_return sta RASTER jmp __b2 @@ -2093,121 +2110,121 @@ plexShowSprite: { .label plex_sprite_idx2 = $18 .label plexFreeAdd1_ypos = $19 .label xpos_idx = $1d - // [97] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 -- vbuz1=vbuz2_rol_1 + // [100] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 -- vbuz1=vbuz2_rol_1 lda.z plex_sprite_idx asl sta.z plex_sprite_idx2 - // [98] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) -- vbuz1=pbuc1_derefidx_(pbuc2_derefidx_vbuz2) + // [101] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) -- vbuz1=pbuc1_derefidx_(pbuc2_derefidx_vbuz2) ldx.z plex_show_idx ldy PLEX_SORTED_IDX,x ldx PLEX_YPOS,y stx.z plexFreeAdd1_ypos - // [99] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 -- pbuc1_derefidx_vbuz1=vbuz2 + // [102] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z plexFreeAdd1_ypos ldy.z plex_sprite_idx2 sta SPRITES_YPOS,y jmp plexFreeAdd1 // plexShowSprite::plexFreeAdd1 plexFreeAdd1: - // [100] (byte~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte) $15 -- vbuz1=vbuz2_plus_vbuc1 + // [103] (byte~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte) $15 -- vbuz1=vbuz2_plus_vbuc1 lax.z plexFreeAdd1_ypos axs #-[$15] stx.z plexFreeAdd1___0 - // [101] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 -- pbuc1_derefidx_vbuz1=vbuz2 + // [104] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z plexFreeAdd1___0 ldy.z plex_free_next sta PLEX_FREE_YPOS,y - // [102] (byte~) plexShowSprite::plexFreeAdd1_$1 ← (volatile byte) plex_free_next + (byte) 1 -- vbuz1=vbuz2_plus_1 + // [105] (byte~) plexShowSprite::plexFreeAdd1_$1 ← (volatile byte) plex_free_next + (byte) 1 -- vbuz1=vbuz2_plus_1 ldy.z plex_free_next iny sty.z plexFreeAdd1___1 - // [103] (byte~) plexShowSprite::plexFreeAdd1_$2 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7 -- vbuz1=vbuz2_band_vbuc1 + // [106] (byte~) plexShowSprite::plexFreeAdd1_$2 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7 -- vbuz1=vbuz2_band_vbuc1 lda #7 and.z plexFreeAdd1___1 sta.z plexFreeAdd1___2 - // [104] (volatile byte) plex_free_next ← (byte~) plexShowSprite::plexFreeAdd1_$2 -- vbuz1=vbuz2 + // [107] (volatile byte) plex_free_next ← (byte~) plexShowSprite::plexFreeAdd1_$2 -- vbuz1=vbuz2 lda.z plexFreeAdd1___2 sta.z plex_free_next jmp __b5 // plexShowSprite::@5 __b5: - // [105] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_(pbuc3_derefidx_vbuz2) + // [108] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_(pbuc3_derefidx_vbuz2) ldx.z plex_show_idx ldy PLEX_SORTED_IDX,x lda PLEX_PTR,y ldx.z plex_sprite_idx sta PLEX_SCREEN_PTR,x - // [106] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) -- vbuz1=pbuc1_derefidx_vbuz2 + // [109] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) -- vbuz1=pbuc1_derefidx_vbuz2 ldy.z plex_show_idx lda PLEX_SORTED_IDX,y sta.z xpos_idx - // [107] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 -- vbuz1=vbuz2_rol_1 + // [110] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 -- vbuz1=vbuz2_rol_1 lda.z xpos_idx asl sta.z __11 - // [108] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) -- vbuz1=_lo_pwuc1_derefidx_vbuz2 + // [111] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) -- vbuz1=_lo_pwuc1_derefidx_vbuz2 ldy.z __11 lda PLEX_XPOS,y sta.z __2 - // [109] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 -- pbuc1_derefidx_vbuz1=vbuz2 + // [112] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z __2 ldy.z plex_sprite_idx2 sta SPRITES_XPOS,y - // [110] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) -- vbuz1=_hi_pwuc1_derefidx_vbuz2 + // [113] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) -- vbuz1=_hi_pwuc1_derefidx_vbuz2 ldy.z __11 lda PLEX_XPOS+1,y sta.z __3 - // [111] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1 -- vbuz1_neq_0_then_la1 + // [114] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1 -- vbuz1_neq_0_then_la1 lda.z __3 cmp #0 bne __b1 jmp __b3 // plexShowSprite::@3 __b3: - // [112] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb -- vbuz1=vbuc1_bxor_vbuz2 + // [115] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb -- vbuz1=vbuc1_bxor_vbuz2 lda #$ff eor.z plex_sprite_msb sta.z __9 - // [113] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 -- _deref_pbuc1=_deref_pbuc1_band_vbuz1 + // [116] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 -- _deref_pbuc1=_deref_pbuc1_band_vbuz1 lda SPRITES_XMSB and.z __9 sta SPRITES_XMSB jmp __b2 // plexShowSprite::@2 __b2: - // [114] (byte~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (byte) 1 -- vbuz1=vbuz2_plus_1 + // [117] (byte~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (byte) 1 -- vbuz1=vbuz2_plus_1 ldy.z plex_sprite_idx iny sty.z __5 - // [115] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7 -- vbuz1=vbuz2_band_vbuc1 + // [118] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7 -- vbuz1=vbuz2_band_vbuc1 lda #7 and.z __5 sta.z __6 - // [116] (volatile byte) plex_sprite_idx ← (byte~) plexShowSprite::$6 -- vbuz1=vbuz2 + // [119] (volatile byte) plex_sprite_idx ← (byte~) plexShowSprite::$6 -- vbuz1=vbuz2 lda.z __6 sta.z plex_sprite_idx - // [117] (volatile byte) plex_show_idx ← ++ (volatile byte) plex_show_idx -- vbuz1=_inc_vbuz1 + // [120] (volatile byte) plex_show_idx ← ++ (volatile byte) plex_show_idx -- vbuz1=_inc_vbuz1 inc.z plex_show_idx - // [118] (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (byte) 1 -- vbuz1=vbuz1_rol_1 + // [121] (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (byte) 1 -- vbuz1=vbuz1_rol_1 asl.z plex_sprite_msb - // [119] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return -- vbuz1_neq_0_then_la1 + // [122] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return -- vbuz1_neq_0_then_la1 lda.z plex_sprite_msb cmp #0 bne __breturn jmp __b4 // plexShowSprite::@4 __b4: - // [120] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 + // [123] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 lda #1 sta.z plex_sprite_msb jmp __breturn // plexShowSprite::@return __breturn: - // [121] return + // [124] return rts // plexShowSprite::@1 __b1: - // [122] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 + // [125] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 lda SPRITES_XMSB ora.z plex_sprite_msb sta SPRITES_XMSB @@ -2251,62 +2268,63 @@ Removing always clobbered register reg byte a as potential for zp[1]:4 [ loop::s Statement [21] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte) 8 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ( main:7::loop:12 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] { } ) always clobbers reg byte a Statement [27] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) GREEN [ loop::sin_idx#1 ] ( main:7::loop:12 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a Statement [28] (volatile bool) framedone ← false [ framedone loop::sin_idx#1 ] ( main:7::loop:12 [ framedone loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [29] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f [ framedone loop::sin_idx#1 ] ( main:7::loop:12 [ framedone loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [30] *((const nomodify byte*) RASTER) ← (byte) 0 [ framedone loop::sin_idx#1 ] ( main:7::loop:12 [ framedone loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [38] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] { } ) always clobbers reg byte a +Statement [36] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] { } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:5 [ plexSort::m#2 plexSort::m#1 ] Removing always clobbered register reg byte a as potential for zp[1]:18 [ plexSort::nxt_idx#0 ] Removing always clobbered register reg byte a as potential for zp[1]:19 [ plexSort::nxt_y#0 ] Removing always clobbered register reg byte a as potential for zp[1]:6 [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] -Statement [41] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] { } ) always clobbers reg byte a -Statement [43] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 [ plexSort::m#2 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 ] { } ) always clobbers reg byte a -Statement [46] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [47] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [48] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [51] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 [ plexSort::plexFreePrepare1_s#2 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::plexFreePrepare1_s#2 ] { } ) always clobbers reg byte a +Statement [39] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] { } ) always clobbers reg byte a +Statement [41] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 [ plexSort::m#2 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 ] { } ) always clobbers reg byte a +Statement [44] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a +Statement [45] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a +Statement [46] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a +Statement [49] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 [ plexSort::plexFreePrepare1_s#2 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::plexFreePrepare1_s#2 ] { } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:7 [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] -Statement [54] (volatile byte) plex_free_next ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [56] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [59] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::sx#2 init::xp#2 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 ] { } ) always clobbers reg byte a +Statement [52] (volatile byte) plex_free_next ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a +Statement [54] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [57] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::sx#2 init::xp#2 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 ] { } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:8 [ init::sx#2 init::sx#1 ] -Statement [60] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1 [ init::sx#2 init::xp#2 init::$3 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 init::$3 ] { } ) always clobbers reg byte a -Statement [61] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (word) init::xp#2 [ init::sx#2 init::xp#2 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 ] { } ) always clobbers reg byte a -Statement [62] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 [ init::sx#2 init::xp#1 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#1 ] { } ) always clobbers reg byte a -Statement [65] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [67] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN [ init::ss#2 ] ( main:7::init:10 [ framedone init::ss#2 ] { } ) always clobbers reg byte a +Statement [58] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1 [ init::sx#2 init::xp#2 init::$3 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 init::$3 ] { } ) always clobbers reg byte a +Statement [59] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (word) init::xp#2 [ init::sx#2 init::xp#2 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 ] { } ) always clobbers reg byte a +Statement [60] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 [ init::sx#2 init::xp#1 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#1 ] { } ) always clobbers reg byte a +Statement [63] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [65] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN [ init::ss#2 ] ( main:7::init:10 [ framedone init::ss#2 ] { } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:11 [ init::ss#2 init::ss#1 ] -Statement [71] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [72] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [73] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [74] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [84] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a -Statement [87] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte y -Statement [89] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] { } ) always clobbers reg byte a +Statement [69] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [70] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [71] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [72] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [73] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [74] *((const nomodify byte*) RASTER) ← (byte) 0 [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [85] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [88] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte y +Statement [90] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] { } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:22 [ plex_irq::plexFreeNextYpos1_return#0 ] Removing always clobbered register reg byte a as potential for zp[1]:23 [ plex_irq::$4 ] -Statement [91] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ plex_show_idx plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_show_idx plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte a -Statement [92] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 [ plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte a -Statement [93] (volatile bool) framedone ← true [ ] ( [ ] { } ) always clobbers reg byte a -Statement [94] *((const nomodify byte*) BORDERCOL) ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a -Statement [97] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a -Statement [98] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte x reg byte y +Statement [92] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ plex_show_idx plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_show_idx plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte a +Statement [93] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 [ plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte a +Statement [94] *((const nomodify byte*) RASTER) ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [95] (volatile bool) framedone ← true [ ] ( [ ] { } ) always clobbers reg byte a +Statement [96] *((const nomodify byte*) BORDERCOL) ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [100] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a +Statement [101] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte x reg byte y Removing always clobbered register reg byte x as potential for zp[1]:24 [ plexShowSprite::plex_sprite_idx2#0 ] Removing always clobbered register reg byte y as potential for zp[1]:24 [ plexShowSprite::plex_sprite_idx2#0 ] -Statement [101] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte y -Statement [105] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a reg byte x reg byte y +Statement [104] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte y +Statement [108] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a reg byte x reg byte y Removing always clobbered register reg byte a as potential for zp[1]:24 [ plexShowSprite::plex_sprite_idx2#0 ] -Statement [106] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] { } ) always clobbers reg byte y -Statement [107] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] { } ) always clobbers reg byte a -Statement [108] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] { } ) always clobbers reg byte a +Statement [109] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] { } ) always clobbers reg byte y +Statement [110] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] { } ) always clobbers reg byte a +Statement [111] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] { } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:30 [ plexShowSprite::$11 ] -Statement [109] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] { } ) always clobbers reg byte y +Statement [112] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] { } ) always clobbers reg byte y Removing always clobbered register reg byte y as potential for zp[1]:30 [ plexShowSprite::$11 ] -Statement [110] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] { } ) always clobbers reg byte a -Statement [112] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] { } ) always clobbers reg byte a -Statement [113] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a -Statement [119] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a -Statement [120] (volatile byte) plex_sprite_msb ← (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a -Statement [122] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [113] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] { } ) always clobbers reg byte a +Statement [115] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] { } ) always clobbers reg byte a +Statement [116] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [122] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [123] (volatile byte) plex_sprite_msb ← (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [125] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a Statement [1] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a Statement [2] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a Statement [3] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( [ ] { } ) always clobbers reg byte a @@ -2318,51 +2336,52 @@ Statement [20] *((const byte*) PLEX_YPOS + (byte) loop::sy#2) ← *((const byte* Statement [21] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte) 8 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ( main:7::loop:12 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] { } ) always clobbers reg byte a Statement [27] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) GREEN [ loop::sin_idx#1 ] ( main:7::loop:12 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a Statement [28] (volatile bool) framedone ← false [ framedone loop::sin_idx#1 ] ( main:7::loop:12 [ framedone loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [29] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f [ framedone loop::sin_idx#1 ] ( main:7::loop:12 [ framedone loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [30] *((const nomodify byte*) RASTER) ← (byte) 0 [ framedone loop::sin_idx#1 ] ( main:7::loop:12 [ framedone loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [35] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 ] { } ) always clobbers reg byte a -Statement [38] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] { } ) always clobbers reg byte a -Statement [41] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] { } ) always clobbers reg byte a -Statement [43] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 [ plexSort::m#2 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 ] { } ) always clobbers reg byte a -Statement [46] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [47] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [48] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [51] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 [ plexSort::plexFreePrepare1_s#2 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::plexFreePrepare1_s#2 ] { } ) always clobbers reg byte a -Statement [54] (volatile byte) plex_free_next ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [56] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [59] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::sx#2 init::xp#2 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 ] { } ) always clobbers reg byte a -Statement [60] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1 [ init::sx#2 init::xp#2 init::$3 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 init::$3 ] { } ) always clobbers reg byte a -Statement [61] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (word) init::xp#2 [ init::sx#2 init::xp#2 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 ] { } ) always clobbers reg byte a -Statement [62] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 [ init::sx#2 init::xp#1 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#1 ] { } ) always clobbers reg byte a -Statement [65] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [67] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN [ init::ss#2 ] ( main:7::init:10 [ framedone init::ss#2 ] { } ) always clobbers reg byte a -Statement [71] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [72] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [73] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [74] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [84] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a -Statement [87] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte y -Statement [89] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] { } ) always clobbers reg byte a -Statement [91] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ plex_show_idx plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_show_idx plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte a -Statement [92] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 [ plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte a -Statement [93] (volatile bool) framedone ← true [ ] ( [ ] { } ) always clobbers reg byte a -Statement [94] *((const nomodify byte*) BORDERCOL) ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a -Statement [97] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a -Statement [98] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte x reg byte y -Statement [99] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte y +Statement [33] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 ] { } ) always clobbers reg byte a +Statement [36] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] { } ) always clobbers reg byte a +Statement [39] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] { } ) always clobbers reg byte a +Statement [41] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 [ plexSort::m#2 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 ] { } ) always clobbers reg byte a +Statement [44] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a +Statement [45] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a +Statement [46] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a +Statement [49] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 [ plexSort::plexFreePrepare1_s#2 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::plexFreePrepare1_s#2 ] { } ) always clobbers reg byte a +Statement [52] (volatile byte) plex_free_next ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a +Statement [54] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [57] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::sx#2 init::xp#2 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 ] { } ) always clobbers reg byte a +Statement [58] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1 [ init::sx#2 init::xp#2 init::$3 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 init::$3 ] { } ) always clobbers reg byte a +Statement [59] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (word) init::xp#2 [ init::sx#2 init::xp#2 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 ] { } ) always clobbers reg byte a +Statement [60] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 [ init::sx#2 init::xp#1 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#1 ] { } ) always clobbers reg byte a +Statement [63] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [65] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN [ init::ss#2 ] ( main:7::init:10 [ framedone init::ss#2 ] { } ) always clobbers reg byte a +Statement [69] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [70] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [71] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [72] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [73] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [74] *((const nomodify byte*) RASTER) ← (byte) 0 [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [85] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [88] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte y +Statement [90] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] { } ) always clobbers reg byte a +Statement [92] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ plex_show_idx plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_show_idx plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte a +Statement [93] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 [ plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte a +Statement [94] *((const nomodify byte*) RASTER) ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [95] (volatile bool) framedone ← true [ ] ( [ ] { } ) always clobbers reg byte a +Statement [96] *((const nomodify byte*) BORDERCOL) ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [100] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a +Statement [101] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte x reg byte y +Statement [102] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte y Removing always clobbered register reg byte y as potential for zp[1]:25 [ plexShowSprite::plexFreeAdd1_ypos#0 ] -Statement [101] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte y -Statement [105] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a reg byte x reg byte y -Statement [106] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] { } ) always clobbers reg byte y -Statement [107] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] { } ) always clobbers reg byte a -Statement [108] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] { } ) always clobbers reg byte a -Statement [109] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] { } ) always clobbers reg byte y -Statement [110] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] { } ) always clobbers reg byte a -Statement [112] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] { } ) always clobbers reg byte a -Statement [113] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a -Statement [119] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a -Statement [120] (volatile byte) plex_sprite_msb ← (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a -Statement [122] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [104] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte y +Statement [108] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a reg byte x reg byte y +Statement [109] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] { } ) always clobbers reg byte y +Statement [110] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] { } ) always clobbers reg byte a +Statement [111] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] { } ) always clobbers reg byte a +Statement [112] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] { } ) always clobbers reg byte y +Statement [113] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] { } ) always clobbers reg byte a +Statement [115] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] { } ) always clobbers reg byte a +Statement [116] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [122] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [123] (volatile byte) plex_sprite_msb ← (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [125] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a Statement [1] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a Statement [2] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a Statement [3] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( [ ] { } ) always clobbers reg byte a @@ -2374,50 +2393,51 @@ Statement [20] *((const byte*) PLEX_YPOS + (byte) loop::sy#2) ← *((const byte* Statement [21] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte) 8 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ( main:7::loop:12 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] { } ) always clobbers reg byte a Statement [27] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) GREEN [ loop::sin_idx#1 ] ( main:7::loop:12 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a Statement [28] (volatile bool) framedone ← false [ framedone loop::sin_idx#1 ] ( main:7::loop:12 [ framedone loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [29] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f [ framedone loop::sin_idx#1 ] ( main:7::loop:12 [ framedone loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [30] *((const nomodify byte*) RASTER) ← (byte) 0 [ framedone loop::sin_idx#1 ] ( main:7::loop:12 [ framedone loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [35] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 ] { } ) always clobbers reg byte a -Statement [38] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] { } ) always clobbers reg byte a -Statement [41] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] { } ) always clobbers reg byte a -Statement [43] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 [ plexSort::m#2 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 ] { } ) always clobbers reg byte a -Statement [46] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [47] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [48] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [51] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 [ plexSort::plexFreePrepare1_s#2 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::plexFreePrepare1_s#2 ] { } ) always clobbers reg byte a -Statement [54] (volatile byte) plex_free_next ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a -Statement [56] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [59] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::sx#2 init::xp#2 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 ] { } ) always clobbers reg byte a -Statement [60] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1 [ init::sx#2 init::xp#2 init::$3 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 init::$3 ] { } ) always clobbers reg byte a -Statement [61] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (word) init::xp#2 [ init::sx#2 init::xp#2 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 ] { } ) always clobbers reg byte a -Statement [62] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 [ init::sx#2 init::xp#1 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#1 ] { } ) always clobbers reg byte a -Statement [65] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [67] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN [ init::ss#2 ] ( main:7::init:10 [ framedone init::ss#2 ] { } ) always clobbers reg byte a -Statement [71] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [72] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [73] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [74] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a -Statement [84] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a -Statement [87] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte y -Statement [89] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] { } ) always clobbers reg byte a -Statement [91] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ plex_show_idx plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_show_idx plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte a -Statement [92] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 [ plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte a -Statement [93] (volatile bool) framedone ← true [ ] ( [ ] { } ) always clobbers reg byte a -Statement [94] *((const nomodify byte*) BORDERCOL) ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a -Statement [97] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a -Statement [98] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte x reg byte y -Statement [99] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte y -Statement [101] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte y -Statement [105] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a reg byte x reg byte y -Statement [106] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] { } ) always clobbers reg byte y -Statement [107] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] { } ) always clobbers reg byte a -Statement [108] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] { } ) always clobbers reg byte a -Statement [109] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] { } ) always clobbers reg byte y -Statement [110] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] { } ) always clobbers reg byte a -Statement [112] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] { } ) always clobbers reg byte a -Statement [113] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a -Statement [119] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a -Statement [120] (volatile byte) plex_sprite_msb ← (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a -Statement [122] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:86 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [33] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 ] { } ) always clobbers reg byte a +Statement [36] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#3 ] { } ) always clobbers reg byte a +Statement [39] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 [ plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 plexSort::nxt_idx#0 plexSort::nxt_y#0 plexSort::s#1 ] { } ) always clobbers reg byte a +Statement [41] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 [ plexSort::m#2 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::m#2 ] { } ) always clobbers reg byte a +Statement [44] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a +Statement [45] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a +Statement [46] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a +Statement [49] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 [ plexSort::plexFreePrepare1_s#2 ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 plexSort::plexFreePrepare1_s#2 ] { } ) always clobbers reg byte a +Statement [52] (volatile byte) plex_free_next ← (byte) 0 [ ] ( main:7::loop:12::plexSort:26 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a +Statement [54] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [57] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::sx#2 init::xp#2 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 ] { } ) always clobbers reg byte a +Statement [58] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1 [ init::sx#2 init::xp#2 init::$3 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 init::$3 ] { } ) always clobbers reg byte a +Statement [59] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (word) init::xp#2 [ init::sx#2 init::xp#2 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#2 ] { } ) always clobbers reg byte a +Statement [60] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 [ init::sx#2 init::xp#1 ] ( main:7::init:10 [ framedone init::sx#2 init::xp#1 ] { } ) always clobbers reg byte a +Statement [63] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [65] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN [ init::ss#2 ] ( main:7::init:10 [ framedone init::ss#2 ] { } ) always clobbers reg byte a +Statement [69] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [70] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [71] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [72] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [73] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [74] *((const nomodify byte*) RASTER) ← (byte) 0 [ ] ( main:7::init:10 [ framedone ] { } ) always clobbers reg byte a +Statement [85] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [88] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte y +Statement [90] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] ( [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plex_irq::plexFreeNextYpos1_return#0 plex_irq::$4 ] { } ) always clobbers reg byte a +Statement [92] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ plex_show_idx plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_show_idx plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte a +Statement [93] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 [ plex_irq::plexFreeNextYpos1_return#0 ] ( [ plex_irq::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte a +Statement [94] *((const nomodify byte*) RASTER) ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [95] (volatile bool) framedone ← true [ ] ( [ ] { } ) always clobbers reg byte a +Statement [96] *((const nomodify byte*) BORDERCOL) ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [100] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a +Statement [101] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte x reg byte y +Statement [102] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte y +Statement [104] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte y +Statement [108] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a reg byte x reg byte y +Statement [109] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::xpos_idx#0 ] { } ) always clobbers reg byte y +Statement [110] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 ] { } ) always clobbers reg byte a +Statement [111] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::$11 plexShowSprite::$2 ] { } ) always clobbers reg byte a +Statement [112] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$11 ] { } ) always clobbers reg byte y +Statement [113] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$3 ] { } ) always clobbers reg byte a +Statement [115] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::$9 ] { } ) always clobbers reg byte a +Statement [116] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [122] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [123] (volatile byte) plex_sprite_msb ← (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a +Statement [125] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] ( plexShowSprite:87 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next ] { } ) always clobbers reg byte a Potential registers zp[1]:2 [ loop::sin_idx#6 loop::sin_idx#1 ] : zp[1]:2 , reg byte x , reg byte y , Potential registers zp[1]:3 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] : zp[1]:3 , reg byte x , reg byte y , Potential registers zp[1]:4 [ loop::sy#2 loop::sy#1 ] : zp[1]:4 , reg byte x , reg byte y , @@ -2454,70 +2474,70 @@ Potential registers zp[1]:35 [ plexShowSprite::$6 ] : zp[1]:35 , reg byte a , re REGISTER UPLIFT SCOPES Uplift Scope [plexSort] 36,166,672.83: zp[1]:6 [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] 3,000,003: zp[1]:7 [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] 2,000,002: zp[1]:20 [ plexSort::s#2 ] 1,916,668.58: zp[1]:5 [ plexSort::m#2 plexSort::m#1 ] 1,500,000.38: zp[1]:19 [ plexSort::nxt_y#0 ] 300,000.3: zp[1]:18 [ plexSort::nxt_idx#0 ] -Uplift Scope [loop] 25,002.5: zp[1]:4 [ loop::sy#2 loop::sy#1 ] 24,171.33: zp[1]:3 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] 619.67: zp[1]:2 [ loop::sin_idx#6 loop::sin_idx#1 ] +Uplift Scope [loop] 25,002.5: zp[1]:4 [ loop::sy#2 loop::sy#1 ] 24,171.33: zp[1]:3 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] 734.07: zp[1]:2 [ loop::sin_idx#6 loop::sin_idx#1 ] Uplift Scope [plexInit] 35,003.5: zp[1]:12 [ plexInit::i#2 plexInit::i#1 ] Uplift Scope [init] 3,003: zp[1]:11 [ init::ss#2 init::ss#1 ] 2,302.3: zp[1]:8 [ init::sx#2 init::sx#1 ] 2,002: zp[1]:21 [ init::$3 ] 1,418.08: zp[2]:9 [ init::xp#2 init::xp#1 ] -Uplift Scope [] 1,000.55: zp[1]:17 [ framedone ] 335.71: zp[1]:14 [ plex_sprite_idx ] 332.81: zp[1]:16 [ plex_free_next ] 321.48: zp[1]:15 [ plex_sprite_msb ] 309.44: zp[1]:13 [ plex_show_idx ] +Uplift Scope [] 1,222.89: zp[1]:17 [ framedone ] 325.22: zp[1]:14 [ plex_sprite_idx ] 322.41: zp[1]:16 [ plex_free_next ] 312.03: zp[1]:15 [ plex_sprite_msb ] 300.6: zp[1]:13 [ plex_show_idx ] Uplift Scope [plexShowSprite] 202: zp[1]:26 [ plexShowSprite::plexFreeAdd1_$0 ] 202: zp[1]:27 [ plexShowSprite::plexFreeAdd1_$1 ] 202: zp[1]:28 [ plexShowSprite::plexFreeAdd1_$2 ] 202: zp[1]:29 [ plexShowSprite::xpos_idx#0 ] 202: zp[1]:31 [ plexShowSprite::$2 ] 202: zp[1]:32 [ plexShowSprite::$3 ] 202: zp[1]:33 [ plexShowSprite::$9 ] 202: zp[1]:34 [ plexShowSprite::$5 ] 202: zp[1]:35 [ plexShowSprite::$6 ] 151.5: zp[1]:25 [ plexShowSprite::plexFreeAdd1_ypos#0 ] 101: zp[1]:30 [ plexShowSprite::$11 ] 25.25: zp[1]:24 [ plexShowSprite::plex_sprite_idx2#0 ] Uplift Scope [plex_irq] 11: zp[1]:23 [ plex_irq::$4 ] 4: zp[1]:22 [ plex_irq::plexFreeNextYpos1_return#0 ] Uplift Scope [main] -Uplifting [plexSort] best 60379 combination reg byte x [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] reg byte x [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] zp[1]:20 [ plexSort::s#2 ] zp[1]:5 [ plexSort::m#2 plexSort::m#1 ] zp[1]:19 [ plexSort::nxt_y#0 ] zp[1]:18 [ plexSort::nxt_idx#0 ] +Uplifting [plexSort] best 60245 combination reg byte x [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] reg byte x [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] zp[1]:20 [ plexSort::s#2 ] zp[1]:5 [ plexSort::m#2 plexSort::m#1 ] zp[1]:19 [ plexSort::nxt_y#0 ] zp[1]:18 [ plexSort::nxt_idx#0 ] Limited combination testing to 10 combinations of 972 possible. -Uplifting [loop] best 58449 combination reg byte y [ loop::sy#2 loop::sy#1 ] reg byte x [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] zp[1]:2 [ loop::sin_idx#6 loop::sin_idx#1 ] +Uplifting [loop] best 58315 combination reg byte y [ loop::sy#2 loop::sy#1 ] reg byte x [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] zp[1]:2 [ loop::sin_idx#6 loop::sin_idx#1 ] Limited combination testing to 10 combinations of 27 possible. -Uplifting [plexInit] best 58329 combination reg byte x [ plexInit::i#2 plexInit::i#1 ] -Uplifting [init] best 58079 combination reg byte x [ init::ss#2 init::ss#1 ] reg byte x [ init::sx#2 init::sx#1 ] zp[1]:21 [ init::$3 ] zp[2]:9 [ init::xp#2 init::xp#1 ] +Uplifting [plexInit] best 58195 combination reg byte x [ plexInit::i#2 plexInit::i#1 ] +Uplifting [init] best 57945 combination reg byte x [ init::ss#2 init::ss#1 ] reg byte x [ init::sx#2 init::sx#1 ] zp[1]:21 [ init::$3 ] zp[2]:9 [ init::xp#2 init::xp#1 ] Limited combination testing to 10 combinations of 36 possible. -Uplifting [] best 58079 combination zp[1]:17 [ framedone ] zp[1]:14 [ plex_sprite_idx ] zp[1]:16 [ plex_free_next ] zp[1]:15 [ plex_sprite_msb ] zp[1]:13 [ plex_show_idx ] -Uplifting [plexShowSprite] best 58069 combination reg byte a [ plexShowSprite::plexFreeAdd1_$0 ] reg byte x [ plexShowSprite::plexFreeAdd1_$1 ] zp[1]:28 [ plexShowSprite::plexFreeAdd1_$2 ] zp[1]:29 [ plexShowSprite::xpos_idx#0 ] zp[1]:31 [ plexShowSprite::$2 ] zp[1]:32 [ plexShowSprite::$3 ] zp[1]:33 [ plexShowSprite::$9 ] zp[1]:34 [ plexShowSprite::$5 ] zp[1]:35 [ plexShowSprite::$6 ] zp[1]:25 [ plexShowSprite::plexFreeAdd1_ypos#0 ] zp[1]:30 [ plexShowSprite::$11 ] zp[1]:24 [ plexShowSprite::plex_sprite_idx2#0 ] +Uplifting [] best 57945 combination zp[1]:17 [ framedone ] zp[1]:14 [ plex_sprite_idx ] zp[1]:16 [ plex_free_next ] zp[1]:15 [ plex_sprite_msb ] zp[1]:13 [ plex_show_idx ] +Uplifting [plexShowSprite] best 57935 combination reg byte a [ plexShowSprite::plexFreeAdd1_$0 ] reg byte x [ plexShowSprite::plexFreeAdd1_$1 ] zp[1]:28 [ plexShowSprite::plexFreeAdd1_$2 ] zp[1]:29 [ plexShowSprite::xpos_idx#0 ] zp[1]:31 [ plexShowSprite::$2 ] zp[1]:32 [ plexShowSprite::$3 ] zp[1]:33 [ plexShowSprite::$9 ] zp[1]:34 [ plexShowSprite::$5 ] zp[1]:35 [ plexShowSprite::$6 ] zp[1]:25 [ plexShowSprite::plexFreeAdd1_ypos#0 ] zp[1]:30 [ plexShowSprite::$11 ] zp[1]:24 [ plexShowSprite::plex_sprite_idx2#0 ] Limited combination testing to 10 combinations of 1572864 possible. -Uplifting [plex_irq] best 58006 combination zp[1]:23 [ plex_irq::$4 ] reg byte x [ plex_irq::plexFreeNextYpos1_return#0 ] -Uplifting [main] best 58006 combination +Uplifting [plex_irq] best 57872 combination zp[1]:23 [ plex_irq::$4 ] reg byte x [ plex_irq::plexFreeNextYpos1_return#0 ] +Uplifting [main] best 57872 combination Attempting to uplift remaining variables inzp[1]:20 [ plexSort::s#2 ] -Uplifting [plexSort] best 57406 combination reg byte x [ plexSort::s#2 ] +Uplifting [plexSort] best 57272 combination reg byte x [ plexSort::s#2 ] Attempting to uplift remaining variables inzp[1]:5 [ plexSort::m#2 plexSort::m#1 ] -Uplifting [plexSort] best 57406 combination zp[1]:5 [ plexSort::m#2 plexSort::m#1 ] +Uplifting [plexSort] best 57272 combination zp[1]:5 [ plexSort::m#2 plexSort::m#1 ] Attempting to uplift remaining variables inzp[1]:19 [ plexSort::nxt_y#0 ] -Uplifting [plexSort] best 57406 combination zp[1]:19 [ plexSort::nxt_y#0 ] +Uplifting [plexSort] best 57272 combination zp[1]:19 [ plexSort::nxt_y#0 ] Attempting to uplift remaining variables inzp[1]:18 [ plexSort::nxt_idx#0 ] -Uplifting [plexSort] best 57406 combination zp[1]:18 [ plexSort::nxt_idx#0 ] +Uplifting [plexSort] best 57272 combination zp[1]:18 [ plexSort::nxt_idx#0 ] Attempting to uplift remaining variables inzp[1]:21 [ init::$3 ] -Uplifting [init] best 57366 combination reg byte a [ init::$3 ] +Uplifting [init] best 57232 combination reg byte a [ init::$3 ] Attempting to uplift remaining variables inzp[1]:17 [ framedone ] -Uplifting [] best 57366 combination zp[1]:17 [ framedone ] +Uplifting [] best 57232 combination zp[1]:17 [ framedone ] Attempting to uplift remaining variables inzp[1]:2 [ loop::sin_idx#6 loop::sin_idx#1 ] -Uplifting [loop] best 57366 combination zp[1]:2 [ loop::sin_idx#6 loop::sin_idx#1 ] +Uplifting [loop] best 57232 combination zp[1]:2 [ loop::sin_idx#6 loop::sin_idx#1 ] Attempting to uplift remaining variables inzp[1]:14 [ plex_sprite_idx ] -Uplifting [] best 57366 combination zp[1]:14 [ plex_sprite_idx ] +Uplifting [] best 57232 combination zp[1]:14 [ plex_sprite_idx ] Attempting to uplift remaining variables inzp[1]:16 [ plex_free_next ] -Uplifting [] best 57366 combination zp[1]:16 [ plex_free_next ] +Uplifting [] best 57232 combination zp[1]:16 [ plex_free_next ] Attempting to uplift remaining variables inzp[1]:15 [ plex_sprite_msb ] -Uplifting [] best 57366 combination zp[1]:15 [ plex_sprite_msb ] +Uplifting [] best 57232 combination zp[1]:15 [ plex_sprite_msb ] Attempting to uplift remaining variables inzp[1]:13 [ plex_show_idx ] -Uplifting [] best 57366 combination zp[1]:13 [ plex_show_idx ] +Uplifting [] best 57232 combination zp[1]:13 [ plex_show_idx ] Attempting to uplift remaining variables inzp[1]:28 [ plexShowSprite::plexFreeAdd1_$2 ] -Uplifting [plexShowSprite] best 57362 combination reg byte a [ plexShowSprite::plexFreeAdd1_$2 ] +Uplifting [plexShowSprite] best 57228 combination reg byte a [ plexShowSprite::plexFreeAdd1_$2 ] Attempting to uplift remaining variables inzp[1]:29 [ plexShowSprite::xpos_idx#0 ] -Uplifting [plexShowSprite] best 57356 combination reg byte a [ plexShowSprite::xpos_idx#0 ] +Uplifting [plexShowSprite] best 57222 combination reg byte a [ plexShowSprite::xpos_idx#0 ] Attempting to uplift remaining variables inzp[1]:31 [ plexShowSprite::$2 ] -Uplifting [plexShowSprite] best 57350 combination reg byte a [ plexShowSprite::$2 ] +Uplifting [plexShowSprite] best 57216 combination reg byte a [ plexShowSprite::$2 ] Attempting to uplift remaining variables inzp[1]:32 [ plexShowSprite::$3 ] -Uplifting [plexShowSprite] best 57344 combination reg byte a [ plexShowSprite::$3 ] +Uplifting [plexShowSprite] best 57210 combination reg byte a [ plexShowSprite::$3 ] Attempting to uplift remaining variables inzp[1]:33 [ plexShowSprite::$9 ] -Uplifting [plexShowSprite] best 57338 combination reg byte a [ plexShowSprite::$9 ] +Uplifting [plexShowSprite] best 57204 combination reg byte a [ plexShowSprite::$9 ] Attempting to uplift remaining variables inzp[1]:34 [ plexShowSprite::$5 ] -Uplifting [plexShowSprite] best 57332 combination reg byte x [ plexShowSprite::$5 ] +Uplifting [plexShowSprite] best 57198 combination reg byte x [ plexShowSprite::$5 ] Attempting to uplift remaining variables inzp[1]:35 [ plexShowSprite::$6 ] -Uplifting [plexShowSprite] best 57328 combination reg byte a [ plexShowSprite::$6 ] +Uplifting [plexShowSprite] best 57194 combination reg byte a [ plexShowSprite::$6 ] Attempting to uplift remaining variables inzp[1]:25 [ plexShowSprite::plexFreeAdd1_ypos#0 ] -Uplifting [plexShowSprite] best 57319 combination reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ] +Uplifting [plexShowSprite] best 57185 combination reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ] Attempting to uplift remaining variables inzp[1]:30 [ plexShowSprite::$11 ] -Uplifting [plexShowSprite] best 57312 combination reg byte x [ plexShowSprite::$11 ] +Uplifting [plexShowSprite] best 57178 combination reg byte x [ plexShowSprite::$11 ] Attempting to uplift remaining variables inzp[1]:24 [ plexShowSprite::plex_sprite_idx2#0 ] -Uplifting [plexShowSprite] best 57312 combination zp[1]:24 [ plexShowSprite::plex_sprite_idx2#0 ] +Uplifting [plexShowSprite] best 57178 combination zp[1]:24 [ plexShowSprite::plex_sprite_idx2#0 ] Attempting to uplift remaining variables inzp[1]:23 [ plex_irq::$4 ] -Uplifting [plex_irq] best 57312 combination zp[1]:23 [ plex_irq::$4 ] +Uplifting [plex_irq] best 57178 combination zp[1]:23 [ plex_irq::$4 ] Allocated (was zp[1]:5) zp[1]:3 [ plexSort::m#2 plexSort::m#1 ] Allocated (was zp[2]:9) zp[2]:4 [ init::xp#2 init::xp#1 ] Allocated (was zp[1]:13) zp[1]:6 [ plex_show_idx ] @@ -2696,7 +2716,7 @@ loop: { // [25] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1 inc BORDERCOL // [26] call plexSort - // [31] phi from loop::@5 to plexSort [phi:loop::@5->plexSort] + // [29] phi from loop::@5 to plexSort [phi:loop::@5->plexSort] plexSort_from___b5: jsr plexSort jmp __b6 @@ -2708,13 +2728,6 @@ loop: { // [28] (volatile bool) framedone ← false -- vboz1=vboc1 lda #0 sta.z framedone - // [29] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 - lda #$7f - and VIC_CONTROL - sta VIC_CONTROL - // [30] *((const nomodify byte*) RASTER) ← (byte) 0 -- _deref_pbuc1=vbuc2 - lda #0 - sta RASTER // [15] phi from loop::@6 to loop::@1 [phi:loop::@6->loop::@1] __b1_from___b6: // [15] phi (byte) loop::sin_idx#6 = (byte) loop::sin_idx#1 [phi:loop::@6->loop::@1#0] -- register_copy @@ -2734,27 +2747,27 @@ plexSort: { .label nxt_idx = $b .label nxt_y = $c .label m = 3 - // [32] phi from plexSort to plexSort::@1 [phi:plexSort->plexSort::@1] + // [30] phi from plexSort to plexSort::@1 [phi:plexSort->plexSort::@1] __b1_from_plexSort: - // [32] phi (byte) plexSort::m#2 = (byte) 0 [phi:plexSort->plexSort::@1#0] -- vbuz1=vbuc1 + // [30] phi (byte) plexSort::m#2 = (byte) 0 [phi:plexSort->plexSort::@1#0] -- vbuz1=vbuc1 lda #0 sta.z m jmp __b1 - // [32] phi from plexSort::@2 to plexSort::@1 [phi:plexSort::@2->plexSort::@1] + // [30] phi from plexSort::@2 to plexSort::@1 [phi:plexSort::@2->plexSort::@1] __b1_from___b2: - // [32] phi (byte) plexSort::m#2 = (byte) plexSort::m#1 [phi:plexSort::@2->plexSort::@1#0] -- register_copy + // [30] phi (byte) plexSort::m#2 = (byte) plexSort::m#1 [phi:plexSort::@2->plexSort::@1#0] -- register_copy jmp __b1 // plexSort::@1 __b1: - // [33] (byte) plexSort::nxt_idx#0 ← *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2) -- vbuz1=pbuc1_derefidx_vbuz2 + // [31] (byte) plexSort::nxt_idx#0 ← *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2) -- vbuz1=pbuc1_derefidx_vbuz2 ldy.z m lda PLEX_SORTED_IDX+1,y sta.z nxt_idx - // [34] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0) -- vbuz1=pbuc1_derefidx_vbuz2 + // [32] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0) -- vbuz1=pbuc1_derefidx_vbuz2 ldy.z nxt_idx lda PLEX_YPOS,y sta.z nxt_y - // [35] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 -- vbuz1_ge_pbuc1_derefidx_(pbuc2_derefidx_vbuz2)_then_la1 + // [33] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 -- vbuz1_ge_pbuc1_derefidx_(pbuc2_derefidx_vbuz2)_then_la1 lda.z nxt_y ldx.z m ldy PLEX_SORTED_IDX,x @@ -2763,27 +2776,27 @@ plexSort: { jmp __b5 // plexSort::@5 __b5: - // [36] (byte) plexSort::s#6 ← (byte) plexSort::m#2 -- vbuxx=vbuz1 + // [34] (byte) plexSort::s#6 ← (byte) plexSort::m#2 -- vbuxx=vbuz1 ldx.z m - // [37] phi from plexSort::@5 plexSort::@7 to plexSort::@3 [phi:plexSort::@5/plexSort::@7->plexSort::@3] + // [35] phi from plexSort::@5 plexSort::@7 to plexSort::@3 [phi:plexSort::@5/plexSort::@7->plexSort::@3] __b3_from___b5: __b3_from___b7: - // [37] phi (byte) plexSort::s#3 = (byte) plexSort::s#6 [phi:plexSort::@5/plexSort::@7->plexSort::@3#0] -- register_copy + // [35] phi (byte) plexSort::s#3 = (byte) plexSort::s#6 [phi:plexSort::@5/plexSort::@7->plexSort::@3#0] -- register_copy jmp __b3 // plexSort::@3 __b3: - // [38] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [36] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda PLEX_SORTED_IDX,x sta PLEX_SORTED_IDX+1,x - // [39] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 -- vbuxx=_dec_vbuxx + // [37] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 -- vbuxx=_dec_vbuxx dex - // [40] if((byte) plexSort::s#1==(byte) $ff) goto plexSort::@4 -- vbuxx_eq_vbuc1_then_la1 + // [38] if((byte) plexSort::s#1==(byte) $ff) goto plexSort::@4 -- vbuxx_eq_vbuc1_then_la1 cpx #$ff beq __b4 jmp __b7 // plexSort::@7 __b7: - // [41] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 -- vbuz1_lt_pbuc1_derefidx_(pbuc2_derefidx_vbuxx)_then_la1 + // [39] if((byte) plexSort::nxt_y#0<*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#1))) goto plexSort::@3 -- vbuz1_lt_pbuc1_derefidx_(pbuc2_derefidx_vbuxx)_then_la1 lda.z nxt_y ldy PLEX_SORTED_IDX,x cmp PLEX_YPOS,y @@ -2791,67 +2804,67 @@ plexSort: { jmp __b4 // plexSort::@4 __b4: - // [42] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 -- vbuxx=_inc_vbuxx + // [40] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 -- vbuxx=_inc_vbuxx inx - // [43] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 -- pbuc1_derefidx_vbuxx=vbuz1 + // [41] *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 -- pbuc1_derefidx_vbuxx=vbuz1 lda.z nxt_idx sta PLEX_SORTED_IDX,x jmp __b2 // plexSort::@2 __b2: - // [44] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 -- vbuz1=_inc_vbuz1 + // [42] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 -- vbuz1=_inc_vbuz1 inc.z m - // [45] if((byte) plexSort::m#1!=(const nomodify byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1 -- vbuz1_neq_vbuc1_then_la1 + // [43] if((byte) plexSort::m#1!=(const nomodify byte) PLEX_COUNT-(byte) 2+(byte) 1) goto plexSort::@1 -- vbuz1_neq_vbuc1_then_la1 lda #PLEX_COUNT-2+1 cmp.z m bne __b1_from___b2 jmp __b6 // plexSort::@6 __b6: - // [46] (volatile byte) plex_show_idx ← (byte) 0 -- vbuz1=vbuc1 + // [44] (volatile byte) plex_show_idx ← (byte) 0 -- vbuz1=vbuc1 // Prepare for showing the sprites lda #0 sta.z plex_show_idx - // [47] (volatile byte) plex_sprite_idx ← (byte) 0 -- vbuz1=vbuc1 + // [45] (volatile byte) plex_sprite_idx ← (byte) 0 -- vbuz1=vbuc1 lda #0 sta.z plex_sprite_idx - // [48] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 + // [46] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 lda #1 sta.z plex_sprite_msb - // [49] phi from plexSort::@6 to plexSort::plexFreePrepare1 [phi:plexSort::@6->plexSort::plexFreePrepare1] + // [47] phi from plexSort::@6 to plexSort::plexFreePrepare1 [phi:plexSort::@6->plexSort::plexFreePrepare1] plexFreePrepare1_from___b6: jmp plexFreePrepare1 // plexSort::plexFreePrepare1 plexFreePrepare1: - // [50] phi from plexSort::plexFreePrepare1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1] + // [48] phi from plexSort::plexFreePrepare1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1] plexFreePrepare1___b1_from_plexFreePrepare1: - // [50] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) 0 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1#0] -- vbuxx=vbuc1 + // [48] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) 0 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1#0] -- vbuxx=vbuc1 ldx #0 jmp plexFreePrepare1___b1 - // [50] phi from plexSort::plexFreePrepare1_@1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1] + // [48] phi from plexSort::plexFreePrepare1_@1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1] plexFreePrepare1___b1_from_plexFreePrepare1___b1: - // [50] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) plexSort::plexFreePrepare1_s#1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1#0] -- register_copy + // [48] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) plexSort::plexFreePrepare1_s#1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1#0] -- register_copy jmp plexFreePrepare1___b1 // plexSort::plexFreePrepare1_@1 plexFreePrepare1___b1: - // [51] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 -- pbuc1_derefidx_vbuxx=vbuc2 + // [49] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 -- pbuc1_derefidx_vbuxx=vbuc2 lda #0 sta PLEX_FREE_YPOS,x - // [52] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 -- vbuxx=_inc_vbuxx + // [50] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 -- vbuxx=_inc_vbuxx inx - // [53] if((byte) plexSort::plexFreePrepare1_s#1!=(byte) 8) goto plexSort::plexFreePrepare1_@1 -- vbuxx_neq_vbuc1_then_la1 + // [51] if((byte) plexSort::plexFreePrepare1_s#1!=(byte) 8) goto plexSort::plexFreePrepare1_@1 -- vbuxx_neq_vbuc1_then_la1 cpx #8 bne plexFreePrepare1___b1_from_plexFreePrepare1___b1 jmp plexFreePrepare1___b2 // plexSort::plexFreePrepare1_@2 plexFreePrepare1___b2: - // [54] (volatile byte) plex_free_next ← (byte) 0 -- vbuz1=vbuc1 + // [52] (volatile byte) plex_free_next ← (byte) 0 -- vbuz1=vbuc1 lda #0 sta.z plex_free_next jmp __breturn // plexSort::@return __breturn: - // [55] return + // [53] return rts } // init @@ -2859,44 +2872,44 @@ plexSort: { init: { // Set the x-positions & pointers .label xp = 4 - // [56] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 -- _deref_pbuc1=vbuc2 + // [54] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 -- _deref_pbuc1=vbuc2 lda #VIC_DEN|VIC_RSEL|3 sta D011 - // [57] call plexInit + // [55] call plexInit // Initialize the multiplexer // [77] phi from init to plexInit [phi:init->plexInit] plexInit_from_init: jsr plexInit - // [58] phi from init to init::@1 [phi:init->init::@1] + // [56] phi from init to init::@1 [phi:init->init::@1] __b1_from_init: - // [58] phi (word) init::xp#2 = (word) $20 [phi:init->init::@1#0] -- vwuz1=vwuc1 + // [56] phi (word) init::xp#2 = (word) $20 [phi:init->init::@1#0] -- vwuz1=vwuc1 lda #<$20 sta.z xp lda #>$20 sta.z xp+1 - // [58] phi (byte) init::sx#2 = (byte) 0 [phi:init->init::@1#1] -- vbuxx=vbuc1 + // [56] phi (byte) init::sx#2 = (byte) 0 [phi:init->init::@1#1] -- vbuxx=vbuc1 ldx #0 jmp __b1 - // [58] phi from init::@1 to init::@1 [phi:init::@1->init::@1] + // [56] phi from init::@1 to init::@1 [phi:init::@1->init::@1] __b1_from___b1: - // [58] phi (word) init::xp#2 = (word) init::xp#1 [phi:init::@1->init::@1#0] -- register_copy - // [58] phi (byte) init::sx#2 = (byte) init::sx#1 [phi:init::@1->init::@1#1] -- register_copy + // [56] phi (word) init::xp#2 = (word) init::xp#1 [phi:init::@1->init::@1#0] -- register_copy + // [56] phi (byte) init::sx#2 = (byte) init::sx#1 [phi:init::@1->init::@1#1] -- register_copy jmp __b1 // init::@1 __b1: - // [59] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 + // [57] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 lda #$ff&SPRITE/$40 sta PLEX_PTR,x - // [60] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1 -- vbuaa=vbuxx_rol_1 + // [58] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1 -- vbuaa=vbuxx_rol_1 txa asl - // [61] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (word) init::xp#2 -- pwuc1_derefidx_vbuaa=vwuz1 + // [59] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (word) init::xp#2 -- pwuc1_derefidx_vbuaa=vwuz1 tay lda.z xp sta PLEX_XPOS,y lda.z xp+1 sta PLEX_XPOS+1,y - // [62] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 -- vwuz1=vwuz1_plus_vbuc1 + // [60] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 -- vwuz1=vwuz1_plus_vbuc1 lda #9 clc adc.z xp @@ -2904,35 +2917,35 @@ init: { bcc !+ inc.z xp+1 !: - // [63] (byte) init::sx#1 ← ++ (byte) init::sx#2 -- vbuxx=_inc_vbuxx + // [61] (byte) init::sx#1 ← ++ (byte) init::sx#2 -- vbuxx=_inc_vbuxx inx - // [64] if((byte) init::sx#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto init::@1 -- vbuxx_neq_vbuc1_then_la1 + // [62] if((byte) init::sx#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto init::@1 -- vbuxx_neq_vbuc1_then_la1 cpx #PLEX_COUNT-1+1 bne __b1_from___b1 jmp __b2 // init::@2 __b2: - // [65] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2 + // [63] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2 // Enable & initialize sprites lda #$ff sta SPRITES_ENABLE - // [66] phi from init::@2 to init::@3 [phi:init::@2->init::@3] + // [64] phi from init::@2 to init::@3 [phi:init::@2->init::@3] __b3_from___b2: - // [66] phi (byte) init::ss#2 = (byte) 0 [phi:init::@2->init::@3#0] -- vbuxx=vbuc1 + // [64] phi (byte) init::ss#2 = (byte) 0 [phi:init::@2->init::@3#0] -- vbuxx=vbuc1 ldx #0 jmp __b3 - // [66] phi from init::@3 to init::@3 [phi:init::@3->init::@3] + // [64] phi from init::@3 to init::@3 [phi:init::@3->init::@3] __b3_from___b3: - // [66] phi (byte) init::ss#2 = (byte) init::ss#1 [phi:init::@3->init::@3#0] -- register_copy + // [64] phi (byte) init::ss#2 = (byte) init::ss#1 [phi:init::@3->init::@3#0] -- register_copy jmp __b3 // init::@3 __b3: - // [67] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN -- pbuc1_derefidx_vbuxx=vbuc2 + // [65] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN -- pbuc1_derefidx_vbuxx=vbuc2 lda #GREEN sta SPRITES_COLS,x - // [68] (byte) init::ss#1 ← ++ (byte) init::ss#2 -- vbuxx=_inc_vbuxx + // [66] (byte) init::ss#1 ← ++ (byte) init::ss#2 -- vbuxx=_inc_vbuxx inx - // [69] if((byte) init::ss#1!=(byte) 8) goto init::@3 -- vbuxx_neq_vbuc1_then_la1 + // [67] if((byte) init::ss#1!=(byte) 8) goto init::@3 -- vbuxx_neq_vbuc1_then_la1 cpx #8 bne __b3_from___b3 jmp __b4 @@ -2941,20 +2954,27 @@ init: { // asm { sei } // enable the interrupt sei - // [71] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 + // [69] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 lda #CIA_INTERRUPT_CLEAR sta CIA1_INTERRUPT - // [72] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // [70] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 lda #IRQ_RASTER sta IRQ_ENABLE - // [73] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // [71] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 lda #IRQ_RASTER sta IRQ_STATUS - // [74] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() -- _deref_pptc1=pprc2 + // [72] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() -- _deref_pptc1=pprc2 lda #plex_irq sta KERNEL_IRQ+1 + // [73] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + lda #$7f + and VIC_CONTROL + sta VIC_CONTROL + // [74] *((const nomodify byte*) RASTER) ← (byte) 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta RASTER // asm { cli } cli jmp __breturn @@ -3000,71 +3020,78 @@ plexInit: { plex_irq: { .label __4 = $d // entry interrupt(KERNEL_MIN) - // [84] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2 + // asm { sei } + sei + // [85] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2 lda #WHITE sta BORDERCOL - // [85] phi from plex_irq plex_irq::@7 to plex_irq::@3 [phi:plex_irq/plex_irq::@7->plex_irq::@3] + // [86] phi from plex_irq plex_irq::@7 to plex_irq::@3 [phi:plex_irq/plex_irq::@7->plex_irq::@3] __b3_from_plex_irq: __b3_from___b7: jmp __b3 // plex_irq::@3 __b3: - // [86] call plexShowSprite + // [87] call plexShowSprite jsr plexShowSprite jmp plexFreeNextYpos1 // plex_irq::plexFreeNextYpos1 plexFreeNextYpos1: - // [87] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) -- vbuxx=pbuc1_derefidx_vbuz1 + // [88] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) -- vbuxx=pbuc1_derefidx_vbuz1 ldy.z plex_free_next ldx PLEX_FREE_YPOS,y jmp __b6 // plex_irq::@6 __b6: - // [88] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 2 -- vbuz1=_deref_pbuc1_plus_2 + // [89] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 2 -- vbuz1=_deref_pbuc1_plus_2 lda RASTER clc adc #2 sta.z __4 - // [89] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 -- vbuz1_ge_vbuc1_then_la1 + // [90] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 -- vbuz1_ge_vbuc1_then_la1 lda.z plex_show_idx cmp #PLEX_COUNT bcs __b4 jmp __b7 // plex_irq::@7 __b7: - // [90] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3 -- vbuxx_lt_vbuz1_then_la1 + // [91] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3 -- vbuxx_lt_vbuz1_then_la1 cpx.z __4 bcc __b3_from___b7 jmp __b4 // plex_irq::@4 __b4: - // [91] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // [92] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 lda #IRQ_RASTER sta IRQ_STATUS - // [92] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 -- vbuz1_lt_vbuc1_then_la1 + // [93] if((volatile byte) plex_show_idx<(const nomodify byte) PLEX_COUNT) goto plex_irq::@1 -- vbuz1_lt_vbuc1_then_la1 lda.z plex_show_idx cmp #PLEX_COUNT bcc __b1 jmp __b5 // plex_irq::@5 __b5: - // [93] (volatile bool) framedone ← true -- vboz1=vboc1 + // [94] *((const nomodify byte*) RASTER) ← (byte) 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta RASTER + // [95] (volatile bool) framedone ← true -- vboz1=vboc1 lda #1 sta.z framedone jmp __b2 // plex_irq::@2 __b2: - // [94] *((const nomodify byte*) BORDERCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 + // [96] *((const nomodify byte*) BORDERCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2 lda #0 sta BORDERCOL + // asm { cli } + cli jmp __breturn // plex_irq::@return __breturn: - // [95] return - exit interrupt(KERNEL_MIN) + // [98] return - exit interrupt(KERNEL_MIN) jmp $ea81 // plex_irq::@1 __b1: - // [96] *((const nomodify byte*) RASTER) ← (byte) plex_irq::plexFreeNextYpos1_return#0 -- _deref_pbuc1=vbuxx + // [99] *((const nomodify byte*) RASTER) ← (byte) plex_irq::plexFreeNextYpos1_return#0 -- _deref_pbuc1=vbuxx stx RASTER jmp __b2 } @@ -3073,101 +3100,101 @@ plex_irq: { // plexSort() prepares showing the sprites plexShowSprite: { .label plex_sprite_idx2 = $e - // [97] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 -- vbuz1=vbuz2_rol_1 + // [100] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 -- vbuz1=vbuz2_rol_1 lda.z plex_sprite_idx asl sta.z plex_sprite_idx2 - // [98] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) -- vbuaa=pbuc1_derefidx_(pbuc2_derefidx_vbuz1) + // [101] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) -- vbuaa=pbuc1_derefidx_(pbuc2_derefidx_vbuz1) ldx.z plex_show_idx ldy PLEX_SORTED_IDX,x lda PLEX_YPOS,y - // [99] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 -- pbuc1_derefidx_vbuz1=vbuaa + // [102] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 -- pbuc1_derefidx_vbuz1=vbuaa ldy.z plex_sprite_idx2 sta SPRITES_YPOS,y jmp plexFreeAdd1 // plexShowSprite::plexFreeAdd1 plexFreeAdd1: - // [100] (byte~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte) $15 -- vbuaa=vbuaa_plus_vbuc1 + // [103] (byte~) plexShowSprite::plexFreeAdd1_$0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte) $15 -- vbuaa=vbuaa_plus_vbuc1 clc adc #$15 - // [101] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 -- pbuc1_derefidx_vbuz1=vbuaa + // [104] *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) ← (byte~) plexShowSprite::plexFreeAdd1_$0 -- pbuc1_derefidx_vbuz1=vbuaa ldy.z plex_free_next sta PLEX_FREE_YPOS,y - // [102] (byte~) plexShowSprite::plexFreeAdd1_$1 ← (volatile byte) plex_free_next + (byte) 1 -- vbuxx=vbuz1_plus_1 + // [105] (byte~) plexShowSprite::plexFreeAdd1_$1 ← (volatile byte) plex_free_next + (byte) 1 -- vbuxx=vbuz1_plus_1 ldx.z plex_free_next inx - // [103] (byte~) plexShowSprite::plexFreeAdd1_$2 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7 -- vbuaa=vbuxx_band_vbuc1 + // [106] (byte~) plexShowSprite::plexFreeAdd1_$2 ← (byte~) plexShowSprite::plexFreeAdd1_$1 & (byte) 7 -- vbuaa=vbuxx_band_vbuc1 txa and #7 - // [104] (volatile byte) plex_free_next ← (byte~) plexShowSprite::plexFreeAdd1_$2 -- vbuz1=vbuaa + // [107] (volatile byte) plex_free_next ← (byte~) plexShowSprite::plexFreeAdd1_$2 -- vbuz1=vbuaa sta.z plex_free_next jmp __b5 // plexShowSprite::@5 __b5: - // [105] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_(pbuc3_derefidx_vbuz2) + // [108] *((const byte*) PLEX_SCREEN_PTR#0 + (volatile byte) plex_sprite_idx) ← *((const byte*) PLEX_PTR + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_(pbuc3_derefidx_vbuz2) ldx.z plex_show_idx ldy PLEX_SORTED_IDX,x lda PLEX_PTR,y ldx.z plex_sprite_idx sta PLEX_SCREEN_PTR,x - // [106] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) -- vbuaa=pbuc1_derefidx_vbuz1 + // [109] (byte) plexShowSprite::xpos_idx#0 ← *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx) -- vbuaa=pbuc1_derefidx_vbuz1 ldy.z plex_show_idx lda PLEX_SORTED_IDX,y - // [107] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 -- vbuxx=vbuaa_rol_1 + // [110] (byte~) plexShowSprite::$11 ← (byte) plexShowSprite::xpos_idx#0 << (byte) 1 -- vbuxx=vbuaa_rol_1 asl tax - // [108] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) -- vbuaa=_lo_pwuc1_derefidx_vbuxx + // [111] (byte~) plexShowSprite::$2 ← < *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) -- vbuaa=_lo_pwuc1_derefidx_vbuxx lda PLEX_XPOS,x - // [109] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 -- pbuc1_derefidx_vbuz1=vbuaa + // [112] *((const nomodify byte*) SPRITES_XPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$2 -- pbuc1_derefidx_vbuz1=vbuaa ldy.z plex_sprite_idx2 sta SPRITES_XPOS,y - // [110] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) -- vbuaa=_hi_pwuc1_derefidx_vbuxx + // [113] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) -- vbuaa=_hi_pwuc1_derefidx_vbuxx lda PLEX_XPOS+1,x - // [111] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1 -- vbuaa_neq_0_then_la1 + // [114] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1 -- vbuaa_neq_0_then_la1 cmp #0 bne __b1 jmp __b3 // plexShowSprite::@3 __b3: - // [112] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb -- vbuaa=vbuc1_bxor_vbuz1 + // [115] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb -- vbuaa=vbuc1_bxor_vbuz1 lda #$ff eor.z plex_sprite_msb - // [113] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 -- _deref_pbuc1=_deref_pbuc1_band_vbuaa + // [116] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 -- _deref_pbuc1=_deref_pbuc1_band_vbuaa and SPRITES_XMSB sta SPRITES_XMSB jmp __b2 // plexShowSprite::@2 __b2: - // [114] (byte~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (byte) 1 -- vbuxx=vbuz1_plus_1 + // [117] (byte~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (byte) 1 -- vbuxx=vbuz1_plus_1 ldx.z plex_sprite_idx inx - // [115] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7 -- vbuaa=vbuxx_band_vbuc1 + // [118] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7 -- vbuaa=vbuxx_band_vbuc1 txa and #7 - // [116] (volatile byte) plex_sprite_idx ← (byte~) plexShowSprite::$6 -- vbuz1=vbuaa + // [119] (volatile byte) plex_sprite_idx ← (byte~) plexShowSprite::$6 -- vbuz1=vbuaa sta.z plex_sprite_idx - // [117] (volatile byte) plex_show_idx ← ++ (volatile byte) plex_show_idx -- vbuz1=_inc_vbuz1 + // [120] (volatile byte) plex_show_idx ← ++ (volatile byte) plex_show_idx -- vbuz1=_inc_vbuz1 inc.z plex_show_idx - // [118] (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (byte) 1 -- vbuz1=vbuz1_rol_1 + // [121] (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (byte) 1 -- vbuz1=vbuz1_rol_1 asl.z plex_sprite_msb - // [119] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return -- vbuz1_neq_0_then_la1 + // [122] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return -- vbuz1_neq_0_then_la1 lda.z plex_sprite_msb cmp #0 bne __breturn jmp __b4 // plexShowSprite::@4 __b4: - // [120] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 + // [123] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 lda #1 sta.z plex_sprite_msb jmp __breturn // plexShowSprite::@return __breturn: - // [121] return + // [124] return rts // plexShowSprite::@1 __b1: - // [122] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 + // [125] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 lda SPRITES_XMSB ora.z plex_sprite_msb sta SPRITES_XMSB @@ -3371,7 +3398,7 @@ FINAL SYMBOL TABLE (const nomodify byte) WHITE = (byte) 1 (const byte*) YSIN[(number) $100] = kickasm {{ .fill $100, round(139.5+89.5*sin(toRadians(360*i/256))) }} -(volatile bool) framedone loadstore zp[1]:10 1000.5454545454544 +(volatile bool) framedone loadstore zp[1]:10 1222.8888888888887 (void()) init() (byte~) init::$3 reg byte a 2002.0 (label) init::@1 @@ -3396,7 +3423,7 @@ FINAL SYMBOL TABLE (label) loop::@5 (label) loop::@6 (byte) loop::sin_idx -(byte) loop::sin_idx#1 sin_idx zp[1]:2 286.0 +(byte) loop::sin_idx#1 sin_idx zp[1]:2 400.4 (byte) loop::sin_idx#6 sin_idx zp[1]:2 333.6666666666667 (byte) loop::sy (byte) loop::sy#1 reg byte y 15001.5 @@ -3468,7 +3495,7 @@ FINAL SYMBOL TABLE (byte) plexSort::s#2 reg byte x 2000002.0 (byte) plexSort::s#3 reg byte x 2.05000025E7 (byte) plexSort::s#6 reg byte x 2000002.0 -(volatile byte) plex_free_next loadstore zp[1]:9 332.80645161290323 +(volatile byte) plex_free_next loadstore zp[1]:9 322.40625 interrupt(KERNEL_MIN)(void()) plex_irq() (byte~) plex_irq::$4 zp[1]:13 11.0 (label) plex_irq::@1 @@ -3483,9 +3510,9 @@ interrupt(KERNEL_MIN)(void()) plex_irq() (byte) plex_irq::plexFreeNextYpos1_return (byte) plex_irq::plexFreeNextYpos1_return#0 reg byte x 4.0 (byte) plex_irq::rasterY -(volatile byte) plex_show_idx loadstore zp[1]:6 309.44117647058835 -(volatile byte) plex_sprite_idx loadstore zp[1]:7 335.7096774193548 -(volatile byte) plex_sprite_msb loadstore zp[1]:8 321.4848484848485 +(volatile byte) plex_show_idx loadstore zp[1]:6 300.6000000000001 +(volatile byte) plex_sprite_idx loadstore zp[1]:7 325.21875 +(volatile byte) plex_sprite_msb loadstore zp[1]:8 312.029411764706 zp[1]:2 [ loop::sin_idx#6 loop::sin_idx#1 ] reg byte x [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] @@ -3523,7 +3550,7 @@ reg byte a [ plexShowSprite::$6 ] FINAL ASSEMBLER -Score: 43740 +Score: 43606 // File Comments // A simple usage of the flexible sprite multiplexer routine @@ -3679,7 +3706,7 @@ loop: { inc BORDERCOL // plexSort() // [26] call plexSort - // [31] phi from loop::@5 to plexSort [phi:loop::@5->plexSort] + // [29] phi from loop::@5 to plexSort [phi:loop::@5->plexSort] jsr plexSort // loop::@6 // *BORDERCOL = GREEN @@ -3690,15 +3717,6 @@ loop: { // [28] (volatile bool) framedone ← false -- vboz1=vboc1 lda #0 sta.z framedone - // *VIC_CONTROL &=0x7f - // [29] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 - lda #$7f - and VIC_CONTROL - sta VIC_CONTROL - // *RASTER = 0x0 - // [30] *((const nomodify byte*) RASTER) ← (byte) 0 -- _deref_pbuc1=vbuc2 - lda #0 - sta RASTER // [15] phi from loop::@6 to loop::@1 [phi:loop::@6->loop::@1] // [15] phi (byte) loop::sin_idx#6 = (byte) loop::sin_idx#1 [phi:loop::@6->loop::@1#0] -- register_copy jmp __b2 @@ -3717,49 +3735,49 @@ plexSort: { .label nxt_idx = $b .label nxt_y = $c .label m = 3 - // [32] phi from plexSort to plexSort::@1 [phi:plexSort->plexSort::@1] - // [32] phi (byte) plexSort::m#2 = (byte) 0 [phi:plexSort->plexSort::@1#0] -- vbuz1=vbuc1 + // [30] phi from plexSort to plexSort::@1 [phi:plexSort->plexSort::@1] + // [30] phi (byte) plexSort::m#2 = (byte) 0 [phi:plexSort->plexSort::@1#0] -- vbuz1=vbuc1 lda #0 sta.z m - // [32] phi from plexSort::@2 to plexSort::@1 [phi:plexSort::@2->plexSort::@1] - // [32] phi (byte) plexSort::m#2 = (byte) plexSort::m#1 [phi:plexSort::@2->plexSort::@1#0] -- register_copy + // [30] phi from plexSort::@2 to plexSort::@1 [phi:plexSort::@2->plexSort::@1] + // [30] phi (byte) plexSort::m#2 = (byte) plexSort::m#1 [phi:plexSort::@2->plexSort::@1#0] -- register_copy // plexSort::@1 __b1: // nxt_idx = PLEX_SORTED_IDX[m+1] - // [33] (byte) plexSort::nxt_idx#0 ← *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2) -- vbuz1=pbuc1_derefidx_vbuz2 + // [31] (byte) plexSort::nxt_idx#0 ← *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::m#2) -- vbuz1=pbuc1_derefidx_vbuz2 ldy.z m lda PLEX_SORTED_IDX+1,y sta.z nxt_idx // nxt_y = PLEX_YPOS[nxt_idx] - // [34] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0) -- vbuz1=pbuc1_derefidx_vbuz2 + // [32] (byte) plexSort::nxt_y#0 ← *((const byte*) PLEX_YPOS + (byte) plexSort::nxt_idx#0) -- vbuz1=pbuc1_derefidx_vbuz2 tay lda PLEX_YPOS,y sta.z nxt_y // if(nxt_y=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 -- vbuz1_ge_pbuc1_derefidx_(pbuc2_derefidx_vbuz2)_then_la1 + // [33] if((byte) plexSort::nxt_y#0>=*((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::m#2))) goto plexSort::@2 -- vbuz1_ge_pbuc1_derefidx_(pbuc2_derefidx_vbuz2)_then_la1 ldx.z m ldy PLEX_SORTED_IDX,x cmp PLEX_YPOS,y bcs __b2 // plexSort::@5 - // [36] (byte) plexSort::s#6 ← (byte) plexSort::m#2 -- vbuxx=vbuz1 - // [37] phi from plexSort::@5 plexSort::@7 to plexSort::@3 [phi:plexSort::@5/plexSort::@7->plexSort::@3] - // [37] phi (byte) plexSort::s#3 = (byte) plexSort::s#6 [phi:plexSort::@5/plexSort::@7->plexSort::@3#0] -- register_copy + // [34] (byte) plexSort::s#6 ← (byte) plexSort::m#2 -- vbuxx=vbuz1 + // [35] phi from plexSort::@5 plexSort::@7 to plexSort::@3 [phi:plexSort::@5/plexSort::@7->plexSort::@3] + // [35] phi (byte) plexSort::s#3 = (byte) plexSort::s#6 [phi:plexSort::@5/plexSort::@7->plexSort::@3#0] -- register_copy // plexSort::@3 __b3: // PLEX_SORTED_IDX[s+1] = PLEX_SORTED_IDX[s] - // [38] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + // [36] *((const byte*) PLEX_SORTED_IDX+(byte) 1 + (byte) plexSort::s#3) ← *((const byte*) PLEX_SORTED_IDX + (byte) plexSort::s#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda PLEX_SORTED_IDX,x sta PLEX_SORTED_IDX+1,x // s--; - // [39] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 -- vbuxx=_dec_vbuxx + // [37] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 -- vbuxx=_dec_vbuxx dex // while((s!=0xff) && (nxt_yplexSort::plexFreePrepare1] + // [47] phi from plexSort::@6 to plexSort::plexFreePrepare1 [phi:plexSort::@6->plexSort::plexFreePrepare1] // plexSort::plexFreePrepare1 - // [50] phi from plexSort::plexFreePrepare1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1] - // [50] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) 0 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1#0] -- vbuxx=vbuc1 + // [48] phi from plexSort::plexFreePrepare1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1] + // [48] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) 0 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1#0] -- vbuxx=vbuc1 ldx #0 - // [50] phi from plexSort::plexFreePrepare1_@1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1] - // [50] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) plexSort::plexFreePrepare1_s#1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1#0] -- register_copy + // [48] phi from plexSort::plexFreePrepare1_@1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1] + // [48] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) plexSort::plexFreePrepare1_s#1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1#0] -- register_copy // plexSort::plexFreePrepare1_@1 plexFreePrepare1___b1: // PLEX_FREE_YPOS[s] = 0 - // [51] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 -- pbuc1_derefidx_vbuxx=vbuc2 + // [49] *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1_s#2) ← (byte) 0 -- pbuc1_derefidx_vbuxx=vbuc2 lda #0 sta PLEX_FREE_YPOS,x // for( char s: 0..7) - // [52] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 -- vbuxx=_inc_vbuxx + // [50] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 -- vbuxx=_inc_vbuxx inx - // [53] if((byte) plexSort::plexFreePrepare1_s#1!=(byte) 8) goto plexSort::plexFreePrepare1_@1 -- vbuxx_neq_vbuc1_then_la1 + // [51] if((byte) plexSort::plexFreePrepare1_s#1!=(byte) 8) goto plexSort::plexFreePrepare1_@1 -- vbuxx_neq_vbuc1_then_la1 cpx #8 bne plexFreePrepare1___b1 // plexSort::plexFreePrepare1_@2 // plex_free_next = 0 - // [54] (volatile byte) plex_free_next ← (byte) 0 -- vbuz1=vbuc1 + // [52] (volatile byte) plex_free_next ← (byte) 0 -- vbuz1=vbuc1 sta.z plex_free_next // plexSort::@return // } - // [55] return + // [53] return rts } // init @@ -3829,43 +3847,43 @@ init: { // Set the x-positions & pointers .label xp = 4 // *D011 = VIC_DEN | VIC_RSEL | 3 - // [56] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 -- _deref_pbuc1=vbuc2 + // [54] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 -- _deref_pbuc1=vbuc2 lda #VIC_DEN|VIC_RSEL|3 sta D011 // plexInit(SCREEN) - // [57] call plexInit + // [55] call plexInit // Initialize the multiplexer // [77] phi from init to plexInit [phi:init->plexInit] jsr plexInit - // [58] phi from init to init::@1 [phi:init->init::@1] - // [58] phi (word) init::xp#2 = (word) $20 [phi:init->init::@1#0] -- vwuz1=vwuc1 + // [56] phi from init to init::@1 [phi:init->init::@1] + // [56] phi (word) init::xp#2 = (word) $20 [phi:init->init::@1#0] -- vwuz1=vwuc1 lda #<$20 sta.z xp lda #>$20 sta.z xp+1 - // [58] phi (byte) init::sx#2 = (byte) 0 [phi:init->init::@1#1] -- vbuxx=vbuc1 + // [56] phi (byte) init::sx#2 = (byte) 0 [phi:init->init::@1#1] -- vbuxx=vbuc1 ldx #0 - // [58] phi from init::@1 to init::@1 [phi:init::@1->init::@1] - // [58] phi (word) init::xp#2 = (word) init::xp#1 [phi:init::@1->init::@1#0] -- register_copy - // [58] phi (byte) init::sx#2 = (byte) init::sx#1 [phi:init::@1->init::@1#1] -- register_copy + // [56] phi from init::@1 to init::@1 [phi:init::@1->init::@1] + // [56] phi (word) init::xp#2 = (word) init::xp#1 [phi:init::@1->init::@1#0] -- register_copy + // [56] phi (byte) init::sx#2 = (byte) init::sx#1 [phi:init::@1->init::@1#1] -- register_copy // init::@1 __b1: // PLEX_PTR[sx] = (char)(SPRITE/0x40) - // [59] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 + // [57] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const byte*) SPRITE/(byte) $40 -- pbuc1_derefidx_vbuxx=vbuc2 lda #$ff&SPRITE/$40 sta PLEX_PTR,x // PLEX_XPOS[sx] = xp - // [60] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1 -- vbuaa=vbuxx_rol_1 + // [58] (byte~) init::$3 ← (byte) init::sx#2 << (byte) 1 -- vbuaa=vbuxx_rol_1 txa asl - // [61] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (word) init::xp#2 -- pwuc1_derefidx_vbuaa=vwuz1 + // [59] *((const word*) PLEX_XPOS + (byte~) init::$3) ← (word) init::xp#2 -- pwuc1_derefidx_vbuaa=vwuz1 tay lda.z xp sta PLEX_XPOS,y lda.z xp+1 sta PLEX_XPOS+1,y // xp += 9 - // [62] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 -- vwuz1=vwuz1_plus_vbuc1 + // [60] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 -- vwuz1=vwuz1_plus_vbuc1 lda #9 clc adc.z xp @@ -3874,32 +3892,32 @@ init: { inc.z xp+1 !: // for(char sx: 0..PLEX_COUNT-1) - // [63] (byte) init::sx#1 ← ++ (byte) init::sx#2 -- vbuxx=_inc_vbuxx + // [61] (byte) init::sx#1 ← ++ (byte) init::sx#2 -- vbuxx=_inc_vbuxx inx - // [64] if((byte) init::sx#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto init::@1 -- vbuxx_neq_vbuc1_then_la1 + // [62] if((byte) init::sx#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto init::@1 -- vbuxx_neq_vbuc1_then_la1 cpx #PLEX_COUNT-1+1 bne __b1 // init::@2 // *SPRITES_ENABLE = 0xff - // [65] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2 + // [63] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2 // Enable & initialize sprites lda #$ff sta SPRITES_ENABLE - // [66] phi from init::@2 to init::@3 [phi:init::@2->init::@3] - // [66] phi (byte) init::ss#2 = (byte) 0 [phi:init::@2->init::@3#0] -- vbuxx=vbuc1 + // [64] phi from init::@2 to init::@3 [phi:init::@2->init::@3] + // [64] phi (byte) init::ss#2 = (byte) 0 [phi:init::@2->init::@3#0] -- vbuxx=vbuc1 ldx #0 - // [66] phi from init::@3 to init::@3 [phi:init::@3->init::@3] - // [66] phi (byte) init::ss#2 = (byte) init::ss#1 [phi:init::@3->init::@3#0] -- register_copy + // [64] phi from init::@3 to init::@3 [phi:init::@3->init::@3] + // [64] phi (byte) init::ss#2 = (byte) init::ss#1 [phi:init::@3->init::@3#0] -- register_copy // init::@3 __b3: // SPRITES_COLS[ss] = GREEN - // [67] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN -- pbuc1_derefidx_vbuxx=vbuc2 + // [65] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN -- pbuc1_derefidx_vbuxx=vbuc2 lda #GREEN sta SPRITES_COLS,x // for(char ss: 0..7) - // [68] (byte) init::ss#1 ← ++ (byte) init::ss#2 -- vbuxx=_inc_vbuxx + // [66] (byte) init::ss#1 ← ++ (byte) init::ss#2 -- vbuxx=_inc_vbuxx inx - // [69] if((byte) init::ss#1!=(byte) 8) goto init::@3 -- vbuxx_neq_vbuc1_then_la1 + // [67] if((byte) init::ss#1!=(byte) 8) goto init::@3 -- vbuxx_neq_vbuc1_then_la1 cpx #8 bne __b3 // init::@4 @@ -3908,22 +3926,31 @@ init: { // enable the interrupt sei // *CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR - // [71] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 + // [69] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2 lda #CIA_INTERRUPT_CLEAR sta CIA1_INTERRUPT // *IRQ_ENABLE = IRQ_RASTER - // [72] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // [70] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 lda #IRQ_RASTER sta IRQ_ENABLE // *IRQ_STATUS = IRQ_RASTER - // [73] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // [71] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 sta IRQ_STATUS // *KERNEL_IRQ = &plex_irq - // [74] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() -- _deref_pptc1=pprc2 + // [72] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) plex_irq() -- _deref_pptc1=pprc2 lda #plex_irq sta KERNEL_IRQ+1 + // *VIC_CONTROL &=0x7f + // [73] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + lda #$7f + and VIC_CONTROL + sta VIC_CONTROL + // *RASTER = 0x0 + // [74] *((const nomodify byte*) RASTER) ← (byte) 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta RASTER // asm // asm { cli } cli @@ -3963,67 +3990,77 @@ plexInit: { plex_irq: { .label __4 = $d // entry interrupt(KERNEL_MIN) + // asm + // asm { sei } + sei // *BORDERCOL = WHITE - // [84] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2 + // [85] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2 lda #WHITE sta BORDERCOL - // [85] phi from plex_irq plex_irq::@7 to plex_irq::@3 [phi:plex_irq/plex_irq::@7->plex_irq::@3] + // [86] phi from plex_irq plex_irq::@7 to plex_irq::@3 [phi:plex_irq/plex_irq::@7->plex_irq::@3] // plex_irq::@3 __b3: // plexShowSprite() - // [86] call plexShowSprite + // [87] call plexShowSprite jsr plexShowSprite // plex_irq::plexFreeNextYpos1 // return PLEX_FREE_YPOS[plex_free_next]; - // [87] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) -- vbuxx=pbuc1_derefidx_vbuz1 + // [88] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) -- vbuxx=pbuc1_derefidx_vbuz1 ldy.z plex_free_next ldx PLEX_FREE_YPOS,y // plex_irq::@6 // *RASTER+2 - // [88] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 2 -- vbuz1=_deref_pbuc1_plus_2 + // [89] (byte~) plex_irq::$4 ← *((const nomodify byte*) RASTER) + (byte) 2 -- vbuz1=_deref_pbuc1_plus_2 lda RASTER clc adc #2 sta.z __4 // while (plex_show_idx < PLEX_COUNT && rasterY < *RASTER+2) - // [89] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 -- vbuz1_ge_vbuc1_then_la1 + // [90] if((volatile byte) plex_show_idx>=(const nomodify byte) PLEX_COUNT) goto plex_irq::@4 -- vbuz1_ge_vbuc1_then_la1 lda.z plex_show_idx cmp #PLEX_COUNT bcs __b4 // plex_irq::@7 - // [90] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3 -- vbuxx_lt_vbuz1_then_la1 + // [91] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte~) plex_irq::$4) goto plex_irq::@3 -- vbuxx_lt_vbuz1_then_la1 cpx.z __4 bcc __b3 // plex_irq::@4 __b4: // *IRQ_STATUS = IRQ_RASTER - // [91] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 + // [92] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2 lda #IRQ_RASTER sta IRQ_STATUS // if (plex_show_idxPLEX_XPOS[xpos_idx] - // [110] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) -- vbuaa=_hi_pwuc1_derefidx_vbuxx + // [113] (byte~) plexShowSprite::$3 ← > *((const word*) PLEX_XPOS + (byte~) plexShowSprite::$11) -- vbuaa=_hi_pwuc1_derefidx_vbuxx lda PLEX_XPOS+1,x // if(>PLEX_XPOS[xpos_idx]!=0) - // [111] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1 -- vbuaa_neq_0_then_la1 + // [114] if((byte~) plexShowSprite::$3!=(byte) 0) goto plexShowSprite::@1 -- vbuaa_neq_0_then_la1 cmp #0 bne __b1 // plexShowSprite::@3 // 0xff^plex_sprite_msb - // [112] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb -- vbuaa=vbuc1_bxor_vbuz1 + // [115] (byte~) plexShowSprite::$9 ← (byte) $ff ^ (volatile byte) plex_sprite_msb -- vbuaa=vbuc1_bxor_vbuz1 lda #$ff eor.z plex_sprite_msb // *SPRITES_XMSB &= (0xff^plex_sprite_msb) - // [113] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 -- _deref_pbuc1=_deref_pbuc1_band_vbuaa + // [116] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) & (byte~) plexShowSprite::$9 -- _deref_pbuc1=_deref_pbuc1_band_vbuaa and SPRITES_XMSB sta SPRITES_XMSB // plexShowSprite::@2 __b2: // plex_sprite_idx+1 - // [114] (byte~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (byte) 1 -- vbuxx=vbuz1_plus_1 + // [117] (byte~) plexShowSprite::$5 ← (volatile byte) plex_sprite_idx + (byte) 1 -- vbuxx=vbuz1_plus_1 ldx.z plex_sprite_idx inx // (plex_sprite_idx+1)&7 - // [115] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7 -- vbuaa=vbuxx_band_vbuc1 + // [118] (byte~) plexShowSprite::$6 ← (byte~) plexShowSprite::$5 & (byte) 7 -- vbuaa=vbuxx_band_vbuc1 txa and #7 // plex_sprite_idx = (plex_sprite_idx+1)&7 - // [116] (volatile byte) plex_sprite_idx ← (byte~) plexShowSprite::$6 -- vbuz1=vbuaa + // [119] (volatile byte) plex_sprite_idx ← (byte~) plexShowSprite::$6 -- vbuz1=vbuaa sta.z plex_sprite_idx // plex_show_idx++; - // [117] (volatile byte) plex_show_idx ← ++ (volatile byte) plex_show_idx -- vbuz1=_inc_vbuz1 + // [120] (volatile byte) plex_show_idx ← ++ (volatile byte) plex_show_idx -- vbuz1=_inc_vbuz1 inc.z plex_show_idx // plex_sprite_msb <<=1 - // [118] (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (byte) 1 -- vbuz1=vbuz1_rol_1 + // [121] (volatile byte) plex_sprite_msb ← (volatile byte) plex_sprite_msb << (byte) 1 -- vbuz1=vbuz1_rol_1 asl.z plex_sprite_msb // if(plex_sprite_msb==0) - // [119] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return -- vbuz1_neq_0_then_la1 + // [122] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return -- vbuz1_neq_0_then_la1 lda.z plex_sprite_msb cmp #0 bne __breturn // plexShowSprite::@4 // plex_sprite_msb = 1 - // [120] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 + // [123] (volatile byte) plex_sprite_msb ← (byte) 1 -- vbuz1=vbuc1 lda #1 sta.z plex_sprite_msb // plexShowSprite::@return __breturn: // } - // [121] return + // [124] return rts // plexShowSprite::@1 __b1: // *SPRITES_XMSB |= plex_sprite_msb - // [122] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 + // [125] *((const nomodify byte*) SPRITES_XMSB) ← *((const nomodify byte*) SPRITES_XMSB) | (volatile byte) plex_sprite_msb -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 lda SPRITES_XMSB ora.z plex_sprite_msb sta SPRITES_XMSB diff --git a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.sym b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.sym index 47913a910..2fdc74813 100644 --- a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.sym +++ b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.sym @@ -39,7 +39,7 @@ (const nomodify byte) WHITE = (byte) 1 (const byte*) YSIN[(number) $100] = kickasm {{ .fill $100, round(139.5+89.5*sin(toRadians(360*i/256))) }} -(volatile bool) framedone loadstore zp[1]:10 1000.5454545454544 +(volatile bool) framedone loadstore zp[1]:10 1222.8888888888887 (void()) init() (byte~) init::$3 reg byte a 2002.0 (label) init::@1 @@ -64,7 +64,7 @@ (label) loop::@5 (label) loop::@6 (byte) loop::sin_idx -(byte) loop::sin_idx#1 sin_idx zp[1]:2 286.0 +(byte) loop::sin_idx#1 sin_idx zp[1]:2 400.4 (byte) loop::sin_idx#6 sin_idx zp[1]:2 333.6666666666667 (byte) loop::sy (byte) loop::sy#1 reg byte y 15001.5 @@ -136,7 +136,7 @@ (byte) plexSort::s#2 reg byte x 2000002.0 (byte) plexSort::s#3 reg byte x 2.05000025E7 (byte) plexSort::s#6 reg byte x 2000002.0 -(volatile byte) plex_free_next loadstore zp[1]:9 332.80645161290323 +(volatile byte) plex_free_next loadstore zp[1]:9 322.40625 interrupt(KERNEL_MIN)(void()) plex_irq() (byte~) plex_irq::$4 zp[1]:13 11.0 (label) plex_irq::@1 @@ -151,9 +151,9 @@ interrupt(KERNEL_MIN)(void()) plex_irq() (byte) plex_irq::plexFreeNextYpos1_return (byte) plex_irq::plexFreeNextYpos1_return#0 reg byte x 4.0 (byte) plex_irq::rasterY -(volatile byte) plex_show_idx loadstore zp[1]:6 309.44117647058835 -(volatile byte) plex_sprite_idx loadstore zp[1]:7 335.7096774193548 -(volatile byte) plex_sprite_msb loadstore zp[1]:8 321.4848484848485 +(volatile byte) plex_show_idx loadstore zp[1]:6 300.6000000000001 +(volatile byte) plex_sprite_idx loadstore zp[1]:7 325.21875 +(volatile byte) plex_sprite_msb loadstore zp[1]:8 312.029411764706 zp[1]:2 [ loop::sin_idx#6 loop::sin_idx#1 ] reg byte x [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ]