diff --git a/src/main/kc/stdlib/c64.kc b/src/main/kc/stdlib/c64.kc index c3ac15e89..42d5083cb 100644 --- a/src/main/kc/stdlib/c64.kc +++ b/src/main/kc/stdlib/c64.kc @@ -126,20 +126,20 @@ const byte LIGHT_GREY = $f; // Get the value to store into D018 to display a specific screen and charset/bitmap // Optimized for ASM from (byte)((((word)screen&$3fff)/$40)|(((word)charset&$3fff)/$400)); inline byte toD018(byte* screen, byte* gfx) { - return (>((((word)screen&$3fff)<<2)))|(((>((word)gfx))>>2)&$f); + return (>((((word)screen&$3fff)*4)))|(((>((word)gfx))/4)&$f); } // Get the value to store into DD00 (CIA 2 port A) to choose a specific VIC bank // Optimized for ASM from %00000011 ^ (byte)((word)gfx/$4000) inline byte toDd00(byte* gfx) { - return %00000011 ^ (>((word)gfx))>>6; + return %00000011 ^ (>((word)gfx))/$40; } // Get the sprite pointer for a sprite. // The sprite pointer is the index of the sprite within the graphics bank and equal to the sprite (byte)(sprite_addr/64) // The sprite pointers are stored SCREEN+$3f8+sprite_id to set the pointer of each sprite inline byte toSpritePtr(byte* sprite) { - return (byte)(((word)sprite)>>6); + return (byte)(((word)sprite)/$40); } // Select a specific VIC graphics bank by setting the CIA 2 port A ($dd00) as needed diff --git a/src/test/ref/complex/tetris/test-sprites.asm b/src/test/ref/complex/tetris/test-sprites.asm index 0e8127faf..296aab255 100644 --- a/src/test/ref/complex/tetris/test-sprites.asm +++ b/src/test/ref/complex/tetris/test-sprites.asm @@ -60,7 +60,7 @@ .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS // The line of the first IRQ .const IRQ_RASTER_FIRST = SPRITES_FIRST_YPOS+$13 - .const toSpritePtr1_return = PLAYFIELD_SPRITES>>6 + .const toSpritePtr1_return = PLAYFIELD_SPRITES/$40 .label render_screen_showing = 5 .label irq_raster_next = 6 .label irq_sprite_ypos = 7 @@ -86,9 +86,9 @@ bbegin: jsr main rts main: { - .const toSpritePtr2_return = SIN_SPRITE>>6 - .const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_SCREEN_1)>>6 - .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)<<2)|(>PLAYFIELD_CHARSET)>>2&$f + .const toSpritePtr2_return = SIN_SPRITE/$40 + .const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_SCREEN_1)/$40 + .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)*4)|(>PLAYFIELD_CHARSET)/4&$f .label xpos = 2 .label ypos = 3 lda #3 @@ -222,7 +222,7 @@ sprites_init: { // Repeats 10 timers every 2 lines from line IRQ_RASTER_FIRST // Utilizes duplicated gfx in the sprites to allow for some leeway in updating the sprite pointers sprites_irq: { - .const toSpritePtr2_return = PLAYFIELD_SPRITES>>6 + .const toSpritePtr2_return = PLAYFIELD_SPRITES/$40 .label raster_sprite_gfx_modify = 4 sta rega+1 stx regx+1 diff --git a/src/test/ref/complex/tetris/test-sprites.log b/src/test/ref/complex/tetris/test-sprites.log index eef6203fd..c3c6cf950 100644 --- a/src/test/ref/complex/tetris/test-sprites.log +++ b/src/test/ref/complex/tetris/test-sprites.log @@ -186,8 +186,8 @@ toSpritePtr1: scope:[] from @5 (byte) irq_sprite_ypos#22 ← phi( @5/(byte) irq_sprite_ypos#0 ) (byte*) toSpritePtr1_sprite#1 ← phi( @5/(byte*) toSpritePtr1_sprite#0 ) (word) toSpritePtr1_$0#0 ← ((word)) (byte*) toSpritePtr1_sprite#1 - (word) toSpritePtr1_$1#0 ← (word) toSpritePtr1_$0#0 >> (byte/signed byte/word/signed word/dword/signed dword) 6 - (byte) toSpritePtr1_$2#0 ← ((byte)) (word) toSpritePtr1_$1#0 + (word/signed dword/dword) toSpritePtr1_$1#0 ← (word) toSpritePtr1_$0#0 / (byte/signed byte/word/signed word/dword/signed dword) $40 + (byte) toSpritePtr1_$2#0 ← ((byte)) (word/signed dword/dword) toSpritePtr1_$1#0 (byte) toSpritePtr1_return#0 ← (byte) toSpritePtr1_$2#0 to:toSpritePtr1_@return toSpritePtr1_@return: scope:[] from toSpritePtr1 @@ -307,8 +307,8 @@ sprites_irq::toSpritePtr2: scope:[sprites_irq] from sprites_irq::@3 (byte) irq_raster_next#19 ← phi( sprites_irq::@3/(byte) irq_raster_next#1 ) (byte*) sprites_irq::toSpritePtr2_sprite#1 ← phi( sprites_irq::@3/(byte*) sprites_irq::toSpritePtr2_sprite#0 ) (word) sprites_irq::toSpritePtr2_$0#0 ← ((word)) (byte*) sprites_irq::toSpritePtr2_sprite#1 - (word) sprites_irq::toSpritePtr2_$1#0 ← (word) sprites_irq::toSpritePtr2_$0#0 >> (byte/signed byte/word/signed word/dword/signed dword) 6 - (byte) sprites_irq::toSpritePtr2_$2#0 ← ((byte)) (word) sprites_irq::toSpritePtr2_$1#0 + (word/signed dword/dword) sprites_irq::toSpritePtr2_$1#0 ← (word) sprites_irq::toSpritePtr2_$0#0 / (byte/signed byte/word/signed word/dword/signed dword) $40 + (byte) sprites_irq::toSpritePtr2_$2#0 ← ((byte)) (word/signed dword/dword) sprites_irq::toSpritePtr2_$1#0 (byte) sprites_irq::toSpritePtr2_return#0 ← (byte) sprites_irq::toSpritePtr2_$2#0 to:sprites_irq::toSpritePtr2_@return sprites_irq::toSpritePtr2_@return: scope:[sprites_irq] from sprites_irq::toSpritePtr2 @@ -402,8 +402,8 @@ main::vicSelectGfxBank1_toDd001: scope:[main] from main::vicSelectGfxBank1 (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 ← phi( main::vicSelectGfxBank1/(byte*) main::vicSelectGfxBank1_toDd001_gfx#0 ) (word) main::vicSelectGfxBank1_toDd001_$0#0 ← ((word)) (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 (byte) main::vicSelectGfxBank1_toDd001_$1#0 ← > (word) main::vicSelectGfxBank1_toDd001_$0#0 - (byte) main::vicSelectGfxBank1_toDd001_$2#0 ← (byte) main::vicSelectGfxBank1_toDd001_$1#0 >> (byte/signed byte/word/signed word/dword/signed dword) 6 - (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte) main::vicSelectGfxBank1_toDd001_$2#0 + (byte/signed word/word/dword/signed dword) main::vicSelectGfxBank1_toDd001_$2#0 ← (byte) main::vicSelectGfxBank1_toDd001_$1#0 / (byte/signed byte/word/signed word/dword/signed dword) $40 + (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte/signed word/word/dword/signed dword) main::vicSelectGfxBank1_toDd001_$2#0 (byte) main::vicSelectGfxBank1_toDd001_return#0 ← (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 to:main::vicSelectGfxBank1_toDd001_@return main::vicSelectGfxBank1_toDd001_@return: scope:[main] from main::vicSelectGfxBank1_toDd001 @@ -428,14 +428,14 @@ main::toD0181: scope:[main] from main::@3 (byte*) main::toD0181_screen#1 ← phi( main::@3/(byte*) main::toD0181_screen#0 ) (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1 (word) main::toD0181_$1#0 ← (word) main::toD0181_$0#0 & (word/signed word/dword/signed dword) $3fff - (word) main::toD0181_$2#0 ← (word) main::toD0181_$1#0 << (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0181_$3#0 ← > (word) main::toD0181_$2#0 + (word/signed dword/dword) main::toD0181_$2#0 ← (word) main::toD0181_$1#0 * (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word) main::toD0181_$3#0 ← > (word/signed dword/dword) main::toD0181_$2#0 (word) main::toD0181_$4#0 ← ((word)) (byte*) main::toD0181_gfx#1 (byte) main::toD0181_$5#0 ← > (word) main::toD0181_$4#0 - (byte) main::toD0181_$6#0 ← (byte) main::toD0181_$5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0181_$7#0 ← (byte) main::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f - (byte) main::toD0181_$8#0 ← (byte) main::toD0181_$3#0 | (byte) main::toD0181_$7#0 - (byte) main::toD0181_return#0 ← (byte) main::toD0181_$8#0 + (byte/signed word/word/dword/signed dword) main::toD0181_$6#0 ← (byte) main::toD0181_$5#0 / (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word/dword) main::toD0181_$7#0 ← (byte/signed word/word/dword/signed dword) main::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f + (byte/word/dword) main::toD0181_$8#0 ← (byte/word) main::toD0181_$3#0 | (byte/word/dword) main::toD0181_$7#0 + (byte) main::toD0181_return#0 ← (byte/word/dword) main::toD0181_$8#0 to:main::toD0181_@return main::toD0181_@return: scope:[main] from main::toD0181 (byte) sin_idx#26 ← phi( main::toD0181/(byte) sin_idx#27 ) @@ -476,8 +476,8 @@ main::toSpritePtr2: scope:[main] from main::@1 (byte) main::s#5 ← phi( main::@1/(byte) main::s#2 ) (byte*) main::toSpritePtr2_sprite#1 ← phi( main::@1/(byte*) main::toSpritePtr2_sprite#0 ) (word) main::toSpritePtr2_$0#0 ← ((word)) (byte*) main::toSpritePtr2_sprite#1 - (word) main::toSpritePtr2_$1#0 ← (word) main::toSpritePtr2_$0#0 >> (byte/signed byte/word/signed word/dword/signed dword) 6 - (byte) main::toSpritePtr2_$2#0 ← ((byte)) (word) main::toSpritePtr2_$1#0 + (word/signed dword/dword) main::toSpritePtr2_$1#0 ← (word) main::toSpritePtr2_$0#0 / (byte/signed byte/word/signed word/dword/signed dword) $40 + (byte) main::toSpritePtr2_$2#0 ← ((byte)) (word/signed dword/dword) main::toSpritePtr2_$1#0 (byte) main::toSpritePtr2_return#0 ← (byte) main::toSpritePtr2_$2#0 to:main::toSpritePtr2_@return main::toSpritePtr2_@return: scope:[main] from main::toSpritePtr2 @@ -930,20 +930,20 @@ SYMBOL TABLE SSA (word) main::toD0181_$0#0 (word~) main::toD0181_$1 (word) main::toD0181_$1#0 -(word~) main::toD0181_$2 -(word) main::toD0181_$2#0 -(byte~) main::toD0181_$3 -(byte) main::toD0181_$3#0 +(word/signed dword/dword~) main::toD0181_$2 +(word/signed dword/dword) main::toD0181_$2#0 +(byte/word~) main::toD0181_$3 +(byte/word) main::toD0181_$3#0 (word~) main::toD0181_$4 (word) main::toD0181_$4#0 (byte~) main::toD0181_$5 (byte) main::toD0181_$5#0 -(byte~) main::toD0181_$6 -(byte) main::toD0181_$6#0 -(byte~) main::toD0181_$7 -(byte) main::toD0181_$7#0 -(byte~) main::toD0181_$8 -(byte) main::toD0181_$8#0 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/signed word/word/dword/signed dword) main::toD0181_$6#0 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword) main::toD0181_$7#0 +(byte/word/dword~) main::toD0181_$8 +(byte/word/dword) main::toD0181_$8#0 (label) main::toD0181_@return (byte*) main::toD0181_gfx (byte*) main::toD0181_gfx#0 @@ -959,8 +959,8 @@ SYMBOL TABLE SSA (label) main::toSpritePtr2 (word~) main::toSpritePtr2_$0 (word) main::toSpritePtr2_$0#0 -(word~) main::toSpritePtr2_$1 -(word) main::toSpritePtr2_$1#0 +(word/signed dword/dword~) main::toSpritePtr2_$1 +(word/signed dword/dword) main::toSpritePtr2_$1#0 (byte~) main::toSpritePtr2_$2 (byte) main::toSpritePtr2_$2#0 (label) main::toSpritePtr2_@return @@ -984,8 +984,8 @@ SYMBOL TABLE SSA (word) main::vicSelectGfxBank1_toDd001_$0#0 (byte~) main::vicSelectGfxBank1_toDd001_$1 (byte) main::vicSelectGfxBank1_toDd001_$1#0 -(byte~) main::vicSelectGfxBank1_toDd001_$2 -(byte) main::vicSelectGfxBank1_toDd001_$2#0 +(byte/signed word/word/dword/signed dword~) main::vicSelectGfxBank1_toDd001_$2 +(byte/signed word/word/dword/signed dword) main::vicSelectGfxBank1_toDd001_$2#0 (byte/word/dword~) main::vicSelectGfxBank1_toDd001_$3 (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 (label) main::vicSelectGfxBank1_toDd001_@return @@ -1116,8 +1116,8 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() (label) sprites_irq::toSpritePtr2 (word~) sprites_irq::toSpritePtr2_$0 (word) sprites_irq::toSpritePtr2_$0#0 -(word~) sprites_irq::toSpritePtr2_$1 -(word) sprites_irq::toSpritePtr2_$1#0 +(word/signed dword/dword~) sprites_irq::toSpritePtr2_$1 +(word/signed dword/dword) sprites_irq::toSpritePtr2_$1#0 (byte~) sprites_irq::toSpritePtr2_$2 (byte) sprites_irq::toSpritePtr2_$2#0 (label) sprites_irq::toSpritePtr2_@return @@ -1137,8 +1137,8 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() (label) toSpritePtr1 (word~) toSpritePtr1_$0 (word) toSpritePtr1_$0#0 -(word~) toSpritePtr1_$1 -(word) toSpritePtr1_$1#0 +(word/signed dword/dword~) toSpritePtr1_$1 +(word/signed dword/dword) toSpritePtr1_$1#0 (byte~) toSpritePtr1_$2 (byte) toSpritePtr1_$2#0 (label) toSpritePtr1_@return @@ -1187,7 +1187,7 @@ Alias (byte) sin_idx#24 = (byte) sin_idx#32 (byte) sin_idx#33 (byte) sin_idx#31 Alias (byte) main::vicSelectGfxBank1_toDd001_return#0 = (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 (byte) main::vicSelectGfxBank1_toDd001_return#2 (byte) main::vicSelectGfxBank1_toDd001_return#1 (byte) main::vicSelectGfxBank1_toDd001_return#3 (byte) main::vicSelectGfxBank1_$0#0 Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 -Alias (byte) main::toD0181_return#0 = (byte) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$1 +Alias (byte) main::toD0181_return#0 = (byte/word/dword) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$1 Alias (byte) main::s2#0 = (byte~) main::$5 Alias (byte*) main::toSpritePtr2_sprite#0 = (byte*) main::toSpritePtr2_sprite#1 Alias (byte) main::s#2 = (byte) main::s#5 (byte) main::s#4 (byte) main::s#3 @@ -1394,7 +1394,7 @@ Constant (const byte*) main::toSpritePtr2_sprite#0 = SIN_SPRITE#0 Successful SSA optimization Pass2ConstantIdentification Constant (const byte[$2]) playfield#0 = { fill( $2, 0) } Constant (const byte) IRQ_RASTER_FIRST#0 = $3 -Constant (const word) toSpritePtr1_$1#0 = toSpritePtr1_$0#0>>6 +Constant (const word/signed dword/dword) toSpritePtr1_$1#0 = toSpritePtr1_$0#0/$40 Constant (const word) sprites_irq::toSpritePtr2_$0#0 = ((word))sprites_irq::toSpritePtr2_sprite#0 Constant (const word) main::vicSelectGfxBank1_toDd001_$0#0 = ((word))main::vicSelectGfxBank1_gfx#0 Constant (const word) main::toD0181_$0#0 = ((word))main::toD0181_screen#0 @@ -1402,23 +1402,23 @@ Constant (const word) main::toD0181_$4#0 = ((word))main::toD0181_gfx#0 Constant (const word) main::toSpritePtr2_$0#0 = ((word))main::toSpritePtr2_sprite#0 Successful SSA optimization Pass2ConstantIdentification Constant (const byte) toSpritePtr1_return#0 = ((byte))toSpritePtr1_$1#0 -Constant (const word) sprites_irq::toSpritePtr2_$1#0 = sprites_irq::toSpritePtr2_$0#0>>6 +Constant (const word/signed dword/dword) sprites_irq::toSpritePtr2_$1#0 = sprites_irq::toSpritePtr2_$0#0/$40 Constant (const byte) main::vicSelectGfxBank1_toDd001_$1#0 = >main::vicSelectGfxBank1_toDd001_$0#0 Constant (const word) main::toD0181_$1#0 = main::toD0181_$0#0&$3fff Constant (const byte) main::toD0181_$5#0 = >main::toD0181_$4#0 -Constant (const word) main::toSpritePtr2_$1#0 = main::toSpritePtr2_$0#0>>6 +Constant (const word/signed dword/dword) main::toSpritePtr2_$1#0 = main::toSpritePtr2_$0#0/$40 Successful SSA optimization Pass2ConstantIdentification Constant (const byte/signed word/word/dword/signed dword) $6 = toSpritePtr1_return#0+3 Constant (const byte) sprites_irq::toSpritePtr2_$2#0 = ((byte))sprites_irq::toSpritePtr2_$1#0 -Constant (const byte) main::vicSelectGfxBank1_toDd001_$2#0 = main::vicSelectGfxBank1_toDd001_$1#0>>6 -Constant (const word) main::toD0181_$2#0 = main::toD0181_$1#0<<2 -Constant (const byte) main::toD0181_$6#0 = main::toD0181_$5#0>>2 +Constant (const byte/signed word/word/dword/signed dword) main::vicSelectGfxBank1_toDd001_$2#0 = main::vicSelectGfxBank1_toDd001_$1#0/$40 +Constant (const word/signed dword/dword) main::toD0181_$2#0 = main::toD0181_$1#0*4 +Constant (const byte/signed word/word/dword/signed dword) main::toD0181_$6#0 = main::toD0181_$5#0/4 Constant (const byte) main::toSpritePtr2_return#0 = ((byte))main::toSpritePtr2_$1#0 Successful SSA optimization Pass2ConstantIdentification Constant (const byte) sprites_irq::toSpritePtr2_return#0 = sprites_irq::toSpritePtr2_$2#0 Constant (const byte) main::vicSelectGfxBank1_toDd001_return#0 = 3^main::vicSelectGfxBank1_toDd001_$2#0 -Constant (const byte) main::toD0181_$3#0 = >main::toD0181_$2#0 -Constant (const byte) main::toD0181_$7#0 = main::toD0181_$6#0&$f +Constant (const byte/word) main::toD0181_$3#0 = >main::toD0181_$2#0 +Constant (const byte/word/dword) main::toD0181_$7#0 = main::toD0181_$6#0&$f Successful SSA optimization Pass2ConstantIdentification Constant (const byte) sprites_irq::toSpritePtr2_return#1 = sprites_irq::toSpritePtr2_return#0 Constant (const byte) main::toD0181_return#0 = main::toD0181_$3#0|main::toD0181_$7#0 @@ -1472,7 +1472,7 @@ Inlining constant with var siblings (const byte) sin_idx#0 Constant inlined main::toSpritePtr2_$0#0 = ((word))(const byte*) SIN_SPRITE#0 Constant inlined main::toD0181_screen#0 = (const byte*) PLAYFIELD_SCREEN_1#0 Constant inlined main::toD0181_gfx#0 = (const byte*) PLAYFIELD_CHARSET#0 -Constant inlined main::toSpritePtr2_$1#0 = ((word))(const byte*) SIN_SPRITE#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +Constant inlined main::toSpritePtr2_$1#0 = ((word))(const byte*) SIN_SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) $40 Constant inlined sprites_irq::toSpritePtr2_return#1 = (const byte) sprites_irq::toSpritePtr2_return#0 Constant inlined sprites_irq::$5 = (const byte) sprites_irq::toSpritePtr2_return#0 Constant inlined sprites_init::xpos#0 = (byte/signed byte/word/signed word/dword/signed dword) $18+(byte/signed byte/word/signed word/dword/signed dword) $f*(byte/signed byte/word/signed word/dword/signed dword) 8 @@ -1483,7 +1483,7 @@ Constant inlined $4 = (const byte) SPRITES_FIRST_YPOS#0+(byte/signed byte/word/s Constant inlined $6 = (const byte) toSpritePtr1_return#0+(byte/signed byte/word/signed word/dword/signed dword) 3 Constant inlined sin_idx#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined sprites_init::s#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 -Constant inlined main::vicSelectGfxBank1_toDd001_$2#0 = >((word))(const byte*) PLAYFIELD_SCREEN_1#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +Constant inlined main::vicSelectGfxBank1_toDd001_$2#0 = >((word))(const byte*) PLAYFIELD_SCREEN_1#0/(byte/signed byte/word/signed word/dword/signed dword) $40 Constant inlined main::xpos#0 = (byte/signed byte/word/signed word/dword/signed dword) $18 Constant inlined main::s#0 = (byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined main::vicSelectGfxBank1_toDd001_$1#0 = >((word))(const byte*) PLAYFIELD_SCREEN_1#0 @@ -1492,16 +1492,16 @@ Constant inlined main::vicSelectGfxBank1_toDd001_$0#0 = ((word))(const byte*) PL Constant inlined main::toD0181_$0#0 = ((word))(const byte*) PLAYFIELD_SCREEN_1#0 Constant inlined main::toD0181_$1#0 = ((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff Constant inlined sprites_irq::toSpritePtr2_sprite#0 = (const byte*) PLAYFIELD_SPRITES#0 -Constant inlined sprites_irq::toSpritePtr2_$1#0 = ((word))(const byte*) PLAYFIELD_SPRITES#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 -Constant inlined main::toD0181_$6#0 = >((word))(const byte*) PLAYFIELD_CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined sprites_irq::toSpritePtr2_$1#0 = ((word))(const byte*) PLAYFIELD_SPRITES#0/(byte/signed byte/word/signed word/dword/signed dword) $40 +Constant inlined main::toD0181_$6#0 = >((word))(const byte*) PLAYFIELD_CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined sprites_irq::toSpritePtr2_$2#0 = (const byte) sprites_irq::toSpritePtr2_return#0 -Constant inlined main::toD0181_$7#0 = >((word))(const byte*) PLAYFIELD_CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +Constant inlined main::toD0181_$7#0 = >((word))(const byte*) PLAYFIELD_CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f Constant inlined sprites_irq::toSpritePtr2_$0#0 = ((word))(const byte*) PLAYFIELD_SPRITES#0 -Constant inlined main::toD0181_$2#0 = ((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 -Constant inlined main::toD0181_$3#0 = >((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$2#0 = ((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 +Constant inlined main::toD0181_$3#0 = >((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined main::toD0181_$4#0 = ((word))(const byte*) PLAYFIELD_CHARSET#0 Constant inlined main::toD0181_$5#0 = >((word))(const byte*) PLAYFIELD_CHARSET#0 -Constant inlined toSpritePtr1_$1#0 = ((word))(const byte*) PLAYFIELD_SPRITES#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +Constant inlined toSpritePtr1_$1#0 = ((word))(const byte*) PLAYFIELD_SPRITES#0/(byte/signed byte/word/signed word/dword/signed dword) $40 Constant inlined main::vicSelectGfxBank1_gfx#0 = (const byte*) PLAYFIELD_SCREEN_1#0 Constant inlined main::ypos#0 = (byte/signed byte/word/signed word/dword/signed dword) $32 Constant inlined sprites_init::$0 = (byte/signed byte/word/signed word/dword/signed dword) $f*(byte/signed byte/word/signed word/dword/signed dword) 8 @@ -1951,18 +1951,18 @@ VARIABLE REGISTER WEIGHTS (byte) main::s2#0 16.5 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return (byte*) main::toD0181_screen (word~) main::toSpritePtr2_$0 -(word~) main::toSpritePtr2_$1 +(word/signed dword/dword~) main::toSpritePtr2_$1 (byte~) main::toSpritePtr2_$2 (byte) main::toSpritePtr2_return (byte*) main::toSpritePtr2_sprite @@ -1970,7 +1970,7 @@ VARIABLE REGISTER WEIGHTS (byte*) main::vicSelectGfxBank1_gfx (word~) main::vicSelectGfxBank1_toDd001_$0 (byte~) main::vicSelectGfxBank1_toDd001_$1 -(byte~) main::vicSelectGfxBank1_toDd001_$2 +(byte/signed word/word/dword/signed dword~) main::vicSelectGfxBank1_toDd001_$2 (byte/word/dword~) main::vicSelectGfxBank1_toDd001_$3 (byte*) main::vicSelectGfxBank1_toDd001_gfx (byte) main::vicSelectGfxBank1_toDd001_return @@ -2009,7 +2009,7 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() (byte) sprites_irq::raster_sprite_gfx_modify (byte) sprites_irq::raster_sprite_gfx_modify#0 6.5 (word~) sprites_irq::toSpritePtr2_$0 -(word~) sprites_irq::toSpritePtr2_$1 +(word/signed dword/dword~) sprites_irq::toSpritePtr2_$1 (byte~) sprites_irq::toSpritePtr2_$2 (byte) sprites_irq::toSpritePtr2_return (byte*) sprites_irq::toSpritePtr2_sprite @@ -2017,7 +2017,7 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() (byte) sprites_irq::ypos#0 2.5 (void()) sprites_irq_init() (word~) toSpritePtr1_$0 -(word~) toSpritePtr1_$1 +(word/signed dword/dword~) toSpritePtr1_$1 (byte~) toSpritePtr1_$2 (byte) toSpritePtr1_return (byte*) toSpritePtr1_sprite @@ -2170,7 +2170,7 @@ INITIAL ASM .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS // The line of the first IRQ .const IRQ_RASTER_FIRST = SPRITES_FIRST_YPOS+$13 - .const toSpritePtr1_return = PLAYFIELD_SPRITES>>6 + .const toSpritePtr1_return = PLAYFIELD_SPRITES/$40 .label render_screen_showing = $b .label irq_raster_next = $c .label irq_sprite_ypos = $d @@ -2235,9 +2235,9 @@ bend_from_b4: bend: //SEG24 main main: { - .const toSpritePtr2_return = SIN_SPRITE>>6 - .const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_SCREEN_1)>>6 - .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)<<2)|(>PLAYFIELD_CHARSET)>>2&$f + .const toSpritePtr2_return = SIN_SPRITE/$40 + .const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_SCREEN_1)/$40 + .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)*4)|(>PLAYFIELD_CHARSET)/4&$f .label _6 = $11 .label s2 = $10 .label xpos = 3 @@ -2551,7 +2551,7 @@ sprites_init: { // Repeats 10 timers every 2 lines from line IRQ_RASTER_FIRST // Utilizes duplicated gfx in the sprites to allow for some leeway in updating the sprite pointers sprites_irq: { - .const toSpritePtr2_return = PLAYFIELD_SPRITES>>6 + .const toSpritePtr2_return = PLAYFIELD_SPRITES/$40 .label _0 = $15 .label ypos = $14 .label raster_sprite_gfx_modify = $a @@ -3049,7 +3049,7 @@ ASSEMBLER BEFORE OPTIMIZATION .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS // The line of the first IRQ .const IRQ_RASTER_FIRST = SPRITES_FIRST_YPOS+$13 - .const toSpritePtr1_return = PLAYFIELD_SPRITES>>6 + .const toSpritePtr1_return = PLAYFIELD_SPRITES/$40 .label render_screen_showing = 5 .label irq_raster_next = 6 .label irq_sprite_ypos = 7 @@ -3114,9 +3114,9 @@ bend_from_b4: bend: //SEG24 main main: { - .const toSpritePtr2_return = SIN_SPRITE>>6 - .const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_SCREEN_1)>>6 - .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)<<2)|(>PLAYFIELD_CHARSET)>>2&$f + .const toSpritePtr2_return = SIN_SPRITE/$40 + .const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_SCREEN_1)/$40 + .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)*4)|(>PLAYFIELD_CHARSET)/4&$f .label xpos = 2 .label ypos = 3 jmp vicSelectGfxBank1 @@ -3408,7 +3408,7 @@ sprites_init: { // Repeats 10 timers every 2 lines from line IRQ_RASTER_FIRST // Utilizes duplicated gfx in the sprites to allow for some leeway in updating the sprite pointers sprites_irq: { - .const toSpritePtr2_return = PLAYFIELD_SPRITES>>6 + .const toSpritePtr2_return = PLAYFIELD_SPRITES/$40 .label raster_sprite_gfx_modify = 4 //SEG128 entry interrupt(HARDWARE_CLOBBER) sta rega+1 @@ -3909,23 +3909,23 @@ FINAL SYMBOL TABLE (label) main::toD0181 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) PLAYFIELD_CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) PLAYFIELD_CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0181_screen (label) main::toSpritePtr2 (word~) main::toSpritePtr2_$0 -(word~) main::toSpritePtr2_$1 +(word/signed dword/dword~) main::toSpritePtr2_$1 (byte~) main::toSpritePtr2_$2 (byte) main::toSpritePtr2_return -(const byte) main::toSpritePtr2_return#0 toSpritePtr2_return = ((byte))((word))(const byte*) SIN_SPRITE#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) main::toSpritePtr2_return#0 toSpritePtr2_return = ((byte))((word))(const byte*) SIN_SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (byte*) main::toSpritePtr2_sprite (label) main::vicSelectGfxBank1 (byte~) main::vicSelectGfxBank1_$0 @@ -3934,11 +3934,11 @@ FINAL SYMBOL TABLE (label) main::vicSelectGfxBank1_toDd001 (word~) main::vicSelectGfxBank1_toDd001_$0 (byte~) main::vicSelectGfxBank1_toDd001_$1 -(byte~) main::vicSelectGfxBank1_toDd001_$2 +(byte/signed word/word/dword/signed dword~) main::vicSelectGfxBank1_toDd001_$2 (byte/word/dword~) main::vicSelectGfxBank1_toDd001_$3 (byte*) main::vicSelectGfxBank1_toDd001_gfx (byte) main::vicSelectGfxBank1_toDd001_return -(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) PLAYFIELD_SCREEN_1#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) PLAYFIELD_SCREEN_1#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (byte) main::xpos (byte) main::xpos#1 xpos zp ZP_BYTE:2 5.5 (byte) main::xpos#2 xpos zp ZP_BYTE:2 4.125 @@ -3989,10 +3989,10 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() (byte) sprites_irq::raster_sprite_gfx_modify#0 raster_sprite_gfx_modify zp ZP_BYTE:4 6.5 (label) sprites_irq::toSpritePtr2 (word~) sprites_irq::toSpritePtr2_$0 -(word~) sprites_irq::toSpritePtr2_$1 +(word/signed dword/dword~) sprites_irq::toSpritePtr2_$1 (byte~) sprites_irq::toSpritePtr2_$2 (byte) sprites_irq::toSpritePtr2_return -(const byte) sprites_irq::toSpritePtr2_return#0 toSpritePtr2_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) sprites_irq::toSpritePtr2_return#0 toSpritePtr2_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (byte*) sprites_irq::toSpritePtr2_sprite (byte) sprites_irq::ypos (byte) sprites_irq::ypos#0 reg byte a 2.5 @@ -4000,10 +4000,10 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() (label) sprites_irq_init::@return (label) toSpritePtr1 (word~) toSpritePtr1_$0 -(word~) toSpritePtr1_$1 +(word/signed dword/dword~) toSpritePtr1_$1 (byte~) toSpritePtr1_$2 (byte) toSpritePtr1_return -(const byte) toSpritePtr1_return#0 toSpritePtr1_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) toSpritePtr1_return#0 toSpritePtr1_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (byte*) toSpritePtr1_sprite reg byte y [ main::s#2 main::s#1 ] @@ -4098,7 +4098,7 @@ Score: 7310 .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS // The line of the first IRQ .const IRQ_RASTER_FIRST = SPRITES_FIRST_YPOS+$13 - .const toSpritePtr1_return = PLAYFIELD_SPRITES>>6 + .const toSpritePtr1_return = PLAYFIELD_SPRITES/$40 .label render_screen_showing = 5 .label irq_raster_next = 6 .label irq_sprite_ypos = 7 @@ -4146,9 +4146,9 @@ bbegin: //SEG23 @end //SEG24 main main: { - .const toSpritePtr2_return = SIN_SPRITE>>6 - .const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_SCREEN_1)>>6 - .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)<<2)|(>PLAYFIELD_CHARSET)>>2&$f + .const toSpritePtr2_return = SIN_SPRITE/$40 + .const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_SCREEN_1)/$40 + .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)*4)|(>PLAYFIELD_CHARSET)/4&$f .label xpos = 2 .label ypos = 3 //SEG25 main::vicSelectGfxBank1 @@ -4385,7 +4385,7 @@ sprites_init: { // Repeats 10 timers every 2 lines from line IRQ_RASTER_FIRST // Utilizes duplicated gfx in the sprites to allow for some leeway in updating the sprite pointers sprites_irq: { - .const toSpritePtr2_return = PLAYFIELD_SPRITES>>6 + .const toSpritePtr2_return = PLAYFIELD_SPRITES/$40 .label raster_sprite_gfx_modify = 4 //SEG128 entry interrupt(HARDWARE_CLOBBER) sta rega+1 diff --git a/src/test/ref/complex/tetris/test-sprites.sym b/src/test/ref/complex/tetris/test-sprites.sym index 89ff37854..f1cfe7e06 100644 --- a/src/test/ref/complex/tetris/test-sprites.sym +++ b/src/test/ref/complex/tetris/test-sprites.sym @@ -193,23 +193,23 @@ (label) main::toD0181 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) PLAYFIELD_CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) PLAYFIELD_CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0181_screen (label) main::toSpritePtr2 (word~) main::toSpritePtr2_$0 -(word~) main::toSpritePtr2_$1 +(word/signed dword/dword~) main::toSpritePtr2_$1 (byte~) main::toSpritePtr2_$2 (byte) main::toSpritePtr2_return -(const byte) main::toSpritePtr2_return#0 toSpritePtr2_return = ((byte))((word))(const byte*) SIN_SPRITE#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) main::toSpritePtr2_return#0 toSpritePtr2_return = ((byte))((word))(const byte*) SIN_SPRITE#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (byte*) main::toSpritePtr2_sprite (label) main::vicSelectGfxBank1 (byte~) main::vicSelectGfxBank1_$0 @@ -218,11 +218,11 @@ (label) main::vicSelectGfxBank1_toDd001 (word~) main::vicSelectGfxBank1_toDd001_$0 (byte~) main::vicSelectGfxBank1_toDd001_$1 -(byte~) main::vicSelectGfxBank1_toDd001_$2 +(byte/signed word/word/dword/signed dword~) main::vicSelectGfxBank1_toDd001_$2 (byte/word/dword~) main::vicSelectGfxBank1_toDd001_$3 (byte*) main::vicSelectGfxBank1_toDd001_gfx (byte) main::vicSelectGfxBank1_toDd001_return -(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) PLAYFIELD_SCREEN_1#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) PLAYFIELD_SCREEN_1#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (byte) main::xpos (byte) main::xpos#1 xpos zp ZP_BYTE:2 5.5 (byte) main::xpos#2 xpos zp ZP_BYTE:2 4.125 @@ -273,10 +273,10 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() (byte) sprites_irq::raster_sprite_gfx_modify#0 raster_sprite_gfx_modify zp ZP_BYTE:4 6.5 (label) sprites_irq::toSpritePtr2 (word~) sprites_irq::toSpritePtr2_$0 -(word~) sprites_irq::toSpritePtr2_$1 +(word/signed dword/dword~) sprites_irq::toSpritePtr2_$1 (byte~) sprites_irq::toSpritePtr2_$2 (byte) sprites_irq::toSpritePtr2_return -(const byte) sprites_irq::toSpritePtr2_return#0 toSpritePtr2_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) sprites_irq::toSpritePtr2_return#0 toSpritePtr2_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (byte*) sprites_irq::toSpritePtr2_sprite (byte) sprites_irq::ypos (byte) sprites_irq::ypos#0 reg byte a 2.5 @@ -284,10 +284,10 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() (label) sprites_irq_init::@return (label) toSpritePtr1 (word~) toSpritePtr1_$0 -(word~) toSpritePtr1_$1 +(word/signed dword/dword~) toSpritePtr1_$1 (byte~) toSpritePtr1_$2 (byte) toSpritePtr1_return -(const byte) toSpritePtr1_return#0 toSpritePtr1_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) toSpritePtr1_return#0 toSpritePtr1_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (byte*) toSpritePtr1_sprite reg byte y [ main::s#2 main::s#1 ] diff --git a/src/test/ref/complex/tetris/tetris.asm b/src/test/ref/complex/tetris/tetris.asm index f6a714dba..2715d5d4c 100644 --- a/src/test/ref/complex/tetris/tetris.asm +++ b/src/test/ref/complex/tetris/tetris.asm @@ -125,7 +125,7 @@ .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS // The line of the first IRQ .const IRQ_RASTER_FIRST = SPRITES_FIRST_YPOS+$13 - .const toSpritePtr1_return = PLAYFIELD_SPRITES>>6 + .const toSpritePtr1_return = PLAYFIELD_SPRITES/$40 .label keyboard_events_size = $23 .label render_screen_showing = $25 .label irq_raster_next = $26 @@ -1278,8 +1278,8 @@ keyboard_matrix_read: { } // Update $D018 to show the current screen (used for double buffering) render_show: { - .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)<<2)|(>PLAYFIELD_CHARSET)>>2&$f - .const toD0182_return = (>(PLAYFIELD_SCREEN_2&$3fff)<<2)|(>PLAYFIELD_CHARSET)>>2&$f + .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)*4)|(>PLAYFIELD_CHARSET)/4&$f + .const toD0182_return = (>(PLAYFIELD_SCREEN_2&$3fff)*4)|(>PLAYFIELD_CHARSET)/4&$f lda render_screen_show cmp #0 beq toD0181 @@ -1419,7 +1419,7 @@ sprites_init: { } // Initialize rendering render_init: { - .const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_CHARSET)>>6 + .const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_CHARSET)/$40 .label li_1 = 5 .label li_2 = 7 lda #3 @@ -1599,7 +1599,7 @@ sid_rnd_init: { // Repeats 10 timers every 2 lines from line IRQ_RASTER_FIRST // Utilizes duplicated gfx in the sprites to allow for some leeway in updating the sprite pointers sprites_irq: { - .const toSpritePtr2_return = PLAYFIELD_SPRITES>>6 + .const toSpritePtr2_return = PLAYFIELD_SPRITES/$40 .label raster_sprite_gfx_modify = $24 sta rega+1 stx regx+1 diff --git a/src/test/ref/complex/tetris/tetris.log b/src/test/ref/complex/tetris/tetris.log index 2174e3ffc..8aa252cdc 100644 --- a/src/test/ref/complex/tetris/tetris.log +++ b/src/test/ref/complex/tetris/tetris.log @@ -531,8 +531,8 @@ render_init::vicSelectGfxBank1_toDd001: scope:[render_init] from render_init::v (byte*) render_init::vicSelectGfxBank1_toDd001_gfx#1 ← phi( render_init::vicSelectGfxBank1/(byte*) render_init::vicSelectGfxBank1_toDd001_gfx#0 ) (word) render_init::vicSelectGfxBank1_toDd001_$0#0 ← ((word)) (byte*) render_init::vicSelectGfxBank1_toDd001_gfx#1 (byte) render_init::vicSelectGfxBank1_toDd001_$1#0 ← > (word) render_init::vicSelectGfxBank1_toDd001_$0#0 - (byte) render_init::vicSelectGfxBank1_toDd001_$2#0 ← (byte) render_init::vicSelectGfxBank1_toDd001_$1#0 >> (byte/signed byte/word/signed word/dword/signed dword) 6 - (byte/word/dword) render_init::vicSelectGfxBank1_toDd001_$3#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte) render_init::vicSelectGfxBank1_toDd001_$2#0 + (byte/signed word/word/dword/signed dword) render_init::vicSelectGfxBank1_toDd001_$2#0 ← (byte) render_init::vicSelectGfxBank1_toDd001_$1#0 / (byte/signed byte/word/signed word/dword/signed dword) $40 + (byte/word/dword) render_init::vicSelectGfxBank1_toDd001_$3#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte/signed word/word/dword/signed dword) render_init::vicSelectGfxBank1_toDd001_$2#0 (byte) render_init::vicSelectGfxBank1_toDd001_return#0 ← (byte/word/dword) render_init::vicSelectGfxBank1_toDd001_$3#0 to:render_init::vicSelectGfxBank1_toDd001_@return render_init::vicSelectGfxBank1_toDd001_@return: scope:[render_init] from render_init::vicSelectGfxBank1_toDd001 @@ -618,14 +618,14 @@ render_show::toD0181: scope:[render_show] from render_show::@1 (byte*) render_show::toD0181_screen#1 ← phi( render_show::@1/(byte*) render_show::toD0181_screen#0 ) (word) render_show::toD0181_$0#0 ← ((word)) (byte*) render_show::toD0181_screen#1 (word) render_show::toD0181_$1#0 ← (word) render_show::toD0181_$0#0 & (word/signed word/dword/signed dword) $3fff - (word) render_show::toD0181_$2#0 ← (word) render_show::toD0181_$1#0 << (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) render_show::toD0181_$3#0 ← > (word) render_show::toD0181_$2#0 + (word/signed dword/dword) render_show::toD0181_$2#0 ← (word) render_show::toD0181_$1#0 * (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word) render_show::toD0181_$3#0 ← > (word/signed dword/dword) render_show::toD0181_$2#0 (word) render_show::toD0181_$4#0 ← ((word)) (byte*) render_show::toD0181_gfx#1 (byte) render_show::toD0181_$5#0 ← > (word) render_show::toD0181_$4#0 - (byte) render_show::toD0181_$6#0 ← (byte) render_show::toD0181_$5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) render_show::toD0181_$7#0 ← (byte) render_show::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f - (byte) render_show::toD0181_$8#0 ← (byte) render_show::toD0181_$3#0 | (byte) render_show::toD0181_$7#0 - (byte) render_show::toD0181_return#0 ← (byte) render_show::toD0181_$8#0 + (byte/signed word/word/dword/signed dword) render_show::toD0181_$6#0 ← (byte) render_show::toD0181_$5#0 / (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word/dword) render_show::toD0181_$7#0 ← (byte/signed word/word/dword/signed dword) render_show::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f + (byte/word/dword) render_show::toD0181_$8#0 ← (byte/word) render_show::toD0181_$3#0 | (byte/word/dword) render_show::toD0181_$7#0 + (byte) render_show::toD0181_return#0 ← (byte/word/dword) render_show::toD0181_$8#0 to:render_show::toD0181_@return render_show::toD0181_@return: scope:[render_show] from render_show::toD0181 (byte) render_screen_show#25 ← phi( render_show::toD0181/(byte) render_screen_show#33 ) @@ -653,14 +653,14 @@ render_show::toD0182: scope:[render_show] from render_show::@3 (byte*) render_show::toD0182_screen#1 ← phi( render_show::@3/(byte*) render_show::toD0182_screen#0 ) (word) render_show::toD0182_$0#0 ← ((word)) (byte*) render_show::toD0182_screen#1 (word) render_show::toD0182_$1#0 ← (word) render_show::toD0182_$0#0 & (word/signed word/dword/signed dword) $3fff - (word) render_show::toD0182_$2#0 ← (word) render_show::toD0182_$1#0 << (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) render_show::toD0182_$3#0 ← > (word) render_show::toD0182_$2#0 + (word/signed dword/dword) render_show::toD0182_$2#0 ← (word) render_show::toD0182_$1#0 * (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word) render_show::toD0182_$3#0 ← > (word/signed dword/dword) render_show::toD0182_$2#0 (word) render_show::toD0182_$4#0 ← ((word)) (byte*) render_show::toD0182_gfx#1 (byte) render_show::toD0182_$5#0 ← > (word) render_show::toD0182_$4#0 - (byte) render_show::toD0182_$6#0 ← (byte) render_show::toD0182_$5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) render_show::toD0182_$7#0 ← (byte) render_show::toD0182_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f - (byte) render_show::toD0182_$8#0 ← (byte) render_show::toD0182_$3#0 | (byte) render_show::toD0182_$7#0 - (byte) render_show::toD0182_return#0 ← (byte) render_show::toD0182_$8#0 + (byte/signed word/word/dword/signed dword) render_show::toD0182_$6#0 ← (byte) render_show::toD0182_$5#0 / (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word/dword) render_show::toD0182_$7#0 ← (byte/signed word/word/dword/signed dword) render_show::toD0182_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f + (byte/word/dword) render_show::toD0182_$8#0 ← (byte/word) render_show::toD0182_$3#0 | (byte/word/dword) render_show::toD0182_$7#0 + (byte) render_show::toD0182_return#0 ← (byte/word/dword) render_show::toD0182_$8#0 to:render_show::toD0182_@return render_show::toD0182_@return: scope:[render_show] from render_show::toD0182 (byte) render_screen_show#26 ← phi( render_show::toD0182/(byte) render_screen_show#34 ) @@ -1257,8 +1257,8 @@ toSpritePtr1: scope:[] from @24 (byte) irq_sprite_ypos#24 ← phi( @24/(byte) irq_sprite_ypos#0 ) (byte*) toSpritePtr1_sprite#1 ← phi( @24/(byte*) toSpritePtr1_sprite#0 ) (word) toSpritePtr1_$0#0 ← ((word)) (byte*) toSpritePtr1_sprite#1 - (word) toSpritePtr1_$1#0 ← (word) toSpritePtr1_$0#0 >> (byte/signed byte/word/signed word/dword/signed dword) 6 - (byte) toSpritePtr1_$2#0 ← ((byte)) (word) toSpritePtr1_$1#0 + (word/signed dword/dword) toSpritePtr1_$1#0 ← (word) toSpritePtr1_$0#0 / (byte/signed byte/word/signed word/dword/signed dword) $40 + (byte) toSpritePtr1_$2#0 ← ((byte)) (word/signed dword/dword) toSpritePtr1_$1#0 (byte) toSpritePtr1_return#0 ← (byte) toSpritePtr1_$2#0 to:toSpritePtr1_@return toSpritePtr1_@return: scope:[] from toSpritePtr1 @@ -1404,8 +1404,8 @@ sprites_irq::toSpritePtr2: scope:[sprites_irq] from sprites_irq::@3 (byte) irq_raster_next#19 ← phi( sprites_irq::@3/(byte) irq_raster_next#1 ) (byte*) sprites_irq::toSpritePtr2_sprite#1 ← phi( sprites_irq::@3/(byte*) sprites_irq::toSpritePtr2_sprite#0 ) (word) sprites_irq::toSpritePtr2_$0#0 ← ((word)) (byte*) sprites_irq::toSpritePtr2_sprite#1 - (word) sprites_irq::toSpritePtr2_$1#0 ← (word) sprites_irq::toSpritePtr2_$0#0 >> (byte/signed byte/word/signed word/dword/signed dword) 6 - (byte) sprites_irq::toSpritePtr2_$2#0 ← ((byte)) (word) sprites_irq::toSpritePtr2_$1#0 + (word/signed dword/dword) sprites_irq::toSpritePtr2_$1#0 ← (word) sprites_irq::toSpritePtr2_$0#0 / (byte/signed byte/word/signed word/dword/signed dword) $40 + (byte) sprites_irq::toSpritePtr2_$2#0 ← ((byte)) (word/signed dword/dword) sprites_irq::toSpritePtr2_$1#0 (byte) sprites_irq::toSpritePtr2_return#0 ← (byte) sprites_irq::toSpritePtr2_$2#0 to:sprites_irq::toSpritePtr2_@return sprites_irq::toSpritePtr2_@return: scope:[sprites_irq] from sprites_irq::toSpritePtr2 @@ -6730,8 +6730,8 @@ SYMBOL TABLE SSA (word) render_init::vicSelectGfxBank1_toDd001_$0#0 (byte~) render_init::vicSelectGfxBank1_toDd001_$1 (byte) render_init::vicSelectGfxBank1_toDd001_$1#0 -(byte~) render_init::vicSelectGfxBank1_toDd001_$2 -(byte) render_init::vicSelectGfxBank1_toDd001_$2#0 +(byte/signed word/word/dword/signed dword~) render_init::vicSelectGfxBank1_toDd001_$2 +(byte/signed word/word/dword/signed dword) render_init::vicSelectGfxBank1_toDd001_$2#0 (byte/word/dword~) render_init::vicSelectGfxBank1_toDd001_$3 (byte/word/dword) render_init::vicSelectGfxBank1_toDd001_$3#0 (label) render_init::vicSelectGfxBank1_toDd001_@return @@ -7239,20 +7239,20 @@ SYMBOL TABLE SSA (word) render_show::toD0181_$0#0 (word~) render_show::toD0181_$1 (word) render_show::toD0181_$1#0 -(word~) render_show::toD0181_$2 -(word) render_show::toD0181_$2#0 -(byte~) render_show::toD0181_$3 -(byte) render_show::toD0181_$3#0 +(word/signed dword/dword~) render_show::toD0181_$2 +(word/signed dword/dword) render_show::toD0181_$2#0 +(byte/word~) render_show::toD0181_$3 +(byte/word) render_show::toD0181_$3#0 (word~) render_show::toD0181_$4 (word) render_show::toD0181_$4#0 (byte~) render_show::toD0181_$5 (byte) render_show::toD0181_$5#0 -(byte~) render_show::toD0181_$6 -(byte) render_show::toD0181_$6#0 -(byte~) render_show::toD0181_$7 -(byte) render_show::toD0181_$7#0 -(byte~) render_show::toD0181_$8 -(byte) render_show::toD0181_$8#0 +(byte/signed word/word/dword/signed dword~) render_show::toD0181_$6 +(byte/signed word/word/dword/signed dword) render_show::toD0181_$6#0 +(byte/word/dword~) render_show::toD0181_$7 +(byte/word/dword) render_show::toD0181_$7#0 +(byte/word/dword~) render_show::toD0181_$8 +(byte/word/dword) render_show::toD0181_$8#0 (label) render_show::toD0181_@return (byte*) render_show::toD0181_gfx (byte*) render_show::toD0181_gfx#0 @@ -7270,20 +7270,20 @@ SYMBOL TABLE SSA (word) render_show::toD0182_$0#0 (word~) render_show::toD0182_$1 (word) render_show::toD0182_$1#0 -(word~) render_show::toD0182_$2 -(word) render_show::toD0182_$2#0 -(byte~) render_show::toD0182_$3 -(byte) render_show::toD0182_$3#0 +(word/signed dword/dword~) render_show::toD0182_$2 +(word/signed dword/dword) render_show::toD0182_$2#0 +(byte/word~) render_show::toD0182_$3 +(byte/word) render_show::toD0182_$3#0 (word~) render_show::toD0182_$4 (word) render_show::toD0182_$4#0 (byte~) render_show::toD0182_$5 (byte) render_show::toD0182_$5#0 -(byte~) render_show::toD0182_$6 -(byte) render_show::toD0182_$6#0 -(byte~) render_show::toD0182_$7 -(byte) render_show::toD0182_$7#0 -(byte~) render_show::toD0182_$8 -(byte) render_show::toD0182_$8#0 +(byte/signed word/word/dword/signed dword~) render_show::toD0182_$6 +(byte/signed word/word/dword/signed dword) render_show::toD0182_$6#0 +(byte/word/dword~) render_show::toD0182_$7 +(byte/word/dword) render_show::toD0182_$7#0 +(byte/word/dword~) render_show::toD0182_$8 +(byte/word/dword) render_show::toD0182_$8#0 (label) render_show::toD0182_@return (byte*) render_show::toD0182_gfx (byte*) render_show::toD0182_gfx#0 @@ -7446,8 +7446,8 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() (label) sprites_irq::toSpritePtr2 (word~) sprites_irq::toSpritePtr2_$0 (word) sprites_irq::toSpritePtr2_$0#0 -(word~) sprites_irq::toSpritePtr2_$1 -(word) sprites_irq::toSpritePtr2_$1#0 +(word/signed dword/dword~) sprites_irq::toSpritePtr2_$1 +(word/signed dword/dword) sprites_irq::toSpritePtr2_$1#0 (byte~) sprites_irq::toSpritePtr2_$2 (byte) sprites_irq::toSpritePtr2_$2#0 (label) sprites_irq::toSpritePtr2_@return @@ -7467,8 +7467,8 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() (label) toSpritePtr1 (word~) toSpritePtr1_$0 (word) toSpritePtr1_$0#0 -(word~) toSpritePtr1_$1 -(word) toSpritePtr1_$1#0 +(word/signed dword/dword~) toSpritePtr1_$1 +(word/signed dword/dword) toSpritePtr1_$1#0 (byte~) toSpritePtr1_$2 (byte) toSpritePtr1_$2#0 (label) toSpritePtr1_@return @@ -7575,10 +7575,10 @@ Alias (byte) level#26 = (byte) level#72 (byte) level#86 (byte) level#58 (byte) l Alias (byte) render_screen_show#10 = (byte) render_screen_show#41 (byte) render_screen_show#33 (byte) render_screen_show#25 (byte) render_screen_show#19 (byte) render_screen_show#42 (byte) render_screen_show#34 (byte) render_screen_show#26 (byte) render_screen_show#20 Alias (byte*) render_show::toD0181_screen#0 = (byte*) render_show::toD0181_screen#1 Alias (byte*) render_show::toD0181_gfx#0 = (byte*) render_show::toD0181_gfx#1 -Alias (byte) render_show::toD0181_return#0 = (byte) render_show::toD0181_$8#0 (byte) render_show::toD0181_return#2 (byte) render_show::toD0181_return#1 (byte) render_show::toD0181_return#3 (byte~) render_show::$2 (byte) render_show::d018val#1 +Alias (byte) render_show::toD0181_return#0 = (byte/word/dword) render_show::toD0181_$8#0 (byte) render_show::toD0181_return#2 (byte) render_show::toD0181_return#1 (byte) render_show::toD0181_return#3 (byte~) render_show::$2 (byte) render_show::d018val#1 Alias (byte*) render_show::toD0182_screen#0 = (byte*) render_show::toD0182_screen#1 Alias (byte*) render_show::toD0182_gfx#0 = (byte*) render_show::toD0182_gfx#1 -Alias (byte) render_show::toD0182_return#0 = (byte) render_show::toD0182_$8#0 (byte) render_show::toD0182_return#2 (byte) render_show::toD0182_return#1 (byte) render_show::toD0182_return#3 (byte~) render_show::$1 (byte) render_show::d018val#2 +Alias (byte) render_show::toD0182_return#0 = (byte/word/dword) render_show::toD0182_$8#0 (byte) render_show::toD0182_return#2 (byte) render_show::toD0182_return#1 (byte) render_show::toD0182_return#3 (byte~) render_show::$1 (byte) render_show::d018val#2 Alias (byte) render_screen_render#11 = (byte) render_screen_render#3 (byte) render_screen_render#4 Alias (byte) render_screen_show#13 = (byte) render_screen_show#3 (byte) render_screen_show#4 Alias (dword) score_bcd#20 = (dword) score_bcd#35 (dword) score_bcd#21 @@ -9059,7 +9059,7 @@ Constant (const word) render_bcd::offset#4 = render_score::lines_offset#0+1 Constant (const word) render_bcd::offset#5 = render_score::level_offset#0 Constant (const word) render_next::next_area_offset#0 = render_next::$1+4 Constant (const byte) IRQ_RASTER_FIRST#0 = $4 -Constant (const word) toSpritePtr1_$1#0 = toSpritePtr1_$0#0>>6 +Constant (const word/signed dword/dword) toSpritePtr1_$1#0 = toSpritePtr1_$0#0/$40 Constant (const word) sprites_irq::toSpritePtr2_$0#0 = ((word))sprites_irq::toSpritePtr2_sprite#0 Constant (const word[]) PIECES#0 = { $22, $23, $24, $25, $26, $27, $28 } Constant (const byte[$29]) playfield_lines_idx#0 = { fill( $29, 0) } @@ -9075,22 +9075,22 @@ Constant (const byte) render_show::toD0182_$5#0 = >render_show::toD0182_$4#0 Constant (const byte*) render_next::screen_next_area#1 = PLAYFIELD_SCREEN_1#0+render_next::next_area_offset#0 Constant (const byte*) render_next::screen_next_area#2 = PLAYFIELD_SCREEN_2#0+render_next::next_area_offset#0 Constant (const byte) toSpritePtr1_return#0 = ((byte))toSpritePtr1_$1#0 -Constant (const word) sprites_irq::toSpritePtr2_$1#0 = sprites_irq::toSpritePtr2_$0#0>>6 +Constant (const word/signed dword/dword) sprites_irq::toSpritePtr2_$1#0 = sprites_irq::toSpritePtr2_$0#0/$40 Constant (const byte*) play_init::pli#0 = playfield#0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) render_init::vicSelectGfxBank1_toDd001_$2#0 = render_init::vicSelectGfxBank1_toDd001_$1#0>>6 -Constant (const word) render_show::toD0181_$2#0 = render_show::toD0181_$1#0<<2 -Constant (const byte) render_show::toD0181_$6#0 = render_show::toD0181_$5#0>>2 -Constant (const word) render_show::toD0182_$2#0 = render_show::toD0182_$1#0<<2 -Constant (const byte) render_show::toD0182_$6#0 = render_show::toD0182_$5#0>>2 +Constant (const byte/signed word/word/dword/signed dword) render_init::vicSelectGfxBank1_toDd001_$2#0 = render_init::vicSelectGfxBank1_toDd001_$1#0/$40 +Constant (const word/signed dword/dword) render_show::toD0181_$2#0 = render_show::toD0181_$1#0*4 +Constant (const byte/signed word/word/dword/signed dword) render_show::toD0181_$6#0 = render_show::toD0181_$5#0/4 +Constant (const word/signed dword/dword) render_show::toD0182_$2#0 = render_show::toD0182_$1#0*4 +Constant (const byte/signed word/word/dword/signed dword) render_show::toD0182_$6#0 = render_show::toD0182_$5#0/4 Constant (const byte/signed word/word/dword/signed dword) $7 = toSpritePtr1_return#0+3 Constant (const byte) sprites_irq::toSpritePtr2_$2#0 = ((byte))sprites_irq::toSpritePtr2_$1#0 Successful SSA optimization Pass2ConstantIdentification Constant (const byte) render_init::vicSelectGfxBank1_toDd001_return#0 = 3^render_init::vicSelectGfxBank1_toDd001_$2#0 -Constant (const byte) render_show::toD0181_$3#0 = >render_show::toD0181_$2#0 -Constant (const byte) render_show::toD0181_$7#0 = render_show::toD0181_$6#0&$f -Constant (const byte) render_show::toD0182_$3#0 = >render_show::toD0182_$2#0 -Constant (const byte) render_show::toD0182_$7#0 = render_show::toD0182_$6#0&$f +Constant (const byte/word) render_show::toD0181_$3#0 = >render_show::toD0181_$2#0 +Constant (const byte/word/dword) render_show::toD0181_$7#0 = render_show::toD0181_$6#0&$f +Constant (const byte/word) render_show::toD0182_$3#0 = >render_show::toD0182_$2#0 +Constant (const byte/word/dword) render_show::toD0182_$7#0 = render_show::toD0182_$6#0&$f Constant (const byte) sprites_irq::toSpritePtr2_return#0 = sprites_irq::toSpritePtr2_$2#0 Successful SSA optimization Pass2ConstantIdentification Constant (const byte) render_show::toD0181_return#0 = render_show::toD0181_$3#0|render_show::toD0181_$7#0 @@ -9386,7 +9386,7 @@ Inlining constant with var siblings (const byte) game_over#5 Inlining constant with var siblings (const byte) current_movedown_slow#9 Inlining constant with var siblings (const byte) keyboard_modifiers#2 Constant inlined play_remove_lines::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 -Constant inlined render_show::toD0181_$7#0 = >((word))(const byte*) PLAYFIELD_CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +Constant inlined render_show::toD0181_$7#0 = >((word))(const byte*) PLAYFIELD_CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f Constant inlined play_init::pli#0 = (const byte[PLAYFIELD_LINES#0*PLAYFIELD_COLS#0]) playfield#0 Constant inlined play_move_rotate::return#1 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined play_move_rotate::return#4 = (byte/signed byte/word/signed word/dword/signed dword) 1 @@ -9398,10 +9398,10 @@ Constant inlined render_screen_original::screen#1 = (const byte*) PLAYFIELD_SCRE Constant inlined render_screen_original::screen#0 = (const byte*) PLAYFIELD_SCREEN_1#0 Constant inlined render_screen_original::y#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined current_movedown_slow#9 = (byte/signed byte/word/signed word/dword/signed dword) 1 -Constant inlined render_show::toD0182_$7#0 = >((word))(const byte*) PLAYFIELD_CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +Constant inlined render_show::toD0182_$7#0 = >((word))(const byte*) PLAYFIELD_CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f Constant inlined render_playfield::i#0 = (const byte) PLAYFIELD_COLS#0*(byte/signed byte/word/signed word/dword/signed dword) 2 Constant inlined play_collision::$4 = (byte/signed byte/word/signed word/dword/signed dword) 2*(const byte) PLAYFIELD_LINES#0 -Constant inlined render_show::toD0182_$2#0 = ((word))(const byte*) PLAYFIELD_SCREEN_2#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined render_show::toD0182_$2#0 = ((word))(const byte*) PLAYFIELD_SCREEN_2#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined render_init::vicSelectGfxBank1_toDd001_$1#0 = >((word))(const byte*) PLAYFIELD_CHARSET#0 Constant inlined render_init::$12 = (const byte) PLAYFIELD_LINES#0-(byte/signed byte/word/signed word/dword/signed dword) 1 Constant inlined render_init::$10 = (const byte*) PLAYFIELD_SCREEN_2#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) $28 @@ -9418,9 +9418,9 @@ Constant inlined render_bcd::offset#4 = (const word) render_score::lines_offset# Constant inlined render_bcd::offset#5 = (const word) render_score::level_offset#0 Constant inlined render_bcd::offset#2 = (const word) render_score::score_offset#0+(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined render_bcd::offset#3 = (const word) render_score::lines_offset#0 -Constant inlined toSpritePtr1_$1#0 = ((word))(const byte*) PLAYFIELD_SPRITES#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +Constant inlined toSpritePtr1_$1#0 = ((word))(const byte*) PLAYFIELD_SPRITES#0/(byte/signed byte/word/signed word/dword/signed dword) $40 Constant inlined render_show::toD0182_gfx#0 = (const byte*) PLAYFIELD_CHARSET#0 -Constant inlined render_show::toD0181_$3#0 = >((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined render_show::toD0181_$3#0 = >((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined render_screen_original::$2 = (byte/signed byte/word/signed word/dword/signed dword) $20*(byte/signed byte/word/signed word/dword/signed dword) 2 Constant inlined render_init::$9 = (byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) $28 Constant inlined play_lock_current::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -9448,7 +9448,7 @@ Constant inlined $19 = (byte/signed byte/word/signed word/dword/signed dword) 4* Constant inlined render_show::toD0181_screen#0 = (const byte*) PLAYFIELD_SCREEN_1#0 Constant inlined render_playfield::l#0 = (byte/signed byte/word/signed word/dword/signed dword) 2 Constant inlined render_moving::c#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 -Constant inlined render_show::toD0182_$6#0 = >((word))(const byte*) PLAYFIELD_CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined render_show::toD0182_$6#0 = >((word))(const byte*) PLAYFIELD_CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined render_screen_original::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined render_bcd::only_low#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined render_bcd::only_low#1 = (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -9460,7 +9460,7 @@ Constant inlined keyboard_event_pressed::keycode#4 = (const byte) KEY_SPACE#0 Constant inlined render_bcd::only_low#3 = (byte/signed byte/word/signed word/dword/signed dword) 1 Constant inlined $22 = ((word))(const byte[4*4*4]) PIECE_T#0 Constant inlined render_bcd::only_low#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 -Constant inlined render_init::vicSelectGfxBank1_toDd001_$2#0 = >((word))(const byte*) PLAYFIELD_CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +Constant inlined render_init::vicSelectGfxBank1_toDd001_$2#0 = >((word))(const byte*) PLAYFIELD_CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) $40 Constant inlined $23 = ((word))(const byte[4*4*4]) PIECE_S#0 Constant inlined render_bcd::only_low#5 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined $24 = ((word))(const byte[4*4*4]) PIECE_Z#0 @@ -9477,7 +9477,7 @@ Constant inlined keyboard_event_pressed::keycode#2 = (const byte) KEY_CTRL#0 Constant inlined render_init::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined keyboard_event_pressed::keycode#1 = (const byte) KEY_RSHIFT#0 Constant inlined keyboard_event_pressed::keycode#0 = (const byte) KEY_LSHIFT#0 -Constant inlined sprites_irq::toSpritePtr2_$1#0 = ((word))(const byte*) PLAYFIELD_SPRITES#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +Constant inlined sprites_irq::toSpritePtr2_$1#0 = ((word))(const byte*) PLAYFIELD_SPRITES#0/(byte/signed byte/word/signed word/dword/signed dword) $40 Constant inlined play_collision::return#7 = (const byte) COLLISION_RIGHT#0 Constant inlined play_collision::return#6 = (const byte) COLLISION_LEFT#0 Constant inlined play_init::$1 = (const byte) PLAYFIELD_LINES#0-(byte/signed byte/word/signed word/dword/signed dword) 1 @@ -9533,7 +9533,7 @@ Constant inlined play_move_down::movedown#0 = (byte/signed byte/word/signed word Constant inlined play_remove_lines::w#0 = (const byte) PLAYFIELD_LINES#0*(const byte) PLAYFIELD_COLS#0-(byte/signed byte/word/signed word/dword/signed dword) 1 Constant inlined play_init::j#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined render_screen_original::ocols#0 = (const byte*) PLAYFIELD_COLORS_ORIGINAL#0+(byte/signed byte/word/signed word/dword/signed dword) $20*(byte/signed byte/word/signed word/dword/signed dword) 2 -Constant inlined render_show::toD0181_$6#0 = >((word))(const byte*) PLAYFIELD_CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined render_show::toD0181_$6#0 = >((word))(const byte*) PLAYFIELD_CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined play_lock_current::c#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined sprites_irq::toSpritePtr2_return#1 = (const byte) sprites_irq::toSpritePtr2_return#0 Constant inlined keyboard_event_scan::row#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -9549,7 +9549,7 @@ Constant inlined render_next::$1 = (byte/signed byte/word/signed word/dword/sign Constant inlined render_next::$0 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) $c Constant inlined play_collision::orientation#4 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined render_moving::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 -Constant inlined render_show::toD0182_$3#0 = >((word))(const byte*) PLAYFIELD_SCREEN_2#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined render_show::toD0182_$3#0 = >((word))(const byte*) PLAYFIELD_SCREEN_2#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined render_init::vicSelectGfxBank1_toDd001_$0#0 = ((word))(const byte*) PLAYFIELD_CHARSET#0 Constant inlined render_show::toD0182_screen#0 = (const byte*) PLAYFIELD_SCREEN_2#0 Constant inlined render_screen_original::oscr#0 = (const byte*) PLAYFIELD_SCREEN_ORIGINAL#0+(byte/signed byte/word/signed word/dword/signed dword) $20*(byte/signed byte/word/signed word/dword/signed dword) 2 @@ -9561,7 +9561,7 @@ Constant inlined sprites_irq::toSpritePtr2_sprite#0 = (const byte*) PLAYFIELD_SP Constant inlined render_score::$3 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 5 Constant inlined render_score::$10 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 1 Constant inlined play_collision::l#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 -Constant inlined render_show::toD0181_$2#0 = ((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined render_show::toD0181_$2#0 = ((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined keyboard_event_get::return#0 = (byte/word/signed word/dword/signed dword) $ff Constant inlined render_init::li_1#0 = (const byte*) PLAYFIELD_SCREEN_1#0+(byte/signed byte/word/signed word/dword/signed dword) 2*(byte/signed byte/word/signed word/dword/signed dword) $28+(byte/signed byte/word/signed word/dword/signed dword) $10 Constant inlined render_score::$1 = &(dword) score_bcd#14 @@ -12073,7 +12073,7 @@ VARIABLE REGISTER WEIGHTS (byte*) render_init::vicSelectGfxBank1_gfx (word~) render_init::vicSelectGfxBank1_toDd001_$0 (byte~) render_init::vicSelectGfxBank1_toDd001_$1 -(byte~) render_init::vicSelectGfxBank1_toDd001_$2 +(byte/signed word/word/dword/signed dword~) render_init::vicSelectGfxBank1_toDd001_$2 (byte/word/dword~) render_init::vicSelectGfxBank1_toDd001_$3 (byte*) render_init::vicSelectGfxBank1_toDd001_gfx (byte) render_init::vicSelectGfxBank1_toDd001_return @@ -12209,25 +12209,25 @@ VARIABLE REGISTER WEIGHTS (byte) render_show::d018val#3 2.0 (word~) render_show::toD0181_$0 (word~) render_show::toD0181_$1 -(word~) render_show::toD0181_$2 -(byte~) render_show::toD0181_$3 +(word/signed dword/dword~) render_show::toD0181_$2 +(byte/word~) render_show::toD0181_$3 (word~) render_show::toD0181_$4 (byte~) render_show::toD0181_$5 -(byte~) render_show::toD0181_$6 -(byte~) render_show::toD0181_$7 -(byte~) render_show::toD0181_$8 +(byte/signed word/word/dword/signed dword~) render_show::toD0181_$6 +(byte/word/dword~) render_show::toD0181_$7 +(byte/word/dword~) render_show::toD0181_$8 (byte*) render_show::toD0181_gfx (byte) render_show::toD0181_return (byte*) render_show::toD0181_screen (word~) render_show::toD0182_$0 (word~) render_show::toD0182_$1 -(word~) render_show::toD0182_$2 -(byte~) render_show::toD0182_$3 +(word/signed dword/dword~) render_show::toD0182_$2 +(byte/word~) render_show::toD0182_$3 (word~) render_show::toD0182_$4 (byte~) render_show::toD0182_$5 -(byte~) render_show::toD0182_$6 -(byte~) render_show::toD0182_$7 -(byte~) render_show::toD0182_$8 +(byte/signed word/word/dword/signed dword~) render_show::toD0182_$6 +(byte/word/dword~) render_show::toD0182_$7 +(byte/word/dword~) render_show::toD0182_$8 (byte*) render_show::toD0182_gfx (byte) render_show::toD0182_return (byte*) render_show::toD0182_screen @@ -12261,7 +12261,7 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() (byte) sprites_irq::raster_sprite_gfx_modify (byte) sprites_irq::raster_sprite_gfx_modify#0 6.5 (word~) sprites_irq::toSpritePtr2_$0 -(word~) sprites_irq::toSpritePtr2_$1 +(word/signed dword/dword~) sprites_irq::toSpritePtr2_$1 (byte~) sprites_irq::toSpritePtr2_$2 (byte) sprites_irq::toSpritePtr2_return (byte*) sprites_irq::toSpritePtr2_sprite @@ -12269,7 +12269,7 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() (byte) sprites_irq::ypos#0 2.5 (void()) sprites_irq_init() (word~) toSpritePtr1_$0 -(word~) toSpritePtr1_$1 +(word/signed dword/dword~) toSpritePtr1_$1 (byte~) toSpritePtr1_$2 (byte) toSpritePtr1_return (byte*) toSpritePtr1_sprite @@ -12998,7 +12998,7 @@ INITIAL ASM .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS // The line of the first IRQ .const IRQ_RASTER_FIRST = SPRITES_FIRST_YPOS+$13 - .const toSpritePtr1_return = PLAYFIELD_SPRITES>>6 + .const toSpritePtr1_return = PLAYFIELD_SPRITES/$40 .label keyboard_events_size = $5e .label keyboard_modifiers = $5b .label keyboard_modifiers_5 = $d1 @@ -15943,8 +15943,8 @@ keyboard_matrix_read: { //SEG1020 render_show // Update $D018 to show the current screen (used for double buffering) render_show: { - .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)<<2)|(>PLAYFIELD_CHARSET)>>2&$f - .const toD0182_return = (>(PLAYFIELD_SCREEN_2&$3fff)<<2)|(>PLAYFIELD_CHARSET)>>2&$f + .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)*4)|(>PLAYFIELD_CHARSET)/4&$f + .const toD0182_return = (>(PLAYFIELD_SCREEN_2&$3fff)*4)|(>PLAYFIELD_CHARSET)/4&$f .label d018val = $5f //SEG1021 [445] if((byte) render_screen_show#16==(byte/signed byte/word/signed word/dword/signed dword) 0) goto render_show::toD0181 -- vbuz1_eq_0_then_la1 lda render_screen_show @@ -16220,7 +16220,7 @@ sprites_init: { //SEG1102 render_init // Initialize rendering render_init: { - .const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_CHARSET)>>6 + .const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_CHARSET)/$40 .label _13 = $da .label _14 = $db .label li_1 = $68 @@ -16561,7 +16561,7 @@ sid_rnd_init: { // Repeats 10 timers every 2 lines from line IRQ_RASTER_FIRST // Utilizes duplicated gfx in the sprites to allow for some leeway in updating the sprite pointers sprites_irq: { - .const toSpritePtr2_return = PLAYFIELD_SPRITES>>6 + .const toSpritePtr2_return = PLAYFIELD_SPRITES/$40 .label _0 = $dd .label ypos = $dc .label raster_sprite_gfx_modify = $76 @@ -18184,7 +18184,7 @@ ASSEMBLER BEFORE OPTIMIZATION .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS // The line of the first IRQ .const IRQ_RASTER_FIRST = SPRITES_FIRST_YPOS+$13 - .const toSpritePtr1_return = PLAYFIELD_SPRITES>>6 + .const toSpritePtr1_return = PLAYFIELD_SPRITES/$40 .label keyboard_events_size = $23 .label render_screen_showing = $25 .label irq_raster_next = $26 @@ -20798,8 +20798,8 @@ keyboard_matrix_read: { //SEG1020 render_show // Update $D018 to show the current screen (used for double buffering) render_show: { - .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)<<2)|(>PLAYFIELD_CHARSET)>>2&$f - .const toD0182_return = (>(PLAYFIELD_SCREEN_2&$3fff)<<2)|(>PLAYFIELD_CHARSET)>>2&$f + .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)*4)|(>PLAYFIELD_CHARSET)/4&$f + .const toD0182_return = (>(PLAYFIELD_SCREEN_2&$3fff)*4)|(>PLAYFIELD_CHARSET)/4&$f //SEG1021 [445] if((byte) render_screen_show#16==(byte/signed byte/word/signed word/dword/signed dword) 0) goto render_show::toD0181 -- vbuz1_eq_0_then_la1 lda render_screen_show cmp #0 @@ -21054,7 +21054,7 @@ sprites_init: { //SEG1102 render_init // Initialize rendering render_init: { - .const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_CHARSET)>>6 + .const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_CHARSET)/$40 .label li_1 = 5 .label li_2 = 7 jmp vicSelectGfxBank1 @@ -21383,7 +21383,7 @@ sid_rnd_init: { // Repeats 10 timers every 2 lines from line IRQ_RASTER_FIRST // Utilizes duplicated gfx in the sprites to allow for some leeway in updating the sprite pointers sprites_irq: { - .const toSpritePtr2_return = PLAYFIELD_SPRITES>>6 + .const toSpritePtr2_return = PLAYFIELD_SPRITES/$40 .label raster_sprite_gfx_modify = $24 //SEG1209 entry interrupt(HARDWARE_CLOBBER) sta rega+1 @@ -23189,11 +23189,11 @@ FINAL SYMBOL TABLE (label) render_init::vicSelectGfxBank1_toDd001 (word~) render_init::vicSelectGfxBank1_toDd001_$0 (byte~) render_init::vicSelectGfxBank1_toDd001_$1 -(byte~) render_init::vicSelectGfxBank1_toDd001_$2 +(byte/signed word/word/dword/signed dword~) render_init::vicSelectGfxBank1_toDd001_$2 (byte/word/dword~) render_init::vicSelectGfxBank1_toDd001_$3 (byte*) render_init::vicSelectGfxBank1_toDd001_gfx (byte) render_init::vicSelectGfxBank1_toDd001_return -(const byte) render_init::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) PLAYFIELD_CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) render_init::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) PLAYFIELD_CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (void()) render_moving() (byte~) render_moving::$2 reg byte a 202.0 (label) render_moving::@1 @@ -23371,30 +23371,30 @@ FINAL SYMBOL TABLE (label) render_show::toD0181 (word~) render_show::toD0181_$0 (word~) render_show::toD0181_$1 -(word~) render_show::toD0181_$2 -(byte~) render_show::toD0181_$3 +(word/signed dword/dword~) render_show::toD0181_$2 +(byte/word~) render_show::toD0181_$3 (word~) render_show::toD0181_$4 (byte~) render_show::toD0181_$5 -(byte~) render_show::toD0181_$6 -(byte~) render_show::toD0181_$7 -(byte~) render_show::toD0181_$8 +(byte/signed word/word/dword/signed dword~) render_show::toD0181_$6 +(byte/word/dword~) render_show::toD0181_$7 +(byte/word/dword~) render_show::toD0181_$8 (byte*) render_show::toD0181_gfx (byte) render_show::toD0181_return -(const byte) render_show::toD0181_return#0 toD0181_return = >((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) PLAYFIELD_CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) render_show::toD0181_return#0 toD0181_return = >((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) PLAYFIELD_CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) render_show::toD0181_screen (label) render_show::toD0182 (word~) render_show::toD0182_$0 (word~) render_show::toD0182_$1 -(word~) render_show::toD0182_$2 -(byte~) render_show::toD0182_$3 +(word/signed dword/dword~) render_show::toD0182_$2 +(byte/word~) render_show::toD0182_$3 (word~) render_show::toD0182_$4 (byte~) render_show::toD0182_$5 -(byte~) render_show::toD0182_$6 -(byte~) render_show::toD0182_$7 -(byte~) render_show::toD0182_$8 +(byte/signed word/word/dword/signed dword~) render_show::toD0182_$6 +(byte/word/dword~) render_show::toD0182_$7 +(byte/word/dword~) render_show::toD0182_$8 (byte*) render_show::toD0182_gfx (byte) render_show::toD0182_return -(const byte) render_show::toD0182_return#0 toD0182_return = >((word))(const byte*) PLAYFIELD_SCREEN_2#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) PLAYFIELD_CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) render_show::toD0182_return#0 toD0182_return = >((word))(const byte*) PLAYFIELD_SCREEN_2#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) PLAYFIELD_CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) render_show::toD0182_screen (dword[5]) score_add_bcd (const dword[5]) score_add_bcd#0 score_add_bcd = { fill( 5, 0) } @@ -23445,10 +23445,10 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() (byte) sprites_irq::raster_sprite_gfx_modify#0 raster_sprite_gfx_modify zp ZP_BYTE:36 6.5 (label) sprites_irq::toSpritePtr2 (word~) sprites_irq::toSpritePtr2_$0 -(word~) sprites_irq::toSpritePtr2_$1 +(word/signed dword/dword~) sprites_irq::toSpritePtr2_$1 (byte~) sprites_irq::toSpritePtr2_$2 (byte) sprites_irq::toSpritePtr2_return -(const byte) sprites_irq::toSpritePtr2_return#0 toSpritePtr2_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) sprites_irq::toSpritePtr2_return#0 toSpritePtr2_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (byte*) sprites_irq::toSpritePtr2_sprite (byte) sprites_irq::ypos (byte) sprites_irq::ypos#0 reg byte a 2.5 @@ -23456,10 +23456,10 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() (label) sprites_irq_init::@return (label) toSpritePtr1 (word~) toSpritePtr1_$0 -(word~) toSpritePtr1_$1 +(word/signed dword/dword~) toSpritePtr1_$1 (byte~) toSpritePtr1_$2 (byte) toSpritePtr1_return -(const byte) toSpritePtr1_return#0 toSpritePtr1_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) toSpritePtr1_return#0 toSpritePtr1_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (byte*) toSpritePtr1_sprite zp ZP_BYTE:2 [ render_screen_show#16 render_screen_show#13 play_init::idx#2 play_init::idx#1 sprites_init::xpos#2 sprites_init::xpos#1 render_screen_original::y#6 render_screen_original::y#1 ] @@ -23739,7 +23739,7 @@ Score: 3348890 .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS // The line of the first IRQ .const IRQ_RASTER_FIRST = SPRITES_FIRST_YPOS+$13 - .const toSpritePtr1_return = PLAYFIELD_SPRITES>>6 + .const toSpritePtr1_return = PLAYFIELD_SPRITES/$40 .label keyboard_events_size = $23 .label render_screen_showing = $25 .label irq_raster_next = $26 @@ -25910,8 +25910,8 @@ keyboard_matrix_read: { //SEG1020 render_show // Update $D018 to show the current screen (used for double buffering) render_show: { - .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)<<2)|(>PLAYFIELD_CHARSET)>>2&$f - .const toD0182_return = (>(PLAYFIELD_SCREEN_2&$3fff)<<2)|(>PLAYFIELD_CHARSET)>>2&$f + .const toD0181_return = (>(PLAYFIELD_SCREEN_1&$3fff)*4)|(>PLAYFIELD_CHARSET)/4&$f + .const toD0182_return = (>(PLAYFIELD_SCREEN_2&$3fff)*4)|(>PLAYFIELD_CHARSET)/4&$f //SEG1021 [445] if((byte) render_screen_show#16==(byte/signed byte/word/signed word/dword/signed dword) 0) goto render_show::toD0181 -- vbuz1_eq_0_then_la1 lda render_screen_show cmp #0 @@ -26133,7 +26133,7 @@ sprites_init: { //SEG1102 render_init // Initialize rendering render_init: { - .const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_CHARSET)>>6 + .const vicSelectGfxBank1_toDd001_return = 3^(>PLAYFIELD_CHARSET)/$40 .label li_1 = 5 .label li_2 = 7 //SEG1103 render_init::vicSelectGfxBank1 @@ -26419,7 +26419,7 @@ sid_rnd_init: { // Repeats 10 timers every 2 lines from line IRQ_RASTER_FIRST // Utilizes duplicated gfx in the sprites to allow for some leeway in updating the sprite pointers sprites_irq: { - .const toSpritePtr2_return = PLAYFIELD_SPRITES>>6 + .const toSpritePtr2_return = PLAYFIELD_SPRITES/$40 .label raster_sprite_gfx_modify = $24 //SEG1209 entry interrupt(HARDWARE_CLOBBER) sta rega+1 diff --git a/src/test/ref/complex/tetris/tetris.sym b/src/test/ref/complex/tetris/tetris.sym index f0925af31..5cfd4fbd0 100644 --- a/src/test/ref/complex/tetris/tetris.sym +++ b/src/test/ref/complex/tetris/tetris.sym @@ -908,11 +908,11 @@ (label) render_init::vicSelectGfxBank1_toDd001 (word~) render_init::vicSelectGfxBank1_toDd001_$0 (byte~) render_init::vicSelectGfxBank1_toDd001_$1 -(byte~) render_init::vicSelectGfxBank1_toDd001_$2 +(byte/signed word/word/dword/signed dword~) render_init::vicSelectGfxBank1_toDd001_$2 (byte/word/dword~) render_init::vicSelectGfxBank1_toDd001_$3 (byte*) render_init::vicSelectGfxBank1_toDd001_gfx (byte) render_init::vicSelectGfxBank1_toDd001_return -(const byte) render_init::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) PLAYFIELD_CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) render_init::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) PLAYFIELD_CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (void()) render_moving() (byte~) render_moving::$2 reg byte a 202.0 (label) render_moving::@1 @@ -1090,30 +1090,30 @@ (label) render_show::toD0181 (word~) render_show::toD0181_$0 (word~) render_show::toD0181_$1 -(word~) render_show::toD0181_$2 -(byte~) render_show::toD0181_$3 +(word/signed dword/dword~) render_show::toD0181_$2 +(byte/word~) render_show::toD0181_$3 (word~) render_show::toD0181_$4 (byte~) render_show::toD0181_$5 -(byte~) render_show::toD0181_$6 -(byte~) render_show::toD0181_$7 -(byte~) render_show::toD0181_$8 +(byte/signed word/word/dword/signed dword~) render_show::toD0181_$6 +(byte/word/dword~) render_show::toD0181_$7 +(byte/word/dword~) render_show::toD0181_$8 (byte*) render_show::toD0181_gfx (byte) render_show::toD0181_return -(const byte) render_show::toD0181_return#0 toD0181_return = >((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) PLAYFIELD_CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) render_show::toD0181_return#0 toD0181_return = >((word))(const byte*) PLAYFIELD_SCREEN_1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) PLAYFIELD_CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) render_show::toD0181_screen (label) render_show::toD0182 (word~) render_show::toD0182_$0 (word~) render_show::toD0182_$1 -(word~) render_show::toD0182_$2 -(byte~) render_show::toD0182_$3 +(word/signed dword/dword~) render_show::toD0182_$2 +(byte/word~) render_show::toD0182_$3 (word~) render_show::toD0182_$4 (byte~) render_show::toD0182_$5 -(byte~) render_show::toD0182_$6 -(byte~) render_show::toD0182_$7 -(byte~) render_show::toD0182_$8 +(byte/signed word/word/dword/signed dword~) render_show::toD0182_$6 +(byte/word/dword~) render_show::toD0182_$7 +(byte/word/dword~) render_show::toD0182_$8 (byte*) render_show::toD0182_gfx (byte) render_show::toD0182_return -(const byte) render_show::toD0182_return#0 toD0182_return = >((word))(const byte*) PLAYFIELD_SCREEN_2#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) PLAYFIELD_CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) render_show::toD0182_return#0 toD0182_return = >((word))(const byte*) PLAYFIELD_SCREEN_2#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) PLAYFIELD_CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) render_show::toD0182_screen (dword[5]) score_add_bcd (const dword[5]) score_add_bcd#0 score_add_bcd = { fill( 5, 0) } @@ -1164,10 +1164,10 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() (byte) sprites_irq::raster_sprite_gfx_modify#0 raster_sprite_gfx_modify zp ZP_BYTE:36 6.5 (label) sprites_irq::toSpritePtr2 (word~) sprites_irq::toSpritePtr2_$0 -(word~) sprites_irq::toSpritePtr2_$1 +(word/signed dword/dword~) sprites_irq::toSpritePtr2_$1 (byte~) sprites_irq::toSpritePtr2_$2 (byte) sprites_irq::toSpritePtr2_return -(const byte) sprites_irq::toSpritePtr2_return#0 toSpritePtr2_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) sprites_irq::toSpritePtr2_return#0 toSpritePtr2_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (byte*) sprites_irq::toSpritePtr2_sprite (byte) sprites_irq::ypos (byte) sprites_irq::ypos#0 reg byte a 2.5 @@ -1175,10 +1175,10 @@ interrupt(HARDWARE_CLOBBER)(void()) sprites_irq() (label) sprites_irq_init::@return (label) toSpritePtr1 (word~) toSpritePtr1_$0 -(word~) toSpritePtr1_$1 +(word/signed dword/dword~) toSpritePtr1_$1 (byte~) toSpritePtr1_$2 (byte) toSpritePtr1_return -(const byte) toSpritePtr1_return#0 toSpritePtr1_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) toSpritePtr1_return#0 toSpritePtr1_return = ((byte))((word))(const byte*) PLAYFIELD_SPRITES#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (byte*) toSpritePtr1_sprite zp ZP_BYTE:2 [ render_screen_show#16 render_screen_show#13 play_init::idx#2 play_init::idx#1 sprites_init::xpos#2 sprites_init::xpos#1 render_screen_original::y#6 render_screen_original::y#1 ] diff --git a/src/test/ref/examples/fire/fire.asm b/src/test/ref/examples/fire/fire.asm index d1deada69..c8a9f74a4 100644 --- a/src/test/ref/examples/fire/fire.asm +++ b/src/test/ref/examples/fire/fire.asm @@ -24,8 +24,8 @@ .label BUFFER = $4000 .label CHARSET = $3000 main: { - .const toD0181_return = (>(SCREEN1&$3fff)<<2)|(>CHARSET)>>2&$f - .const toD0182_return = (>(SCREEN2&$3fff)<<2)|(>CHARSET)>>2&$f + .const toD0181_return = (>(SCREEN1&$3fff)*4)|(>CHARSET)/4&$f + .const toD0182_return = (>(SCREEN2&$3fff)*4)|(>CHARSET)/4&$f sei lda #BLACK sta BORDERCOL diff --git a/src/test/ref/examples/fire/fire.log b/src/test/ref/examples/fire/fire.log index 90d19617b..460a30e27 100644 --- a/src/test/ref/examples/fire/fire.log +++ b/src/test/ref/examples/fire/fire.log @@ -172,14 +172,14 @@ main::toD0181: scope:[main] from main::@15 (byte*) main::toD0181_screen#1 ← phi( main::@15/(byte*) main::toD0181_screen#0 ) (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1 (word) main::toD0181_$1#0 ← (word) main::toD0181_$0#0 & (word/signed word/dword/signed dword) $3fff - (word) main::toD0181_$2#0 ← (word) main::toD0181_$1#0 << (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0181_$3#0 ← > (word) main::toD0181_$2#0 + (word/signed dword/dword) main::toD0181_$2#0 ← (word) main::toD0181_$1#0 * (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word) main::toD0181_$3#0 ← > (word/signed dword/dword) main::toD0181_$2#0 (word) main::toD0181_$4#0 ← ((word)) (byte*) main::toD0181_gfx#1 (byte) main::toD0181_$5#0 ← > (word) main::toD0181_$4#0 - (byte) main::toD0181_$6#0 ← (byte) main::toD0181_$5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0181_$7#0 ← (byte) main::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f - (byte) main::toD0181_$8#0 ← (byte) main::toD0181_$3#0 | (byte) main::toD0181_$7#0 - (byte) main::toD0181_return#0 ← (byte) main::toD0181_$8#0 + (byte/signed word/word/dword/signed dword) main::toD0181_$6#0 ← (byte) main::toD0181_$5#0 / (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word/dword) main::toD0181_$7#0 ← (byte/signed word/word/dword/signed dword) main::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f + (byte/word/dword) main::toD0181_$8#0 ← (byte/word) main::toD0181_$3#0 | (byte/word/dword) main::toD0181_$7#0 + (byte) main::toD0181_return#0 ← (byte/word/dword) main::toD0181_$8#0 to:main::toD0181_@return main::toD0181_@return: scope:[main] from main::toD0181 (byte) main::toD0181_return#2 ← phi( main::toD0181/(byte) main::toD0181_return#0 ) @@ -201,14 +201,14 @@ main::toD0182: scope:[main] from main::@16 (byte*) main::toD0182_screen#1 ← phi( main::@16/(byte*) main::toD0182_screen#0 ) (word) main::toD0182_$0#0 ← ((word)) (byte*) main::toD0182_screen#1 (word) main::toD0182_$1#0 ← (word) main::toD0182_$0#0 & (word/signed word/dword/signed dword) $3fff - (word) main::toD0182_$2#0 ← (word) main::toD0182_$1#0 << (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0182_$3#0 ← > (word) main::toD0182_$2#0 + (word/signed dword/dword) main::toD0182_$2#0 ← (word) main::toD0182_$1#0 * (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word) main::toD0182_$3#0 ← > (word/signed dword/dword) main::toD0182_$2#0 (word) main::toD0182_$4#0 ← ((word)) (byte*) main::toD0182_gfx#1 (byte) main::toD0182_$5#0 ← > (word) main::toD0182_$4#0 - (byte) main::toD0182_$6#0 ← (byte) main::toD0182_$5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0182_$7#0 ← (byte) main::toD0182_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f - (byte) main::toD0182_$8#0 ← (byte) main::toD0182_$3#0 | (byte) main::toD0182_$7#0 - (byte) main::toD0182_return#0 ← (byte) main::toD0182_$8#0 + (byte/signed word/word/dword/signed dword) main::toD0182_$6#0 ← (byte) main::toD0182_$5#0 / (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word/dword) main::toD0182_$7#0 ← (byte/signed word/word/dword/signed dword) main::toD0182_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f + (byte/word/dword) main::toD0182_$8#0 ← (byte/word) main::toD0182_$3#0 | (byte/word/dword) main::toD0182_$7#0 + (byte) main::toD0182_return#0 ← (byte/word/dword) main::toD0182_$8#0 to:main::toD0182_@return main::toD0182_@return: scope:[main] from main::toD0182 (byte) main::toD0182_return#2 ← phi( main::toD0182/(byte) main::toD0182_return#0 ) @@ -755,20 +755,20 @@ SYMBOL TABLE SSA (word) main::toD0181_$0#0 (word~) main::toD0181_$1 (word) main::toD0181_$1#0 -(word~) main::toD0181_$2 -(word) main::toD0181_$2#0 -(byte~) main::toD0181_$3 -(byte) main::toD0181_$3#0 +(word/signed dword/dword~) main::toD0181_$2 +(word/signed dword/dword) main::toD0181_$2#0 +(byte/word~) main::toD0181_$3 +(byte/word) main::toD0181_$3#0 (word~) main::toD0181_$4 (word) main::toD0181_$4#0 (byte~) main::toD0181_$5 (byte) main::toD0181_$5#0 -(byte~) main::toD0181_$6 -(byte) main::toD0181_$6#0 -(byte~) main::toD0181_$7 -(byte) main::toD0181_$7#0 -(byte~) main::toD0181_$8 -(byte) main::toD0181_$8#0 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/signed word/word/dword/signed dword) main::toD0181_$6#0 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword) main::toD0181_$7#0 +(byte/word/dword~) main::toD0181_$8 +(byte/word/dword) main::toD0181_$8#0 (label) main::toD0181_@return (byte*) main::toD0181_gfx (byte*) main::toD0181_gfx#0 @@ -786,20 +786,20 @@ SYMBOL TABLE SSA (word) main::toD0182_$0#0 (word~) main::toD0182_$1 (word) main::toD0182_$1#0 -(word~) main::toD0182_$2 -(word) main::toD0182_$2#0 -(byte~) main::toD0182_$3 -(byte) main::toD0182_$3#0 +(word/signed dword/dword~) main::toD0182_$2 +(word/signed dword/dword) main::toD0182_$2#0 +(byte/word~) main::toD0182_$3 +(byte/word) main::toD0182_$3#0 (word~) main::toD0182_$4 (word) main::toD0182_$4#0 (byte~) main::toD0182_$5 (byte) main::toD0182_$5#0 -(byte~) main::toD0182_$6 -(byte) main::toD0182_$6#0 -(byte~) main::toD0182_$7 -(byte) main::toD0182_$7#0 -(byte~) main::toD0182_$8 -(byte) main::toD0182_$8#0 +(byte/signed word/word/dword/signed dword~) main::toD0182_$6 +(byte/signed word/word/dword/signed dword) main::toD0182_$6#0 +(byte/word/dword~) main::toD0182_$7 +(byte/word/dword) main::toD0182_$7#0 +(byte/word/dword~) main::toD0182_$8 +(byte/word/dword) main::toD0182_$8#0 (label) main::toD0182_@return (byte*) main::toD0182_gfx (byte*) main::toD0182_gfx#0 @@ -931,10 +931,10 @@ Successful SSA optimization Pass2UnaryNotSimplification Alias (byte) sid_rnd::return#0 = (byte) sid_rnd::return#3 (byte) sid_rnd::return#1 Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 -Alias (byte) main::toD0181_return#0 = (byte) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$7 +Alias (byte) main::toD0181_return#0 = (byte/word/dword) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$7 Alias (byte*) main::toD0182_screen#0 = (byte*) main::toD0182_screen#1 Alias (byte*) main::toD0182_gfx#0 = (byte*) main::toD0182_gfx#1 -Alias (byte) main::toD0182_return#0 = (byte) main::toD0182_$8#0 (byte) main::toD0182_return#2 (byte) main::toD0182_return#1 (byte) main::toD0182_return#3 (byte~) main::$9 +Alias (byte) main::toD0182_return#0 = (byte/word/dword) main::toD0182_$8#0 (byte) main::toD0182_return#2 (byte) main::toD0182_return#1 (byte) main::toD0182_return#3 (byte~) main::$9 Alias (byte*) fire::screen#0 = (byte*) fire::screenbase#2 Alias (byte*) fire::buffer#4 = (byte*) fire::buffer#5 (byte*) fire::buffer#9 Alias (byte*) fire::screen#6 = (byte*) fire::screen#9 (byte*) fire::screen#7 @@ -1145,15 +1145,15 @@ Constant (const byte) main::toD0181_$5#0 = >main::toD0181_$4#0 Constant (const word) main::toD0182_$1#0 = main::toD0182_$0#0&$3fff Constant (const byte) main::toD0182_$5#0 = >main::toD0182_$4#0 Successful SSA optimization Pass2ConstantIdentification -Constant (const word) main::toD0181_$2#0 = main::toD0181_$1#0<<2 -Constant (const byte) main::toD0181_$6#0 = main::toD0181_$5#0>>2 -Constant (const word) main::toD0182_$2#0 = main::toD0182_$1#0<<2 -Constant (const byte) main::toD0182_$6#0 = main::toD0182_$5#0>>2 +Constant (const word/signed dword/dword) main::toD0181_$2#0 = main::toD0181_$1#0*4 +Constant (const byte/signed word/word/dword/signed dword) main::toD0181_$6#0 = main::toD0181_$5#0/4 +Constant (const word/signed dword/dword) main::toD0182_$2#0 = main::toD0182_$1#0*4 +Constant (const byte/signed word/word/dword/signed dword) main::toD0182_$6#0 = main::toD0182_$5#0/4 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) main::toD0181_$3#0 = >main::toD0181_$2#0 -Constant (const byte) main::toD0181_$7#0 = main::toD0181_$6#0&$f -Constant (const byte) main::toD0182_$3#0 = >main::toD0182_$2#0 -Constant (const byte) main::toD0182_$7#0 = main::toD0182_$6#0&$f +Constant (const byte/word) main::toD0181_$3#0 = >main::toD0181_$2#0 +Constant (const byte/word/dword) main::toD0181_$7#0 = main::toD0181_$6#0&$f +Constant (const byte/word) main::toD0182_$3#0 = >main::toD0182_$2#0 +Constant (const byte/word/dword) main::toD0182_$7#0 = main::toD0182_$6#0&$f Successful SSA optimization Pass2ConstantIdentification Constant (const byte) main::toD0181_return#0 = main::toD0181_$3#0|main::toD0181_$7#0 Constant (const byte) main::toD0182_return#0 = main::toD0182_$3#0|main::toD0182_$7#0 @@ -1212,16 +1212,16 @@ Constant inlined fillscreen::fill#3 = (const byte) YELLOW#0 Constant inlined makecharset::bc#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined main::toD0182_gfx#0 = (const byte*) CHARSET#0 Constant inlined main::toD0182_$4#0 = ((word))(const byte*) CHARSET#0 -Constant inlined main::toD0182_$6#0 = >((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0182_$6#0 = >((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined main::toD0181_$1#0 = ((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff Constant inlined makecharset::ii#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined makecharset::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined makecharset::font1#0 = (const byte*) CHARSET#0+(byte/signed byte/word/signed word/dword/signed dword) $40*(byte/signed byte/word/signed word/dword/signed dword) 8 -Constant inlined main::toD0181_$7#0 = >((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +Constant inlined main::toD0181_$7#0 = >((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f Constant inlined makecharset::charset#0 = (const byte*) CHARSET#0 Constant inlined main::toD0182_$0#0 = ((word))(const byte*) SCREEN2#0 -Constant inlined main::toD0181_$3#0 = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 -Constant inlined main::toD0182_$2#0 = ((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$3#0 = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 +Constant inlined main::toD0182_$2#0 = ((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined main::toD0181_$5#0 = >((word))(const byte*) CHARSET#0 Constant inlined makecharset::c#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined fillscreen::fill#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -1246,14 +1246,14 @@ Constant inlined makecharset::$5 = (word/signed word/dword/signed dword) $100*(b Constant inlined makecharset::$3 = (byte/signed byte/word/signed word/dword/signed dword) $40*(byte/signed byte/word/signed word/dword/signed dword) 8 Constant inlined makecharset::$0 = (byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 8 Constant inlined makecharset::$1 = (const byte*) CHARSET#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 8 -Constant inlined main::toD0182_$3#0 = >((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0182_$3#0 = >((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined main::toD0181_$0#0 = ((word))(const byte*) SCREEN1#0 Constant inlined main::toD0182_$5#0 = >((word))(const byte*) CHARSET#0 Constant inlined makecharset::$16 = (const byte*) CHARSET#0+(byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 8 -Constant inlined main::toD0182_$7#0 = >((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +Constant inlined main::toD0182_$7#0 = >((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f Constant inlined makecharset::$15 = (byte/signed byte/word/signed word/dword/signed dword) 1*(byte/signed byte/word/signed word/dword/signed dword) 8 -Constant inlined main::toD0181_$6#0 = >((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2 -Constant inlined main::toD0181_$2#0 = ((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$6#0 = >((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4 +Constant inlined main::toD0181_$2#0 = ((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined main::toD0182_screen#0 = (const byte*) SCREEN2#0 Constant inlined main::toD0181_$4#0 = ((word))(const byte*) CHARSET#0 Constant inlined main::toD0182_$1#0 = ((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff @@ -1683,25 +1683,25 @@ VARIABLE REGISTER WEIGHTS (void()) main() (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return (byte*) main::toD0181_screen (word~) main::toD0182_$0 (word~) main::toD0182_$1 -(word~) main::toD0182_$2 -(byte~) main::toD0182_$3 +(word/signed dword/dword~) main::toD0182_$2 +(byte/word~) main::toD0182_$3 (word~) main::toD0182_$4 (byte~) main::toD0182_$5 -(byte~) main::toD0182_$6 -(byte~) main::toD0182_$7 -(byte~) main::toD0182_$8 +(byte/signed word/word/dword/signed dword~) main::toD0182_$6 +(byte/word/dword~) main::toD0182_$7 +(byte/word/dword~) main::toD0182_$8 (byte*) main::toD0182_gfx (byte) main::toD0182_return (byte*) main::toD0182_screen @@ -1883,8 +1883,8 @@ bend_from_b1: bend: //SEG9 main main: { - .const toD0181_return = (>(SCREEN1&$3fff)<<2)|(>CHARSET)>>2&$f - .const toD0182_return = (>(SCREEN2&$3fff)<<2)|(>CHARSET)>>2&$f + .const toD0181_return = (>(SCREEN1&$3fff)*4)|(>CHARSET)/4&$f + .const toD0182_return = (>(SCREEN2&$3fff)*4)|(>CHARSET)/4&$f //SEG10 asm { sei } sei //SEG11 [5] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 @@ -2734,8 +2734,8 @@ bend_from_b1: bend: //SEG9 main main: { - .const toD0181_return = (>(SCREEN1&$3fff)<<2)|(>CHARSET)>>2&$f - .const toD0182_return = (>(SCREEN2&$3fff)<<2)|(>CHARSET)>>2&$f + .const toD0181_return = (>(SCREEN1&$3fff)*4)|(>CHARSET)/4&$f + .const toD0182_return = (>(SCREEN2&$3fff)*4)|(>CHARSET)/4&$f //SEG10 asm { sei } sei //SEG11 [5] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 @@ -3640,30 +3640,30 @@ FINAL SYMBOL TABLE (label) main::toD0181 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0181_screen (label) main::toD0182 (word~) main::toD0182_$0 (word~) main::toD0182_$1 -(word~) main::toD0182_$2 -(byte~) main::toD0182_$3 +(word/signed dword/dword~) main::toD0182_$2 +(byte/word~) main::toD0182_$3 (word~) main::toD0182_$4 (byte~) main::toD0182_$5 -(byte~) main::toD0182_$6 -(byte~) main::toD0182_$7 -(byte~) main::toD0182_$8 +(byte/signed word/word/dword/signed dword~) main::toD0182_$6 +(byte/word/dword~) main::toD0182_$7 +(byte/word/dword~) main::toD0182_$8 (byte*) main::toD0182_gfx (byte) main::toD0182_return -(const byte) main::toD0182_return#0 toD0182_return = >((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0182_return#0 toD0182_return = >((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0182_screen (void()) makecharset((byte*) makecharset::charset) (byte~) makecharset::$11 reg byte a 2002.0 @@ -3780,8 +3780,8 @@ Score: 99615 //SEG8 @end //SEG9 main main: { - .const toD0181_return = (>(SCREEN1&$3fff)<<2)|(>CHARSET)>>2&$f - .const toD0182_return = (>(SCREEN2&$3fff)<<2)|(>CHARSET)>>2&$f + .const toD0181_return = (>(SCREEN1&$3fff)*4)|(>CHARSET)/4&$f + .const toD0182_return = (>(SCREEN2&$3fff)*4)|(>CHARSET)/4&$f //SEG10 asm { sei } sei //SEG11 [5] *((const byte*) BORDERCOL#0) ← (const byte) BLACK#0 -- _deref_pbuc1=vbuc2 diff --git a/src/test/ref/examples/fire/fire.sym b/src/test/ref/examples/fire/fire.sym index 21be23d3e..30d0f7b48 100644 --- a/src/test/ref/examples/fire/fire.sym +++ b/src/test/ref/examples/fire/fire.sym @@ -169,30 +169,30 @@ (label) main::toD0181 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0181_screen (label) main::toD0182 (word~) main::toD0182_$0 (word~) main::toD0182_$1 -(word~) main::toD0182_$2 -(byte~) main::toD0182_$3 +(word/signed dword/dword~) main::toD0182_$2 +(byte/word~) main::toD0182_$3 (word~) main::toD0182_$4 (byte~) main::toD0182_$5 -(byte~) main::toD0182_$6 -(byte~) main::toD0182_$7 -(byte~) main::toD0182_$8 +(byte/signed word/word/dword/signed dword~) main::toD0182_$6 +(byte/word/dword~) main::toD0182_$7 +(byte/word/dword~) main::toD0182_$8 (byte*) main::toD0182_gfx (byte) main::toD0182_return -(const byte) main::toD0182_return#0 toD0182_return = >((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0182_return#0 toD0182_return = >((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0182_screen (void()) makecharset((byte*) makecharset::charset) (byte~) makecharset::$11 reg byte a 2002.0 diff --git a/src/test/ref/examples/plasma/plasma-unroll.asm b/src/test/ref/examples/plasma/plasma-unroll.asm index b5bbc160d..cff6e7d8e 100644 --- a/src/test/ref/examples/plasma/plasma-unroll.asm +++ b/src/test/ref/examples/plasma/plasma-unroll.asm @@ -30,7 +30,7 @@ .label c2A = 6 .label c2B = 7 main: { - .const toD0181_return = (>(SCREEN1&$3fff)<<2)|(>CHARSET)>>2&$f + .const toD0181_return = (>(SCREEN1&$3fff)*4)|(>CHARSET)/4&$f .label col = 2 sei lda #BLUE diff --git a/src/test/ref/examples/plasma/plasma-unroll.log b/src/test/ref/examples/plasma/plasma-unroll.log index 414798863..a1914eadc 100644 --- a/src/test/ref/examples/plasma/plasma-unroll.log +++ b/src/test/ref/examples/plasma/plasma-unroll.log @@ -236,14 +236,14 @@ main::toD0181: scope:[main] from main::@10 (byte*) main::toD0181_screen#1 ← phi( main::@10/(byte*) main::toD0181_screen#0 ) (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1 (word) main::toD0181_$1#0 ← (word) main::toD0181_$0#0 & (word/signed word/dword/signed dword) $3fff - (word) main::toD0181_$2#0 ← (word) main::toD0181_$1#0 << (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0181_$3#0 ← > (word) main::toD0181_$2#0 + (word/signed dword/dword) main::toD0181_$2#0 ← (word) main::toD0181_$1#0 * (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word) main::toD0181_$3#0 ← > (word/signed dword/dword) main::toD0181_$2#0 (word) main::toD0181_$4#0 ← ((word)) (byte*) main::toD0181_gfx#1 (byte) main::toD0181_$5#0 ← > (word) main::toD0181_$4#0 - (byte) main::toD0181_$6#0 ← (byte) main::toD0181_$5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0181_$7#0 ← (byte) main::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f - (byte) main::toD0181_$8#0 ← (byte) main::toD0181_$3#0 | (byte) main::toD0181_$7#0 - (byte) main::toD0181_return#0 ← (byte) main::toD0181_$8#0 + (byte/signed word/word/dword/signed dword) main::toD0181_$6#0 ← (byte) main::toD0181_$5#0 / (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word/dword) main::toD0181_$7#0 ← (byte/signed word/word/dword/signed dword) main::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f + (byte/word/dword) main::toD0181_$8#0 ← (byte/word) main::toD0181_$3#0 | (byte/word/dword) main::toD0181_$7#0 + (byte) main::toD0181_return#0 ← (byte/word/dword) main::toD0181_$8#0 to:main::toD0181_@return main::toD0181_@return: scope:[main] from main::toD0181 (byte) c2B#21 ← phi( main::toD0181/(byte) c2B#23 ) @@ -1021,20 +1021,20 @@ SYMBOL TABLE SSA (word) main::toD0181_$0#0 (word~) main::toD0181_$1 (word) main::toD0181_$1#0 -(word~) main::toD0181_$2 -(word) main::toD0181_$2#0 -(byte~) main::toD0181_$3 -(byte) main::toD0181_$3#0 +(word/signed dword/dword~) main::toD0181_$2 +(word/signed dword/dword) main::toD0181_$2#0 +(byte/word~) main::toD0181_$3 +(byte/word) main::toD0181_$3#0 (word~) main::toD0181_$4 (word) main::toD0181_$4#0 (byte~) main::toD0181_$5 (byte) main::toD0181_$5#0 -(byte~) main::toD0181_$6 -(byte) main::toD0181_$6#0 -(byte~) main::toD0181_$7 -(byte) main::toD0181_$7#0 -(byte~) main::toD0181_$8 -(byte) main::toD0181_$8#0 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/signed word/word/dword/signed dword) main::toD0181_$6#0 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword) main::toD0181_$7#0 +(byte/word/dword~) main::toD0181_$8 +(byte/word/dword) main::toD0181_$8#0 (label) main::toD0181_@return (byte*) main::toD0181_gfx (byte*) main::toD0181_gfx#0 @@ -1289,7 +1289,7 @@ Alias (byte*) print_line_cursor#21 = (byte*) print_line_cursor#3 (byte*) print_l Alias (byte*) print_char_cursor#14 = (byte*) print_char_cursor#5 (byte*) print_char_cursor#38 (byte*) print_char_cursor#33 (byte*) print_char_cursor#28 Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 -Alias (byte) main::toD0181_return#0 = (byte) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$1 +Alias (byte) main::toD0181_return#0 = (byte/word/dword) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$1 Alias (byte) c1A#1 = (byte) c1A#12 (byte) c1A#13 (byte) c1A#7 Alias (byte) c1B#1 = (byte) c1B#12 (byte) c1B#13 (byte) c1B#7 Alias (byte) c2A#1 = (byte) c2A#12 (byte) c2A#13 (byte) c2A#7 @@ -1603,11 +1603,11 @@ Successful SSA optimization Pass2ConstantIdentification Constant (const word) main::toD0181_$1#0 = main::toD0181_$0#0&$3fff Constant (const byte) main::toD0181_$5#0 = >main::toD0181_$4#0 Successful SSA optimization Pass2ConstantIdentification -Constant (const word) main::toD0181_$2#0 = main::toD0181_$1#0<<2 -Constant (const byte) main::toD0181_$6#0 = main::toD0181_$5#0>>2 +Constant (const word/signed dword/dword) main::toD0181_$2#0 = main::toD0181_$1#0*4 +Constant (const byte/signed word/word/dword/signed dword) main::toD0181_$6#0 = main::toD0181_$5#0/4 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) main::toD0181_$3#0 = >main::toD0181_$2#0 -Constant (const byte) main::toD0181_$7#0 = main::toD0181_$6#0&$f +Constant (const byte/word) main::toD0181_$3#0 = >main::toD0181_$2#0 +Constant (const byte/word/dword) main::toD0181_$7#0 = main::toD0181_$6#0&$f Successful SSA optimization Pass2ConstantIdentification Constant (const byte) main::toD0181_return#0 = main::toD0181_$3#0|main::toD0181_$7#0 Successful SSA optimization Pass2ConstantIdentification @@ -2049,9 +2049,9 @@ Constant inlined doplasma::$61 = (const byte*) SCREEN1#0++++++++++++++++++++++++ Constant inlined doplasma::ii#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined doplasma::ii#1 = ++(byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined doplasma::ii#4 = ++++(byte/signed byte/word/signed word/dword/signed dword) 0 -Constant inlined main::toD0181_$7#0 = >((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +Constant inlined main::toD0181_$7#0 = >((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f Constant inlined doplasma::$57 = ++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) $28 -Constant inlined main::toD0181_$3#0 = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$3#0 = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined doplasma::$58 = (const byte*) SCREEN1#0+++++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) $28 Constant inlined doplasma::$52 = (const byte*) SCREEN1#0+++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) $28 Constant inlined doplasma::$55 = (const byte*) SCREEN1#0+++++++++++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) $28 @@ -2121,9 +2121,9 @@ Constant inlined doplasma::$48 = ++++++++++++++++++++++++++++(byte/signed byte/w Constant inlined doplasma::$42 = ++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) $28 Constant inlined doplasma::$43 = (const byte*) SCREEN1#0+++++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) $28 Constant inlined doplasma::$40 = (const byte*) SCREEN1#0+++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) $28 -Constant inlined main::toD0181_$6#0 = >((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$6#0 = >((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined doplasma::$39 = ++++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) $28 -Constant inlined main::toD0181_$2#0 = ((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$2#0 = ((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined c1B#16 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined doplasma::$34 = (const byte*) SCREEN1#0+++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) $28 Constant inlined doplasma::$37 = (const byte*) SCREEN1#0+++++++++++++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0*(byte/signed byte/word/signed word/dword/signed dword) $28 @@ -2747,13 +2747,13 @@ VARIABLE REGISTER WEIGHTS (byte*) main::col#2 16.5 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return (byte*) main::toD0181_screen @@ -3023,7 +3023,7 @@ bend_from_b2: bend: //SEG11 main main: { - .const toD0181_return = (>(SCREEN1&$3fff)<<2)|(>CHARSET)>>2&$f + .const toD0181_return = (>(SCREEN1&$3fff)*4)|(>CHARSET)/4&$f .label col = 2 //SEG12 asm { sei } sei @@ -4256,7 +4256,7 @@ bend_from_b2: bend: //SEG11 main main: { - .const toD0181_return = (>(SCREEN1&$3fff)<<2)|(>CHARSET)>>2&$f + .const toD0181_return = (>(SCREEN1&$3fff)*4)|(>CHARSET)/4&$f .label col = 2 //SEG12 asm { sei } sei @@ -5416,16 +5416,16 @@ FINAL SYMBOL TABLE (label) main::toD0181 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0181_screen (void()) makecharset((byte*) makecharset::charset) (byte/word~) makecharset::$11 reg byte a 22.0 @@ -5585,7 +5585,7 @@ Score: 97100 //SEG10 @end //SEG11 main main: { - .const toD0181_return = (>(SCREEN1&$3fff)<<2)|(>CHARSET)>>2&$f + .const toD0181_return = (>(SCREEN1&$3fff)*4)|(>CHARSET)/4&$f .label col = 2 //SEG12 asm { sei } sei diff --git a/src/test/ref/examples/plasma/plasma-unroll.sym b/src/test/ref/examples/plasma/plasma-unroll.sym index 79f878b5a..6873ccd55 100644 --- a/src/test/ref/examples/plasma/plasma-unroll.sym +++ b/src/test/ref/examples/plasma/plasma-unroll.sym @@ -227,16 +227,16 @@ (label) main::toD0181 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0181_screen (void()) makecharset((byte*) makecharset::charset) (byte/word~) makecharset::$11 reg byte a 22.0 diff --git a/src/test/ref/examples/plasma/plasma.asm b/src/test/ref/examples/plasma/plasma.asm index 87d3d9f7f..caf3b038c 100644 --- a/src/test/ref/examples/plasma/plasma.asm +++ b/src/test/ref/examples/plasma/plasma.asm @@ -30,8 +30,8 @@ .label c2A = 6 .label c2B = 7 main: { - .const toD0181_return = (>(SCREEN1&$3fff)<<2)|(>CHARSET)>>2&$f - .const toD0182_return = (>(SCREEN2&$3fff)<<2)|(>CHARSET)>>2&$f + .const toD0181_return = (>(SCREEN1&$3fff)*4)|(>CHARSET)/4&$f + .const toD0182_return = (>(SCREEN2&$3fff)*4)|(>CHARSET)/4&$f .label col = 2 sei lda #BLUE diff --git a/src/test/ref/examples/plasma/plasma.log b/src/test/ref/examples/plasma/plasma.log index 356814ea7..ee521e111 100644 --- a/src/test/ref/examples/plasma/plasma.log +++ b/src/test/ref/examples/plasma/plasma.log @@ -269,14 +269,14 @@ main::toD0181: scope:[main] from main::@12 (byte*) main::toD0181_screen#1 ← phi( main::@12/(byte*) main::toD0181_screen#0 ) (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1 (word) main::toD0181_$1#0 ← (word) main::toD0181_$0#0 & (word/signed word/dword/signed dword) $3fff - (word) main::toD0181_$2#0 ← (word) main::toD0181_$1#0 << (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0181_$3#0 ← > (word) main::toD0181_$2#0 + (word/signed dword/dword) main::toD0181_$2#0 ← (word) main::toD0181_$1#0 * (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word) main::toD0181_$3#0 ← > (word/signed dword/dword) main::toD0181_$2#0 (word) main::toD0181_$4#0 ← ((word)) (byte*) main::toD0181_gfx#1 (byte) main::toD0181_$5#0 ← > (word) main::toD0181_$4#0 - (byte) main::toD0181_$6#0 ← (byte) main::toD0181_$5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0181_$7#0 ← (byte) main::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f - (byte) main::toD0181_$8#0 ← (byte) main::toD0181_$3#0 | (byte) main::toD0181_$7#0 - (byte) main::toD0181_return#0 ← (byte) main::toD0181_$8#0 + (byte/signed word/word/dword/signed dword) main::toD0181_$6#0 ← (byte) main::toD0181_$5#0 / (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word/dword) main::toD0181_$7#0 ← (byte/signed word/word/dword/signed dword) main::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f + (byte/word/dword) main::toD0181_$8#0 ← (byte/word) main::toD0181_$3#0 | (byte/word/dword) main::toD0181_$7#0 + (byte) main::toD0181_return#0 ← (byte/word/dword) main::toD0181_$8#0 to:main::toD0181_@return main::toD0181_@return: scope:[main] from main::toD0181 (byte*) print_char_cursor#44 ← phi( main::toD0181/(byte*) print_char_cursor#46 ) @@ -326,14 +326,14 @@ main::toD0182: scope:[main] from main::@13 (byte*) main::toD0182_screen#1 ← phi( main::@13/(byte*) main::toD0182_screen#0 ) (word) main::toD0182_$0#0 ← ((word)) (byte*) main::toD0182_screen#1 (word) main::toD0182_$1#0 ← (word) main::toD0182_$0#0 & (word/signed word/dword/signed dword) $3fff - (word) main::toD0182_$2#0 ← (word) main::toD0182_$1#0 << (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0182_$3#0 ← > (word) main::toD0182_$2#0 + (word/signed dword/dword) main::toD0182_$2#0 ← (word) main::toD0182_$1#0 * (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word) main::toD0182_$3#0 ← > (word/signed dword/dword) main::toD0182_$2#0 (word) main::toD0182_$4#0 ← ((word)) (byte*) main::toD0182_gfx#1 (byte) main::toD0182_$5#0 ← > (word) main::toD0182_$4#0 - (byte) main::toD0182_$6#0 ← (byte) main::toD0182_$5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0182_$7#0 ← (byte) main::toD0182_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f - (byte) main::toD0182_$8#0 ← (byte) main::toD0182_$3#0 | (byte) main::toD0182_$7#0 - (byte) main::toD0182_return#0 ← (byte) main::toD0182_$8#0 + (byte/signed word/word/dword/signed dword) main::toD0182_$6#0 ← (byte) main::toD0182_$5#0 / (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word/dword) main::toD0182_$7#0 ← (byte/signed word/word/dword/signed dword) main::toD0182_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f + (byte/word/dword) main::toD0182_$8#0 ← (byte/word) main::toD0182_$3#0 | (byte/word/dword) main::toD0182_$7#0 + (byte) main::toD0182_return#0 ← (byte/word/dword) main::toD0182_$8#0 to:main::toD0182_@return main::toD0182_@return: scope:[main] from main::toD0182 (byte) c2B#28 ← phi( main::toD0182/(byte) c2B#31 ) @@ -1099,20 +1099,20 @@ SYMBOL TABLE SSA (word) main::toD0181_$0#0 (word~) main::toD0181_$1 (word) main::toD0181_$1#0 -(word~) main::toD0181_$2 -(word) main::toD0181_$2#0 -(byte~) main::toD0181_$3 -(byte) main::toD0181_$3#0 +(word/signed dword/dword~) main::toD0181_$2 +(word/signed dword/dword) main::toD0181_$2#0 +(byte/word~) main::toD0181_$3 +(byte/word) main::toD0181_$3#0 (word~) main::toD0181_$4 (word) main::toD0181_$4#0 (byte~) main::toD0181_$5 (byte) main::toD0181_$5#0 -(byte~) main::toD0181_$6 -(byte) main::toD0181_$6#0 -(byte~) main::toD0181_$7 -(byte) main::toD0181_$7#0 -(byte~) main::toD0181_$8 -(byte) main::toD0181_$8#0 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/signed word/word/dword/signed dword) main::toD0181_$6#0 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword) main::toD0181_$7#0 +(byte/word/dword~) main::toD0181_$8 +(byte/word/dword) main::toD0181_$8#0 (label) main::toD0181_@return (byte*) main::toD0181_gfx (byte*) main::toD0181_gfx#0 @@ -1130,20 +1130,20 @@ SYMBOL TABLE SSA (word) main::toD0182_$0#0 (word~) main::toD0182_$1 (word) main::toD0182_$1#0 -(word~) main::toD0182_$2 -(word) main::toD0182_$2#0 -(byte~) main::toD0182_$3 -(byte) main::toD0182_$3#0 +(word/signed dword/dword~) main::toD0182_$2 +(word/signed dword/dword) main::toD0182_$2#0 +(byte/word~) main::toD0182_$3 +(byte/word) main::toD0182_$3#0 (word~) main::toD0182_$4 (word) main::toD0182_$4#0 (byte~) main::toD0182_$5 (byte) main::toD0182_$5#0 -(byte~) main::toD0182_$6 -(byte) main::toD0182_$6#0 -(byte~) main::toD0182_$7 -(byte) main::toD0182_$7#0 -(byte~) main::toD0182_$8 -(byte) main::toD0182_$8#0 +(byte/signed word/word/dword/signed dword~) main::toD0182_$6 +(byte/signed word/word/dword/signed dword) main::toD0182_$6#0 +(byte/word/dword~) main::toD0182_$7 +(byte/word/dword) main::toD0182_$7#0 +(byte/word/dword~) main::toD0182_$8 +(byte/word/dword) main::toD0182_$8#0 (label) main::toD0182_@return (byte*) main::toD0182_gfx (byte*) main::toD0182_gfx#0 @@ -1416,14 +1416,14 @@ Alias (byte) c2A#0 = (byte) c2A#7 (byte) c2A#27 (byte) c2A#23 (byte) c2A#15 Alias (byte) c2B#0 = (byte) c2B#7 (byte) c2B#27 (byte) c2B#23 (byte) c2B#15 Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 -Alias (byte) main::toD0181_return#0 = (byte) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$4 +Alias (byte) main::toD0181_return#0 = (byte/word/dword) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$4 Alias (byte) c1A#1 = (byte) c1A#8 (byte) c1A#29 (byte) c1A#26 (byte) c1A#20 Alias (byte) c1B#1 = (byte) c1B#8 (byte) c1B#29 (byte) c1B#26 (byte) c1B#20 Alias (byte) c2A#1 = (byte) c2A#8 (byte) c2A#31 (byte) c2A#28 (byte) c2A#21 Alias (byte) c2B#1 = (byte) c2B#8 (byte) c2B#31 (byte) c2B#28 (byte) c2B#21 Alias (byte*) main::toD0182_screen#0 = (byte*) main::toD0182_screen#1 Alias (byte*) main::toD0182_gfx#0 = (byte*) main::toD0182_gfx#1 -Alias (byte) main::toD0182_return#0 = (byte) main::toD0182_$8#0 (byte) main::toD0182_return#2 (byte) main::toD0182_return#1 (byte) main::toD0182_return#3 (byte~) main::$6 +Alias (byte) main::toD0182_return#0 = (byte/word/dword) main::toD0182_$8#0 (byte) main::toD0182_return#2 (byte) main::toD0182_return#1 (byte) main::toD0182_return#3 (byte~) main::$6 Alias (byte) c1A#11 = (byte) c1A#17 Alias (byte) c1B#11 = (byte) c1B#17 Alias (byte) c2A#10 = (byte) c2A#17 @@ -1732,15 +1732,15 @@ Constant (const byte) main::toD0181_$5#0 = >main::toD0181_$4#0 Constant (const word) main::toD0182_$1#0 = main::toD0182_$0#0&$3fff Constant (const byte) main::toD0182_$5#0 = >main::toD0182_$4#0 Successful SSA optimization Pass2ConstantIdentification -Constant (const word) main::toD0181_$2#0 = main::toD0181_$1#0<<2 -Constant (const byte) main::toD0181_$6#0 = main::toD0181_$5#0>>2 -Constant (const word) main::toD0182_$2#0 = main::toD0182_$1#0<<2 -Constant (const byte) main::toD0182_$6#0 = main::toD0182_$5#0>>2 +Constant (const word/signed dword/dword) main::toD0181_$2#0 = main::toD0181_$1#0*4 +Constant (const byte/signed word/word/dword/signed dword) main::toD0181_$6#0 = main::toD0181_$5#0/4 +Constant (const word/signed dword/dword) main::toD0182_$2#0 = main::toD0182_$1#0*4 +Constant (const byte/signed word/word/dword/signed dword) main::toD0182_$6#0 = main::toD0182_$5#0/4 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) main::toD0181_$3#0 = >main::toD0181_$2#0 -Constant (const byte) main::toD0181_$7#0 = main::toD0181_$6#0&$f -Constant (const byte) main::toD0182_$3#0 = >main::toD0182_$2#0 -Constant (const byte) main::toD0182_$7#0 = main::toD0182_$6#0&$f +Constant (const byte/word) main::toD0181_$3#0 = >main::toD0181_$2#0 +Constant (const byte/word/dword) main::toD0181_$7#0 = main::toD0181_$6#0&$f +Constant (const byte/word) main::toD0182_$3#0 = >main::toD0182_$2#0 +Constant (const byte/word/dword) main::toD0182_$7#0 = main::toD0182_$6#0&$f Successful SSA optimization Pass2ConstantIdentification Constant (const byte) main::toD0181_return#0 = main::toD0181_$3#0|main::toD0181_$7#0 Constant (const byte) main::toD0182_return#0 = main::toD0182_$3#0|main::toD0182_$7#0 @@ -1820,28 +1820,28 @@ Constant inlined c1A#19 = (byte/signed byte/word/signed word/dword/signed dword) Constant inlined c2A#20 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined main::toD0182_gfx#0 = (const byte*) CHARSET#0 Constant inlined main::toD0182_$4#0 = ((word))(const byte*) CHARSET#0 -Constant inlined main::toD0182_$3#0 = >((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0182_$3#0 = >((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined main::toD0181_$0#0 = ((word))(const byte*) SCREEN1#0 -Constant inlined main::toD0182_$6#0 = >((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0182_$6#0 = >((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined doplasma::ii#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined main::toD0181_$1#0 = ((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff Constant inlined main::toD0182_$5#0 = >((word))(const byte*) CHARSET#0 Constant inlined print_cls::sc#0 = (const byte*) print_line_cursor#0 -Constant inlined main::toD0182_$7#0 = >((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +Constant inlined main::toD0182_$7#0 = >((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f Constant inlined makecharset::ii#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 -Constant inlined main::toD0181_$6#0 = >((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$6#0 = >((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined makecharset::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 -Constant inlined main::toD0181_$7#0 = >((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +Constant inlined main::toD0181_$7#0 = >((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f Constant inlined makecharset::charset#0 = (const byte*) CHARSET#0 Constant inlined main::$1 = (const byte*) COLS#0+(word/signed word/dword/signed dword) $3e8 Constant inlined main::toD0182_$0#0 = ((word))(const byte*) SCREEN2#0 -Constant inlined main::toD0181_$2#0 = ((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$2#0 = ((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined doplasma::screen#0 = (const byte*) SCREEN1#0 -Constant inlined main::toD0181_$3#0 = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$3#0 = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined main::toD0182_screen#0 = (const byte*) SCREEN2#0 Constant inlined doplasma::screen#1 = (const byte*) SCREEN2#0 Constant inlined main::toD0181_$4#0 = ((word))(const byte*) CHARSET#0 -Constant inlined main::toD0182_$2#0 = ((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0182_$2#0 = ((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined main::toD0181_$5#0 = >((word))(const byte*) CHARSET#0 Constant inlined main::toD0182_$1#0 = ((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff Constant inlined c1B#19 = (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -2305,25 +2305,25 @@ VARIABLE REGISTER WEIGHTS (byte*) main::col#2 16.5 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return (byte*) main::toD0181_screen (word~) main::toD0182_$0 (word~) main::toD0182_$1 -(word~) main::toD0182_$2 -(byte~) main::toD0182_$3 +(word/signed dword/dword~) main::toD0182_$2 +(byte/word~) main::toD0182_$3 (word~) main::toD0182_$4 (byte~) main::toD0182_$5 -(byte~) main::toD0182_$6 -(byte~) main::toD0182_$7 -(byte~) main::toD0182_$8 +(byte/signed word/word/dword/signed dword~) main::toD0182_$6 +(byte/word/dword~) main::toD0182_$7 +(byte/word/dword~) main::toD0182_$8 (byte*) main::toD0182_gfx (byte) main::toD0182_return (byte*) main::toD0182_screen @@ -2524,8 +2524,8 @@ bend_from_b2: bend: //SEG11 main main: { - .const toD0181_return = (>(SCREEN1&$3fff)<<2)|(>CHARSET)>>2&$f - .const toD0182_return = (>(SCREEN2&$3fff)<<2)|(>CHARSET)>>2&$f + .const toD0181_return = (>(SCREEN1&$3fff)*4)|(>CHARSET)/4&$f + .const toD0182_return = (>(SCREEN2&$3fff)*4)|(>CHARSET)/4&$f .label col = 2 //SEG12 asm { sei } sei @@ -3388,8 +3388,8 @@ bend_from_b2: bend: //SEG11 main main: { - .const toD0181_return = (>(SCREEN1&$3fff)<<2)|(>CHARSET)>>2&$f - .const toD0182_return = (>(SCREEN2&$3fff)<<2)|(>CHARSET)>>2&$f + .const toD0181_return = (>(SCREEN1&$3fff)*4)|(>CHARSET)/4&$f + .const toD0182_return = (>(SCREEN2&$3fff)*4)|(>CHARSET)/4&$f .label col = 2 //SEG12 asm { sei } sei @@ -4314,30 +4314,30 @@ FINAL SYMBOL TABLE (label) main::toD0181 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0181_screen (label) main::toD0182 (word~) main::toD0182_$0 (word~) main::toD0182_$1 -(word~) main::toD0182_$2 -(byte~) main::toD0182_$3 +(word/signed dword/dword~) main::toD0182_$2 +(byte/word~) main::toD0182_$3 (word~) main::toD0182_$4 (byte~) main::toD0182_$5 -(byte~) main::toD0182_$6 -(byte~) main::toD0182_$7 -(byte~) main::toD0182_$8 +(byte/signed word/word/dword/signed dword~) main::toD0182_$6 +(byte/word/dword~) main::toD0182_$7 +(byte/word/dword~) main::toD0182_$8 (byte*) main::toD0182_gfx (byte) main::toD0182_return -(const byte) main::toD0182_return#0 toD0182_return = >((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0182_return#0 toD0182_return = >((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0182_screen (void()) makecharset((byte*) makecharset::charset) (byte/word~) makecharset::$11 reg byte a 22.0 @@ -4473,8 +4473,8 @@ Score: 91186 //SEG10 @end //SEG11 main main: { - .const toD0181_return = (>(SCREEN1&$3fff)<<2)|(>CHARSET)>>2&$f - .const toD0182_return = (>(SCREEN2&$3fff)<<2)|(>CHARSET)>>2&$f + .const toD0181_return = (>(SCREEN1&$3fff)*4)|(>CHARSET)/4&$f + .const toD0182_return = (>(SCREEN2&$3fff)*4)|(>CHARSET)/4&$f .label col = 2 //SEG12 asm { sei } sei diff --git a/src/test/ref/examples/plasma/plasma.sym b/src/test/ref/examples/plasma/plasma.sym index 5fef657c7..410655bdb 100644 --- a/src/test/ref/examples/plasma/plasma.sym +++ b/src/test/ref/examples/plasma/plasma.sym @@ -189,30 +189,30 @@ (label) main::toD0181 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN1#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0181_screen (label) main::toD0182 (word~) main::toD0182_$0 (word~) main::toD0182_$1 -(word~) main::toD0182_$2 -(byte~) main::toD0182_$3 +(word/signed dword/dword~) main::toD0182_$2 +(byte/word~) main::toD0182_$3 (word~) main::toD0182_$4 (byte~) main::toD0182_$5 -(byte~) main::toD0182_$6 -(byte~) main::toD0182_$7 -(byte~) main::toD0182_$8 +(byte/signed word/word/dword/signed dword~) main::toD0182_$6 +(byte/word/dword~) main::toD0182_$7 +(byte/word/dword~) main::toD0182_$8 (byte*) main::toD0182_gfx (byte) main::toD0182_return -(const byte) main::toD0182_return#0 toD0182_return = >((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) CHARSET#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0182_return#0 toD0182_return = >((word))(const byte*) SCREEN2#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) CHARSET#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0182_screen (void()) makecharset((byte*) makecharset::charset) (byte/word~) makecharset::$11 reg byte a 22.0 diff --git a/src/test/ref/examples/scrolllogo/scrolllogo.asm b/src/test/ref/examples/scrolllogo/scrolllogo.asm index 529298499..abd236fbb 100644 --- a/src/test/ref/examples/scrolllogo/scrolllogo.asm +++ b/src/test/ref/examples/scrolllogo/scrolllogo.asm @@ -27,7 +27,7 @@ .label rem16u = 2 .label xsin_idx = 2 main: { - .const toD0181_return = (>(SCREEN&$3fff)<<2)|(>LOGO)>>2&$f + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>LOGO)/4&$f sei lda #WHITE sta BORDERCOL diff --git a/src/test/ref/examples/scrolllogo/scrolllogo.log b/src/test/ref/examples/scrolllogo/scrolllogo.log index d36f0ca2a..49fcf7908 100644 --- a/src/test/ref/examples/scrolllogo/scrolllogo.log +++ b/src/test/ref/examples/scrolllogo/scrolllogo.log @@ -615,14 +615,14 @@ main::toD0181: scope:[main] from main (byte*) main::toD0181_screen#1 ← phi( main/(byte*) main::toD0181_screen#0 ) (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1 (word) main::toD0181_$1#0 ← (word) main::toD0181_$0#0 & (word/signed word/dword/signed dword) $3fff - (word) main::toD0181_$2#0 ← (word) main::toD0181_$1#0 << (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0181_$3#0 ← > (word) main::toD0181_$2#0 + (word/signed dword/dword) main::toD0181_$2#0 ← (word) main::toD0181_$1#0 * (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word) main::toD0181_$3#0 ← > (word/signed dword/dword) main::toD0181_$2#0 (word) main::toD0181_$4#0 ← ((word)) (byte*) main::toD0181_gfx#1 (byte) main::toD0181_$5#0 ← > (word) main::toD0181_$4#0 - (byte) main::toD0181_$6#0 ← (byte) main::toD0181_$5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0181_$7#0 ← (byte) main::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f - (byte) main::toD0181_$8#0 ← (byte) main::toD0181_$3#0 | (byte) main::toD0181_$7#0 - (byte) main::toD0181_return#0 ← (byte) main::toD0181_$8#0 + (byte/signed word/word/dword/signed dword) main::toD0181_$6#0 ← (byte) main::toD0181_$5#0 / (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word/dword) main::toD0181_$7#0 ← (byte/signed word/word/dword/signed dword) main::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f + (byte/word/dword) main::toD0181_$8#0 ← (byte/word) main::toD0181_$3#0 | (byte/word/dword) main::toD0181_$7#0 + (byte) main::toD0181_return#0 ← (byte/word/dword) main::toD0181_$8#0 to:main::toD0181_@return main::toD0181_@return: scope:[main] from main::toD0181 (word) xsin_idx#26 ← phi( main::toD0181/(word) xsin_idx#27 ) @@ -1262,20 +1262,20 @@ SYMBOL TABLE SSA (word) main::toD0181_$0#0 (word~) main::toD0181_$1 (word) main::toD0181_$1#0 -(word~) main::toD0181_$2 -(word) main::toD0181_$2#0 -(byte~) main::toD0181_$3 -(byte) main::toD0181_$3#0 +(word/signed dword/dword~) main::toD0181_$2 +(word/signed dword/dword) main::toD0181_$2#0 +(byte/word~) main::toD0181_$3 +(byte/word) main::toD0181_$3#0 (word~) main::toD0181_$4 (word) main::toD0181_$4#0 (byte~) main::toD0181_$5 (byte) main::toD0181_$5#0 -(byte~) main::toD0181_$6 -(byte) main::toD0181_$6#0 -(byte~) main::toD0181_$7 -(byte) main::toD0181_$7#0 -(byte~) main::toD0181_$8 -(byte) main::toD0181_$8#0 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/signed word/word/dword/signed dword) main::toD0181_$6#0 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword) main::toD0181_$7#0 +(byte/word/dword~) main::toD0181_$8 +(byte/word/dword) main::toD0181_$8#0 (label) main::toD0181_@return (byte*) main::toD0181_gfx (byte*) main::toD0181_gfx#0 @@ -1891,7 +1891,7 @@ Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 Alias (word) rem16u#30 = (word) rem16u#38 (word) rem16u#39 (word) rem16u#37 (word) rem16u#35 (word) rem16u#33 Alias (word) xsin_idx#23 = (word) xsin_idx#27 (word) xsin_idx#28 (word) xsin_idx#26 (word) xsin_idx#25 (word) xsin_idx#24 -Alias (byte) main::toD0181_return#0 = (byte) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$0 +Alias (byte) main::toD0181_return#0 = (byte/word/dword) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$0 Alias (byte) fill::val#1 = (byte/word/dword~) main::$2 Alias (word) rem16u#23 = (word) rem16u#27 Alias (word) xsin_idx#13 = (word) xsin_idx#17 (word) xsin_idx#22 @@ -2172,11 +2172,11 @@ Constant (const signed word) sin16s_gen2::offs#0 = sin16s_gen2::min#0+sin16s_gen Constant (const word) main::toD0181_$1#0 = main::toD0181_$0#0&$3fff Constant (const byte) main::toD0181_$5#0 = >main::toD0181_$4#0 Successful SSA optimization Pass2ConstantIdentification -Constant (const word) main::toD0181_$2#0 = main::toD0181_$1#0<<2 -Constant (const byte) main::toD0181_$6#0 = main::toD0181_$5#0>>2 +Constant (const word/signed dword/dword) main::toD0181_$2#0 = main::toD0181_$1#0*4 +Constant (const byte/signed word/word/dword/signed dword) main::toD0181_$6#0 = main::toD0181_$5#0/4 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) main::toD0181_$3#0 = >main::toD0181_$2#0 -Constant (const byte) main::toD0181_$7#0 = main::toD0181_$6#0&$f +Constant (const byte/word) main::toD0181_$3#0 = >main::toD0181_$2#0 +Constant (const byte/word/dword) main::toD0181_$7#0 = main::toD0181_$6#0&$f Successful SSA optimization Pass2ConstantIdentification Constant (const byte) main::toD0181_return#0 = main::toD0181_$3#0|main::toD0181_$7#0 Successful SSA optimization Pass2ConstantIdentification @@ -2647,9 +2647,9 @@ Constant inlined render_logo::$43 = (byte/signed byte/word/signed word/dword/sig Constant inlined sin16s_gen2::wavelength#0 = (const word) XSIN_SIZE#0 Constant inlined fill::size#1 = (word/signed word/dword/signed dword) $3e8 Constant inlined fill::size#0 = (word/signed word/dword/signed dword) $3e8 -Constant inlined main::toD0181_$7#0 = >((word))(const byte*) LOGO#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +Constant inlined main::toD0181_$7#0 = >((word))(const byte*) LOGO#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f Constant inlined xsin_idx#16 = (byte/signed byte/word/signed word/dword/signed dword) 0 -Constant inlined main::toD0181_$3#0 = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$3#0 = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined render_logo::$45 = (byte/signed byte/word/signed word/dword/signed dword) $28*++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined sin16s_gen2::sintab#1 = (const signed word[XSIN_SIZE#0]) xsin#0 Constant inlined render_logo::$44 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) $28*++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 @@ -2742,9 +2742,9 @@ Constant inlined render_logo::$21 = (const byte*) SCREEN#0+(byte/signed byte/wor Constant inlined render_logo::$20 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined render_logo::line#44 = ++++++++++(byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined render_logo::line#40 = ++++++(byte/signed byte/word/signed word/dword/signed dword) 0 -Constant inlined main::toD0181_$6#0 = >((word))(const byte*) LOGO#0>>(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$6#0 = >((word))(const byte*) LOGO#0/(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined loop::$3 = (const word) XSIN_SIZE#0*(byte/signed byte/word/signed word/dword/signed dword) 2 -Constant inlined main::toD0181_$2#0 = ((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$2#0 = ((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined div32u16u::divisor#0 = (const word) XSIN_SIZE#0 Constant inlined render_logo::$27 = (const byte*) SCREEN#0+(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined render_logo::line#38 = ++++(byte/signed byte/word/signed word/dword/signed dword) 0 @@ -3565,13 +3565,13 @@ VARIABLE REGISTER WEIGHTS (byte) main::ch#2 22.0 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return (byte*) main::toD0181_screen @@ -4049,7 +4049,7 @@ bend_from_b2: bend: //SEG11 main main: { - .const toD0181_return = (>(SCREEN&$3fff)<<2)|(>LOGO)>>2&$f + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>LOGO)/4&$f .label ch = 2 //SEG12 asm { sei } sei @@ -6174,7 +6174,7 @@ bend_from_b2: bend: //SEG11 main main: { - .const toD0181_return = (>(SCREEN&$3fff)<<2)|(>LOGO)>>2&$f + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>LOGO)/4&$f //SEG12 asm { sei } sei //SEG13 [6] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 @@ -7997,16 +7997,16 @@ FINAL SYMBOL TABLE (label) main::toD0181 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) LOGO#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) LOGO#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0181_screen (signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b) (word~) mul16s::$16 $16 zp ZP_WORD:15 4.0 @@ -8318,7 +8318,7 @@ Score: 43910 //SEG10 @end //SEG11 main main: { - .const toD0181_return = (>(SCREEN&$3fff)<<2)|(>LOGO)>>2&$f + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>LOGO)/4&$f //SEG12 asm { sei } sei //SEG13 [6] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 diff --git a/src/test/ref/examples/scrolllogo/scrolllogo.sym b/src/test/ref/examples/scrolllogo/scrolllogo.sym index ed645d8e4..f30d3d742 100644 --- a/src/test/ref/examples/scrolllogo/scrolllogo.sym +++ b/src/test/ref/examples/scrolllogo/scrolllogo.sym @@ -193,16 +193,16 @@ (label) main::toD0181 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) LOGO#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) LOGO#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0181_screen (signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b) (word~) mul16s::$16 $16 zp ZP_WORD:15 4.0 diff --git a/src/test/ref/examples/showlogo/showlogo.asm b/src/test/ref/examples/showlogo/showlogo.asm index 261d92607..7866af43c 100644 --- a/src/test/ref/examples/showlogo/showlogo.asm +++ b/src/test/ref/examples/showlogo/showlogo.asm @@ -18,7 +18,7 @@ .label SCREEN = $400 .label LOGO = $2000 main: { - .const toD0181_return = (>(SCREEN&$3fff)<<2)|(>LOGO)>>2&$f + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>LOGO)/4&$f lda #WHITE sta BORDERCOL lda #DARK_GREY diff --git a/src/test/ref/examples/showlogo/showlogo.log b/src/test/ref/examples/showlogo/showlogo.log index f756fb09f..844716351 100644 --- a/src/test/ref/examples/showlogo/showlogo.log +++ b/src/test/ref/examples/showlogo/showlogo.log @@ -110,14 +110,14 @@ main::toD0181: scope:[main] from main (byte*) main::toD0181_screen#1 ← phi( main/(byte*) main::toD0181_screen#0 ) (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1 (word) main::toD0181_$1#0 ← (word) main::toD0181_$0#0 & (word/signed word/dword/signed dword) $3fff - (word) main::toD0181_$2#0 ← (word) main::toD0181_$1#0 << (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0181_$3#0 ← > (word) main::toD0181_$2#0 + (word/signed dword/dword) main::toD0181_$2#0 ← (word) main::toD0181_$1#0 * (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word) main::toD0181_$3#0 ← > (word/signed dword/dword) main::toD0181_$2#0 (word) main::toD0181_$4#0 ← ((word)) (byte*) main::toD0181_gfx#1 (byte) main::toD0181_$5#0 ← > (word) main::toD0181_$4#0 - (byte) main::toD0181_$6#0 ← (byte) main::toD0181_$5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0181_$7#0 ← (byte) main::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f - (byte) main::toD0181_$8#0 ← (byte) main::toD0181_$3#0 | (byte) main::toD0181_$7#0 - (byte) main::toD0181_return#0 ← (byte) main::toD0181_$8#0 + (byte/signed word/word/dword/signed dword) main::toD0181_$6#0 ← (byte) main::toD0181_$5#0 / (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word/dword) main::toD0181_$7#0 ← (byte/signed word/word/dword/signed dword) main::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f + (byte/word/dword) main::toD0181_$8#0 ← (byte/word) main::toD0181_$3#0 | (byte/word/dword) main::toD0181_$7#0 + (byte) main::toD0181_return#0 ← (byte/word/dword) main::toD0181_$8#0 to:main::toD0181_@return main::toD0181_@return: scope:[main] from main::toD0181 (byte) main::toD0181_return#2 ← phi( main::toD0181/(byte) main::toD0181_return#0 ) @@ -414,20 +414,20 @@ SYMBOL TABLE SSA (word) main::toD0181_$0#0 (word~) main::toD0181_$1 (word) main::toD0181_$1#0 -(word~) main::toD0181_$2 -(word) main::toD0181_$2#0 -(byte~) main::toD0181_$3 -(byte) main::toD0181_$3#0 +(word/signed dword/dword~) main::toD0181_$2 +(word/signed dword/dword) main::toD0181_$2#0 +(byte/word~) main::toD0181_$3 +(byte/word) main::toD0181_$3#0 (word~) main::toD0181_$4 (word) main::toD0181_$4#0 (byte~) main::toD0181_$5 (byte) main::toD0181_$5#0 -(byte~) main::toD0181_$6 -(byte) main::toD0181_$6#0 -(byte~) main::toD0181_$7 -(byte) main::toD0181_$7#0 -(byte~) main::toD0181_$8 -(byte) main::toD0181_$8#0 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/signed word/word/dword/signed dword) main::toD0181_$6#0 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword) main::toD0181_$7#0 +(byte/word/dword~) main::toD0181_$8 +(byte/word/dword) main::toD0181_$8#0 (label) main::toD0181_@return (byte*) main::toD0181_gfx (byte*) main::toD0181_gfx#0 @@ -445,7 +445,7 @@ Culled Empty Block (label) @7 Successful SSA optimization Pass2CullEmptyBlocks Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 -Alias (byte) main::toD0181_return#0 = (byte) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$0 +Alias (byte) main::toD0181_return#0 = (byte/word/dword) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$0 Alias (word) fill::size#0 = (word/signed word/dword/signed dword~) main::$2 Alias (word) fill::size#1 = (word/signed word/dword/signed dword~) main::$4 Alias (byte) fill::val#1 = (byte/word/dword~) main::$5 @@ -565,11 +565,11 @@ Successful SSA optimization Pass2ConstantIdentification Constant (const word) main::toD0181_$1#0 = main::toD0181_$0#0&$3fff Constant (const byte) main::toD0181_$5#0 = >main::toD0181_$4#0 Successful SSA optimization Pass2ConstantIdentification -Constant (const word) main::toD0181_$2#0 = main::toD0181_$1#0<<2 -Constant (const byte) main::toD0181_$6#0 = main::toD0181_$5#0>>2 +Constant (const word/signed dword/dword) main::toD0181_$2#0 = main::toD0181_$1#0*4 +Constant (const byte/signed word/word/dword/signed dword) main::toD0181_$6#0 = main::toD0181_$5#0/4 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) main::toD0181_$3#0 = >main::toD0181_$2#0 -Constant (const byte) main::toD0181_$7#0 = main::toD0181_$6#0&$f +Constant (const byte/word) main::toD0181_$3#0 = >main::toD0181_$2#0 +Constant (const byte/word/dword) main::toD0181_$7#0 = main::toD0181_$6#0&$f Successful SSA optimization Pass2ConstantIdentification Constant (const byte) main::toD0181_return#0 = main::toD0181_$3#0|main::toD0181_$7#0 Successful SSA optimization Pass2ConstantIdentification @@ -600,12 +600,12 @@ Constant inlined main::toD0181_$1#0 = ((word))(const byte*) SCREEN#0&(word/signe Constant inlined $0 = (byte/signed byte/word/signed word/dword/signed dword) 6*(byte/signed byte/word/signed word/dword/signed dword) $28 Constant inlined $1 = (byte/signed byte/word/signed word/dword/signed dword) 6*(byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 8 Constant inlined main::$10 = (const byte*) SCREEN#0+(word/signed word/dword/signed dword) $3e7 -Constant inlined main::toD0181_$6#0 = >((word))(const byte*) LOGO#0>>(byte/signed byte/word/signed word/dword/signed dword) 2 -Constant inlined main::toD0181_$7#0 = >((word))(const byte*) LOGO#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +Constant inlined main::toD0181_$6#0 = >((word))(const byte*) LOGO#0/(byte/signed byte/word/signed word/dword/signed dword) 4 +Constant inlined main::toD0181_$7#0 = >((word))(const byte*) LOGO#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f Constant inlined main::$1 = (const byte) VIC_MCM#0|(const byte) VIC_CSEL#0 -Constant inlined main::toD0181_$2#0 = ((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$2#0 = ((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined fill::start#1 = (const byte*) COLS#0 -Constant inlined main::toD0181_$3#0 = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$3#0 = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined fill::start#0 = (const byte*) SCREEN#0 Constant inlined main::toD0181_$4#0 = ((word))(const byte*) LOGO#0 Constant inlined main::toD0181_$5#0 = >((word))(const byte*) LOGO#0 @@ -803,13 +803,13 @@ VARIABLE REGISTER WEIGHTS (byte) main::ch#2 22.0 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return (byte*) main::toD0181_screen @@ -875,7 +875,7 @@ bend_from_b2: bend: //SEG11 main main: { - .const toD0181_return = (>(SCREEN&$3fff)<<2)|(>LOGO)>>2&$f + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>LOGO)/4&$f .label ch = 2 //SEG12 [5] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 lda #WHITE @@ -1108,7 +1108,7 @@ bend_from_b2: bend: //SEG11 main main: { - .const toD0181_return = (>(SCREEN&$3fff)<<2)|(>LOGO)>>2&$f + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>LOGO)/4&$f //SEG12 [5] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 lda #WHITE sta BORDERCOL @@ -1421,16 +1421,16 @@ FINAL SYMBOL TABLE (label) main::toD0181 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) LOGO#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) LOGO#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0181_screen reg byte x [ main::ch#2 main::ch#1 ] @@ -1474,7 +1474,7 @@ Score: 3572 //SEG10 @end //SEG11 main main: { - .const toD0181_return = (>(SCREEN&$3fff)<<2)|(>LOGO)>>2&$f + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>LOGO)/4&$f //SEG12 [5] *((const byte*) BORDERCOL#0) ← (const byte) WHITE#0 -- _deref_pbuc1=vbuc2 lda #WHITE sta BORDERCOL diff --git a/src/test/ref/examples/showlogo/showlogo.sym b/src/test/ref/examples/showlogo/showlogo.sym index 7d34aa76c..9976b151f 100644 --- a/src/test/ref/examples/showlogo/showlogo.sym +++ b/src/test/ref/examples/showlogo/showlogo.sym @@ -122,16 +122,16 @@ (label) main::toD0181 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) LOGO#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) LOGO#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0181_screen reg byte x [ main::ch#2 main::ch#1 ] diff --git a/src/test/ref/examples/sinplotter/sine-plotter.asm b/src/test/ref/examples/sinplotter/sine-plotter.asm index ac6c0479f..6d10d9eea 100644 --- a/src/test/ref/examples/sinplotter/sine-plotter.asm +++ b/src/test/ref/examples/sinplotter/sine-plotter.asm @@ -35,8 +35,8 @@ .label sin2 = $1400 .label rem16u = 2 main: { - .const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)>>6 - .const toD0181_return = (>(SCREEN&$3fff)<<2)|(>BITMAP)>>2&$f + .const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)/$40 + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f sei // Disable normal interrupt // Disable kernal & basic diff --git a/src/test/ref/examples/sinplotter/sine-plotter.log b/src/test/ref/examples/sinplotter/sine-plotter.log index 26984b341..6343eb540 100644 --- a/src/test/ref/examples/sinplotter/sine-plotter.log +++ b/src/test/ref/examples/sinplotter/sine-plotter.log @@ -731,8 +731,8 @@ main::vicSelectGfxBank1_toDd001: scope:[main] from main::vicSelectGfxBank1 (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 ← phi( main::vicSelectGfxBank1/(byte*) main::vicSelectGfxBank1_toDd001_gfx#0 ) (word) main::vicSelectGfxBank1_toDd001_$0#0 ← ((word)) (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 (byte) main::vicSelectGfxBank1_toDd001_$1#0 ← > (word) main::vicSelectGfxBank1_toDd001_$0#0 - (byte) main::vicSelectGfxBank1_toDd001_$2#0 ← (byte) main::vicSelectGfxBank1_toDd001_$1#0 >> (byte/signed byte/word/signed word/dword/signed dword) 6 - (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte) main::vicSelectGfxBank1_toDd001_$2#0 + (byte/signed word/word/dword/signed dword) main::vicSelectGfxBank1_toDd001_$2#0 ← (byte) main::vicSelectGfxBank1_toDd001_$1#0 / (byte/signed byte/word/signed word/dword/signed dword) $40 + (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte/signed word/word/dword/signed dword) main::vicSelectGfxBank1_toDd001_$2#0 (byte) main::vicSelectGfxBank1_toDd001_return#0 ← (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 to:main::vicSelectGfxBank1_toDd001_@return main::vicSelectGfxBank1_toDd001_@return: scope:[main] from main::vicSelectGfxBank1_toDd001 @@ -758,14 +758,14 @@ main::toD0181: scope:[main] from main::@7 (byte*) main::toD0181_screen#1 ← phi( main::@7/(byte*) main::toD0181_screen#0 ) (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1 (word) main::toD0181_$1#0 ← (word) main::toD0181_$0#0 & (word/signed word/dword/signed dword) $3fff - (word) main::toD0181_$2#0 ← (word) main::toD0181_$1#0 << (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0181_$3#0 ← > (word) main::toD0181_$2#0 + (word/signed dword/dword) main::toD0181_$2#0 ← (word) main::toD0181_$1#0 * (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word) main::toD0181_$3#0 ← > (word/signed dword/dword) main::toD0181_$2#0 (word) main::toD0181_$4#0 ← ((word)) (byte*) main::toD0181_gfx#1 (byte) main::toD0181_$5#0 ← > (word) main::toD0181_$4#0 - (byte) main::toD0181_$6#0 ← (byte) main::toD0181_$5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0181_$7#0 ← (byte) main::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f - (byte) main::toD0181_$8#0 ← (byte) main::toD0181_$3#0 | (byte) main::toD0181_$7#0 - (byte) main::toD0181_return#0 ← (byte) main::toD0181_$8#0 + (byte/signed word/word/dword/signed dword) main::toD0181_$6#0 ← (byte) main::toD0181_$5#0 / (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word/dword) main::toD0181_$7#0 ← (byte/signed word/word/dword/signed dword) main::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f + (byte/word/dword) main::toD0181_$8#0 ← (byte/word) main::toD0181_$3#0 | (byte/word/dword) main::toD0181_$7#0 + (byte) main::toD0181_return#0 ← (byte/word/dword) main::toD0181_$8#0 to:main::toD0181_@return main::toD0181_@return: scope:[main] from main::toD0181 (word) rem16u#37 ← phi( main::toD0181/(word) rem16u#39 ) @@ -1366,20 +1366,20 @@ SYMBOL TABLE SSA (word) main::toD0181_$0#0 (word~) main::toD0181_$1 (word) main::toD0181_$1#0 -(word~) main::toD0181_$2 -(word) main::toD0181_$2#0 -(byte~) main::toD0181_$3 -(byte) main::toD0181_$3#0 +(word/signed dword/dword~) main::toD0181_$2 +(word/signed dword/dword) main::toD0181_$2#0 +(byte/word~) main::toD0181_$3 +(byte/word) main::toD0181_$3#0 (word~) main::toD0181_$4 (word) main::toD0181_$4#0 (byte~) main::toD0181_$5 (byte) main::toD0181_$5#0 -(byte~) main::toD0181_$6 -(byte) main::toD0181_$6#0 -(byte~) main::toD0181_$7 -(byte) main::toD0181_$7#0 -(byte~) main::toD0181_$8 -(byte) main::toD0181_$8#0 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/signed word/word/dword/signed dword) main::toD0181_$6#0 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword) main::toD0181_$7#0 +(byte/word/dword~) main::toD0181_$8 +(byte/word/dword) main::toD0181_$8#0 (label) main::toD0181_@return (byte*) main::toD0181_gfx (byte*) main::toD0181_gfx#0 @@ -1404,8 +1404,8 @@ SYMBOL TABLE SSA (word) main::vicSelectGfxBank1_toDd001_$0#0 (byte~) main::vicSelectGfxBank1_toDd001_$1 (byte) main::vicSelectGfxBank1_toDd001_$1#0 -(byte~) main::vicSelectGfxBank1_toDd001_$2 -(byte) main::vicSelectGfxBank1_toDd001_$2#0 +(byte/signed word/word/dword/signed dword~) main::vicSelectGfxBank1_toDd001_$2 +(byte/signed word/word/dword/signed dword) main::vicSelectGfxBank1_toDd001_$2#0 (byte/word/dword~) main::vicSelectGfxBank1_toDd001_$3 (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 (label) main::vicSelectGfxBank1_toDd001_@return @@ -1971,7 +1971,7 @@ Alias (word) rem16u#23 = (word) rem16u#44 (word) rem16u#45 (word) rem16u#43 (wor Alias (byte) main::vicSelectGfxBank1_toDd001_return#0 = (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 (byte) main::vicSelectGfxBank1_toDd001_return#2 (byte) main::vicSelectGfxBank1_toDd001_return#1 (byte) main::vicSelectGfxBank1_toDd001_return#3 (byte) main::vicSelectGfxBank1_$0#0 Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 -Alias (byte) main::toD0181_return#0 = (byte) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$4 +Alias (byte) main::toD0181_return#0 = (byte/word/dword) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$4 Alias (signed word) sin16s_gen2::min#0 = (signed word/signed dword~) main::$8 Alias (word) rem16u#17 = (word) rem16u#8 (word) rem16u#28 Alias (word) rem16u#18 = (word) rem16u#29 (word) rem16u#24 (word) rem16u#9 @@ -2228,13 +2228,13 @@ Constant (const byte) main::vicSelectGfxBank1_toDd001_$1#0 = >main::vicSelectGfx Constant (const word) main::toD0181_$1#0 = main::toD0181_$0#0&$3fff Constant (const byte) main::toD0181_$5#0 = >main::toD0181_$4#0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) main::vicSelectGfxBank1_toDd001_$2#0 = main::vicSelectGfxBank1_toDd001_$1#0>>6 -Constant (const word) main::toD0181_$2#0 = main::toD0181_$1#0<<2 -Constant (const byte) main::toD0181_$6#0 = main::toD0181_$5#0>>2 +Constant (const byte/signed word/word/dword/signed dword) main::vicSelectGfxBank1_toDd001_$2#0 = main::vicSelectGfxBank1_toDd001_$1#0/$40 +Constant (const word/signed dword/dword) main::toD0181_$2#0 = main::toD0181_$1#0*4 +Constant (const byte/signed word/word/dword/signed dword) main::toD0181_$6#0 = main::toD0181_$5#0/4 Successful SSA optimization Pass2ConstantIdentification Constant (const byte) main::vicSelectGfxBank1_toDd001_return#0 = 3^main::vicSelectGfxBank1_toDd001_$2#0 -Constant (const byte) main::toD0181_$3#0 = >main::toD0181_$2#0 -Constant (const byte) main::toD0181_$7#0 = main::toD0181_$6#0&$f +Constant (const byte/word) main::toD0181_$3#0 = >main::toD0181_$2#0 +Constant (const byte/word/dword) main::toD0181_$7#0 = main::toD0181_$6#0&$f Successful SSA optimization Pass2ConstantIdentification Constant (const byte) main::toD0181_return#0 = main::toD0181_$3#0|main::toD0181_$7#0 Successful SSA optimization Pass2ConstantIdentification @@ -2339,8 +2339,8 @@ Constant inlined main::vicSelectGfxBank1_toDd001_$1#0 = >((word))(const byte*) S Constant inlined bitmap_clear::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined sin16s_gen2::wavelength#0 = (const word) SIN_SIZE#0 Constant inlined main::toD0181_$1#0 = ((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff -Constant inlined main::toD0181_$7#0 = >((word))(const byte*) BITMAP#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f -Constant inlined main::toD0181_$3#0 = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$7#0 = >((word))(const byte*) BITMAP#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f +Constant inlined main::toD0181_$3#0 = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined main::toD0181_$5#0 = >((word))(const byte*) BITMAP#0 Constant inlined sin16s_gen2::sintab#1 = (const signed word[$200]) sin#0 Constant inlined bitmap_init::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 @@ -2359,16 +2359,16 @@ Constant inlined mul16u::res#0 = (byte/signed byte/word/signed word/dword/signed Constant inlined divr16u::divisor#1 = (const word) SIN_SIZE#0 Constant inlined divr16u::divisor#0 = (const word) SIN_SIZE#0 Constant inlined bitmap_init::$10 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 8 -Constant inlined main::vicSelectGfxBank1_toDd001_$2#0 = >((word))(const byte*) SCREEN#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +Constant inlined main::vicSelectGfxBank1_toDd001_$2#0 = >((word))(const byte*) SCREEN#0/(byte/signed byte/word/signed word/dword/signed dword) $40 Constant inlined render_sine::sin_idx#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined main::vicSelectGfxBank1_toDd001_$0#0 = ((word))(const byte*) SCREEN#0 Constant inlined bitmap_clear::y#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined main::toD0181_$0#0 = ((word))(const byte*) SCREEN#0 Constant inlined divr16u::dividend#1 = >(const dword) PI2_u4f28#0 Constant inlined divr16u::dividend#2 = <(const dword) PI2_u4f28#0 -Constant inlined main::toD0181_$6#0 = >((word))(const byte*) BITMAP#0>>(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$6#0 = >((word))(const byte*) BITMAP#0/(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined main::$1 = (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0 -Constant inlined main::toD0181_$2#0 = ((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$2#0 = ((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined main::$2 = (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 Constant inlined render_sine::xpos#2 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined main::toD0181_$4#0 = ((word))(const byte*) BITMAP#0 @@ -3205,13 +3205,13 @@ VARIABLE REGISTER WEIGHTS (void()) main() (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return (byte*) main::toD0181_screen @@ -3219,7 +3219,7 @@ VARIABLE REGISTER WEIGHTS (byte*) main::vicSelectGfxBank1_gfx (word~) main::vicSelectGfxBank1_toDd001_$0 (byte~) main::vicSelectGfxBank1_toDd001_$1 -(byte~) main::vicSelectGfxBank1_toDd001_$2 +(byte/signed word/word/dword/signed dword~) main::vicSelectGfxBank1_toDd001_$2 (byte/word/dword~) main::vicSelectGfxBank1_toDd001_$3 (byte*) main::vicSelectGfxBank1_toDd001_gfx (byte) main::vicSelectGfxBank1_toDd001_return @@ -3716,8 +3716,8 @@ bend_from_b2: bend: //SEG11 main main: { - .const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)>>6 - .const toD0181_return = (>(SCREEN&$3fff)<<2)|(>BITMAP)>>2&$f + .const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)/$40 + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f //SEG12 asm { sei } sei //SEG13 [6] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 -- _deref_pbuc1=vbuc2 @@ -5909,8 +5909,8 @@ bend_from_b2: bend: //SEG11 main main: { - .const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)>>6 - .const toD0181_return = (>(SCREEN&$3fff)<<2)|(>BITMAP)>>2&$f + .const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)/$40 + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f //SEG12 asm { sei } sei //SEG13 [6] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 -- _deref_pbuc1=vbuc2 @@ -7866,16 +7866,16 @@ FINAL SYMBOL TABLE (label) main::toD0181 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) BITMAP#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) BITMAP#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0181_screen (label) main::vicSelectGfxBank1 (byte~) main::vicSelectGfxBank1_$0 @@ -7884,11 +7884,11 @@ FINAL SYMBOL TABLE (label) main::vicSelectGfxBank1_toDd001 (word~) main::vicSelectGfxBank1_toDd001_$0 (byte~) main::vicSelectGfxBank1_toDd001_$1 -(byte~) main::vicSelectGfxBank1_toDd001_$2 +(byte/signed word/word/dword/signed dword~) main::vicSelectGfxBank1_toDd001_$2 (byte/word/dword~) main::vicSelectGfxBank1_toDd001_$3 (byte*) main::vicSelectGfxBank1_toDd001_gfx (byte) main::vicSelectGfxBank1_toDd001_return -(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) SCREEN#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) SCREEN#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b) (word~) mul16s::$16 $16 zp ZP_WORD:6 4.0 (word~) mul16s::$9 $9 zp ZP_WORD:6 4.0 @@ -8178,8 +8178,8 @@ Score: 28278 //SEG10 @end //SEG11 main main: { - .const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)>>6 - .const toD0181_return = (>(SCREEN&$3fff)<<2)|(>BITMAP)>>2&$f + .const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)/$40 + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f //SEG12 asm { sei } sei //SEG13 [6] *((const byte*) PROCPORT_DDR#0) ← (const byte) PROCPORT_DDR_MEMORY_MASK#0 -- _deref_pbuc1=vbuc2 diff --git a/src/test/ref/examples/sinplotter/sine-plotter.sym b/src/test/ref/examples/sinplotter/sine-plotter.sym index 8896a260d..787a3d5e9 100644 --- a/src/test/ref/examples/sinplotter/sine-plotter.sym +++ b/src/test/ref/examples/sinplotter/sine-plotter.sym @@ -249,16 +249,16 @@ (label) main::toD0181 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) BITMAP#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) BITMAP#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0181_screen (label) main::vicSelectGfxBank1 (byte~) main::vicSelectGfxBank1_$0 @@ -267,11 +267,11 @@ (label) main::vicSelectGfxBank1_toDd001 (word~) main::vicSelectGfxBank1_toDd001_$0 (byte~) main::vicSelectGfxBank1_toDd001_$1 -(byte~) main::vicSelectGfxBank1_toDd001_$2 +(byte/signed word/word/dword/signed dword~) main::vicSelectGfxBank1_toDd001_$2 (byte/word/dword~) main::vicSelectGfxBank1_toDd001_$3 (byte*) main::vicSelectGfxBank1_toDd001_gfx (byte) main::vicSelectGfxBank1_toDd001_return -(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) SCREEN#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) SCREEN#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (signed dword()) mul16s((signed word) mul16s::a , (signed word) mul16s::b) (word~) mul16s::$16 $16 zp ZP_WORD:6 4.0 (word~) mul16s::$9 $9 zp ZP_WORD:6 4.0 diff --git a/src/test/ref/line-anim.asm b/src/test/ref/line-anim.asm index 30163d729..a0bbb8ef8 100644 --- a/src/test/ref/line-anim.asm +++ b/src/test/ref/line-anim.asm @@ -28,8 +28,8 @@ .label rem16s = 3 .label rem16u = 9 main: { - .const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)>>6 - .const toD0181_return = (>(SCREEN&$3fff)<<2)|(>BITMAP)>>2&$f + .const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)/$40 + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f .label i = 2 sei // Disable normal interrupt diff --git a/src/test/ref/line-anim.log b/src/test/ref/line-anim.log index 2417e1500..faac2d027 100644 --- a/src/test/ref/line-anim.log +++ b/src/test/ref/line-anim.log @@ -339,8 +339,8 @@ main::vicSelectGfxBank1_toDd001: scope:[main] from main::vicSelectGfxBank1 (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 ← phi( main::vicSelectGfxBank1/(byte*) main::vicSelectGfxBank1_toDd001_gfx#0 ) (word) main::vicSelectGfxBank1_toDd001_$0#0 ← ((word)) (byte*) main::vicSelectGfxBank1_toDd001_gfx#1 (byte) main::vicSelectGfxBank1_toDd001_$1#0 ← > (word) main::vicSelectGfxBank1_toDd001_$0#0 - (byte) main::vicSelectGfxBank1_toDd001_$2#0 ← (byte) main::vicSelectGfxBank1_toDd001_$1#0 >> (byte/signed byte/word/signed word/dword/signed dword) 6 - (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte) main::vicSelectGfxBank1_toDd001_$2#0 + (byte/signed word/word/dword/signed dword) main::vicSelectGfxBank1_toDd001_$2#0 ← (byte) main::vicSelectGfxBank1_toDd001_$1#0 / (byte/signed byte/word/signed word/dword/signed dword) $40 + (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 ← (byte/signed byte/word/signed word/dword/signed dword) 3 ^ (byte/signed word/word/dword/signed dword) main::vicSelectGfxBank1_toDd001_$2#0 (byte) main::vicSelectGfxBank1_toDd001_return#0 ← (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 to:main::vicSelectGfxBank1_toDd001_@return main::vicSelectGfxBank1_toDd001_@return: scope:[main] from main::vicSelectGfxBank1_toDd001 @@ -369,14 +369,14 @@ main::toD0181: scope:[main] from main::@15 (byte*) main::toD0181_screen#1 ← phi( main::@15/(byte*) main::toD0181_screen#0 ) (word) main::toD0181_$0#0 ← ((word)) (byte*) main::toD0181_screen#1 (word) main::toD0181_$1#0 ← (word) main::toD0181_$0#0 & (word/signed word/dword/signed dword) $3fff - (word) main::toD0181_$2#0 ← (word) main::toD0181_$1#0 << (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0181_$3#0 ← > (word) main::toD0181_$2#0 + (word/signed dword/dword) main::toD0181_$2#0 ← (word) main::toD0181_$1#0 * (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word) main::toD0181_$3#0 ← > (word/signed dword/dword) main::toD0181_$2#0 (word) main::toD0181_$4#0 ← ((word)) (byte*) main::toD0181_gfx#1 (byte) main::toD0181_$5#0 ← > (word) main::toD0181_$4#0 - (byte) main::toD0181_$6#0 ← (byte) main::toD0181_$5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) main::toD0181_$7#0 ← (byte) main::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f - (byte) main::toD0181_$8#0 ← (byte) main::toD0181_$3#0 | (byte) main::toD0181_$7#0 - (byte) main::toD0181_return#0 ← (byte) main::toD0181_$8#0 + (byte/signed word/word/dword/signed dword) main::toD0181_$6#0 ← (byte) main::toD0181_$5#0 / (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word/dword) main::toD0181_$7#0 ← (byte/signed word/word/dword/signed dword) main::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f + (byte/word/dword) main::toD0181_$8#0 ← (byte/word) main::toD0181_$3#0 | (byte/word/dword) main::toD0181_$7#0 + (byte) main::toD0181_return#0 ← (byte/word/dword) main::toD0181_$8#0 to:main::toD0181_@return main::toD0181_@return: scope:[main] from main::toD0181 (signed word) rem16s#39 ← phi( main::toD0181/(signed word) rem16s#41 ) @@ -1307,20 +1307,20 @@ SYMBOL TABLE SSA (word) main::toD0181_$0#0 (word~) main::toD0181_$1 (word) main::toD0181_$1#0 -(word~) main::toD0181_$2 -(word) main::toD0181_$2#0 -(byte~) main::toD0181_$3 -(byte) main::toD0181_$3#0 +(word/signed dword/dword~) main::toD0181_$2 +(word/signed dword/dword) main::toD0181_$2#0 +(byte/word~) main::toD0181_$3 +(byte/word) main::toD0181_$3#0 (word~) main::toD0181_$4 (word) main::toD0181_$4#0 (byte~) main::toD0181_$5 (byte) main::toD0181_$5#0 -(byte~) main::toD0181_$6 -(byte) main::toD0181_$6#0 -(byte~) main::toD0181_$7 -(byte) main::toD0181_$7#0 -(byte~) main::toD0181_$8 -(byte) main::toD0181_$8#0 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/signed word/word/dword/signed dword) main::toD0181_$6#0 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword) main::toD0181_$7#0 +(byte/word/dword~) main::toD0181_$8 +(byte/word/dword) main::toD0181_$8#0 (label) main::toD0181_@return (byte*) main::toD0181_gfx (byte*) main::toD0181_gfx#0 @@ -1345,8 +1345,8 @@ SYMBOL TABLE SSA (word) main::vicSelectGfxBank1_toDd001_$0#0 (byte~) main::vicSelectGfxBank1_toDd001_$1 (byte) main::vicSelectGfxBank1_toDd001_$1#0 -(byte~) main::vicSelectGfxBank1_toDd001_$2 -(byte) main::vicSelectGfxBank1_toDd001_$2#0 +(byte/signed word/word/dword/signed dword~) main::vicSelectGfxBank1_toDd001_$2 +(byte/signed word/word/dword/signed dword) main::vicSelectGfxBank1_toDd001_$2#0 (byte/word/dword~) main::vicSelectGfxBank1_toDd001_$3 (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 (label) main::vicSelectGfxBank1_toDd001_@return @@ -1733,7 +1733,7 @@ Alias (signed word) rem16s#20 = (signed word) rem16s#51 (signed word) rem16s#52 Alias (byte) main::vicSelectGfxBank1_toDd001_return#0 = (byte/word/dword) main::vicSelectGfxBank1_toDd001_$3#0 (byte) main::vicSelectGfxBank1_toDd001_return#2 (byte) main::vicSelectGfxBank1_toDd001_return#1 (byte) main::vicSelectGfxBank1_toDd001_return#3 (byte) main::vicSelectGfxBank1_$0#0 Alias (byte*) main::toD0181_screen#0 = (byte*) main::toD0181_screen#1 Alias (byte*) main::toD0181_gfx#0 = (byte*) main::toD0181_gfx#1 -Alias (byte) main::toD0181_return#0 = (byte) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$4 +Alias (byte) main::toD0181_return#0 = (byte/word/dword) main::toD0181_$8#0 (byte) main::toD0181_return#2 (byte) main::toD0181_return#1 (byte) main::toD0181_return#3 (byte~) main::$4 Alias (byte) main::i#2 = (byte) main::i#3 (byte) main::i#4 Alias (word) rem16u#15 = (word) rem16u#5 (word) rem16u#29 Alias (signed word) rem16s#10 = (signed word) rem16s#4 (signed word) rem16s#21 @@ -2016,13 +2016,13 @@ Constant (const byte) main::vicSelectGfxBank1_toDd001_$1#0 = >main::vicSelectGfx Constant (const word) main::toD0181_$1#0 = main::toD0181_$0#0&$3fff Constant (const byte) main::toD0181_$5#0 = >main::toD0181_$4#0 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) main::vicSelectGfxBank1_toDd001_$2#0 = main::vicSelectGfxBank1_toDd001_$1#0>>6 -Constant (const word) main::toD0181_$2#0 = main::toD0181_$1#0<<2 -Constant (const byte) main::toD0181_$6#0 = main::toD0181_$5#0>>2 +Constant (const byte/signed word/word/dword/signed dword) main::vicSelectGfxBank1_toDd001_$2#0 = main::vicSelectGfxBank1_toDd001_$1#0/$40 +Constant (const word/signed dword/dword) main::toD0181_$2#0 = main::toD0181_$1#0*4 +Constant (const byte/signed word/word/dword/signed dword) main::toD0181_$6#0 = main::toD0181_$5#0/4 Successful SSA optimization Pass2ConstantIdentification Constant (const byte) main::vicSelectGfxBank1_toDd001_return#0 = 3^main::vicSelectGfxBank1_toDd001_$2#0 -Constant (const byte) main::toD0181_$3#0 = >main::toD0181_$2#0 -Constant (const byte) main::toD0181_$7#0 = main::toD0181_$6#0&$f +Constant (const byte/word) main::toD0181_$3#0 = >main::toD0181_$2#0 +Constant (const byte/word/dword) main::toD0181_$7#0 = main::toD0181_$6#0&$f Successful SSA optimization Pass2ConstantIdentification Constant (const byte) main::toD0181_return#0 = main::toD0181_$3#0|main::toD0181_$7#0 Successful SSA optimization Pass2ConstantIdentification @@ -2131,7 +2131,7 @@ Constant inlined divr16u::quotient#0 = (byte/signed byte/word/signed word/dword/ Constant inlined point_init::$14 = -(byte/signed byte/word/signed word/dword/signed dword) $10 Constant inlined main::i#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined bitmap_init::$10 = (byte/signed byte/word/signed word/dword/signed dword) $28*(byte/signed byte/word/signed word/dword/signed dword) 8 -Constant inlined main::vicSelectGfxBank1_toDd001_$2#0 = >((word))(const byte*) SCREEN#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +Constant inlined main::vicSelectGfxBank1_toDd001_$2#0 = >((word))(const byte*) SCREEN#0/(byte/signed byte/word/signed word/dword/signed dword) $40 Constant inlined screen_fill::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined main::vicSelectGfxBank1_toDd001_$1#0 = >((word))(const byte*) SCREEN#0 Constant inlined main::vicSelectGfxBank1_toDd001_$0#0 = ((word))(const byte*) SCREEN#0 @@ -2141,13 +2141,13 @@ Constant inlined rem16s#0 = (byte/signed byte/word/signed word/dword/signed dwor Constant inlined main::toD0181_$0#0 = ((word))(const byte*) SCREEN#0 Constant inlined main::toD0181_$1#0 = ((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff Constant inlined rem16u#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 -Constant inlined main::toD0181_$6#0 = >((word))(const byte*) BITMAP#0>>(byte/signed byte/word/signed word/dword/signed dword) 2 -Constant inlined main::toD0181_$7#0 = >((word))(const byte*) BITMAP#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +Constant inlined main::toD0181_$6#0 = >((word))(const byte*) BITMAP#0/(byte/signed byte/word/signed word/dword/signed dword) 4 +Constant inlined main::toD0181_$7#0 = >((word))(const byte*) BITMAP#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f Constant inlined screen_fill::screen#0 = (const byte*) SCREEN#0 Constant inlined main::$1 = (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0 -Constant inlined main::toD0181_$2#0 = ((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$2#0 = ((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined main::$2 = (const byte) VIC_BMM#0|(const byte) VIC_DEN#0|(const byte) VIC_RSEL#0|(byte/signed byte/word/signed word/dword/signed dword) 3 -Constant inlined main::toD0181_$3#0 = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined main::toD0181_$3#0 = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined main::toD0181_$4#0 = ((word))(const byte*) BITMAP#0 Constant inlined main::$0 = (const byte) VIC_BMM#0|(const byte) VIC_DEN#0 Constant inlined main::toD0181_$5#0 = >((word))(const byte*) BITMAP#0 @@ -2806,13 +2806,13 @@ VARIABLE REGISTER WEIGHTS (byte) main::i#2 7.857142857142857 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return (byte*) main::toD0181_screen @@ -2820,7 +2820,7 @@ VARIABLE REGISTER WEIGHTS (byte*) main::vicSelectGfxBank1_gfx (word~) main::vicSelectGfxBank1_toDd001_$0 (byte~) main::vicSelectGfxBank1_toDd001_$1 -(byte~) main::vicSelectGfxBank1_toDd001_$2 +(byte/signed word/word/dword/signed dword~) main::vicSelectGfxBank1_toDd001_$2 (byte/word/dword~) main::vicSelectGfxBank1_toDd001_$3 (byte*) main::vicSelectGfxBank1_toDd001_gfx (byte) main::vicSelectGfxBank1_toDd001_return @@ -3126,8 +3126,8 @@ bend_from_b1: bend: //SEG9 main main: { - .const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)>>6 - .const toD0181_return = (>(SCREEN&$3fff)<<2)|(>BITMAP)>>2&$f + .const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)/$40 + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f .label _9 = $27 .label i = 2 //SEG10 asm { sei } @@ -4555,8 +4555,8 @@ bend_from_b1: bend: //SEG9 main main: { - .const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)>>6 - .const toD0181_return = (>(SCREEN&$3fff)<<2)|(>BITMAP)>>2&$f + .const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)/$40 + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f .label i = 2 //SEG10 asm { sei } sei @@ -5958,16 +5958,16 @@ FINAL SYMBOL TABLE (label) main::toD0181 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) BITMAP#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) BITMAP#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0181_screen (label) main::vicSelectGfxBank1 (byte~) main::vicSelectGfxBank1_$0 @@ -5976,11 +5976,11 @@ FINAL SYMBOL TABLE (label) main::vicSelectGfxBank1_toDd001 (word~) main::vicSelectGfxBank1_toDd001_$0 (byte~) main::vicSelectGfxBank1_toDd001_$1 -(byte~) main::vicSelectGfxBank1_toDd001_$2 +(byte/signed word/word/dword/signed dword~) main::vicSelectGfxBank1_toDd001_$2 (byte/word/dword~) main::vicSelectGfxBank1_toDd001_$3 (byte*) main::vicSelectGfxBank1_toDd001_gfx (byte) main::vicSelectGfxBank1_toDd001_return -(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) SCREEN#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) SCREEN#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (void()) point_init((byte) point_init::point_idx) (word~) point_init::$10 $10 zp ZP_WORD:5 4.0 (word~) point_init::$11 $11 zp ZP_WORD:5 4.0 @@ -6151,8 +6151,8 @@ Score: 21647 //SEG8 @end //SEG9 main main: { - .const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)>>6 - .const toD0181_return = (>(SCREEN&$3fff)<<2)|(>BITMAP)>>2&$f + .const vicSelectGfxBank1_toDd001_return = 3^(>SCREEN)/$40 + .const toD0181_return = (>(SCREEN&$3fff)*4)|(>BITMAP)/4&$f .label i = 2 //SEG10 asm { sei } sei diff --git a/src/test/ref/line-anim.sym b/src/test/ref/line-anim.sym index 4f3febd75..3f1a8e0e3 100644 --- a/src/test/ref/line-anim.sym +++ b/src/test/ref/line-anim.sym @@ -255,16 +255,16 @@ (label) main::toD0181 (word~) main::toD0181_$0 (word~) main::toD0181_$1 -(word~) main::toD0181_$2 -(byte~) main::toD0181_$3 +(word/signed dword/dword~) main::toD0181_$2 +(byte/word~) main::toD0181_$3 (word~) main::toD0181_$4 (byte~) main::toD0181_$5 -(byte~) main::toD0181_$6 -(byte~) main::toD0181_$7 -(byte~) main::toD0181_$8 +(byte/signed word/word/dword/signed dword~) main::toD0181_$6 +(byte/word/dword~) main::toD0181_$7 +(byte/word/dword~) main::toD0181_$8 (byte*) main::toD0181_gfx (byte) main::toD0181_return -(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) BITMAP#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) main::toD0181_return#0 toD0181_return = >((word))(const byte*) SCREEN#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) BITMAP#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) main::toD0181_screen (label) main::vicSelectGfxBank1 (byte~) main::vicSelectGfxBank1_$0 @@ -273,11 +273,11 @@ (label) main::vicSelectGfxBank1_toDd001 (word~) main::vicSelectGfxBank1_toDd001_$0 (byte~) main::vicSelectGfxBank1_toDd001_$1 -(byte~) main::vicSelectGfxBank1_toDd001_$2 +(byte/signed word/word/dword/signed dword~) main::vicSelectGfxBank1_toDd001_$2 (byte/word/dword~) main::vicSelectGfxBank1_toDd001_$3 (byte*) main::vicSelectGfxBank1_toDd001_gfx (byte) main::vicSelectGfxBank1_toDd001_return -(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) SCREEN#0>>(byte/signed byte/word/signed word/dword/signed dword) 6 +(const byte) main::vicSelectGfxBank1_toDd001_return#0 vicSelectGfxBank1_toDd001_return = (byte/signed byte/word/signed word/dword/signed dword) 3^>((word))(const byte*) SCREEN#0/(byte/signed byte/word/signed word/dword/signed dword) $40 (void()) point_init((byte) point_init::point_idx) (word~) point_init::$10 $10 zp ZP_WORD:5 4.0 (word~) point_init::$11 $11 zp ZP_WORD:5 4.0 diff --git a/src/test/ref/scan-desire-problem.asm b/src/test/ref/scan-desire-problem.asm index 27c5c36c1..a60696316 100644 --- a/src/test/ref/scan-desire-problem.asm +++ b/src/test/ref/scan-desire-problem.asm @@ -204,7 +204,7 @@ mul8u: { jmp b1 } init: { - .const toD0181_return = (>(screen&$3fff)<<2)|(>charset)>>2&$f + .const toD0181_return = (>(screen&$3fff)*4)|(>charset)/4&$f jsr init_sprites ldx #0 lda # (word) init::toD0181_$2#0 + (word/signed dword/dword) init::toD0181_$2#0 ← (word) init::toD0181_$1#0 * (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word) init::toD0181_$3#0 ← > (word/signed dword/dword) init::toD0181_$2#0 (word) init::toD0181_$4#0 ← ((word)) (byte*) init::toD0181_gfx#1 (byte) init::toD0181_$5#0 ← > (word) init::toD0181_$4#0 - (byte) init::toD0181_$6#0 ← (byte) init::toD0181_$5#0 >> (byte/signed byte/word/signed word/dword/signed dword) 2 - (byte) init::toD0181_$7#0 ← (byte) init::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f - (byte) init::toD0181_$8#0 ← (byte) init::toD0181_$3#0 | (byte) init::toD0181_$7#0 - (byte) init::toD0181_return#0 ← (byte) init::toD0181_$8#0 + (byte/signed word/word/dword/signed dword) init::toD0181_$6#0 ← (byte) init::toD0181_$5#0 / (byte/signed byte/word/signed word/dword/signed dword) 4 + (byte/word/dword) init::toD0181_$7#0 ← (byte/signed word/word/dword/signed dword) init::toD0181_$6#0 & (byte/signed byte/word/signed word/dword/signed dword) $f + (byte/word/dword) init::toD0181_$8#0 ← (byte/word) init::toD0181_$3#0 | (byte/word/dword) init::toD0181_$7#0 + (byte) init::toD0181_return#0 ← (byte/word/dword) init::toD0181_$8#0 to:init::toD0181_@return init::toD0181_@return: scope:[init] from init::toD0181 (byte) init::toD0181_return#2 ← phi( init::toD0181/(byte) init::toD0181_return#0 ) @@ -772,20 +772,20 @@ SYMBOL TABLE SSA (word) init::toD0181_$0#0 (word~) init::toD0181_$1 (word) init::toD0181_$1#0 -(word~) init::toD0181_$2 -(word) init::toD0181_$2#0 -(byte~) init::toD0181_$3 -(byte) init::toD0181_$3#0 +(word/signed dword/dword~) init::toD0181_$2 +(word/signed dword/dword) init::toD0181_$2#0 +(byte/word~) init::toD0181_$3 +(byte/word) init::toD0181_$3#0 (word~) init::toD0181_$4 (word) init::toD0181_$4#0 (byte~) init::toD0181_$5 (byte) init::toD0181_$5#0 -(byte~) init::toD0181_$6 -(byte) init::toD0181_$6#0 -(byte~) init::toD0181_$7 -(byte) init::toD0181_$7#0 -(byte~) init::toD0181_$8 -(byte) init::toD0181_$8#0 +(byte/signed word/word/dword/signed dword~) init::toD0181_$6 +(byte/signed word/word/dword/signed dword) init::toD0181_$6#0 +(byte/word/dword~) init::toD0181_$7 +(byte/word/dword) init::toD0181_$7#0 +(byte/word/dword~) init::toD0181_$8 +(byte/word/dword) init::toD0181_$8#0 (label) init::toD0181_@return (byte*) init::toD0181_gfx (byte*) init::toD0181_gfx#0 @@ -912,7 +912,7 @@ Alias (byte) main::y#2 = (byte) main::y#3 Alias (byte) main::x#2 = (byte) main::x#5 (byte) main::x#3 Alias (byte*) init::toD0181_screen#0 = (byte*) init::toD0181_screen#1 Alias (byte*) init::toD0181_gfx#0 = (byte*) init::toD0181_gfx#1 -Alias (byte) init::toD0181_return#0 = (byte) init::toD0181_$8#0 (byte) init::toD0181_return#2 (byte) init::toD0181_return#1 (byte) init::toD0181_return#3 (byte~) init::$3 +Alias (byte) init::toD0181_return#0 = (byte/word/dword) init::toD0181_$8#0 (byte) init::toD0181_return#2 (byte) init::toD0181_return#1 (byte) init::toD0181_return#3 (byte~) init::$3 Alias (byte) draw_block::tileno#1 = (byte~) draw_block::$0 (byte) draw_block::tileno#3 Alias (byte) draw_block::y#1 = (byte~) draw_block::$2 Alias (word) mul8u::return#2 = (word) mul8u::return#4 @@ -1124,11 +1124,11 @@ Successful SSA optimization Pass2ConstantIdentification Constant (const word) init::toD0181_$1#0 = init::toD0181_$0#0&$3fff Constant (const byte) init::toD0181_$5#0 = >init::toD0181_$4#0 Successful SSA optimization Pass2ConstantIdentification -Constant (const word) init::toD0181_$2#0 = init::toD0181_$1#0<<2 -Constant (const byte) init::toD0181_$6#0 = init::toD0181_$5#0>>2 +Constant (const word/signed dword/dword) init::toD0181_$2#0 = init::toD0181_$1#0*4 +Constant (const byte/signed word/word/dword/signed dword) init::toD0181_$6#0 = init::toD0181_$5#0/4 Successful SSA optimization Pass2ConstantIdentification -Constant (const byte) init::toD0181_$3#0 = >init::toD0181_$2#0 -Constant (const byte) init::toD0181_$7#0 = init::toD0181_$6#0&$f +Constant (const byte/word) init::toD0181_$3#0 = >init::toD0181_$2#0 +Constant (const byte/word/dword) init::toD0181_$7#0 = init::toD0181_$6#0&$f Successful SSA optimization Pass2ConstantIdentification Constant (const byte) init::toD0181_return#0 = init::toD0181_$3#0|init::toD0181_$7#0 Successful SSA optimization Pass2ConstantIdentification @@ -1173,18 +1173,18 @@ Constant inlined init::toD0181_gfx#0 = (const byte*) charset#0 Constant inlined fill::val#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined init::toD0181_$0#0 = ((word))(const byte*) screen#0 Constant inlined mul8u::mb#0 = ((word))(const byte) mul8u::b#0 -Constant inlined init::toD0181_$2#0 = ((word))(const byte*) screen#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined init::toD0181_$2#0 = ((word))(const byte*) screen#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined init::toD0181_$1#0 = ((word))(const byte*) screen#0&(word/signed word/dword/signed dword) $3fff Constant inlined fill::val#1 = (const byte) BLACK#0 Constant inlined init::toD0181_$4#0 = ((word))(const byte*) charset#0 -Constant inlined init::toD0181_$3#0 = >((word))(const byte*) screen#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined init::toD0181_$3#0 = >((word))(const byte*) screen#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined fill::size#1 = (word/signed word/dword/signed dword) $3e8 -Constant inlined init::toD0181_$6#0 = >((word))(const byte*) charset#0>>(byte/signed byte/word/signed word/dword/signed dword) 2 +Constant inlined init::toD0181_$6#0 = >((word))(const byte*) charset#0/(byte/signed byte/word/signed word/dword/signed dword) 4 Constant inlined fill::size#0 = (word/signed word/dword/signed dword) $3e8 Constant inlined main::x#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined init::toD0181_$5#0 = >((word))(const byte*) charset#0 Constant inlined main::y#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 -Constant inlined init::toD0181_$7#0 = >((word))(const byte*) charset#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +Constant inlined init::toD0181_$7#0 = >((word))(const byte*) charset#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f Constant inlined mul8u::res#0 = (byte/signed byte/word/signed word/dword/signed dword) 0 Constant inlined fill::start#1 = (const byte*) colors#0 Constant inlined fill::start#0 = (const byte*) screen#0 @@ -1566,13 +1566,13 @@ VARIABLE REGISTER WEIGHTS (void()) init() (word~) init::toD0181_$0 (word~) init::toD0181_$1 -(word~) init::toD0181_$2 -(byte~) init::toD0181_$3 +(word/signed dword/dword~) init::toD0181_$2 +(byte/word~) init::toD0181_$3 (word~) init::toD0181_$4 (byte~) init::toD0181_$5 -(byte~) init::toD0181_$6 -(byte~) init::toD0181_$7 -(byte~) init::toD0181_$8 +(byte/signed word/word/dword/signed dword~) init::toD0181_$6 +(byte/word/dword~) init::toD0181_$7 +(byte/word/dword~) init::toD0181_$8 (byte*) init::toD0181_gfx (byte) init::toD0181_return (byte*) init::toD0181_screen @@ -2049,7 +2049,7 @@ mul8u: { } //SEG83 init init: { - .const toD0181_return = (>(screen&$3fff)<<2)|(>charset)>>2&$f + .const toD0181_return = (>(screen&$3fff)*4)|(>charset)/4&$f //SEG84 [49] call init_sprites jsr init_sprites //SEG85 [50] phi from init to init::@2 [phi:init->init::@2] @@ -2663,7 +2663,7 @@ mul8u: { } //SEG83 init init: { - .const toD0181_return = (>(screen&$3fff)<<2)|(>charset)>>2&$f + .const toD0181_return = (>(screen&$3fff)*4)|(>charset)/4&$f //SEG84 [49] call init_sprites jsr init_sprites //SEG85 [50] phi from init to init::@2 [phi:init->init::@2] @@ -3102,16 +3102,16 @@ FINAL SYMBOL TABLE (label) init::toD0181 (word~) init::toD0181_$0 (word~) init::toD0181_$1 -(word~) init::toD0181_$2 -(byte~) init::toD0181_$3 +(word/signed dword/dword~) init::toD0181_$2 +(byte/word~) init::toD0181_$3 (word~) init::toD0181_$4 (byte~) init::toD0181_$5 -(byte~) init::toD0181_$6 -(byte~) init::toD0181_$7 -(byte~) init::toD0181_$8 +(byte/signed word/word/dword/signed dword~) init::toD0181_$6 +(byte/word/dword~) init::toD0181_$7 +(byte/word/dword~) init::toD0181_$8 (byte*) init::toD0181_gfx (byte) init::toD0181_return -(const byte) init::toD0181_return#0 toD0181_return = >((word))(const byte*) screen#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) charset#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) init::toD0181_return#0 toD0181_return = >((word))(const byte*) screen#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) charset#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) init::toD0181_screen (void()) init_sprites() (label) init_sprites::@return @@ -3479,7 +3479,7 @@ mul8u: { } //SEG83 init init: { - .const toD0181_return = (>(screen&$3fff)<<2)|(>charset)>>2&$f + .const toD0181_return = (>(screen&$3fff)*4)|(>charset)/4&$f //SEG84 [49] call init_sprites jsr init_sprites //SEG85 [50] phi from init to init::@2 [phi:init->init::@2] diff --git a/src/test/ref/scan-desire-problem.sym b/src/test/ref/scan-desire-problem.sym index 00891e2ed..383feb891 100644 --- a/src/test/ref/scan-desire-problem.sym +++ b/src/test/ref/scan-desire-problem.sym @@ -212,16 +212,16 @@ (label) init::toD0181 (word~) init::toD0181_$0 (word~) init::toD0181_$1 -(word~) init::toD0181_$2 -(byte~) init::toD0181_$3 +(word/signed dword/dword~) init::toD0181_$2 +(byte/word~) init::toD0181_$3 (word~) init::toD0181_$4 (byte~) init::toD0181_$5 -(byte~) init::toD0181_$6 -(byte~) init::toD0181_$7 -(byte~) init::toD0181_$8 +(byte/signed word/word/dword/signed dword~) init::toD0181_$6 +(byte/word/dword~) init::toD0181_$7 +(byte/word/dword~) init::toD0181_$8 (byte*) init::toD0181_gfx (byte) init::toD0181_return -(const byte) init::toD0181_return#0 toD0181_return = >((word))(const byte*) screen#0&(word/signed word/dword/signed dword) $3fff<<(byte/signed byte/word/signed word/dword/signed dword) 2|>((word))(const byte*) charset#0>>(byte/signed byte/word/signed word/dword/signed dword) 2&(byte/signed byte/word/signed word/dword/signed dword) $f +(const byte) init::toD0181_return#0 toD0181_return = >((word))(const byte*) screen#0&(word/signed word/dword/signed dword) $3fff*(byte/signed byte/word/signed word/dword/signed dword) 4|>((word))(const byte*) charset#0/(byte/signed byte/word/signed word/dword/signed dword) 4&(byte/signed byte/word/signed word/dword/signed dword) $f (byte*) init::toD0181_screen (void()) init_sprites() (label) init_sprites::@return