From 2dd2697ba1aa22ceaeef90f48cb33a75f3778756 Mon Sep 17 00:00:00 2001 From: jespergravgaard Date: Wed, 30 Dec 2020 01:55:04 +0100 Subject: [PATCH] Updated const names to VICII. --- src/main/kc/include/mos6569.h | 2 +- src/test/kc/complex/clearscreen/clearscreen.c | 2 +- .../complex/spritescroller/spritescroller.c | 2 +- src/test/kc/complex/tetris/tetris-data.c | 4 +- src/test/kc/examples/kernalload/kernalload.c | 2 +- src/test/kc/examples/krillload/krillload.c | 2 +- src/test/kc/sprite-font.c | 2 +- src/test/kc/zeropage-sinus.c | 2 +- .../ref/complex/clearscreen/clearscreen.asm | 6 +- .../ref/complex/clearscreen/clearscreen.cfg | 2 +- .../ref/complex/clearscreen/clearscreen.log | 32 ++++---- .../ref/complex/clearscreen/clearscreen.sym | 2 +- src/test/ref/complex/tetris/test-sprites.asm | 6 +- src/test/ref/complex/tetris/test-sprites.log | 24 +++--- src/test/ref/complex/tetris/test-sprites.sym | 6 +- src/test/ref/complex/tetris/tetris.asm | 6 +- src/test/ref/complex/tetris/tetris.log | 24 +++--- src/test/ref/complex/tetris/tetris.sym | 6 +- src/test/ref/complex/xmega65/xmega65.asm | 6 +- src/test/ref/complex/xmega65/xmega65.cfg | 2 +- src/test/ref/complex/xmega65/xmega65.log | 30 +++---- src/test/ref/complex/xmega65/xmega65.sym | 2 +- .../ref/examples/kernalload/kernalload.asm | 4 +- .../ref/examples/kernalload/kernalload.log | 16 ++-- .../ref/examples/kernalload/kernalload.sym | 4 +- src/test/ref/examples/krillload/krillload.asm | 4 +- src/test/ref/examples/krillload/krillload.log | 16 ++-- src/test/ref/examples/krillload/krillload.sym | 4 +- src/test/ref/index-sizeof-reuse-2.asm | 16 ++-- src/test/ref/index-sizeof-reuse-2.cfg | 6 +- src/test/ref/index-sizeof-reuse-2.log | 82 +++++++++---------- src/test/ref/index-sizeof-reuse-2.sym | 4 +- src/test/ref/index-sizeof-reuse.asm | 16 ++-- src/test/ref/index-sizeof-reuse.cfg | 6 +- src/test/ref/index-sizeof-reuse.log | 82 +++++++++---------- src/test/ref/index-sizeof-reuse.sym | 4 +- src/test/ref/irq-hardware-clobber.asm | 8 +- src/test/ref/irq-hardware-clobber.cfg | 2 +- src/test/ref/irq-hardware-clobber.log | 30 +++---- src/test/ref/irq-hardware-clobber.sym | 2 +- src/test/ref/irq-hardware.asm | 8 +- src/test/ref/irq-hardware.cfg | 2 +- src/test/ref/irq-hardware.log | 30 +++---- src/test/ref/irq-hardware.sym | 2 +- src/test/ref/irq-kernel.asm | 8 +- src/test/ref/irq-kernel.cfg | 2 +- src/test/ref/irq-kernel.log | 30 +++---- src/test/ref/irq-kernel.sym | 2 +- .../ref/irq-local-var-overlap-problem.asm | 8 +- .../ref/irq-local-var-overlap-problem.cfg | 2 +- .../ref/irq-local-var-overlap-problem.log | 32 ++++---- .../ref/irq-local-var-overlap-problem.sym | 2 +- src/test/ref/irq-raster.asm | 8 +- src/test/ref/irq-raster.cfg | 2 +- src/test/ref/irq-raster.log | 30 +++---- src/test/ref/irq-raster.sym | 2 +- src/test/ref/irq-volatile-bool-problem.asm | 8 +- src/test/ref/irq-volatile-bool-problem.cfg | 2 +- src/test/ref/irq-volatile-bool-problem.log | 30 +++---- src/test/ref/irq-volatile-bool-problem.sym | 2 +- src/test/ref/norom-charset.asm | 6 +- src/test/ref/norom-charset.cfg | 2 +- src/test/ref/norom-charset.log | 28 +++---- src/test/ref/norom-charset.sym | 2 +- src/test/ref/zeropage-sinus.asm | 6 +- src/test/ref/zeropage-sinus.cfg | 2 +- src/test/ref/zeropage-sinus.log | 26 +++--- src/test/ref/zeropage-sinus.sym | 2 +- 68 files changed, 382 insertions(+), 382 deletions(-) diff --git a/src/main/kc/include/mos6569.h b/src/main/kc/include/mos6569.h index 7e9baa3f2..b30b547d6 100644 --- a/src/main/kc/include/mos6569.h +++ b/src/main/kc/include/mos6569.h @@ -142,7 +142,7 @@ const char BORDER_YPOS_TOP=50; const char BORDER_YPOS_BOTTOM=250; // The offset of the sprite pointers from the screen start address -const unsigned int SPRITE_PTRS = $3f8; +const unsigned int OFFSET_SPRITE_PTRS = 0x3f8; char * const SPRITES_XPOS = $d000; char * const SPRITES_YPOS = $d001; diff --git a/src/test/kc/complex/clearscreen/clearscreen.c b/src/test/kc/complex/clearscreen/clearscreen.c index 3dffce723..e954e440a 100644 --- a/src/test/kc/complex/clearscreen/clearscreen.c +++ b/src/test/kc/complex/clearscreen/clearscreen.c @@ -183,7 +183,7 @@ void processChars() { // Set the sprite color SPRITES_COLOR[processing->id] = processing->col; // Set sprite pointer - *(SCREEN+SPRITE_PTRS+processing->id) = processing->ptr; + *(SCREEN+OFFSET_SPRITE_PTRS+processing->id) = processing->ptr; // Set status processing->status = STATUS_PROCESSING; } diff --git a/src/test/kc/complex/spritescroller/spritescroller.c b/src/test/kc/complex/spritescroller/spritescroller.c index fdeb08304..d1798056b 100644 --- a/src/test/kc/complex/spritescroller/spritescroller.c +++ b/src/test/kc/complex/spritescroller/spritescroller.c @@ -7,7 +7,7 @@ char * const SPRITES = 0x3000; char * const SCREEN = 0x0400; // Address of sprite pointers on screen -char * const SCREEN_SPRITES = SCREEN + SPRITE_PTRS; +char * const SCREEN_SPRITES = SCREEN + OFFSET_SPRITE_PTRS; // Sprite pointer for sprite 0 char SPRITE_0 = toSpritePtr(SPRITES); diff --git a/src/test/kc/complex/tetris/tetris-data.c b/src/test/kc/complex/tetris/tetris-data.c index 4fd56ed7e..0385ab506 100644 --- a/src/test/kc/complex/tetris/tetris-data.c +++ b/src/test/kc/complex/tetris/tetris-data.c @@ -6,9 +6,9 @@ char* const PLAYFIELD_SCREEN_1 = 0x0400; // Address of the second screen char* const PLAYFIELD_SCREEN_2 = 0x2c00; // Screen Sprite pointers on screen 1 -char* const PLAYFIELD_SPRITE_PTRS_1 = (PLAYFIELD_SCREEN_1+SPRITE_PTRS); +char* const PLAYFIELD_SPRITE_PTRS_1 = (PLAYFIELD_SCREEN_1+OFFSET_SPRITE_PTRS); // Screen Sprite pointers on screen 2 -char* const PLAYFIELD_SPRITE_PTRS_2 = (PLAYFIELD_SCREEN_2+SPRITE_PTRS); +char* const PLAYFIELD_SPRITE_PTRS_2 = (PLAYFIELD_SCREEN_2+OFFSET_SPRITE_PTRS); // Sprites covering the playfield __address(0x3000) char PLAYFIELD_SPRITES[30*64] = kickasm(resource "playfield-sprites.png") {{ diff --git a/src/test/kc/examples/kernalload/kernalload.c b/src/test/kc/examples/kernalload/kernalload.c index 2a1b758fc..75bc4a267 100644 --- a/src/test/kc/examples/kernalload/kernalload.c +++ b/src/test/kc/examples/kernalload/kernalload.c @@ -23,7 +23,7 @@ export char SPRITE[] = kickasm(resource "sprite.png") {{ char* const LOAD_SPRITE = 0x3000; char* const SCREEN = 0x0400; -char* const SPRITES_PTR = SCREEN+SPRITE_PTRS; +char* const SPRITES_PTR = SCREEN+OFFSET_SPRITE_PTRS; void main() { // Load sprite file into memory diff --git a/src/test/kc/examples/krillload/krillload.c b/src/test/kc/examples/krillload/krillload.c index 92f2ea897..59c6eef6e 100644 --- a/src/test/kc/examples/krillload/krillload.c +++ b/src/test/kc/examples/krillload/krillload.c @@ -25,7 +25,7 @@ export __address(0x2040) char SPRITE[0x40] = kickasm(resource "sprite.png") {{ #pragma data_seg(Data) char* const SCREEN = 0x0400; -char* const SPRITES_PTR = SCREEN+SPRITE_PTRS; +char* const SPRITES_PTR = SCREEN+OFFSET_SPRITE_PTRS; void main() { // Install the Krill drive code diff --git a/src/test/kc/sprite-font.c b/src/test/kc/sprite-font.c index 79a755959..1a77aa3a9 100644 --- a/src/test/kc/sprite-font.c +++ b/src/test/kc/sprite-font.c @@ -5,7 +5,7 @@ char* const SCREEN = 0x0400; char* const SPRITE = 0x2000; -char* const SPRITES = SCREEN+SPRITE_PTRS; +char* const SPRITES = SCREEN+OFFSET_SPRITE_PTRS; void* const GENERATOR = 0x0900; diff --git a/src/test/kc/zeropage-sinus.c b/src/test/kc/zeropage-sinus.c index 664625ff4..a8b3bafaa 100644 --- a/src/test/kc/zeropage-sinus.c +++ b/src/test/kc/zeropage-sinus.c @@ -24,7 +24,7 @@ void main() { *SPRITES_ENABLE = 1; SPRITES_YPOS[0] = 100; SPRITES_XPOS[0] = 100; - *(SCREEN+SPRITE_PTRS) = (byte)(SPRITE/0x40); + *(SCREEN+OFFSET_SPRITE_PTRS) = (byte)(SPRITE/0x40); saveZeropage(); sinZeropage(); diff --git a/src/test/ref/complex/clearscreen/clearscreen.asm b/src/test/ref/complex/clearscreen/clearscreen.asm index b4992647e..6969d312d 100644 --- a/src/test/ref/complex/clearscreen/clearscreen.asm +++ b/src/test/ref/complex/clearscreen/clearscreen.asm @@ -21,7 +21,7 @@ .const BORDER_YPOS_TOP = $32 .const BORDER_YPOS_BOTTOM = $fa // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 // Bits for the VICII IRQ Status/Enable Registers .const IRQ_RASTER = 1 // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written @@ -369,7 +369,7 @@ processChars: { tay pla sta SPRITES_COLOR,y - // *(SCREEN+SPRITE_PTRS+processing->id) = processing->ptr + // *(SCREEN+OFFSET_SPRITE_PTRS+processing->id) = processing->ptr // Set sprite pointer ldy #OFFSET_STRUCT_PROCESSINGSPRITE_PTR lda (processing),y @@ -378,7 +378,7 @@ processChars: { lda (processing),y tay pla - sta SCREEN+SPRITE_PTRS,y + sta SCREEN+OFFSET_SPRITE_PTRS,y // processing->status = STATUS_PROCESSING // Set status lda #STATUS_PROCESSING diff --git a/src/test/ref/complex/clearscreen/clearscreen.cfg b/src/test/ref/complex/clearscreen/clearscreen.cfg index 84ea99cbe..27bf29070 100644 --- a/src/test/ref/complex/clearscreen/clearscreen.cfg +++ b/src/test/ref/complex/clearscreen/clearscreen.cfg @@ -147,7 +147,7 @@ processChars::@11: scope:[processChars] from processChars::@10 [71] *(((byte**)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_SCREENPTR]) = ' ' [72] *SPRITES_ENABLE = *SPRITES_ENABLE | processChars::bitmask#0 [73] SPRITES_COLOR[((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] = ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_COL] - [74] (SCREEN+SPRITE_PTRS)[((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] = ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_PTR] + [74] (SCREEN+OFFSET_SPRITE_PTRS)[((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] = ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_PTR] [75] ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_STATUS] = STATUS_PROCESSING to:processChars::@3 processChars::@3: scope:[processChars] from processChars::@10 processChars::@11 diff --git a/src/test/ref/complex/clearscreen/clearscreen.log b/src/test/ref/complex/clearscreen/clearscreen.log index cc6c10e1e..783efc2bd 100644 --- a/src/test/ref/complex/clearscreen/clearscreen.log +++ b/src/test/ref/complex/clearscreen/clearscreen.log @@ -670,7 +670,7 @@ processChars::@11: scope:[processChars] from processChars::@10 SPRITES_COLOR[*processChars::$37] = *processChars::$36 processChars::$64 = (byte*)processChars::processing#3 processChars::$38 = processChars::$64 + OFFSET_STRUCT_PROCESSINGSPRITE_ID - processChars::$7 = SCREEN+SPRITE_PTRS + *processChars::$38 + processChars::$7 = SCREEN+OFFSET_SPRITE_PTRS + *processChars::$38 processChars::$65 = (byte*)processChars::processing#3 processChars::$39 = processChars::$65 + OFFSET_STRUCT_PROCESSINGSPRITE_PTR *processChars::$7 = *processChars::$39 @@ -1091,6 +1091,7 @@ const nomodify byte* IRQ_STATUS = (byte*)$d019 const nomodify byte LIGHT_BLUE = $e const nomodify byte NOT_FOUND = $ff const nomodify byte NUM_PROCESSING = 8 +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const byte OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d const byte OFFSET_STRUCT_PROCESSINGSPRITE_COL = $a const byte OFFSET_STRUCT_PROCESSINGSPRITE_ID = 8 @@ -1175,7 +1176,6 @@ const nomodify byte* SPRITES_XMSB = (byte*)$d010 const nomodify byte* SPRITES_XPOS = (byte*)$d000 const nomodify byte* SPRITES_YPOS = (byte*)$d001 const nomodify byte* SPRITE_DATA = (byte*)$2000 -const nomodify word SPRITE_PTRS = $3f8 const byte STATUS_FREE = 0 const byte STATUS_NEW = 1 const byte STATUS_PROCESSING = 2 @@ -2568,9 +2568,9 @@ Converting *(pointer+n) to pointer[n] [212] processChars::xpos#0 = *processChars Converting *(pointer+n) to pointer[n] [218] *(*processChars::$35) = ' ' -- processChars::$61[OFFSET_STRUCT_PROCESSINGSPRITE_SCREENPTR] Converting *(pointer+n) to pointer[n] [224] SPRITES_COLOR[*processChars::$37] = *processChars::$36 -- processChars::$62[OFFSET_STRUCT_PROCESSINGSPRITE_COL] Converting *(pointer+n) to pointer[n] [224] SPRITES_COLOR[*processChars::$37] = processChars::$62[OFFSET_STRUCT_PROCESSINGSPRITE_COL] -- processChars::$63[OFFSET_STRUCT_PROCESSINGSPRITE_ID] -Converting *(pointer+n) to pointer[n] [227] processChars::$7 = SCREEN+SPRITE_PTRS + *processChars::$38 -- processChars::$64[OFFSET_STRUCT_PROCESSINGSPRITE_ID] +Converting *(pointer+n) to pointer[n] [227] processChars::$7 = SCREEN+OFFSET_SPRITE_PTRS + *processChars::$38 -- processChars::$64[OFFSET_STRUCT_PROCESSINGSPRITE_ID] Converting *(pointer+n) to pointer[n] [230] *processChars::$7 = *processChars::$39 -- processChars::$65[OFFSET_STRUCT_PROCESSINGSPRITE_PTR] -Converting *(pointer+n) to pointer[n] [230] *processChars::$7 = processChars::$65[OFFSET_STRUCT_PROCESSINGSPRITE_PTR] -- (SCREEN+SPRITE_PTRS)[processChars::$64[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] +Converting *(pointer+n) to pointer[n] [230] *processChars::$7 = processChars::$65[OFFSET_STRUCT_PROCESSINGSPRITE_PTR] -- (SCREEN+OFFSET_SPRITE_PTRS)[processChars::$64[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] Converting *(pointer+n) to pointer[n] [233] *processChars::$40 = STATUS_PROCESSING -- processChars::$66[OFFSET_STRUCT_PROCESSINGSPRITE_STATUS] Converting *(pointer+n) to pointer[n] [241] processChars::$12 = *processChars::$41 >> 4 -- processChars::$67[OFFSET_STRUCT_PROCESSINGSPRITE_Y] Converting *(pointer+n) to pointer[n] [247] processChars::$14 = *processChars::$42 < XPOS_LEFTMOST -- processChars::$68[OFFSET_STRUCT_PROCESSINGSPRITE_X] @@ -2613,7 +2613,7 @@ Eliminating unused variable processChars::$35 and assignment [169] processChars: Eliminating unused variable processChars::$36 and assignment [173] processChars::$36 = processChars::$62 + OFFSET_STRUCT_PROCESSINGSPRITE_COL Eliminating unused variable processChars::$37 and assignment [175] processChars::$37 = processChars::$63 + OFFSET_STRUCT_PROCESSINGSPRITE_ID Eliminating unused variable processChars::$38 and assignment [178] processChars::$38 = processChars::$64 + OFFSET_STRUCT_PROCESSINGSPRITE_ID -Eliminating unused variable processChars::$7 and assignment [179] processChars::$7 = SCREEN+SPRITE_PTRS + processChars::$64[OFFSET_STRUCT_PROCESSINGSPRITE_ID] +Eliminating unused variable processChars::$7 and assignment [179] processChars::$7 = SCREEN+OFFSET_SPRITE_PTRS + processChars::$64[OFFSET_STRUCT_PROCESSINGSPRITE_ID] Eliminating unused variable processChars::$39 and assignment [181] processChars::$39 = processChars::$65 + OFFSET_STRUCT_PROCESSINGSPRITE_PTR Eliminating unused variable processChars::$40 and assignment [184] processChars::$40 = processChars::$66 + OFFSET_STRUCT_PROCESSINGSPRITE_STATUS Eliminating unused variable processChars::$41 and assignment [192] processChars::$41 = processChars::$67 + OFFSET_STRUCT_PROCESSINGSPRITE_Y @@ -3204,7 +3204,7 @@ processChars::@11: scope:[processChars] from processChars::@10 [71] *(((byte**)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_SCREENPTR]) = ' ' [72] *SPRITES_ENABLE = *SPRITES_ENABLE | processChars::bitmask#0 [73] SPRITES_COLOR[((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] = ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_COL] - [74] (SCREEN+SPRITE_PTRS)[((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] = ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_PTR] + [74] (SCREEN+OFFSET_SPRITE_PTRS)[((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] = ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_PTR] [75] ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_STATUS] = STATUS_PROCESSING to:processChars::@3 processChars::@3: scope:[processChars] from processChars::@10 processChars::@11 @@ -4341,7 +4341,7 @@ Removing always clobbered register reg byte x as potential for zp[1]:73 [ proces Removing always clobbered register reg byte x as potential for zp[1]:80 [ processChars::bitmask#0 ] Statement [72] *SPRITES_ENABLE = *SPRITES_ENABLE | processChars::bitmask#0 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] ( processChars:11 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] { } ) always clobbers reg byte a Statement [73] SPRITES_COLOR[((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] = ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_COL] [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] ( processChars:11 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] { } ) always clobbers reg byte a reg byte y -Statement [74] (SCREEN+SPRITE_PTRS)[((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] = ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_PTR] [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] ( processChars:11 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] { } ) always clobbers reg byte a reg byte y +Statement [74] (SCREEN+OFFSET_SPRITE_PTRS)[((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] = ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_PTR] [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] ( processChars:11 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] { } ) always clobbers reg byte a reg byte y Statement [75] ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_STATUS] = STATUS_PROCESSING [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] ( processChars:11 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] { } ) always clobbers reg byte a reg byte y Statement [76] processChars::xpos#0 = *((word*)processChars::processing#0) >> 4 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 processChars::xpos#0 ] ( processChars:11 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 processChars::xpos#0 ] { } ) always clobbers reg byte a reg byte y Statement [79] processChars::$10 = $ff ^ processChars::bitmask#0 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 processChars::xpos#0 processChars::$10 ] ( processChars:11 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 processChars::xpos#0 processChars::$10 ] { } ) always clobbers reg byte a @@ -4559,7 +4559,7 @@ Statement [70] if(((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSP Statement [71] *(((byte**)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_SCREENPTR]) = ' ' [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] ( processChars:11 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] { } ) always clobbers reg byte a reg byte x reg byte y Statement [72] *SPRITES_ENABLE = *SPRITES_ENABLE | processChars::bitmask#0 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] ( processChars:11 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] { } ) always clobbers reg byte a Statement [73] SPRITES_COLOR[((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] = ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_COL] [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] ( processChars:11 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] { } ) always clobbers reg byte a reg byte y -Statement [74] (SCREEN+SPRITE_PTRS)[((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] = ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_PTR] [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] ( processChars:11 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] { } ) always clobbers reg byte a reg byte y +Statement [74] (SCREEN+OFFSET_SPRITE_PTRS)[((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] = ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_PTR] [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] ( processChars:11 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] { } ) always clobbers reg byte a reg byte y Statement [75] ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_STATUS] = STATUS_PROCESSING [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] ( processChars:11 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 ] { } ) always clobbers reg byte a reg byte y Statement [76] processChars::xpos#0 = *((word*)processChars::processing#0) >> 4 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 processChars::xpos#0 ] ( processChars:11 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 processChars::xpos#0 ] { } ) always clobbers reg byte a reg byte y Statement [79] processChars::$10 = $ff ^ processChars::bitmask#0 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 processChars::xpos#0 processChars::$10 ] ( processChars:11 [ processChars::i#10 processChars::numActive#10 processChars::$13 processChars::processing#0 processChars::bitmask#0 processChars::xpos#0 processChars::$10 ] { } ) always clobbers reg byte a @@ -5090,7 +5090,7 @@ ASSEMBLER BEFORE OPTIMIZATION .const BORDER_YPOS_TOP = $32 .const BORDER_YPOS_BOTTOM = $fa // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 // Bits for the VICII IRQ Status/Enable Registers .const IRQ_RASTER = 1 // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written @@ -5587,7 +5587,7 @@ processChars: { tay pla sta SPRITES_COLOR,y - // [74] (SCREEN+SPRITE_PTRS)[((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] = ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_PTR] -- pbuc1_derefidx_(pbuz1_derefidx_vbuc2)=pbuz1_derefidx_vbuc3 + // [74] (SCREEN+OFFSET_SPRITE_PTRS)[((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] = ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_PTR] -- pbuc1_derefidx_(pbuz1_derefidx_vbuc2)=pbuz1_derefidx_vbuc3 // Set sprite pointer ldy #OFFSET_STRUCT_PROCESSINGSPRITE_PTR lda (processing),y @@ -5596,7 +5596,7 @@ processChars: { lda (processing),y tay pla - sta SCREEN+SPRITE_PTRS,y + sta SCREEN+OFFSET_SPRITE_PTRS,y // [75] ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_STATUS] = STATUS_PROCESSING -- pbuz1_derefidx_vbuc1=vbuc2 // Set status lda #STATUS_PROCESSING @@ -7349,6 +7349,7 @@ const nomodify byte* IRQ_STATUS = (byte*) 53273 const nomodify byte LIGHT_BLUE = $e const nomodify byte NOT_FOUND = $ff const nomodify byte NUM_PROCESSING = 8 +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const byte OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d const byte OFFSET_STRUCT_PROCESSINGSPRITE_COL = $a const byte OFFSET_STRUCT_PROCESSINGSPRITE_ID = 8 @@ -7386,7 +7387,6 @@ const nomodify byte* SPRITES_XMSB = (byte*) 53264 const nomodify byte* SPRITES_XPOS = (byte*) 53248 const nomodify byte* SPRITES_YPOS = (byte*) 53249 const nomodify byte* SPRITE_DATA = (byte*) 8192 -const nomodify word SPRITE_PTRS = $3f8 const byte STATUS_FREE = 0 const byte STATUS_NEW = 1 const byte STATUS_PROCESSING = 2 @@ -7798,7 +7798,7 @@ Score: 1110954 .const BORDER_YPOS_TOP = $32 .const BORDER_YPOS_BOTTOM = $fa // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 // Bits for the VICII IRQ Status/Enable Registers .const IRQ_RASTER = 1 // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written @@ -8270,8 +8270,8 @@ processChars: { tay pla sta SPRITES_COLOR,y - // *(SCREEN+SPRITE_PTRS+processing->id) = processing->ptr - // [74] (SCREEN+SPRITE_PTRS)[((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] = ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_PTR] -- pbuc1_derefidx_(pbuz1_derefidx_vbuc2)=pbuz1_derefidx_vbuc3 + // *(SCREEN+OFFSET_SPRITE_PTRS+processing->id) = processing->ptr + // [74] (SCREEN+OFFSET_SPRITE_PTRS)[((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_ID]] = ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_PTR] -- pbuc1_derefidx_(pbuz1_derefidx_vbuc2)=pbuz1_derefidx_vbuc3 // Set sprite pointer ldy #OFFSET_STRUCT_PROCESSINGSPRITE_PTR lda (processing),y @@ -8280,7 +8280,7 @@ processChars: { lda (processing),y tay pla - sta SCREEN+SPRITE_PTRS,y + sta SCREEN+OFFSET_SPRITE_PTRS,y // processing->status = STATUS_PROCESSING // [75] ((byte*)processChars::processing#0)[OFFSET_STRUCT_PROCESSINGSPRITE_STATUS] = STATUS_PROCESSING -- pbuz1_derefidx_vbuc1=vbuc2 // Set status diff --git a/src/test/ref/complex/clearscreen/clearscreen.sym b/src/test/ref/complex/clearscreen/clearscreen.sym index c130d6957..7f9c58e3c 100644 --- a/src/test/ref/complex/clearscreen/clearscreen.sym +++ b/src/test/ref/complex/clearscreen/clearscreen.sym @@ -19,6 +19,7 @@ const nomodify byte* IRQ_STATUS = (byte*) 53273 const nomodify byte LIGHT_BLUE = $e const nomodify byte NOT_FOUND = $ff const nomodify byte NUM_PROCESSING = 8 +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const byte OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d const byte OFFSET_STRUCT_PROCESSINGSPRITE_COL = $a const byte OFFSET_STRUCT_PROCESSINGSPRITE_ID = 8 @@ -56,7 +57,6 @@ const nomodify byte* SPRITES_XMSB = (byte*) 53264 const nomodify byte* SPRITES_XPOS = (byte*) 53248 const nomodify byte* SPRITES_YPOS = (byte*) 53249 const nomodify byte* SPRITE_DATA = (byte*) 8192 -const nomodify word SPRITE_PTRS = $3f8 const byte STATUS_FREE = 0 const byte STATUS_NEW = 1 const byte STATUS_PROCESSING = 2 diff --git a/src/test/ref/complex/tetris/test-sprites.asm b/src/test/ref/complex/tetris/test-sprites.asm index 67d77f623..883da6245 100644 --- a/src/test/ref/complex/tetris/test-sprites.asm +++ b/src/test/ref/complex/tetris/test-sprites.asm @@ -14,7 +14,7 @@ // Value that disables all CIA interrupts when stored to the CIA Interrupt registers .const CIA_INTERRUPT_CLEAR = $7f // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 // Bits for the VICII IRQ Status/Enable Registers .const IRQ_RASTER = 1 // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written @@ -60,9 +60,9 @@ // Address of the second screen .label PLAYFIELD_SCREEN_2 = $2c00 // Screen Sprite pointers on screen 1 - .label PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+SPRITE_PTRS + .label PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+OFFSET_SPRITE_PTRS // Screen Sprite pointers on screen 2 - .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS + .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+OFFSET_SPRITE_PTRS // The screen currently being showed to the user. 0x00 for screen 1 / 0x20 for screen 2. .label render_screen_showing = 6 // The raster line of the next IRQ diff --git a/src/test/ref/complex/tetris/test-sprites.log b/src/test/ref/complex/tetris/test-sprites.log index d70408545..f9d478363 100644 --- a/src/test/ref/complex/tetris/test-sprites.log +++ b/src/test/ref/complex/tetris/test-sprites.log @@ -362,6 +362,7 @@ const nomodify byte* IRQ_ENABLE = (byte*)$d01a const nomodify byte IRQ_RASTER = 1 const nomodify byte IRQ_RASTER_FIRST = (byte)SPRITES_FIRST_YPOS+$13 const nomodify byte* IRQ_STATUS = (byte*)$d019 +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const byte OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d const byte OFFSET_STRUCT_MOS6526_CIA_PORT_A = 0 const byte OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2 @@ -385,8 +386,8 @@ const byte* PLAYFIELD_SPRITES[$1e*$40] = kickasm {{ .var sprites = LoadPicture( } } }} -const nomodify byte* PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+SPRITE_PTRS -const nomodify byte* PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS +const nomodify byte* PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+OFFSET_SPRITE_PTRS +const nomodify byte* PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+OFFSET_SPRITE_PTRS const nomodify byte* PROCPORT = (byte*)1 const nomodify byte* PROCPORT_DDR = (byte*)0 const nomodify byte PROCPORT_DDR_MEMORY_MASK = 7 @@ -407,7 +408,6 @@ const nomodify byte SPRITES_FIRST_YPOS = $31 const nomodify byte* SPRITES_MC = (byte*)$d01c const nomodify byte* SPRITES_XPOS = (byte*)$d000 const nomodify byte* SPRITES_YPOS = (byte*)$d001 -const nomodify word SPRITE_PTRS = $3f8 const nomodify byte* VICII_CONTROL = (byte*)$d011 void __start() byte~ __start::__init1_$0 @@ -1687,7 +1687,7 @@ ASSEMBLER BEFORE OPTIMIZATION // Value that disables all CIA interrupts when stored to the CIA Interrupt registers .const CIA_INTERRUPT_CLEAR = $7f // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 // Bits for the VICII IRQ Status/Enable Registers .const IRQ_RASTER = 1 // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written @@ -1733,9 +1733,9 @@ ASSEMBLER BEFORE OPTIMIZATION // Address of the second screen .label PLAYFIELD_SCREEN_2 = $2c00 // Screen Sprite pointers on screen 1 - .label PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+SPRITE_PTRS + .label PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+OFFSET_SPRITE_PTRS // Screen Sprite pointers on screen 2 - .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS + .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+OFFSET_SPRITE_PTRS // The screen currently being showed to the user. 0x00 for screen 1 / 0x20 for screen 2. .label render_screen_showing = 6 // The raster line of the next IRQ @@ -2400,6 +2400,7 @@ const nomodify byte* IRQ_ENABLE = (byte*) 53274 const nomodify byte IRQ_RASTER = 1 const nomodify byte IRQ_RASTER_FIRST = SPRITES_FIRST_YPOS+$13 const nomodify byte* IRQ_STATUS = (byte*) 53273 +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const byte OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d const byte OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2 const byte* PLAYFIELD_CHARSET[] = kickasm {{ .fill 8,$00 // Place a filled char at the start of the charset @@ -2422,8 +2423,8 @@ const byte* PLAYFIELD_SPRITES[$1e*$40] = kickasm {{ .var sprites = LoadPicture( } } }} -const nomodify byte* PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+SPRITE_PTRS -const nomodify byte* PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS +const nomodify byte* PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+OFFSET_SPRITE_PTRS +const nomodify byte* PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+OFFSET_SPRITE_PTRS const nomodify byte* PROCPORT = (byte*) 1 const nomodify byte* PROCPORT_DDR = (byte*) 0 const nomodify byte PROCPORT_DDR_MEMORY_MASK = 7 @@ -2444,7 +2445,6 @@ const nomodify byte SPRITES_FIRST_YPOS = $31 const nomodify byte* SPRITES_MC = (byte*) 53276 const nomodify byte* SPRITES_XPOS = (byte*) 53248 const nomodify byte* SPRITES_YPOS = (byte*) 53249 -const nomodify word SPRITE_PTRS = $3f8 const nomodify byte* VICII_CONTROL = (byte*) 53265 void __start() byte __start::__init1_toSpritePtr1_return @@ -2564,7 +2564,7 @@ Score: 6632 // Value that disables all CIA interrupts when stored to the CIA Interrupt registers .const CIA_INTERRUPT_CLEAR = $7f // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 // Bits for the VICII IRQ Status/Enable Registers .const IRQ_RASTER = 1 // Mask for PROCESSOR_PORT_DDR which allows only memory configuration to be written @@ -2610,9 +2610,9 @@ Score: 6632 // Address of the second screen .label PLAYFIELD_SCREEN_2 = $2c00 // Screen Sprite pointers on screen 1 - .label PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+SPRITE_PTRS + .label PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+OFFSET_SPRITE_PTRS // Screen Sprite pointers on screen 2 - .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS + .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+OFFSET_SPRITE_PTRS // The screen currently being showed to the user. 0x00 for screen 1 / 0x20 for screen 2. .label render_screen_showing = 6 // The raster line of the next IRQ diff --git a/src/test/ref/complex/tetris/test-sprites.sym b/src/test/ref/complex/tetris/test-sprites.sym index 9f45e30db..a164f2d34 100644 --- a/src/test/ref/complex/tetris/test-sprites.sym +++ b/src/test/ref/complex/tetris/test-sprites.sym @@ -9,6 +9,7 @@ const nomodify byte* IRQ_ENABLE = (byte*) 53274 const nomodify byte IRQ_RASTER = 1 const nomodify byte IRQ_RASTER_FIRST = SPRITES_FIRST_YPOS+$13 const nomodify byte* IRQ_STATUS = (byte*) 53273 +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const byte OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d const byte OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2 const byte* PLAYFIELD_CHARSET[] = kickasm {{ .fill 8,$00 // Place a filled char at the start of the charset @@ -31,8 +32,8 @@ const byte* PLAYFIELD_SPRITES[$1e*$40] = kickasm {{ .var sprites = LoadPicture( } } }} -const nomodify byte* PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+SPRITE_PTRS -const nomodify byte* PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS +const nomodify byte* PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+OFFSET_SPRITE_PTRS +const nomodify byte* PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+OFFSET_SPRITE_PTRS const nomodify byte* PROCPORT = (byte*) 1 const nomodify byte* PROCPORT_DDR = (byte*) 0 const nomodify byte PROCPORT_DDR_MEMORY_MASK = 7 @@ -53,7 +54,6 @@ const nomodify byte SPRITES_FIRST_YPOS = $31 const nomodify byte* SPRITES_MC = (byte*) 53276 const nomodify byte* SPRITES_XPOS = (byte*) 53248 const nomodify byte* SPRITES_YPOS = (byte*) 53249 -const nomodify word SPRITE_PTRS = $3f8 const nomodify byte* VICII_CONTROL = (byte*) 53265 void __start() byte __start::__init1_toSpritePtr1_return diff --git a/src/test/ref/complex/tetris/tetris.asm b/src/test/ref/complex/tetris/tetris.asm index b86b82ff2..1abf38078 100644 --- a/src/test/ref/complex/tetris/tetris.asm +++ b/src/test/ref/complex/tetris/tetris.asm @@ -12,7 +12,7 @@ // Value that disables all CIA interrupts when stored to the CIA Interrupt registers .const CIA_INTERRUPT_CLEAR = $7f // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 .const VICII_ECM = $40 .const VICII_DEN = $10 .const VICII_RSEL = 8 @@ -112,9 +112,9 @@ // Address of the second screen .label PLAYFIELD_SCREEN_2 = $2c00 // Screen Sprite pointers on screen 1 - .label PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+SPRITE_PTRS + .label PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+OFFSET_SPRITE_PTRS // Screen Sprite pointers on screen 2 - .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS + .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+OFFSET_SPRITE_PTRS // The screen currently being showed to the user. 0x00 for screen 1 / 0x20 for screen 2. .label render_screen_showing = $24 // Current score in BCD-format diff --git a/src/test/ref/complex/tetris/tetris.log b/src/test/ref/complex/tetris/tetris.log index 589157755..407c4cbda 100644 --- a/src/test/ref/complex/tetris/tetris.log +++ b/src/test/ref/complex/tetris/tetris.log @@ -3252,6 +3252,7 @@ const nomodify byte KEY_Z = $c const nomodify byte LIGHT_BLUE = $e const nomodify byte LIGHT_GREEN = $d const to_nomodify byte* MOVEDOWN_SLOW_SPEEDS[] = { $30, $2b, $26, $21, $1c, $17, $12, $d, 8, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 } +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const byte OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d const byte OFFSET_STRUCT_MOS6526_CIA_PORT_A = 0 const byte OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2 @@ -3308,8 +3309,8 @@ const byte* PLAYFIELD_SPRITES[$1e*$40] = kickasm {{ .var sprites = LoadPicture( } } }} -const nomodify byte* PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+SPRITE_PTRS -const nomodify byte* PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS +const nomodify byte* PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+OFFSET_SPRITE_PTRS +const nomodify byte* PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+OFFSET_SPRITE_PTRS const nomodify byte* PROCPORT = (byte*)1 const nomodify byte* PROCPORT_DDR = (byte*)0 const nomodify byte PROCPORT_DDR_MEMORY_MASK = 7 @@ -3331,7 +3332,6 @@ const nomodify byte SPRITES_FIRST_YPOS = $31 const nomodify byte* SPRITES_MC = (byte*)$d01c const nomodify byte* SPRITES_XPOS = (byte*)$d000 const nomodify byte* SPRITES_YPOS = (byte*)$d001 -const nomodify word SPRITE_PTRS = $3f8 const nomodify byte* VICII_CONTROL = (byte*)$d011 const nomodify byte VICII_DEN = $10 const nomodify byte VICII_ECM = $40 @@ -12554,7 +12554,7 @@ ASSEMBLER BEFORE OPTIMIZATION // Value that disables all CIA interrupts when stored to the CIA Interrupt registers .const CIA_INTERRUPT_CLEAR = $7f // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 .const VICII_ECM = $40 .const VICII_DEN = $10 .const VICII_RSEL = 8 @@ -12654,9 +12654,9 @@ ASSEMBLER BEFORE OPTIMIZATION // Address of the second screen .label PLAYFIELD_SCREEN_2 = $2c00 // Screen Sprite pointers on screen 1 - .label PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+SPRITE_PTRS + .label PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+OFFSET_SPRITE_PTRS // Screen Sprite pointers on screen 2 - .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS + .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+OFFSET_SPRITE_PTRS // The screen currently being showed to the user. 0x00 for screen 1 / 0x20 for screen 2. .label render_screen_showing = $24 // Current score in BCD-format @@ -16762,6 +16762,7 @@ const nomodify byte KEY_Z = $c const nomodify byte LIGHT_BLUE = $e const nomodify byte LIGHT_GREEN = $d const to_nomodify byte* MOVEDOWN_SLOW_SPEEDS[] = { $30, $2b, $26, $21, $1c, $17, $12, $d, 8, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 } +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const byte OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d const byte OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2 const byte OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1 @@ -16817,8 +16818,8 @@ const byte* PLAYFIELD_SPRITES[$1e*$40] = kickasm {{ .var sprites = LoadPicture( } } }} -const nomodify byte* PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+SPRITE_PTRS -const nomodify byte* PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS +const nomodify byte* PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+OFFSET_SPRITE_PTRS +const nomodify byte* PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+OFFSET_SPRITE_PTRS const nomodify byte* PROCPORT = (byte*) 1 const nomodify byte* PROCPORT_DDR = (byte*) 0 const nomodify byte PROCPORT_DDR_MEMORY_MASK = 7 @@ -16837,7 +16838,6 @@ const nomodify byte SPRITES_FIRST_YPOS = $31 const nomodify byte* SPRITES_MC = (byte*) 53276 const nomodify byte* SPRITES_XPOS = (byte*) 53248 const nomodify byte* SPRITES_YPOS = (byte*) 53249 -const nomodify word SPRITE_PTRS = $3f8 const nomodify byte* VICII_CONTROL = (byte*) 53265 const nomodify byte VICII_DEN = $10 const nomodify byte VICII_ECM = $40 @@ -17614,7 +17614,7 @@ Score: 3343892 // Value that disables all CIA interrupts when stored to the CIA Interrupt registers .const CIA_INTERRUPT_CLEAR = $7f // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 .const VICII_ECM = $40 .const VICII_DEN = $10 .const VICII_RSEL = 8 @@ -17714,9 +17714,9 @@ Score: 3343892 // Address of the second screen .label PLAYFIELD_SCREEN_2 = $2c00 // Screen Sprite pointers on screen 1 - .label PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+SPRITE_PTRS + .label PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+OFFSET_SPRITE_PTRS // Screen Sprite pointers on screen 2 - .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS + .label PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+OFFSET_SPRITE_PTRS // The screen currently being showed to the user. 0x00 for screen 1 / 0x20 for screen 2. .label render_screen_showing = $24 // Current score in BCD-format diff --git a/src/test/ref/complex/tetris/tetris.sym b/src/test/ref/complex/tetris/tetris.sym index e516d739d..8cb88d4d7 100644 --- a/src/test/ref/complex/tetris/tetris.sym +++ b/src/test/ref/complex/tetris/tetris.sym @@ -38,6 +38,7 @@ const nomodify byte KEY_Z = $c const nomodify byte LIGHT_BLUE = $e const nomodify byte LIGHT_GREEN = $d const to_nomodify byte* MOVEDOWN_SLOW_SPEEDS[] = { $30, $2b, $26, $21, $1c, $17, $12, $d, 8, 6, 5, 5, 5, 4, 4, 4, 3, 3, 3, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 1 } +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const byte OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d const byte OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2 const byte OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1 @@ -93,8 +94,8 @@ const byte* PLAYFIELD_SPRITES[$1e*$40] = kickasm {{ .var sprites = LoadPicture( } } }} -const nomodify byte* PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+SPRITE_PTRS -const nomodify byte* PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+SPRITE_PTRS +const nomodify byte* PLAYFIELD_SPRITE_PTRS_1 = PLAYFIELD_SCREEN_1+OFFSET_SPRITE_PTRS +const nomodify byte* PLAYFIELD_SPRITE_PTRS_2 = PLAYFIELD_SCREEN_2+OFFSET_SPRITE_PTRS const nomodify byte* PROCPORT = (byte*) 1 const nomodify byte* PROCPORT_DDR = (byte*) 0 const nomodify byte PROCPORT_DDR_MEMORY_MASK = 7 @@ -113,7 +114,6 @@ const nomodify byte SPRITES_FIRST_YPOS = $31 const nomodify byte* SPRITES_MC = (byte*) 53276 const nomodify byte* SPRITES_XPOS = (byte*) 53248 const nomodify byte* SPRITES_YPOS = (byte*) 53249 -const nomodify word SPRITE_PTRS = $3f8 const nomodify byte* VICII_CONTROL = (byte*) 53265 const nomodify byte VICII_DEN = $10 const nomodify byte VICII_ECM = $40 diff --git a/src/test/ref/complex/xmega65/xmega65.asm b/src/test/ref/complex/xmega65/xmega65.asm index 7a208da02..aab8e646e 100644 --- a/src/test/ref/complex/xmega65/xmega65.asm +++ b/src/test/ref/complex/xmega65/xmega65.asm @@ -13,7 +13,7 @@ .const JMP = $4c .const NOP = $ea .label RASTER = $d012 - .label VIC_MEMORY = $d018 + .label VICII_MEMORY = $d018 .label SCREEN = $400 .label BG_COLOR = $d021 .label COLS = $d800 @@ -36,10 +36,10 @@ main: { // Print message .label sc = 4 .label msg = 2 - // *VIC_MEMORY = 0x14 + // *VICII_MEMORY = 0x14 // Initialize screen memory lda #$14 - sta VIC_MEMORY + sta VICII_MEMORY // memset(SCREEN, ' ', 40*25) // Init screen/colors ldx #' ' diff --git a/src/test/ref/complex/xmega65/xmega65.cfg b/src/test/ref/complex/xmega65/xmega65.cfg index 7c1493313..4374b4f84 100644 --- a/src/test/ref/complex/xmega65/xmega65.cfg +++ b/src/test/ref/complex/xmega65/xmega65.cfg @@ -17,7 +17,7 @@ syscall1::@return: scope:[syscall1] from syscall1 void main() main: scope:[main] from - [4] *VIC_MEMORY = $14 + [4] *VICII_MEMORY = $14 [5] call memset to:main::@6 main::@6: scope:[main] from main diff --git a/src/test/ref/complex/xmega65/xmega65.log b/src/test/ref/complex/xmega65/xmega65.log index 9b64fd1fc..bcc9e0995 100644 --- a/src/test/ref/complex/xmega65/xmega65.log +++ b/src/test/ref/complex/xmega65/xmega65.log @@ -48,7 +48,7 @@ memset::@return: scope:[memset] from memset::@1 void main() main: scope:[main] from __start - *VIC_MEMORY = $14 + *VICII_MEMORY = $14 memset::str#0 = (void*)SCREEN memset::c#0 = ' ' memset::num#0 = $28*$19 @@ -135,7 +135,7 @@ const nomodify byte* RASTER = (byte*)$d012 const nomodify byte* SCREEN = (byte*)$400 const struct SysCall* SYSCALLS[] = { { xjmp: JMP, syscall: &syscall1, xnop: NOP }, { xjmp: JMP, syscall: &syscall2, xnop: NOP } } const struct SysCall* SYSCALL_RESET[] = { { xjmp: JMP, syscall: &main, xnop: NOP } } -const nomodify byte* VIC_MEMORY = (byte*)$d018 +const nomodify byte* VICII_MEMORY = (byte*)$d018 const nomodify byte WHITE = 1 void __start() void main() @@ -198,7 +198,7 @@ void syscall1() void syscall2() Adding number conversion cast (unumber) 0 in memset::$0 = memset::num#2 > 0 -Adding number conversion cast (unumber) $14 in *VIC_MEMORY = $14 +Adding number conversion cast (unumber) $14 in *VICII_MEMORY = $14 Adding number conversion cast (unumber) $28*$19 in memset::num#0 = $28*$19 Adding number conversion cast (unumber) $28*$19 in memset::num#1 = $28*$19 Adding number conversion cast (unumber) $28 in main::sc#0 = SCREEN+$28 @@ -209,7 +209,7 @@ Adding number conversion cast (unumber) $4f in *(SCREEN+$4f) = '>' Adding number conversion cast (unumber) $4e in *(SCREEN+$4e) = '<' Successful SSA optimization PassNAddNumberTypeConversions Inlining cast memset::dst#0 = (byte*)memset::str#3 -Inlining cast *VIC_MEMORY = (unumber)$14 +Inlining cast *VICII_MEMORY = (unumber)$14 Inlining cast memset::num#0 = (unumber)$28*$19 Inlining cast memset::num#1 = (unumber)$28*$19 Successful SSA optimization Pass2InlineCast @@ -361,7 +361,7 @@ syscall1::@return: scope:[syscall1] from syscall1 void main() main: scope:[main] from - [4] *VIC_MEMORY = $14 + [4] *VICII_MEMORY = $14 [5] call memset to:main::@6 main::@6: scope:[main] from main @@ -460,7 +460,7 @@ Allocated zp[2]:11 [ memset::end#0 ] REGISTER UPLIFT POTENTIAL REGISTERS Statement [0] *(SCREEN+$4e) = '<' [ ] ( [ ] { } ) always clobbers reg byte a Statement [2] *(SCREEN+$4f) = '>' [ ] ( [ ] { } ) always clobbers reg byte a -Statement [4] *VIC_MEMORY = $14 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [4] *VICII_MEMORY = $14 [ ] ( [ ] { } ) always clobbers reg byte a Statement [9] if(0!=*main::msg#2) goto main::@2 [ main::msg#2 main::sc#2 ] ( [ main::msg#2 main::sc#2 ] { } ) always clobbers reg byte a reg byte y Statement [10] if(*RASTER==$36) goto main::@4 [ ] ( [ ] { } ) always clobbers reg byte a Statement [11] if(*RASTER==$42) goto main::@4 [ ] ( [ ] { } ) always clobbers reg byte a @@ -475,7 +475,7 @@ Statement [23] *memset::dst#2 = memset::c#4 [ memset::c#4 memset::end#0 memset:: Removing always clobbered register reg byte y as potential for zp[1]:8 [ memset::c#4 ] Statement [0] *(SCREEN+$4e) = '<' [ ] ( [ ] { } ) always clobbers reg byte a Statement [2] *(SCREEN+$4f) = '>' [ ] ( [ ] { } ) always clobbers reg byte a -Statement [4] *VIC_MEMORY = $14 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [4] *VICII_MEMORY = $14 [ ] ( [ ] { } ) always clobbers reg byte a Statement [9] if(0!=*main::msg#2) goto main::@2 [ main::msg#2 main::sc#2 ] ( [ main::msg#2 main::sc#2 ] { } ) always clobbers reg byte a reg byte y Statement [10] if(*RASTER==$36) goto main::@4 [ ] ( [ ] { } ) always clobbers reg byte a Statement [11] if(*RASTER==$42) goto main::@4 [ ] ( [ ] { } ) always clobbers reg byte a @@ -529,7 +529,7 @@ ASSEMBLER BEFORE OPTIMIZATION .const JMP = $4c .const NOP = $ea .label RASTER = $d012 - .label VIC_MEMORY = $d018 + .label VICII_MEMORY = $d018 .label SCREEN = $400 .label BG_COLOR = $d021 .label COLS = $d800 @@ -561,10 +561,10 @@ main: { // Print message .label sc = 4 .label msg = 2 - // [4] *VIC_MEMORY = $14 -- _deref_pbuc1=vbuc2 + // [4] *VICII_MEMORY = $14 -- _deref_pbuc1=vbuc2 // Initialize screen memory lda #$14 - sta VIC_MEMORY + sta VICII_MEMORY // [5] call memset // Init screen/colors // [17] phi from main to memset [phi:main->memset] @@ -772,7 +772,7 @@ const nomodify byte* RASTER = (byte*) 53266 const nomodify byte* SCREEN = (byte*) 1024 const struct SysCall* SYSCALLS[] = { { xjmp: JMP, syscall: &syscall1, xnop: NOP }, { xjmp: JMP, syscall: &syscall2, xnop: NOP } } const struct SysCall* SYSCALL_RESET[] = { { xjmp: JMP, syscall: &main, xnop: NOP } } -const nomodify byte* VIC_MEMORY = (byte*) 53272 +const nomodify byte* VICII_MEMORY = (byte*) 53272 const nomodify byte WHITE = 1 void main() byte* main::msg @@ -825,7 +825,7 @@ Score: 1600 .const JMP = $4c .const NOP = $ea .label RASTER = $d012 - .label VIC_MEMORY = $d018 + .label VICII_MEMORY = $d018 .label SCREEN = $400 .label BG_COLOR = $d021 .label COLS = $d800 @@ -857,11 +857,11 @@ main: { // Print message .label sc = 4 .label msg = 2 - // *VIC_MEMORY = 0x14 - // [4] *VIC_MEMORY = $14 -- _deref_pbuc1=vbuc2 + // *VICII_MEMORY = 0x14 + // [4] *VICII_MEMORY = $14 -- _deref_pbuc1=vbuc2 // Initialize screen memory lda #$14 - sta VIC_MEMORY + sta VICII_MEMORY // memset(SCREEN, ' ', 40*25) // [5] call memset // Init screen/colors diff --git a/src/test/ref/complex/xmega65/xmega65.sym b/src/test/ref/complex/xmega65/xmega65.sym index 5b3945c72..766ef36e4 100644 --- a/src/test/ref/complex/xmega65/xmega65.sym +++ b/src/test/ref/complex/xmega65/xmega65.sym @@ -8,7 +8,7 @@ const nomodify byte* RASTER = (byte*) 53266 const nomodify byte* SCREEN = (byte*) 1024 const struct SysCall* SYSCALLS[] = { { xjmp: JMP, syscall: &syscall1, xnop: NOP }, { xjmp: JMP, syscall: &syscall2, xnop: NOP } } const struct SysCall* SYSCALL_RESET[] = { { xjmp: JMP, syscall: &main, xnop: NOP } } -const nomodify byte* VIC_MEMORY = (byte*) 53272 +const nomodify byte* VICII_MEMORY = (byte*) 53272 const nomodify byte WHITE = 1 void main() byte* main::msg diff --git a/src/test/ref/examples/kernalload/kernalload.asm b/src/test/ref/examples/kernalload/kernalload.asm index fec925691..f978c4c2d 100644 --- a/src/test/ref/examples/kernalload/kernalload.asm +++ b/src/test/ref/examples/kernalload/kernalload.asm @@ -15,7 +15,7 @@ :BasicUpstart(main) .segment Code // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 .const GREEN = 5 .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 .const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 @@ -27,7 +27,7 @@ // Address to load to .label LOAD_SPRITE = $3000 .label SCREEN = $400 - .label SPRITES_PTR = SCREEN+SPRITE_PTRS + .label SPRITES_PTR = SCREEN+OFFSET_SPRITE_PTRS .segment Code main: { .const toSpritePtr1_return = LOAD_SPRITE/$40 diff --git a/src/test/ref/examples/kernalload/kernalload.log b/src/test/ref/examples/kernalload/kernalload.log index 7ffe3fd3c..d24df69fc 100644 --- a/src/test/ref/examples/kernalload/kernalload.log +++ b/src/test/ref/examples/kernalload/kernalload.log @@ -180,6 +180,7 @@ __start::@return: scope:[__start] from __start::@1 SYMBOL TABLE SSA const nomodify byte GREEN = 5 const nomodify byte* LOAD_SPRITE = (byte*)$3000 +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const byte OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 const nomodify byte* SCREEN = (byte*)$400 @@ -189,10 +190,9 @@ const byte* SPRITE[] = kickasm {{ .var pic = LoadPicture("sprite.png", List().a .byte pic.getSinglecolorByte(x,y) }} const nomodify byte* SPRITES_COLOR = (byte*)$d027 -const nomodify byte* SPRITES_PTR = SCREEN+SPRITE_PTRS +const nomodify byte* SPRITES_PTR = SCREEN+OFFSET_SPRITE_PTRS const nomodify byte* SPRITES_XPOS = (byte*)$d000 const nomodify byte* SPRITES_YPOS = (byte*)$d001 -const nomodify word SPRITE_PTRS = $3f8 const nomodify struct MOS6569_VICII* VICII = (struct MOS6569_VICII*)$d000 void __start() void error(byte error::err) @@ -740,7 +740,7 @@ ASSEMBLER BEFORE OPTIMIZATION .segment Code // Global Constants & labels // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 .const GREEN = 5 .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 .const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 @@ -752,7 +752,7 @@ ASSEMBLER BEFORE OPTIMIZATION // Address to load to .label LOAD_SPRITE = $3000 .label SCREEN = $400 - .label SPRITES_PTR = SCREEN+SPRITE_PTRS + .label SPRITES_PTR = SCREEN+OFFSET_SPRITE_PTRS .segment Code // main main: { @@ -1068,6 +1068,7 @@ Succesful ASM optimization Pass5UnusedLabelElimination FINAL SYMBOL TABLE const nomodify byte GREEN = 5 const nomodify byte* LOAD_SPRITE = (byte*) 12288 +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const byte OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 const nomodify byte* SCREEN = (byte*) 1024 @@ -1077,10 +1078,9 @@ const byte* SPRITE[] = kickasm {{ .var pic = LoadPicture("sprite.png", List().a .byte pic.getSinglecolorByte(x,y) }} const nomodify byte* SPRITES_COLOR = (byte*) 53287 -const nomodify byte* SPRITES_PTR = SCREEN+SPRITE_PTRS +const nomodify byte* SPRITES_PTR = SCREEN+OFFSET_SPRITE_PTRS const nomodify byte* SPRITES_XPOS = (byte*) 53248 const nomodify byte* SPRITES_YPOS = (byte*) 53249 -const nomodify word SPRITE_PTRS = $3f8 const nomodify struct MOS6569_VICII* VICII = (struct MOS6569_VICII*) 53248 void error(byte error::err) byte error::err @@ -1161,7 +1161,7 @@ Score: 811 .segment Code // Global Constants & labels // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 .const GREEN = 5 .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 .const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 @@ -1173,7 +1173,7 @@ Score: 811 // Address to load to .label LOAD_SPRITE = $3000 .label SCREEN = $400 - .label SPRITES_PTR = SCREEN+SPRITE_PTRS + .label SPRITES_PTR = SCREEN+OFFSET_SPRITE_PTRS .segment Code // main main: { diff --git a/src/test/ref/examples/kernalload/kernalload.sym b/src/test/ref/examples/kernalload/kernalload.sym index 884e6675f..fc0144a4a 100644 --- a/src/test/ref/examples/kernalload/kernalload.sym +++ b/src/test/ref/examples/kernalload/kernalload.sym @@ -1,5 +1,6 @@ const nomodify byte GREEN = 5 const nomodify byte* LOAD_SPRITE = (byte*) 12288 +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const byte OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 const nomodify byte* SCREEN = (byte*) 1024 @@ -9,10 +10,9 @@ const byte* SPRITE[] = kickasm {{ .var pic = LoadPicture("sprite.png", List().a .byte pic.getSinglecolorByte(x,y) }} const nomodify byte* SPRITES_COLOR = (byte*) 53287 -const nomodify byte* SPRITES_PTR = SCREEN+SPRITE_PTRS +const nomodify byte* SPRITES_PTR = SCREEN+OFFSET_SPRITE_PTRS const nomodify byte* SPRITES_XPOS = (byte*) 53248 const nomodify byte* SPRITES_YPOS = (byte*) 53249 -const nomodify word SPRITE_PTRS = $3f8 const nomodify struct MOS6569_VICII* VICII = (struct MOS6569_VICII*) 53248 void error(byte error::err) byte error::err diff --git a/src/test/ref/examples/krillload/krillload.asm b/src/test/ref/examples/krillload/krillload.asm index f16da6642..bf8f58540 100644 --- a/src/test/ref/examples/krillload/krillload.asm +++ b/src/test/ref/examples/krillload/krillload.asm @@ -17,7 +17,7 @@ .segment Code .const KRILL_OK = 0 // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 .const GREEN = 5 .const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 @@ -27,7 +27,7 @@ // The VIC-II MOS 6567/6569 .label VICII = $d000 .label SCREEN = $400 - .label SPRITES_PTR = SCREEN+SPRITE_PTRS + .label SPRITES_PTR = SCREEN+OFFSET_SPRITE_PTRS .segment Code main: { .const toSpritePtr1_return = $ff&SPRITE/$40 diff --git a/src/test/ref/examples/krillload/krillload.log b/src/test/ref/examples/krillload/krillload.log index 456d3481d..95998c669 100644 --- a/src/test/ref/examples/krillload/krillload.log +++ b/src/test/ref/examples/krillload/krillload.log @@ -109,6 +109,7 @@ const byte KrillStatus::KRILL_FILE_NOT_FOUND = $ff const byte KrillStatus::KRILL_GENERIC_KERNAL_ERROR = $fd const byte KrillStatus::KRILL_OK = 0 const byte KrillStatus::KRILL_TOO_MANY_DEVICES = $fc +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const byte OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 const nomodify byte* SCREEN = (byte*)$400 @@ -118,10 +119,9 @@ const byte* SPRITE[$40] = kickasm {{ .var pic = LoadPicture("sprite.png", List( .byte pic.getSinglecolorByte(x,y) }} const nomodify byte* SPRITES_COLOR = (byte*)$d027 -const nomodify byte* SPRITES_PTR = SCREEN+SPRITE_PTRS +const nomodify byte* SPRITES_PTR = SCREEN+OFFSET_SPRITE_PTRS const nomodify byte* SPRITES_XPOS = (byte*)$d000 const nomodify byte* SPRITES_YPOS = (byte*)$d001 -const nomodify word SPRITE_PTRS = $3f8 const nomodify struct MOS6569_VICII* VICII = (struct MOS6569_VICII*)$d000 void __start() byte krill_install() @@ -445,7 +445,7 @@ ASSEMBLER BEFORE OPTIMIZATION // Global Constants & labels .const KRILL_OK = 0 // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 .const GREEN = 5 .const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 @@ -455,7 +455,7 @@ ASSEMBLER BEFORE OPTIMIZATION // The VIC-II MOS 6567/6569 .label VICII = $d000 .label SCREEN = $400 - .label SPRITES_PTR = SCREEN+SPRITE_PTRS + .label SPRITES_PTR = SCREEN+OFFSET_SPRITE_PTRS .segment Code // main main: { @@ -654,6 +654,7 @@ const byte KrillStatus::KRILL_FILE_NOT_FOUND = $ff const byte KrillStatus::KRILL_GENERIC_KERNAL_ERROR = $fd const byte KrillStatus::KRILL_OK = 0 const byte KrillStatus::KRILL_TOO_MANY_DEVICES = $fc +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const byte OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 const nomodify byte* SCREEN = (byte*) 1024 @@ -663,10 +664,9 @@ const byte* SPRITE[$40] = kickasm {{ .var pic = LoadPicture("sprite.png", List( .byte pic.getSinglecolorByte(x,y) }} const nomodify byte* SPRITES_COLOR = (byte*) 53287 -const nomodify byte* SPRITES_PTR = SCREEN+SPRITE_PTRS +const nomodify byte* SPRITES_PTR = SCREEN+OFFSET_SPRITE_PTRS const nomodify byte* SPRITES_XPOS = (byte*) 53248 const nomodify byte* SPRITES_YPOS = (byte*) 53249 -const nomodify word SPRITE_PTRS = $3f8 const nomodify struct MOS6569_VICII* VICII = (struct MOS6569_VICII*) 53248 byte krill_install() byte krill_install::return @@ -722,7 +722,7 @@ Score: 130 // Global Constants & labels .const KRILL_OK = 0 // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 .const GREEN = 5 .const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 .const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 @@ -732,7 +732,7 @@ Score: 130 // The VIC-II MOS 6567/6569 .label VICII = $d000 .label SCREEN = $400 - .label SPRITES_PTR = SCREEN+SPRITE_PTRS + .label SPRITES_PTR = SCREEN+OFFSET_SPRITE_PTRS .segment Code // main main: { diff --git a/src/test/ref/examples/krillload/krillload.sym b/src/test/ref/examples/krillload/krillload.sym index 71d905c7a..b657d0736 100644 --- a/src/test/ref/examples/krillload/krillload.sym +++ b/src/test/ref/examples/krillload/krillload.sym @@ -10,6 +10,7 @@ const byte KrillStatus::KRILL_FILE_NOT_FOUND = $ff const byte KrillStatus::KRILL_GENERIC_KERNAL_ERROR = $fd const byte KrillStatus::KRILL_OK = 0 const byte KrillStatus::KRILL_TOO_MANY_DEVICES = $fc +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const byte OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20 const byte OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15 const nomodify byte* SCREEN = (byte*) 1024 @@ -19,10 +20,9 @@ const byte* SPRITE[$40] = kickasm {{ .var pic = LoadPicture("sprite.png", List( .byte pic.getSinglecolorByte(x,y) }} const nomodify byte* SPRITES_COLOR = (byte*) 53287 -const nomodify byte* SPRITES_PTR = SCREEN+SPRITE_PTRS +const nomodify byte* SPRITES_PTR = SCREEN+OFFSET_SPRITE_PTRS const nomodify byte* SPRITES_XPOS = (byte*) 53248 const nomodify byte* SPRITES_YPOS = (byte*) 53249 -const nomodify word SPRITE_PTRS = $3f8 const nomodify struct MOS6569_VICII* VICII = (struct MOS6569_VICII*) 53248 byte krill_install() byte krill_install::return diff --git a/src/test/ref/index-sizeof-reuse-2.asm b/src/test/ref/index-sizeof-reuse-2.asm index f70eef5e0..da4518806 100644 --- a/src/test/ref/index-sizeof-reuse-2.asm +++ b/src/test/ref/index-sizeof-reuse-2.asm @@ -7,8 +7,8 @@ .segmentdef Data [startAfter="Code"] .segment Basic :BasicUpstart(main) - .label VIC_RASTER = $d012 - .label VIC_BG_COLOR = $d020 + .label VICII_RASTER = $d012 + .label VICII_BG_COLOR = $d020 .label SCREEN = $400 .segment Code main: { @@ -20,13 +20,13 @@ main: { sei // Wait for raster refresh __b1: - // while(*VIC_RASTER!=0xff) + // while(*VICII_RASTER!=0xff) lda #$ff - cmp VIC_RASTER + cmp VICII_RASTER bne __b1 - // *VIC_BG_COLOR = 0 + // *VICII_BG_COLOR = 0 lda #0 - sta VIC_BG_COLOR + sta VICII_BG_COLOR lda #SCREEN @@ -38,9 +38,9 @@ main: { lda.z i cmp #$19 bcc __b4 - // *VIC_BG_COLOR = 15 + // *VICII_BG_COLOR = 15 lda #$f - sta VIC_BG_COLOR + sta VICII_BG_COLOR jmp __b1 __b4: // line[(char)entities[i]] = ' ' diff --git a/src/test/ref/index-sizeof-reuse-2.cfg b/src/test/ref/index-sizeof-reuse-2.cfg index 09859d3c6..66f68d3b0 100644 --- a/src/test/ref/index-sizeof-reuse-2.cfg +++ b/src/test/ref/index-sizeof-reuse-2.cfg @@ -4,10 +4,10 @@ main: scope:[main] from asm { sei } to:main::@1 main::@1: scope:[main] from main main::@1 main::@5 - [1] if(*VIC_RASTER!=$ff) goto main::@1 + [1] if(*VICII_RASTER!=$ff) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 - [2] *VIC_BG_COLOR = 0 + [2] *VICII_BG_COLOR = 0 to:main::@3 main::@3: scope:[main] from main::@2 main::@6 [3] main::line#2 = phi( main::@2/SCREEN, main::@6/main::line#1 ) @@ -15,7 +15,7 @@ main::@3: scope:[main] from main::@2 main::@6 [4] if(main::i#2<$19) goto main::@4 to:main::@5 main::@5: scope:[main] from main::@3 - [5] *VIC_BG_COLOR = $f + [5] *VICII_BG_COLOR = $f to:main::@1 main::@4: scope:[main] from main::@3 [6] main::$7 = main::i#2 << 1 diff --git a/src/test/ref/index-sizeof-reuse-2.log b/src/test/ref/index-sizeof-reuse-2.log index 94df54a93..f2630bbe2 100644 --- a/src/test/ref/index-sizeof-reuse-2.log +++ b/src/test/ref/index-sizeof-reuse-2.log @@ -10,11 +10,11 @@ main::@1: scope:[main] from main main::@6 if(main::$10) goto main::@2 to:main::@return main::@2: scope:[main] from main::@1 main::@2 - main::$0 = *VIC_RASTER != $ff + main::$0 = *VICII_RASTER != $ff if(main::$0) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@2 - *VIC_BG_COLOR = 0 + *VICII_BG_COLOR = 0 main::line#0 = SCREEN main::i#0 = 0 to:main::@4 @@ -38,7 +38,7 @@ main::@5: scope:[main] from main::@4 if(main::$3) goto main::@7 to:main::@8 main::@6: scope:[main] from main::@4 - *VIC_BG_COLOR = $f + *VICII_BG_COLOR = $f to:main::@1 main::@7: scope:[main] from main::@5 main::@8 main::line#3 = phi( main::@5/main::line#2, main::@8/main::line#5 ) @@ -71,8 +71,8 @@ __start::@return: scope:[__start] from __start::@1 SYMBOL TABLE SSA const nomodify byte* SCREEN = (byte*)$400 const byte SIZEOF_WORD = 2 -const nomodify byte* VIC_BG_COLOR = (byte*)$d020 -const nomodify byte* VIC_RASTER = (byte*)$d012 +const nomodify byte* VICII_BG_COLOR = (byte*)$d020 +const nomodify byte* VICII_RASTER = (byte*)$d012 void __start() const word* entities[$19] = { fill( $19, 0) } void main() @@ -102,17 +102,17 @@ byte* main::line#3 byte* main::line#4 byte* main::line#5 -Adding number conversion cast (unumber) $ff in main::$0 = *VIC_RASTER != $ff -Adding number conversion cast (unumber) 0 in *VIC_BG_COLOR = 0 +Adding number conversion cast (unumber) $ff in main::$0 = *VICII_RASTER != $ff +Adding number conversion cast (unumber) 0 in *VICII_BG_COLOR = 0 Adding number conversion cast (unumber) $19 in main::$1 = main::i#2 < $19 Adding number conversion cast (unumber) 1 in entities[main::$5] = entities[main::$5] + 1 Adding number conversion cast (unumber) $27 in main::$2 = entities[main::$6] > $27 -Adding number conversion cast (unumber) $f in *VIC_BG_COLOR = $f +Adding number conversion cast (unumber) $f in *VICII_BG_COLOR = $f Adding number conversion cast (unumber) $28 in main::line#1 = main::line#3 + $28 Adding number conversion cast (unumber) 0 in entities[main::$8] = 0 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast *VIC_BG_COLOR = (unumber)0 -Inlining cast *VIC_BG_COLOR = (unumber)$f +Inlining cast *VICII_BG_COLOR = (unumber)0 +Inlining cast *VICII_BG_COLOR = (unumber)$f Inlining cast entities[main::$8] = (unumber)0 Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 53266 @@ -148,7 +148,7 @@ Identified duplicate assignment right side [15] main::$5 = main::i#2 * SIZEOF_WO Identified duplicate assignment right side [17] main::$6 = main::i#2 * SIZEOF_WORD Successful SSA optimization Pass2DuplicateRValueIdentification Simple Condition main::$10 [2] if(0!=1) goto main::@2 -Simple Condition main::$0 [4] if(*VIC_RASTER!=$ff) goto main::@2 +Simple Condition main::$0 [4] if(*VICII_RASTER!=$ff) goto main::@2 Simple Condition main::$1 [10] if(main::i#2<$19) goto main::@5 Simple Condition main::$3 [18] if(entities[main::$6]<=$27) goto main::@7 Successful SSA optimization Pass2ConditionalJumpSimplification @@ -219,10 +219,10 @@ main: scope:[main] from asm { sei } to:main::@1 main::@1: scope:[main] from main main::@1 main::@5 - [1] if(*VIC_RASTER!=$ff) goto main::@1 + [1] if(*VICII_RASTER!=$ff) goto main::@1 to:main::@2 main::@2: scope:[main] from main::@1 - [2] *VIC_BG_COLOR = 0 + [2] *VICII_BG_COLOR = 0 to:main::@3 main::@3: scope:[main] from main::@2 main::@6 [3] main::line#2 = phi( main::@2/SCREEN, main::@6/main::line#1 ) @@ -230,7 +230,7 @@ main::@3: scope:[main] from main::@2 main::@6 [4] if(main::i#2<$19) goto main::@4 to:main::@5 main::@5: scope:[main] from main::@3 - [5] *VIC_BG_COLOR = $f + [5] *VICII_BG_COLOR = $f to:main::@1 main::@4: scope:[main] from main::@3 [6] main::$7 = main::i#2 << 1 @@ -280,9 +280,9 @@ Allocated zp[1]:5 [ main::$7 ] Allocated zp[1]:6 [ main::$9 ] Allocated zp[2]:7 [ main::$11 ] REGISTER UPLIFT POTENTIAL REGISTERS -Statement [1] if(*VIC_RASTER!=$ff) goto main::@1 [ ] ( [ ] { } ) always clobbers reg byte a -Statement [2] *VIC_BG_COLOR = 0 [ ] ( [ ] { } ) always clobbers reg byte a -Statement [5] *VIC_BG_COLOR = $f [ ] ( [ ] { } ) always clobbers reg byte a +Statement [1] if(*VICII_RASTER!=$ff) goto main::@1 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [2] *VICII_BG_COLOR = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [5] *VICII_BG_COLOR = $f [ ] ( [ ] { } ) always clobbers reg byte a Statement [6] main::$7 = main::i#2 << 1 [ main::i#2 main::line#2 main::$7 ] ( [ main::i#2 main::line#2 main::$7 ] { } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::i#2 main::i#1 ] Statement [7] main::$9 = (byte)entities[main::$7] [ main::i#2 main::line#2 main::$7 main::$9 ] ( [ main::i#2 main::line#2 main::$7 main::$9 ] { } ) always clobbers reg byte a @@ -294,9 +294,9 @@ Statement [12] main::$11 = main::line#2 + entities[main::$7] [ main::i#2 main::l Statement [13] *main::$11 = '*' [ main::i#2 main::line#2 ] ( [ main::i#2 main::line#2 ] { } ) always clobbers reg byte a reg byte y Removing always clobbered register reg byte y as potential for zp[1]:2 [ main::i#2 main::i#1 ] Statement [14] main::line#1 = main::line#2 + $28 [ main::i#2 main::line#1 ] ( [ main::i#2 main::line#1 ] { } ) always clobbers reg byte a -Statement [1] if(*VIC_RASTER!=$ff) goto main::@1 [ ] ( [ ] { } ) always clobbers reg byte a -Statement [2] *VIC_BG_COLOR = 0 [ ] ( [ ] { } ) always clobbers reg byte a -Statement [5] *VIC_BG_COLOR = $f [ ] ( [ ] { } ) always clobbers reg byte a +Statement [1] if(*VICII_RASTER!=$ff) goto main::@1 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [2] *VICII_BG_COLOR = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [5] *VICII_BG_COLOR = $f [ ] ( [ ] { } ) always clobbers reg byte a Statement [6] main::$7 = main::i#2 << 1 [ main::i#2 main::line#2 main::$7 ] ( [ main::i#2 main::line#2 main::$7 ] { } ) always clobbers reg byte a Statement [7] main::$9 = (byte)entities[main::$7] [ main::i#2 main::line#2 main::$7 main::$9 ] ( [ main::i#2 main::line#2 main::$7 main::$9 ] { } ) always clobbers reg byte a Statement [8] main::line#2[main::$9] = ' ' [ main::i#2 main::line#2 main::$7 ] ( [ main::i#2 main::line#2 main::$7 ] { } ) always clobbers reg byte a @@ -334,8 +334,8 @@ ASSEMBLER BEFORE OPTIMIZATION .segment Basic :BasicUpstart(main) // Global Constants & labels - .label VIC_RASTER = $d012 - .label VIC_BG_COLOR = $d020 + .label VICII_RASTER = $d012 + .label VICII_BG_COLOR = $d020 .label SCREEN = $400 .segment Code // main @@ -350,16 +350,16 @@ main: { // Wait for raster refresh // main::@1 __b1: - // [1] if(*VIC_RASTER!=$ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [1] if(*VICII_RASTER!=$ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff - cmp VIC_RASTER + cmp VICII_RASTER bne __b1 jmp __b2 // main::@2 __b2: - // [2] *VIC_BG_COLOR = 0 -- _deref_pbuc1=vbuc2 + // [2] *VICII_BG_COLOR = 0 -- _deref_pbuc1=vbuc2 lda #0 - sta VIC_BG_COLOR + sta VICII_BG_COLOR // [3] phi from main::@2 to main::@3 [phi:main::@2->main::@3] __b3_from___b2: // [3] phi main::line#2 = SCREEN [phi:main::@2->main::@3#0] -- pbuz1=pbuc1 @@ -380,9 +380,9 @@ main: { jmp __b5 // main::@5 __b5: - // [5] *VIC_BG_COLOR = $f -- _deref_pbuc1=vbuc2 + // [5] *VICII_BG_COLOR = $f -- _deref_pbuc1=vbuc2 lda #$f - sta VIC_BG_COLOR + sta VICII_BG_COLOR jmp __b1 // main::@4 __b4: @@ -474,8 +474,8 @@ Succesful ASM optimization Pass5UnusedLabelElimination FINAL SYMBOL TABLE const nomodify byte* SCREEN = (byte*) 1024 -const nomodify byte* VIC_BG_COLOR = (byte*) 53280 -const nomodify byte* VIC_RASTER = (byte*) 53266 +const nomodify byte* VICII_BG_COLOR = (byte*) 53280 +const nomodify byte* VICII_RASTER = (byte*) 53266 const word* entities[$19] = { fill( $19, 0) } void main() byte*~ main::$11 zp[2]:5 202.0 @@ -510,8 +510,8 @@ Score: 15702 .segment Basic :BasicUpstart(main) // Global Constants & labels - .label VIC_RASTER = $d012 - .label VIC_BG_COLOR = $d020 + .label VICII_RASTER = $d012 + .label VICII_BG_COLOR = $d020 .label SCREEN = $400 .segment Code // main @@ -526,16 +526,16 @@ main: { // Wait for raster refresh // main::@1 __b1: - // while(*VIC_RASTER!=0xff) - // [1] if(*VIC_RASTER!=$ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 + // while(*VICII_RASTER!=0xff) + // [1] if(*VICII_RASTER!=$ff) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff - cmp VIC_RASTER + cmp VICII_RASTER bne __b1 // main::@2 - // *VIC_BG_COLOR = 0 - // [2] *VIC_BG_COLOR = 0 -- _deref_pbuc1=vbuc2 + // *VICII_BG_COLOR = 0 + // [2] *VICII_BG_COLOR = 0 -- _deref_pbuc1=vbuc2 lda #0 - sta VIC_BG_COLOR + sta VICII_BG_COLOR // [3] phi from main::@2 to main::@3 [phi:main::@2->main::@3] // [3] phi main::line#2 = SCREEN [phi:main::@2->main::@3#0] -- pbuz1=pbuc1 lda #SCREEN @@ -48,9 +48,9 @@ main: { lda.z i1 cmp #$19 bcc __b6 - // *VIC_BG_COLOR = 15 + // *VICII_BG_COLOR = 15 lda #$f - sta VIC_BG_COLOR + sta VICII_BG_COLOR jmp __b3 __b6: // line[entities[i].x_pos] = ' ' diff --git a/src/test/ref/index-sizeof-reuse.cfg b/src/test/ref/index-sizeof-reuse.cfg index ce4c272e9..95eb29e23 100644 --- a/src/test/ref/index-sizeof-reuse.cfg +++ b/src/test/ref/index-sizeof-reuse.cfg @@ -9,10 +9,10 @@ main::@1: scope:[main] from main main::@2 [2] if(main::i#2<$19) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 main::@3 main::@7 - [3] if(*VIC_RASTER!=$ff) goto main::@3 + [3] if(*VICII_RASTER!=$ff) goto main::@3 to:main::@4 main::@4: scope:[main] from main::@3 - [4] *VIC_BG_COLOR = 0 + [4] *VICII_BG_COLOR = 0 to:main::@5 main::@5: scope:[main] from main::@4 main::@8 [5] main::line#2 = phi( main::@4/SCREEN, main::@8/main::line#1 ) @@ -20,7 +20,7 @@ main::@5: scope:[main] from main::@4 main::@8 [6] if(main::i1#2<$19) goto main::@6 to:main::@7 main::@7: scope:[main] from main::@5 - [7] *VIC_BG_COLOR = $f + [7] *VICII_BG_COLOR = $f to:main::@3 main::@6: scope:[main] from main::@5 [8] main::$25 = main::i1#2 << 1 diff --git a/src/test/ref/index-sizeof-reuse.log b/src/test/ref/index-sizeof-reuse.log index 831abb5cb..1161f9df6 100644 --- a/src/test/ref/index-sizeof-reuse.log +++ b/src/test/ref/index-sizeof-reuse.log @@ -31,11 +31,11 @@ main::@3: scope:[main] from main::@1 main::@8 if(main::$20) goto main::@4 to:main::@return main::@4: scope:[main] from main::@3 main::@4 - main::$2 = *VIC_RASTER != $ff + main::$2 = *VICII_RASTER != $ff if(main::$2) goto main::@4 to:main::@5 main::@5: scope:[main] from main::@4 - *VIC_BG_COLOR = 0 + *VICII_BG_COLOR = 0 main::line#0 = SCREEN main::i1#0 = 0 to:main::@6 @@ -61,7 +61,7 @@ main::@7: scope:[main] from main::@6 if(main::$7) goto main::@9 to:main::@10 main::@8: scope:[main] from main::@6 - *VIC_BG_COLOR = $f + *VICII_BG_COLOR = $f to:main::@3 main::@9: scope:[main] from main::@10 main::@7 main::line#3 = phi( main::@10/main::line#5, main::@7/main::line#2 ) @@ -101,8 +101,8 @@ const byte OFFSET_STRUCT_ENTITY_X_POS = 0 const byte OFFSET_STRUCT_ENTITY_X_VEL = 1 const nomodify byte* SCREEN = (byte*)$400 const byte SIZEOF_STRUCT_ENTITY = 3 -const nomodify byte* VIC_BG_COLOR = (byte*)$d020 -const nomodify byte* VIC_RASTER = (byte*)$d012 +const nomodify byte* VICII_BG_COLOR = (byte*)$d020 +const nomodify byte* VICII_RASTER = (byte*)$d012 void __start() const struct Entity* entities[$19] = { fill( $19, 0) } void main() @@ -153,16 +153,16 @@ signed byte main::v#2 signed byte main::v#3 Adding number conversion cast (unumber) $19 in main::$0 = main::i#2 < $19 -Adding number conversion cast (unumber) $ff in main::$2 = *VIC_RASTER != $ff -Adding number conversion cast (unumber) 0 in *VIC_BG_COLOR = 0 +Adding number conversion cast (unumber) $ff in main::$2 = *VICII_RASTER != $ff +Adding number conversion cast (unumber) 0 in *VICII_BG_COLOR = 0 Adding number conversion cast (unumber) $19 in main::$3 = main::i1#2 < $19 Adding number conversion cast (snumber) 0 in main::$4 = ((signed byte*)entities+OFFSET_STRUCT_ENTITY_X_POS)[main::$14] < 0 Adding number conversion cast (snumber) $27 in main::$5 = ((signed byte*)entities+OFFSET_STRUCT_ENTITY_X_POS)[main::$15] > $27 -Adding number conversion cast (unumber) $f in *VIC_BG_COLOR = $f +Adding number conversion cast (unumber) $f in *VICII_BG_COLOR = $f Adding number conversion cast (unumber) $28 in main::line#1 = main::line#3 + $28 Successful SSA optimization PassNAddNumberTypeConversions -Inlining cast *VIC_BG_COLOR = (unumber)0 -Inlining cast *VIC_BG_COLOR = (unumber)$f +Inlining cast *VICII_BG_COLOR = (unumber)0 +Inlining cast *VICII_BG_COLOR = (unumber)$f Successful SSA optimization Pass2InlineCast Simplifying constant pointer cast (byte*) 53266 Simplifying constant pointer cast (byte*) 53280 @@ -204,7 +204,7 @@ Identified duplicate assignment right side [49] main::$19 = main::i1#2 * SIZEOF_ Successful SSA optimization Pass2DuplicateRValueIdentification Simple Condition main::$0 [5] if(main::i#2<$19) goto main::@2 Simple Condition main::$20 [15] if(0!=1) goto main::@4 -Simple Condition main::$2 [17] if(*VIC_RASTER!=$ff) goto main::@4 +Simple Condition main::$2 [17] if(*VICII_RASTER!=$ff) goto main::@4 Simple Condition main::$3 [23] if(main::i1#2<$19) goto main::@7 Successful SSA optimization Pass2ConditionalJumpSimplification Rewriting ! if()-condition to reversed if() [33] main::$7 = ! main::$6 @@ -318,10 +318,10 @@ main::@1: scope:[main] from main main::@2 [2] if(main::i#2<$19) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 main::@3 main::@7 - [3] if(*VIC_RASTER!=$ff) goto main::@3 + [3] if(*VICII_RASTER!=$ff) goto main::@3 to:main::@4 main::@4: scope:[main] from main::@3 - [4] *VIC_BG_COLOR = 0 + [4] *VICII_BG_COLOR = 0 to:main::@5 main::@5: scope:[main] from main::@4 main::@8 [5] main::line#2 = phi( main::@4/SCREEN, main::@8/main::line#1 ) @@ -329,7 +329,7 @@ main::@5: scope:[main] from main::@4 main::@8 [6] if(main::i1#2<$19) goto main::@6 to:main::@7 main::@7: scope:[main] from main::@5 - [7] *VIC_BG_COLOR = $f + [7] *VICII_BG_COLOR = $f to:main::@3 main::@6: scope:[main] from main::@5 [8] main::$25 = main::i1#2 << 1 @@ -412,9 +412,9 @@ Allocated zp[1]:9 [ main::$8 ] Allocated zp[1]:10 [ main::$21 ] Allocated zp[1]:11 [ main::$10 ] REGISTER UPLIFT POTENTIAL REGISTERS -Statement [3] if(*VIC_RASTER!=$ff) goto main::@3 [ ] ( [ ] { } ) always clobbers reg byte a -Statement [4] *VIC_BG_COLOR = 0 [ ] ( [ ] { } ) always clobbers reg byte a -Statement [7] *VIC_BG_COLOR = $f [ ] ( [ ] { } ) always clobbers reg byte a +Statement [3] if(*VICII_RASTER!=$ff) goto main::@3 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [4] *VICII_BG_COLOR = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [7] *VICII_BG_COLOR = $f [ ] ( [ ] { } ) always clobbers reg byte a Statement [8] main::$25 = main::i1#2 << 1 [ main::i1#2 main::line#2 main::$25 ] ( [ main::i1#2 main::line#2 main::$25 ] { } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:4 [ main::i1#2 main::i1#1 ] Statement [9] main::$16 = main::$25 + main::i1#2 [ main::i1#2 main::line#2 main::$16 ] ( [ main::i1#2 main::line#2 main::$16 ] { } ) always clobbers reg byte a @@ -438,9 +438,9 @@ Removing always clobbered register reg byte a as potential for zp[1]:11 [ main:: Statement [23] ((signed byte*)entities+OFFSET_STRUCT_ENTITY_X_VEL)[main::$10] = main::v#2 [ main::i#2 main::v#2 main::$10 ] ( [ main::i#2 main::v#2 main::$10 ] { } ) always clobbers reg byte a Statement [24] ((byte*)entities+OFFSET_STRUCT_ENTITY_SYMBOL)[main::$10] = main::i#2 [ main::i#2 main::v#2 ] ( [ main::i#2 main::v#2 ] { } ) always clobbers reg byte a Statement [25] main::v#1 = - main::v#2 [ main::i#2 main::v#1 ] ( [ main::i#2 main::v#1 ] { } ) always clobbers reg byte a -Statement [3] if(*VIC_RASTER!=$ff) goto main::@3 [ ] ( [ ] { } ) always clobbers reg byte a -Statement [4] *VIC_BG_COLOR = 0 [ ] ( [ ] { } ) always clobbers reg byte a -Statement [7] *VIC_BG_COLOR = $f [ ] ( [ ] { } ) always clobbers reg byte a +Statement [3] if(*VICII_RASTER!=$ff) goto main::@3 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [4] *VICII_BG_COLOR = 0 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [7] *VICII_BG_COLOR = $f [ ] ( [ ] { } ) always clobbers reg byte a Statement [8] main::$25 = main::i1#2 << 1 [ main::i1#2 main::line#2 main::$25 ] ( [ main::i1#2 main::line#2 main::$25 ] { } ) always clobbers reg byte a Statement [9] main::$16 = main::$25 + main::i1#2 [ main::i1#2 main::line#2 main::$16 ] ( [ main::i1#2 main::line#2 main::$16 ] { } ) always clobbers reg byte a Statement [10] main::line#2[((signed byte*)entities)[main::$16]] = ' ' [ main::i1#2 main::line#2 main::$16 ] ( [ main::i1#2 main::line#2 main::$16 ] { } ) always clobbers reg byte a reg byte y @@ -505,8 +505,8 @@ ASSEMBLER BEFORE OPTIMIZATION // Global Constants & labels .const OFFSET_STRUCT_ENTITY_X_VEL = 1 .const OFFSET_STRUCT_ENTITY_SYMBOL = 2 - .label VIC_RASTER = $d012 - .label VIC_BG_COLOR = $d020 + .label VICII_RASTER = $d012 + .label VICII_BG_COLOR = $d020 .label SCREEN = $400 .segment Code // main @@ -535,16 +535,16 @@ main: { // Wait for raster refresh // main::@3 __b3: - // [3] if(*VIC_RASTER!=$ff) goto main::@3 -- _deref_pbuc1_neq_vbuc2_then_la1 + // [3] if(*VICII_RASTER!=$ff) goto main::@3 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff - cmp VIC_RASTER + cmp VICII_RASTER bne __b3 jmp __b4 // main::@4 __b4: - // [4] *VIC_BG_COLOR = 0 -- _deref_pbuc1=vbuc2 + // [4] *VICII_BG_COLOR = 0 -- _deref_pbuc1=vbuc2 lda #0 - sta VIC_BG_COLOR + sta VICII_BG_COLOR // [5] phi from main::@4 to main::@5 [phi:main::@4->main::@5] __b5_from___b4: // [5] phi main::line#2 = SCREEN [phi:main::@4->main::@5#0] -- pbuz1=pbuc1 @@ -565,9 +565,9 @@ main: { jmp __b7 // main::@7 __b7: - // [7] *VIC_BG_COLOR = $f -- _deref_pbuc1=vbuc2 + // [7] *VICII_BG_COLOR = $f -- _deref_pbuc1=vbuc2 lda #$f - sta VIC_BG_COLOR + sta VICII_BG_COLOR jmp __b3 // main::@6 __b6: @@ -703,8 +703,8 @@ FINAL SYMBOL TABLE const byte OFFSET_STRUCT_ENTITY_SYMBOL = 2 const byte OFFSET_STRUCT_ENTITY_X_VEL = 1 const nomodify byte* SCREEN = (byte*) 1024 -const nomodify byte* VIC_BG_COLOR = (byte*) 53280 -const nomodify byte* VIC_RASTER = (byte*) 53266 +const nomodify byte* VICII_BG_COLOR = (byte*) 53280 +const nomodify byte* VICII_RASTER = (byte*) 53266 const struct Entity* entities[$19] = { fill( $19, 0) } void main() byte~ main::$10 reg byte y 14.666666666666666 @@ -753,8 +753,8 @@ Score: 17597 // Global Constants & labels .const OFFSET_STRUCT_ENTITY_X_VEL = 1 .const OFFSET_STRUCT_ENTITY_SYMBOL = 2 - .label VIC_RASTER = $d012 - .label VIC_BG_COLOR = $d020 + .label VICII_RASTER = $d012 + .label VICII_BG_COLOR = $d020 .label SCREEN = $400 .segment Code // main @@ -782,16 +782,16 @@ main: { // Wait for raster refresh // main::@3 __b3: - // while(*VIC_RASTER!=0xff) - // [3] if(*VIC_RASTER!=$ff) goto main::@3 -- _deref_pbuc1_neq_vbuc2_then_la1 + // while(*VICII_RASTER!=0xff) + // [3] if(*VICII_RASTER!=$ff) goto main::@3 -- _deref_pbuc1_neq_vbuc2_then_la1 lda #$ff - cmp VIC_RASTER + cmp VICII_RASTER bne __b3 // main::@4 - // *VIC_BG_COLOR = 0 - // [4] *VIC_BG_COLOR = 0 -- _deref_pbuc1=vbuc2 + // *VICII_BG_COLOR = 0 + // [4] *VICII_BG_COLOR = 0 -- _deref_pbuc1=vbuc2 lda #0 - sta VIC_BG_COLOR + sta VICII_BG_COLOR // [5] phi from main::@4 to main::@5 [phi:main::@4->main::@5] // [5] phi main::line#2 = SCREEN [phi:main::@4->main::@5#0] -- pbuz1=pbuc1 lda # $32 @@ -162,7 +162,7 @@ void main() main: scope:[main] from asm { sei } [7] *CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR - [8] *VIC_CONTROL = *VIC_CONTROL & $7f + [8] *VICII_CONTROL = *VICII_CONTROL & $7f [9] *RASTER = $fd [10] *IRQ_ENABLE = IRQ_RASTER [11] *KERNEL_IRQ = &irq @@ -186,7 +186,7 @@ REGISTER UPLIFT POTENTIAL REGISTERS Statement [1] *IRQ_STATUS = IRQ_RASTER [ ] ( [ ] { } ) always clobbers reg byte a Statement [2] if(*RASTER<$32+1) goto irq::@1 [ ] ( [ ] { } ) always clobbers reg byte a Statement [7] *CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR [ ] ( [ ] { } ) always clobbers reg byte a -Statement [8] *VIC_CONTROL = *VIC_CONTROL & $7f [ ] ( [ ] { } ) always clobbers reg byte a +Statement [8] *VICII_CONTROL = *VICII_CONTROL & $7f [ ] ( [ ] { } ) always clobbers reg byte a Statement [9] *RASTER = $fd [ ] ( [ ] { } ) always clobbers reg byte a Statement [10] *IRQ_ENABLE = IRQ_RASTER [ ] ( [ ] { } ) always clobbers reg byte a Statement [11] *KERNEL_IRQ = &irq [ ] ( [ ] { } ) always clobbers reg byte a @@ -219,7 +219,7 @@ ASSEMBLER BEFORE OPTIMIZATION .const CIA_INTERRUPT_CLEAR = $7f .label KERNEL_IRQ = $314 .label RASTER = $d012 - .label VIC_CONTROL = $d011 + .label VICII_CONTROL = $d011 .label IRQ_STATUS = $d019 .label IRQ_ENABLE = $d01a .label BG_COLOR = $d020 @@ -262,11 +262,11 @@ main: { // Disable CIA 1 Timer IRQ lda #CIA_INTERRUPT_CLEAR sta CIA1_INTERRUPT - // [8] *VIC_CONTROL = *VIC_CONTROL & $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [8] *VICII_CONTROL = *VICII_CONTROL & $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 // Set raster line to $0fd lda #$7f - and VIC_CONTROL - sta VIC_CONTROL + and VICII_CONTROL + sta VICII_CONTROL // [9] *RASTER = $fd -- _deref_pbuc1=vbuc2 lda #$fd sta RASTER @@ -326,7 +326,7 @@ const nomodify byte IRQ_RASTER = 1 const nomodify byte* IRQ_STATUS = (byte*) 53273 const nomodify void()** KERNEL_IRQ = (void()**) 788 const nomodify byte* RASTER = (byte*) 53266 -const nomodify byte* VIC_CONTROL = (byte*) 53265 +const nomodify byte* VICII_CONTROL = (byte*) 53265 __interrupt(rom_min_c64) void irq() void main() @@ -352,7 +352,7 @@ Score: 978 .const CIA_INTERRUPT_CLEAR = $7f .label KERNEL_IRQ = $314 .label RASTER = $d012 - .label VIC_CONTROL = $d011 + .label VICII_CONTROL = $d011 .label IRQ_STATUS = $d019 .label IRQ_ENABLE = $d01a .label BG_COLOR = $d020 @@ -394,12 +394,12 @@ main: { // Disable CIA 1 Timer IRQ lda #CIA_INTERRUPT_CLEAR sta CIA1_INTERRUPT - // *VIC_CONTROL &=$7f - // [8] *VIC_CONTROL = *VIC_CONTROL & $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // *VICII_CONTROL &=$7f + // [8] *VICII_CONTROL = *VICII_CONTROL & $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 // Set raster line to $0fd lda #$7f - and VIC_CONTROL - sta VIC_CONTROL + and VICII_CONTROL + sta VICII_CONTROL // *RASTER = $fd // [9] *RASTER = $fd -- _deref_pbuc1=vbuc2 lda #$fd diff --git a/src/test/ref/irq-volatile-bool-problem.sym b/src/test/ref/irq-volatile-bool-problem.sym index 988a17182..7273b0c37 100644 --- a/src/test/ref/irq-volatile-bool-problem.sym +++ b/src/test/ref/irq-volatile-bool-problem.sym @@ -6,7 +6,7 @@ const nomodify byte IRQ_RASTER = 1 const nomodify byte* IRQ_STATUS = (byte*) 53273 const nomodify void()** KERNEL_IRQ = (void()**) 788 const nomodify byte* RASTER = (byte*) 53266 -const nomodify byte* VIC_CONTROL = (byte*) 53265 +const nomodify byte* VICII_CONTROL = (byte*) 53265 __interrupt(rom_min_c64) void irq() void main() diff --git a/src/test/ref/norom-charset.asm b/src/test/ref/norom-charset.asm index 796b3f5ff..15cbce937 100644 --- a/src/test/ref/norom-charset.asm +++ b/src/test/ref/norom-charset.asm @@ -7,7 +7,7 @@ .segmentdef Data [startAfter="Code"] .segment Basic :BasicUpstart(main) - .label VIC_MEMORY = $d018 + .label VICII_MEMORY = $d018 .label SCREEN = $400 .label CHARSET = $3000 .segment Code @@ -25,9 +25,9 @@ main: { lda #4 cmp.z c bne __b2 - // *VIC_MEMORY = (byte)(((word)SCREEN/$40)|((word)CHARSET/$400)) + // *VICII_MEMORY = (byte)(((word)SCREEN/$40)|((word)CHARSET/$400)) lda #SCREEN/$40|CHARSET/$400 - sta VIC_MEMORY + sta VICII_MEMORY // } rts __b2: diff --git a/src/test/ref/norom-charset.cfg b/src/test/ref/norom-charset.cfg index 54b1435ab..bea349047 100644 --- a/src/test/ref/norom-charset.cfg +++ b/src/test/ref/norom-charset.cfg @@ -9,7 +9,7 @@ main::@1: scope:[main] from main main::@4 [2] if(main::c#2!=4) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 - [3] *VIC_MEMORY = (byte)(word)SCREEN/$40|(word)CHARSET/$400 + [3] *VICII_MEMORY = (byte)(word)SCREEN/$40|(word)CHARSET/$400 to:main::@return main::@return: scope:[main] from main::@3 [4] return diff --git a/src/test/ref/norom-charset.log b/src/test/ref/norom-charset.log index ca0f26ee9..b9f11a586 100644 --- a/src/test/ref/norom-charset.log +++ b/src/test/ref/norom-charset.log @@ -35,7 +35,7 @@ main::@3: scope:[main] from main::@1 main::$9 = (word)CHARSET main::$2 = main::$9 / $400 main::$3 = main::$1 | main::$2 - *VIC_MEMORY = (byte)main::$3 + *VICII_MEMORY = (byte)main::$3 to:main::@return main::@return: scope:[main] from main::@3 return @@ -121,7 +121,7 @@ SYMBOL TABLE SSA const byte* CHARSET = (byte*)$3000 const byte* SCREEN = (byte*)$400 const byte SIZEOF_WORD = 2 -const byte* VIC_MEMORY = (byte*)$d018 +const byte* VICII_MEMORY = (byte*)$d018 void __start() const word* charset_spec_row[] = { $f7da, $f7de, $f24e, $d6de } void gen_char3(byte* gen_char3::dst , word gen_char3::spec) @@ -322,7 +322,7 @@ Constant right-side identified [8] main::$3 = main::$1 | main::$2 Successful SSA optimization Pass2ConstantRValueConsolidation Constant main::$3 = main::$1|main::$2 Successful SSA optimization Pass2ConstantIdentification -Constant value identified (byte)main::$3 in [9] *VIC_MEMORY = (byte)main::$3 +Constant value identified (byte)main::$3 in [9] *VICII_MEMORY = (byte)main::$3 Successful SSA optimization Pass2ConstantValues Rewriting multiplication to use shift [2] main::$7 = main::c#2 * SIZEOF_WORD Rewriting multiplication to use shift [16] gen_char3::b#1 = gen_char3::b#3 * 2 @@ -384,7 +384,7 @@ main::@1: scope:[main] from main main::@4 [2] if(main::c#2!=4) goto main::@2 to:main::@3 main::@3: scope:[main] from main::@1 - [3] *VIC_MEMORY = (byte)(word)SCREEN/$40|(word)CHARSET/$400 + [3] *VICII_MEMORY = (byte)(word)SCREEN/$40|(word)CHARSET/$400 to:main::@return main::@return: scope:[main] from main::@3 [4] return @@ -500,7 +500,7 @@ Allocated zp[2]:11 [ gen_char3::dst#0 ] Allocated zp[1]:13 [ gen_char3::$0 ] Allocated zp[1]:14 [ gen_char3::$1 ] REGISTER UPLIFT POTENTIAL REGISTERS -Statement [3] *VIC_MEMORY = (byte)(word)SCREEN/$40|(word)CHARSET/$400 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [3] *VICII_MEMORY = (byte)(word)SCREEN/$40|(word)CHARSET/$400 [ ] ( [ ] { } ) always clobbers reg byte a Statement [5] main::$7 = main::c#2 << 1 [ main::c#2 main::charset#2 main::$7 ] ( [ main::c#2 main::charset#2 main::$7 ] { { gen_char3::dst#0 = main::charset#2 } } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::c#2 main::c#1 ] Statement [6] gen_char3::dst#0 = main::charset#2 [ main::c#2 main::charset#2 main::$7 gen_char3::dst#0 ] ( [ main::c#2 main::charset#2 main::$7 gen_char3::dst#0 ] { { gen_char3::dst#0 = main::charset#2 } } ) always clobbers reg byte a @@ -510,7 +510,7 @@ Statement [9] main::charset#1 = main::charset#2 + 8 [ main::c#2 main::charset#1 Statement [17] gen_char3::b#2 = gen_char3::b#4 | 1 [ gen_char3::dst#0 gen_char3::r#6 gen_char3::spec#2 gen_char3::c#2 gen_char3::b#2 ] ( gen_char3:8 [ main::c#2 main::charset#2 gen_char3::dst#0 gen_char3::r#6 gen_char3::spec#2 gen_char3::c#2 gen_char3::b#2 ] { { gen_char3::dst#0 = main::charset#2 } } ) always clobbers reg byte a Removing always clobbered register reg byte a as potential for zp[1]:5 [ gen_char3::r#6 gen_char3::r#1 ] Removing always clobbered register reg byte a as potential for zp[1]:8 [ gen_char3::c#2 gen_char3::c#1 ] -Statement [3] *VIC_MEMORY = (byte)(word)SCREEN/$40|(word)CHARSET/$400 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [3] *VICII_MEMORY = (byte)(word)SCREEN/$40|(word)CHARSET/$400 [ ] ( [ ] { } ) always clobbers reg byte a Statement [5] main::$7 = main::c#2 << 1 [ main::c#2 main::charset#2 main::$7 ] ( [ main::c#2 main::charset#2 main::$7 ] { { gen_char3::dst#0 = main::charset#2 } } ) always clobbers reg byte a Statement [6] gen_char3::dst#0 = main::charset#2 [ main::c#2 main::charset#2 main::$7 gen_char3::dst#0 ] ( [ main::c#2 main::charset#2 main::$7 gen_char3::dst#0 ] { { gen_char3::dst#0 = main::charset#2 } } ) always clobbers reg byte a Statement [7] gen_char3::spec#0 = charset_spec_row[main::$7] [ main::c#2 main::charset#2 gen_char3::dst#0 gen_char3::spec#0 ] ( [ main::c#2 main::charset#2 gen_char3::dst#0 gen_char3::spec#0 ] { { gen_char3::dst#0 = main::charset#2 } } ) always clobbers reg byte a @@ -555,7 +555,7 @@ ASSEMBLER BEFORE OPTIMIZATION .segment Basic :BasicUpstart(main) // Global Constants & labels - .label VIC_MEMORY = $d018 + .label VICII_MEMORY = $d018 .label SCREEN = $400 .label CHARSET = $3000 .segment Code @@ -583,9 +583,9 @@ main: { jmp __b3 // main::@3 __b3: - // [3] *VIC_MEMORY = (byte)(word)SCREEN/$40|(word)CHARSET/$400 -- _deref_pbuc1=vbuc2 + // [3] *VICII_MEMORY = (byte)(word)SCREEN/$40|(word)CHARSET/$400 -- _deref_pbuc1=vbuc2 lda #SCREEN/$40|CHARSET/$400 - sta VIC_MEMORY + sta VICII_MEMORY jmp __breturn // main::@return __breturn: @@ -761,7 +761,7 @@ Succesful ASM optimization Pass5NextJumpElimination FINAL SYMBOL TABLE const byte* CHARSET = (byte*) 12288 const byte* SCREEN = (byte*) 1024 -const byte* VIC_MEMORY = (byte*) 53272 +const byte* VICII_MEMORY = (byte*) 53272 const word* charset_spec_row[] = { $f7da, $f7de, $f24e, $d6de } void gen_char3(byte* gen_char3::dst , word gen_char3::spec) byte~ gen_char3::$0 reg byte a 200002.0 @@ -819,7 +819,7 @@ Score: 45574 .segment Basic :BasicUpstart(main) // Global Constants & labels - .label VIC_MEMORY = $d018 + .label VICII_MEMORY = $d018 .label SCREEN = $400 .label CHARSET = $3000 .segment Code @@ -844,10 +844,10 @@ main: { cmp.z c bne __b2 // main::@3 - // *VIC_MEMORY = (byte)(((word)SCREEN/$40)|((word)CHARSET/$400)) - // [3] *VIC_MEMORY = (byte)(word)SCREEN/$40|(word)CHARSET/$400 -- _deref_pbuc1=vbuc2 + // *VICII_MEMORY = (byte)(((word)SCREEN/$40)|((word)CHARSET/$400)) + // [3] *VICII_MEMORY = (byte)(word)SCREEN/$40|(word)CHARSET/$400 -- _deref_pbuc1=vbuc2 lda #SCREEN/$40|CHARSET/$400 - sta VIC_MEMORY + sta VICII_MEMORY // main::@return // } // [4] return diff --git a/src/test/ref/norom-charset.sym b/src/test/ref/norom-charset.sym index 314b8f148..8e9d45a9f 100644 --- a/src/test/ref/norom-charset.sym +++ b/src/test/ref/norom-charset.sym @@ -1,6 +1,6 @@ const byte* CHARSET = (byte*) 12288 const byte* SCREEN = (byte*) 1024 -const byte* VIC_MEMORY = (byte*) 53272 +const byte* VICII_MEMORY = (byte*) 53272 const word* charset_spec_row[] = { $f7da, $f7de, $f24e, $d6de } void gen_char3(byte* gen_char3::dst , word gen_char3::spec) byte~ gen_char3::$0 reg byte a 200002.0 diff --git a/src/test/ref/zeropage-sinus.asm b/src/test/ref/zeropage-sinus.asm index b4e014e2a..8db79b1ea 100644 --- a/src/test/ref/zeropage-sinus.asm +++ b/src/test/ref/zeropage-sinus.asm @@ -9,7 +9,7 @@ .segment Basic :BasicUpstart(main) // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 .label SPRITES_XPOS = $d000 .label SPRITES_YPOS = $d001 .label SPRITES_ENABLE = $d015 @@ -28,9 +28,9 @@ main: { sta SPRITES_YPOS // SPRITES_XPOS[0] = 100 sta SPRITES_XPOS - // *(SCREEN+SPRITE_PTRS) = (byte)(SPRITE/0x40) + // *(SCREEN+OFFSET_SPRITE_PTRS) = (byte)(SPRITE/0x40) lda #$ff&SPRITE/$40 - sta SCREEN+SPRITE_PTRS + sta SCREEN+OFFSET_SPRITE_PTRS // saveZeropage() jsr saveZeropage // sinZeropage() diff --git a/src/test/ref/zeropage-sinus.cfg b/src/test/ref/zeropage-sinus.cfg index 6e360bd70..b8023dd12 100644 --- a/src/test/ref/zeropage-sinus.cfg +++ b/src/test/ref/zeropage-sinus.cfg @@ -5,7 +5,7 @@ main: scope:[main] from [1] *SPRITES_ENABLE = 1 [2] *SPRITES_YPOS = $64 [3] *SPRITES_XPOS = $64 - [4] *(SCREEN+SPRITE_PTRS) = (byte)SPRITE/$40 + [4] *(SCREEN+OFFSET_SPRITE_PTRS) = (byte)SPRITE/$40 [5] call saveZeropage to:main::@1 main::@1: scope:[main] from main diff --git a/src/test/ref/zeropage-sinus.log b/src/test/ref/zeropage-sinus.log index 42bebcf51..3e4994c78 100644 --- a/src/test/ref/zeropage-sinus.log +++ b/src/test/ref/zeropage-sinus.log @@ -8,7 +8,7 @@ main: scope:[main] from __start *SPRITES_ENABLE = 1 SPRITES_YPOS[0] = $64 SPRITES_XPOS[0] = $64 - *(SCREEN+SPRITE_PTRS) = (byte)SPRITE/$40 + *(SCREEN+OFFSET_SPRITE_PTRS) = (byte)SPRITE/$40 call saveZeropage to:main::@1 main::@1: scope:[main] from main @@ -89,6 +89,7 @@ __start::@return: scope:[__start] from __start::@1 to:@return SYMBOL TABLE SSA +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const nomodify byte* SCREEN = (byte*)$400 const to_nomodify byte* SINTABLE[$100] = kickasm {{ .for(var i=0;i<$100;i++) .byte round(127.5+127.5*cos(toRadians(360*i/256))) @@ -97,7 +98,6 @@ const to_nomodify byte* SPRITE[$40] = kickasm {{ .fill $40,$ff }} const nomodify byte* SPRITES_ENABLE = (byte*)$d015 const nomodify byte* SPRITES_XPOS = (byte*)$d000 const nomodify byte* SPRITES_YPOS = (byte*)$d001 -const nomodify word SPRITE_PTRS = $3f8 const to_nomodify byte* ZP_STORAGE[$100] = { fill( $100, 0) } void __start() void animSprite() @@ -111,7 +111,7 @@ Adding number conversion cast (unumber) $64 in SPRITES_YPOS[0] = $64 Adding number conversion cast (unumber) 0 in SPRITES_YPOS[0] = ((unumber)) $64 Adding number conversion cast (unumber) $64 in SPRITES_XPOS[0] = $64 Adding number conversion cast (unumber) 0 in SPRITES_XPOS[0] = ((unumber)) $64 -Adding number conversion cast (unumber) $40 in *(SCREEN+SPRITE_PTRS) = (byte)SPRITE/$40 +Adding number conversion cast (unumber) $40 in *(SCREEN+OFFSET_SPRITE_PTRS) = (byte)SPRITE/$40 Successful SSA optimization PassNAddNumberTypeConversions Inlining cast *SPRITES_ENABLE = (unumber)1 Inlining cast SPRITES_YPOS[(unumber)0] = (unumber)$64 @@ -170,7 +170,7 @@ main: scope:[main] from [1] *SPRITES_ENABLE = 1 [2] *SPRITES_YPOS = $64 [3] *SPRITES_XPOS = $64 - [4] *(SCREEN+SPRITE_PTRS) = (byte)SPRITE/$40 + [4] *(SCREEN+OFFSET_SPRITE_PTRS) = (byte)SPRITE/$40 [5] call saveZeropage to:main::@1 main::@1: scope:[main] from main @@ -255,7 +255,7 @@ REGISTER UPLIFT POTENTIAL REGISTERS Statement [1] *SPRITES_ENABLE = 1 [ ] ( [ ] { } ) always clobbers reg byte a Statement [2] *SPRITES_YPOS = $64 [ ] ( [ ] { } ) always clobbers reg byte a Statement [3] *SPRITES_XPOS = $64 [ ] ( [ ] { } ) always clobbers reg byte a -Statement [4] *(SCREEN+SPRITE_PTRS) = (byte)SPRITE/$40 [ ] ( [ ] { } ) always clobbers reg byte a +Statement [4] *(SCREEN+OFFSET_SPRITE_PTRS) = (byte)SPRITE/$40 [ ] ( [ ] { } ) always clobbers reg byte a Statement asm { ldx#0 !: lda$00,x staZP_STORAGE,x inx bne!- } always clobbers reg byte a reg byte x Statement asm { ldx#0 !: ldaSINTABLE,x sta$00,x inx bne!- } always clobbers reg byte a reg byte x Statement asm { ldx#0 !: ldaZP_STORAGE,x sta$00,x inx bne!- } always clobbers reg byte a reg byte x @@ -296,7 +296,7 @@ ASSEMBLER BEFORE OPTIMIZATION :BasicUpstart(main) // Global Constants & labels // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 .label SPRITES_XPOS = $d000 .label SPRITES_YPOS = $d001 .label SPRITES_ENABLE = $d015 @@ -317,9 +317,9 @@ main: { // [3] *SPRITES_XPOS = $64 -- _deref_pbuc1=vbuc2 lda #$64 sta SPRITES_XPOS - // [4] *(SCREEN+SPRITE_PTRS) = (byte)SPRITE/$40 -- _deref_pbuc1=vbuc2 + // [4] *(SCREEN+OFFSET_SPRITE_PTRS) = (byte)SPRITE/$40 -- _deref_pbuc1=vbuc2 lda #$ff&SPRITE/$40 - sta SCREEN+SPRITE_PTRS + sta SCREEN+OFFSET_SPRITE_PTRS // [5] call saveZeropage jsr saveZeropage // [6] phi from main to main::@1 [phi:main->main::@1] @@ -471,6 +471,7 @@ Removing instruction __breturn: Succesful ASM optimization Pass5UnusedLabelElimination FINAL SYMBOL TABLE +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const nomodify byte* SCREEN = (byte*) 1024 const to_nomodify byte* SINTABLE[$100] = kickasm {{ .for(var i=0;i<$100;i++) .byte round(127.5+127.5*cos(toRadians(360*i/256))) @@ -479,7 +480,6 @@ const to_nomodify byte* SPRITE[$40] = kickasm {{ .fill $40,$ff }} const nomodify byte* SPRITES_ENABLE = (byte*) 53269 const nomodify byte* SPRITES_XPOS = (byte*) 53248 const nomodify byte* SPRITES_YPOS = (byte*) 53249 -const nomodify word SPRITE_PTRS = $3f8 const to_nomodify byte* ZP_STORAGE[$100] = { fill( $100, 0) } void animSprite() void main() @@ -506,7 +506,7 @@ Score: 379 :BasicUpstart(main) // Global Constants & labels // The offset of the sprite pointers from the screen start address - .const SPRITE_PTRS = $3f8 + .const OFFSET_SPRITE_PTRS = $3f8 .label SPRITES_XPOS = $d000 .label SPRITES_YPOS = $d001 .label SPRITES_ENABLE = $d015 @@ -530,10 +530,10 @@ main: { // SPRITES_XPOS[0] = 100 // [3] *SPRITES_XPOS = $64 -- _deref_pbuc1=vbuc2 sta SPRITES_XPOS - // *(SCREEN+SPRITE_PTRS) = (byte)(SPRITE/0x40) - // [4] *(SCREEN+SPRITE_PTRS) = (byte)SPRITE/$40 -- _deref_pbuc1=vbuc2 + // *(SCREEN+OFFSET_SPRITE_PTRS) = (byte)(SPRITE/0x40) + // [4] *(SCREEN+OFFSET_SPRITE_PTRS) = (byte)SPRITE/$40 -- _deref_pbuc1=vbuc2 lda #$ff&SPRITE/$40 - sta SCREEN+SPRITE_PTRS + sta SCREEN+OFFSET_SPRITE_PTRS // saveZeropage() // [5] call saveZeropage jsr saveZeropage diff --git a/src/test/ref/zeropage-sinus.sym b/src/test/ref/zeropage-sinus.sym index 4d5ff9b47..40a881044 100644 --- a/src/test/ref/zeropage-sinus.sym +++ b/src/test/ref/zeropage-sinus.sym @@ -1,3 +1,4 @@ +const nomodify word OFFSET_SPRITE_PTRS = $3f8 const nomodify byte* SCREEN = (byte*) 1024 const to_nomodify byte* SINTABLE[$100] = kickasm {{ .for(var i=0;i<$100;i++) .byte round(127.5+127.5*cos(toRadians(360*i/256))) @@ -6,7 +7,6 @@ const to_nomodify byte* SPRITE[$40] = kickasm {{ .fill $40,$ff }} const nomodify byte* SPRITES_ENABLE = (byte*) 53269 const nomodify byte* SPRITES_XPOS = (byte*) 53248 const nomodify byte* SPRITES_YPOS = (byte*) 53249 -const nomodify word SPRITE_PTRS = $3f8 const to_nomodify byte* ZP_STORAGE[$100] = { fill( $100, 0) } void animSprite() void main()