From de8c42eba81456ee3c459b6daaafaac6c7f29391 Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Tue, 2 Apr 2019 22:31:26 +0200 Subject: [PATCH] Fixed problem with overlapping variables in threads. --- .../kickc/passes/Pass4ZeroPageCoalesce.java | 2 +- .../multiplexer-irq/simple-multiplexer-irq.kc | 4 +- .../ref/irq-local-var-overlap-problem.asm | 8 +- .../ref/irq-local-var-overlap-problem.log | 52 +- .../ref/irq-local-var-overlap-problem.sym | 28 +- .../simple-multiplexer-irq.asm | 45 +- .../simple-multiplexer-irq.cfg | 8 +- .../simple-multiplexer-irq.log | 1412 ++++++++--------- .../simple-multiplexer-irq.sym | 86 +- 9 files changed, 811 insertions(+), 834 deletions(-) diff --git a/src/main/java/dk/camelot64/kickc/passes/Pass4ZeroPageCoalesce.java b/src/main/java/dk/camelot64/kickc/passes/Pass4ZeroPageCoalesce.java index 6b4974b97..bef9b3f22 100644 --- a/src/main/java/dk/camelot64/kickc/passes/Pass4ZeroPageCoalesce.java +++ b/src/main/java/dk/camelot64/kickc/passes/Pass4ZeroPageCoalesce.java @@ -109,7 +109,7 @@ public class Pass4ZeroPageCoalesce extends Pass2Base { * @return True if the two equivalence classes can be coalesced into one without problems. */ private static boolean canCoalesceThreads(LiveRangeEquivalenceClass ec1, LiveRangeEquivalenceClass ec2, Collection threadHeads, Program program) { - if(threadHeads.size()>=1) { + if(threadHeads.size()<=1) { return true; } CallGraph callGraph = program.getCallGraph(); diff --git a/src/test/kc/multiplexer-irq/simple-multiplexer-irq.kc b/src/test/kc/multiplexer-irq/simple-multiplexer-irq.kc index 6796591b9..e03fd2483 100644 --- a/src/test/kc/multiplexer-irq/simple-multiplexer-irq.kc +++ b/src/test/kc/multiplexer-irq/simple-multiplexer-irq.kc @@ -74,12 +74,12 @@ interrupt(kernel_min) void plex_irq() { // The raster loop void loop() { // The current index into the y-sinus - volatile byte sin_idx = 0; // without volatile gives wrong asm + byte sin_idx = 0; while(true) { while(!framedone) { } *BORDERCOL = RED; // Assign sinus positions - volatile byte y_idx = sin_idx; // without volatile gives wrong asm + byte y_idx = sin_idx; for(byte sy: 0..PLEX_COUNT-1) { PLEX_YPOS[sy] = YSIN[y_idx]; y_idx += 8; diff --git a/src/test/ref/irq-local-var-overlap-problem.asm b/src/test/ref/irq-local-var-overlap-problem.asm index e9502f9f2..9ee3c22e7 100644 --- a/src/test/ref/irq-local-var-overlap-problem.asm +++ b/src/test/ref/irq-local-var-overlap-problem.asm @@ -93,9 +93,9 @@ sub_main: { rts } irq: { - .label k = 4 - .label j = 3 - .label i = 2 + .label k = 8 + .label j = 7 + .label i = 6 inc BGCOL lda #0 sta i @@ -129,7 +129,7 @@ irq: { jmp $ea81 } sub_irq: { - .label i = 5 + .label i = 9 lda #0 sta i b1: diff --git a/src/test/ref/irq-local-var-overlap-problem.log b/src/test/ref/irq-local-var-overlap-problem.log index 59bef8187..4d73aaeee 100644 --- a/src/test/ref/irq-local-var-overlap-problem.log +++ b/src/test/ref/irq-local-var-overlap-problem.log @@ -1349,10 +1349,10 @@ Attempting to uplift remaining variables inzp ZP_BYTE:9 [ irq::j#4 irq::j#1 ] Uplifting [irq] best 424175705 combination zp ZP_BYTE:9 [ irq::j#4 irq::j#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:8 [ irq::i#7 irq::i#1 ] Uplifting [irq] best 424175705 combination zp ZP_BYTE:8 [ irq::i#7 irq::i#1 ] -Coalescing zero page register [ zp ZP_BYTE:2 [ main::i#7 main::i#1 ] ] with [ zp ZP_BYTE:8 [ irq::i#7 irq::i#1 ] ] -Coalescing zero page register [ zp ZP_BYTE:3 [ main::j#5 main::j#1 ] ] with [ zp ZP_BYTE:9 [ irq::j#4 irq::j#1 ] ] -Coalescing zero page register [ zp ZP_BYTE:4 [ main::k#2 main::k#1 ] ] with [ zp ZP_BYTE:10 [ irq::k#2 irq::k#1 ] ] -Coalescing zero page register [ zp ZP_BYTE:5 [ sub_main::i#6 sub_main::i#1 ] ] with [ zp ZP_BYTE:11 [ sub_irq::i#6 sub_irq::i#1 ] ] +Allocated (was zp ZP_BYTE:8) zp ZP_BYTE:6 [ irq::i#7 irq::i#1 ] +Allocated (was zp ZP_BYTE:9) zp ZP_BYTE:7 [ irq::j#4 irq::j#1 ] +Allocated (was zp ZP_BYTE:10) zp ZP_BYTE:8 [ irq::k#2 irq::k#1 ] +Allocated (was zp ZP_BYTE:11) zp ZP_BYTE:9 [ sub_irq::i#6 sub_irq::i#1 ] ASSEMBLER BEFORE OPTIMIZATION //SEG0 File Comments @@ -1578,9 +1578,9 @@ sub_main: { } //SEG77 irq irq: { - .label k = 4 - .label j = 3 - .label i = 2 + .label k = 8 + .label j = 7 + .label i = 6 //SEG78 entry interrupt(KERNEL_MIN) //SEG79 [39] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL @@ -1676,7 +1676,7 @@ irq: { } //SEG114 sub_irq sub_irq: { - .label i = 5 + .label i = 9 //SEG115 [57] phi from sub_irq to sub_irq::@1 [phi:sub_irq->sub_irq::@1] b1_from_sub_irq: //SEG116 [57] phi (byte) sub_irq::i#6 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:sub_irq->sub_irq::@1#0] -- vbuz1=vbuc1 @@ -1906,14 +1906,14 @@ interrupt(KERNEL_MIN)(void()) irq() (label) irq::@7 (label) irq::@return (byte) irq::i -(byte) irq::i#1 i zp ZP_BYTE:2 16.5 -(byte) irq::i#7 i zp ZP_BYTE:2 93.0 +(byte) irq::i#1 i zp ZP_BYTE:6 16.5 +(byte) irq::i#7 i zp ZP_BYTE:6 93.0 (byte) irq::j -(byte) irq::j#1 j zp ZP_BYTE:3 151.5 -(byte) irq::j#4 j zp ZP_BYTE:3 150.375 +(byte) irq::j#1 j zp ZP_BYTE:7 151.5 +(byte) irq::j#4 j zp ZP_BYTE:7 150.375 (byte) irq::k -(byte) irq::k#1 k zp ZP_BYTE:4 1501.5 -(byte) irq::k#2 k zp ZP_BYTE:4 600.5999999999999 +(byte) irq::k#1 k zp ZP_BYTE:8 1501.5 +(byte) irq::k#2 k zp ZP_BYTE:8 600.5999999999999 (void()) main() (byte~) main::$1 reg byte a 20002.0 (byte~) main::$2 reg byte a 20002.0 @@ -1943,8 +1943,8 @@ interrupt(KERNEL_MIN)(void()) irq() (label) sub_irq::@5 (label) sub_irq::@return (byte) sub_irq::i -(byte) sub_irq::i#1 i zp ZP_BYTE:5 15001.5 -(byte) sub_irq::i#6 i zp ZP_BYTE:5 102000.30000000002 +(byte) sub_irq::i#1 i zp ZP_BYTE:9 15001.5 +(byte) sub_irq::i#6 i zp ZP_BYTE:9 102000.30000000002 (byte) sub_irq::j (byte) sub_irq::j#1 reg byte x 150001.5 (byte) sub_irq::j#4 reg byte x 171428.99999999997 @@ -1970,12 +1970,16 @@ interrupt(KERNEL_MIN)(void()) irq() (byte) sub_main::k#1 reg byte y 1.50000015E7 (byte) sub_main::k#2 reg byte y 7500000.75 -zp ZP_BYTE:2 [ main::i#7 main::i#1 irq::i#7 irq::i#1 ] -zp ZP_BYTE:3 [ main::j#5 main::j#1 irq::j#4 irq::j#1 ] -zp ZP_BYTE:4 [ main::k#2 main::k#1 irq::k#2 irq::k#1 ] -zp ZP_BYTE:5 [ sub_main::i#6 sub_main::i#1 sub_irq::i#6 sub_irq::i#1 ] +zp ZP_BYTE:2 [ main::i#7 main::i#1 ] +zp ZP_BYTE:3 [ main::j#5 main::j#1 ] +zp ZP_BYTE:4 [ main::k#2 main::k#1 ] +zp ZP_BYTE:5 [ sub_main::i#6 sub_main::i#1 ] reg byte x [ sub_main::j#4 sub_main::j#1 ] reg byte y [ sub_main::k#2 sub_main::k#1 ] +zp ZP_BYTE:6 [ irq::i#7 irq::i#1 ] +zp ZP_BYTE:7 [ irq::j#4 irq::j#1 ] +zp ZP_BYTE:8 [ irq::k#2 irq::k#1 ] +zp ZP_BYTE:9 [ sub_irq::i#6 sub_irq::i#1 ] reg byte x [ sub_irq::j#4 sub_irq::j#1 ] reg byte y [ sub_irq::k#2 sub_irq::k#1 ] reg byte a [ main::$1 ] @@ -2164,9 +2168,9 @@ sub_main: { } //SEG77 irq irq: { - .label k = 4 - .label j = 3 - .label i = 2 + .label k = 8 + .label j = 7 + .label i = 6 //SEG78 entry interrupt(KERNEL_MIN) //SEG79 [39] *((const byte*) BGCOL#0) ← ++ *((const byte*) BGCOL#0) -- _deref_pbuc1=_inc__deref_pbuc1 inc BGCOL @@ -2237,7 +2241,7 @@ irq: { } //SEG114 sub_irq sub_irq: { - .label i = 5 + .label i = 9 //SEG115 [57] phi from sub_irq to sub_irq::@1 [phi:sub_irq->sub_irq::@1] //SEG116 [57] phi (byte) sub_irq::i#6 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:sub_irq->sub_irq::@1#0] -- vbuz1=vbuc1 lda #0 diff --git a/src/test/ref/irq-local-var-overlap-problem.sym b/src/test/ref/irq-local-var-overlap-problem.sym index 12c304370..e3ae2397e 100644 --- a/src/test/ref/irq-local-var-overlap-problem.sym +++ b/src/test/ref/irq-local-var-overlap-problem.sym @@ -33,14 +33,14 @@ interrupt(KERNEL_MIN)(void()) irq() (label) irq::@7 (label) irq::@return (byte) irq::i -(byte) irq::i#1 i zp ZP_BYTE:2 16.5 -(byte) irq::i#7 i zp ZP_BYTE:2 93.0 +(byte) irq::i#1 i zp ZP_BYTE:6 16.5 +(byte) irq::i#7 i zp ZP_BYTE:6 93.0 (byte) irq::j -(byte) irq::j#1 j zp ZP_BYTE:3 151.5 -(byte) irq::j#4 j zp ZP_BYTE:3 150.375 +(byte) irq::j#1 j zp ZP_BYTE:7 151.5 +(byte) irq::j#4 j zp ZP_BYTE:7 150.375 (byte) irq::k -(byte) irq::k#1 k zp ZP_BYTE:4 1501.5 -(byte) irq::k#2 k zp ZP_BYTE:4 600.5999999999999 +(byte) irq::k#1 k zp ZP_BYTE:8 1501.5 +(byte) irq::k#2 k zp ZP_BYTE:8 600.5999999999999 (void()) main() (byte~) main::$1 reg byte a 20002.0 (byte~) main::$2 reg byte a 20002.0 @@ -70,8 +70,8 @@ interrupt(KERNEL_MIN)(void()) irq() (label) sub_irq::@5 (label) sub_irq::@return (byte) sub_irq::i -(byte) sub_irq::i#1 i zp ZP_BYTE:5 15001.5 -(byte) sub_irq::i#6 i zp ZP_BYTE:5 102000.30000000002 +(byte) sub_irq::i#1 i zp ZP_BYTE:9 15001.5 +(byte) sub_irq::i#6 i zp ZP_BYTE:9 102000.30000000002 (byte) sub_irq::j (byte) sub_irq::j#1 reg byte x 150001.5 (byte) sub_irq::j#4 reg byte x 171428.99999999997 @@ -97,12 +97,16 @@ interrupt(KERNEL_MIN)(void()) irq() (byte) sub_main::k#1 reg byte y 1.50000015E7 (byte) sub_main::k#2 reg byte y 7500000.75 -zp ZP_BYTE:2 [ main::i#7 main::i#1 irq::i#7 irq::i#1 ] -zp ZP_BYTE:3 [ main::j#5 main::j#1 irq::j#4 irq::j#1 ] -zp ZP_BYTE:4 [ main::k#2 main::k#1 irq::k#2 irq::k#1 ] -zp ZP_BYTE:5 [ sub_main::i#6 sub_main::i#1 sub_irq::i#6 sub_irq::i#1 ] +zp ZP_BYTE:2 [ main::i#7 main::i#1 ] +zp ZP_BYTE:3 [ main::j#5 main::j#1 ] +zp ZP_BYTE:4 [ main::k#2 main::k#1 ] +zp ZP_BYTE:5 [ sub_main::i#6 sub_main::i#1 ] reg byte x [ sub_main::j#4 sub_main::j#1 ] reg byte y [ sub_main::k#2 sub_main::k#1 ] +zp ZP_BYTE:6 [ irq::i#7 irq::i#1 ] +zp ZP_BYTE:7 [ irq::j#4 irq::j#1 ] +zp ZP_BYTE:8 [ irq::k#2 irq::k#1 ] +zp ZP_BYTE:9 [ sub_irq::i#6 sub_irq::i#1 ] reg byte x [ sub_irq::j#4 sub_irq::j#1 ] reg byte y [ sub_irq::k#2 sub_irq::k#1 ] reg byte a [ main::$1 ] diff --git a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.asm b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.asm index 21012a41e..11c2ce9f2 100644 --- a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.asm +++ b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.asm @@ -34,14 +34,14 @@ .label YSIN = $2100 // The address of the sprite pointers on the current screen (screen+$3f8). .label PLEX_SCREEN_PTR = $400+$3f8 - .label plex_show_idx = 9 - .label plex_sprite_idx = 8 - .label plex_sprite_msb = $b - .label plex_sprite_idx_1 = $e - .label plex_free_next = $f + .label plex_show_idx = 8 + .label plex_sprite_idx = 7 + .label plex_sprite_msb = $a + .label plex_sprite_idx_1 = $d + .label plex_free_next = $e .label framedone = 2 - .label plex_free_next_27 = $a - .label plex_free_next_31 = $a + .label plex_free_next_27 = 9 + .label plex_free_next_31 = 9 bbegin: // The index in the PLEX tables of the next sprite to show lda #0 @@ -66,12 +66,8 @@ main: { // The raster loop loop: { .label sin_idx = 3 - .label y_idx = 4 - // The current index into the y-sinus lda #0 sta sin_idx - b1: - // without volatile gives wrong asm b2: lda framedone cmp #0 @@ -80,18 +76,13 @@ loop: { b3: lda #RED sta BORDERCOL - // Assign sinus positions - lda sin_idx - sta y_idx + ldx sin_idx ldy #0 - // without volatile gives wrong asm b4: - ldx y_idx lda YSIN,x sta PLEX_YPOS,y - lax y_idx + txa axs #-[8] - stx y_idx iny cpy #PLEX_COUNT-1+1 bne b4 @@ -107,7 +98,7 @@ loop: { sta VIC_CONTROL lda #0 sta RASTER - jmp b1 + jmp b2 } // 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) @@ -119,9 +110,9 @@ loop: { // 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 = $c - .label nxt_y = $d - .label m = 5 + .label nxt_idx = $b + .label nxt_y = $c + .label m = 4 lda #0 sta m b1: @@ -174,7 +165,7 @@ plexSort: { } // Initialize the program init: { - .label xp = 6 + .label xp = 5 lda #VIC_DEN|VIC_RSEL|3 sta D011 jsr plexInit @@ -239,7 +230,7 @@ plexInit: { rts } plex_irq: { - .label _4 = 5 + .label _4 = $f lda #WHITE sta BORDERCOL b3: @@ -276,9 +267,9 @@ plex_irq: { // Show the next sprite. // plexSort() prepares showing the sprites plexShowSprite: { - .label _7 = 8 - .label plex_sprite_idx2 = 5 - .label plexFreeAdd1__2 = $a + .label _7 = 7 + .label plex_sprite_idx2 = $f + .label plexFreeAdd1__2 = 9 lda plex_sprite_idx asl sta plex_sprite_idx2 diff --git a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.cfg b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.cfg index 52b0bce54..4703b55b8 100644 --- a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.cfg +++ b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.cfg @@ -43,10 +43,10 @@ main::@return: scope:[main] from main::@1 [15] return to:@return loop: scope:[loop] from main::@1 - [16] (byte) loop::sin_idx#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 + [16] phi() to:loop::@1 loop::@1: scope:[loop] from loop loop::@6 - [17] (byte) loop::sin_idx#6 ← phi( loop/(byte) loop::sin_idx#0 loop::@6/(byte) loop::sin_idx#1 ) + [17] (byte) loop::sin_idx#6 ← phi( loop/(byte/signed byte/word/signed word/dword/signed dword) 0 loop::@6/(byte) loop::sin_idx#1 ) [17] (bool) framedone#12 ← phi( loop/(bool) framedone#19 loop::@6/(bool) framedone#5 ) to:loop::@2 loop::@2: scope:[loop] from loop::@1 loop::@2 @@ -54,11 +54,11 @@ loop::@2: scope:[loop] from loop::@1 loop::@2 to:loop::@2 loop::@3: scope:[loop] from loop::@2 [19] *((const byte*) BORDERCOL#0) ← (const byte) RED#0 - [20] (byte) loop::y_idx#0 ← (byte) loop::sin_idx#6 + [20] (byte~) loop::y_idx#4 ← (byte) loop::sin_idx#6 to:loop::@4 loop::@4: scope:[loop] from loop::@3 loop::@4 [21] (byte) loop::sy#2 ← phi( loop::@4/(byte) loop::sy#1 loop::@3/(byte/signed byte/word/signed word/dword/signed dword) 0 ) - [21] (byte) loop::y_idx#2 ← phi( loop::@4/(byte) loop::y_idx#1 loop::@3/(byte) loop::y_idx#0 ) + [21] (byte) loop::y_idx#2 ← phi( loop::@4/(byte) loop::y_idx#1 loop::@3/(byte~) loop::y_idx#4 ) [22] *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) loop::sy#2) ← *((const byte*) YSIN#0 + (byte) loop::y_idx#2) [23] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte/signed byte/word/signed word/dword/signed dword) 8 [24] (byte) loop::sy#1 ← ++ (byte) loop::sy#2 diff --git a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.log b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.log index 7b9d42ba0..90a45684e 100644 --- a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.log +++ b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.log @@ -1368,7 +1368,6 @@ Inversing boolean not [182] (bool~) plexShowSprite::$9 ← (byte) plex_sprite_ms Successful SSA optimization Pass2UnaryNotSimplification Alias candidate removed (volatile)(byte) plex_free_next#2 = (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 (byte) plex_free_next#47 (byte) plex_free_next#41 (byte) plex_free_next#42 Alias candidate removed (volatile)(byte) plex_sprite_idx#29 = (byte) plex_sprite_idx#3 (byte/word/dword~) plexShowSprite::$7 (byte) plex_sprite_idx#30 -Alias candidate removed (volatile)(byte) loop::sin_idx#2 = (byte) loop::sin_idx#7 (byte) loop::sin_idx#4 (byte) loop::y_idx#0 Alias (byte*) plexInit::plexSetScreen1_screen#0 = (byte*) plexInit::screen#1 (byte*) plexInit::plexSetScreen1_screen#1 Alias (byte*) PLEX_SCREEN_PTR#1 = (byte*) plexInit::plexSetScreen1_$0#0 (byte*) PLEX_SCREEN_PTR#22 Alias (byte*) PLEX_SCREEN_PTR#15 = (byte*) PLEX_SCREEN_PTR#8 (byte*) PLEX_SCREEN_PTR#2 @@ -1438,6 +1437,7 @@ Alias (byte) plex_sprite_idx#10 = (byte) plex_sprite_idx#53 (byte) plex_sprite_i Alias (byte) plex_sprite_msb#11 = (byte) plex_sprite_msb#53 (byte) plex_sprite_msb#32 (byte) plex_sprite_msb#23 Alias (byte) plex_free_next#10 = (byte) plex_free_next#49 (byte) plex_free_next#30 (byte) plex_free_next#21 Alias (bool) framedone#11 = (bool) framedone#17 +Alias (byte) loop::sin_idx#2 = (byte) loop::sin_idx#7 (byte) loop::sin_idx#4 (byte) loop::y_idx#0 Alias (byte) plex_show_idx#50 = (byte) plex_show_idx#54 (byte) plex_show_idx#52 Alias (byte) plex_sprite_idx#49 = (byte) plex_sprite_idx#54 (byte) plex_sprite_idx#52 Alias (byte) plex_sprite_msb#49 = (byte) plex_sprite_msb#54 (byte) plex_sprite_msb#52 @@ -1462,7 +1462,6 @@ Alias (bool) framedone#13 = (bool) framedone#7 Successful SSA optimization Pass2AliasElimination Alias candidate removed (volatile)(byte) plex_free_next#2 = (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 (byte) plex_free_next#47 (byte) plex_free_next#41 (byte) plex_free_next#42 Alias candidate removed (volatile)(byte) plex_sprite_idx#29 = (byte) plex_sprite_idx#3 (byte/word/dword~) plexShowSprite::$7 (byte) plex_sprite_idx#30 -Alias candidate removed (volatile)(byte) loop::sin_idx#2 = (byte) loop::sin_idx#7 (byte) loop::sin_idx#4 (byte) loop::y_idx#0 Alias (byte) plex_sprite_idx#13 = (byte) plex_sprite_idx#15 Alias (byte) plex_show_idx#13 = (byte) plex_show_idx#15 Alias (byte) plex_sprite_msb#14 = (byte) plex_sprite_msb#16 @@ -1475,7 +1474,6 @@ Alias (byte) plex_sprite_msb#20 = (byte) plex_sprite_msb#21 Successful SSA optimization Pass2AliasElimination Alias candidate removed (volatile)(byte) plex_free_next#2 = (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 (byte) plex_free_next#47 (byte) plex_free_next#41 (byte) plex_free_next#42 Alias candidate removed (volatile)(byte) plex_sprite_idx#29 = (byte) plex_sprite_idx#3 (byte/word/dword~) plexShowSprite::$7 (byte) plex_sprite_idx#30 -Alias candidate removed (volatile)(byte) loop::sin_idx#2 = (byte) loop::sin_idx#7 (byte) loop::sin_idx#4 (byte) loop::y_idx#0 Self Phi Eliminated (byte*) PLEX_SCREEN_PTR#15 Self Phi Eliminated (byte) plexSort::nxt_y#1 Self Phi Eliminated (byte) plexSort::nxt_idx#1 @@ -1488,6 +1486,7 @@ Self Phi Eliminated (byte*) PLEX_SCREEN_PTR#13 Self Phi Eliminated (byte*) PLEX_SCREEN_PTR#26 Self Phi Eliminated (bool) framedone#21 Self Phi Eliminated (bool) framedone#11 +Self Phi Eliminated (byte) loop::sin_idx#2 Self Phi Eliminated (byte) plex_show_idx#50 Self Phi Eliminated (byte) plex_sprite_idx#49 Self Phi Eliminated (byte) plex_sprite_msb#49 @@ -1550,12 +1549,11 @@ Redundant Phi (byte) plex_sprite_msb#41 (byte) plex_sprite_msb#28 Redundant Phi (byte) plex_free_next#38 (byte) plex_free_next#26 Redundant Phi (bool) framedone#22 (bool) framedone#14 Redundant Phi (bool) framedone#11 (bool) framedone#12 +Redundant Phi (byte) loop::sin_idx#2 (byte) loop::sin_idx#6 Redundant Phi (byte) plex_show_idx#50 (byte) plex_show_idx#10 Redundant Phi (byte) plex_sprite_idx#49 (byte) plex_sprite_idx#10 Redundant Phi (byte) plex_sprite_msb#49 (byte) plex_sprite_msb#11 Redundant Phi (byte) plex_free_next#46 (byte) plex_free_next#10 -Redundant Phi (byte) loop::sin_idx#7 (byte) loop::sin_idx#4 -Redundant Phi (byte) loop::sin_idx#2 (byte) loop::sin_idx#4 Redundant Phi (byte) loop::sin_idx#3 (byte) loop::sin_idx#2 Redundant Phi (byte) plex_show_idx#36 (byte) plex_show_idx#50 Redundant Phi (byte) plex_sprite_idx#33 (byte) plex_sprite_idx#49 @@ -1686,6 +1684,7 @@ Constant (const byte) init::sx#0 = 0 Constant (const byte) init::ss#0 = 0 Constant (const void()*) init::$3 = &plex_irq 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 Constant (const word[PLEX_COUNT#0]) PLEX_XPOS#0 = { fill( PLEX_COUNT#0, 0) } @@ -1708,7 +1707,7 @@ Successful SSA optimization Pass2ConstantIdentification Consolidated array index constant in assignment *(PLEX_SORTED_IDX#0+1 + plexSort::$2) Consolidated array index constant in assignment *(PLEX_SORTED_IDX#0+1 + plexSort::$5) Successful SSA optimization Pass2ConstantAdditionElimination -if() condition always true - replacing block destination [105] if(true) goto loop::@2 +if() condition always true - replacing block destination [104] if(true) goto loop::@2 Successful SSA optimization Pass2ConstantIfs Inferred type updated to byte in [9] (byte/signed word/word/dword/signed dword~) plexSort::$2 ← (byte) plexSort::m#2 Inferred type updated to byte in [16] (byte/signed word/word/dword/signed dword~) plexSort::$5 ← (byte) plexSort::s#3 @@ -1742,31 +1741,25 @@ Culled Empty Block (label) @17 Successful SSA optimization Pass2CullEmptyBlocks Alias candidate removed (volatile)(byte) plex_free_next#2 = (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 Alias candidate removed (volatile)(byte) plex_sprite_idx#3 = (byte/word/dword~) plexShowSprite::$7 -Alias candidate removed (volatile)(byte) loop::y_idx#0 = (byte) loop::sin_idx#4 Alias (byte) plexSort::m#2 = (byte~) plexSort::$2 Alias (byte) plexSort::s#3 = (byte~) plexSort::$5 Successful SSA optimization Pass2AliasElimination Alias candidate removed (volatile)(byte) plex_free_next#2 = (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 Alias candidate removed (volatile)(byte) plex_sprite_idx#3 = (byte/word/dword~) plexShowSprite::$7 -Alias candidate removed (volatile)(byte) loop::y_idx#0 = (byte) loop::sin_idx#4 -Self Phi Eliminated (byte) loop::sin_idx#4 -Successful SSA optimization Pass2SelfPhiElimination -Redundant Phi (byte) loop::sin_idx#4 (byte) loop::sin_idx#6 -Successful SSA optimization Pass2RedundantPhiElimination Simple Condition (bool~) plexSort::$6 [21] if((byte) plexSort::s#1!=(byte/word/signed word/dword/signed dword) $ff) goto plexSort::@8 Simple Condition (bool~) plex_irq::$3 [95] if((byte) plex_show_idx#16<(const byte) PLEX_COUNT#0) goto plex_irq::@9 -Simple Condition (bool~) plexSort::$7 [122] if((byte) plexSort::nxt_y#0<*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#1))) goto plexSort::@3 -Simple Condition (bool~) plex_irq::$5 [123] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte/signed word/word/dword/signed dword~) plex_irq::$4) goto plex_irq::@3 +Simple Condition (bool~) plexSort::$7 [119] if((byte) plexSort::nxt_y#0<*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#1))) goto plexSort::@3 +Simple Condition (bool~) plex_irq::$5 [120] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte/signed word/word/dword/signed dword~) plex_irq::$4) goto plex_irq::@3 Successful SSA optimization Pass2ConditionalJumpSimplification Alias candidate removed (volatile)(byte) plex_free_next#2 = (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 Alias candidate removed (volatile)(byte) plex_sprite_idx#3 = (byte/word/dword~) plexShowSprite::$7 -Alias candidate removed (volatile)(byte) loop::y_idx#0 = (byte) loop::sin_idx#6 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) init::xp#0 Inlining constant with var siblings (const byte) init::sx#0 Inlining constant with var siblings (const byte) init::ss#0 +Inlining constant with var siblings (const byte) loop::sin_idx#0 Inlining constant with var siblings (const byte) loop::sy#0 Constant inlined init::xp#0 = (byte/signed byte/word/signed word/dword/signed dword) $20 Constant inlined plexInit::$1 = (const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1 @@ -1778,6 +1771,7 @@ Constant inlined plexSort::m#0 = (byte/signed byte/word/signed word/dword/signed Constant inlined init::$3 = &interrupt(KERNEL_MIN)(void()) plex_irq() Constant inlined $0 = (word/signed word/dword/signed dword) $400+(word/signed word/dword/signed dword) $3f8 Constant inlined init::$1 = (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 +Constant inlined loop::sin_idx#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined init::$0 = (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0 Constant inlined init::$6 = ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) $40 Constant inlined init::$5 = (const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) $40 @@ -1807,38 +1801,37 @@ Adding NOP phi() at start of plexInit::plexSetScreen1 CALL GRAPH Calls in [] to main:9 Calls in [main] to init:12 loop:14 -Calls in [loop] to plexSort:31 -Calls in [init] to plexInit:69 -Calls in [plex_irq] to plexShowSprite:106 +Calls in [loop] to plexSort:28 +Calls in [init] to plexInit:66 +Calls in [plex_irq] to plexShowSprite:103 Created 16 initial phi equivalence classes -Coalesced [17] framedone#30 ← framedone#19 -Coalesced [18] loop::sin_idx#10 ← loop::sin_idx#0 -Coalesced [23] loop::y_idx#4 ← loop::y_idx#0 -Coalesced [36] framedone#31 ← framedone#5 -Coalesced [37] loop::sin_idx#11 ← loop::sin_idx#1 -Coalesced [38] loop::y_idx#3 ← loop::y_idx#1 -Coalesced [39] loop::sy#3 ← loop::sy#1 -Not coalescing [45] plexSort::s#6 ← plexSort::m#2 -Coalesced [64] plexSort::plexFreePrepare1_s#3 ← plexSort::plexFreePrepare1_s#1 -Coalesced [65] plexSort::m#7 ← plexSort::m#1 -Coalesced [67] plexSort::s#5 ← plexSort::s#1 -Coalesced [89] init::ss#3 ← init::ss#1 -Coalesced [90] init::sx#3 ← init::sx#1 -Coalesced [91] init::xp#3 ← init::xp#1 -Coalesced [99] plexInit::i#3 ← plexInit::i#1 -Coalesced [101] plex_sprite_idx#55 ← plex_sprite_idx#0 -Coalesced [102] plex_show_idx#55 ← plex_show_idx#0 -Coalesced [103] plex_free_next#51 ← plex_free_next#31 -Coalesced [104] plex_sprite_msb#55 ← plex_sprite_msb#0 -Coalesced [117] plex_sprite_idx#56 ← plex_sprite_idx#3 -Coalesced [118] plex_show_idx#56 ← plex_show_idx#16 -Coalesced [119] plex_free_next#52 ← plex_free_next#2 -Coalesced [120] plex_sprite_msb#56 ← plex_sprite_msb#17 -Coalesced [128] plex_free_next#2 ← plexShowSprite::plexFreeAdd1_$2#0 -Coalesced [139] plex_sprite_idx#3 ← plexShowSprite::$7 -Coalesced [144] plex_sprite_msb#58 ← plex_sprite_msb#4 -Coalesced [147] plex_sprite_msb#57 ← plex_sprite_msb#27 +Coalesced [16] framedone#30 ← framedone#19 +Not coalescing [20] loop::y_idx#4 ← loop::sin_idx#6 +Coalesced [33] framedone#31 ← framedone#5 +Coalesced [34] loop::sin_idx#10 ← loop::sin_idx#1 +Coalesced [35] loop::y_idx#3 ← loop::y_idx#1 +Coalesced [36] loop::sy#3 ← loop::sy#1 +Not coalescing [42] 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 [64] 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 +Coalesced [96] plexInit::i#3 ← plexInit::i#1 +Coalesced [98] plex_sprite_idx#55 ← plex_sprite_idx#0 +Coalesced [99] plex_show_idx#55 ← plex_show_idx#0 +Coalesced [100] plex_free_next#51 ← plex_free_next#31 +Coalesced [101] plex_sprite_msb#55 ← plex_sprite_msb#0 +Coalesced [114] plex_sprite_idx#56 ← plex_sprite_idx#3 +Coalesced [115] plex_show_idx#56 ← plex_show_idx#16 +Coalesced [116] plex_free_next#52 ← plex_free_next#2 +Coalesced [117] plex_sprite_msb#56 ← plex_sprite_msb#17 +Coalesced [125] plex_free_next#2 ← plexShowSprite::plexFreeAdd1_$2#0 +Coalesced [136] plex_sprite_idx#3 ← plexShowSprite::$7 +Coalesced [141] plex_sprite_msb#58 ← plex_sprite_msb#4 +Coalesced [144] plex_sprite_msb#57 ← plex_sprite_msb#27 Coalesced down to 15 phi equivalence classes Culled Empty Block (label) loop::@16 Culled Empty Block (label) plexSort::@12 @@ -1871,6 +1864,7 @@ Adding NOP phi() at start of @begin Adding NOP phi() at start of @5 Adding NOP phi() at start of @end Adding NOP phi() at start of main::@1 +Adding NOP phi() at start of loop Adding NOP phi() at start of plexSort Adding NOP phi() at start of plexSort::plexFreePrepare1 Adding NOP phi() at start of plexInit @@ -1922,10 +1916,10 @@ main::@return: scope:[main] from main::@1 [15] return to:@return loop: scope:[loop] from main::@1 - [16] (byte) loop::sin_idx#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 + [16] phi() to:loop::@1 loop::@1: scope:[loop] from loop loop::@6 - [17] (byte) loop::sin_idx#6 ← phi( loop/(byte) loop::sin_idx#0 loop::@6/(byte) loop::sin_idx#1 ) + [17] (byte) loop::sin_idx#6 ← phi( loop/(byte/signed byte/word/signed word/dword/signed dword) 0 loop::@6/(byte) loop::sin_idx#1 ) [17] (bool) framedone#12 ← phi( loop/(bool) framedone#19 loop::@6/(bool) framedone#5 ) to:loop::@2 loop::@2: scope:[loop] from loop::@1 loop::@2 @@ -1933,11 +1927,11 @@ loop::@2: scope:[loop] from loop::@1 loop::@2 to:loop::@2 loop::@3: scope:[loop] from loop::@2 [19] *((const byte*) BORDERCOL#0) ← (const byte) RED#0 - [20] (byte) loop::y_idx#0 ← (byte) loop::sin_idx#6 + [20] (byte~) loop::y_idx#4 ← (byte) loop::sin_idx#6 to:loop::@4 loop::@4: scope:[loop] from loop::@3 loop::@4 [21] (byte) loop::sy#2 ← phi( loop::@4/(byte) loop::sy#1 loop::@3/(byte/signed byte/word/signed word/dword/signed dword) 0 ) - [21] (byte) loop::y_idx#2 ← phi( loop::@4/(byte) loop::y_idx#1 loop::@3/(byte) loop::y_idx#0 ) + [21] (byte) loop::y_idx#2 ← phi( loop::@4/(byte) loop::y_idx#1 loop::@3/(byte~) loop::y_idx#4 ) [22] *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) loop::sy#2) ← *((const byte*) YSIN#0 + (byte) loop::y_idx#2) [23] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte/signed byte/word/signed word/dword/signed dword) 8 [24] (byte) loop::sy#1 ← ++ (byte) loop::sy#2 @@ -2238,16 +2232,15 @@ VARIABLE REGISTER WEIGHTS (word) init::xp#2 8.25 (void()) loop() (byte) loop::sin_idx -(byte) loop::sin_idx#0 4.0 (byte) loop::sin_idx#1 3.142857142857143 -(byte) loop::sin_idx#6 3.8888888888888893 +(byte) loop::sin_idx#6 3.666666666666667 (byte) loop::sy (byte) loop::sy#1 151.5 (byte) loop::sy#2 101.0 (byte) loop::y_idx -(byte) loop::y_idx#0 22.0 (byte) loop::y_idx#1 67.33333333333333 (byte) loop::y_idx#2 157.0 +(byte~) loop::y_idx#4 22.0 (void()) main() (void()) plexInit((byte*) plexInit::screen) (byte) plexInit::i @@ -2320,8 +2313,8 @@ interrupt(KERNEL_MIN)(void()) plex_irq() Initial phi equivalence classes [ framedone#12 framedone#19 framedone#5 ] -[ loop::sin_idx#6 loop::sin_idx#0 loop::sin_idx#1 ] -[ loop::y_idx#2 loop::y_idx#1 loop::y_idx#0 ] +[ loop::sin_idx#6 loop::sin_idx#1 ] +[ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] [ loop::sy#2 loop::sy#1 ] [ plexSort::m#2 plexSort::m#1 ] [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] @@ -2356,8 +2349,8 @@ Added variable plexShowSprite::$10 to zero page equivalence class [ plexShowSpri Added variable plexShowSprite::$6 to zero page equivalence class [ plexShowSprite::$6 ] Complete equivalence classes [ framedone#12 framedone#19 framedone#5 ] -[ loop::sin_idx#6 loop::sin_idx#0 loop::sin_idx#1 ] -[ loop::y_idx#2 loop::y_idx#1 loop::y_idx#0 ] +[ loop::sin_idx#6 loop::sin_idx#1 ] +[ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] [ loop::sy#2 loop::sy#1 ] [ plexSort::m#2 plexSort::m#1 ] [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] @@ -2391,8 +2384,8 @@ Complete equivalence classes [ plexShowSprite::$10 ] [ plexShowSprite::$6 ] Allocated zp ZP_BOOL:2 [ framedone#12 framedone#19 framedone#5 ] -Allocated zp ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#0 loop::sin_idx#1 ] -Allocated zp ZP_BYTE:4 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#0 ] +Allocated zp ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#1 ] +Allocated zp ZP_BYTE:4 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] Allocated zp ZP_BYTE:5 [ loop::sy#2 loop::sy#1 ] Allocated zp ZP_BYTE:6 [ plexSort::m#2 plexSort::m#1 ] Allocated zp ZP_BYTE:7 [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] @@ -2538,30 +2531,28 @@ main: { //SEG24 main::@1 b1: //SEG25 [14] call loop + //SEG26 [16] phi from main::@1 to loop [phi:main::@1->loop] + loop_from_b1: jsr loop jmp breturn - //SEG26 main::@return + //SEG27 main::@return breturn: - //SEG27 [15] return + //SEG28 [15] return rts } -//SEG28 loop +//SEG29 loop // The raster loop loop: { - .label sin_idx = 3 .label y_idx = 4 .label sy = 5 - //SEG29 [16] (byte) loop::sin_idx#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 - // The current index into the y-sinus + .label sin_idx = 3 + //SEG30 [17] phi from loop to loop::@1 [phi:loop->loop::@1] + b1_from_loop: + //SEG31 [17] phi (byte) loop::sin_idx#6 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:loop->loop::@1#0] -- vbuz1=vbuc1 lda #0 sta sin_idx - //SEG30 [17] phi from loop loop::@6 to loop::@1 [phi:loop/loop::@6->loop::@1] - b1_from_loop: - b1_from_b6: - //SEG31 [17] phi (byte) loop::sin_idx#6 = (byte) loop::sin_idx#0 [phi:loop/loop::@6->loop::@1#0] -- register_copy - //SEG32 [17] phi (bool) framedone#12 = (bool) framedone#19 [phi:loop/loop::@6->loop::@1#1] -- register_copy + //SEG32 [17] phi (bool) framedone#12 = (bool) framedone#19 [phi:loop->loop::@1#1] -- register_copy jmp b1 - // without volatile gives wrong asm //SEG33 loop::@1 b1: jmp b2 @@ -2577,8 +2568,7 @@ loop: { //SEG37 [19] *((const byte*) BORDERCOL#0) ← (const byte) RED#0 -- _deref_pbuc1=vbuc2 lda #RED sta BORDERCOL - //SEG38 [20] (byte) loop::y_idx#0 ← (byte) loop::sin_idx#6 -- vbuz1=vbuz2 - // Assign sinus positions + //SEG38 [20] (byte~) loop::y_idx#4 ← (byte) loop::sin_idx#6 -- vbuz1=vbuz2 lda sin_idx sta y_idx //SEG39 [21] phi from loop::@3 to loop::@4 [phi:loop::@3->loop::@4] @@ -2586,9 +2576,8 @@ loop: { //SEG40 [21] phi (byte) loop::sy#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:loop::@3->loop::@4#0] -- vbuz1=vbuc1 lda #0 sta sy - //SEG41 [21] phi (byte) loop::y_idx#2 = (byte) loop::y_idx#0 [phi:loop::@3->loop::@4#1] -- register_copy + //SEG41 [21] phi (byte) loop::y_idx#2 = (byte~) loop::y_idx#4 [phi:loop::@3->loop::@4#1] -- register_copy jmp b4 - // without volatile gives wrong asm //SEG42 [21] phi from loop::@4 to loop::@4 [phi:loop::@4->loop::@4] b4_from_b4: //SEG43 [21] phi (byte) loop::sy#2 = (byte) loop::sy#1 [phi:loop::@4->loop::@4#0] -- register_copy @@ -2638,9 +2627,13 @@ loop: { //SEG59 [32] *((const byte*) RASTER#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2 lda #0 sta RASTER - jmp b1_from_b6 + //SEG60 [17] phi from loop::@6 to loop::@1 [phi:loop::@6->loop::@1] + b1_from_b6: + //SEG61 [17] phi (byte) loop::sin_idx#6 = (byte) loop::sin_idx#1 [phi:loop::@6->loop::@1#0] -- register_copy + //SEG62 [17] phi (bool) framedone#12 = (bool) framedone#5 [phi:loop::@6->loop::@1#1] -- register_copy + jmp b1 } -//SEG60 plexSort +//SEG63 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: @@ -2657,129 +2650,129 @@ plexSort: { .label s = 7 .label s_2 = $14 .label plexFreePrepare1_s = 8 - //SEG61 [34] phi from plexSort to plexSort::@1 [phi:plexSort->plexSort::@1] + //SEG64 [34] phi from plexSort to plexSort::@1 [phi:plexSort->plexSort::@1] b1_from_plexSort: - //SEG62 [34] phi (byte) plexSort::m#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexSort->plexSort::@1#0] -- vbuz1=vbuc1 + //SEG65 [34] phi (byte) plexSort::m#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexSort->plexSort::@1#0] -- vbuz1=vbuc1 lda #0 sta m jmp b1 - //SEG63 [34] phi from plexSort::@2 to plexSort::@1 [phi:plexSort::@2->plexSort::@1] + //SEG66 [34] phi from plexSort::@2 to plexSort::@1 [phi:plexSort::@2->plexSort::@1] b1_from_b2: - //SEG64 [34] phi (byte) plexSort::m#2 = (byte) plexSort::m#1 [phi:plexSort::@2->plexSort::@1#0] -- register_copy + //SEG67 [34] phi (byte) plexSort::m#2 = (byte) plexSort::m#1 [phi:plexSort::@2->plexSort::@1#0] -- register_copy jmp b1 - //SEG65 plexSort::@1 + //SEG68 plexSort::@1 b1: - //SEG66 [35] (byte) plexSort::nxt_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) plexSort::m#2) -- vbuz1=pbuc1_derefidx_vbuz2 + //SEG69 [35] (byte) plexSort::nxt_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) plexSort::m#2) -- vbuz1=pbuc1_derefidx_vbuz2 ldy m lda PLEX_SORTED_IDX+1,y sta nxt_idx - //SEG67 [36] (byte) plexSort::nxt_y#0 ← *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) plexSort::nxt_idx#0) -- vbuz1=pbuc1_derefidx_vbuz2 + //SEG70 [36] (byte) plexSort::nxt_y#0 ← *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) plexSort::nxt_idx#0) -- vbuz1=pbuc1_derefidx_vbuz2 ldy nxt_idx lda PLEX_YPOS,y sta nxt_y - //SEG68 [37] if((byte) plexSort::nxt_y#0>=*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::m#2))) goto plexSort::@2 -- vbuz1_ge_pbuc1_derefidx_pbuc2_derefidx_vbuz2_then_la1 + //SEG71 [37] if((byte) plexSort::nxt_y#0>=*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::m#2))) goto plexSort::@2 -- vbuz1_ge_pbuc1_derefidx_pbuc2_derefidx_vbuz2_then_la1 lda nxt_y ldx m ldy PLEX_SORTED_IDX,x cmp PLEX_YPOS,y bcs b2 jmp b7 - //SEG69 plexSort::@7 + //SEG72 plexSort::@7 b7: - //SEG70 [38] (byte~) plexSort::s#6 ← (byte) plexSort::m#2 -- vbuz1=vbuz2 + //SEG73 [38] (byte~) plexSort::s#6 ← (byte) plexSort::m#2 -- vbuz1=vbuz2 lda m sta s - //SEG71 [39] phi from plexSort::@6 plexSort::@7 to plexSort::@3 [phi:plexSort::@6/plexSort::@7->plexSort::@3] + //SEG74 [39] phi from plexSort::@6 plexSort::@7 to plexSort::@3 [phi:plexSort::@6/plexSort::@7->plexSort::@3] b3_from_b6: b3_from_b7: - //SEG72 [39] phi (byte) plexSort::s#3 = (byte) plexSort::s#1 [phi:plexSort::@6/plexSort::@7->plexSort::@3#0] -- register_copy + //SEG75 [39] phi (byte) plexSort::s#3 = (byte) plexSort::s#1 [phi:plexSort::@6/plexSort::@7->plexSort::@3#0] -- register_copy jmp b3 - //SEG73 plexSort::@3 + //SEG76 plexSort::@3 b3: - //SEG74 [40] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) plexSort::s#3) ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#3) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 + //SEG77 [40] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) plexSort::s#3) ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#3) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_vbuz1 ldy s lda PLEX_SORTED_IDX,y sta PLEX_SORTED_IDX+1,y - //SEG75 [41] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 -- vbuz1=_dec_vbuz1 + //SEG78 [41] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 -- vbuz1=_dec_vbuz1 dec s - //SEG76 [42] if((byte) plexSort::s#1!=(byte/word/signed word/dword/signed dword) $ff) goto plexSort::@6 -- vbuz1_neq_vbuc1_then_la1 + //SEG79 [42] if((byte) plexSort::s#1!=(byte/word/signed word/dword/signed dword) $ff) goto plexSort::@6 -- vbuz1_neq_vbuc1_then_la1 lda #$ff cmp s bne b6 jmp b4 - //SEG77 plexSort::@4 + //SEG80 plexSort::@4 b4: - //SEG78 [43] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 -- vbuz1=_inc_vbuz2 + //SEG81 [43] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 -- vbuz1=_inc_vbuz2 ldy s iny sty s_2 - //SEG79 [44] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 -- pbuc1_derefidx_vbuz1=vbuz2 + //SEG82 [44] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 -- pbuc1_derefidx_vbuz1=vbuz2 lda nxt_idx ldy s_2 sta PLEX_SORTED_IDX,y jmp b2 - //SEG80 plexSort::@2 + //SEG83 plexSort::@2 b2: - //SEG81 [45] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 -- vbuz1=_inc_vbuz1 + //SEG84 [45] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 -- vbuz1=_inc_vbuz1 inc m - //SEG82 [46] if((byte) plexSort::m#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 2+(byte/signed byte/word/signed word/dword/signed dword) 1) goto plexSort::@1 -- vbuz1_neq_vbuc1_then_la1 + //SEG85 [46] if((byte) plexSort::m#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 2+(byte/signed byte/word/signed word/dword/signed dword) 1) goto plexSort::@1 -- vbuz1_neq_vbuc1_then_la1 lda #PLEX_COUNT-2+1 cmp m bne b1_from_b2 jmp b5 - //SEG83 plexSort::@5 + //SEG86 plexSort::@5 b5: - //SEG84 [47] (byte) plex_show_idx#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 + //SEG87 [47] (byte) plex_show_idx#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 // Prepare for showing the sprites lda #0 sta plex_show_idx_1 - //SEG85 [48] (byte) plex_sprite_idx#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 + //SEG88 [48] (byte) plex_sprite_idx#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 lda #0 sta plex_sprite_idx_1 - //SEG86 [49] (byte) plex_sprite_msb#1 ← (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuc1 + //SEG89 [49] (byte) plex_sprite_msb#1 ← (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuc1 lda #1 sta plex_sprite_msb_1 - //SEG87 [50] phi from plexSort::@5 to plexSort::plexFreePrepare1 [phi:plexSort::@5->plexSort::plexFreePrepare1] + //SEG90 [50] phi from plexSort::@5 to plexSort::plexFreePrepare1 [phi:plexSort::@5->plexSort::plexFreePrepare1] plexFreePrepare1_from_b5: jmp plexFreePrepare1 - //SEG88 plexSort::plexFreePrepare1 + //SEG91 plexSort::plexFreePrepare1 plexFreePrepare1: - //SEG89 [51] phi from plexSort::plexFreePrepare1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1] + //SEG92 [51] phi from plexSort::plexFreePrepare1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1] plexFreePrepare1_b1_from_plexFreePrepare1: - //SEG90 [51] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1#0] -- vbuz1=vbuc1 + //SEG93 [51] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1#0] -- vbuz1=vbuc1 lda #0 sta plexFreePrepare1_s jmp plexFreePrepare1_b1 - //SEG91 [51] phi from plexSort::plexFreePrepare1_@1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1] + //SEG94 [51] phi from plexSort::plexFreePrepare1_@1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1] plexFreePrepare1_b1_from_plexFreePrepare1_b1: - //SEG92 [51] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) plexSort::plexFreePrepare1_s#1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1#0] -- register_copy + //SEG95 [51] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) plexSort::plexFreePrepare1_s#1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1#0] -- register_copy jmp plexFreePrepare1_b1 - //SEG93 plexSort::plexFreePrepare1_@1 + //SEG96 plexSort::plexFreePrepare1_@1 plexFreePrepare1_b1: - //SEG94 [52] *((const byte[8]) PLEX_FREE_YPOS#0 + (byte) plexSort::plexFreePrepare1_s#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- pbuc1_derefidx_vbuz1=vbuc2 + //SEG97 [52] *((const byte[8]) PLEX_FREE_YPOS#0 + (byte) plexSort::plexFreePrepare1_s#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- pbuc1_derefidx_vbuz1=vbuc2 lda #0 ldy plexFreePrepare1_s sta PLEX_FREE_YPOS,y - //SEG95 [53] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 -- vbuz1=_inc_vbuz1 + //SEG98 [53] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 -- vbuz1=_inc_vbuz1 inc plexFreePrepare1_s - //SEG96 [54] if((byte) plexSort::plexFreePrepare1_s#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto plexSort::plexFreePrepare1_@1 -- vbuz1_neq_vbuc1_then_la1 + //SEG99 [54] if((byte) plexSort::plexFreePrepare1_s#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto plexSort::plexFreePrepare1_@1 -- vbuz1_neq_vbuc1_then_la1 lda #8 cmp plexFreePrepare1_s bne plexFreePrepare1_b1_from_plexFreePrepare1_b1 jmp plexFreePrepare1_b2 - //SEG97 plexSort::plexFreePrepare1_@2 + //SEG100 plexSort::plexFreePrepare1_@2 plexFreePrepare1_b2: - //SEG98 [55] (byte) plex_free_next#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 + //SEG101 [55] (byte) plex_free_next#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 lda #0 sta plex_free_next jmp breturn - //SEG99 plexSort::@return + //SEG102 plexSort::@return breturn: - //SEG100 [56] return + //SEG103 [56] return rts - //SEG101 plexSort::@6 + //SEG104 plexSort::@6 b6: - //SEG102 [57] if((byte) plexSort::nxt_y#0<*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#1))) goto plexSort::@3 -- vbuz1_lt_pbuc1_derefidx_pbuc2_derefidx_vbuz2_then_la1 + //SEG105 [57] if((byte) plexSort::nxt_y#0<*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#1))) goto plexSort::@3 -- vbuz1_lt_pbuc1_derefidx_pbuc2_derefidx_vbuz2_then_la1 lda nxt_y ldx s ldy PLEX_SORTED_IDX,x @@ -2787,53 +2780,53 @@ plexSort: { bcc b3_from_b6 jmp b4 } -//SEG103 init +//SEG106 init // Initialize the program init: { .label _7 = $19 .label xp = $a .label sx = 9 .label ss = $c - //SEG104 [58] *((const byte*) D011#0) ← (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 -- _deref_pbuc1=vbuc2 + //SEG107 [58] *((const byte*) D011#0) ← (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 -- _deref_pbuc1=vbuc2 lda #VIC_DEN|VIC_RSEL|3 sta D011 - //SEG105 [59] call plexInit - //SEG106 [79] phi from init to plexInit [phi:init->plexInit] + //SEG108 [59] call plexInit + //SEG109 [79] phi from init to plexInit [phi:init->plexInit] plexInit_from_init: jsr plexInit - //SEG107 [60] phi from init to init::@1 [phi:init->init::@1] + //SEG110 [60] phi from init to init::@1 [phi:init->init::@1] b1_from_init: - //SEG108 [60] phi (word) init::xp#2 = (byte/signed byte/word/signed word/dword/signed dword) $20 [phi:init->init::@1#0] -- vwuz1=vbuc1 + //SEG111 [60] phi (word) init::xp#2 = (byte/signed byte/word/signed word/dword/signed dword) $20 [phi:init->init::@1#0] -- vwuz1=vbuc1 lda #$20 sta xp lda #0 sta xp+1 - //SEG109 [60] phi (byte) init::sx#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:init->init::@1#1] -- vbuz1=vbuc1 + //SEG112 [60] phi (byte) init::sx#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:init->init::@1#1] -- vbuz1=vbuc1 lda #0 sta sx jmp b1 - //SEG110 [60] phi from init::@1 to init::@1 [phi:init::@1->init::@1] + //SEG113 [60] phi from init::@1 to init::@1 [phi:init::@1->init::@1] b1_from_b1: - //SEG111 [60] phi (word) init::xp#2 = (word) init::xp#1 [phi:init::@1->init::@1#0] -- register_copy - //SEG112 [60] phi (byte) init::sx#2 = (byte) init::sx#1 [phi:init::@1->init::@1#1] -- register_copy + //SEG114 [60] phi (word) init::xp#2 = (word) init::xp#1 [phi:init::@1->init::@1#0] -- register_copy + //SEG115 [60] phi (byte) init::sx#2 = (byte) init::sx#1 [phi:init::@1->init::@1#1] -- register_copy jmp b1 - //SEG113 init::@1 + //SEG116 init::@1 b1: - //SEG114 [61] *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + (byte) init::sx#2) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) $40 -- pbuc1_derefidx_vbuz1=vbuc2 + //SEG117 [61] *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + (byte) init::sx#2) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) $40 -- pbuc1_derefidx_vbuz1=vbuc2 lda #$ff&SPRITE/$40 ldy sx sta PLEX_PTR,y - //SEG115 [62] (byte~) init::$7 ← (byte) init::sx#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_rol_1 + //SEG118 [62] (byte~) init::$7 ← (byte) init::sx#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_rol_1 lda sx asl sta _7 - //SEG116 [63] *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte~) init::$7) ← (word) init::xp#2 -- pwuc1_derefidx_vbuz1=vwuz2 + //SEG119 [63] *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte~) init::$7) ← (word) init::xp#2 -- pwuc1_derefidx_vbuz1=vwuz2 ldy _7 lda xp sta PLEX_XPOS,y lda xp+1 sta PLEX_XPOS+1,y - //SEG117 [64] (word) init::xp#1 ← (word) init::xp#2 + (byte/signed byte/word/signed word/dword/signed dword) 9 -- vwuz1=vwuz1_plus_vbuc1 + //SEG120 [64] (word) init::xp#1 ← (word) init::xp#2 + (byte/signed byte/word/signed word/dword/signed dword) 9 -- vwuz1=vwuz1_plus_vbuc1 lda #9 clc adc xp @@ -2841,187 +2834,187 @@ init: { bcc !+ inc xp+1 !: - //SEG118 [65] (byte) init::sx#1 ← ++ (byte) init::sx#2 -- vbuz1=_inc_vbuz1 + //SEG121 [65] (byte) init::sx#1 ← ++ (byte) init::sx#2 -- vbuz1=_inc_vbuz1 inc sx - //SEG119 [66] if((byte) init::sx#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto init::@1 -- vbuz1_neq_vbuc1_then_la1 + //SEG122 [66] if((byte) init::sx#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto init::@1 -- vbuz1_neq_vbuc1_then_la1 lda #PLEX_COUNT-1+1 cmp sx bne b1_from_b1 jmp b2 - //SEG120 init::@2 + //SEG123 init::@2 b2: - //SEG121 [67] *((const byte*) SPRITES_ENABLE#0) ← (byte/word/signed word/dword/signed dword) $ff -- _deref_pbuc1=vbuc2 + //SEG124 [67] *((const byte*) SPRITES_ENABLE#0) ← (byte/word/signed word/dword/signed dword) $ff -- _deref_pbuc1=vbuc2 // Enable & initialize sprites lda #$ff sta SPRITES_ENABLE - //SEG122 [68] phi from init::@2 to init::@3 [phi:init::@2->init::@3] + //SEG125 [68] phi from init::@2 to init::@3 [phi:init::@2->init::@3] b3_from_b2: - //SEG123 [68] phi (byte) init::ss#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:init::@2->init::@3#0] -- vbuz1=vbuc1 + //SEG126 [68] phi (byte) init::ss#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:init::@2->init::@3#0] -- vbuz1=vbuc1 lda #0 sta ss jmp b3 - //SEG124 [68] phi from init::@3 to init::@3 [phi:init::@3->init::@3] + //SEG127 [68] phi from init::@3 to init::@3 [phi:init::@3->init::@3] b3_from_b3: - //SEG125 [68] phi (byte) init::ss#2 = (byte) init::ss#1 [phi:init::@3->init::@3#0] -- register_copy + //SEG128 [68] phi (byte) init::ss#2 = (byte) init::ss#1 [phi:init::@3->init::@3#0] -- register_copy jmp b3 - //SEG126 init::@3 + //SEG129 init::@3 b3: - //SEG127 [69] *((const byte*) SPRITES_COLS#0 + (byte) init::ss#2) ← (const byte) GREEN#0 -- pbuc1_derefidx_vbuz1=vbuc2 + //SEG130 [69] *((const byte*) SPRITES_COLS#0 + (byte) init::ss#2) ← (const byte) GREEN#0 -- pbuc1_derefidx_vbuz1=vbuc2 lda #GREEN ldy ss sta SPRITES_COLS,y - //SEG128 [70] (byte) init::ss#1 ← ++ (byte) init::ss#2 -- vbuz1=_inc_vbuz1 + //SEG131 [70] (byte) init::ss#1 ← ++ (byte) init::ss#2 -- vbuz1=_inc_vbuz1 inc ss - //SEG129 [71] if((byte) init::ss#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto init::@3 -- vbuz1_neq_vbuc1_then_la1 + //SEG132 [71] if((byte) init::ss#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto init::@3 -- vbuz1_neq_vbuc1_then_la1 lda #8 cmp ss bne b3_from_b3 jmp b4 - //SEG130 init::@4 + //SEG133 init::@4 b4: - //SEG131 asm { sei } + //SEG134 asm { sei } // enable the interrupt sei - //SEG132 [73] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 -- _deref_pbuc1=vbuc2 + //SEG135 [73] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 -- _deref_pbuc1=vbuc2 lda #CIA_INTERRUPT_CLEAR sta CIA1_INTERRUPT - //SEG133 [74] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 + //SEG136 [74] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 lda #IRQ_RASTER sta IRQ_ENABLE - //SEG134 [75] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 + //SEG137 [75] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 lda #IRQ_RASTER sta IRQ_STATUS - //SEG135 [76] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) plex_irq() -- _deref_pptc1=pprc2 + //SEG138 [76] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) plex_irq() -- _deref_pptc1=pprc2 lda #plex_irq sta KERNEL_IRQ+1 - //SEG136 asm { cli } + //SEG139 asm { cli } cli jmp breturn - //SEG137 init::@return + //SEG140 init::@return breturn: - //SEG138 [78] return + //SEG141 [78] return rts } -//SEG139 plexInit +//SEG142 plexInit // Initialize the multiplexer data structures plexInit: { .label i = $d - //SEG140 [80] phi from plexInit to plexInit::plexSetScreen1 [phi:plexInit->plexInit::plexSetScreen1] + //SEG143 [80] phi from plexInit to plexInit::plexSetScreen1 [phi:plexInit->plexInit::plexSetScreen1] plexSetScreen1_from_plexInit: jmp plexSetScreen1 - //SEG141 plexInit::plexSetScreen1 + //SEG144 plexInit::plexSetScreen1 plexSetScreen1: - //SEG142 [81] phi from plexInit::plexSetScreen1 to plexInit::@1 [phi:plexInit::plexSetScreen1->plexInit::@1] + //SEG145 [81] phi from plexInit::plexSetScreen1 to plexInit::@1 [phi:plexInit::plexSetScreen1->plexInit::@1] b1_from_plexSetScreen1: - //SEG143 [81] phi (byte) plexInit::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexInit::plexSetScreen1->plexInit::@1#0] -- vbuz1=vbuc1 + //SEG146 [81] phi (byte) plexInit::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexInit::plexSetScreen1->plexInit::@1#0] -- vbuz1=vbuc1 lda #0 sta i jmp b1 - //SEG144 [81] phi from plexInit::@1 to plexInit::@1 [phi:plexInit::@1->plexInit::@1] + //SEG147 [81] phi from plexInit::@1 to plexInit::@1 [phi:plexInit::@1->plexInit::@1] b1_from_b1: - //SEG145 [81] phi (byte) plexInit::i#2 = (byte) plexInit::i#1 [phi:plexInit::@1->plexInit::@1#0] -- register_copy + //SEG148 [81] phi (byte) plexInit::i#2 = (byte) plexInit::i#1 [phi:plexInit::@1->plexInit::@1#0] -- register_copy jmp b1 - //SEG146 plexInit::@1 + //SEG149 plexInit::@1 b1: - //SEG147 [82] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexInit::i#2) ← (byte) plexInit::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 + //SEG150 [82] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexInit::i#2) ← (byte) plexInit::i#2 -- pbuc1_derefidx_vbuz1=vbuz1 ldy i tya sta PLEX_SORTED_IDX,y - //SEG148 [83] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2 -- vbuz1=_inc_vbuz1 + //SEG151 [83] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2 -- vbuz1=_inc_vbuz1 inc i - //SEG149 [84] if((byte) plexInit::i#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto plexInit::@1 -- vbuz1_neq_vbuc1_then_la1 + //SEG152 [84] if((byte) plexInit::i#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto plexInit::@1 -- vbuz1_neq_vbuc1_then_la1 lda #PLEX_COUNT-1+1 cmp i bne b1_from_b1 jmp breturn - //SEG150 plexInit::@return + //SEG153 plexInit::@return breturn: - //SEG151 [85] return + //SEG154 [85] return rts } -//SEG152 plex_irq +//SEG155 plex_irq plex_irq: { .label _4 = $1b .label plexFreeNextYpos1_return = $1a - //SEG153 entry interrupt(KERNEL_MIN) - //SEG154 [86] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 + //SEG156 entry interrupt(KERNEL_MIN) + //SEG157 [86] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 lda #WHITE sta BORDERCOL - //SEG155 [87] phi from plex_irq plex_irq::@7 to plex_irq::@3 [phi:plex_irq/plex_irq::@7->plex_irq::@3] + //SEG158 [87] 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: - //SEG156 [87] phi (byte) plex_sprite_msb#29 = (byte) plex_sprite_msb#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#0] -- register_copy - //SEG157 [87] phi (byte) plex_free_next#27 = (byte) plex_free_next#31 [phi:plex_irq/plex_irq::@7->plex_irq::@3#1] -- register_copy - //SEG158 [87] phi (byte) plex_show_idx#27 = (byte) plex_show_idx#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#2] -- register_copy - //SEG159 [87] phi (byte) plex_sprite_idx#25 = (byte) plex_sprite_idx#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#3] -- register_copy + //SEG159 [87] phi (byte) plex_sprite_msb#29 = (byte) plex_sprite_msb#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#0] -- register_copy + //SEG160 [87] phi (byte) plex_free_next#27 = (byte) plex_free_next#31 [phi:plex_irq/plex_irq::@7->plex_irq::@3#1] -- register_copy + //SEG161 [87] phi (byte) plex_show_idx#27 = (byte) plex_show_idx#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#2] -- register_copy + //SEG162 [87] phi (byte) plex_sprite_idx#25 = (byte) plex_sprite_idx#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#3] -- register_copy jmp b3 - //SEG160 plex_irq::@3 + //SEG163 plex_irq::@3 b3: - //SEG161 [88] call plexShowSprite + //SEG164 [88] call plexShowSprite jsr plexShowSprite jmp plexFreeNextYpos1 - //SEG162 plex_irq::plexFreeNextYpos1 + //SEG165 plex_irq::plexFreeNextYpos1 plexFreeNextYpos1: - //SEG163 [89] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte[8]) PLEX_FREE_YPOS#0 + (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0) -- vbuz1=pbuc1_derefidx_vbuz2 + //SEG166 [89] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte[8]) PLEX_FREE_YPOS#0 + (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0) -- vbuz1=pbuc1_derefidx_vbuz2 ldy plexShowSprite.plexFreeAdd1__2 lda PLEX_FREE_YPOS,y sta plexFreeNextYpos1_return jmp b6 - //SEG164 plex_irq::@6 + //SEG167 plex_irq::@6 b6: - //SEG165 [90] (byte/signed word/word/dword/signed dword~) plex_irq::$4 ← *((const byte*) RASTER#0) + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuz1=_deref_pbuc1_plus_2 + //SEG168 [90] (byte/signed word/word/dword/signed dword~) plex_irq::$4 ← *((const byte*) RASTER#0) + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuz1=_deref_pbuc1_plus_2 lda RASTER clc adc #2 sta _4 - //SEG166 [91] if((byte) plex_show_idx#16<(const byte) PLEX_COUNT#0) goto plex_irq::@7 -- vbuz1_lt_vbuc1_then_la1 + //SEG169 [91] if((byte) plex_show_idx#16<(const byte) PLEX_COUNT#0) goto plex_irq::@7 -- vbuz1_lt_vbuc1_then_la1 lda plex_show_idx cmp #PLEX_COUNT bcc b7 jmp b4 - //SEG167 plex_irq::@4 + //SEG170 plex_irq::@4 b4: - //SEG168 [92] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 + //SEG171 [92] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 lda #IRQ_RASTER sta IRQ_STATUS - //SEG169 [93] if((byte) plex_show_idx#16<(const byte) PLEX_COUNT#0) goto plex_irq::@1 -- vbuz1_lt_vbuc1_then_la1 + //SEG172 [93] if((byte) plex_show_idx#16<(const byte) PLEX_COUNT#0) goto plex_irq::@1 -- vbuz1_lt_vbuc1_then_la1 lda plex_show_idx cmp #PLEX_COUNT bcc b1 jmp b5 - //SEG170 plex_irq::@5 + //SEG173 plex_irq::@5 b5: - //SEG171 [94] (bool) framedone#3 ← true -- vboz1=vboc1 + //SEG174 [94] (bool) framedone#3 ← true -- vboz1=vboc1 lda #1 sta framedone jmp b2 - //SEG172 plex_irq::@2 + //SEG175 plex_irq::@2 b2: - //SEG173 [95] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2 + //SEG176 [95] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2 lda #0 sta BORDERCOL jmp breturn - //SEG174 plex_irq::@return + //SEG177 plex_irq::@return breturn: - //SEG175 [96] return - exit interrupt(KERNEL_MIN) + //SEG178 [96] return - exit interrupt(KERNEL_MIN) jmp $ea81 - //SEG176 plex_irq::@1 + //SEG179 plex_irq::@1 b1: - //SEG177 [97] *((const byte*) RASTER#0) ← (byte) plex_irq::plexFreeNextYpos1_return#0 -- _deref_pbuc1=vbuz1 + //SEG180 [97] *((const byte*) RASTER#0) ← (byte) plex_irq::plexFreeNextYpos1_return#0 -- _deref_pbuc1=vbuz1 lda plexFreeNextYpos1_return sta RASTER jmp b2 - //SEG178 plex_irq::@7 + //SEG181 plex_irq::@7 b7: - //SEG179 [98] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte/signed word/word/dword/signed dword~) plex_irq::$4) goto plex_irq::@3 -- vbuz1_lt_vbuz2_then_la1 + //SEG182 [98] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte/signed word/word/dword/signed dword~) plex_irq::$4) goto plex_irq::@3 -- vbuz1_lt_vbuz2_then_la1 lda plexFreeNextYpos1_return cmp _4 bcc b3_from_b7 jmp b4 } -//SEG180 plexShowSprite +//SEG183 plexShowSprite // Show the next sprite. // plexSort() prepares showing the sprites plexShowSprite: { @@ -3036,116 +3029,116 @@ plexShowSprite: { .label plexFreeAdd1__1 = $20 .label plexFreeAdd1__2 = $10 .label xpos_idx = $21 - //SEG181 [99] (byte) plexShowSprite::plex_sprite_idx2#0 ← (byte) plex_sprite_idx#25 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_rol_1 + //SEG184 [99] (byte) plexShowSprite::plex_sprite_idx2#0 ← (byte) plex_sprite_idx#25 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_rol_1 lda plex_sprite_idx asl sta plex_sprite_idx2 - //SEG182 [100] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27)) -- vbuz1=pbuc1_derefidx_pbuc2_derefidx_vbuz2 + //SEG185 [100] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27)) -- vbuz1=pbuc1_derefidx_pbuc2_derefidx_vbuz2 ldx plex_show_idx ldy PLEX_SORTED_IDX,x ldx PLEX_YPOS,y stx plexFreeAdd1_ypos - //SEG183 [101] *((const byte*) SPRITES_YPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 -- pbuc1_derefidx_vbuz1=vbuz2 + //SEG186 [101] *((const byte*) SPRITES_YPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 -- pbuc1_derefidx_vbuz1=vbuz2 lda plexFreeAdd1_ypos ldy plex_sprite_idx2 sta SPRITES_YPOS,y jmp plexFreeAdd1 - //SEG184 plexShowSprite::plexFreeAdd1 + //SEG187 plexShowSprite::plexFreeAdd1 plexFreeAdd1: - //SEG185 [102] (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$0#0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte/signed byte/word/signed word/dword/signed dword) $15 -- vbuz1=vbuz2_plus_vbuc1 + //SEG188 [102] (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$0#0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte/signed byte/word/signed word/dword/signed dword) $15 -- vbuz1=vbuz2_plus_vbuc1 lax plexFreeAdd1_ypos axs #-[$15] stx plexFreeAdd1__0 - //SEG186 [103] *((const byte[8]) PLEX_FREE_YPOS#0 + (byte) plex_free_next#27) ← (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$0#0 -- pbuc1_derefidx_vbuz1=vbuz2 + //SEG189 [103] *((const byte[8]) PLEX_FREE_YPOS#0 + (byte) plex_free_next#27) ← (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$0#0 -- pbuc1_derefidx_vbuz1=vbuz2 lda plexFreeAdd1__0 ldy plex_free_next_27 sta PLEX_FREE_YPOS,y - //SEG187 [104] (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$1#0 ← (byte) plex_free_next#27 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_plus_1 + //SEG190 [104] (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$1#0 ← (byte) plex_free_next#27 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_plus_1 ldy plex_free_next_27 iny sty plexFreeAdd1__1 - //SEG188 [105] (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 ← (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$1#0 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuz1=vbuz2_band_vbuc1 + //SEG191 [105] (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 ← (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$1#0 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuz1=vbuz2_band_vbuc1 lda #7 and plexFreeAdd1__1 sta plexFreeAdd1__2 jmp b5 - //SEG189 plexShowSprite::@5 + //SEG192 plexShowSprite::@5 b5: - //SEG190 [106] *((const byte*) PLEX_SCREEN_PTR#0 + (byte) plex_sprite_idx#25) ← *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27)) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_pbuc3_derefidx_vbuz2 + //SEG193 [106] *((const byte*) PLEX_SCREEN_PTR#0 + (byte) plex_sprite_idx#25) ← *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27)) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_pbuc3_derefidx_vbuz2 ldx plex_show_idx ldy PLEX_SORTED_IDX,x lda PLEX_PTR,y ldx plex_sprite_idx sta PLEX_SCREEN_PTR,x - //SEG191 [107] (byte) plexShowSprite::xpos_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27) << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=pbuc1_derefidx_vbuz2_rol_1 + //SEG194 [107] (byte) plexShowSprite::xpos_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27) << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=pbuc1_derefidx_vbuz2_rol_1 ldy plex_show_idx lda PLEX_SORTED_IDX,y asl sta xpos_idx - //SEG192 [108] (byte~) plexShowSprite::$3 ← < *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::xpos_idx#0) -- vbuz1=_lo_pwuc1_derefidx_vbuz2 + //SEG195 [108] (byte~) plexShowSprite::$3 ← < *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::xpos_idx#0) -- vbuz1=_lo_pwuc1_derefidx_vbuz2 ldy xpos_idx lda PLEX_XPOS,y sta _3 - //SEG193 [109] *((const byte*) SPRITES_XPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$3 -- pbuc1_derefidx_vbuz1=vbuz2 + //SEG196 [109] *((const byte*) SPRITES_XPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$3 -- pbuc1_derefidx_vbuz1=vbuz2 lda _3 ldy plex_sprite_idx2 sta SPRITES_XPOS,y - //SEG194 [110] (byte~) plexShowSprite::$4 ← > *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::xpos_idx#0) -- vbuz1=_hi_pwuc1_derefidx_vbuz2 + //SEG197 [110] (byte~) plexShowSprite::$4 ← > *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::xpos_idx#0) -- vbuz1=_hi_pwuc1_derefidx_vbuz2 ldy xpos_idx lda PLEX_XPOS+1,y sta _4 - //SEG195 [111] if((byte~) plexShowSprite::$4!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@1 -- vbuz1_neq_0_then_la1 + //SEG198 [111] if((byte~) plexShowSprite::$4!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@1 -- vbuz1_neq_0_then_la1 lda _4 cmp #0 bne b1 jmp b3 - //SEG196 plexShowSprite::@3 + //SEG199 plexShowSprite::@3 b3: - //SEG197 [112] (byte/word/dword~) plexShowSprite::$10 ← (byte/word/signed word/dword/signed dword) $ff ^ (byte) plex_sprite_msb#29 -- vbuz1=vbuc1_bxor_vbuz2 + //SEG200 [112] (byte/word/dword~) plexShowSprite::$10 ← (byte/word/signed word/dword/signed dword) $ff ^ (byte) plex_sprite_msb#29 -- vbuz1=vbuc1_bxor_vbuz2 lda plex_sprite_msb eor #$ff sta _10 - //SEG198 [113] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte/word/dword~) plexShowSprite::$10 -- _deref_pbuc1=_deref_pbuc1_band_vbuz1 + //SEG201 [113] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte/word/dword~) plexShowSprite::$10 -- _deref_pbuc1=_deref_pbuc1_band_vbuz1 lda SPRITES_XMSB and _10 sta SPRITES_XMSB jmp b2 - //SEG199 plexShowSprite::@2 + //SEG202 plexShowSprite::@2 b2: - //SEG200 [114] (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 ← (byte) plex_sprite_idx#25 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_plus_1 + //SEG203 [114] (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 ← (byte) plex_sprite_idx#25 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_plus_1 ldy plex_sprite_idx iny sty _6 - //SEG201 [115] (byte/word/dword~) plexShowSprite::$7 ← (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuz1=vbuz2_band_vbuc1 + //SEG204 [115] (byte/word/dword~) plexShowSprite::$7 ← (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuz1=vbuz2_band_vbuc1 lda #7 and _6 sta _7 - //SEG202 [116] (byte) plex_show_idx#16 ← ++ (byte) plex_show_idx#27 -- vbuz1=_inc_vbuz1 + //SEG205 [116] (byte) plex_show_idx#16 ← ++ (byte) plex_show_idx#27 -- vbuz1=_inc_vbuz1 inc plex_show_idx - //SEG203 [117] (byte) plex_sprite_msb#27 ← (byte) plex_sprite_msb#29 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_rol_1 + //SEG206 [117] (byte) plex_sprite_msb#27 ← (byte) plex_sprite_msb#29 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_rol_1 asl plex_sprite_msb - //SEG204 [118] if((byte) plex_sprite_msb#27!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@return -- vbuz1_neq_0_then_la1 + //SEG207 [118] if((byte) plex_sprite_msb#27!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@return -- vbuz1_neq_0_then_la1 lda plex_sprite_msb cmp #0 bne breturn_from_b2 jmp b4 - //SEG205 plexShowSprite::@4 + //SEG208 plexShowSprite::@4 b4: - //SEG206 [119] (byte) plex_sprite_msb#4 ← (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuc1 + //SEG209 [119] (byte) plex_sprite_msb#4 ← (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuc1 lda #1 sta plex_sprite_msb - //SEG207 [120] phi from plexShowSprite::@2 plexShowSprite::@4 to plexShowSprite::@return [phi:plexShowSprite::@2/plexShowSprite::@4->plexShowSprite::@return] + //SEG210 [120] phi from plexShowSprite::@2 plexShowSprite::@4 to plexShowSprite::@return [phi:plexShowSprite::@2/plexShowSprite::@4->plexShowSprite::@return] breturn_from_b2: breturn_from_b4: - //SEG208 [120] phi (byte) plex_sprite_msb#17 = (byte) plex_sprite_msb#27 [phi:plexShowSprite::@2/plexShowSprite::@4->plexShowSprite::@return#0] -- register_copy + //SEG211 [120] phi (byte) plex_sprite_msb#17 = (byte) plex_sprite_msb#27 [phi:plexShowSprite::@2/plexShowSprite::@4->plexShowSprite::@return#0] -- register_copy jmp breturn - //SEG209 plexShowSprite::@return + //SEG212 plexShowSprite::@return breturn: - //SEG210 [121] return + //SEG213 [121] return rts - //SEG211 plexShowSprite::@1 + //SEG214 plexShowSprite::@1 b1: - //SEG212 [122] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) plex_sprite_msb#29 -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 + //SEG215 [122] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) plex_sprite_msb#29 -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 lda SPRITES_XMSB ora plex_sprite_msb sta SPRITES_XMSB @@ -3181,14 +3174,13 @@ Statement [2] (byte) plex_sprite_idx#0 ← (byte/signed byte/word/signed word/dw Statement [3] (byte) plex_sprite_msb#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( ) always clobbers reg byte a Statement [4] (byte) plex_free_next#31 ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( ) always clobbers reg byte a Statement [7] (bool) framedone#19 ← true [ framedone#19 ] ( ) always clobbers reg byte a -Statement [16] (byte) loop::sin_idx#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ framedone#19 loop::sin_idx#0 ] ( main:9::loop:14 [ framedone#19 loop::sin_idx#0 ] ) always clobbers reg byte a Statement [18] if((bool) framedone#12) goto loop::@3 [ framedone#12 loop::sin_idx#6 ] ( main:9::loop:14 [ framedone#12 loop::sin_idx#6 ] ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#1 ] Statement [19] *((const byte*) BORDERCOL#0) ← (const byte) RED#0 [ loop::sin_idx#6 ] ( main:9::loop:14 [ loop::sin_idx#6 ] ) always clobbers reg byte a -Statement [20] (byte) loop::y_idx#0 ← (byte) loop::sin_idx#6 [ loop::sin_idx#6 loop::y_idx#0 ] ( main:9::loop:14 [ loop::sin_idx#6 loop::y_idx#0 ] ) always clobbers reg byte a Statement [22] *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) loop::sy#2) ← *((const byte*) YSIN#0 + (byte) loop::y_idx#2) [ loop::sin_idx#6 loop::y_idx#2 loop::sy#2 ] ( main:9::loop:14 [ loop::sin_idx#6 loop::y_idx#2 loop::sy#2 ] ) always clobbers reg byte a +Removing always clobbered register reg byte a as potential for zp ZP_BYTE:4 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] Removing always clobbered register reg byte a as potential for zp ZP_BYTE:5 [ loop::sy#2 loop::sy#1 ] -Statement [23] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte/signed byte/word/signed word/dword/signed dword) 8 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ( main:9::loop:14 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ) always clobbers reg byte a reg byte x -Removing always clobbered register reg byte x as potential for zp ZP_BYTE:5 [ loop::sy#2 loop::sy#1 ] +Statement [23] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte/signed byte/word/signed word/dword/signed dword) 8 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ( main:9::loop:14 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ) always clobbers reg byte a Statement [29] *((const byte*) BORDERCOL#0) ← (const byte) GREEN#0 [ loop::sin_idx#1 ] ( main:9::loop:14 [ loop::sin_idx#1 ] ) always clobbers reg byte a Statement [30] (bool) framedone#5 ← false [ framedone#5 loop::sin_idx#1 ] ( main:9::loop:14 [ framedone#5 loop::sin_idx#1 ] ) always clobbers reg byte a Statement [31] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) & (byte/signed byte/word/signed word/dword/signed dword) $7f [ framedone#5 loop::sin_idx#1 ] ( main:9::loop:14 [ framedone#5 loop::sin_idx#1 ] ) always clobbers reg byte a @@ -3253,12 +3245,10 @@ Statement [2] (byte) plex_sprite_idx#0 ← (byte/signed byte/word/signed word/dw Statement [3] (byte) plex_sprite_msb#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( ) always clobbers reg byte a Statement [4] (byte) plex_free_next#31 ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( ) always clobbers reg byte a Statement [7] (bool) framedone#19 ← true [ framedone#19 ] ( ) always clobbers reg byte a -Statement [16] (byte) loop::sin_idx#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ framedone#19 loop::sin_idx#0 ] ( main:9::loop:14 [ framedone#19 loop::sin_idx#0 ] ) always clobbers reg byte a Statement [18] if((bool) framedone#12) goto loop::@3 [ framedone#12 loop::sin_idx#6 ] ( main:9::loop:14 [ framedone#12 loop::sin_idx#6 ] ) always clobbers reg byte a Statement [19] *((const byte*) BORDERCOL#0) ← (const byte) RED#0 [ loop::sin_idx#6 ] ( main:9::loop:14 [ loop::sin_idx#6 ] ) always clobbers reg byte a -Statement [20] (byte) loop::y_idx#0 ← (byte) loop::sin_idx#6 [ loop::sin_idx#6 loop::y_idx#0 ] ( main:9::loop:14 [ loop::sin_idx#6 loop::y_idx#0 ] ) always clobbers reg byte a Statement [22] *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) loop::sy#2) ← *((const byte*) YSIN#0 + (byte) loop::y_idx#2) [ loop::sin_idx#6 loop::y_idx#2 loop::sy#2 ] ( main:9::loop:14 [ loop::sin_idx#6 loop::y_idx#2 loop::sy#2 ] ) always clobbers reg byte a -Statement [23] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte/signed byte/word/signed word/dword/signed dword) 8 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ( main:9::loop:14 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ) always clobbers reg byte a reg byte x +Statement [23] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte/signed byte/word/signed word/dword/signed dword) 8 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ( main:9::loop:14 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ) always clobbers reg byte a Statement [29] *((const byte*) BORDERCOL#0) ← (const byte) GREEN#0 [ loop::sin_idx#1 ] ( main:9::loop:14 [ loop::sin_idx#1 ] ) always clobbers reg byte a Statement [30] (bool) framedone#5 ← false [ framedone#5 loop::sin_idx#1 ] ( main:9::loop:14 [ framedone#5 loop::sin_idx#1 ] ) always clobbers reg byte a Statement [31] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) & (byte/signed byte/word/signed word/dword/signed dword) $7f [ framedone#5 loop::sin_idx#1 ] ( main:9::loop:14 [ framedone#5 loop::sin_idx#1 ] ) always clobbers reg byte a @@ -3312,12 +3302,10 @@ Statement [2] (byte) plex_sprite_idx#0 ← (byte/signed byte/word/signed word/dw Statement [3] (byte) plex_sprite_msb#0 ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ ] ( ) always clobbers reg byte a Statement [4] (byte) plex_free_next#31 ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ ] ( ) always clobbers reg byte a Statement [7] (bool) framedone#19 ← true [ framedone#19 ] ( ) always clobbers reg byte a -Statement [16] (byte) loop::sin_idx#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 [ framedone#19 loop::sin_idx#0 ] ( main:9::loop:14 [ framedone#19 loop::sin_idx#0 ] ) always clobbers reg byte a Statement [18] if((bool) framedone#12) goto loop::@3 [ framedone#12 loop::sin_idx#6 ] ( main:9::loop:14 [ framedone#12 loop::sin_idx#6 ] ) always clobbers reg byte a Statement [19] *((const byte*) BORDERCOL#0) ← (const byte) RED#0 [ loop::sin_idx#6 ] ( main:9::loop:14 [ loop::sin_idx#6 ] ) always clobbers reg byte a -Statement [20] (byte) loop::y_idx#0 ← (byte) loop::sin_idx#6 [ loop::sin_idx#6 loop::y_idx#0 ] ( main:9::loop:14 [ loop::sin_idx#6 loop::y_idx#0 ] ) always clobbers reg byte a Statement [22] *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) loop::sy#2) ← *((const byte*) YSIN#0 + (byte) loop::y_idx#2) [ loop::sin_idx#6 loop::y_idx#2 loop::sy#2 ] ( main:9::loop:14 [ loop::sin_idx#6 loop::y_idx#2 loop::sy#2 ] ) always clobbers reg byte a -Statement [23] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte/signed byte/word/signed word/dword/signed dword) 8 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ( main:9::loop:14 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ) always clobbers reg byte a reg byte x +Statement [23] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte/signed byte/word/signed word/dword/signed dword) 8 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ( main:9::loop:14 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ) always clobbers reg byte a Statement [29] *((const byte*) BORDERCOL#0) ← (const byte) GREEN#0 [ loop::sin_idx#1 ] ( main:9::loop:14 [ loop::sin_idx#1 ] ) always clobbers reg byte a Statement [30] (bool) framedone#5 ← false [ framedone#5 loop::sin_idx#1 ] ( main:9::loop:14 [ framedone#5 loop::sin_idx#1 ] ) always clobbers reg byte a Statement [31] *((const byte*) VIC_CONTROL#0) ← *((const byte*) VIC_CONTROL#0) & (byte/signed byte/word/signed word/dword/signed dword) $7f [ framedone#5 loop::sin_idx#1 ] ( main:9::loop:14 [ framedone#5 loop::sin_idx#1 ] ) always clobbers reg byte a @@ -3366,9 +3354,9 @@ Statement [118] if((byte) plex_sprite_msb#27!=(byte/signed byte/word/signed word Statement [119] (byte) plex_sprite_msb#4 ← (byte/signed byte/word/signed word/dword/signed dword) 1 [ plexShowSprite::$7 plex_show_idx#16 plexShowSprite::plexFreeAdd1_$2#0 plex_sprite_msb#4 ] ( plexShowSprite:88 [ plexShowSprite::$7 plex_show_idx#16 plexShowSprite::plexFreeAdd1_$2#0 plex_sprite_msb#4 ] ) always clobbers reg byte a Statement [122] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) plex_sprite_msb#29 [ plex_sprite_idx#25 plex_show_idx#27 plex_sprite_msb#29 plexShowSprite::plexFreeAdd1_$2#0 ] ( plexShowSprite:88 [ plex_sprite_idx#25 plex_show_idx#27 plex_sprite_msb#29 plexShowSprite::plexFreeAdd1_$2#0 ] ) always clobbers reg byte a Potential registers zp ZP_BOOL:2 [ framedone#12 framedone#19 framedone#5 ] : zp ZP_BOOL:2 , -Potential registers zp ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#0 loop::sin_idx#1 ] : zp ZP_BYTE:3 , -Potential registers zp ZP_BYTE:4 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#0 ] : zp ZP_BYTE:4 , -Potential registers zp ZP_BYTE:5 [ loop::sy#2 loop::sy#1 ] : zp ZP_BYTE:5 , reg byte y , +Potential registers zp ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#1 ] : zp ZP_BYTE:3 , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:4 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] : zp ZP_BYTE:4 , reg byte x , reg byte y , +Potential registers zp ZP_BYTE:5 [ loop::sy#2 loop::sy#1 ] : zp ZP_BYTE:5 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:6 [ plexSort::m#2 plexSort::m#1 ] : zp ZP_BYTE:6 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:7 [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] : zp ZP_BYTE:7 , reg byte x , reg byte y , Potential registers zp ZP_BYTE:8 [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] : zp ZP_BYTE:8 , reg byte x , reg byte y , @@ -3403,7 +3391,7 @@ Potential registers zp ZP_BYTE:37 [ plexShowSprite::$6 ] : zp ZP_BYTE:37 , reg b REGISTER UPLIFT SCOPES Uplift Scope [plexSort] 3,622.83: zp ZP_BYTE:7 [ plexSort::s#3 plexSort::s#1 plexSort::s#6 ] 303: zp ZP_BYTE:8 [ plexSort::plexFreePrepare1_s#2 plexSort::plexFreePrepare1_s#1 ] 202: zp ZP_BYTE:20 [ plexSort::s#2 ] 193.58: zp ZP_BYTE:6 [ plexSort::m#2 plexSort::m#1 ] 150.38: zp ZP_BYTE:19 [ plexSort::nxt_y#0 ] 30.3: zp ZP_BYTE:18 [ plexSort::nxt_idx#0 ] -Uplift Scope [loop] 252.5: zp ZP_BYTE:5 [ loop::sy#2 loop::sy#1 ] 246.33: zp ZP_BYTE:4 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#0 ] 11.03: zp ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#0 loop::sin_idx#1 ] +Uplift Scope [loop] 252.5: zp ZP_BYTE:5 [ loop::sy#2 loop::sy#1 ] 246.33: zp ZP_BYTE:4 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] 6.81: zp ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#1 ] Uplift Scope [] 65: zp ZP_BOOL:2 [ framedone#12 framedone#19 framedone#5 ] 20: zp ZP_BYTE:21 [ plex_show_idx#1 ] 20: zp ZP_BYTE:22 [ plex_sprite_idx#1 ] 20: zp ZP_BYTE:23 [ plex_sprite_msb#1 ] 20: zp ZP_BYTE:24 [ plex_free_next#0 ] 20: zp ZP_BOOL:28 [ framedone#3 ] 14.09: zp ZP_BYTE:17 [ plex_sprite_msb#29 plex_sprite_msb#0 plex_sprite_msb#17 plex_sprite_msb#27 plex_sprite_msb#4 ] 7.88: zp ZP_BYTE:16 [ plex_free_next#27 plex_free_next#31 plexShowSprite::plexFreeAdd1_$2#0 ] 7.27: zp ZP_BYTE:15 [ plex_show_idx#27 plex_show_idx#0 plex_show_idx#16 ] 6.2: zp ZP_BYTE:14 [ plex_sprite_idx#25 plex_sprite_idx#0 plexShowSprite::$7 ] Uplift Scope [init] 33: zp ZP_BYTE:12 [ init::ss#2 init::ss#1 ] 25.3: zp ZP_BYTE:9 [ init::sx#2 init::sx#1 ] 22: zp ZP_BYTE:25 [ init::$7 ] 15.58: zp ZP_WORD:10 [ init::xp#2 init::xp#1 ] Uplift Scope [plexInit] 38.5: zp ZP_BYTE:13 [ plexInit::i#2 plexInit::i#1 ] @@ -3411,78 +3399,77 @@ Uplift Scope [plexShowSprite] 4: zp ZP_BYTE:31 [ plexShowSprite::plexFreeAdd1_$0 Uplift Scope [plex_irq] 11: zp ZP_BYTE:27 [ plex_irq::$4 ] 4: zp ZP_BYTE:26 [ plex_irq::plexFreeNextYpos1_return#0 ] Uplift Scope [main] -Uplifting [plexSort] best 60831 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 ZP_BYTE:20 [ plexSort::s#2 ] zp ZP_BYTE:6 [ plexSort::m#2 plexSort::m#1 ] zp ZP_BYTE:19 [ plexSort::nxt_y#0 ] zp ZP_BYTE:18 [ plexSort::nxt_idx#0 ] +Uplifting [plexSort] best 60876 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 ZP_BYTE:20 [ plexSort::s#2 ] zp ZP_BYTE:6 [ plexSort::m#2 plexSort::m#1 ] zp ZP_BYTE:19 [ plexSort::nxt_y#0 ] zp ZP_BYTE:18 [ plexSort::nxt_idx#0 ] Limited combination testing to 10 combinations of 972 possible. -Uplifting [loop] best 59631 combination reg byte y [ loop::sy#2 loop::sy#1 ] zp ZP_BYTE:4 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#0 ] zp ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#0 loop::sin_idx#1 ] -Uplifting [] best 59631 combination zp ZP_BOOL:2 [ framedone#12 framedone#19 framedone#5 ] zp ZP_BYTE:21 [ plex_show_idx#1 ] zp ZP_BYTE:22 [ plex_sprite_idx#1 ] zp ZP_BYTE:23 [ plex_sprite_msb#1 ] zp ZP_BYTE:24 [ plex_free_next#0 ] zp ZP_BOOL:28 [ framedone#3 ] zp ZP_BYTE:17 [ plex_sprite_msb#29 plex_sprite_msb#0 plex_sprite_msb#17 plex_sprite_msb#27 plex_sprite_msb#4 ] zp ZP_BYTE:16 [ plex_free_next#27 plex_free_next#31 plexShowSprite::plexFreeAdd1_$2#0 ] zp ZP_BYTE:15 [ plex_show_idx#27 plex_show_idx#0 plex_show_idx#16 ] zp ZP_BYTE:14 [ plex_sprite_idx#25 plex_sprite_idx#0 plexShowSprite::$7 ] -Uplifting [init] best 59381 combination reg byte x [ init::ss#2 init::ss#1 ] reg byte x [ init::sx#2 init::sx#1 ] zp ZP_BYTE:25 [ init::$7 ] zp ZP_WORD:10 [ init::xp#2 init::xp#1 ] +Uplifting [loop] best 58946 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 ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#1 ] +Limited combination testing to 10 combinations of 27 possible. +Uplifting [] best 58946 combination zp ZP_BOOL:2 [ framedone#12 framedone#19 framedone#5 ] zp ZP_BYTE:21 [ plex_show_idx#1 ] zp ZP_BYTE:22 [ plex_sprite_idx#1 ] zp ZP_BYTE:23 [ plex_sprite_msb#1 ] zp ZP_BYTE:24 [ plex_free_next#0 ] zp ZP_BOOL:28 [ framedone#3 ] zp ZP_BYTE:17 [ plex_sprite_msb#29 plex_sprite_msb#0 plex_sprite_msb#17 plex_sprite_msb#27 plex_sprite_msb#4 ] zp ZP_BYTE:16 [ plex_free_next#27 plex_free_next#31 plexShowSprite::plexFreeAdd1_$2#0 ] zp ZP_BYTE:15 [ plex_show_idx#27 plex_show_idx#0 plex_show_idx#16 ] zp ZP_BYTE:14 [ plex_sprite_idx#25 plex_sprite_idx#0 plexShowSprite::$7 ] +Uplifting [init] best 58696 combination reg byte x [ init::ss#2 init::ss#1 ] reg byte x [ init::sx#2 init::sx#1 ] zp ZP_BYTE:25 [ init::$7 ] zp ZP_WORD:10 [ init::xp#2 init::xp#1 ] Limited combination testing to 10 combinations of 36 possible. -Uplifting [plexInit] best 59261 combination reg byte x [ plexInit::i#2 plexInit::i#1 ] -Uplifting [plexShowSprite] best 59251 combination reg byte a [ plexShowSprite::plexFreeAdd1_$0#0 ] reg byte x [ plexShowSprite::plexFreeAdd1_$1#0 ] zp ZP_BYTE:34 [ plexShowSprite::$3 ] zp ZP_BYTE:35 [ plexShowSprite::$4 ] zp ZP_BYTE:36 [ plexShowSprite::$10 ] zp ZP_BYTE:37 [ plexShowSprite::$6 ] zp ZP_BYTE:30 [ plexShowSprite::plexFreeAdd1_ypos#0 ] zp ZP_BYTE:33 [ plexShowSprite::xpos_idx#0 ] zp ZP_BYTE:29 [ plexShowSprite::plex_sprite_idx2#0 ] +Uplifting [plexInit] best 58576 combination reg byte x [ plexInit::i#2 plexInit::i#1 ] +Uplifting [plexShowSprite] best 58566 combination reg byte a [ plexShowSprite::plexFreeAdd1_$0#0 ] reg byte x [ plexShowSprite::plexFreeAdd1_$1#0 ] zp ZP_BYTE:34 [ plexShowSprite::$3 ] zp ZP_BYTE:35 [ plexShowSprite::$4 ] zp ZP_BYTE:36 [ plexShowSprite::$10 ] zp ZP_BYTE:37 [ plexShowSprite::$6 ] zp ZP_BYTE:30 [ plexShowSprite::plexFreeAdd1_ypos#0 ] zp ZP_BYTE:33 [ plexShowSprite::xpos_idx#0 ] zp ZP_BYTE:29 [ plexShowSprite::plex_sprite_idx2#0 ] Limited combination testing to 10 combinations of 24576 possible. -Uplifting [plex_irq] best 59188 combination zp ZP_BYTE:27 [ plex_irq::$4 ] reg byte x [ plex_irq::plexFreeNextYpos1_return#0 ] -Uplifting [main] best 59188 combination -Attempting to uplift remaining variables inzp ZP_BYTE:4 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#0 ] -Uplifting [loop] best 59188 combination zp ZP_BYTE:4 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#0 ] +Uplifting [plex_irq] best 58503 combination zp ZP_BYTE:27 [ plex_irq::$4 ] reg byte x [ plex_irq::plexFreeNextYpos1_return#0 ] +Uplifting [main] best 58503 combination Attempting to uplift remaining variables inzp ZP_BYTE:20 [ plexSort::s#2 ] -Uplifting [plexSort] best 58588 combination reg byte x [ plexSort::s#2 ] +Uplifting [plexSort] best 57903 combination reg byte x [ plexSort::s#2 ] Attempting to uplift remaining variables inzp ZP_BYTE:6 [ plexSort::m#2 plexSort::m#1 ] -Uplifting [plexSort] best 58588 combination zp ZP_BYTE:6 [ plexSort::m#2 plexSort::m#1 ] +Uplifting [plexSort] best 57903 combination zp ZP_BYTE:6 [ plexSort::m#2 plexSort::m#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:19 [ plexSort::nxt_y#0 ] -Uplifting [plexSort] best 58588 combination zp ZP_BYTE:19 [ plexSort::nxt_y#0 ] +Uplifting [plexSort] best 57903 combination zp ZP_BYTE:19 [ plexSort::nxt_y#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:18 [ plexSort::nxt_idx#0 ] -Uplifting [plexSort] best 58588 combination zp ZP_BYTE:18 [ plexSort::nxt_idx#0 ] +Uplifting [plexSort] best 57903 combination zp ZP_BYTE:18 [ plexSort::nxt_idx#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:25 [ init::$7 ] -Uplifting [init] best 58548 combination reg byte a [ init::$7 ] +Uplifting [init] best 57863 combination reg byte a [ init::$7 ] Attempting to uplift remaining variables inzp ZP_BYTE:21 [ plex_show_idx#1 ] -Uplifting [] best 58548 combination zp ZP_BYTE:21 [ plex_show_idx#1 ] +Uplifting [] best 57863 combination zp ZP_BYTE:21 [ plex_show_idx#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:22 [ plex_sprite_idx#1 ] -Uplifting [] best 58548 combination zp ZP_BYTE:22 [ plex_sprite_idx#1 ] +Uplifting [] best 57863 combination zp ZP_BYTE:22 [ plex_sprite_idx#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:23 [ plex_sprite_msb#1 ] -Uplifting [] best 58548 combination zp ZP_BYTE:23 [ plex_sprite_msb#1 ] +Uplifting [] best 57863 combination zp ZP_BYTE:23 [ plex_sprite_msb#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:24 [ plex_free_next#0 ] -Uplifting [] best 58548 combination zp ZP_BYTE:24 [ plex_free_next#0 ] +Uplifting [] best 57863 combination zp ZP_BYTE:24 [ plex_free_next#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:17 [ plex_sprite_msb#29 plex_sprite_msb#0 plex_sprite_msb#17 plex_sprite_msb#27 plex_sprite_msb#4 ] -Uplifting [] best 58548 combination zp ZP_BYTE:17 [ plex_sprite_msb#29 plex_sprite_msb#0 plex_sprite_msb#17 plex_sprite_msb#27 plex_sprite_msb#4 ] -Attempting to uplift remaining variables inzp ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#0 loop::sin_idx#1 ] -Uplifting [loop] best 58548 combination zp ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#0 loop::sin_idx#1 ] +Uplifting [] best 57863 combination zp ZP_BYTE:17 [ plex_sprite_msb#29 plex_sprite_msb#0 plex_sprite_msb#17 plex_sprite_msb#27 plex_sprite_msb#4 ] Attempting to uplift remaining variables inzp ZP_BYTE:27 [ plex_irq::$4 ] -Uplifting [plex_irq] best 58548 combination zp ZP_BYTE:27 [ plex_irq::$4 ] +Uplifting [plex_irq] best 57863 combination zp ZP_BYTE:27 [ plex_irq::$4 ] Attempting to uplift remaining variables inzp ZP_BYTE:16 [ plex_free_next#27 plex_free_next#31 plexShowSprite::plexFreeAdd1_$2#0 ] -Uplifting [] best 58548 combination zp ZP_BYTE:16 [ plex_free_next#27 plex_free_next#31 plexShowSprite::plexFreeAdd1_$2#0 ] +Uplifting [] best 57863 combination zp ZP_BYTE:16 [ plex_free_next#27 plex_free_next#31 plexShowSprite::plexFreeAdd1_$2#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:15 [ plex_show_idx#27 plex_show_idx#0 plex_show_idx#16 ] -Uplifting [] best 58548 combination zp ZP_BYTE:15 [ plex_show_idx#27 plex_show_idx#0 plex_show_idx#16 ] +Uplifting [] best 57863 combination zp ZP_BYTE:15 [ plex_show_idx#27 plex_show_idx#0 plex_show_idx#16 ] +Attempting to uplift remaining variables inzp ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#1 ] +Uplifting [loop] best 57863 combination zp ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#1 ] Attempting to uplift remaining variables inzp ZP_BYTE:14 [ plex_sprite_idx#25 plex_sprite_idx#0 plexShowSprite::$7 ] -Uplifting [] best 58548 combination zp ZP_BYTE:14 [ plex_sprite_idx#25 plex_sprite_idx#0 plexShowSprite::$7 ] +Uplifting [] best 57863 combination zp ZP_BYTE:14 [ plex_sprite_idx#25 plex_sprite_idx#0 plexShowSprite::$7 ] Attempting to uplift remaining variables inzp ZP_BYTE:34 [ plexShowSprite::$3 ] -Uplifting [plexShowSprite] best 58542 combination reg byte a [ plexShowSprite::$3 ] +Uplifting [plexShowSprite] best 57857 combination reg byte a [ plexShowSprite::$3 ] Attempting to uplift remaining variables inzp ZP_BYTE:35 [ plexShowSprite::$4 ] -Uplifting [plexShowSprite] best 58536 combination reg byte a [ plexShowSprite::$4 ] +Uplifting [plexShowSprite] best 57851 combination reg byte a [ plexShowSprite::$4 ] Attempting to uplift remaining variables inzp ZP_BYTE:36 [ plexShowSprite::$10 ] -Uplifting [plexShowSprite] best 58530 combination reg byte a [ plexShowSprite::$10 ] +Uplifting [plexShowSprite] best 57845 combination reg byte a [ plexShowSprite::$10 ] Attempting to uplift remaining variables inzp ZP_BYTE:37 [ plexShowSprite::$6 ] -Uplifting [plexShowSprite] best 58524 combination reg byte x [ plexShowSprite::$6 ] +Uplifting [plexShowSprite] best 57839 combination reg byte x [ plexShowSprite::$6 ] Attempting to uplift remaining variables inzp ZP_BYTE:30 [ plexShowSprite::plexFreeAdd1_ypos#0 ] -Uplifting [plexShowSprite] best 58515 combination reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ] +Uplifting [plexShowSprite] best 57830 combination reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:33 [ plexShowSprite::xpos_idx#0 ] -Uplifting [plexShowSprite] best 58508 combination reg byte x [ plexShowSprite::xpos_idx#0 ] +Uplifting [plexShowSprite] best 57823 combination reg byte x [ plexShowSprite::xpos_idx#0 ] Attempting to uplift remaining variables inzp ZP_BYTE:29 [ plexShowSprite::plex_sprite_idx2#0 ] -Uplifting [plexShowSprite] best 58508 combination zp ZP_BYTE:29 [ plexShowSprite::plex_sprite_idx2#0 ] +Uplifting [plexShowSprite] best 57823 combination zp ZP_BYTE:29 [ plexShowSprite::plex_sprite_idx2#0 ] Coalescing zero page register [ zp ZP_BOOL:2 [ framedone#12 framedone#19 framedone#5 ] ] with [ zp ZP_BOOL:28 [ framedone#3 ] ] -Coalescing zero page register [ zp ZP_BYTE:6 [ plexSort::m#2 plexSort::m#1 ] ] with [ zp ZP_BYTE:27 [ plex_irq::$4 ] ] -Coalescing zero page register [ zp ZP_BYTE:6 [ plexSort::m#2 plexSort::m#1 plex_irq::$4 ] ] with [ zp ZP_BYTE:29 [ plexShowSprite::plex_sprite_idx2#0 ] ] Coalescing zero page register [ zp ZP_BYTE:15 [ plex_show_idx#27 plex_show_idx#0 plex_show_idx#16 ] ] with [ zp ZP_BYTE:21 [ plex_show_idx#1 ] ] Coalescing zero page register [ zp ZP_BYTE:17 [ plex_sprite_msb#29 plex_sprite_msb#0 plex_sprite_msb#17 plex_sprite_msb#27 plex_sprite_msb#4 ] ] with [ zp ZP_BYTE:23 [ plex_sprite_msb#1 ] ] -Allocated (was zp ZP_BYTE:6) zp ZP_BYTE:5 [ plexSort::m#2 plexSort::m#1 plex_irq::$4 plexShowSprite::plex_sprite_idx2#0 ] -Allocated (was zp ZP_WORD:10) zp ZP_WORD:6 [ init::xp#2 init::xp#1 ] -Allocated (was zp ZP_BYTE:14) zp ZP_BYTE:8 [ plex_sprite_idx#25 plex_sprite_idx#0 plexShowSprite::$7 ] -Allocated (was zp ZP_BYTE:15) zp ZP_BYTE:9 [ plex_show_idx#27 plex_show_idx#0 plex_show_idx#16 plex_show_idx#1 ] -Allocated (was zp ZP_BYTE:16) zp ZP_BYTE:10 [ plex_free_next#27 plex_free_next#31 plexShowSprite::plexFreeAdd1_$2#0 ] -Allocated (was zp ZP_BYTE:17) zp ZP_BYTE:11 [ plex_sprite_msb#29 plex_sprite_msb#0 plex_sprite_msb#17 plex_sprite_msb#27 plex_sprite_msb#4 plex_sprite_msb#1 ] -Allocated (was zp ZP_BYTE:18) zp ZP_BYTE:12 [ plexSort::nxt_idx#0 ] -Allocated (was zp ZP_BYTE:19) zp ZP_BYTE:13 [ plexSort::nxt_y#0 ] -Allocated (was zp ZP_BYTE:22) zp ZP_BYTE:14 [ plex_sprite_idx#1 ] -Allocated (was zp ZP_BYTE:24) zp ZP_BYTE:15 [ plex_free_next#0 ] +Coalescing zero page register [ zp ZP_BYTE:27 [ plex_irq::$4 ] ] with [ zp ZP_BYTE:29 [ plexShowSprite::plex_sprite_idx2#0 ] ] +Allocated (was zp ZP_BYTE:6) zp ZP_BYTE:4 [ plexSort::m#2 plexSort::m#1 ] +Allocated (was zp ZP_WORD:10) zp ZP_WORD:5 [ init::xp#2 init::xp#1 ] +Allocated (was zp ZP_BYTE:14) zp ZP_BYTE:7 [ plex_sprite_idx#25 plex_sprite_idx#0 plexShowSprite::$7 ] +Allocated (was zp ZP_BYTE:15) zp ZP_BYTE:8 [ plex_show_idx#27 plex_show_idx#0 plex_show_idx#16 plex_show_idx#1 ] +Allocated (was zp ZP_BYTE:16) zp ZP_BYTE:9 [ plex_free_next#27 plex_free_next#31 plexShowSprite::plexFreeAdd1_$2#0 ] +Allocated (was zp ZP_BYTE:17) zp ZP_BYTE:10 [ plex_sprite_msb#29 plex_sprite_msb#0 plex_sprite_msb#17 plex_sprite_msb#27 plex_sprite_msb#4 plex_sprite_msb#1 ] +Allocated (was zp ZP_BYTE:18) zp ZP_BYTE:11 [ plexSort::nxt_idx#0 ] +Allocated (was zp ZP_BYTE:19) zp ZP_BYTE:12 [ plexSort::nxt_y#0 ] +Allocated (was zp ZP_BYTE:22) zp ZP_BYTE:13 [ plex_sprite_idx#1 ] +Allocated (was zp ZP_BYTE:24) zp ZP_BYTE:14 [ plex_free_next#0 ] +Allocated (was zp ZP_BYTE:27) zp ZP_BYTE:15 [ plex_irq::$4 plexShowSprite::plex_sprite_idx2#0 ] ASSEMBLER BEFORE OPTIMIZATION //SEG0 File Comments @@ -3524,14 +3511,14 @@ ASSEMBLER BEFORE OPTIMIZATION .label YSIN = $2100 // The address of the sprite pointers on the current screen (screen+$3f8). .label PLEX_SCREEN_PTR = $400+$3f8 - .label plex_show_idx = 9 - .label plex_sprite_idx = 8 - .label plex_sprite_msb = $b - .label plex_sprite_idx_1 = $e - .label plex_free_next = $f + .label plex_show_idx = 8 + .label plex_sprite_idx = 7 + .label plex_sprite_msb = $a + .label plex_sprite_idx_1 = $d + .label plex_free_next = $e .label framedone = 2 - .label plex_free_next_27 = $a - .label plex_free_next_31 = $a + .label plex_free_next_27 = 9 + .label plex_free_next_31 = 9 //SEG3 @begin bbegin: jmp b1 @@ -3591,29 +3578,26 @@ main: { //SEG24 main::@1 b1: //SEG25 [14] call loop + //SEG26 [16] phi from main::@1 to loop [phi:main::@1->loop] + loop_from_b1: jsr loop jmp breturn - //SEG26 main::@return + //SEG27 main::@return breturn: - //SEG27 [15] return + //SEG28 [15] return rts } -//SEG28 loop +//SEG29 loop // The raster loop loop: { .label sin_idx = 3 - .label y_idx = 4 - //SEG29 [16] (byte) loop::sin_idx#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 - // The current index into the y-sinus + //SEG30 [17] phi from loop to loop::@1 [phi:loop->loop::@1] + b1_from_loop: + //SEG31 [17] phi (byte) loop::sin_idx#6 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:loop->loop::@1#0] -- vbuz1=vbuc1 lda #0 sta sin_idx - //SEG30 [17] phi from loop loop::@6 to loop::@1 [phi:loop/loop::@6->loop::@1] - b1_from_loop: - b1_from_b6: - //SEG31 [17] phi (byte) loop::sin_idx#6 = (byte) loop::sin_idx#0 [phi:loop/loop::@6->loop::@1#0] -- register_copy - //SEG32 [17] phi (bool) framedone#12 = (bool) framedone#19 [phi:loop/loop::@6->loop::@1#1] -- register_copy + //SEG32 [17] phi (bool) framedone#12 = (bool) framedone#19 [phi:loop->loop::@1#1] -- register_copy jmp b1 - // without volatile gives wrong asm //SEG33 loop::@1 b1: jmp b2 @@ -3629,17 +3613,14 @@ loop: { //SEG37 [19] *((const byte*) BORDERCOL#0) ← (const byte) RED#0 -- _deref_pbuc1=vbuc2 lda #RED sta BORDERCOL - //SEG38 [20] (byte) loop::y_idx#0 ← (byte) loop::sin_idx#6 -- vbuz1=vbuz2 - // Assign sinus positions - lda sin_idx - sta y_idx + //SEG38 [20] (byte~) loop::y_idx#4 ← (byte) loop::sin_idx#6 -- vbuxx=vbuz1 + ldx sin_idx //SEG39 [21] phi from loop::@3 to loop::@4 [phi:loop::@3->loop::@4] b4_from_b3: //SEG40 [21] phi (byte) loop::sy#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:loop::@3->loop::@4#0] -- vbuyy=vbuc1 ldy #0 - //SEG41 [21] phi (byte) loop::y_idx#2 = (byte) loop::y_idx#0 [phi:loop::@3->loop::@4#1] -- register_copy + //SEG41 [21] phi (byte) loop::y_idx#2 = (byte~) loop::y_idx#4 [phi:loop::@3->loop::@4#1] -- register_copy jmp b4 - // without volatile gives wrong asm //SEG42 [21] phi from loop::@4 to loop::@4 [phi:loop::@4->loop::@4] b4_from_b4: //SEG43 [21] phi (byte) loop::sy#2 = (byte) loop::sy#1 [phi:loop::@4->loop::@4#0] -- register_copy @@ -3647,14 +3628,12 @@ loop: { jmp b4 //SEG45 loop::@4 b4: - //SEG46 [22] *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) loop::sy#2) ← *((const byte*) YSIN#0 + (byte) loop::y_idx#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuz1 - ldx y_idx + //SEG46 [22] *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) loop::sy#2) ← *((const byte*) YSIN#0 + (byte) loop::y_idx#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuxx lda YSIN,x sta PLEX_YPOS,y - //SEG47 [23] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte/signed byte/word/signed word/dword/signed dword) 8 -- vbuz1=vbuz1_plus_vbuc1 - lax y_idx + //SEG47 [23] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte/signed byte/word/signed word/dword/signed dword) 8 -- vbuxx=vbuxx_plus_vbuc1 + txa axs #-[8] - stx y_idx //SEG48 [24] (byte) loop::sy#1 ← ++ (byte) loop::sy#2 -- vbuyy=_inc_vbuyy iny //SEG49 [25] if((byte) loop::sy#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto loop::@4 -- vbuyy_neq_vbuc1_then_la1 @@ -3687,9 +3666,13 @@ loop: { //SEG59 [32] *((const byte*) RASTER#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2 lda #0 sta RASTER - jmp b1_from_b6 + //SEG60 [17] phi from loop::@6 to loop::@1 [phi:loop::@6->loop::@1] + b1_from_b6: + //SEG61 [17] phi (byte) loop::sin_idx#6 = (byte) loop::sin_idx#1 [phi:loop::@6->loop::@1#0] -- register_copy + //SEG62 [17] phi (bool) framedone#12 = (bool) framedone#5 [phi:loop::@6->loop::@1#1] -- register_copy + jmp b1 } -//SEG60 plexSort +//SEG63 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: @@ -3700,170 +3683,170 @@ loop: { // 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 = $c - .label nxt_y = $d - .label m = 5 - //SEG61 [34] phi from plexSort to plexSort::@1 [phi:plexSort->plexSort::@1] + .label nxt_idx = $b + .label nxt_y = $c + .label m = 4 + //SEG64 [34] phi from plexSort to plexSort::@1 [phi:plexSort->plexSort::@1] b1_from_plexSort: - //SEG62 [34] phi (byte) plexSort::m#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexSort->plexSort::@1#0] -- vbuz1=vbuc1 + //SEG65 [34] phi (byte) plexSort::m#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexSort->plexSort::@1#0] -- vbuz1=vbuc1 lda #0 sta m jmp b1 - //SEG63 [34] phi from plexSort::@2 to plexSort::@1 [phi:plexSort::@2->plexSort::@1] + //SEG66 [34] phi from plexSort::@2 to plexSort::@1 [phi:plexSort::@2->plexSort::@1] b1_from_b2: - //SEG64 [34] phi (byte) plexSort::m#2 = (byte) plexSort::m#1 [phi:plexSort::@2->plexSort::@1#0] -- register_copy + //SEG67 [34] phi (byte) plexSort::m#2 = (byte) plexSort::m#1 [phi:plexSort::@2->plexSort::@1#0] -- register_copy jmp b1 - //SEG65 plexSort::@1 + //SEG68 plexSort::@1 b1: - //SEG66 [35] (byte) plexSort::nxt_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) plexSort::m#2) -- vbuz1=pbuc1_derefidx_vbuz2 + //SEG69 [35] (byte) plexSort::nxt_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) plexSort::m#2) -- vbuz1=pbuc1_derefidx_vbuz2 ldy m lda PLEX_SORTED_IDX+1,y sta nxt_idx - //SEG67 [36] (byte) plexSort::nxt_y#0 ← *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) plexSort::nxt_idx#0) -- vbuz1=pbuc1_derefidx_vbuz2 + //SEG70 [36] (byte) plexSort::nxt_y#0 ← *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) plexSort::nxt_idx#0) -- vbuz1=pbuc1_derefidx_vbuz2 ldy nxt_idx lda PLEX_YPOS,y sta nxt_y - //SEG68 [37] if((byte) plexSort::nxt_y#0>=*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::m#2))) goto plexSort::@2 -- vbuz1_ge_pbuc1_derefidx_pbuc2_derefidx_vbuz2_then_la1 + //SEG71 [37] if((byte) plexSort::nxt_y#0>=*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::m#2))) goto plexSort::@2 -- vbuz1_ge_pbuc1_derefidx_pbuc2_derefidx_vbuz2_then_la1 lda nxt_y ldx m ldy PLEX_SORTED_IDX,x cmp PLEX_YPOS,y bcs b2 jmp b7 - //SEG69 plexSort::@7 + //SEG72 plexSort::@7 b7: - //SEG70 [38] (byte~) plexSort::s#6 ← (byte) plexSort::m#2 -- vbuxx=vbuz1 + //SEG73 [38] (byte~) plexSort::s#6 ← (byte) plexSort::m#2 -- vbuxx=vbuz1 ldx m - //SEG71 [39] phi from plexSort::@6 plexSort::@7 to plexSort::@3 [phi:plexSort::@6/plexSort::@7->plexSort::@3] + //SEG74 [39] phi from plexSort::@6 plexSort::@7 to plexSort::@3 [phi:plexSort::@6/plexSort::@7->plexSort::@3] b3_from_b6: b3_from_b7: - //SEG72 [39] phi (byte) plexSort::s#3 = (byte) plexSort::s#1 [phi:plexSort::@6/plexSort::@7->plexSort::@3#0] -- register_copy + //SEG75 [39] phi (byte) plexSort::s#3 = (byte) plexSort::s#1 [phi:plexSort::@6/plexSort::@7->plexSort::@3#0] -- register_copy jmp b3 - //SEG73 plexSort::@3 + //SEG76 plexSort::@3 b3: - //SEG74 [40] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) plexSort::s#3) ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + //SEG77 [40] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) plexSort::s#3) ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda PLEX_SORTED_IDX,x sta PLEX_SORTED_IDX+1,x - //SEG75 [41] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 -- vbuxx=_dec_vbuxx + //SEG78 [41] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 -- vbuxx=_dec_vbuxx dex - //SEG76 [42] if((byte) plexSort::s#1!=(byte/word/signed word/dword/signed dword) $ff) goto plexSort::@6 -- vbuxx_neq_vbuc1_then_la1 + //SEG79 [42] if((byte) plexSort::s#1!=(byte/word/signed word/dword/signed dword) $ff) goto plexSort::@6 -- vbuxx_neq_vbuc1_then_la1 cpx #$ff bne b6 jmp b4 - //SEG77 plexSort::@4 + //SEG80 plexSort::@4 b4: - //SEG78 [43] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 -- vbuxx=_inc_vbuxx + //SEG81 [43] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 -- vbuxx=_inc_vbuxx inx - //SEG79 [44] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 -- pbuc1_derefidx_vbuxx=vbuz1 + //SEG82 [44] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 -- pbuc1_derefidx_vbuxx=vbuz1 lda nxt_idx sta PLEX_SORTED_IDX,x jmp b2 - //SEG80 plexSort::@2 + //SEG83 plexSort::@2 b2: - //SEG81 [45] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 -- vbuz1=_inc_vbuz1 + //SEG84 [45] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 -- vbuz1=_inc_vbuz1 inc m - //SEG82 [46] if((byte) plexSort::m#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 2+(byte/signed byte/word/signed word/dword/signed dword) 1) goto plexSort::@1 -- vbuz1_neq_vbuc1_then_la1 + //SEG85 [46] if((byte) plexSort::m#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 2+(byte/signed byte/word/signed word/dword/signed dword) 1) goto plexSort::@1 -- vbuz1_neq_vbuc1_then_la1 lda #PLEX_COUNT-2+1 cmp m bne b1_from_b2 jmp b5 - //SEG83 plexSort::@5 + //SEG86 plexSort::@5 b5: - //SEG84 [47] (byte) plex_show_idx#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 + //SEG87 [47] (byte) plex_show_idx#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 // Prepare for showing the sprites lda #0 sta plex_show_idx - //SEG85 [48] (byte) plex_sprite_idx#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 + //SEG88 [48] (byte) plex_sprite_idx#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 lda #0 sta plex_sprite_idx_1 - //SEG86 [49] (byte) plex_sprite_msb#1 ← (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuc1 + //SEG89 [49] (byte) plex_sprite_msb#1 ← (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuc1 lda #1 sta plex_sprite_msb - //SEG87 [50] phi from plexSort::@5 to plexSort::plexFreePrepare1 [phi:plexSort::@5->plexSort::plexFreePrepare1] + //SEG90 [50] phi from plexSort::@5 to plexSort::plexFreePrepare1 [phi:plexSort::@5->plexSort::plexFreePrepare1] plexFreePrepare1_from_b5: jmp plexFreePrepare1 - //SEG88 plexSort::plexFreePrepare1 + //SEG91 plexSort::plexFreePrepare1 plexFreePrepare1: - //SEG89 [51] phi from plexSort::plexFreePrepare1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1] + //SEG92 [51] phi from plexSort::plexFreePrepare1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1] plexFreePrepare1_b1_from_plexFreePrepare1: - //SEG90 [51] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1#0] -- vbuxx=vbuc1 + //SEG93 [51] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1#0] -- vbuxx=vbuc1 ldx #0 jmp plexFreePrepare1_b1 - //SEG91 [51] phi from plexSort::plexFreePrepare1_@1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1] + //SEG94 [51] phi from plexSort::plexFreePrepare1_@1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1] plexFreePrepare1_b1_from_plexFreePrepare1_b1: - //SEG92 [51] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) plexSort::plexFreePrepare1_s#1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1#0] -- register_copy + //SEG95 [51] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) plexSort::plexFreePrepare1_s#1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1#0] -- register_copy jmp plexFreePrepare1_b1 - //SEG93 plexSort::plexFreePrepare1_@1 + //SEG96 plexSort::plexFreePrepare1_@1 plexFreePrepare1_b1: - //SEG94 [52] *((const byte[8]) PLEX_FREE_YPOS#0 + (byte) plexSort::plexFreePrepare1_s#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- pbuc1_derefidx_vbuxx=vbuc2 + //SEG97 [52] *((const byte[8]) PLEX_FREE_YPOS#0 + (byte) plexSort::plexFreePrepare1_s#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- pbuc1_derefidx_vbuxx=vbuc2 lda #0 sta PLEX_FREE_YPOS,x - //SEG95 [53] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 -- vbuxx=_inc_vbuxx + //SEG98 [53] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 -- vbuxx=_inc_vbuxx inx - //SEG96 [54] if((byte) plexSort::plexFreePrepare1_s#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto plexSort::plexFreePrepare1_@1 -- vbuxx_neq_vbuc1_then_la1 + //SEG99 [54] if((byte) plexSort::plexFreePrepare1_s#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto plexSort::plexFreePrepare1_@1 -- vbuxx_neq_vbuc1_then_la1 cpx #8 bne plexFreePrepare1_b1_from_plexFreePrepare1_b1 jmp plexFreePrepare1_b2 - //SEG97 plexSort::plexFreePrepare1_@2 + //SEG100 plexSort::plexFreePrepare1_@2 plexFreePrepare1_b2: - //SEG98 [55] (byte) plex_free_next#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 + //SEG101 [55] (byte) plex_free_next#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 lda #0 sta plex_free_next jmp breturn - //SEG99 plexSort::@return + //SEG102 plexSort::@return breturn: - //SEG100 [56] return + //SEG103 [56] return rts - //SEG101 plexSort::@6 + //SEG104 plexSort::@6 b6: - //SEG102 [57] if((byte) plexSort::nxt_y#0<*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#1))) goto plexSort::@3 -- vbuz1_lt_pbuc1_derefidx_pbuc2_derefidx_vbuxx_then_la1 + //SEG105 [57] if((byte) plexSort::nxt_y#0<*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#1))) goto plexSort::@3 -- vbuz1_lt_pbuc1_derefidx_pbuc2_derefidx_vbuxx_then_la1 lda nxt_y ldy PLEX_SORTED_IDX,x cmp PLEX_YPOS,y bcc b3_from_b6 jmp b4 } -//SEG103 init +//SEG106 init // Initialize the program init: { - .label xp = 6 - //SEG104 [58] *((const byte*) D011#0) ← (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 -- _deref_pbuc1=vbuc2 + .label xp = 5 + //SEG107 [58] *((const byte*) D011#0) ← (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 -- _deref_pbuc1=vbuc2 lda #VIC_DEN|VIC_RSEL|3 sta D011 - //SEG105 [59] call plexInit - //SEG106 [79] phi from init to plexInit [phi:init->plexInit] + //SEG108 [59] call plexInit + //SEG109 [79] phi from init to plexInit [phi:init->plexInit] plexInit_from_init: jsr plexInit - //SEG107 [60] phi from init to init::@1 [phi:init->init::@1] + //SEG110 [60] phi from init to init::@1 [phi:init->init::@1] b1_from_init: - //SEG108 [60] phi (word) init::xp#2 = (byte/signed byte/word/signed word/dword/signed dword) $20 [phi:init->init::@1#0] -- vwuz1=vbuc1 + //SEG111 [60] phi (word) init::xp#2 = (byte/signed byte/word/signed word/dword/signed dword) $20 [phi:init->init::@1#0] -- vwuz1=vbuc1 lda #$20 sta xp lda #0 sta xp+1 - //SEG109 [60] phi (byte) init::sx#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:init->init::@1#1] -- vbuxx=vbuc1 + //SEG112 [60] phi (byte) init::sx#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:init->init::@1#1] -- vbuxx=vbuc1 ldx #0 jmp b1 - //SEG110 [60] phi from init::@1 to init::@1 [phi:init::@1->init::@1] + //SEG113 [60] phi from init::@1 to init::@1 [phi:init::@1->init::@1] b1_from_b1: - //SEG111 [60] phi (word) init::xp#2 = (word) init::xp#1 [phi:init::@1->init::@1#0] -- register_copy - //SEG112 [60] phi (byte) init::sx#2 = (byte) init::sx#1 [phi:init::@1->init::@1#1] -- register_copy + //SEG114 [60] phi (word) init::xp#2 = (word) init::xp#1 [phi:init::@1->init::@1#0] -- register_copy + //SEG115 [60] phi (byte) init::sx#2 = (byte) init::sx#1 [phi:init::@1->init::@1#1] -- register_copy jmp b1 - //SEG113 init::@1 + //SEG116 init::@1 b1: - //SEG114 [61] *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + (byte) init::sx#2) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) $40 -- pbuc1_derefidx_vbuxx=vbuc2 + //SEG117 [61] *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + (byte) init::sx#2) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) $40 -- pbuc1_derefidx_vbuxx=vbuc2 lda #$ff&SPRITE/$40 sta PLEX_PTR,x - //SEG115 [62] (byte~) init::$7 ← (byte) init::sx#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuaa=vbuxx_rol_1 + //SEG118 [62] (byte~) init::$7 ← (byte) init::sx#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuaa=vbuxx_rol_1 txa asl - //SEG116 [63] *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte~) init::$7) ← (word) init::xp#2 -- pwuc1_derefidx_vbuaa=vwuz1 + //SEG119 [63] *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte~) init::$7) ← (word) init::xp#2 -- pwuc1_derefidx_vbuaa=vwuz1 tay lda xp sta PLEX_XPOS,y lda xp+1 sta PLEX_XPOS+1,y - //SEG117 [64] (word) init::xp#1 ← (word) init::xp#2 + (byte/signed byte/word/signed word/dword/signed dword) 9 -- vwuz1=vwuz1_plus_vbuc1 + //SEG120 [64] (word) init::xp#1 ← (word) init::xp#2 + (byte/signed byte/word/signed word/dword/signed dword) 9 -- vwuz1=vwuz1_plus_vbuc1 lda #9 clc adc xp @@ -3871,275 +3854,275 @@ init: { bcc !+ inc xp+1 !: - //SEG118 [65] (byte) init::sx#1 ← ++ (byte) init::sx#2 -- vbuxx=_inc_vbuxx + //SEG121 [65] (byte) init::sx#1 ← ++ (byte) init::sx#2 -- vbuxx=_inc_vbuxx inx - //SEG119 [66] if((byte) init::sx#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto init::@1 -- vbuxx_neq_vbuc1_then_la1 + //SEG122 [66] if((byte) init::sx#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto init::@1 -- vbuxx_neq_vbuc1_then_la1 cpx #PLEX_COUNT-1+1 bne b1_from_b1 jmp b2 - //SEG120 init::@2 + //SEG123 init::@2 b2: - //SEG121 [67] *((const byte*) SPRITES_ENABLE#0) ← (byte/word/signed word/dword/signed dword) $ff -- _deref_pbuc1=vbuc2 + //SEG124 [67] *((const byte*) SPRITES_ENABLE#0) ← (byte/word/signed word/dword/signed dword) $ff -- _deref_pbuc1=vbuc2 // Enable & initialize sprites lda #$ff sta SPRITES_ENABLE - //SEG122 [68] phi from init::@2 to init::@3 [phi:init::@2->init::@3] + //SEG125 [68] phi from init::@2 to init::@3 [phi:init::@2->init::@3] b3_from_b2: - //SEG123 [68] phi (byte) init::ss#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:init::@2->init::@3#0] -- vbuxx=vbuc1 + //SEG126 [68] phi (byte) init::ss#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:init::@2->init::@3#0] -- vbuxx=vbuc1 ldx #0 jmp b3 - //SEG124 [68] phi from init::@3 to init::@3 [phi:init::@3->init::@3] + //SEG127 [68] phi from init::@3 to init::@3 [phi:init::@3->init::@3] b3_from_b3: - //SEG125 [68] phi (byte) init::ss#2 = (byte) init::ss#1 [phi:init::@3->init::@3#0] -- register_copy + //SEG128 [68] phi (byte) init::ss#2 = (byte) init::ss#1 [phi:init::@3->init::@3#0] -- register_copy jmp b3 - //SEG126 init::@3 + //SEG129 init::@3 b3: - //SEG127 [69] *((const byte*) SPRITES_COLS#0 + (byte) init::ss#2) ← (const byte) GREEN#0 -- pbuc1_derefidx_vbuxx=vbuc2 + //SEG130 [69] *((const byte*) SPRITES_COLS#0 + (byte) init::ss#2) ← (const byte) GREEN#0 -- pbuc1_derefidx_vbuxx=vbuc2 lda #GREEN sta SPRITES_COLS,x - //SEG128 [70] (byte) init::ss#1 ← ++ (byte) init::ss#2 -- vbuxx=_inc_vbuxx + //SEG131 [70] (byte) init::ss#1 ← ++ (byte) init::ss#2 -- vbuxx=_inc_vbuxx inx - //SEG129 [71] if((byte) init::ss#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto init::@3 -- vbuxx_neq_vbuc1_then_la1 + //SEG132 [71] if((byte) init::ss#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto init::@3 -- vbuxx_neq_vbuc1_then_la1 cpx #8 bne b3_from_b3 jmp b4 - //SEG130 init::@4 + //SEG133 init::@4 b4: - //SEG131 asm { sei } + //SEG134 asm { sei } // enable the interrupt sei - //SEG132 [73] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 -- _deref_pbuc1=vbuc2 + //SEG135 [73] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 -- _deref_pbuc1=vbuc2 lda #CIA_INTERRUPT_CLEAR sta CIA1_INTERRUPT - //SEG133 [74] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 + //SEG136 [74] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 lda #IRQ_RASTER sta IRQ_ENABLE - //SEG134 [75] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 + //SEG137 [75] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 lda #IRQ_RASTER sta IRQ_STATUS - //SEG135 [76] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) plex_irq() -- _deref_pptc1=pprc2 + //SEG138 [76] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) plex_irq() -- _deref_pptc1=pprc2 lda #plex_irq sta KERNEL_IRQ+1 - //SEG136 asm { cli } + //SEG139 asm { cli } cli jmp breturn - //SEG137 init::@return + //SEG140 init::@return breturn: - //SEG138 [78] return + //SEG141 [78] return rts } -//SEG139 plexInit +//SEG142 plexInit // Initialize the multiplexer data structures plexInit: { - //SEG140 [80] phi from plexInit to plexInit::plexSetScreen1 [phi:plexInit->plexInit::plexSetScreen1] + //SEG143 [80] phi from plexInit to plexInit::plexSetScreen1 [phi:plexInit->plexInit::plexSetScreen1] plexSetScreen1_from_plexInit: jmp plexSetScreen1 - //SEG141 plexInit::plexSetScreen1 + //SEG144 plexInit::plexSetScreen1 plexSetScreen1: - //SEG142 [81] phi from plexInit::plexSetScreen1 to plexInit::@1 [phi:plexInit::plexSetScreen1->plexInit::@1] + //SEG145 [81] phi from plexInit::plexSetScreen1 to plexInit::@1 [phi:plexInit::plexSetScreen1->plexInit::@1] b1_from_plexSetScreen1: - //SEG143 [81] phi (byte) plexInit::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexInit::plexSetScreen1->plexInit::@1#0] -- vbuxx=vbuc1 + //SEG146 [81] phi (byte) plexInit::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexInit::plexSetScreen1->plexInit::@1#0] -- vbuxx=vbuc1 ldx #0 jmp b1 - //SEG144 [81] phi from plexInit::@1 to plexInit::@1 [phi:plexInit::@1->plexInit::@1] + //SEG147 [81] phi from plexInit::@1 to plexInit::@1 [phi:plexInit::@1->plexInit::@1] b1_from_b1: - //SEG145 [81] phi (byte) plexInit::i#2 = (byte) plexInit::i#1 [phi:plexInit::@1->plexInit::@1#0] -- register_copy + //SEG148 [81] phi (byte) plexInit::i#2 = (byte) plexInit::i#1 [phi:plexInit::@1->plexInit::@1#0] -- register_copy jmp b1 - //SEG146 plexInit::@1 + //SEG149 plexInit::@1 b1: - //SEG147 [82] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexInit::i#2) ← (byte) plexInit::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + //SEG150 [82] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexInit::i#2) ← (byte) plexInit::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta PLEX_SORTED_IDX,x - //SEG148 [83] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2 -- vbuxx=_inc_vbuxx + //SEG151 [83] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2 -- vbuxx=_inc_vbuxx inx - //SEG149 [84] if((byte) plexInit::i#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto plexInit::@1 -- vbuxx_neq_vbuc1_then_la1 + //SEG152 [84] if((byte) plexInit::i#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto plexInit::@1 -- vbuxx_neq_vbuc1_then_la1 cpx #PLEX_COUNT-1+1 bne b1_from_b1 jmp breturn - //SEG150 plexInit::@return + //SEG153 plexInit::@return breturn: - //SEG151 [85] return + //SEG154 [85] return rts } -//SEG152 plex_irq +//SEG155 plex_irq plex_irq: { - .label _4 = 5 - //SEG153 entry interrupt(KERNEL_MIN) - //SEG154 [86] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 + .label _4 = $f + //SEG156 entry interrupt(KERNEL_MIN) + //SEG157 [86] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 lda #WHITE sta BORDERCOL - //SEG155 [87] phi from plex_irq plex_irq::@7 to plex_irq::@3 [phi:plex_irq/plex_irq::@7->plex_irq::@3] + //SEG158 [87] 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: - //SEG156 [87] phi (byte) plex_sprite_msb#29 = (byte) plex_sprite_msb#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#0] -- register_copy - //SEG157 [87] phi (byte) plex_free_next#27 = (byte) plex_free_next#31 [phi:plex_irq/plex_irq::@7->plex_irq::@3#1] -- register_copy - //SEG158 [87] phi (byte) plex_show_idx#27 = (byte) plex_show_idx#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#2] -- register_copy - //SEG159 [87] phi (byte) plex_sprite_idx#25 = (byte) plex_sprite_idx#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#3] -- register_copy + //SEG159 [87] phi (byte) plex_sprite_msb#29 = (byte) plex_sprite_msb#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#0] -- register_copy + //SEG160 [87] phi (byte) plex_free_next#27 = (byte) plex_free_next#31 [phi:plex_irq/plex_irq::@7->plex_irq::@3#1] -- register_copy + //SEG161 [87] phi (byte) plex_show_idx#27 = (byte) plex_show_idx#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#2] -- register_copy + //SEG162 [87] phi (byte) plex_sprite_idx#25 = (byte) plex_sprite_idx#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#3] -- register_copy jmp b3 - //SEG160 plex_irq::@3 + //SEG163 plex_irq::@3 b3: - //SEG161 [88] call plexShowSprite + //SEG164 [88] call plexShowSprite jsr plexShowSprite jmp plexFreeNextYpos1 - //SEG162 plex_irq::plexFreeNextYpos1 + //SEG165 plex_irq::plexFreeNextYpos1 plexFreeNextYpos1: - //SEG163 [89] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte[8]) PLEX_FREE_YPOS#0 + (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0) -- vbuxx=pbuc1_derefidx_vbuz1 + //SEG166 [89] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte[8]) PLEX_FREE_YPOS#0 + (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0) -- vbuxx=pbuc1_derefidx_vbuz1 ldy plexShowSprite.plexFreeAdd1__2 ldx PLEX_FREE_YPOS,y jmp b6 - //SEG164 plex_irq::@6 + //SEG167 plex_irq::@6 b6: - //SEG165 [90] (byte/signed word/word/dword/signed dword~) plex_irq::$4 ← *((const byte*) RASTER#0) + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuz1=_deref_pbuc1_plus_2 + //SEG168 [90] (byte/signed word/word/dword/signed dword~) plex_irq::$4 ← *((const byte*) RASTER#0) + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuz1=_deref_pbuc1_plus_2 lda RASTER clc adc #2 sta _4 - //SEG166 [91] if((byte) plex_show_idx#16<(const byte) PLEX_COUNT#0) goto plex_irq::@7 -- vbuz1_lt_vbuc1_then_la1 + //SEG169 [91] if((byte) plex_show_idx#16<(const byte) PLEX_COUNT#0) goto plex_irq::@7 -- vbuz1_lt_vbuc1_then_la1 lda plex_show_idx cmp #PLEX_COUNT bcc b7 jmp b4 - //SEG167 plex_irq::@4 + //SEG170 plex_irq::@4 b4: - //SEG168 [92] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 + //SEG171 [92] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 lda #IRQ_RASTER sta IRQ_STATUS - //SEG169 [93] if((byte) plex_show_idx#16<(const byte) PLEX_COUNT#0) goto plex_irq::@1 -- vbuz1_lt_vbuc1_then_la1 + //SEG172 [93] if((byte) plex_show_idx#16<(const byte) PLEX_COUNT#0) goto plex_irq::@1 -- vbuz1_lt_vbuc1_then_la1 lda plex_show_idx cmp #PLEX_COUNT bcc b1 jmp b5 - //SEG170 plex_irq::@5 + //SEG173 plex_irq::@5 b5: - //SEG171 [94] (bool) framedone#3 ← true -- vboz1=vboc1 + //SEG174 [94] (bool) framedone#3 ← true -- vboz1=vboc1 lda #1 sta framedone jmp b2 - //SEG172 plex_irq::@2 + //SEG175 plex_irq::@2 b2: - //SEG173 [95] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2 + //SEG176 [95] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2 lda #0 sta BORDERCOL jmp breturn - //SEG174 plex_irq::@return + //SEG177 plex_irq::@return breturn: - //SEG175 [96] return - exit interrupt(KERNEL_MIN) + //SEG178 [96] return - exit interrupt(KERNEL_MIN) jmp $ea81 - //SEG176 plex_irq::@1 + //SEG179 plex_irq::@1 b1: - //SEG177 [97] *((const byte*) RASTER#0) ← (byte) plex_irq::plexFreeNextYpos1_return#0 -- _deref_pbuc1=vbuxx + //SEG180 [97] *((const byte*) RASTER#0) ← (byte) plex_irq::plexFreeNextYpos1_return#0 -- _deref_pbuc1=vbuxx stx RASTER jmp b2 - //SEG178 plex_irq::@7 + //SEG181 plex_irq::@7 b7: - //SEG179 [98] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte/signed word/word/dword/signed dword~) plex_irq::$4) goto plex_irq::@3 -- vbuxx_lt_vbuz1_then_la1 + //SEG182 [98] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte/signed word/word/dword/signed dword~) plex_irq::$4) goto plex_irq::@3 -- vbuxx_lt_vbuz1_then_la1 cpx _4 bcc b3_from_b7 jmp b4 } -//SEG180 plexShowSprite +//SEG183 plexShowSprite // Show the next sprite. // plexSort() prepares showing the sprites plexShowSprite: { - .label _7 = 8 - .label plex_sprite_idx2 = 5 - .label plexFreeAdd1__2 = $a - //SEG181 [99] (byte) plexShowSprite::plex_sprite_idx2#0 ← (byte) plex_sprite_idx#25 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_rol_1 + .label _7 = 7 + .label plex_sprite_idx2 = $f + .label plexFreeAdd1__2 = 9 + //SEG184 [99] (byte) plexShowSprite::plex_sprite_idx2#0 ← (byte) plex_sprite_idx#25 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_rol_1 lda plex_sprite_idx asl sta plex_sprite_idx2 - //SEG182 [100] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27)) -- vbuaa=pbuc1_derefidx_pbuc2_derefidx_vbuz1 + //SEG185 [100] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27)) -- vbuaa=pbuc1_derefidx_pbuc2_derefidx_vbuz1 ldx plex_show_idx ldy PLEX_SORTED_IDX,x lda PLEX_YPOS,y - //SEG183 [101] *((const byte*) SPRITES_YPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 -- pbuc1_derefidx_vbuz1=vbuaa + //SEG186 [101] *((const byte*) SPRITES_YPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 -- pbuc1_derefidx_vbuz1=vbuaa ldy plex_sprite_idx2 sta SPRITES_YPOS,y jmp plexFreeAdd1 - //SEG184 plexShowSprite::plexFreeAdd1 + //SEG187 plexShowSprite::plexFreeAdd1 plexFreeAdd1: - //SEG185 [102] (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$0#0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte/signed byte/word/signed word/dword/signed dword) $15 -- vbuaa=vbuaa_plus_vbuc1 + //SEG188 [102] (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$0#0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte/signed byte/word/signed word/dword/signed dword) $15 -- vbuaa=vbuaa_plus_vbuc1 clc adc #$15 - //SEG186 [103] *((const byte[8]) PLEX_FREE_YPOS#0 + (byte) plex_free_next#27) ← (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$0#0 -- pbuc1_derefidx_vbuz1=vbuaa + //SEG189 [103] *((const byte[8]) PLEX_FREE_YPOS#0 + (byte) plex_free_next#27) ← (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$0#0 -- pbuc1_derefidx_vbuz1=vbuaa ldy plex_free_next_27 sta PLEX_FREE_YPOS,y - //SEG187 [104] (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$1#0 ← (byte) plex_free_next#27 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=vbuz1_plus_1 + //SEG190 [104] (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$1#0 ← (byte) plex_free_next#27 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=vbuz1_plus_1 ldx plex_free_next_27 inx - //SEG188 [105] (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 ← (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$1#0 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuz1=vbuxx_band_vbuc1 + //SEG191 [105] (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 ← (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$1#0 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuz1=vbuxx_band_vbuc1 lda #7 sax plexFreeAdd1__2 jmp b5 - //SEG189 plexShowSprite::@5 + //SEG192 plexShowSprite::@5 b5: - //SEG190 [106] *((const byte*) PLEX_SCREEN_PTR#0 + (byte) plex_sprite_idx#25) ← *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27)) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_pbuc3_derefidx_vbuz2 + //SEG193 [106] *((const byte*) PLEX_SCREEN_PTR#0 + (byte) plex_sprite_idx#25) ← *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27)) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_pbuc3_derefidx_vbuz2 ldx plex_show_idx ldy PLEX_SORTED_IDX,x lda PLEX_PTR,y ldx plex_sprite_idx sta PLEX_SCREEN_PTR,x - //SEG191 [107] (byte) plexShowSprite::xpos_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27) << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=pbuc1_derefidx_vbuz1_rol_1 + //SEG194 [107] (byte) plexShowSprite::xpos_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27) << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=pbuc1_derefidx_vbuz1_rol_1 ldx plex_show_idx lda PLEX_SORTED_IDX,x asl tax - //SEG192 [108] (byte~) plexShowSprite::$3 ← < *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::xpos_idx#0) -- vbuaa=_lo_pwuc1_derefidx_vbuxx + //SEG195 [108] (byte~) plexShowSprite::$3 ← < *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::xpos_idx#0) -- vbuaa=_lo_pwuc1_derefidx_vbuxx lda PLEX_XPOS,x - //SEG193 [109] *((const byte*) SPRITES_XPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$3 -- pbuc1_derefidx_vbuz1=vbuaa + //SEG196 [109] *((const byte*) SPRITES_XPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$3 -- pbuc1_derefidx_vbuz1=vbuaa ldy plex_sprite_idx2 sta SPRITES_XPOS,y - //SEG194 [110] (byte~) plexShowSprite::$4 ← > *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::xpos_idx#0) -- vbuaa=_hi_pwuc1_derefidx_vbuxx + //SEG197 [110] (byte~) plexShowSprite::$4 ← > *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::xpos_idx#0) -- vbuaa=_hi_pwuc1_derefidx_vbuxx lda PLEX_XPOS+1,x - //SEG195 [111] if((byte~) plexShowSprite::$4!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@1 -- vbuaa_neq_0_then_la1 + //SEG198 [111] if((byte~) plexShowSprite::$4!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@1 -- vbuaa_neq_0_then_la1 cmp #0 bne b1 jmp b3 - //SEG196 plexShowSprite::@3 + //SEG199 plexShowSprite::@3 b3: - //SEG197 [112] (byte/word/dword~) plexShowSprite::$10 ← (byte/word/signed word/dword/signed dword) $ff ^ (byte) plex_sprite_msb#29 -- vbuaa=vbuc1_bxor_vbuz1 + //SEG200 [112] (byte/word/dword~) plexShowSprite::$10 ← (byte/word/signed word/dword/signed dword) $ff ^ (byte) plex_sprite_msb#29 -- vbuaa=vbuc1_bxor_vbuz1 lda plex_sprite_msb eor #$ff - //SEG198 [113] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte/word/dword~) plexShowSprite::$10 -- _deref_pbuc1=_deref_pbuc1_band_vbuaa + //SEG201 [113] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte/word/dword~) plexShowSprite::$10 -- _deref_pbuc1=_deref_pbuc1_band_vbuaa and SPRITES_XMSB sta SPRITES_XMSB jmp b2 - //SEG199 plexShowSprite::@2 + //SEG202 plexShowSprite::@2 b2: - //SEG200 [114] (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 ← (byte) plex_sprite_idx#25 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=vbuz1_plus_1 + //SEG203 [114] (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 ← (byte) plex_sprite_idx#25 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=vbuz1_plus_1 ldx plex_sprite_idx inx - //SEG201 [115] (byte/word/dword~) plexShowSprite::$7 ← (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuz1=vbuxx_band_vbuc1 + //SEG204 [115] (byte/word/dword~) plexShowSprite::$7 ← (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuz1=vbuxx_band_vbuc1 lda #7 sax _7 - //SEG202 [116] (byte) plex_show_idx#16 ← ++ (byte) plex_show_idx#27 -- vbuz1=_inc_vbuz1 + //SEG205 [116] (byte) plex_show_idx#16 ← ++ (byte) plex_show_idx#27 -- vbuz1=_inc_vbuz1 inc plex_show_idx - //SEG203 [117] (byte) plex_sprite_msb#27 ← (byte) plex_sprite_msb#29 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_rol_1 + //SEG206 [117] (byte) plex_sprite_msb#27 ← (byte) plex_sprite_msb#29 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_rol_1 asl plex_sprite_msb - //SEG204 [118] if((byte) plex_sprite_msb#27!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@return -- vbuz1_neq_0_then_la1 + //SEG207 [118] if((byte) plex_sprite_msb#27!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@return -- vbuz1_neq_0_then_la1 lda plex_sprite_msb cmp #0 bne breturn_from_b2 jmp b4 - //SEG205 plexShowSprite::@4 + //SEG208 plexShowSprite::@4 b4: - //SEG206 [119] (byte) plex_sprite_msb#4 ← (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuc1 + //SEG209 [119] (byte) plex_sprite_msb#4 ← (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuc1 lda #1 sta plex_sprite_msb - //SEG207 [120] phi from plexShowSprite::@2 plexShowSprite::@4 to plexShowSprite::@return [phi:plexShowSprite::@2/plexShowSprite::@4->plexShowSprite::@return] + //SEG210 [120] phi from plexShowSprite::@2 plexShowSprite::@4 to plexShowSprite::@return [phi:plexShowSprite::@2/plexShowSprite::@4->plexShowSprite::@return] breturn_from_b2: breturn_from_b4: - //SEG208 [120] phi (byte) plex_sprite_msb#17 = (byte) plex_sprite_msb#27 [phi:plexShowSprite::@2/plexShowSprite::@4->plexShowSprite::@return#0] -- register_copy + //SEG211 [120] phi (byte) plex_sprite_msb#17 = (byte) plex_sprite_msb#27 [phi:plexShowSprite::@2/plexShowSprite::@4->plexShowSprite::@return#0] -- register_copy jmp breturn - //SEG209 plexShowSprite::@return + //SEG212 plexShowSprite::@return breturn: - //SEG210 [121] return + //SEG213 [121] return rts - //SEG211 plexShowSprite::@1 + //SEG214 plexShowSprite::@1 b1: - //SEG212 [122] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) plex_sprite_msb#29 -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 + //SEG215 [122] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) plex_sprite_msb#29 -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 lda SPRITES_XMSB ora plex_sprite_msb sta SPRITES_XMSB @@ -4223,6 +4206,7 @@ Replacing instruction ldx #0 with TAX Removing instruction lda #IRQ_RASTER Succesful ASM optimization Pass5UnnecesaryLoadElimination Replacing label b4_from_b4 with b4 +Replacing label b1 with b2 Replacing label b1_from_b2 with b1 Replacing label plexFreePrepare1_b1_from_plexFreePrepare1_b1 with plexFreePrepare1_b1 Replacing label b3_from_b6 with b3 @@ -4236,7 +4220,7 @@ Removing instruction b3: Removing instruction b5_from_b4: Removing instruction bend_from_b5: Removing instruction b1_from_main: -Removing instruction b1_from_loop: +Removing instruction loop_from_b1: Removing instruction b1: Removing instruction b4_from_b4: Removing instruction b1_from_b2: @@ -4261,10 +4245,12 @@ Removing instruction b5: Removing instruction bend: Removing instruction b1: Removing instruction breturn: +Removing instruction b1_from_loop: Removing instruction b4_from_b3: Removing instruction b5: Removing instruction plexSort_from_b5: Removing instruction b6: +Removing instruction b1_from_b6: Removing instruction b1_from_plexSort: Removing instruction b7: Removing instruction b5: @@ -4288,8 +4274,6 @@ Removing instruction b5: Removing instruction b3: Removing instruction b4: Succesful ASM optimization Pass5UnusedLabelElimination -Relabelling long label b1_from_b6 to b1 -Succesful ASM optimization Pass5RelabelLongLabels Removing instruction jmp b4 Removing instruction jmp b1 Removing instruction jmp plexFreePrepare1_b1 @@ -4446,8 +4430,8 @@ FINAL SYMBOL TABLE (byte) init::sx#1 reg byte x 16.5 (byte) init::sx#2 reg byte x 8.8 (word) init::xp -(word) init::xp#1 xp zp ZP_WORD:6 7.333333333333333 -(word) init::xp#2 xp zp ZP_WORD:6 8.25 +(word) init::xp#1 xp zp ZP_WORD:5 7.333333333333333 +(word) init::xp#2 xp zp ZP_WORD:5 8.25 (void()) loop() (label) loop::@1 (label) loop::@2 @@ -4456,16 +4440,15 @@ FINAL SYMBOL TABLE (label) loop::@5 (label) loop::@6 (byte) loop::sin_idx -(byte) loop::sin_idx#0 sin_idx zp ZP_BYTE:3 4.0 (byte) loop::sin_idx#1 sin_idx zp ZP_BYTE:3 3.142857142857143 -(byte) loop::sin_idx#6 sin_idx zp ZP_BYTE:3 3.8888888888888893 +(byte) loop::sin_idx#6 sin_idx zp ZP_BYTE:3 3.666666666666667 (byte) loop::sy (byte) loop::sy#1 reg byte y 151.5 (byte) loop::sy#2 reg byte y 101.0 (byte) loop::y_idx -(byte) loop::y_idx#0 y_idx zp ZP_BYTE:4 22.0 -(byte) loop::y_idx#1 y_idx zp ZP_BYTE:4 67.33333333333333 -(byte) loop::y_idx#2 y_idx zp ZP_BYTE:4 157.0 +(byte) loop::y_idx#1 reg byte x 67.33333333333333 +(byte) loop::y_idx#2 reg byte x 157.0 +(byte~) loop::y_idx#4 reg byte x 22.0 (void()) main() (label) main::@1 (label) main::@return @@ -4484,7 +4467,7 @@ FINAL SYMBOL TABLE (byte~) plexShowSprite::$3 reg byte a 4.0 (byte~) plexShowSprite::$4 reg byte a 4.0 (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 reg byte x 4.0 -(byte/word/dword~) plexShowSprite::$7 $7 zp ZP_BYTE:8 1.0833333333333333 +(byte/word/dword~) plexShowSprite::$7 $7 zp ZP_BYTE:7 1.0833333333333333 (label) plexShowSprite::@1 (label) plexShowSprite::@2 (label) plexShowSprite::@3 @@ -4497,11 +4480,11 @@ FINAL SYMBOL TABLE (byte/signed word/word/dword/signed dword~) plexShowSprite::plexFreeAdd1_$1 (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$1#0 reg byte x 4.0 (byte/word/dword~) plexShowSprite::plexFreeAdd1_$2 -(byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 plexFreeAdd1_$2 zp ZP_BYTE:10 1.0434782608695652 +(byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 plexFreeAdd1_$2 zp ZP_BYTE:9 1.0434782608695652 (byte) plexShowSprite::plexFreeAdd1_ypos (byte) plexShowSprite::plexFreeAdd1_ypos#0 reg byte a 3.0 (byte) plexShowSprite::plex_sprite_idx2 -(byte) plexShowSprite::plex_sprite_idx2#0 plex_sprite_idx2 zp ZP_BYTE:5 0.6000000000000001 +(byte) plexShowSprite::plex_sprite_idx2#0 plex_sprite_idx2 zp ZP_BYTE:15 0.6000000000000001 (byte) plexShowSprite::xpos_idx (byte) plexShowSprite::xpos_idx#0 reg byte x 2.0 (byte) plexShowSprite::ypos @@ -4515,12 +4498,12 @@ FINAL SYMBOL TABLE (label) plexSort::@7 (label) plexSort::@return (byte) plexSort::m -(byte) plexSort::m#1 m zp ZP_BYTE:5 151.5 -(byte) plexSort::m#2 m zp ZP_BYTE:5 42.08333333333333 +(byte) plexSort::m#1 m zp ZP_BYTE:4 151.5 +(byte) plexSort::m#2 m zp ZP_BYTE:4 42.08333333333333 (byte) plexSort::nxt_idx -(byte) plexSort::nxt_idx#0 nxt_idx zp ZP_BYTE:12 30.299999999999997 +(byte) plexSort::nxt_idx#0 nxt_idx zp ZP_BYTE:11 30.299999999999997 (byte) plexSort::nxt_y -(byte) plexSort::nxt_y#0 nxt_y zp ZP_BYTE:13 150.375 +(byte) plexSort::nxt_y#0 nxt_y zp ZP_BYTE:12 150.375 (label) plexSort::plexFreePrepare1 (bool~) plexSort::plexFreePrepare1_$0 (label) plexSort::plexFreePrepare1_@1 @@ -4534,11 +4517,11 @@ FINAL SYMBOL TABLE (byte) plexSort::s#3 reg byte x 2052.5 (byte~) plexSort::s#6 reg byte x 202.0 (byte) plex_free_next -(byte) plex_free_next#0 plex_free_next zp ZP_BYTE:15 20.0 -(byte) plex_free_next#27 plex_free_next#27 zp ZP_BYTE:10 2.8333333333333335 -(byte) plex_free_next#31 plex_free_next#31 zp ZP_BYTE:10 4.0 +(byte) plex_free_next#0 plex_free_next zp ZP_BYTE:14 20.0 +(byte) plex_free_next#27 plex_free_next#27 zp ZP_BYTE:9 2.8333333333333335 +(byte) plex_free_next#31 plex_free_next#31 zp ZP_BYTE:9 4.0 interrupt(KERNEL_MIN)(void()) plex_irq() -(byte/signed word/word/dword/signed dword~) plex_irq::$4 $4 zp ZP_BYTE:5 11.0 +(byte/signed word/word/dword/signed dword~) plex_irq::$4 $4 zp ZP_BYTE:15 11.0 (label) plex_irq::@1 (label) plex_irq::@2 (label) plex_irq::@3 @@ -4552,44 +4535,45 @@ interrupt(KERNEL_MIN)(void()) plex_irq() (byte) plex_irq::plexFreeNextYpos1_return#0 reg byte x 4.0 (byte) plex_irq::rasterY (byte) plex_show_idx -(byte) plex_show_idx#0 plex_show_idx zp ZP_BYTE:9 4.0 -(byte) plex_show_idx#1 plex_show_idx zp ZP_BYTE:9 20.0 -(byte) plex_show_idx#16 plex_show_idx zp ZP_BYTE:9 2.1666666666666665 -(byte) plex_show_idx#27 plex_show_idx zp ZP_BYTE:9 1.1052631578947367 +(byte) plex_show_idx#0 plex_show_idx zp ZP_BYTE:8 4.0 +(byte) plex_show_idx#1 plex_show_idx zp ZP_BYTE:8 20.0 +(byte) plex_show_idx#16 plex_show_idx zp ZP_BYTE:8 2.1666666666666665 +(byte) plex_show_idx#27 plex_show_idx zp ZP_BYTE:8 1.1052631578947367 (byte) plex_sprite_idx -(byte) plex_sprite_idx#0 plex_sprite_idx zp ZP_BYTE:8 4.0 -(byte) plex_sprite_idx#1 plex_sprite_idx#1 zp ZP_BYTE:14 20.0 -(byte) plex_sprite_idx#25 plex_sprite_idx zp ZP_BYTE:8 1.1176470588235294 +(byte) plex_sprite_idx#0 plex_sprite_idx zp ZP_BYTE:7 4.0 +(byte) plex_sprite_idx#1 plex_sprite_idx#1 zp ZP_BYTE:13 20.0 +(byte) plex_sprite_idx#25 plex_sprite_idx zp ZP_BYTE:7 1.1176470588235294 (byte) plex_sprite_msb -(byte) plex_sprite_msb#0 plex_sprite_msb zp ZP_BYTE:11 4.0 -(byte) plex_sprite_msb#1 plex_sprite_msb zp ZP_BYTE:11 20.0 -(byte) plex_sprite_msb#17 plex_sprite_msb zp ZP_BYTE:11 2.142857142857143 -(byte) plex_sprite_msb#27 plex_sprite_msb zp ZP_BYTE:11 3.0 -(byte) plex_sprite_msb#29 plex_sprite_msb zp ZP_BYTE:11 0.95 -(byte) plex_sprite_msb#4 plex_sprite_msb zp ZP_BYTE:11 4.0 +(byte) plex_sprite_msb#0 plex_sprite_msb zp ZP_BYTE:10 4.0 +(byte) plex_sprite_msb#1 plex_sprite_msb zp ZP_BYTE:10 20.0 +(byte) plex_sprite_msb#17 plex_sprite_msb zp ZP_BYTE:10 2.142857142857143 +(byte) plex_sprite_msb#27 plex_sprite_msb zp ZP_BYTE:10 3.0 +(byte) plex_sprite_msb#29 plex_sprite_msb zp ZP_BYTE:10 0.95 +(byte) plex_sprite_msb#4 plex_sprite_msb zp ZP_BYTE:10 4.0 zp ZP_BOOL:2 [ framedone#12 framedone#19 framedone#5 framedone#3 ] -zp ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#0 loop::sin_idx#1 ] -zp ZP_BYTE:4 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#0 ] +zp ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#1 ] +reg byte x [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] reg byte y [ loop::sy#2 loop::sy#1 ] -zp ZP_BYTE:5 [ plexSort::m#2 plexSort::m#1 plex_irq::$4 plexShowSprite::plex_sprite_idx2#0 ] +zp ZP_BYTE:4 [ plexSort::m#2 plexSort::m#1 ] 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 [ init::sx#2 init::sx#1 ] -zp ZP_WORD:6 [ init::xp#2 init::xp#1 ] +zp ZP_WORD:5 [ init::xp#2 init::xp#1 ] reg byte x [ init::ss#2 init::ss#1 ] reg byte x [ plexInit::i#2 plexInit::i#1 ] -zp ZP_BYTE:8 [ plex_sprite_idx#25 plex_sprite_idx#0 plexShowSprite::$7 ] -zp ZP_BYTE:9 [ plex_show_idx#27 plex_show_idx#0 plex_show_idx#16 plex_show_idx#1 ] -zp ZP_BYTE:10 [ plex_free_next#27 plex_free_next#31 plexShowSprite::plexFreeAdd1_$2#0 ] -zp ZP_BYTE:11 [ plex_sprite_msb#29 plex_sprite_msb#0 plex_sprite_msb#17 plex_sprite_msb#27 plex_sprite_msb#4 plex_sprite_msb#1 ] -zp ZP_BYTE:12 [ plexSort::nxt_idx#0 ] -zp ZP_BYTE:13 [ plexSort::nxt_y#0 ] +zp ZP_BYTE:7 [ plex_sprite_idx#25 plex_sprite_idx#0 plexShowSprite::$7 ] +zp ZP_BYTE:8 [ plex_show_idx#27 plex_show_idx#0 plex_show_idx#16 plex_show_idx#1 ] +zp ZP_BYTE:9 [ plex_free_next#27 plex_free_next#31 plexShowSprite::plexFreeAdd1_$2#0 ] +zp ZP_BYTE:10 [ plex_sprite_msb#29 plex_sprite_msb#0 plex_sprite_msb#17 plex_sprite_msb#27 plex_sprite_msb#4 plex_sprite_msb#1 ] +zp ZP_BYTE:11 [ plexSort::nxt_idx#0 ] +zp ZP_BYTE:12 [ plexSort::nxt_y#0 ] reg byte x [ plexSort::s#2 ] -zp ZP_BYTE:14 [ plex_sprite_idx#1 ] -zp ZP_BYTE:15 [ plex_free_next#0 ] +zp ZP_BYTE:13 [ plex_sprite_idx#1 ] +zp ZP_BYTE:14 [ plex_free_next#0 ] reg byte a [ init::$7 ] reg byte x [ plex_irq::plexFreeNextYpos1_return#0 ] +zp ZP_BYTE:15 [ plex_irq::$4 plexShowSprite::plex_sprite_idx2#0 ] reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ] reg byte a [ plexShowSprite::plexFreeAdd1_$0#0 ] reg byte x [ plexShowSprite::plexFreeAdd1_$1#0 ] @@ -4601,7 +4585,7 @@ reg byte x [ plexShowSprite::$6 ] FINAL ASSEMBLER -Score: 47957 +Score: 47272 //SEG0 File Comments // A simple usage of the flexible sprite multiplexer routine @@ -4642,14 +4626,14 @@ Score: 47957 .label YSIN = $2100 // The address of the sprite pointers on the current screen (screen+$3f8). .label PLEX_SCREEN_PTR = $400+$3f8 - .label plex_show_idx = 9 - .label plex_sprite_idx = 8 - .label plex_sprite_msb = $b - .label plex_sprite_idx_1 = $e - .label plex_free_next = $f + .label plex_show_idx = 8 + .label plex_sprite_idx = 7 + .label plex_sprite_msb = $a + .label plex_sprite_idx_1 = $d + .label plex_free_next = $e .label framedone = 2 - .label plex_free_next_27 = $a - .label plex_free_next_31 = $a + .label plex_free_next_27 = 9 + .label plex_free_next_31 = 9 //SEG3 @begin bbegin: //SEG4 @1 @@ -4691,25 +4675,21 @@ main: { //SEG23 [13] phi from main to main::@1 [phi:main->main::@1] //SEG24 main::@1 //SEG25 [14] call loop + //SEG26 [16] phi from main::@1 to loop [phi:main::@1->loop] jsr loop - //SEG26 main::@return - //SEG27 [15] return + //SEG27 main::@return + //SEG28 [15] return rts } -//SEG28 loop +//SEG29 loop // The raster loop loop: { .label sin_idx = 3 - .label y_idx = 4 - //SEG29 [16] (byte) loop::sin_idx#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 - // The current index into the y-sinus + //SEG30 [17] phi from loop to loop::@1 [phi:loop->loop::@1] + //SEG31 [17] phi (byte) loop::sin_idx#6 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:loop->loop::@1#0] -- vbuz1=vbuc1 lda #0 sta sin_idx - //SEG30 [17] phi from loop loop::@6 to loop::@1 [phi:loop/loop::@6->loop::@1] - b1: - //SEG31 [17] phi (byte) loop::sin_idx#6 = (byte) loop::sin_idx#0 [phi:loop/loop::@6->loop::@1#0] -- register_copy - //SEG32 [17] phi (bool) framedone#12 = (bool) framedone#19 [phi:loop/loop::@6->loop::@1#1] -- register_copy - // without volatile gives wrong asm + //SEG32 [17] phi (bool) framedone#12 = (bool) framedone#19 [phi:loop->loop::@1#1] -- register_copy //SEG33 loop::@1 //SEG34 loop::@2 b2: @@ -4723,28 +4703,23 @@ loop: { //SEG37 [19] *((const byte*) BORDERCOL#0) ← (const byte) RED#0 -- _deref_pbuc1=vbuc2 lda #RED sta BORDERCOL - //SEG38 [20] (byte) loop::y_idx#0 ← (byte) loop::sin_idx#6 -- vbuz1=vbuz2 - // Assign sinus positions - lda sin_idx - sta y_idx + //SEG38 [20] (byte~) loop::y_idx#4 ← (byte) loop::sin_idx#6 -- vbuxx=vbuz1 + ldx sin_idx //SEG39 [21] phi from loop::@3 to loop::@4 [phi:loop::@3->loop::@4] //SEG40 [21] phi (byte) loop::sy#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:loop::@3->loop::@4#0] -- vbuyy=vbuc1 ldy #0 - //SEG41 [21] phi (byte) loop::y_idx#2 = (byte) loop::y_idx#0 [phi:loop::@3->loop::@4#1] -- register_copy - // without volatile gives wrong asm + //SEG41 [21] phi (byte) loop::y_idx#2 = (byte~) loop::y_idx#4 [phi:loop::@3->loop::@4#1] -- register_copy //SEG42 [21] phi from loop::@4 to loop::@4 [phi:loop::@4->loop::@4] //SEG43 [21] phi (byte) loop::sy#2 = (byte) loop::sy#1 [phi:loop::@4->loop::@4#0] -- register_copy //SEG44 [21] phi (byte) loop::y_idx#2 = (byte) loop::y_idx#1 [phi:loop::@4->loop::@4#1] -- register_copy //SEG45 loop::@4 b4: - //SEG46 [22] *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) loop::sy#2) ← *((const byte*) YSIN#0 + (byte) loop::y_idx#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuz1 - ldx y_idx + //SEG46 [22] *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) loop::sy#2) ← *((const byte*) YSIN#0 + (byte) loop::y_idx#2) -- pbuc1_derefidx_vbuyy=pbuc2_derefidx_vbuxx lda YSIN,x sta PLEX_YPOS,y - //SEG47 [23] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte/signed byte/word/signed word/dword/signed dword) 8 -- vbuz1=vbuz1_plus_vbuc1 - lax y_idx + //SEG47 [23] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte/signed byte/word/signed word/dword/signed dword) 8 -- vbuxx=vbuxx_plus_vbuc1 + txa axs #-[8] - stx y_idx //SEG48 [24] (byte) loop::sy#1 ← ++ (byte) loop::sy#2 -- vbuyy=_inc_vbuyy iny //SEG49 [25] if((byte) loop::sy#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto loop::@4 -- vbuyy_neq_vbuc1_then_la1 @@ -4772,9 +4747,12 @@ loop: { //SEG59 [32] *((const byte*) RASTER#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2 lda #0 sta RASTER - jmp b1 + //SEG60 [17] phi from loop::@6 to loop::@1 [phi:loop::@6->loop::@1] + //SEG61 [17] phi (byte) loop::sin_idx#6 = (byte) loop::sin_idx#1 [phi:loop::@6->loop::@1#0] -- register_copy + //SEG62 [17] phi (bool) framedone#12 = (bool) framedone#5 [phi:loop::@6->loop::@1#1] -- register_copy + jmp b2 } -//SEG60 plexSort +//SEG63 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: @@ -4785,137 +4763,137 @@ loop: { // 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 = $c - .label nxt_y = $d - .label m = 5 - //SEG61 [34] phi from plexSort to plexSort::@1 [phi:plexSort->plexSort::@1] - //SEG62 [34] phi (byte) plexSort::m#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexSort->plexSort::@1#0] -- vbuz1=vbuc1 + .label nxt_idx = $b + .label nxt_y = $c + .label m = 4 + //SEG64 [34] phi from plexSort to plexSort::@1 [phi:plexSort->plexSort::@1] + //SEG65 [34] phi (byte) plexSort::m#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexSort->plexSort::@1#0] -- vbuz1=vbuc1 lda #0 sta m - //SEG63 [34] phi from plexSort::@2 to plexSort::@1 [phi:plexSort::@2->plexSort::@1] - //SEG64 [34] phi (byte) plexSort::m#2 = (byte) plexSort::m#1 [phi:plexSort::@2->plexSort::@1#0] -- register_copy - //SEG65 plexSort::@1 + //SEG66 [34] phi from plexSort::@2 to plexSort::@1 [phi:plexSort::@2->plexSort::@1] + //SEG67 [34] phi (byte) plexSort::m#2 = (byte) plexSort::m#1 [phi:plexSort::@2->plexSort::@1#0] -- register_copy + //SEG68 plexSort::@1 b1: - //SEG66 [35] (byte) plexSort::nxt_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) plexSort::m#2) -- vbuz1=pbuc1_derefidx_vbuz2 + //SEG69 [35] (byte) plexSort::nxt_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) plexSort::m#2) -- vbuz1=pbuc1_derefidx_vbuz2 ldy m lda PLEX_SORTED_IDX+1,y sta nxt_idx - //SEG67 [36] (byte) plexSort::nxt_y#0 ← *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) plexSort::nxt_idx#0) -- vbuz1=pbuc1_derefidx_vbuz2 + //SEG70 [36] (byte) plexSort::nxt_y#0 ← *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + (byte) plexSort::nxt_idx#0) -- vbuz1=pbuc1_derefidx_vbuz2 tay lda PLEX_YPOS,y sta nxt_y - //SEG68 [37] if((byte) plexSort::nxt_y#0>=*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::m#2))) goto plexSort::@2 -- vbuz1_ge_pbuc1_derefidx_pbuc2_derefidx_vbuz2_then_la1 + //SEG71 [37] if((byte) plexSort::nxt_y#0>=*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::m#2))) goto plexSort::@2 -- vbuz1_ge_pbuc1_derefidx_pbuc2_derefidx_vbuz2_then_la1 ldx m ldy PLEX_SORTED_IDX,x cmp PLEX_YPOS,y bcs b2 - //SEG69 plexSort::@7 - //SEG70 [38] (byte~) plexSort::s#6 ← (byte) plexSort::m#2 -- vbuxx=vbuz1 - //SEG71 [39] phi from plexSort::@6 plexSort::@7 to plexSort::@3 [phi:plexSort::@6/plexSort::@7->plexSort::@3] - //SEG72 [39] phi (byte) plexSort::s#3 = (byte) plexSort::s#1 [phi:plexSort::@6/plexSort::@7->plexSort::@3#0] -- register_copy - //SEG73 plexSort::@3 + //SEG72 plexSort::@7 + //SEG73 [38] (byte~) plexSort::s#6 ← (byte) plexSort::m#2 -- vbuxx=vbuz1 + //SEG74 [39] phi from plexSort::@6 plexSort::@7 to plexSort::@3 [phi:plexSort::@6/plexSort::@7->plexSort::@3] + //SEG75 [39] phi (byte) plexSort::s#3 = (byte) plexSort::s#1 [phi:plexSort::@6/plexSort::@7->plexSort::@3#0] -- register_copy + //SEG76 plexSort::@3 b3: - //SEG74 [40] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) plexSort::s#3) ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx + //SEG77 [40] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0+(byte/signed byte/word/signed word/dword/signed dword) 1 + (byte) plexSort::s#3) ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#3) -- pbuc1_derefidx_vbuxx=pbuc2_derefidx_vbuxx lda PLEX_SORTED_IDX,x sta PLEX_SORTED_IDX+1,x - //SEG75 [41] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 -- vbuxx=_dec_vbuxx + //SEG78 [41] (byte) plexSort::s#1 ← -- (byte) plexSort::s#3 -- vbuxx=_dec_vbuxx dex - //SEG76 [42] if((byte) plexSort::s#1!=(byte/word/signed word/dword/signed dword) $ff) goto plexSort::@6 -- vbuxx_neq_vbuc1_then_la1 + //SEG79 [42] if((byte) plexSort::s#1!=(byte/word/signed word/dword/signed dword) $ff) goto plexSort::@6 -- vbuxx_neq_vbuc1_then_la1 cpx #$ff bne b6 - //SEG77 plexSort::@4 + //SEG80 plexSort::@4 b4: - //SEG78 [43] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 -- vbuxx=_inc_vbuxx + //SEG81 [43] (byte) plexSort::s#2 ← ++ (byte) plexSort::s#1 -- vbuxx=_inc_vbuxx inx - //SEG79 [44] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 -- pbuc1_derefidx_vbuxx=vbuz1 + //SEG82 [44] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#2) ← (byte) plexSort::nxt_idx#0 -- pbuc1_derefidx_vbuxx=vbuz1 lda nxt_idx sta PLEX_SORTED_IDX,x - //SEG80 plexSort::@2 + //SEG83 plexSort::@2 b2: - //SEG81 [45] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 -- vbuz1=_inc_vbuz1 + //SEG84 [45] (byte) plexSort::m#1 ← ++ (byte) plexSort::m#2 -- vbuz1=_inc_vbuz1 inc m - //SEG82 [46] if((byte) plexSort::m#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 2+(byte/signed byte/word/signed word/dword/signed dword) 1) goto plexSort::@1 -- vbuz1_neq_vbuc1_then_la1 + //SEG85 [46] if((byte) plexSort::m#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 2+(byte/signed byte/word/signed word/dword/signed dword) 1) goto plexSort::@1 -- vbuz1_neq_vbuc1_then_la1 lda #PLEX_COUNT-2+1 cmp m bne b1 - //SEG83 plexSort::@5 - //SEG84 [47] (byte) plex_show_idx#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 + //SEG86 plexSort::@5 + //SEG87 [47] (byte) plex_show_idx#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 // Prepare for showing the sprites lda #0 sta plex_show_idx - //SEG85 [48] (byte) plex_sprite_idx#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 + //SEG88 [48] (byte) plex_sprite_idx#1 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 sta plex_sprite_idx_1 - //SEG86 [49] (byte) plex_sprite_msb#1 ← (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuc1 + //SEG89 [49] (byte) plex_sprite_msb#1 ← (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuc1 lda #1 sta plex_sprite_msb - //SEG87 [50] phi from plexSort::@5 to plexSort::plexFreePrepare1 [phi:plexSort::@5->plexSort::plexFreePrepare1] - //SEG88 plexSort::plexFreePrepare1 - //SEG89 [51] phi from plexSort::plexFreePrepare1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1] - //SEG90 [51] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1#0] -- vbuxx=vbuc1 + //SEG90 [50] phi from plexSort::@5 to plexSort::plexFreePrepare1 [phi:plexSort::@5->plexSort::plexFreePrepare1] + //SEG91 plexSort::plexFreePrepare1 + //SEG92 [51] phi from plexSort::plexFreePrepare1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1] + //SEG93 [51] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexSort::plexFreePrepare1->plexSort::plexFreePrepare1_@1#0] -- vbuxx=vbuc1 ldx #0 - //SEG91 [51] phi from plexSort::plexFreePrepare1_@1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1] - //SEG92 [51] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) plexSort::plexFreePrepare1_s#1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1#0] -- register_copy - //SEG93 plexSort::plexFreePrepare1_@1 + //SEG94 [51] phi from plexSort::plexFreePrepare1_@1 to plexSort::plexFreePrepare1_@1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1] + //SEG95 [51] phi (byte) plexSort::plexFreePrepare1_s#2 = (byte) plexSort::plexFreePrepare1_s#1 [phi:plexSort::plexFreePrepare1_@1->plexSort::plexFreePrepare1_@1#0] -- register_copy + //SEG96 plexSort::plexFreePrepare1_@1 plexFreePrepare1_b1: - //SEG94 [52] *((const byte[8]) PLEX_FREE_YPOS#0 + (byte) plexSort::plexFreePrepare1_s#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- pbuc1_derefidx_vbuxx=vbuc2 + //SEG97 [52] *((const byte[8]) PLEX_FREE_YPOS#0 + (byte) plexSort::plexFreePrepare1_s#2) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- pbuc1_derefidx_vbuxx=vbuc2 lda #0 sta PLEX_FREE_YPOS,x - //SEG95 [53] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 -- vbuxx=_inc_vbuxx + //SEG98 [53] (byte) plexSort::plexFreePrepare1_s#1 ← ++ (byte) plexSort::plexFreePrepare1_s#2 -- vbuxx=_inc_vbuxx inx - //SEG96 [54] if((byte) plexSort::plexFreePrepare1_s#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto plexSort::plexFreePrepare1_@1 -- vbuxx_neq_vbuc1_then_la1 + //SEG99 [54] if((byte) plexSort::plexFreePrepare1_s#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto plexSort::plexFreePrepare1_@1 -- vbuxx_neq_vbuc1_then_la1 cpx #8 bne plexFreePrepare1_b1 - //SEG97 plexSort::plexFreePrepare1_@2 - //SEG98 [55] (byte) plex_free_next#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 + //SEG100 plexSort::plexFreePrepare1_@2 + //SEG101 [55] (byte) plex_free_next#0 ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- vbuz1=vbuc1 sta plex_free_next - //SEG99 plexSort::@return - //SEG100 [56] return + //SEG102 plexSort::@return + //SEG103 [56] return rts - //SEG101 plexSort::@6 + //SEG104 plexSort::@6 b6: - //SEG102 [57] if((byte) plexSort::nxt_y#0<*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#1))) goto plexSort::@3 -- vbuz1_lt_pbuc1_derefidx_pbuc2_derefidx_vbuxx_then_la1 + //SEG105 [57] if((byte) plexSort::nxt_y#0<*((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexSort::s#1))) goto plexSort::@3 -- vbuz1_lt_pbuc1_derefidx_pbuc2_derefidx_vbuxx_then_la1 lda nxt_y ldy PLEX_SORTED_IDX,x cmp PLEX_YPOS,y bcc b3 jmp b4 } -//SEG103 init +//SEG106 init // Initialize the program init: { - .label xp = 6 - //SEG104 [58] *((const byte*) D011#0) ← (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 -- _deref_pbuc1=vbuc2 + .label xp = 5 + //SEG107 [58] *((const byte*) D011#0) ← (const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 -- _deref_pbuc1=vbuc2 lda #VIC_DEN|VIC_RSEL|3 sta D011 - //SEG105 [59] call plexInit - //SEG106 [79] phi from init to plexInit [phi:init->plexInit] + //SEG108 [59] call plexInit + //SEG109 [79] phi from init to plexInit [phi:init->plexInit] jsr plexInit - //SEG107 [60] phi from init to init::@1 [phi:init->init::@1] - //SEG108 [60] phi (word) init::xp#2 = (byte/signed byte/word/signed word/dword/signed dword) $20 [phi:init->init::@1#0] -- vwuz1=vbuc1 + //SEG110 [60] phi from init to init::@1 [phi:init->init::@1] + //SEG111 [60] phi (word) init::xp#2 = (byte/signed byte/word/signed word/dword/signed dword) $20 [phi:init->init::@1#0] -- vwuz1=vbuc1 lda #$20 sta xp lda #0 sta xp+1 - //SEG109 [60] phi (byte) init::sx#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:init->init::@1#1] -- vbuxx=vbuc1 + //SEG112 [60] phi (byte) init::sx#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:init->init::@1#1] -- vbuxx=vbuc1 tax - //SEG110 [60] phi from init::@1 to init::@1 [phi:init::@1->init::@1] - //SEG111 [60] phi (word) init::xp#2 = (word) init::xp#1 [phi:init::@1->init::@1#0] -- register_copy - //SEG112 [60] phi (byte) init::sx#2 = (byte) init::sx#1 [phi:init::@1->init::@1#1] -- register_copy - //SEG113 init::@1 + //SEG113 [60] phi from init::@1 to init::@1 [phi:init::@1->init::@1] + //SEG114 [60] phi (word) init::xp#2 = (word) init::xp#1 [phi:init::@1->init::@1#0] -- register_copy + //SEG115 [60] phi (byte) init::sx#2 = (byte) init::sx#1 [phi:init::@1->init::@1#1] -- register_copy + //SEG116 init::@1 b1: - //SEG114 [61] *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + (byte) init::sx#2) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) $40 -- pbuc1_derefidx_vbuxx=vbuc2 + //SEG117 [61] *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + (byte) init::sx#2) ← ((byte))(const byte*) SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) $40 -- pbuc1_derefidx_vbuxx=vbuc2 lda #$ff&SPRITE/$40 sta PLEX_PTR,x - //SEG115 [62] (byte~) init::$7 ← (byte) init::sx#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuaa=vbuxx_rol_1 + //SEG118 [62] (byte~) init::$7 ← (byte) init::sx#2 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuaa=vbuxx_rol_1 txa asl - //SEG116 [63] *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte~) init::$7) ← (word) init::xp#2 -- pwuc1_derefidx_vbuaa=vwuz1 + //SEG119 [63] *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte~) init::$7) ← (word) init::xp#2 -- pwuc1_derefidx_vbuaa=vwuz1 tay lda xp sta PLEX_XPOS,y lda xp+1 sta PLEX_XPOS+1,y - //SEG117 [64] (word) init::xp#1 ← (word) init::xp#2 + (byte/signed byte/word/signed word/dword/signed dword) 9 -- vwuz1=vwuz1_plus_vbuc1 + //SEG120 [64] (word) init::xp#1 ← (word) init::xp#2 + (byte/signed byte/word/signed word/dword/signed dword) 9 -- vwuz1=vwuz1_plus_vbuc1 lda #9 clc adc xp @@ -4923,230 +4901,230 @@ init: { bcc !+ inc xp+1 !: - //SEG118 [65] (byte) init::sx#1 ← ++ (byte) init::sx#2 -- vbuxx=_inc_vbuxx + //SEG121 [65] (byte) init::sx#1 ← ++ (byte) init::sx#2 -- vbuxx=_inc_vbuxx inx - //SEG119 [66] if((byte) init::sx#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto init::@1 -- vbuxx_neq_vbuc1_then_la1 + //SEG122 [66] if((byte) init::sx#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto init::@1 -- vbuxx_neq_vbuc1_then_la1 cpx #PLEX_COUNT-1+1 bne b1 - //SEG120 init::@2 - //SEG121 [67] *((const byte*) SPRITES_ENABLE#0) ← (byte/word/signed word/dword/signed dword) $ff -- _deref_pbuc1=vbuc2 + //SEG123 init::@2 + //SEG124 [67] *((const byte*) SPRITES_ENABLE#0) ← (byte/word/signed word/dword/signed dword) $ff -- _deref_pbuc1=vbuc2 // Enable & initialize sprites lda #$ff sta SPRITES_ENABLE - //SEG122 [68] phi from init::@2 to init::@3 [phi:init::@2->init::@3] - //SEG123 [68] phi (byte) init::ss#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:init::@2->init::@3#0] -- vbuxx=vbuc1 + //SEG125 [68] phi from init::@2 to init::@3 [phi:init::@2->init::@3] + //SEG126 [68] phi (byte) init::ss#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:init::@2->init::@3#0] -- vbuxx=vbuc1 ldx #0 - //SEG124 [68] phi from init::@3 to init::@3 [phi:init::@3->init::@3] - //SEG125 [68] phi (byte) init::ss#2 = (byte) init::ss#1 [phi:init::@3->init::@3#0] -- register_copy - //SEG126 init::@3 + //SEG127 [68] phi from init::@3 to init::@3 [phi:init::@3->init::@3] + //SEG128 [68] phi (byte) init::ss#2 = (byte) init::ss#1 [phi:init::@3->init::@3#0] -- register_copy + //SEG129 init::@3 b3: - //SEG127 [69] *((const byte*) SPRITES_COLS#0 + (byte) init::ss#2) ← (const byte) GREEN#0 -- pbuc1_derefidx_vbuxx=vbuc2 + //SEG130 [69] *((const byte*) SPRITES_COLS#0 + (byte) init::ss#2) ← (const byte) GREEN#0 -- pbuc1_derefidx_vbuxx=vbuc2 lda #GREEN sta SPRITES_COLS,x - //SEG128 [70] (byte) init::ss#1 ← ++ (byte) init::ss#2 -- vbuxx=_inc_vbuxx + //SEG131 [70] (byte) init::ss#1 ← ++ (byte) init::ss#2 -- vbuxx=_inc_vbuxx inx - //SEG129 [71] if((byte) init::ss#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto init::@3 -- vbuxx_neq_vbuc1_then_la1 + //SEG132 [71] if((byte) init::ss#1!=(byte/signed byte/word/signed word/dword/signed dword) 8) goto init::@3 -- vbuxx_neq_vbuc1_then_la1 cpx #8 bne b3 - //SEG130 init::@4 - //SEG131 asm { sei } + //SEG133 init::@4 + //SEG134 asm { sei } // enable the interrupt sei - //SEG132 [73] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 -- _deref_pbuc1=vbuc2 + //SEG135 [73] *((const byte*) CIA1_INTERRUPT#0) ← (const byte) CIA_INTERRUPT_CLEAR#0 -- _deref_pbuc1=vbuc2 lda #CIA_INTERRUPT_CLEAR sta CIA1_INTERRUPT - //SEG133 [74] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 + //SEG136 [74] *((const byte*) IRQ_ENABLE#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 lda #IRQ_RASTER sta IRQ_ENABLE - //SEG134 [75] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 + //SEG137 [75] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 sta IRQ_STATUS - //SEG135 [76] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) plex_irq() -- _deref_pptc1=pprc2 + //SEG138 [76] *((const void()**) KERNEL_IRQ#0) ← &interrupt(KERNEL_MIN)(void()) plex_irq() -- _deref_pptc1=pprc2 lda #plex_irq sta KERNEL_IRQ+1 - //SEG136 asm { cli } + //SEG139 asm { cli } cli - //SEG137 init::@return - //SEG138 [78] return + //SEG140 init::@return + //SEG141 [78] return rts } -//SEG139 plexInit +//SEG142 plexInit // Initialize the multiplexer data structures plexInit: { - //SEG140 [80] phi from plexInit to plexInit::plexSetScreen1 [phi:plexInit->plexInit::plexSetScreen1] - //SEG141 plexInit::plexSetScreen1 - //SEG142 [81] phi from plexInit::plexSetScreen1 to plexInit::@1 [phi:plexInit::plexSetScreen1->plexInit::@1] - //SEG143 [81] phi (byte) plexInit::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexInit::plexSetScreen1->plexInit::@1#0] -- vbuxx=vbuc1 + //SEG143 [80] phi from plexInit to plexInit::plexSetScreen1 [phi:plexInit->plexInit::plexSetScreen1] + //SEG144 plexInit::plexSetScreen1 + //SEG145 [81] phi from plexInit::plexSetScreen1 to plexInit::@1 [phi:plexInit::plexSetScreen1->plexInit::@1] + //SEG146 [81] phi (byte) plexInit::i#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 [phi:plexInit::plexSetScreen1->plexInit::@1#0] -- vbuxx=vbuc1 ldx #0 - //SEG144 [81] phi from plexInit::@1 to plexInit::@1 [phi:plexInit::@1->plexInit::@1] - //SEG145 [81] phi (byte) plexInit::i#2 = (byte) plexInit::i#1 [phi:plexInit::@1->plexInit::@1#0] -- register_copy - //SEG146 plexInit::@1 + //SEG147 [81] phi from plexInit::@1 to plexInit::@1 [phi:plexInit::@1->plexInit::@1] + //SEG148 [81] phi (byte) plexInit::i#2 = (byte) plexInit::i#1 [phi:plexInit::@1->plexInit::@1#0] -- register_copy + //SEG149 plexInit::@1 b1: - //SEG147 [82] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexInit::i#2) ← (byte) plexInit::i#2 -- pbuc1_derefidx_vbuxx=vbuxx + //SEG150 [82] *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plexInit::i#2) ← (byte) plexInit::i#2 -- pbuc1_derefidx_vbuxx=vbuxx txa sta PLEX_SORTED_IDX,x - //SEG148 [83] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2 -- vbuxx=_inc_vbuxx + //SEG151 [83] (byte) plexInit::i#1 ← ++ (byte) plexInit::i#2 -- vbuxx=_inc_vbuxx inx - //SEG149 [84] if((byte) plexInit::i#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto plexInit::@1 -- vbuxx_neq_vbuc1_then_la1 + //SEG152 [84] if((byte) plexInit::i#1!=(const byte) PLEX_COUNT#0-(byte/signed byte/word/signed word/dword/signed dword) 1+(byte/signed byte/word/signed word/dword/signed dword) 1) goto plexInit::@1 -- vbuxx_neq_vbuc1_then_la1 cpx #PLEX_COUNT-1+1 bne b1 - //SEG150 plexInit::@return - //SEG151 [85] return + //SEG153 plexInit::@return + //SEG154 [85] return rts } -//SEG152 plex_irq +//SEG155 plex_irq plex_irq: { - .label _4 = 5 - //SEG153 entry interrupt(KERNEL_MIN) - //SEG154 [86] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 + .label _4 = $f + //SEG156 entry interrupt(KERNEL_MIN) + //SEG157 [86] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 lda #WHITE sta BORDERCOL - //SEG155 [87] phi from plex_irq plex_irq::@7 to plex_irq::@3 [phi:plex_irq/plex_irq::@7->plex_irq::@3] - //SEG156 [87] phi (byte) plex_sprite_msb#29 = (byte) plex_sprite_msb#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#0] -- register_copy - //SEG157 [87] phi (byte) plex_free_next#27 = (byte) plex_free_next#31 [phi:plex_irq/plex_irq::@7->plex_irq::@3#1] -- register_copy - //SEG158 [87] phi (byte) plex_show_idx#27 = (byte) plex_show_idx#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#2] -- register_copy - //SEG159 [87] phi (byte) plex_sprite_idx#25 = (byte) plex_sprite_idx#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#3] -- register_copy - //SEG160 plex_irq::@3 + //SEG158 [87] phi from plex_irq plex_irq::@7 to plex_irq::@3 [phi:plex_irq/plex_irq::@7->plex_irq::@3] + //SEG159 [87] phi (byte) plex_sprite_msb#29 = (byte) plex_sprite_msb#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#0] -- register_copy + //SEG160 [87] phi (byte) plex_free_next#27 = (byte) plex_free_next#31 [phi:plex_irq/plex_irq::@7->plex_irq::@3#1] -- register_copy + //SEG161 [87] phi (byte) plex_show_idx#27 = (byte) plex_show_idx#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#2] -- register_copy + //SEG162 [87] phi (byte) plex_sprite_idx#25 = (byte) plex_sprite_idx#0 [phi:plex_irq/plex_irq::@7->plex_irq::@3#3] -- register_copy + //SEG163 plex_irq::@3 b3: - //SEG161 [88] call plexShowSprite + //SEG164 [88] call plexShowSprite jsr plexShowSprite - //SEG162 plex_irq::plexFreeNextYpos1 - //SEG163 [89] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte[8]) PLEX_FREE_YPOS#0 + (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0) -- vbuxx=pbuc1_derefidx_vbuz1 + //SEG165 plex_irq::plexFreeNextYpos1 + //SEG166 [89] (byte) plex_irq::plexFreeNextYpos1_return#0 ← *((const byte[8]) PLEX_FREE_YPOS#0 + (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0) -- vbuxx=pbuc1_derefidx_vbuz1 ldy plexShowSprite.plexFreeAdd1__2 ldx PLEX_FREE_YPOS,y - //SEG164 plex_irq::@6 - //SEG165 [90] (byte/signed word/word/dword/signed dword~) plex_irq::$4 ← *((const byte*) RASTER#0) + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuz1=_deref_pbuc1_plus_2 + //SEG167 plex_irq::@6 + //SEG168 [90] (byte/signed word/word/dword/signed dword~) plex_irq::$4 ← *((const byte*) RASTER#0) + (byte/signed byte/word/signed word/dword/signed dword) 2 -- vbuz1=_deref_pbuc1_plus_2 lda RASTER clc adc #2 sta _4 - //SEG166 [91] if((byte) plex_show_idx#16<(const byte) PLEX_COUNT#0) goto plex_irq::@7 -- vbuz1_lt_vbuc1_then_la1 + //SEG169 [91] if((byte) plex_show_idx#16<(const byte) PLEX_COUNT#0) goto plex_irq::@7 -- vbuz1_lt_vbuc1_then_la1 lda plex_show_idx cmp #PLEX_COUNT bcc b7 - //SEG167 plex_irq::@4 + //SEG170 plex_irq::@4 b4: - //SEG168 [92] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 + //SEG171 [92] *((const byte*) IRQ_STATUS#0) ← (const byte) IRQ_RASTER#0 -- _deref_pbuc1=vbuc2 lda #IRQ_RASTER sta IRQ_STATUS - //SEG169 [93] if((byte) plex_show_idx#16<(const byte) PLEX_COUNT#0) goto plex_irq::@1 -- vbuz1_lt_vbuc1_then_la1 + //SEG172 [93] if((byte) plex_show_idx#16<(const byte) PLEX_COUNT#0) goto plex_irq::@1 -- vbuz1_lt_vbuc1_then_la1 lda plex_show_idx cmp #PLEX_COUNT bcc b1 - //SEG170 plex_irq::@5 - //SEG171 [94] (bool) framedone#3 ← true -- vboz1=vboc1 + //SEG173 plex_irq::@5 + //SEG174 [94] (bool) framedone#3 ← true -- vboz1=vboc1 lda #1 sta framedone - //SEG172 plex_irq::@2 + //SEG175 plex_irq::@2 b2: - //SEG173 [95] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2 + //SEG176 [95] *((const byte*) BORDERCOL#0) ← (byte/signed byte/word/signed word/dword/signed dword) 0 -- _deref_pbuc1=vbuc2 lda #0 sta BORDERCOL - //SEG174 plex_irq::@return - //SEG175 [96] return - exit interrupt(KERNEL_MIN) + //SEG177 plex_irq::@return + //SEG178 [96] return - exit interrupt(KERNEL_MIN) jmp $ea81 - //SEG176 plex_irq::@1 + //SEG179 plex_irq::@1 b1: - //SEG177 [97] *((const byte*) RASTER#0) ← (byte) plex_irq::plexFreeNextYpos1_return#0 -- _deref_pbuc1=vbuxx + //SEG180 [97] *((const byte*) RASTER#0) ← (byte) plex_irq::plexFreeNextYpos1_return#0 -- _deref_pbuc1=vbuxx stx RASTER jmp b2 - //SEG178 plex_irq::@7 + //SEG181 plex_irq::@7 b7: - //SEG179 [98] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte/signed word/word/dword/signed dword~) plex_irq::$4) goto plex_irq::@3 -- vbuxx_lt_vbuz1_then_la1 + //SEG182 [98] if((byte) plex_irq::plexFreeNextYpos1_return#0<(byte/signed word/word/dword/signed dword~) plex_irq::$4) goto plex_irq::@3 -- vbuxx_lt_vbuz1_then_la1 cpx _4 bcc b3 jmp b4 } -//SEG180 plexShowSprite +//SEG183 plexShowSprite // Show the next sprite. // plexSort() prepares showing the sprites plexShowSprite: { - .label _7 = 8 - .label plex_sprite_idx2 = 5 - .label plexFreeAdd1__2 = $a - //SEG181 [99] (byte) plexShowSprite::plex_sprite_idx2#0 ← (byte) plex_sprite_idx#25 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_rol_1 + .label _7 = 7 + .label plex_sprite_idx2 = $f + .label plexFreeAdd1__2 = 9 + //SEG184 [99] (byte) plexShowSprite::plex_sprite_idx2#0 ← (byte) plex_sprite_idx#25 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz2_rol_1 lda plex_sprite_idx asl sta plex_sprite_idx2 - //SEG182 [100] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27)) -- vbuaa=pbuc1_derefidx_pbuc2_derefidx_vbuz1 + //SEG185 [100] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte[PLEX_COUNT#0]) PLEX_YPOS#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27)) -- vbuaa=pbuc1_derefidx_pbuc2_derefidx_vbuz1 ldx plex_show_idx ldy PLEX_SORTED_IDX,x lda PLEX_YPOS,y - //SEG183 [101] *((const byte*) SPRITES_YPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 -- pbuc1_derefidx_vbuz1=vbuaa + //SEG186 [101] *((const byte*) SPRITES_YPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 -- pbuc1_derefidx_vbuz1=vbuaa ldy plex_sprite_idx2 sta SPRITES_YPOS,y - //SEG184 plexShowSprite::plexFreeAdd1 - //SEG185 [102] (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$0#0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte/signed byte/word/signed word/dword/signed dword) $15 -- vbuaa=vbuaa_plus_vbuc1 + //SEG187 plexShowSprite::plexFreeAdd1 + //SEG188 [102] (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$0#0 ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 + (byte/signed byte/word/signed word/dword/signed dword) $15 -- vbuaa=vbuaa_plus_vbuc1 clc adc #$15 - //SEG186 [103] *((const byte[8]) PLEX_FREE_YPOS#0 + (byte) plex_free_next#27) ← (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$0#0 -- pbuc1_derefidx_vbuz1=vbuaa + //SEG189 [103] *((const byte[8]) PLEX_FREE_YPOS#0 + (byte) plex_free_next#27) ← (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$0#0 -- pbuc1_derefidx_vbuz1=vbuaa ldy plex_free_next_27 sta PLEX_FREE_YPOS,y - //SEG187 [104] (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$1#0 ← (byte) plex_free_next#27 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=vbuz1_plus_1 + //SEG190 [104] (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$1#0 ← (byte) plex_free_next#27 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=vbuz1_plus_1 ldx plex_free_next_27 inx - //SEG188 [105] (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 ← (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$1#0 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuz1=vbuxx_band_vbuc1 + //SEG191 [105] (byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 ← (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$1#0 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuz1=vbuxx_band_vbuc1 lda #7 sax plexFreeAdd1__2 - //SEG189 plexShowSprite::@5 - //SEG190 [106] *((const byte*) PLEX_SCREEN_PTR#0 + (byte) plex_sprite_idx#25) ← *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27)) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_pbuc3_derefidx_vbuz2 + //SEG192 plexShowSprite::@5 + //SEG193 [106] *((const byte*) PLEX_SCREEN_PTR#0 + (byte) plex_sprite_idx#25) ← *((const byte[PLEX_COUNT#0]) PLEX_PTR#0 + *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27)) -- pbuc1_derefidx_vbuz1=pbuc2_derefidx_pbuc3_derefidx_vbuz2 ldx plex_show_idx ldy PLEX_SORTED_IDX,x lda PLEX_PTR,y ldx plex_sprite_idx sta PLEX_SCREEN_PTR,x - //SEG191 [107] (byte) plexShowSprite::xpos_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27) << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=pbuc1_derefidx_vbuz1_rol_1 + //SEG194 [107] (byte) plexShowSprite::xpos_idx#0 ← *((const byte[PLEX_COUNT#0]) PLEX_SORTED_IDX#0 + (byte) plex_show_idx#27) << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=pbuc1_derefidx_vbuz1_rol_1 ldx plex_show_idx lda PLEX_SORTED_IDX,x asl tax - //SEG192 [108] (byte~) plexShowSprite::$3 ← < *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::xpos_idx#0) -- vbuaa=_lo_pwuc1_derefidx_vbuxx + //SEG195 [108] (byte~) plexShowSprite::$3 ← < *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::xpos_idx#0) -- vbuaa=_lo_pwuc1_derefidx_vbuxx lda PLEX_XPOS,x - //SEG193 [109] *((const byte*) SPRITES_XPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$3 -- pbuc1_derefidx_vbuz1=vbuaa + //SEG196 [109] *((const byte*) SPRITES_XPOS#0 + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte~) plexShowSprite::$3 -- pbuc1_derefidx_vbuz1=vbuaa ldy plex_sprite_idx2 sta SPRITES_XPOS,y - //SEG194 [110] (byte~) plexShowSprite::$4 ← > *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::xpos_idx#0) -- vbuaa=_hi_pwuc1_derefidx_vbuxx + //SEG197 [110] (byte~) plexShowSprite::$4 ← > *((const word[PLEX_COUNT#0]) PLEX_XPOS#0 + (byte) plexShowSprite::xpos_idx#0) -- vbuaa=_hi_pwuc1_derefidx_vbuxx lda PLEX_XPOS+1,x - //SEG195 [111] if((byte~) plexShowSprite::$4!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@1 -- vbuaa_neq_0_then_la1 + //SEG198 [111] if((byte~) plexShowSprite::$4!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@1 -- vbuaa_neq_0_then_la1 cmp #0 bne b1 - //SEG196 plexShowSprite::@3 - //SEG197 [112] (byte/word/dword~) plexShowSprite::$10 ← (byte/word/signed word/dword/signed dword) $ff ^ (byte) plex_sprite_msb#29 -- vbuaa=vbuc1_bxor_vbuz1 + //SEG199 plexShowSprite::@3 + //SEG200 [112] (byte/word/dword~) plexShowSprite::$10 ← (byte/word/signed word/dword/signed dword) $ff ^ (byte) plex_sprite_msb#29 -- vbuaa=vbuc1_bxor_vbuz1 lda plex_sprite_msb eor #$ff - //SEG198 [113] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte/word/dword~) plexShowSprite::$10 -- _deref_pbuc1=_deref_pbuc1_band_vbuaa + //SEG201 [113] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) & (byte/word/dword~) plexShowSprite::$10 -- _deref_pbuc1=_deref_pbuc1_band_vbuaa and SPRITES_XMSB sta SPRITES_XMSB - //SEG199 plexShowSprite::@2 + //SEG202 plexShowSprite::@2 b2: - //SEG200 [114] (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 ← (byte) plex_sprite_idx#25 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=vbuz1_plus_1 + //SEG203 [114] (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 ← (byte) plex_sprite_idx#25 + (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuxx=vbuz1_plus_1 ldx plex_sprite_idx inx - //SEG201 [115] (byte/word/dword~) plexShowSprite::$7 ← (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuz1=vbuxx_band_vbuc1 + //SEG204 [115] (byte/word/dword~) plexShowSprite::$7 ← (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 & (byte/signed byte/word/signed word/dword/signed dword) 7 -- vbuz1=vbuxx_band_vbuc1 lda #7 sax _7 - //SEG202 [116] (byte) plex_show_idx#16 ← ++ (byte) plex_show_idx#27 -- vbuz1=_inc_vbuz1 + //SEG205 [116] (byte) plex_show_idx#16 ← ++ (byte) plex_show_idx#27 -- vbuz1=_inc_vbuz1 inc plex_show_idx - //SEG203 [117] (byte) plex_sprite_msb#27 ← (byte) plex_sprite_msb#29 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_rol_1 + //SEG206 [117] (byte) plex_sprite_msb#27 ← (byte) plex_sprite_msb#29 << (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuz1_rol_1 asl plex_sprite_msb - //SEG204 [118] if((byte) plex_sprite_msb#27!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@return -- vbuz1_neq_0_then_la1 + //SEG207 [118] if((byte) plex_sprite_msb#27!=(byte/signed byte/word/signed word/dword/signed dword) 0) goto plexShowSprite::@return -- vbuz1_neq_0_then_la1 lda plex_sprite_msb cmp #0 bne breturn - //SEG205 plexShowSprite::@4 - //SEG206 [119] (byte) plex_sprite_msb#4 ← (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuc1 + //SEG208 plexShowSprite::@4 + //SEG209 [119] (byte) plex_sprite_msb#4 ← (byte/signed byte/word/signed word/dword/signed dword) 1 -- vbuz1=vbuc1 lda #1 sta plex_sprite_msb - //SEG207 [120] phi from plexShowSprite::@2 plexShowSprite::@4 to plexShowSprite::@return [phi:plexShowSprite::@2/plexShowSprite::@4->plexShowSprite::@return] - //SEG208 [120] phi (byte) plex_sprite_msb#17 = (byte) plex_sprite_msb#27 [phi:plexShowSprite::@2/plexShowSprite::@4->plexShowSprite::@return#0] -- register_copy - //SEG209 plexShowSprite::@return + //SEG210 [120] phi from plexShowSprite::@2 plexShowSprite::@4 to plexShowSprite::@return [phi:plexShowSprite::@2/plexShowSprite::@4->plexShowSprite::@return] + //SEG211 [120] phi (byte) plex_sprite_msb#17 = (byte) plex_sprite_msb#27 [phi:plexShowSprite::@2/plexShowSprite::@4->plexShowSprite::@return#0] -- register_copy + //SEG212 plexShowSprite::@return breturn: - //SEG210 [121] return + //SEG213 [121] return rts - //SEG211 plexShowSprite::@1 + //SEG214 plexShowSprite::@1 b1: - //SEG212 [122] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) plex_sprite_msb#29 -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 + //SEG215 [122] *((const byte*) SPRITES_XMSB#0) ← *((const byte*) SPRITES_XMSB#0) | (byte) plex_sprite_msb#29 -- _deref_pbuc1=_deref_pbuc1_bor_vbuz1 lda SPRITES_XMSB ora 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 27d76d5c0..b19040834 100644 --- a/src/test/ref/multiplexer-irq/simple-multiplexer-irq.sym +++ b/src/test/ref/multiplexer-irq/simple-multiplexer-irq.sym @@ -142,8 +142,8 @@ (byte) init::sx#1 reg byte x 16.5 (byte) init::sx#2 reg byte x 8.8 (word) init::xp -(word) init::xp#1 xp zp ZP_WORD:6 7.333333333333333 -(word) init::xp#2 xp zp ZP_WORD:6 8.25 +(word) init::xp#1 xp zp ZP_WORD:5 7.333333333333333 +(word) init::xp#2 xp zp ZP_WORD:5 8.25 (void()) loop() (label) loop::@1 (label) loop::@2 @@ -152,16 +152,15 @@ (label) loop::@5 (label) loop::@6 (byte) loop::sin_idx -(byte) loop::sin_idx#0 sin_idx zp ZP_BYTE:3 4.0 (byte) loop::sin_idx#1 sin_idx zp ZP_BYTE:3 3.142857142857143 -(byte) loop::sin_idx#6 sin_idx zp ZP_BYTE:3 3.8888888888888893 +(byte) loop::sin_idx#6 sin_idx zp ZP_BYTE:3 3.666666666666667 (byte) loop::sy (byte) loop::sy#1 reg byte y 151.5 (byte) loop::sy#2 reg byte y 101.0 (byte) loop::y_idx -(byte) loop::y_idx#0 y_idx zp ZP_BYTE:4 22.0 -(byte) loop::y_idx#1 y_idx zp ZP_BYTE:4 67.33333333333333 -(byte) loop::y_idx#2 y_idx zp ZP_BYTE:4 157.0 +(byte) loop::y_idx#1 reg byte x 67.33333333333333 +(byte) loop::y_idx#2 reg byte x 157.0 +(byte~) loop::y_idx#4 reg byte x 22.0 (void()) main() (label) main::@1 (label) main::@return @@ -180,7 +179,7 @@ (byte~) plexShowSprite::$3 reg byte a 4.0 (byte~) plexShowSprite::$4 reg byte a 4.0 (byte/signed word/word/dword/signed dword~) plexShowSprite::$6 reg byte x 4.0 -(byte/word/dword~) plexShowSprite::$7 $7 zp ZP_BYTE:8 1.0833333333333333 +(byte/word/dword~) plexShowSprite::$7 $7 zp ZP_BYTE:7 1.0833333333333333 (label) plexShowSprite::@1 (label) plexShowSprite::@2 (label) plexShowSprite::@3 @@ -193,11 +192,11 @@ (byte/signed word/word/dword/signed dword~) plexShowSprite::plexFreeAdd1_$1 (byte/signed word/word/dword/signed dword) plexShowSprite::plexFreeAdd1_$1#0 reg byte x 4.0 (byte/word/dword~) plexShowSprite::plexFreeAdd1_$2 -(byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 plexFreeAdd1_$2 zp ZP_BYTE:10 1.0434782608695652 +(byte/word/dword) plexShowSprite::plexFreeAdd1_$2#0 plexFreeAdd1_$2 zp ZP_BYTE:9 1.0434782608695652 (byte) plexShowSprite::plexFreeAdd1_ypos (byte) plexShowSprite::plexFreeAdd1_ypos#0 reg byte a 3.0 (byte) plexShowSprite::plex_sprite_idx2 -(byte) plexShowSprite::plex_sprite_idx2#0 plex_sprite_idx2 zp ZP_BYTE:5 0.6000000000000001 +(byte) plexShowSprite::plex_sprite_idx2#0 plex_sprite_idx2 zp ZP_BYTE:15 0.6000000000000001 (byte) plexShowSprite::xpos_idx (byte) plexShowSprite::xpos_idx#0 reg byte x 2.0 (byte) plexShowSprite::ypos @@ -211,12 +210,12 @@ (label) plexSort::@7 (label) plexSort::@return (byte) plexSort::m -(byte) plexSort::m#1 m zp ZP_BYTE:5 151.5 -(byte) plexSort::m#2 m zp ZP_BYTE:5 42.08333333333333 +(byte) plexSort::m#1 m zp ZP_BYTE:4 151.5 +(byte) plexSort::m#2 m zp ZP_BYTE:4 42.08333333333333 (byte) plexSort::nxt_idx -(byte) plexSort::nxt_idx#0 nxt_idx zp ZP_BYTE:12 30.299999999999997 +(byte) plexSort::nxt_idx#0 nxt_idx zp ZP_BYTE:11 30.299999999999997 (byte) plexSort::nxt_y -(byte) plexSort::nxt_y#0 nxt_y zp ZP_BYTE:13 150.375 +(byte) plexSort::nxt_y#0 nxt_y zp ZP_BYTE:12 150.375 (label) plexSort::plexFreePrepare1 (bool~) plexSort::plexFreePrepare1_$0 (label) plexSort::plexFreePrepare1_@1 @@ -230,11 +229,11 @@ (byte) plexSort::s#3 reg byte x 2052.5 (byte~) plexSort::s#6 reg byte x 202.0 (byte) plex_free_next -(byte) plex_free_next#0 plex_free_next zp ZP_BYTE:15 20.0 -(byte) plex_free_next#27 plex_free_next#27 zp ZP_BYTE:10 2.8333333333333335 -(byte) plex_free_next#31 plex_free_next#31 zp ZP_BYTE:10 4.0 +(byte) plex_free_next#0 plex_free_next zp ZP_BYTE:14 20.0 +(byte) plex_free_next#27 plex_free_next#27 zp ZP_BYTE:9 2.8333333333333335 +(byte) plex_free_next#31 plex_free_next#31 zp ZP_BYTE:9 4.0 interrupt(KERNEL_MIN)(void()) plex_irq() -(byte/signed word/word/dword/signed dword~) plex_irq::$4 $4 zp ZP_BYTE:5 11.0 +(byte/signed word/word/dword/signed dword~) plex_irq::$4 $4 zp ZP_BYTE:15 11.0 (label) plex_irq::@1 (label) plex_irq::@2 (label) plex_irq::@3 @@ -248,44 +247,45 @@ interrupt(KERNEL_MIN)(void()) plex_irq() (byte) plex_irq::plexFreeNextYpos1_return#0 reg byte x 4.0 (byte) plex_irq::rasterY (byte) plex_show_idx -(byte) plex_show_idx#0 plex_show_idx zp ZP_BYTE:9 4.0 -(byte) plex_show_idx#1 plex_show_idx zp ZP_BYTE:9 20.0 -(byte) plex_show_idx#16 plex_show_idx zp ZP_BYTE:9 2.1666666666666665 -(byte) plex_show_idx#27 plex_show_idx zp ZP_BYTE:9 1.1052631578947367 +(byte) plex_show_idx#0 plex_show_idx zp ZP_BYTE:8 4.0 +(byte) plex_show_idx#1 plex_show_idx zp ZP_BYTE:8 20.0 +(byte) plex_show_idx#16 plex_show_idx zp ZP_BYTE:8 2.1666666666666665 +(byte) plex_show_idx#27 plex_show_idx zp ZP_BYTE:8 1.1052631578947367 (byte) plex_sprite_idx -(byte) plex_sprite_idx#0 plex_sprite_idx zp ZP_BYTE:8 4.0 -(byte) plex_sprite_idx#1 plex_sprite_idx#1 zp ZP_BYTE:14 20.0 -(byte) plex_sprite_idx#25 plex_sprite_idx zp ZP_BYTE:8 1.1176470588235294 +(byte) plex_sprite_idx#0 plex_sprite_idx zp ZP_BYTE:7 4.0 +(byte) plex_sprite_idx#1 plex_sprite_idx#1 zp ZP_BYTE:13 20.0 +(byte) plex_sprite_idx#25 plex_sprite_idx zp ZP_BYTE:7 1.1176470588235294 (byte) plex_sprite_msb -(byte) plex_sprite_msb#0 plex_sprite_msb zp ZP_BYTE:11 4.0 -(byte) plex_sprite_msb#1 plex_sprite_msb zp ZP_BYTE:11 20.0 -(byte) plex_sprite_msb#17 plex_sprite_msb zp ZP_BYTE:11 2.142857142857143 -(byte) plex_sprite_msb#27 plex_sprite_msb zp ZP_BYTE:11 3.0 -(byte) plex_sprite_msb#29 plex_sprite_msb zp ZP_BYTE:11 0.95 -(byte) plex_sprite_msb#4 plex_sprite_msb zp ZP_BYTE:11 4.0 +(byte) plex_sprite_msb#0 plex_sprite_msb zp ZP_BYTE:10 4.0 +(byte) plex_sprite_msb#1 plex_sprite_msb zp ZP_BYTE:10 20.0 +(byte) plex_sprite_msb#17 plex_sprite_msb zp ZP_BYTE:10 2.142857142857143 +(byte) plex_sprite_msb#27 plex_sprite_msb zp ZP_BYTE:10 3.0 +(byte) plex_sprite_msb#29 plex_sprite_msb zp ZP_BYTE:10 0.95 +(byte) plex_sprite_msb#4 plex_sprite_msb zp ZP_BYTE:10 4.0 zp ZP_BOOL:2 [ framedone#12 framedone#19 framedone#5 framedone#3 ] -zp ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#0 loop::sin_idx#1 ] -zp ZP_BYTE:4 [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#0 ] +zp ZP_BYTE:3 [ loop::sin_idx#6 loop::sin_idx#1 ] +reg byte x [ loop::y_idx#2 loop::y_idx#1 loop::y_idx#4 ] reg byte y [ loop::sy#2 loop::sy#1 ] -zp ZP_BYTE:5 [ plexSort::m#2 plexSort::m#1 plex_irq::$4 plexShowSprite::plex_sprite_idx2#0 ] +zp ZP_BYTE:4 [ plexSort::m#2 plexSort::m#1 ] 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 [ init::sx#2 init::sx#1 ] -zp ZP_WORD:6 [ init::xp#2 init::xp#1 ] +zp ZP_WORD:5 [ init::xp#2 init::xp#1 ] reg byte x [ init::ss#2 init::ss#1 ] reg byte x [ plexInit::i#2 plexInit::i#1 ] -zp ZP_BYTE:8 [ plex_sprite_idx#25 plex_sprite_idx#0 plexShowSprite::$7 ] -zp ZP_BYTE:9 [ plex_show_idx#27 plex_show_idx#0 plex_show_idx#16 plex_show_idx#1 ] -zp ZP_BYTE:10 [ plex_free_next#27 plex_free_next#31 plexShowSprite::plexFreeAdd1_$2#0 ] -zp ZP_BYTE:11 [ plex_sprite_msb#29 plex_sprite_msb#0 plex_sprite_msb#17 plex_sprite_msb#27 plex_sprite_msb#4 plex_sprite_msb#1 ] -zp ZP_BYTE:12 [ plexSort::nxt_idx#0 ] -zp ZP_BYTE:13 [ plexSort::nxt_y#0 ] +zp ZP_BYTE:7 [ plex_sprite_idx#25 plex_sprite_idx#0 plexShowSprite::$7 ] +zp ZP_BYTE:8 [ plex_show_idx#27 plex_show_idx#0 plex_show_idx#16 plex_show_idx#1 ] +zp ZP_BYTE:9 [ plex_free_next#27 plex_free_next#31 plexShowSprite::plexFreeAdd1_$2#0 ] +zp ZP_BYTE:10 [ plex_sprite_msb#29 plex_sprite_msb#0 plex_sprite_msb#17 plex_sprite_msb#27 plex_sprite_msb#4 plex_sprite_msb#1 ] +zp ZP_BYTE:11 [ plexSort::nxt_idx#0 ] +zp ZP_BYTE:12 [ plexSort::nxt_y#0 ] reg byte x [ plexSort::s#2 ] -zp ZP_BYTE:14 [ plex_sprite_idx#1 ] -zp ZP_BYTE:15 [ plex_free_next#0 ] +zp ZP_BYTE:13 [ plex_sprite_idx#1 ] +zp ZP_BYTE:14 [ plex_free_next#0 ] reg byte a [ init::$7 ] reg byte x [ plex_irq::plexFreeNextYpos1_return#0 ] +zp ZP_BYTE:15 [ plex_irq::$4 plexShowSprite::plex_sprite_idx2#0 ] reg byte a [ plexShowSprite::plexFreeAdd1_ypos#0 ] reg byte a [ plexShowSprite::plexFreeAdd1_$0#0 ] reg byte x [ plexShowSprite::plexFreeAdd1_$1#0 ]