1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2025-02-19 08:31:01 +00:00

Improved equality of constants. Moved more VIC-II variabes into struct.

This commit is contained in:
jespergravgaard 2020-04-29 07:53:45 +02:00
parent 0a9cee999d
commit bc85b3c0d1
132 changed files with 9462 additions and 9388 deletions

View File

@ -6,6 +6,8 @@ import dk.camelot64.kickc.model.operators.Operators;
import dk.camelot64.kickc.model.symbols.ProgramScope;
import dk.camelot64.kickc.model.types.SymbolType;
import java.util.Objects;
/** A Cast of a constant that requires no actual operation.
* The types have the same size and the code will execute as if the value already had the type cast to.
* Examples: byte to/from signed byte, word to/from sighed word.
@ -61,4 +63,18 @@ public class ConstantCastValue implements ConstantValue {
public String toString() {
return toString(null);
}
@Override
public boolean equals(Object o) {
if(this == o) return true;
if(o == null || getClass() != o.getClass()) return false;
ConstantCastValue that = (ConstantCastValue) o;
return toType.equals(that.toType) &&
value.equals(that.value);
}
@Override
public int hashCode() {
return Objects.hash(toType, value);
}
}

View File

@ -88,7 +88,6 @@ public class ConstantSymbolPointer implements ConstantValue {
@Override
public int hashCode() {
return Objects.hash(toSymbol);
}
}

View File

@ -2,6 +2,8 @@ package dk.camelot64.kickc.model.values;
import dk.camelot64.kickc.model.Program;
import java.util.Objects;
/** A dereferenced pointer (based on a variable or a constant pointer) */
public class PointerDereferenceSimple implements PointerDereference {
@ -29,4 +31,16 @@ public class PointerDereferenceSimple implements PointerDereference {
return "*(" + pointer.toString(program) + ')';
}
@Override
public boolean equals(Object o) {
if(this == o) return true;
if(o == null || getClass() != o.getClass()) return false;
PointerDereferenceSimple that = (PointerDereferenceSimple) o;
return pointer.equals(that.pointer);
}
@Override
public int hashCode() {
return Objects.hash(pointer);
}
}

View File

@ -87,6 +87,3 @@ void sid_rnd_init();
// Get a random number from the SID voice 3,
// Must be initialized with sid_rnd_init()
char sid_rnd();

View File

@ -55,15 +55,15 @@ signed char sz = 0;
void anim() {
while(true) {
while(*RASTER!=$ff) {}
while(*RASTER!=$fe) {}
while(*RASTER!=$fd) {}
(*BORDERCOL)++;
while(VICII->RASTER!=$ff) {}
while(VICII->RASTER!=$fe) {}
while(VICII->RASTER!=$fd) {}
(VICII->BORDER_COLOR)++;
//calculate_matrix_16(sx,sy,sz);
calculate_matrix(sx,sy,sz);
store_matrix();
for(char i: 0..7) {
(*BORDERCOL)++;
(VICII->BORDER_COLOR)++;
rotate_matrix(xs[i], ys[i], zs[i]);
xrs[i] = *xr;
yrs[i] = *yr;
@ -75,9 +75,9 @@ void anim() {
SPRITES_XPOS[i2] = $80+(char)((*xp));
SPRITES_YPOS[i2] = $80+(char)((*yp));
}
*BORDERCOL = LIGHT_GREY;
VICII->BORDER_COLOR = LIGHT_GREY;
debug_print();
*BORDERCOL = LIGHT_BLUE;
VICII->BORDER_COLOR = LIGHT_BLUE;
// Increment angles
sx +=2;
sy -=3;
@ -157,7 +157,7 @@ void debug_print() {
// Initialize sprites
void sprites_init() {
char* SCREEN = $400;
*SPRITES_ENABLE = %11111111;
VICII->SPRITES_ENABLE = %11111111;
char* sprites_ptr = SCREEN+$3f8;
for(char i: 0..7) {
sprites_ptr[i] = (char)(SPRITE/$40);

View File

@ -9,8 +9,8 @@ char lines_y[] = { 10, 40, 60, 80, 110, 80, 60, 40, 10 };
char lines_cnt = 8;
void main() {
*BORDERCOL = 0;
*BGCOL = 0;
VICII->BORDER_COLOR = 0;
VICII->BG_COLOR = 0;
*D011 = VIC_BMM|VIC_DEN|VIC_RSEL|3;
*VIC_MEMORY = (char)((((unsigned int)SCREEN&$3fff)/$40)|(((unsigned int)BITMAP&$3fff)/$400));
bitmap_init(BITMAP);

View File

@ -13,8 +13,8 @@ unsigned char* CHARSET = 0x3000;
void main() {
asm { sei }
*BORDERCOL = BLACK;
*BGCOL = BLACK;
VICII->BORDER_COLOR = BLACK;
VICII->BG_COLOR = BLACK;
fillscreen(BUFFER, 00);
fillscreen(SCREEN1, 00);
fillscreen(SCREEN2, 00);

View File

@ -9,10 +9,10 @@ void main() {
// Disable CIA 1 Timer IRQ
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to $fa
*VIC_CONTROL &=$7f;
*RASTER = $fa;
VICII->CONTROL1 &=$7f;
VICII->RASTER = $fa;
// Enable Raster Interrupt
*IRQ_ENABLE = IRQ_RASTER;
VICII->IRQ_ENABLE = IRQ_RASTER;
// Set the IRQ routine
*KERNEL_IRQ = &irq_bottom_1;
asm { cli }
@ -20,26 +20,26 @@ void main() {
// Interrupt Routine 1
interrupt(kernel_min) void irq_bottom_1() {
*BORDERCOL = WHITE;
VICII->BORDER_COLOR = WHITE;
// Set screen height to 24 lines - this is done after the border should have started drawing - so it wont start
*VIC_CONTROL &= ($ff^VIC_RSEL);
VICII->CONTROL1 &= ($ff^VIC_RSEL);
// Acknowledge the IRQ
*IRQ_STATUS = IRQ_RASTER;
VICII->IRQ_STATUS = IRQ_RASTER;
// Trigger IRQ 2 at line $fd
*RASTER = $fd;
VICII->RASTER = $fd;
*KERNEL_IRQ = &irq_bottom_2;
*BORDERCOL = RED;
VICII->BORDER_COLOR = RED;
}
// Interrupt Routine 2
interrupt(kernel_keyboard) void irq_bottom_2() {
*BORDERCOL = WHITE;
VICII->BORDER_COLOR = WHITE;
// Set screen height back to 25 lines (preparing for the next screen)
*VIC_CONTROL |= VIC_RSEL;
VICII->CONTROL1 |= VIC_RSEL;
// Acknowledge the IRQ
*IRQ_STATUS = IRQ_RASTER;
VICII->IRQ_STATUS = IRQ_RASTER;
// Trigger IRQ 1 at line $fa
*RASTER = $fa;
VICII->RASTER = $fa;
*KERNEL_IRQ = &irq_bottom_1;
*BORDERCOL = RED;
VICII->BORDER_COLOR = RED;
}

View File

@ -28,11 +28,11 @@ void main() {
// Load sprite file into memory
char status = loadFileToMemory(8, "SPRITE", LOAD_SPRITE);
if(status!=0xff) {
*BORDERCOL = 0x02;
VICII->BORDER_COLOR = 0x02;
error(status);
}
// Show the loaded sprite on screen
*SPRITES_ENABLE = %00000001;
VICII->SPRITES_ENABLE = %00000001;
SPRITES_PTR[0] = toSpritePtr(LOAD_SPRITE);
SPRITES_COLS[0] = GREEN;
SPRITES_XPOS[0] = 0x15;

View File

@ -40,7 +40,7 @@ void init() {
xp += 9;
}
// Enable & initialize sprites
*SPRITES_ENABLE = $ff;
VICII->SPRITES_ENABLE = $ff;
for(char ss: 0..7) {
SPRITES_COLS[ss] = GREEN;
}
@ -51,9 +51,9 @@ void loop() {
// The current index into the y-sinus
char sin_idx = 0;
while(true) {
while(*RASTER!=$ff) {}
while(VICII->RASTER!=$ff) {}
// Assign sinus positions
(*BORDERCOL)++;
(VICII->BORDER_COLOR)++;
char y_idx = sin_idx;
for(char sy: 0..PLEX_COUNT-1) {
PLEX_YPOS[sy] = YSIN[y_idx];
@ -61,18 +61,18 @@ void loop() {
}
sin_idx +=1;
// Sort the sprites by y-position
(*BORDERCOL)++;
(VICII->BORDER_COLOR)++;
plexSort();
*BORDERCOL = BLACK;
VICII->BORDER_COLOR = BLACK;
while((*D011&VIC_RST8)!=0) {}
// Show the sprites
for( char ss: 0..PLEX_COUNT-1) {
*BORDERCOL = BLACK;
VICII->BORDER_COLOR = BLACK;
char rasterY = plexFreeNextYpos();
while(*RASTER<rasterY) {}
(*BORDERCOL)++;
while(VICII->RASTER<rasterY) {}
(VICII->BORDER_COLOR)++;
plexShowSprite();
}
*BORDERCOL = BLACK;
VICII->BORDER_COLOR = BLACK;
}
}

View File

@ -20,10 +20,10 @@ void main() {
asm { jsr music.init }
do {
// Wait for the RASTER
do {} while (*RASTER != $fd);
(*BORDERCOL)++;
do {} while (VICII->RASTER != $fd);
(VICII->BORDER_COLOR)++;
// Play the music
asm { jsr music.play }
(*BORDERCOL)--;
(VICII->BORDER_COLOR)--;
} while (true);
}

View File

@ -23,10 +23,10 @@ void main() {
// Disable CIA 1 Timer IRQ
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to $fd
*VIC_CONTROL &=$7f;
*RASTER = $fd;
VICII->CONTROL1 &=$7f;
VICII->RASTER = $fd;
// Enable Raster Interrupt
*IRQ_ENABLE = IRQ_RASTER;
VICII->IRQ_ENABLE = IRQ_RASTER;
// Set the IRQ routine
*KERNEL_IRQ = &irq_play;
asm { cli }
@ -34,10 +34,10 @@ void main() {
// Raster IRQ Routine playing music
interrupt(kernel_keyboard) void irq_play() {
(*BORDERCOL)++;
(VICII->BORDER_COLOR)++;
// Play SID
asm { jsr music.play }
// Acknowledge the IRQ
*IRQ_STATUS = IRQ_RASTER;
(*BORDERCOL)--;
VICII->IRQ_STATUS = IRQ_RASTER;
(VICII->BORDER_COLOR)--;
}

View File

@ -33,15 +33,15 @@ void main() {
}
interrupt(hardware_all) void nmi() {
(*BORDERCOL)++;
(VICII->BORDER_COLOR)++;
asm { lda CIA2_INTERRUPT }
SID->VOLUME_FILTER_MODE = *sample & $0f;
*KERNEL_NMI = &nmi2;
(*BORDERCOL)--;
(VICII->BORDER_COLOR)--;
}
interrupt(hardware_all) void nmi2() {
(*BORDERCOL)++;
(VICII->BORDER_COLOR)++;
asm { lda CIA2_INTERRUPT }
SID->VOLUME_FILTER_MODE = *sample >> 4;
sample++;
@ -49,5 +49,5 @@ interrupt(hardware_all) void nmi2() {
sample = SAMPLE;
}
*KERNEL_NMI = &nmi;
(*BORDERCOL)--;
(VICII->BORDER_COLOR)--;
}

View File

@ -19,8 +19,8 @@ const unsigned char align(0x100) SINTABLE[0x100] = kickasm {{
void main() {
asm { sei }
*BORDERCOL = BLUE;
*BGCOL = BLUE;
VICII->BORDER_COLOR = BLUE;
VICII->BG_COLOR = BLUE;
for(unsigned char* col : COLS..COLS+1000) *col = BLACK;
makecharset(CHARSET);
*D018 = toD018(SCREEN1, CHARSET);

View File

@ -18,8 +18,8 @@ const char align(0x100) SINTABLE[0x100] = kickasm {{
void main() {
asm { sei }
*BORDERCOL = BLUE;
*BGCOL = BLUE;
VICII->BORDER_COLOR = BLUE;
VICII->BG_COLOR = BLUE;
for(char* col : COLS..COLS+1000) *col = BLACK;
makecharset(CHARSET);
// Show double-buffered plasma

View File

@ -5,8 +5,8 @@ void main() {
sei
}
do {
do {} while (*RASTER!=$a);
do {} while (*RASTER!=$b);
do {} while (VICII->RASTER!=$a);
do {} while (VICII->RASTER!=$b);
raster();
} while (true);
}
@ -39,8 +39,8 @@ void raster() {
char i = 0;
char col = rastercols[i];
do {
*BGCOL = col;
*BORDERCOL = col;
VICII->BG_COLOR = col;
VICII->BORDER_COLOR = col;
col = rastercols[++i];
asm {
nop

View File

@ -25,7 +25,7 @@ void main() {
void init() {
mulf_init();
*SPRITES_ENABLE = %11111111;
VICII->SPRITES_ENABLE = %11111111;
char* sprites_ptr = SCREEN+$3f8;
for(char i: 0..7) {
sprites_ptr[i] = (char)(SPRITE/$40);
@ -40,8 +40,8 @@ signed char ys[8] = { -70, 0, 70, -70, 70, -70, 0, 70};
void anim() {
char angle = 0;
while(true) {
while(*RASTER!=$ff) {}
(*BORDERCOL)++;
while(VICII->RASTER!=$ff) {}
(VICII->BORDER_COLOR)++;
clock_start();
signed char cos_a = (signed char) COS[angle]; // signed fixed[0.7]
signed char sin_a = (signed char) SIN[angle]; // signed fixed[0.7]
@ -65,13 +65,13 @@ void anim() {
SPRITES_XPOS[i2] = <xpos;
SPRITES_YPOS[i2] = ypos;
}
*SPRITES_XMSB = sprite_msb;
VICII->SPRITES_XMSB = sprite_msb;
angle++;
// Calculate the cycle count - 0x12 is the base usage of start/read
unsigned long cyclecount = clock()-CLOCKS_PER_INIT;
// Print cycle count
print_ulong_at(cyclecount, SCREEN);
*BORDERCOL = LIGHT_BLUE;
VICII->BORDER_COLOR = LIGHT_BLUE;
}
}

View File

@ -1,7 +1,6 @@
#include <c64.h>
char* const SCREEN = $0400;
char* const RASTER = $d012;
char* const BGCOL = $d020;
char* const SCROLL = $d016;
const char TEXT[] = "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =- ";
void main() {
@ -11,9 +10,9 @@ void main() {
char* const line = SCREEN+40;
do {
// Wait for raster
do {} while(*RASTER!=$fe);
do {} while(*RASTER!=$ff);
++*BGCOL;
do {} while(VICII->RASTER!=$fe);
do {} while(VICII->RASTER!=$ff);
++VICII->BG_COLOR;
// Soft scroll
if(--scroll==$ff) {
scroll = 7;
@ -30,8 +29,8 @@ void main() {
line[39] = c;
nxt++;
}
*SCROLL = scroll;
--*BGCOL;
VICII->CONTROL2 = scroll;
--VICII->BG_COLOR;
} while(true);
}

View File

@ -1,22 +1,18 @@
// An 8x8 char letter scroller
#include <c64.h>
char* PROCPORT = $01;
char* CHARGEN = $d000;
char* SCREEN = $0400;
char* RASTER = $d012;
char* BGCOL = $d020;
char* SCROLL = $d016;
char* TEXT = "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =- ";
void main() {
fillscreen(SCREEN, $20);
do {
// Wait for raster
do {} while(*RASTER!=$fe);
do {} while(*RASTER!=$ff);
++*BGCOL;
do {} while(VICII->RASTER!=$fe);
do {} while(VICII->RASTER!=$ff);
++VICII->BG_COLOR;
scroll_soft();
--*BGCOL;
--VICII->BG_COLOR;
} while(true);
}
@ -27,7 +23,7 @@ void scroll_soft() {
scroll = 7;
scroll_bit();
}
*SCROLL = scroll;
VICII->CONTROL2 = scroll;
}
// Scroll the next bit from the current char onto the screen - trigger next char if needed

View File

@ -18,9 +18,9 @@ signed int align($100) xsin[XSIN_SIZE];
void main() {
asm { sei }
*BORDERCOL = WHITE;
*BGCOL = *BGCOL2 = DARK_GREY;
*BGCOL3 = BLACK;
VICII->BORDER_COLOR = WHITE;
VICII->BG_COLOR = VICII->BG_COLOR1 = DARK_GREY;
VICII->BG_COLOR2 = BLACK;
*D018 = toD018(SCREEN, LOGO);
*D016 = VIC_MCM;
memset(SCREEN, BLACK, 1000);
@ -37,14 +37,14 @@ unsigned int xsin_idx = 0;
void loop() {
while(true) {
// Wait for the raster to reach the bottom of the screen
while(*RASTER!=$ff) {}
(*BORDERCOL)++;
while(VICII->RASTER!=$ff) {}
(VICII->BORDER_COLOR)++;
signed int xpos = *(xsin+xsin_idx);
render_logo(xpos);
if(++xsin_idx==XSIN_SIZE) {
xsin_idx = 0;
}
(*BORDERCOL)--;
(VICII->BORDER_COLOR)--;
}
}

View File

@ -13,9 +13,9 @@ kickasm(resource "logo.png", pc LOGO, bytes 6*40*8 ) {{
}}
void main() {
*BORDERCOL = WHITE;
*BGCOL = *BGCOL2 = DARK_GREY;
*BGCOL3 = BLACK;
VICII->BORDER_COLOR = WHITE;
VICII->BG_COLOR = VICII->BG_COLOR1 = DARK_GREY;
VICII->BG_COLOR2 = BLACK;
*D018 = toD018(SCREEN, LOGO);
*D016 = VIC_MCM | VIC_CSEL;
memset(SCREEN, BLACK, 40*25);

View File

@ -33,7 +33,7 @@ void main() {
sin16s_gen2(sin, SIN_SIZE, -320, 320);
render_sine();
while(true) {
(*BGCOL)++;
(VICII->BG_COLOR)++;
}
}

View File

@ -12,7 +12,7 @@ char* const SCREEN = $400;
void main() {
init();
do {
do { } while (*RASTER!=$ff);
do { } while (VICII->RASTER!=$ff);
anim();
} while(true);
}
@ -67,7 +67,7 @@ char sin_idx_x = 0;
char sin_idx_y = 0;
void anim() {
(*BORDERCOL)++;
(VICII->BORDER_COLOR)++;
char xidx = sin_idx_x;
char yidx = sin_idx_y;
char j2 = 12;
@ -87,7 +87,7 @@ void anim() {
}
j2 = j2-2;
}
*SPRITES_XMSB = x_msb;
VICII->SPRITES_XMSB = x_msb;
// Increment sin indices
if(++sin_idx_x>=sinlen_x) {
@ -96,13 +96,13 @@ void anim() {
if(++sin_idx_y>=sinlen_y) {
sin_idx_y = 0;
}
(*BORDERCOL)--;
(VICII->BORDER_COLOR)--;
}
void place_sprites() {
*SPRITES_ENABLE = %01111111;
*SPRITES_EXPAND_X = %01111111;
*SPRITES_EXPAND_Y = %01111111;
VICII->SPRITES_ENABLE = %01111111;
VICII->SPRITES_EXPAND_X = %01111111;
VICII->SPRITES_EXPAND_Y = %01111111;
char* sprites_ptr = SCREEN+$3f8;
char spr_id = (char)((unsigned int)sprites/$40);
char spr_x = 60;

View File

@ -903,59 +903,59 @@ get_plane: {
.label return = 9
// if(idx==0)
cmp #0
beq __b2
beq __b1
// if(idx==1)
cmp #1
bne !__b6+
jmp __b6
!__b6:
// if(idx==2)
cmp #2
bne !__b7+
jmp __b7
!__b7:
// if(idx==2)
cmp #2
// if(idx==3)
cmp #3
bne !__b8+
jmp __b8
!__b8:
// if(idx==3)
cmp #3
// if(idx==4)
cmp #4
bne !__b9+
jmp __b9
!__b9:
// if(idx==4)
cmp #4
// if(idx==5)
cmp #5
bne !__b10+
jmp __b10
!__b10:
// if(idx==5)
cmp #5
// if(idx==6)
cmp #6
bne !__b11+
jmp __b11
!__b11:
// if(idx==6)
cmp #6
// if(idx==7)
cmp #7
bne !__b12+
jmp __b12
!__b12:
// if(idx==7)
cmp #7
// if(idx==8)
cmp #8
bne !__b13+
jmp __b13
!__b13:
// if(idx==8)
cmp #8
bne !__b14+
jmp __b14
!__b14:
// if(idx==9)
cmp #9
beq __b3
beq __b2
// if(idx==10)
cmp #$a
beq __b4
beq __b3
// if(idx==11)
cmp #$b
beq __b5
beq __b4
// if(idx==12)
cmp #$c
beq __b6
beq __b5
// if(idx==13)
cmp #$d
bne __b1
@ -979,16 +979,6 @@ get_plane: {
sta.z return+3
rts
__b2:
lda #<VIC_SCREEN0
sta.z return
lda #>VIC_SCREEN0
sta.z return+1
lda #<VIC_SCREEN0>>$10
sta.z return+2
lda #>VIC_SCREEN0>>$10
sta.z return+3
rts
__b3:
lda #<PLANE_HORISONTAL2
sta.z return
lda #>PLANE_HORISONTAL2
@ -998,7 +988,7 @@ get_plane: {
lda #>PLANE_HORISONTAL2>>$10
sta.z return+3
rts
__b4:
__b3:
lda #<PLANE_VERTICAL2
sta.z return
lda #>PLANE_VERTICAL2
@ -1008,7 +998,7 @@ get_plane: {
lda #>PLANE_VERTICAL2>>$10
sta.z return+3
rts
__b5:
__b4:
lda #<PLANE_CHARSET8
sta.z return
lda #>PLANE_CHARSET8
@ -1018,7 +1008,7 @@ get_plane: {
lda #>PLANE_CHARSET8>>$10
sta.z return+3
rts
__b6:
__b5:
lda #<PLANE_BLANK
sta.z return
lda #>PLANE_BLANK
@ -1028,7 +1018,7 @@ get_plane: {
lda #>PLANE_BLANK>>$10
sta.z return+3
rts
__b7:
__b6:
lda #<VIC_SCREEN1
sta.z return
lda #>VIC_SCREEN1
@ -1038,7 +1028,7 @@ get_plane: {
lda #>VIC_SCREEN1>>$10
sta.z return+3
rts
__b8:
__b7:
lda #<VIC_SCREEN2
sta.z return
lda #>VIC_SCREEN2
@ -1048,7 +1038,7 @@ get_plane: {
lda #>VIC_SCREEN2>>$10
sta.z return+3
rts
__b9:
__b8:
lda #<VIC_SCREEN3
sta.z return
lda #>VIC_SCREEN3
@ -1058,7 +1048,7 @@ get_plane: {
lda #>VIC_SCREEN3>>$10
sta.z return+3
rts
__b10:
__b9:
lda #<VIC_BITMAP
sta.z return
lda #>VIC_BITMAP
@ -1068,7 +1058,7 @@ get_plane: {
lda #>VIC_BITMAP>>$10
sta.z return+3
rts
__b11:
__b10:
lda #<VIC_CHARSET_ROM
sta.z return
lda #>VIC_CHARSET_ROM
@ -1078,7 +1068,7 @@ get_plane: {
lda #>VIC_CHARSET_ROM>>$10
sta.z return+3
rts
__b12:
__b11:
lda #<PLANE_8BPP_CHUNKY
sta.z return
lda #>PLANE_8BPP_CHUNKY
@ -1088,7 +1078,7 @@ get_plane: {
lda #>PLANE_8BPP_CHUNKY>>$10
sta.z return+3
rts
__b13:
__b12:
lda #<PLANE_HORISONTAL
sta.z return
lda #>PLANE_HORISONTAL
@ -1098,7 +1088,7 @@ get_plane: {
lda #>PLANE_HORISONTAL>>$10
sta.z return+3
rts
__b14:
__b13:
lda #<PLANE_VERTICAL
sta.z return
lda #>PLANE_VERTICAL

View File

@ -14784,21 +14784,10 @@ get_plane: {
jmp __b1
// get_plane::@1
__b1:
// [250] phi from get_plane::@1 to get_plane::@return [phi:get_plane::@1->get_plane::@return]
__breturn_from___b1:
// [250] phi (dword) get_plane::return#14 = (dword)(const nomodify byte*) VIC_SCREEN0 [phi:get_plane::@1->get_plane::@return#0] -- vduz1=vduc1
lda #<VIC_SCREEN0
sta.z return
lda #>VIC_SCREEN0
sta.z return+1
lda #<VIC_SCREEN0>>$10
sta.z return+2
lda #>VIC_SCREEN0>>$10
sta.z return+3
jmp __breturn
// [250] phi from get_plane to get_plane::@return [phi:get_plane->get_plane::@return]
// [250] phi from get_plane get_plane::@1 to get_plane::@return [phi:get_plane/get_plane::@1->get_plane::@return]
__breturn_from_get_plane:
// [250] phi (dword) get_plane::return#14 = (dword)(const nomodify byte*) VIC_SCREEN0 [phi:get_plane->get_plane::@return#0] -- vduz1=vduc1
__breturn_from___b1:
// [250] phi (dword) get_plane::return#14 = (dword)(const nomodify byte*) VIC_SCREEN0 [phi:get_plane/get_plane::@1->get_plane::@return#0] -- vduz1=vduc1
lda #<VIC_SCREEN0
sta.z return
lda #>VIC_SCREEN0
@ -19855,362 +19844,362 @@ Uplift Scope [gfx_init_plane_vertical2]
Uplift Scope [gfx_init_plane_blank]
Uplift Scope [gfx_init_plane_full]
Uplifting [keyboard_event_scan] best 15469563 combination reg byte a [ keyboard_event_scan::$15 ] reg byte a [ keyboard_event_scan::$16 ] zp[1]:252 [ keyboard_event_scan::event_type#0 ] zp[1]:253 [ keyboard_event_scan::$23 ] zp[1]:16 [ keyboard_event_scan::col#2 keyboard_event_scan::col#1 ] zp[1]:17 [ keyboard_event_scan::keycode#10 keyboard_event_scan::keycode#11 keyboard_event_scan::keycode#13 keyboard_event_scan::keycode#14 keyboard_event_scan::keycode#1 ] zp[1]:14 [ keyboard_event_scan::row#2 keyboard_event_scan::row#1 ] zp[1]:241 [ keyboard_event_scan::row_scan#0 ] zp[1]:243 [ keyboard_event_scan::$0 ] zp[1]:245 [ keyboard_event_scan::$3 ] zp[1]:247 [ keyboard_event_scan::$6 ] zp[1]:249 [ keyboard_event_scan::$9 ]
Uplifting [keyboard_event_scan] best 15469540 combination reg byte a [ keyboard_event_scan::$15 ] reg byte a [ keyboard_event_scan::$16 ] zp[1]:252 [ keyboard_event_scan::event_type#0 ] zp[1]:253 [ keyboard_event_scan::$23 ] zp[1]:16 [ keyboard_event_scan::col#2 keyboard_event_scan::col#1 ] zp[1]:17 [ keyboard_event_scan::keycode#10 keyboard_event_scan::keycode#11 keyboard_event_scan::keycode#13 keyboard_event_scan::keycode#14 keyboard_event_scan::keycode#1 ] zp[1]:14 [ keyboard_event_scan::row#2 keyboard_event_scan::row#1 ] zp[1]:241 [ keyboard_event_scan::row_scan#0 ] zp[1]:243 [ keyboard_event_scan::$0 ] zp[1]:245 [ keyboard_event_scan::$3 ] zp[1]:247 [ keyboard_event_scan::$6 ] zp[1]:249 [ keyboard_event_scan::$9 ]
Limited combination testing to 10 combinations of 5308416 possible.
Uplifting [] best 15469545 combination zp[1]:18 [ keyboard_events_size#18 keyboard_events_size#106 keyboard_events_size#97 keyboard_events_size#47 keyboard_events_size#27 keyboard_events_size#24 keyboard_events_size#100 keyboard_events_size#4 keyboard_events_size#105 keyboard_events_size#1 keyboard_events_size#2 ] zp[2]:54 [ print_line_cursor#21 print_line_cursor#2 print_set_screen::screen#2 print_line_cursor#22 ] zp[2]:52 [ print_char_cursor#41 print_char_cursor#24 print_char_cursor#72 print_char_cursor#73 print_char_cursor#42 print_char_cursor#28 ] reg byte x [ keyboard_modifiers#21 keyboard_modifiers#20 keyboard_modifiers#19 keyboard_modifiers#18 keyboard_modifiers#3 keyboard_modifiers#4 keyboard_modifiers#5 ] zp[1]:32 [ form_field_idx#28 form_field_idx#1 form_field_idx#18 form_field_idx#31 form_field_idx#6 form_field_idx#5 ] zp[1]:31 [ form_cursor_count#21 form_cursor_count#1 form_cursor_count#16 form_cursor_count#15 form_cursor_count#5 ]
Uplifting [] best 15469522 combination zp[1]:18 [ keyboard_events_size#18 keyboard_events_size#106 keyboard_events_size#97 keyboard_events_size#47 keyboard_events_size#27 keyboard_events_size#24 keyboard_events_size#100 keyboard_events_size#4 keyboard_events_size#105 keyboard_events_size#1 keyboard_events_size#2 ] zp[2]:54 [ print_line_cursor#21 print_line_cursor#2 print_set_screen::screen#2 print_line_cursor#22 ] zp[2]:52 [ print_char_cursor#41 print_char_cursor#24 print_char_cursor#72 print_char_cursor#73 print_char_cursor#42 print_char_cursor#28 ] reg byte x [ keyboard_modifiers#21 keyboard_modifiers#20 keyboard_modifiers#19 keyboard_modifiers#18 keyboard_modifiers#3 keyboard_modifiers#4 keyboard_modifiers#5 ] zp[1]:32 [ form_field_idx#28 form_field_idx#1 form_field_idx#18 form_field_idx#31 form_field_idx#6 form_field_idx#5 ] zp[1]:31 [ form_cursor_count#21 form_cursor_count#1 form_cursor_count#16 form_cursor_count#15 form_cursor_count#5 ]
Limited combination testing to 10 combinations of 16 possible.
Uplifting [keyboard_matrix_read] best 15409539 combination reg byte x [ keyboard_matrix_read::rowid#0 ] reg byte a [ keyboard_matrix_read::return#0 ] zp[1]:240 [ keyboard_matrix_read::return#2 ]
Uplifting [keyboard_matrix_read] best 15409516 combination reg byte x [ keyboard_matrix_read::rowid#0 ] reg byte a [ keyboard_matrix_read::return#0 ] zp[1]:240 [ keyboard_matrix_read::return#2 ]
Limited combination testing to 10 combinations of 64 possible.
Uplifting [print_str_at] best 15409539 combination zp[2]:37 [ print_str_at::str#2 print_str_at::str#1 print_str_at::str#0 ] zp[2]:39 [ print_str_at::at#2 print_str_at::at#0 ]
Uplifting [form_field_ptr] best 15406524 combination reg byte y [ form_field_ptr::y#0 ] reg byte x [ form_field_ptr::field_idx#2 form_field_ptr::field_idx#1 form_field_ptr::field_idx#0 ] zp[1]:265 [ form_field_ptr::x#0 ] zp[2]:266 [ form_field_ptr::return#0 ] zp[2]:263 [ form_field_ptr::line#0 ] zp[2]:268 [ form_field_ptr::return#3 ]
Uplifting [print_str_at] best 15409516 combination zp[2]:37 [ print_str_at::str#2 print_str_at::str#1 print_str_at::str#0 ] zp[2]:39 [ print_str_at::at#2 print_str_at::at#0 ]
Uplifting [form_field_ptr] best 15406501 combination reg byte y [ form_field_ptr::y#0 ] reg byte x [ form_field_ptr::field_idx#2 form_field_ptr::field_idx#1 form_field_ptr::field_idx#0 ] zp[1]:265 [ form_field_ptr::x#0 ] zp[2]:266 [ form_field_ptr::return#0 ] zp[2]:263 [ form_field_ptr::line#0 ] zp[2]:268 [ form_field_ptr::return#3 ]
Limited combination testing to 10 combinations of 36 possible.
Uplifting [bitmap_plot] best 15405315 combination reg byte x [ bitmap_plot::y#4 bitmap_plot::y#1 bitmap_plot::y#0 bitmap_plot::y#3 bitmap_plot::y#2 ] zp[2]:320 [ bitmap_plot::plotter_y#0 ] reg byte a [ bitmap_plot::$1 ] zp[1]:103 [ bitmap_plot::x#4 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#3 bitmap_plot::x#2 ] zp[2]:318 [ bitmap_plot::plotter_x#0 ] zp[2]:322 [ bitmap_plot::plotter#0 ]
Uplifting [bitmap_plot] best 15405292 combination reg byte x [ bitmap_plot::y#4 bitmap_plot::y#1 bitmap_plot::y#0 bitmap_plot::y#3 bitmap_plot::y#2 ] zp[2]:320 [ bitmap_plot::plotter_y#0 ] reg byte a [ bitmap_plot::$1 ] zp[1]:103 [ bitmap_plot::x#4 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#3 bitmap_plot::x#2 ] zp[2]:318 [ bitmap_plot::plotter_x#0 ] zp[2]:322 [ bitmap_plot::plotter#0 ]
Limited combination testing to 10 combinations of 36 possible.
Uplifting [keyboard_event_pressed] best 15405307 combination reg byte a [ keyboard_event_pressed::$0 ] reg byte a [ keyboard_event_pressed::$1 ] zp[1]:255 [ keyboard_event_pressed::row_bits#0 ] zp[1]:19 [ keyboard_event_pressed::keycode#4 ] zp[1]:257 [ keyboard_event_pressed::return#10 ] zp[1]:242 [ keyboard_event_pressed::return#0 ] zp[1]:244 [ keyboard_event_pressed::return#1 ] zp[1]:246 [ keyboard_event_pressed::return#2 ] zp[1]:248 [ keyboard_event_pressed::return#3 ]
Uplifting [keyboard_event_pressed] best 15405284 combination reg byte a [ keyboard_event_pressed::$0 ] reg byte a [ keyboard_event_pressed::$1 ] zp[1]:255 [ keyboard_event_pressed::row_bits#0 ] zp[1]:19 [ keyboard_event_pressed::keycode#4 ] zp[1]:257 [ keyboard_event_pressed::return#10 ] zp[1]:242 [ keyboard_event_pressed::return#0 ] zp[1]:244 [ keyboard_event_pressed::return#1 ] zp[1]:246 [ keyboard_event_pressed::return#2 ] zp[1]:248 [ keyboard_event_pressed::return#3 ]
Limited combination testing to 10 combinations of 147456 possible.
Uplifting [apply_preset] best 15392974 combination reg byte y [ apply_preset::i#2 apply_preset::i#1 ] zp[2]:43 [ apply_preset::preset#15 ] reg byte a [ apply_preset::idx#0 ]
Uplifting [apply_preset] best 15392951 combination reg byte y [ apply_preset::i#2 apply_preset::i#1 ] zp[2]:43 [ apply_preset::preset#15 ] reg byte a [ apply_preset::idx#0 ]
Limited combination testing to 10 combinations of 12 possible.
Uplifting [form_render_values] best 15377974 combination reg byte x [ form_render_values::idx#2 form_render_values::idx#1 ]
Uplifting [bitmap_line_xdyi] best 15376968 combination zp[1]:102 [ bitmap_line_xdyi::e#3 bitmap_line_xdyi::e#0 bitmap_line_xdyi::e#6 bitmap_line_xdyi::e#2 bitmap_line_xdyi::e#1 ] reg byte x [ bitmap_line_xdyi::y#3 bitmap_line_xdyi::y#5 bitmap_line_xdyi::y#1 bitmap_line_xdyi::y#0 bitmap_line_xdyi::y#6 bitmap_line_xdyi::y#2 ] reg byte a [ bitmap_line_xdyi::$6 ] zp[1]:100 [ bitmap_line_xdyi::x#3 bitmap_line_xdyi::x#6 bitmap_line_xdyi::x#1 bitmap_line_xdyi::x#0 bitmap_line_xdyi::x#2 ] zp[1]:98 [ bitmap_line_xdyi::xd#5 bitmap_line_xdyi::xd#1 bitmap_line_xdyi::xd#0 ] zp[1]:97 [ bitmap_line_xdyi::yd#2 bitmap_line_xdyi::yd#1 bitmap_line_xdyi::yd#0 ] zp[1]:99 [ bitmap_line_xdyi::x1#6 bitmap_line_xdyi::x1#1 bitmap_line_xdyi::x1#0 ]
Uplifting [form_render_values] best 15377951 combination reg byte x [ form_render_values::idx#2 form_render_values::idx#1 ]
Uplifting [bitmap_line_xdyi] best 15376945 combination zp[1]:102 [ bitmap_line_xdyi::e#3 bitmap_line_xdyi::e#0 bitmap_line_xdyi::e#6 bitmap_line_xdyi::e#2 bitmap_line_xdyi::e#1 ] reg byte x [ bitmap_line_xdyi::y#3 bitmap_line_xdyi::y#5 bitmap_line_xdyi::y#1 bitmap_line_xdyi::y#0 bitmap_line_xdyi::y#6 bitmap_line_xdyi::y#2 ] reg byte a [ bitmap_line_xdyi::$6 ] zp[1]:100 [ bitmap_line_xdyi::x#3 bitmap_line_xdyi::x#6 bitmap_line_xdyi::x#1 bitmap_line_xdyi::x#0 bitmap_line_xdyi::x#2 ] zp[1]:98 [ bitmap_line_xdyi::xd#5 bitmap_line_xdyi::xd#1 bitmap_line_xdyi::xd#0 ] zp[1]:97 [ bitmap_line_xdyi::yd#2 bitmap_line_xdyi::yd#1 bitmap_line_xdyi::yd#0 ] zp[1]:99 [ bitmap_line_xdyi::x1#6 bitmap_line_xdyi::x1#1 bitmap_line_xdyi::x1#0 ]
Limited combination testing to 10 combinations of 256 possible.
Uplifting [bitmap_line_xdyd] best 15375962 combination zp[1]:116 [ bitmap_line_xdyd::e#3 bitmap_line_xdyd::e#0 bitmap_line_xdyd::e#6 bitmap_line_xdyd::e#2 bitmap_line_xdyd::e#1 ] reg byte x [ bitmap_line_xdyd::y#3 bitmap_line_xdyd::y#5 bitmap_line_xdyd::y#1 bitmap_line_xdyd::y#0 bitmap_line_xdyd::y#6 bitmap_line_xdyd::y#2 ] reg byte a [ bitmap_line_xdyd::$6 ] zp[1]:114 [ bitmap_line_xdyd::x#3 bitmap_line_xdyd::x#6 bitmap_line_xdyd::x#1 bitmap_line_xdyd::x#0 bitmap_line_xdyd::x#2 ] zp[1]:112 [ bitmap_line_xdyd::xd#5 bitmap_line_xdyd::xd#1 bitmap_line_xdyd::xd#0 ] zp[1]:111 [ bitmap_line_xdyd::yd#2 bitmap_line_xdyd::yd#1 bitmap_line_xdyd::yd#0 ] zp[1]:113 [ bitmap_line_xdyd::x1#6 bitmap_line_xdyd::x1#1 bitmap_line_xdyd::x1#0 ]
Uplifting [bitmap_line_xdyd] best 15375939 combination zp[1]:116 [ bitmap_line_xdyd::e#3 bitmap_line_xdyd::e#0 bitmap_line_xdyd::e#6 bitmap_line_xdyd::e#2 bitmap_line_xdyd::e#1 ] reg byte x [ bitmap_line_xdyd::y#3 bitmap_line_xdyd::y#5 bitmap_line_xdyd::y#1 bitmap_line_xdyd::y#0 bitmap_line_xdyd::y#6 bitmap_line_xdyd::y#2 ] reg byte a [ bitmap_line_xdyd::$6 ] zp[1]:114 [ bitmap_line_xdyd::x#3 bitmap_line_xdyd::x#6 bitmap_line_xdyd::x#1 bitmap_line_xdyd::x#0 bitmap_line_xdyd::x#2 ] zp[1]:112 [ bitmap_line_xdyd::xd#5 bitmap_line_xdyd::xd#1 bitmap_line_xdyd::xd#0 ] zp[1]:111 [ bitmap_line_xdyd::yd#2 bitmap_line_xdyd::yd#1 bitmap_line_xdyd::yd#0 ] zp[1]:113 [ bitmap_line_xdyd::x1#6 bitmap_line_xdyd::x1#1 bitmap_line_xdyd::x1#0 ]
Limited combination testing to 10 combinations of 256 possible.
Uplifting [bitmap_line_ydxi] best 15375362 combination zp[1]:110 [ bitmap_line_ydxi::e#3 bitmap_line_ydxi::e#0 bitmap_line_ydxi::e#6 bitmap_line_ydxi::e#2 bitmap_line_ydxi::e#1 ] zp[1]:108 [ bitmap_line_ydxi::x#3 bitmap_line_ydxi::x#5 bitmap_line_ydxi::x#1 bitmap_line_ydxi::x#0 bitmap_line_ydxi::x#6 bitmap_line_ydxi::x#2 ] reg byte x [ bitmap_line_ydxi::$6 ] zp[1]:109 [ bitmap_line_ydxi::y#3 bitmap_line_ydxi::y#6 bitmap_line_ydxi::y#1 bitmap_line_ydxi::y#0 bitmap_line_ydxi::y#2 ] zp[1]:106 [ bitmap_line_ydxi::yd#5 bitmap_line_ydxi::yd#1 bitmap_line_ydxi::yd#0 ] zp[1]:105 [ bitmap_line_ydxi::xd#2 bitmap_line_ydxi::xd#1 bitmap_line_ydxi::xd#0 ] zp[1]:107 [ bitmap_line_ydxi::y1#6 bitmap_line_ydxi::y1#1 bitmap_line_ydxi::y1#0 ]
Uplifting [bitmap_line_ydxi] best 15375339 combination zp[1]:110 [ bitmap_line_ydxi::e#3 bitmap_line_ydxi::e#0 bitmap_line_ydxi::e#6 bitmap_line_ydxi::e#2 bitmap_line_ydxi::e#1 ] zp[1]:108 [ bitmap_line_ydxi::x#3 bitmap_line_ydxi::x#5 bitmap_line_ydxi::x#1 bitmap_line_ydxi::x#0 bitmap_line_ydxi::x#6 bitmap_line_ydxi::x#2 ] reg byte x [ bitmap_line_ydxi::$6 ] zp[1]:109 [ bitmap_line_ydxi::y#3 bitmap_line_ydxi::y#6 bitmap_line_ydxi::y#1 bitmap_line_ydxi::y#0 bitmap_line_ydxi::y#2 ] zp[1]:106 [ bitmap_line_ydxi::yd#5 bitmap_line_ydxi::yd#1 bitmap_line_ydxi::yd#0 ] zp[1]:105 [ bitmap_line_ydxi::xd#2 bitmap_line_ydxi::xd#1 bitmap_line_ydxi::xd#0 ] zp[1]:107 [ bitmap_line_ydxi::y1#6 bitmap_line_ydxi::y1#1 bitmap_line_ydxi::y1#0 ]
Limited combination testing to 10 combinations of 256 possible.
Uplifting [bitmap_line_ydxd] best 15374762 combination zp[1]:122 [ bitmap_line_ydxd::e#3 bitmap_line_ydxd::e#0 bitmap_line_ydxd::e#6 bitmap_line_ydxd::e#2 bitmap_line_ydxd::e#1 ] zp[1]:120 [ bitmap_line_ydxd::x#3 bitmap_line_ydxd::x#5 bitmap_line_ydxd::x#0 bitmap_line_ydxd::x#1 bitmap_line_ydxd::x#6 bitmap_line_ydxd::x#2 ] reg byte x [ bitmap_line_ydxd::$6 ] zp[1]:121 [ bitmap_line_ydxd::y#2 bitmap_line_ydxd::y#7 bitmap_line_ydxd::y#0 bitmap_line_ydxd::y#1 bitmap_line_ydxd::y#3 ] zp[1]:118 [ bitmap_line_ydxd::yd#5 bitmap_line_ydxd::yd#0 bitmap_line_ydxd::yd#1 ] zp[1]:117 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::xd#0 bitmap_line_ydxd::xd#1 ] zp[1]:119 [ bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y1#0 bitmap_line_ydxd::y1#1 ]
Uplifting [bitmap_line_ydxd] best 15374739 combination zp[1]:122 [ bitmap_line_ydxd::e#3 bitmap_line_ydxd::e#0 bitmap_line_ydxd::e#6 bitmap_line_ydxd::e#2 bitmap_line_ydxd::e#1 ] zp[1]:120 [ bitmap_line_ydxd::x#3 bitmap_line_ydxd::x#5 bitmap_line_ydxd::x#0 bitmap_line_ydxd::x#1 bitmap_line_ydxd::x#6 bitmap_line_ydxd::x#2 ] reg byte x [ bitmap_line_ydxd::$6 ] zp[1]:121 [ bitmap_line_ydxd::y#2 bitmap_line_ydxd::y#7 bitmap_line_ydxd::y#0 bitmap_line_ydxd::y#1 bitmap_line_ydxd::y#3 ] zp[1]:118 [ bitmap_line_ydxd::yd#5 bitmap_line_ydxd::yd#0 bitmap_line_ydxd::yd#1 ] zp[1]:117 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::xd#0 bitmap_line_ydxd::xd#1 ] zp[1]:119 [ bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y1#0 bitmap_line_ydxd::y1#1 ]
Limited combination testing to 10 combinations of 256 possible.
Uplifting [keyboard_event_get] best 15374447 combination reg byte a [ keyboard_event_get::return#2 keyboard_event_get::return#1 ] reg byte a [ keyboard_event_get::return#4 ] zp[1]:237 [ keyboard_event_get::return#3 ]
Uplifting [keyboard_event_get] best 15374424 combination reg byte a [ keyboard_event_get::return#2 keyboard_event_get::return#1 ] reg byte a [ keyboard_event_get::return#4 ] zp[1]:237 [ keyboard_event_get::return#3 ]
Limited combination testing to 10 combinations of 64 possible.
Uplifting [form_control] best 15374435 combination reg byte a [ form_control::$12 ] reg byte a [ form_control::$14 ] zp[1]:276 [ form_control::$15 ] zp[1]:277 [ form_control::$22 ] zp[1]:278 [ form_control::$13 ] zp[1]:274 [ form_control::key_event#0 ] zp[2]:270 [ form_control::field#0 ] zp[1]:259 [ form_control::return#0 ] zp[1]:46 [ form_control::return#2 ]
Uplifting [form_control] best 15374412 combination reg byte a [ form_control::$12 ] reg byte a [ form_control::$14 ] zp[1]:276 [ form_control::$15 ] zp[1]:277 [ form_control::$22 ] zp[1]:278 [ form_control::$13 ] zp[1]:274 [ form_control::key_event#0 ] zp[2]:270 [ form_control::field#0 ] zp[1]:259 [ form_control::return#0 ] zp[1]:46 [ form_control::return#2 ]
Limited combination testing to 10 combinations of 65536 possible.
Uplifting [print_char] best 15371432 combination reg byte a [ print_char::ch#0 ]
Uplifting [memset] best 15371432 combination zp[2]:56 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:285 [ memset::end#0 ] zp[2]:283 [ memset::str#0 ]
Uplifting [print_str_lines] best 15359432 combination zp[2]:50 [ print_str_lines::str#4 print_str_lines::str#3 print_str_lines::str#5 print_str_lines::str#0 ] reg byte a [ print_str_lines::ch#0 ]
Uplifting [gfx_init_plane_charset8] best 15344432 combination reg byte a [ gfx_init_plane_charset8::c#2 gfx_init_plane_charset8::c#3 ] reg byte a [ gfx_init_plane_charset8::$2 ] zp[1]:88 [ gfx_init_plane_charset8::cp#2 gfx_init_plane_charset8::cp#1 ] zp[1]:84 [ gfx_init_plane_charset8::bits#2 gfx_init_plane_charset8::bits#0 gfx_init_plane_charset8::bits#1 ] zp[2]:85 [ gfx_init_plane_charset8::gfxa#2 gfx_init_plane_charset8::gfxa#5 gfx_init_plane_charset8::gfxa#6 gfx_init_plane_charset8::gfxa#1 ] zp[1]:87 [ gfx_init_plane_charset8::col#2 gfx_init_plane_charset8::col#5 gfx_init_plane_charset8::col#6 gfx_init_plane_charset8::col#1 ] zp[2]:81 [ gfx_init_plane_charset8::chargen#2 gfx_init_plane_charset8::chargen#3 gfx_init_plane_charset8::chargen#1 ] zp[1]:83 [ gfx_init_plane_charset8::cr#6 gfx_init_plane_charset8::cr#1 ] zp[1]:80 [ gfx_init_plane_charset8::ch#8 gfx_init_plane_charset8::ch#1 ]
Uplifting [print_char] best 15371409 combination reg byte a [ print_char::ch#0 ]
Uplifting [memset] best 15371409 combination zp[2]:56 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:285 [ memset::end#0 ] zp[2]:283 [ memset::str#0 ]
Uplifting [print_str_lines] best 15359409 combination zp[2]:50 [ print_str_lines::str#4 print_str_lines::str#3 print_str_lines::str#5 print_str_lines::str#0 ] reg byte a [ print_str_lines::ch#0 ]
Uplifting [gfx_init_plane_charset8] best 15344409 combination reg byte a [ gfx_init_plane_charset8::c#2 gfx_init_plane_charset8::c#3 ] reg byte a [ gfx_init_plane_charset8::$2 ] zp[1]:88 [ gfx_init_plane_charset8::cp#2 gfx_init_plane_charset8::cp#1 ] zp[1]:84 [ gfx_init_plane_charset8::bits#2 gfx_init_plane_charset8::bits#0 gfx_init_plane_charset8::bits#1 ] zp[2]:85 [ gfx_init_plane_charset8::gfxa#2 gfx_init_plane_charset8::gfxa#5 gfx_init_plane_charset8::gfxa#6 gfx_init_plane_charset8::gfxa#1 ] zp[1]:87 [ gfx_init_plane_charset8::col#2 gfx_init_plane_charset8::col#5 gfx_init_plane_charset8::col#6 gfx_init_plane_charset8::col#1 ] zp[2]:81 [ gfx_init_plane_charset8::chargen#2 gfx_init_plane_charset8::chargen#3 gfx_init_plane_charset8::chargen#1 ] zp[1]:83 [ gfx_init_plane_charset8::cr#6 gfx_init_plane_charset8::cr#1 ] zp[1]:80 [ gfx_init_plane_charset8::ch#8 gfx_init_plane_charset8::ch#1 ]
Limited combination testing to 10 combinations of 1152 possible.
Uplifting [form_set_screen] best 15342332 combination reg byte x [ form_set_screen::y#2 form_set_screen::y#1 ] reg byte a [ form_set_screen::$0 ] zp[1]:280 [ form_set_screen::$1 ] zp[2]:47 [ form_set_screen::line#2 form_set_screen::line#1 ]
Uplifting [form_set_screen] best 15342309 combination reg byte x [ form_set_screen::y#2 form_set_screen::y#1 ] reg byte a [ form_set_screen::$0 ] zp[1]:280 [ form_set_screen::$1 ] zp[2]:47 [ form_set_screen::line#2 form_set_screen::line#1 ]
Limited combination testing to 10 combinations of 48 possible.
Uplifting [gfx_init_plane_fill] best 15341426 combination zp[2]:64 [ gfx_init_plane_fill::gfxb#2 gfx_init_plane_fill::gfxb#3 gfx_init_plane_fill::gfxb#1 gfx_init_plane_fill::gfxb#6 ] reg byte x [ gfx_init_plane_fill::bx#2 gfx_init_plane_fill::bx#1 ] zp[1]:63 [ gfx_init_plane_fill::by#4 gfx_init_plane_fill::by#1 ] zp[1]:62 [ gfx_init_plane_fill::fill#6 ] zp[4]:287 [ gfx_init_plane_fill::$0 ] zp[2]:291 [ gfx_init_plane_fill::$1 ] reg byte a [ gfx_init_plane_fill::gfxbCpuBank#0 ] zp[2]:294 [ gfx_init_plane_fill::$4 ] zp[2]:296 [ gfx_init_plane_fill::$5 ] zp[2]:298 [ gfx_init_plane_fill::gfxb#0 ] zp[4]:58 [ gfx_init_plane_fill::plane_addr#3 ]
Uplifting [gfx_init_plane_fill] best 15341403 combination zp[2]:64 [ gfx_init_plane_fill::gfxb#2 gfx_init_plane_fill::gfxb#3 gfx_init_plane_fill::gfxb#1 gfx_init_plane_fill::gfxb#6 ] reg byte x [ gfx_init_plane_fill::bx#2 gfx_init_plane_fill::bx#1 ] zp[1]:63 [ gfx_init_plane_fill::by#4 gfx_init_plane_fill::by#1 ] zp[1]:62 [ gfx_init_plane_fill::fill#6 ] zp[4]:287 [ gfx_init_plane_fill::$0 ] zp[2]:291 [ gfx_init_plane_fill::$1 ] reg byte a [ gfx_init_plane_fill::gfxbCpuBank#0 ] zp[2]:294 [ gfx_init_plane_fill::$4 ] zp[2]:296 [ gfx_init_plane_fill::$5 ] zp[2]:298 [ gfx_init_plane_fill::gfxb#0 ] zp[4]:58 [ gfx_init_plane_fill::plane_addr#3 ]
Limited combination testing to 10 combinations of 32 possible.
Uplifting [bitmap_clear] best 15340526 combination zp[2]:124 [ bitmap_clear::bitmap#2 bitmap_clear::bitmap#3 bitmap_clear::bitmap#5 bitmap_clear::bitmap#1 ] reg byte x [ bitmap_clear::x#2 bitmap_clear::x#1 ] zp[1]:123 [ bitmap_clear::y#4 bitmap_clear::y#1 ] zp[2]:328 [ bitmap_clear::bitmap#0 ]
Uplifting [form_mode] best 15333326 combination reg byte a [ form_mode::$11 ] zp[1]:33 [ form_mode::preset_current#6 form_mode::preset_current#0 form_mode::preset_current#1 ] reg byte x [ form_mode::i#2 form_mode::i#1 ]
Uplifting [bitmap_clear] best 15340503 combination zp[2]:124 [ bitmap_clear::bitmap#2 bitmap_clear::bitmap#3 bitmap_clear::bitmap#5 bitmap_clear::bitmap#1 ] reg byte x [ bitmap_clear::x#2 bitmap_clear::x#1 ] zp[1]:123 [ bitmap_clear::y#4 bitmap_clear::y#1 ] zp[2]:328 [ bitmap_clear::bitmap#0 ]
Uplifting [form_mode] best 15333303 combination reg byte a [ form_mode::$11 ] zp[1]:33 [ form_mode::preset_current#6 form_mode::preset_current#0 form_mode::preset_current#1 ] reg byte x [ form_mode::i#2 form_mode::i#1 ]
Limited combination testing to 10 combinations of 24 possible.
Uplifting [render_preset_name] best 15332990 combination reg byte a [ render_preset_name::idx#10 render_preset_name::idx#0 render_preset_name::idx#1 ] zp[2]:35 [ render_preset_name::name#13 ]
Uplifting [bitmap_init] best 15332690 combination zp[2]:130 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] reg byte y [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ] zp[1]:129 [ bitmap_init::y#2 bitmap_init::y#1 ] zp[1]:330 [ bitmap_init::$0 ] zp[1]:332 [ bitmap_init::$7 ] zp[1]:333 [ bitmap_init::$8 ] zp[1]:334 [ bitmap_init::$9 ] zp[1]:331 [ bitmap_init::$10 ]
Uplifting [render_preset_name] best 15332967 combination reg byte a [ render_preset_name::idx#10 render_preset_name::idx#0 render_preset_name::idx#1 ] zp[2]:35 [ render_preset_name::name#13 ]
Uplifting [bitmap_init] best 15332667 combination zp[2]:130 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] reg byte y [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ] zp[1]:129 [ bitmap_init::y#2 bitmap_init::y#1 ] zp[1]:330 [ bitmap_init::$0 ] zp[1]:332 [ bitmap_init::$7 ] zp[1]:333 [ bitmap_init::$8 ] zp[1]:334 [ bitmap_init::$9 ] zp[1]:331 [ bitmap_init::$10 ]
Limited combination testing to 10 combinations of 34560 possible.
Uplifting [dtvSetCpuBankSegment1] best 15332351 combination reg byte a [ dtvSetCpuBankSegment1::cpuBankIdx#13 dtvSetCpuBankSegment1::cpuBankIdx#1 dtvSetCpuBankSegment1::cpuBankIdx#11 ]
Uplifting [gfx_init_screen2] best 15331151 combination reg byte a [ gfx_init_screen2::$0 ] reg byte a [ gfx_init_screen2::$3 ] zp[1]:343 [ gfx_init_screen2::$4 ] zp[1]:147 [ gfx_init_screen2::cx#2 gfx_init_screen2::cx#1 ] zp[1]:340 [ gfx_init_screen2::col#0 ] zp[2]:148 [ gfx_init_screen2::ch#2 gfx_init_screen2::ch#3 gfx_init_screen2::ch#1 ] zp[1]:341 [ gfx_init_screen2::col2#0 ] zp[1]:146 [ gfx_init_screen2::cy#4 gfx_init_screen2::cy#1 ]
Uplifting [dtvSetCpuBankSegment1] best 15332328 combination reg byte a [ dtvSetCpuBankSegment1::cpuBankIdx#13 dtvSetCpuBankSegment1::cpuBankIdx#1 dtvSetCpuBankSegment1::cpuBankIdx#11 ]
Uplifting [gfx_init_screen2] best 15331128 combination reg byte a [ gfx_init_screen2::$0 ] reg byte a [ gfx_init_screen2::$3 ] zp[1]:343 [ gfx_init_screen2::$4 ] zp[1]:147 [ gfx_init_screen2::cx#2 gfx_init_screen2::cx#1 ] zp[1]:340 [ gfx_init_screen2::col#0 ] zp[2]:148 [ gfx_init_screen2::ch#2 gfx_init_screen2::ch#3 gfx_init_screen2::ch#1 ] zp[1]:341 [ gfx_init_screen2::col2#0 ] zp[1]:146 [ gfx_init_screen2::cy#4 gfx_init_screen2::cy#1 ]
Limited combination testing to 10 combinations of 2304 possible.
Uplifting [gfx_init_plane_8bppchunky] best 15330121 combination reg byte x [ gfx_init_plane_8bppchunky::gfxbCpuBank#4 gfx_init_plane_8bppchunky::gfxbCpuBank#7 gfx_init_plane_8bppchunky::gfxbCpuBank#8 gfx_init_plane_8bppchunky::gfxbCpuBank#2 ] zp[2]:94 [ gfx_init_plane_8bppchunky::gfxb#4 gfx_init_plane_8bppchunky::gfxb#3 gfx_init_plane_8bppchunky::gfxb#5 gfx_init_plane_8bppchunky::gfxb#1 ] reg byte a [ gfx_init_plane_8bppchunky::c#0 ] zp[2]:91 [ gfx_init_plane_8bppchunky::x#2 gfx_init_plane_8bppchunky::x#1 ] zp[2]:304 [ gfx_init_plane_8bppchunky::$5 ] zp[1]:90 [ gfx_init_plane_8bppchunky::y#6 gfx_init_plane_8bppchunky::y#1 ]
Uplifting [gfx_init_plane_8bppchunky] best 15330098 combination reg byte x [ gfx_init_plane_8bppchunky::gfxbCpuBank#4 gfx_init_plane_8bppchunky::gfxbCpuBank#7 gfx_init_plane_8bppchunky::gfxbCpuBank#8 gfx_init_plane_8bppchunky::gfxbCpuBank#2 ] zp[2]:94 [ gfx_init_plane_8bppchunky::gfxb#4 gfx_init_plane_8bppchunky::gfxb#3 gfx_init_plane_8bppchunky::gfxb#5 gfx_init_plane_8bppchunky::gfxb#1 ] reg byte a [ gfx_init_plane_8bppchunky::c#0 ] zp[2]:91 [ gfx_init_plane_8bppchunky::x#2 gfx_init_plane_8bppchunky::x#1 ] zp[2]:304 [ gfx_init_plane_8bppchunky::$5 ] zp[1]:90 [ gfx_init_plane_8bppchunky::y#6 gfx_init_plane_8bppchunky::y#1 ]
Limited combination testing to 10 combinations of 16 possible.
Uplifting [gfx_init_screen0] best 15328921 combination reg byte a [ gfx_init_screen0::$0 ] reg byte a [ gfx_init_screen0::$2 ] zp[1]:349 [ gfx_init_screen0::$3 ] zp[1]:155 [ gfx_init_screen0::cx#2 gfx_init_screen0::cx#1 ] zp[2]:156 [ gfx_init_screen0::ch#2 gfx_init_screen0::ch#3 gfx_init_screen0::ch#1 ] zp[1]:347 [ gfx_init_screen0::$1 ] zp[1]:154 [ gfx_init_screen0::cy#4 gfx_init_screen0::cy#1 ]
Uplifting [gfx_init_screen0] best 15328898 combination reg byte a [ gfx_init_screen0::$0 ] reg byte a [ gfx_init_screen0::$2 ] zp[1]:349 [ gfx_init_screen0::$3 ] zp[1]:155 [ gfx_init_screen0::cx#2 gfx_init_screen0::cx#1 ] zp[2]:156 [ gfx_init_screen0::ch#2 gfx_init_screen0::ch#3 gfx_init_screen0::ch#1 ] zp[1]:347 [ gfx_init_screen0::$1 ] zp[1]:154 [ gfx_init_screen0::cy#4 gfx_init_screen0::cy#1 ]
Limited combination testing to 10 combinations of 768 possible.
Uplifting [gfx_init_screen3] best 15327721 combination reg byte a [ gfx_init_screen3::$0 ] reg byte a [ gfx_init_screen3::$2 ] zp[1]:338 [ gfx_init_screen3::$3 ] zp[1]:143 [ gfx_init_screen3::cx#2 gfx_init_screen3::cx#1 ] zp[2]:144 [ gfx_init_screen3::ch#2 gfx_init_screen3::ch#3 gfx_init_screen3::ch#1 ] zp[1]:336 [ gfx_init_screen3::$1 ] zp[1]:142 [ gfx_init_screen3::cy#4 gfx_init_screen3::cy#1 ]
Uplifting [gfx_init_screen3] best 15327698 combination reg byte a [ gfx_init_screen3::$0 ] reg byte a [ gfx_init_screen3::$2 ] zp[1]:338 [ gfx_init_screen3::$3 ] zp[1]:143 [ gfx_init_screen3::cx#2 gfx_init_screen3::cx#1 ] zp[2]:144 [ gfx_init_screen3::ch#2 gfx_init_screen3::ch#3 gfx_init_screen3::ch#1 ] zp[1]:336 [ gfx_init_screen3::$1 ] zp[1]:142 [ gfx_init_screen3::cy#4 gfx_init_screen3::cy#1 ]
Limited combination testing to 10 combinations of 768 possible.
Uplifting [gfx_init_plane_horisontal] best 15326221 combination zp[2]:77 [ gfx_init_plane_horisontal::gfxa#3 gfx_init_plane_horisontal::gfxa#6 gfx_init_plane_horisontal::gfxa#7 gfx_init_plane_horisontal::gfxa#1 gfx_init_plane_horisontal::gfxa#2 ] reg byte a [ gfx_init_plane_horisontal::$2 ] reg byte x [ gfx_init_plane_horisontal::ax#2 gfx_init_plane_horisontal::ax#1 ] zp[1]:76 [ gfx_init_plane_horisontal::ay#4 gfx_init_plane_horisontal::ay#1 ]
Uplifting [gfx_init_plane_horisontal] best 15326198 combination zp[2]:77 [ gfx_init_plane_horisontal::gfxa#3 gfx_init_plane_horisontal::gfxa#6 gfx_init_plane_horisontal::gfxa#7 gfx_init_plane_horisontal::gfxa#1 gfx_init_plane_horisontal::gfxa#2 ] reg byte a [ gfx_init_plane_horisontal::$2 ] reg byte x [ gfx_init_plane_horisontal::ax#2 gfx_init_plane_horisontal::ax#1 ] zp[1]:76 [ gfx_init_plane_horisontal::ay#4 gfx_init_plane_horisontal::ay#1 ]
Limited combination testing to 10 combinations of 16 possible.
Uplifting [gfx_init_screen1] best 15324621 combination reg byte x [ gfx_init_screen1::cx#2 gfx_init_screen1::cx#1 ] reg byte a [ gfx_init_screen1::$0 ] zp[1]:345 [ gfx_init_screen1::$1 ] zp[2]:152 [ gfx_init_screen1::ch#2 gfx_init_screen1::ch#3 gfx_init_screen1::ch#1 ] zp[1]:150 [ gfx_init_screen1::cy#4 gfx_init_screen1::cy#1 ]
Uplifting [gfx_init_screen1] best 15324598 combination reg byte x [ gfx_init_screen1::cx#2 gfx_init_screen1::cx#1 ] reg byte a [ gfx_init_screen1::$0 ] zp[1]:345 [ gfx_init_screen1::$1 ] zp[2]:152 [ gfx_init_screen1::ch#2 gfx_init_screen1::ch#3 gfx_init_screen1::ch#1 ] zp[1]:150 [ gfx_init_screen1::cy#4 gfx_init_screen1::cy#1 ]
Limited combination testing to 10 combinations of 64 possible.
Uplifting [gfx_init_plane_horisontal2] best 15323621 combination reg byte a [ gfx_init_plane_horisontal2::$2 ] reg byte a [ gfx_init_plane_horisontal2::row#0 ] zp[1]:71 [ gfx_init_plane_horisontal2::ax#2 gfx_init_plane_horisontal2::ax#1 ] zp[2]:69 [ gfx_init_plane_horisontal2::gfxa#2 gfx_init_plane_horisontal2::gfxa#3 gfx_init_plane_horisontal2::gfxa#1 ] zp[1]:68 [ gfx_init_plane_horisontal2::ay#4 gfx_init_plane_horisontal2::ay#1 ]
Uplifting [gfx_init_plane_horisontal2] best 15323598 combination reg byte a [ gfx_init_plane_horisontal2::$2 ] reg byte a [ gfx_init_plane_horisontal2::row#0 ] zp[1]:71 [ gfx_init_plane_horisontal2::ax#2 gfx_init_plane_horisontal2::ax#1 ] zp[2]:69 [ gfx_init_plane_horisontal2::gfxa#2 gfx_init_plane_horisontal2::gfxa#3 gfx_init_plane_horisontal2::gfxa#1 ] zp[1]:68 [ gfx_init_plane_horisontal2::ay#4 gfx_init_plane_horisontal2::ay#1 ]
Limited combination testing to 10 combinations of 64 possible.
Uplifting [gfx_init_charset] best 15322721 combination zp[2]:135 [ gfx_init_charset::charset#2 gfx_init_charset::charset#3 gfx_init_charset::charset#1 ] reg byte x [ gfx_init_charset::l#2 gfx_init_charset::l#1 ] zp[2]:133 [ gfx_init_charset::chargen#2 gfx_init_charset::chargen#3 gfx_init_charset::chargen#1 ] zp[1]:132 [ gfx_init_charset::c#4 gfx_init_charset::c#1 ]
Uplifting [gfx_init_screen4] best 15321821 combination zp[2]:139 [ gfx_init_screen4::ch#2 gfx_init_screen4::ch#3 gfx_init_screen4::ch#1 ] reg byte x [ gfx_init_screen4::cx#2 gfx_init_screen4::cx#1 ] zp[1]:138 [ gfx_init_screen4::cy#4 gfx_init_screen4::cy#1 ]
Uplifting [gfx_init_plane_vertical] best 15320921 combination zp[2]:73 [ gfx_init_plane_vertical::gfxb#2 gfx_init_plane_vertical::gfxb#3 gfx_init_plane_vertical::gfxb#1 ] reg byte x [ gfx_init_plane_vertical::bx#2 gfx_init_plane_vertical::bx#1 ] zp[1]:72 [ gfx_init_plane_vertical::by#4 gfx_init_plane_vertical::by#1 ]
Uplifting [bitmap_line] best 15320867 combination zp[1]:310 [ bitmap_line::y1#0 ] reg byte x [ bitmap_line::y0#0 ] zp[1]:312 [ bitmap_line::yd#2 ] zp[1]:313 [ bitmap_line::yd#1 ] zp[1]:315 [ bitmap_line::yd#10 ] zp[1]:316 [ bitmap_line::yd#11 ] zp[1]:308 [ bitmap_line::x1#0 ] zp[1]:307 [ bitmap_line::x0#0 ] zp[1]:311 [ bitmap_line::xd#2 ] zp[1]:314 [ bitmap_line::xd#1 ]
Uplifting [gfx_init_charset] best 15322698 combination zp[2]:135 [ gfx_init_charset::charset#2 gfx_init_charset::charset#3 gfx_init_charset::charset#1 ] reg byte x [ gfx_init_charset::l#2 gfx_init_charset::l#1 ] zp[2]:133 [ gfx_init_charset::chargen#2 gfx_init_charset::chargen#3 gfx_init_charset::chargen#1 ] zp[1]:132 [ gfx_init_charset::c#4 gfx_init_charset::c#1 ]
Uplifting [gfx_init_screen4] best 15321798 combination zp[2]:139 [ gfx_init_screen4::ch#2 gfx_init_screen4::ch#3 gfx_init_screen4::ch#1 ] reg byte x [ gfx_init_screen4::cx#2 gfx_init_screen4::cx#1 ] zp[1]:138 [ gfx_init_screen4::cy#4 gfx_init_screen4::cy#1 ]
Uplifting [gfx_init_plane_vertical] best 15320898 combination zp[2]:73 [ gfx_init_plane_vertical::gfxb#2 gfx_init_plane_vertical::gfxb#3 gfx_init_plane_vertical::gfxb#1 ] reg byte x [ gfx_init_plane_vertical::bx#2 gfx_init_plane_vertical::bx#1 ] zp[1]:72 [ gfx_init_plane_vertical::by#4 gfx_init_plane_vertical::by#1 ]
Uplifting [bitmap_line] best 15320844 combination zp[1]:310 [ bitmap_line::y1#0 ] reg byte x [ bitmap_line::y0#0 ] zp[1]:312 [ bitmap_line::yd#2 ] zp[1]:313 [ bitmap_line::yd#1 ] zp[1]:315 [ bitmap_line::yd#10 ] zp[1]:316 [ bitmap_line::yd#11 ] zp[1]:308 [ bitmap_line::x1#0 ] zp[1]:307 [ bitmap_line::x0#0 ] zp[1]:311 [ bitmap_line::xd#2 ] zp[1]:314 [ bitmap_line::xd#1 ]
Limited combination testing to 10 combinations of 186624 possible.
Uplifting [gfx_init_vic_bitmap] best 15320867 combination zp[1]:96 [ gfx_init_vic_bitmap::l#2 gfx_init_vic_bitmap::l#1 ]
Uplifting [get_vic_screen] best 15320846 combination reg byte a [ get_vic_screen::idx#2 get_vic_screen::idx#0 get_vic_screen::idx#1 ] zp[2]:208 [ get_vic_screen::return#10 ] zp[2]:227 [ get_vic_screen::return#11 ] zp[2]:21 [ get_vic_screen::return#5 ]
Uplifting [get_plane] best 15320798 combination reg byte a [ get_plane::idx#10 get_plane::idx#1 get_plane::idx#0 ] zp[4]:160 [ get_plane::return#16 ] zp[4]:185 [ get_plane::return#17 ] zp[4]:26 [ get_plane::return#14 ]
Uplifting [get_vic_charset] best 15320789 combination reg byte a [ get_vic_charset::idx#0 ] zp[2]:217 [ get_vic_charset::return#4 ] zp[2]:23 [ get_vic_charset::return#2 ]
Uplifting [MOS6526_CIA] best 15320789 combination
Uplifting [MOS6569_VICII] best 15320789 combination
Uplifting [MOS6581_SID] best 15320789 combination
Uplifting [RADIX] best 15320789 combination
Uplifting [print_ln] best 15320789 combination
Uplifting [print_cls] best 15320789 combination
Uplifting [print_set_screen] best 15320789 combination
Uplifting [keyboard_init] best 15320789 combination
Uplifting [main] best 15320789 combination
Uplifting [gfx_init] best 15320789 combination
Uplifting [gfx_init_plane_vertical2] best 15320789 combination
Uplifting [gfx_init_plane_blank] best 15320789 combination
Uplifting [gfx_init_plane_full] best 15320789 combination
Uplifting [gfx_init_vic_bitmap] best 15320844 combination zp[1]:96 [ gfx_init_vic_bitmap::l#2 gfx_init_vic_bitmap::l#1 ]
Uplifting [get_vic_screen] best 15320823 combination reg byte a [ get_vic_screen::idx#2 get_vic_screen::idx#0 get_vic_screen::idx#1 ] zp[2]:208 [ get_vic_screen::return#10 ] zp[2]:227 [ get_vic_screen::return#11 ] zp[2]:21 [ get_vic_screen::return#5 ]
Uplifting [get_plane] best 15320775 combination reg byte a [ get_plane::idx#10 get_plane::idx#1 get_plane::idx#0 ] zp[4]:160 [ get_plane::return#16 ] zp[4]:185 [ get_plane::return#17 ] zp[4]:26 [ get_plane::return#14 ]
Uplifting [get_vic_charset] best 15320766 combination reg byte a [ get_vic_charset::idx#0 ] zp[2]:217 [ get_vic_charset::return#4 ] zp[2]:23 [ get_vic_charset::return#2 ]
Uplifting [MOS6526_CIA] best 15320766 combination
Uplifting [MOS6569_VICII] best 15320766 combination
Uplifting [MOS6581_SID] best 15320766 combination
Uplifting [RADIX] best 15320766 combination
Uplifting [print_ln] best 15320766 combination
Uplifting [print_cls] best 15320766 combination
Uplifting [print_set_screen] best 15320766 combination
Uplifting [keyboard_init] best 15320766 combination
Uplifting [main] best 15320766 combination
Uplifting [gfx_init] best 15320766 combination
Uplifting [gfx_init_plane_vertical2] best 15320766 combination
Uplifting [gfx_init_plane_blank] best 15320766 combination
Uplifting [gfx_init_plane_full] best 15320766 combination
Attempting to uplift remaining variables inzp[1]:18 [ keyboard_events_size#18 keyboard_events_size#106 keyboard_events_size#97 keyboard_events_size#47 keyboard_events_size#27 keyboard_events_size#24 keyboard_events_size#100 keyboard_events_size#4 keyboard_events_size#105 keyboard_events_size#1 keyboard_events_size#2 ]
Uplifting [] best 15320789 combination zp[1]:18 [ keyboard_events_size#18 keyboard_events_size#106 keyboard_events_size#97 keyboard_events_size#47 keyboard_events_size#27 keyboard_events_size#24 keyboard_events_size#100 keyboard_events_size#4 keyboard_events_size#105 keyboard_events_size#1 keyboard_events_size#2 ]
Uplifting [] best 15320766 combination zp[1]:18 [ keyboard_events_size#18 keyboard_events_size#106 keyboard_events_size#97 keyboard_events_size#47 keyboard_events_size#27 keyboard_events_size#24 keyboard_events_size#100 keyboard_events_size#4 keyboard_events_size#105 keyboard_events_size#1 keyboard_events_size#2 ]
Attempting to uplift remaining variables inzp[1]:252 [ keyboard_event_scan::event_type#0 ]
Uplifting [keyboard_event_scan] best 14720789 combination reg byte a [ keyboard_event_scan::event_type#0 ]
Uplifting [keyboard_event_scan] best 14720766 combination reg byte a [ keyboard_event_scan::event_type#0 ]
Attempting to uplift remaining variables inzp[1]:253 [ keyboard_event_scan::$23 ]
Uplifting [keyboard_event_scan] best 14120789 combination reg byte a [ keyboard_event_scan::$23 ]
Uplifting [keyboard_event_scan] best 14120766 combination reg byte a [ keyboard_event_scan::$23 ]
Attempting to uplift remaining variables inzp[1]:16 [ keyboard_event_scan::col#2 keyboard_event_scan::col#1 ]
Uplifting [keyboard_event_scan] best 12620789 combination reg byte x [ keyboard_event_scan::col#2 keyboard_event_scan::col#1 ]
Uplifting [keyboard_event_scan] best 12620766 combination reg byte x [ keyboard_event_scan::col#2 keyboard_event_scan::col#1 ]
Attempting to uplift remaining variables inzp[1]:17 [ keyboard_event_scan::keycode#10 keyboard_event_scan::keycode#11 keyboard_event_scan::keycode#13 keyboard_event_scan::keycode#14 keyboard_event_scan::keycode#1 ]
Uplifting [keyboard_event_scan] best 12620789 combination zp[1]:17 [ keyboard_event_scan::keycode#10 keyboard_event_scan::keycode#11 keyboard_event_scan::keycode#13 keyboard_event_scan::keycode#14 keyboard_event_scan::keycode#1 ]
Uplifting [keyboard_event_scan] best 12620766 combination zp[1]:17 [ keyboard_event_scan::keycode#10 keyboard_event_scan::keycode#11 keyboard_event_scan::keycode#13 keyboard_event_scan::keycode#14 keyboard_event_scan::keycode#1 ]
Attempting to uplift remaining variables inzp[1]:14 [ keyboard_event_scan::row#2 keyboard_event_scan::row#1 ]
Uplifting [keyboard_event_scan] best 12620789 combination zp[1]:14 [ keyboard_event_scan::row#2 keyboard_event_scan::row#1 ]
Uplifting [keyboard_event_scan] best 12620766 combination zp[1]:14 [ keyboard_event_scan::row#2 keyboard_event_scan::row#1 ]
Attempting to uplift remaining variables inzp[1]:240 [ keyboard_matrix_read::return#2 ]
Uplifting [keyboard_matrix_read] best 12560789 combination reg byte a [ keyboard_matrix_read::return#2 ]
Uplifting [keyboard_matrix_read] best 12560766 combination reg byte a [ keyboard_matrix_read::return#2 ]
Attempting to uplift remaining variables inzp[1]:241 [ keyboard_event_scan::row_scan#0 ]
Uplifting [keyboard_event_scan] best 12560789 combination zp[1]:241 [ keyboard_event_scan::row_scan#0 ]
Uplifting [keyboard_event_scan] best 12560766 combination zp[1]:241 [ keyboard_event_scan::row_scan#0 ]
Attempting to uplift remaining variables inzp[1]:265 [ form_field_ptr::x#0 ]
Uplifting [form_field_ptr] best 12560789 combination zp[1]:265 [ form_field_ptr::x#0 ]
Uplifting [form_field_ptr] best 12560766 combination zp[1]:265 [ form_field_ptr::x#0 ]
Attempting to uplift remaining variables inzp[1]:103 [ bitmap_plot::x#4 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#3 bitmap_plot::x#2 ]
Uplifting [bitmap_plot] best 12559583 combination reg byte y [ bitmap_plot::x#4 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#3 bitmap_plot::x#2 ]
Uplifting [bitmap_plot] best 12559560 combination reg byte y [ bitmap_plot::x#4 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#3 bitmap_plot::x#2 ]
Attempting to uplift remaining variables inzp[1]:255 [ keyboard_event_pressed::row_bits#0 ]
Uplifting [keyboard_event_pressed] best 12559583 combination zp[1]:255 [ keyboard_event_pressed::row_bits#0 ]
Uplifting [keyboard_event_pressed] best 12559560 combination zp[1]:255 [ keyboard_event_pressed::row_bits#0 ]
Attempting to uplift remaining variables inzp[1]:19 [ keyboard_event_pressed::keycode#4 ]
Uplifting [keyboard_event_pressed] best 12559583 combination zp[1]:19 [ keyboard_event_pressed::keycode#4 ]
Uplifting [keyboard_event_pressed] best 12559560 combination zp[1]:19 [ keyboard_event_pressed::keycode#4 ]
Attempting to uplift remaining variables inzp[1]:102 [ bitmap_line_xdyi::e#3 bitmap_line_xdyi::e#0 bitmap_line_xdyi::e#6 bitmap_line_xdyi::e#2 bitmap_line_xdyi::e#1 ]
Uplifting [bitmap_line_xdyi] best 12559583 combination zp[1]:102 [ bitmap_line_xdyi::e#3 bitmap_line_xdyi::e#0 bitmap_line_xdyi::e#6 bitmap_line_xdyi::e#2 bitmap_line_xdyi::e#1 ]
Uplifting [bitmap_line_xdyi] best 12559560 combination zp[1]:102 [ bitmap_line_xdyi::e#3 bitmap_line_xdyi::e#0 bitmap_line_xdyi::e#6 bitmap_line_xdyi::e#2 bitmap_line_xdyi::e#1 ]
Attempting to uplift remaining variables inzp[1]:110 [ bitmap_line_ydxi::e#3 bitmap_line_ydxi::e#0 bitmap_line_ydxi::e#6 bitmap_line_ydxi::e#2 bitmap_line_ydxi::e#1 ]
Uplifting [bitmap_line_ydxi] best 12559583 combination zp[1]:110 [ bitmap_line_ydxi::e#3 bitmap_line_ydxi::e#0 bitmap_line_ydxi::e#6 bitmap_line_ydxi::e#2 bitmap_line_ydxi::e#1 ]
Uplifting [bitmap_line_ydxi] best 12559560 combination zp[1]:110 [ bitmap_line_ydxi::e#3 bitmap_line_ydxi::e#0 bitmap_line_ydxi::e#6 bitmap_line_ydxi::e#2 bitmap_line_ydxi::e#1 ]
Attempting to uplift remaining variables inzp[1]:116 [ bitmap_line_xdyd::e#3 bitmap_line_xdyd::e#0 bitmap_line_xdyd::e#6 bitmap_line_xdyd::e#2 bitmap_line_xdyd::e#1 ]
Uplifting [bitmap_line_xdyd] best 12559583 combination zp[1]:116 [ bitmap_line_xdyd::e#3 bitmap_line_xdyd::e#0 bitmap_line_xdyd::e#6 bitmap_line_xdyd::e#2 bitmap_line_xdyd::e#1 ]
Uplifting [bitmap_line_xdyd] best 12559560 combination zp[1]:116 [ bitmap_line_xdyd::e#3 bitmap_line_xdyd::e#0 bitmap_line_xdyd::e#6 bitmap_line_xdyd::e#2 bitmap_line_xdyd::e#1 ]
Attempting to uplift remaining variables inzp[1]:122 [ bitmap_line_ydxd::e#3 bitmap_line_ydxd::e#0 bitmap_line_ydxd::e#6 bitmap_line_ydxd::e#2 bitmap_line_ydxd::e#1 ]
Uplifting [bitmap_line_ydxd] best 12559583 combination zp[1]:122 [ bitmap_line_ydxd::e#3 bitmap_line_ydxd::e#0 bitmap_line_ydxd::e#6 bitmap_line_ydxd::e#2 bitmap_line_ydxd::e#1 ]
Uplifting [bitmap_line_ydxd] best 12559560 combination zp[1]:122 [ bitmap_line_ydxd::e#3 bitmap_line_ydxd::e#0 bitmap_line_ydxd::e#6 bitmap_line_ydxd::e#2 bitmap_line_ydxd::e#1 ]
Attempting to uplift remaining variables inzp[1]:108 [ bitmap_line_ydxi::x#3 bitmap_line_ydxi::x#5 bitmap_line_ydxi::x#1 bitmap_line_ydxi::x#0 bitmap_line_ydxi::x#6 bitmap_line_ydxi::x#2 ]
Uplifting [bitmap_line_ydxi] best 12559583 combination zp[1]:108 [ bitmap_line_ydxi::x#3 bitmap_line_ydxi::x#5 bitmap_line_ydxi::x#1 bitmap_line_ydxi::x#0 bitmap_line_ydxi::x#6 bitmap_line_ydxi::x#2 ]
Uplifting [bitmap_line_ydxi] best 12559560 combination zp[1]:108 [ bitmap_line_ydxi::x#3 bitmap_line_ydxi::x#5 bitmap_line_ydxi::x#1 bitmap_line_ydxi::x#0 bitmap_line_ydxi::x#6 bitmap_line_ydxi::x#2 ]
Attempting to uplift remaining variables inzp[1]:120 [ bitmap_line_ydxd::x#3 bitmap_line_ydxd::x#5 bitmap_line_ydxd::x#0 bitmap_line_ydxd::x#1 bitmap_line_ydxd::x#6 bitmap_line_ydxd::x#2 ]
Uplifting [bitmap_line_ydxd] best 12559583 combination zp[1]:120 [ bitmap_line_ydxd::x#3 bitmap_line_ydxd::x#5 bitmap_line_ydxd::x#0 bitmap_line_ydxd::x#1 bitmap_line_ydxd::x#6 bitmap_line_ydxd::x#2 ]
Uplifting [bitmap_line_ydxd] best 12559560 combination zp[1]:120 [ bitmap_line_ydxd::x#3 bitmap_line_ydxd::x#5 bitmap_line_ydxd::x#0 bitmap_line_ydxd::x#1 bitmap_line_ydxd::x#6 bitmap_line_ydxd::x#2 ]
Attempting to uplift remaining variables inzp[1]:257 [ keyboard_event_pressed::return#10 ]
Uplifting [keyboard_event_pressed] best 12559568 combination reg byte a [ keyboard_event_pressed::return#10 ]
Uplifting [keyboard_event_pressed] best 12559545 combination reg byte a [ keyboard_event_pressed::return#10 ]
Attempting to uplift remaining variables inzp[1]:242 [ keyboard_event_pressed::return#0 ]
Uplifting [keyboard_event_pressed] best 12559562 combination reg byte a [ keyboard_event_pressed::return#0 ]
Uplifting [keyboard_event_pressed] best 12559539 combination reg byte a [ keyboard_event_pressed::return#0 ]
Attempting to uplift remaining variables inzp[1]:243 [ keyboard_event_scan::$0 ]
Uplifting [keyboard_event_scan] best 12559556 combination reg byte a [ keyboard_event_scan::$0 ]
Uplifting [keyboard_event_scan] best 12559533 combination reg byte a [ keyboard_event_scan::$0 ]
Attempting to uplift remaining variables inzp[1]:244 [ keyboard_event_pressed::return#1 ]
Uplifting [keyboard_event_pressed] best 12559550 combination reg byte a [ keyboard_event_pressed::return#1 ]
Uplifting [keyboard_event_pressed] best 12559527 combination reg byte a [ keyboard_event_pressed::return#1 ]
Attempting to uplift remaining variables inzp[1]:245 [ keyboard_event_scan::$3 ]
Uplifting [keyboard_event_scan] best 12559544 combination reg byte a [ keyboard_event_scan::$3 ]
Uplifting [keyboard_event_scan] best 12559521 combination reg byte a [ keyboard_event_scan::$3 ]
Attempting to uplift remaining variables inzp[1]:246 [ keyboard_event_pressed::return#2 ]
Uplifting [keyboard_event_pressed] best 12559538 combination reg byte a [ keyboard_event_pressed::return#2 ]
Uplifting [keyboard_event_pressed] best 12559515 combination reg byte a [ keyboard_event_pressed::return#2 ]
Attempting to uplift remaining variables inzp[1]:247 [ keyboard_event_scan::$6 ]
Uplifting [keyboard_event_scan] best 12559532 combination reg byte a [ keyboard_event_scan::$6 ]
Uplifting [keyboard_event_scan] best 12559509 combination reg byte a [ keyboard_event_scan::$6 ]
Attempting to uplift remaining variables inzp[1]:248 [ keyboard_event_pressed::return#3 ]
Uplifting [keyboard_event_pressed] best 12559526 combination reg byte a [ keyboard_event_pressed::return#3 ]
Uplifting [keyboard_event_pressed] best 12559503 combination reg byte a [ keyboard_event_pressed::return#3 ]
Attempting to uplift remaining variables inzp[1]:249 [ keyboard_event_scan::$9 ]
Uplifting [keyboard_event_scan] best 12559520 combination reg byte a [ keyboard_event_scan::$9 ]
Uplifting [keyboard_event_scan] best 12559497 combination reg byte a [ keyboard_event_scan::$9 ]
Attempting to uplift remaining variables inzp[1]:100 [ bitmap_line_xdyi::x#3 bitmap_line_xdyi::x#6 bitmap_line_xdyi::x#1 bitmap_line_xdyi::x#0 bitmap_line_xdyi::x#2 ]
Uplifting [bitmap_line_xdyi] best 12559520 combination zp[1]:100 [ bitmap_line_xdyi::x#3 bitmap_line_xdyi::x#6 bitmap_line_xdyi::x#1 bitmap_line_xdyi::x#0 bitmap_line_xdyi::x#2 ]
Uplifting [bitmap_line_xdyi] best 12559497 combination zp[1]:100 [ bitmap_line_xdyi::x#3 bitmap_line_xdyi::x#6 bitmap_line_xdyi::x#1 bitmap_line_xdyi::x#0 bitmap_line_xdyi::x#2 ]
Attempting to uplift remaining variables inzp[1]:109 [ bitmap_line_ydxi::y#3 bitmap_line_ydxi::y#6 bitmap_line_ydxi::y#1 bitmap_line_ydxi::y#0 bitmap_line_ydxi::y#2 ]
Uplifting [bitmap_line_ydxi] best 12559520 combination zp[1]:109 [ bitmap_line_ydxi::y#3 bitmap_line_ydxi::y#6 bitmap_line_ydxi::y#1 bitmap_line_ydxi::y#0 bitmap_line_ydxi::y#2 ]
Uplifting [bitmap_line_ydxi] best 12559497 combination zp[1]:109 [ bitmap_line_ydxi::y#3 bitmap_line_ydxi::y#6 bitmap_line_ydxi::y#1 bitmap_line_ydxi::y#0 bitmap_line_ydxi::y#2 ]
Attempting to uplift remaining variables inzp[1]:114 [ bitmap_line_xdyd::x#3 bitmap_line_xdyd::x#6 bitmap_line_xdyd::x#1 bitmap_line_xdyd::x#0 bitmap_line_xdyd::x#2 ]
Uplifting [bitmap_line_xdyd] best 12559520 combination zp[1]:114 [ bitmap_line_xdyd::x#3 bitmap_line_xdyd::x#6 bitmap_line_xdyd::x#1 bitmap_line_xdyd::x#0 bitmap_line_xdyd::x#2 ]
Uplifting [bitmap_line_xdyd] best 12559497 combination zp[1]:114 [ bitmap_line_xdyd::x#3 bitmap_line_xdyd::x#6 bitmap_line_xdyd::x#1 bitmap_line_xdyd::x#0 bitmap_line_xdyd::x#2 ]
Attempting to uplift remaining variables inzp[1]:121 [ bitmap_line_ydxd::y#2 bitmap_line_ydxd::y#7 bitmap_line_ydxd::y#0 bitmap_line_ydxd::y#1 bitmap_line_ydxd::y#3 ]
Uplifting [bitmap_line_ydxd] best 12559520 combination zp[1]:121 [ bitmap_line_ydxd::y#2 bitmap_line_ydxd::y#7 bitmap_line_ydxd::y#0 bitmap_line_ydxd::y#1 bitmap_line_ydxd::y#3 ]
Uplifting [bitmap_line_ydxd] best 12559497 combination zp[1]:121 [ bitmap_line_ydxd::y#2 bitmap_line_ydxd::y#7 bitmap_line_ydxd::y#0 bitmap_line_ydxd::y#1 bitmap_line_ydxd::y#3 ]
Attempting to uplift remaining variables inzp[1]:32 [ form_field_idx#28 form_field_idx#1 form_field_idx#18 form_field_idx#31 form_field_idx#6 form_field_idx#5 ]
Uplifting [] best 12559520 combination zp[1]:32 [ form_field_idx#28 form_field_idx#1 form_field_idx#18 form_field_idx#31 form_field_idx#6 form_field_idx#5 ]
Uplifting [] best 12559497 combination zp[1]:32 [ form_field_idx#28 form_field_idx#1 form_field_idx#18 form_field_idx#31 form_field_idx#6 form_field_idx#5 ]
Attempting to uplift remaining variables inzp[1]:276 [ form_control::$15 ]
Uplifting [form_control] best 12559516 combination reg byte a [ form_control::$15 ]
Uplifting [form_control] best 12559493 combination reg byte a [ form_control::$15 ]
Attempting to uplift remaining variables inzp[1]:277 [ form_control::$22 ]
Uplifting [form_control] best 12559512 combination reg byte a [ form_control::$22 ]
Uplifting [form_control] best 12559489 combination reg byte a [ form_control::$22 ]
Attempting to uplift remaining variables inzp[1]:278 [ form_control::$13 ]
Uplifting [form_control] best 12559506 combination reg byte a [ form_control::$13 ]
Uplifting [form_control] best 12559483 combination reg byte a [ form_control::$13 ]
Attempting to uplift remaining variables inzp[1]:31 [ form_cursor_count#21 form_cursor_count#1 form_cursor_count#16 form_cursor_count#15 form_cursor_count#5 ]
Uplifting [] best 12559506 combination zp[1]:31 [ form_cursor_count#21 form_cursor_count#1 form_cursor_count#16 form_cursor_count#15 form_cursor_count#5 ]
Uplifting [] best 12559483 combination zp[1]:31 [ form_cursor_count#21 form_cursor_count#1 form_cursor_count#16 form_cursor_count#15 form_cursor_count#5 ]
Attempting to uplift remaining variables inzp[1]:98 [ bitmap_line_xdyi::xd#5 bitmap_line_xdyi::xd#1 bitmap_line_xdyi::xd#0 ]
Uplifting [bitmap_line_xdyi] best 12559506 combination zp[1]:98 [ bitmap_line_xdyi::xd#5 bitmap_line_xdyi::xd#1 bitmap_line_xdyi::xd#0 ]
Uplifting [bitmap_line_xdyi] best 12559483 combination zp[1]:98 [ bitmap_line_xdyi::xd#5 bitmap_line_xdyi::xd#1 bitmap_line_xdyi::xd#0 ]
Attempting to uplift remaining variables inzp[1]:106 [ bitmap_line_ydxi::yd#5 bitmap_line_ydxi::yd#1 bitmap_line_ydxi::yd#0 ]
Uplifting [bitmap_line_ydxi] best 12559506 combination zp[1]:106 [ bitmap_line_ydxi::yd#5 bitmap_line_ydxi::yd#1 bitmap_line_ydxi::yd#0 ]
Uplifting [bitmap_line_ydxi] best 12559483 combination zp[1]:106 [ bitmap_line_ydxi::yd#5 bitmap_line_ydxi::yd#1 bitmap_line_ydxi::yd#0 ]
Attempting to uplift remaining variables inzp[1]:112 [ bitmap_line_xdyd::xd#5 bitmap_line_xdyd::xd#1 bitmap_line_xdyd::xd#0 ]
Uplifting [bitmap_line_xdyd] best 12559506 combination zp[1]:112 [ bitmap_line_xdyd::xd#5 bitmap_line_xdyd::xd#1 bitmap_line_xdyd::xd#0 ]
Uplifting [bitmap_line_xdyd] best 12559483 combination zp[1]:112 [ bitmap_line_xdyd::xd#5 bitmap_line_xdyd::xd#1 bitmap_line_xdyd::xd#0 ]
Attempting to uplift remaining variables inzp[1]:118 [ bitmap_line_ydxd::yd#5 bitmap_line_ydxd::yd#0 bitmap_line_ydxd::yd#1 ]
Uplifting [bitmap_line_ydxd] best 12559506 combination zp[1]:118 [ bitmap_line_ydxd::yd#5 bitmap_line_ydxd::yd#0 bitmap_line_ydxd::yd#1 ]
Uplifting [bitmap_line_ydxd] best 12559483 combination zp[1]:118 [ bitmap_line_ydxd::yd#5 bitmap_line_ydxd::yd#0 bitmap_line_ydxd::yd#1 ]
Attempting to uplift remaining variables inzp[1]:274 [ form_control::key_event#0 ]
Uplifting [form_control] best 12559494 combination reg byte a [ form_control::key_event#0 ]
Uplifting [form_control] best 12559471 combination reg byte a [ form_control::key_event#0 ]
Attempting to uplift remaining variables inzp[1]:97 [ bitmap_line_xdyi::yd#2 bitmap_line_xdyi::yd#1 bitmap_line_xdyi::yd#0 ]
Uplifting [bitmap_line_xdyi] best 12559494 combination zp[1]:97 [ bitmap_line_xdyi::yd#2 bitmap_line_xdyi::yd#1 bitmap_line_xdyi::yd#0 ]
Uplifting [bitmap_line_xdyi] best 12559471 combination zp[1]:97 [ bitmap_line_xdyi::yd#2 bitmap_line_xdyi::yd#1 bitmap_line_xdyi::yd#0 ]
Attempting to uplift remaining variables inzp[1]:105 [ bitmap_line_ydxi::xd#2 bitmap_line_ydxi::xd#1 bitmap_line_ydxi::xd#0 ]
Uplifting [bitmap_line_ydxi] best 12559494 combination zp[1]:105 [ bitmap_line_ydxi::xd#2 bitmap_line_ydxi::xd#1 bitmap_line_ydxi::xd#0 ]
Uplifting [bitmap_line_ydxi] best 12559471 combination zp[1]:105 [ bitmap_line_ydxi::xd#2 bitmap_line_ydxi::xd#1 bitmap_line_ydxi::xd#0 ]
Attempting to uplift remaining variables inzp[1]:111 [ bitmap_line_xdyd::yd#2 bitmap_line_xdyd::yd#1 bitmap_line_xdyd::yd#0 ]
Uplifting [bitmap_line_xdyd] best 12559494 combination zp[1]:111 [ bitmap_line_xdyd::yd#2 bitmap_line_xdyd::yd#1 bitmap_line_xdyd::yd#0 ]
Uplifting [bitmap_line_xdyd] best 12559471 combination zp[1]:111 [ bitmap_line_xdyd::yd#2 bitmap_line_xdyd::yd#1 bitmap_line_xdyd::yd#0 ]
Attempting to uplift remaining variables inzp[1]:117 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::xd#0 bitmap_line_ydxd::xd#1 ]
Uplifting [bitmap_line_ydxd] best 12559494 combination zp[1]:117 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::xd#0 bitmap_line_ydxd::xd#1 ]
Uplifting [bitmap_line_ydxd] best 12559471 combination zp[1]:117 [ bitmap_line_ydxd::xd#2 bitmap_line_ydxd::xd#0 bitmap_line_ydxd::xd#1 ]
Attempting to uplift remaining variables inzp[1]:99 [ bitmap_line_xdyi::x1#6 bitmap_line_xdyi::x1#1 bitmap_line_xdyi::x1#0 ]
Uplifting [bitmap_line_xdyi] best 12559494 combination zp[1]:99 [ bitmap_line_xdyi::x1#6 bitmap_line_xdyi::x1#1 bitmap_line_xdyi::x1#0 ]
Uplifting [bitmap_line_xdyi] best 12559471 combination zp[1]:99 [ bitmap_line_xdyi::x1#6 bitmap_line_xdyi::x1#1 bitmap_line_xdyi::x1#0 ]
Attempting to uplift remaining variables inzp[1]:107 [ bitmap_line_ydxi::y1#6 bitmap_line_ydxi::y1#1 bitmap_line_ydxi::y1#0 ]
Uplifting [bitmap_line_ydxi] best 12559494 combination zp[1]:107 [ bitmap_line_ydxi::y1#6 bitmap_line_ydxi::y1#1 bitmap_line_ydxi::y1#0 ]
Uplifting [bitmap_line_ydxi] best 12559471 combination zp[1]:107 [ bitmap_line_ydxi::y1#6 bitmap_line_ydxi::y1#1 bitmap_line_ydxi::y1#0 ]
Attempting to uplift remaining variables inzp[1]:113 [ bitmap_line_xdyd::x1#6 bitmap_line_xdyd::x1#1 bitmap_line_xdyd::x1#0 ]
Uplifting [bitmap_line_xdyd] best 12559494 combination zp[1]:113 [ bitmap_line_xdyd::x1#6 bitmap_line_xdyd::x1#1 bitmap_line_xdyd::x1#0 ]
Uplifting [bitmap_line_xdyd] best 12559471 combination zp[1]:113 [ bitmap_line_xdyd::x1#6 bitmap_line_xdyd::x1#1 bitmap_line_xdyd::x1#0 ]
Attempting to uplift remaining variables inzp[1]:119 [ bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y1#0 bitmap_line_ydxd::y1#1 ]
Uplifting [bitmap_line_ydxd] best 12559494 combination zp[1]:119 [ bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y1#0 bitmap_line_ydxd::y1#1 ]
Uplifting [bitmap_line_ydxd] best 12559471 combination zp[1]:119 [ bitmap_line_ydxd::y1#6 bitmap_line_ydxd::y1#0 bitmap_line_ydxd::y1#1 ]
Attempting to uplift remaining variables inzp[1]:10 [ gfx_mode::cx#2 gfx_mode::cx#1 ]
Uplifting [gfx_mode] best 12550494 combination reg byte x [ gfx_mode::cx#2 gfx_mode::cx#1 ]
Uplifting [gfx_mode] best 12550471 combination reg byte x [ gfx_mode::cx#2 gfx_mode::cx#1 ]
Attempting to uplift remaining variables inzp[1]:259 [ form_control::return#0 ]
Uplifting [form_control] best 12544494 combination reg byte a [ form_control::return#0 ]
Uplifting [form_control] best 12544471 combination reg byte a [ form_control::return#0 ]
Attempting to uplift remaining variables inzp[1]:280 [ form_set_screen::$1 ]
Uplifting [form_set_screen] best 12543894 combination reg byte a [ form_set_screen::$1 ]
Uplifting [form_set_screen] best 12543871 combination reg byte a [ form_set_screen::$1 ]
Attempting to uplift remaining variables inzp[1]:88 [ gfx_init_plane_charset8::cp#2 gfx_init_plane_charset8::cp#1 ]
Uplifting [gfx_init_plane_charset8] best 12534894 combination reg byte x [ gfx_init_plane_charset8::cp#2 gfx_init_plane_charset8::cp#1 ]
Uplifting [gfx_init_plane_charset8] best 12534871 combination reg byte x [ gfx_init_plane_charset8::cp#2 gfx_init_plane_charset8::cp#1 ]
Attempting to uplift remaining variables inzp[1]:84 [ gfx_init_plane_charset8::bits#2 gfx_init_plane_charset8::bits#0 gfx_init_plane_charset8::bits#1 ]
Uplifting [gfx_init_plane_charset8] best 12534894 combination zp[1]:84 [ gfx_init_plane_charset8::bits#2 gfx_init_plane_charset8::bits#0 gfx_init_plane_charset8::bits#1 ]
Uplifting [gfx_init_plane_charset8] best 12534871 combination zp[1]:84 [ gfx_init_plane_charset8::bits#2 gfx_init_plane_charset8::bits#0 gfx_init_plane_charset8::bits#1 ]
Attempting to uplift remaining variables inzp[1]:87 [ gfx_init_plane_charset8::col#2 gfx_init_plane_charset8::col#5 gfx_init_plane_charset8::col#6 gfx_init_plane_charset8::col#1 ]
Uplifting [gfx_init_plane_charset8] best 12534894 combination zp[1]:87 [ gfx_init_plane_charset8::col#2 gfx_init_plane_charset8::col#5 gfx_init_plane_charset8::col#6 gfx_init_plane_charset8::col#1 ]
Uplifting [gfx_init_plane_charset8] best 12534871 combination zp[1]:87 [ gfx_init_plane_charset8::col#2 gfx_init_plane_charset8::col#5 gfx_init_plane_charset8::col#6 gfx_init_plane_charset8::col#1 ]
Attempting to uplift remaining variables inzp[1]:33 [ form_mode::preset_current#6 form_mode::preset_current#0 form_mode::preset_current#1 ]
Uplifting [form_mode] best 12534894 combination zp[1]:33 [ form_mode::preset_current#6 form_mode::preset_current#0 form_mode::preset_current#1 ]
Uplifting [form_mode] best 12534871 combination zp[1]:33 [ form_mode::preset_current#6 form_mode::preset_current#0 form_mode::preset_current#1 ]
Attempting to uplift remaining variables inzp[1]:11 [ gfx_mode::j#2 gfx_mode::j#1 ]
Uplifting [gfx_mode] best 12533694 combination reg byte x [ gfx_mode::j#2 gfx_mode::j#1 ]
Uplifting [gfx_mode] best 12533671 combination reg byte x [ gfx_mode::j#2 gfx_mode::j#1 ]
Attempting to uplift remaining variables inzp[1]:12 [ gfx_mode::i#2 gfx_mode::i#1 ]
Uplifting [gfx_mode] best 12532494 combination reg byte x [ gfx_mode::i#2 gfx_mode::i#1 ]
Uplifting [gfx_mode] best 12532471 combination reg byte x [ gfx_mode::i#2 gfx_mode::i#1 ]
Attempting to uplift remaining variables inzp[1]:46 [ form_control::return#2 ]
Uplifting [form_control] best 12531485 combination reg byte x [ form_control::return#2 ]
Uplifting [form_control] best 12531462 combination reg byte x [ form_control::return#2 ]
Attempting to uplift remaining variables inzp[1]:129 [ bitmap_init::y#2 bitmap_init::y#1 ]
Uplifting [bitmap_init] best 12531305 combination reg byte x [ bitmap_init::y#2 bitmap_init::y#1 ]
Uplifting [bitmap_init] best 12531282 combination reg byte x [ bitmap_init::y#2 bitmap_init::y#1 ]
Attempting to uplift remaining variables inzp[1]:237 [ keyboard_event_get::return#3 ]
Uplifting [keyboard_event_get] best 12530705 combination reg byte a [ keyboard_event_get::return#3 ]
Uplifting [keyboard_event_get] best 12530682 combination reg byte a [ keyboard_event_get::return#3 ]
Attempting to uplift remaining variables inzp[1]:238 [ gfx_mode::keyboard_event#0 ]
Uplifting [gfx_mode] best 12530105 combination reg byte a [ gfx_mode::keyboard_event#0 ]
Uplifting [gfx_mode] best 12530082 combination reg byte a [ gfx_mode::keyboard_event#0 ]
Attempting to uplift remaining variables inzp[1]:330 [ bitmap_init::$0 ]
Uplifting [bitmap_init] best 12530065 combination reg byte a [ bitmap_init::$0 ]
Uplifting [bitmap_init] best 12530042 combination reg byte a [ bitmap_init::$0 ]
Attempting to uplift remaining variables inzp[1]:332 [ bitmap_init::$7 ]
Uplifting [bitmap_init] best 12530005 combination reg byte a [ bitmap_init::$7 ]
Uplifting [bitmap_init] best 12529982 combination reg byte a [ bitmap_init::$7 ]
Attempting to uplift remaining variables inzp[1]:333 [ bitmap_init::$8 ]
Uplifting [bitmap_init] best 12529945 combination reg byte a [ bitmap_init::$8 ]
Uplifting [bitmap_init] best 12529922 combination reg byte a [ bitmap_init::$8 ]
Attempting to uplift remaining variables inzp[1]:334 [ bitmap_init::$9 ]
Uplifting [bitmap_init] best 12529885 combination reg byte a [ bitmap_init::$9 ]
Uplifting [bitmap_init] best 12529862 combination reg byte a [ bitmap_init::$9 ]
Attempting to uplift remaining variables inzp[1]:338 [ gfx_init_screen3::$3 ]
Uplifting [gfx_init_screen3] best 12529285 combination reg byte a [ gfx_init_screen3::$3 ]
Uplifting [gfx_init_screen3] best 12529262 combination reg byte a [ gfx_init_screen3::$3 ]
Attempting to uplift remaining variables inzp[1]:343 [ gfx_init_screen2::$4 ]
Uplifting [gfx_init_screen2] best 12528685 combination reg byte a [ gfx_init_screen2::$4 ]
Uplifting [gfx_init_screen2] best 12528662 combination reg byte a [ gfx_init_screen2::$4 ]
Attempting to uplift remaining variables inzp[1]:345 [ gfx_init_screen1::$1 ]
Uplifting [gfx_init_screen1] best 12528085 combination reg byte a [ gfx_init_screen1::$1 ]
Uplifting [gfx_init_screen1] best 12528062 combination reg byte a [ gfx_init_screen1::$1 ]
Attempting to uplift remaining variables inzp[1]:349 [ gfx_init_screen0::$3 ]
Uplifting [gfx_init_screen0] best 12527485 combination reg byte a [ gfx_init_screen0::$3 ]
Uplifting [gfx_init_screen0] best 12527462 combination reg byte a [ gfx_init_screen0::$3 ]
Attempting to uplift remaining variables inzp[1]:143 [ gfx_init_screen3::cx#2 gfx_init_screen3::cx#1 ]
Uplifting [gfx_init_screen3] best 12526485 combination reg byte x [ gfx_init_screen3::cx#2 gfx_init_screen3::cx#1 ]
Uplifting [gfx_init_screen3] best 12526462 combination reg byte x [ gfx_init_screen3::cx#2 gfx_init_screen3::cx#1 ]
Attempting to uplift remaining variables inzp[1]:155 [ gfx_init_screen0::cx#2 gfx_init_screen0::cx#1 ]
Uplifting [gfx_init_screen0] best 12525485 combination reg byte x [ gfx_init_screen0::cx#2 gfx_init_screen0::cx#1 ]
Uplifting [gfx_init_screen0] best 12525462 combination reg byte x [ gfx_init_screen0::cx#2 gfx_init_screen0::cx#1 ]
Attempting to uplift remaining variables inzp[1]:71 [ gfx_init_plane_horisontal2::ax#2 gfx_init_plane_horisontal2::ax#1 ]
Uplifting [gfx_init_plane_horisontal2] best 12524585 combination reg byte x [ gfx_init_plane_horisontal2::ax#2 gfx_init_plane_horisontal2::ax#1 ]
Uplifting [gfx_init_plane_horisontal2] best 12524562 combination reg byte x [ gfx_init_plane_horisontal2::ax#2 gfx_init_plane_horisontal2::ax#1 ]
Attempting to uplift remaining variables inzp[1]:147 [ gfx_init_screen2::cx#2 gfx_init_screen2::cx#1 ]
Uplifting [gfx_init_screen2] best 12523585 combination reg byte x [ gfx_init_screen2::cx#2 gfx_init_screen2::cx#1 ]
Uplifting [gfx_init_screen2] best 12523562 combination reg byte x [ gfx_init_screen2::cx#2 gfx_init_screen2::cx#1 ]
Attempting to uplift remaining variables inzp[1]:63 [ gfx_init_plane_fill::by#4 gfx_init_plane_fill::by#1 ]
Uplifting [gfx_init_plane_fill] best 12523585 combination zp[1]:63 [ gfx_init_plane_fill::by#4 gfx_init_plane_fill::by#1 ]
Uplifting [gfx_init_plane_fill] best 12523562 combination zp[1]:63 [ gfx_init_plane_fill::by#4 gfx_init_plane_fill::by#1 ]
Attempting to uplift remaining variables inzp[1]:123 [ bitmap_clear::y#4 bitmap_clear::y#1 ]
Uplifting [bitmap_clear] best 12523585 combination zp[1]:123 [ bitmap_clear::y#4 bitmap_clear::y#1 ]
Uplifting [bitmap_clear] best 12523562 combination zp[1]:123 [ bitmap_clear::y#4 bitmap_clear::y#1 ]
Attempting to uplift remaining variables inzp[1]:5 [ gfx_mode::cy#4 gfx_mode::cy#1 ]
Uplifting [gfx_mode] best 12523585 combination zp[1]:5 [ gfx_mode::cy#4 gfx_mode::cy#1 ]
Uplifting [gfx_mode] best 12523562 combination zp[1]:5 [ gfx_mode::cy#4 gfx_mode::cy#1 ]
Attempting to uplift remaining variables inzp[1]:83 [ gfx_init_plane_charset8::cr#6 gfx_init_plane_charset8::cr#1 ]
Uplifting [gfx_init_plane_charset8] best 12523585 combination zp[1]:83 [ gfx_init_plane_charset8::cr#6 gfx_init_plane_charset8::cr#1 ]
Uplifting [gfx_init_plane_charset8] best 12523562 combination zp[1]:83 [ gfx_init_plane_charset8::cr#6 gfx_init_plane_charset8::cr#1 ]
Attempting to uplift remaining variables inzp[1]:340 [ gfx_init_screen2::col#0 ]
Uplifting [gfx_init_screen2] best 12523485 combination reg byte y [ gfx_init_screen2::col#0 ]
Uplifting [gfx_init_screen2] best 12523462 combination reg byte y [ gfx_init_screen2::col#0 ]
Attempting to uplift remaining variables inzp[1]:336 [ gfx_init_screen3::$1 ]
Uplifting [gfx_init_screen3] best 12523485 combination zp[1]:336 [ gfx_init_screen3::$1 ]
Uplifting [gfx_init_screen3] best 12523462 combination zp[1]:336 [ gfx_init_screen3::$1 ]
Attempting to uplift remaining variables inzp[1]:341 [ gfx_init_screen2::col2#0 ]
Uplifting [gfx_init_screen2] best 12523485 combination zp[1]:341 [ gfx_init_screen2::col2#0 ]
Uplifting [gfx_init_screen2] best 12523462 combination zp[1]:341 [ gfx_init_screen2::col2#0 ]
Attempting to uplift remaining variables inzp[1]:347 [ gfx_init_screen0::$1 ]
Uplifting [gfx_init_screen0] best 12523485 combination zp[1]:347 [ gfx_init_screen0::$1 ]
Uplifting [gfx_init_screen0] best 12523462 combination zp[1]:347 [ gfx_init_screen0::$1 ]
Attempting to uplift remaining variables inzp[1]:310 [ bitmap_line::y1#0 ]
Uplifting [bitmap_line] best 12523485 combination zp[1]:310 [ bitmap_line::y1#0 ]
Uplifting [bitmap_line] best 12523462 combination zp[1]:310 [ bitmap_line::y1#0 ]
Attempting to uplift remaining variables inzp[1]:62 [ gfx_init_plane_fill::fill#6 ]
Uplifting [gfx_init_plane_fill] best 12523485 combination zp[1]:62 [ gfx_init_plane_fill::fill#6 ]
Uplifting [gfx_init_plane_fill] best 12523462 combination zp[1]:62 [ gfx_init_plane_fill::fill#6 ]
Attempting to uplift remaining variables inzp[1]:331 [ bitmap_init::$10 ]
Uplifting [bitmap_init] best 12523485 combination zp[1]:331 [ bitmap_init::$10 ]
Uplifting [bitmap_init] best 12523462 combination zp[1]:331 [ bitmap_init::$10 ]
Attempting to uplift remaining variables inzp[1]:312 [ bitmap_line::yd#2 ]
Uplifting [bitmap_line] best 12523475 combination reg byte y [ bitmap_line::yd#2 ]
Uplifting [bitmap_line] best 12523452 combination reg byte y [ bitmap_line::yd#2 ]
Attempting to uplift remaining variables inzp[1]:313 [ bitmap_line::yd#1 ]
Uplifting [bitmap_line] best 12523465 combination reg byte y [ bitmap_line::yd#1 ]
Uplifting [bitmap_line] best 12523442 combination reg byte y [ bitmap_line::yd#1 ]
Attempting to uplift remaining variables inzp[1]:315 [ bitmap_line::yd#10 ]
Uplifting [bitmap_line] best 12523455 combination reg byte y [ bitmap_line::yd#10 ]
Uplifting [bitmap_line] best 12523432 combination reg byte y [ bitmap_line::yd#10 ]
Attempting to uplift remaining variables inzp[1]:316 [ bitmap_line::yd#11 ]
Uplifting [bitmap_line] best 12523445 combination reg byte y [ bitmap_line::yd#11 ]
Uplifting [bitmap_line] best 12523422 combination reg byte y [ bitmap_line::yd#11 ]
Attempting to uplift remaining variables inzp[1]:308 [ bitmap_line::x1#0 ]
Uplifting [bitmap_line] best 12523445 combination zp[1]:308 [ bitmap_line::x1#0 ]
Uplifting [bitmap_line] best 12523422 combination zp[1]:308 [ bitmap_line::x1#0 ]
Attempting to uplift remaining variables inzp[1]:307 [ bitmap_line::x0#0 ]
Uplifting [bitmap_line] best 12523445 combination zp[1]:307 [ bitmap_line::x0#0 ]
Uplifting [bitmap_line] best 12523422 combination zp[1]:307 [ bitmap_line::x0#0 ]
Attempting to uplift remaining variables inzp[1]:311 [ bitmap_line::xd#2 ]
Uplifting [bitmap_line] best 12523445 combination zp[1]:311 [ bitmap_line::xd#2 ]
Uplifting [bitmap_line] best 12523422 combination zp[1]:311 [ bitmap_line::xd#2 ]
Attempting to uplift remaining variables inzp[1]:314 [ bitmap_line::xd#1 ]
Uplifting [bitmap_line] best 12523445 combination zp[1]:314 [ bitmap_line::xd#1 ]
Uplifting [bitmap_line] best 12523422 combination zp[1]:314 [ bitmap_line::xd#1 ]
Attempting to uplift remaining variables inzp[1]:96 [ gfx_init_vic_bitmap::l#2 gfx_init_vic_bitmap::l#1 ]
Uplifting [gfx_init_vic_bitmap] best 12523445 combination zp[1]:96 [ gfx_init_vic_bitmap::l#2 gfx_init_vic_bitmap::l#1 ]
Uplifting [gfx_init_vic_bitmap] best 12523422 combination zp[1]:96 [ gfx_init_vic_bitmap::l#2 gfx_init_vic_bitmap::l#1 ]
Attempting to uplift remaining variables inzp[1]:68 [ gfx_init_plane_horisontal2::ay#4 gfx_init_plane_horisontal2::ay#1 ]
Uplifting [gfx_init_plane_horisontal2] best 12523445 combination zp[1]:68 [ gfx_init_plane_horisontal2::ay#4 gfx_init_plane_horisontal2::ay#1 ]
Uplifting [gfx_init_plane_horisontal2] best 12523422 combination zp[1]:68 [ gfx_init_plane_horisontal2::ay#4 gfx_init_plane_horisontal2::ay#1 ]
Attempting to uplift remaining variables inzp[1]:150 [ gfx_init_screen1::cy#4 gfx_init_screen1::cy#1 ]
Uplifting [gfx_init_screen1] best 12523445 combination zp[1]:150 [ gfx_init_screen1::cy#4 gfx_init_screen1::cy#1 ]
Uplifting [gfx_init_screen1] best 12523422 combination zp[1]:150 [ gfx_init_screen1::cy#4 gfx_init_screen1::cy#1 ]
Attempting to uplift remaining variables inzp[1]:142 [ gfx_init_screen3::cy#4 gfx_init_screen3::cy#1 ]
Uplifting [gfx_init_screen3] best 12523445 combination zp[1]:142 [ gfx_init_screen3::cy#4 gfx_init_screen3::cy#1 ]
Uplifting [gfx_init_screen3] best 12523422 combination zp[1]:142 [ gfx_init_screen3::cy#4 gfx_init_screen3::cy#1 ]
Attempting to uplift remaining variables inzp[1]:154 [ gfx_init_screen0::cy#4 gfx_init_screen0::cy#1 ]
Uplifting [gfx_init_screen0] best 12523445 combination zp[1]:154 [ gfx_init_screen0::cy#4 gfx_init_screen0::cy#1 ]
Uplifting [gfx_init_screen0] best 12523422 combination zp[1]:154 [ gfx_init_screen0::cy#4 gfx_init_screen0::cy#1 ]
Attempting to uplift remaining variables inzp[1]:76 [ gfx_init_plane_horisontal::ay#4 gfx_init_plane_horisontal::ay#1 ]
Uplifting [gfx_init_plane_horisontal] best 12523445 combination zp[1]:76 [ gfx_init_plane_horisontal::ay#4 gfx_init_plane_horisontal::ay#1 ]
Uplifting [gfx_init_plane_horisontal] best 12523422 combination zp[1]:76 [ gfx_init_plane_horisontal::ay#4 gfx_init_plane_horisontal::ay#1 ]
Attempting to uplift remaining variables inzp[1]:146 [ gfx_init_screen2::cy#4 gfx_init_screen2::cy#1 ]
Uplifting [gfx_init_screen2] best 12523445 combination zp[1]:146 [ gfx_init_screen2::cy#4 gfx_init_screen2::cy#1 ]
Uplifting [gfx_init_screen2] best 12523422 combination zp[1]:146 [ gfx_init_screen2::cy#4 gfx_init_screen2::cy#1 ]
Attempting to uplift remaining variables inzp[1]:90 [ gfx_init_plane_8bppchunky::y#6 gfx_init_plane_8bppchunky::y#1 ]
Uplifting [gfx_init_plane_8bppchunky] best 12523445 combination zp[1]:90 [ gfx_init_plane_8bppchunky::y#6 gfx_init_plane_8bppchunky::y#1 ]
Uplifting [gfx_init_plane_8bppchunky] best 12523422 combination zp[1]:90 [ gfx_init_plane_8bppchunky::y#6 gfx_init_plane_8bppchunky::y#1 ]
Attempting to uplift remaining variables inzp[1]:2 [ gfx_mode::dtv_control#12 gfx_mode::dtv_control#6 gfx_mode::dtv_control#13 gfx_mode::dtv_control#5 gfx_mode::dtv_control#11 gfx_mode::dtv_control#4 gfx_mode::dtv_control#10 gfx_mode::dtv_control#3 gfx_mode::dtv_control#15 gfx_mode::dtv_control#14 gfx_mode::dtv_control#2 ]
Uplifting [gfx_mode] best 12523426 combination reg byte x [ gfx_mode::dtv_control#12 gfx_mode::dtv_control#6 gfx_mode::dtv_control#13 gfx_mode::dtv_control#5 gfx_mode::dtv_control#11 gfx_mode::dtv_control#4 gfx_mode::dtv_control#10 gfx_mode::dtv_control#3 gfx_mode::dtv_control#15 gfx_mode::dtv_control#14 gfx_mode::dtv_control#2 ]
Uplifting [gfx_mode] best 12523403 combination reg byte x [ gfx_mode::dtv_control#12 gfx_mode::dtv_control#6 gfx_mode::dtv_control#13 gfx_mode::dtv_control#5 gfx_mode::dtv_control#11 gfx_mode::dtv_control#4 gfx_mode::dtv_control#10 gfx_mode::dtv_control#3 gfx_mode::dtv_control#15 gfx_mode::dtv_control#14 gfx_mode::dtv_control#2 ]
Attempting to uplift remaining variables inzp[1]:72 [ gfx_init_plane_vertical::by#4 gfx_init_plane_vertical::by#1 ]
Uplifting [gfx_init_plane_vertical] best 12523426 combination zp[1]:72 [ gfx_init_plane_vertical::by#4 gfx_init_plane_vertical::by#1 ]
Uplifting [gfx_init_plane_vertical] best 12523403 combination zp[1]:72 [ gfx_init_plane_vertical::by#4 gfx_init_plane_vertical::by#1 ]
Attempting to uplift remaining variables inzp[1]:138 [ gfx_init_screen4::cy#4 gfx_init_screen4::cy#1 ]
Uplifting [gfx_init_screen4] best 12523426 combination zp[1]:138 [ gfx_init_screen4::cy#4 gfx_init_screen4::cy#1 ]
Uplifting [gfx_init_screen4] best 12523403 combination zp[1]:138 [ gfx_init_screen4::cy#4 gfx_init_screen4::cy#1 ]
Attempting to uplift remaining variables inzp[1]:132 [ gfx_init_charset::c#4 gfx_init_charset::c#1 ]
Uplifting [gfx_init_charset] best 12523426 combination zp[1]:132 [ gfx_init_charset::c#4 gfx_init_charset::c#1 ]
Uplifting [gfx_init_charset] best 12523403 combination zp[1]:132 [ gfx_init_charset::c#4 gfx_init_charset::c#1 ]
Attempting to uplift remaining variables inzp[1]:80 [ gfx_init_plane_charset8::ch#8 gfx_init_plane_charset8::ch#1 ]
Uplifting [gfx_init_plane_charset8] best 12523426 combination zp[1]:80 [ gfx_init_plane_charset8::ch#8 gfx_init_plane_charset8::ch#1 ]
Uplifting [gfx_init_plane_charset8] best 12523403 combination zp[1]:80 [ gfx_init_plane_charset8::ch#8 gfx_init_plane_charset8::ch#1 ]
Attempting to uplift remaining variables inzp[1]:3 [ gfx_mode::vic_control#4 gfx_mode::vic_control#2 gfx_mode::vic_control#5 ]
Uplifting [gfx_mode] best 12523415 combination reg byte x [ gfx_mode::vic_control#4 gfx_mode::vic_control#2 gfx_mode::vic_control#5 ]
Uplifting [gfx_mode] best 12523392 combination reg byte x [ gfx_mode::vic_control#4 gfx_mode::vic_control#2 gfx_mode::vic_control#5 ]
Attempting to uplift remaining variables inzp[1]:158 [ gfx_mode::$18 ]
Uplifting [gfx_mode] best 12523409 combination reg byte a [ gfx_mode::$18 ]
Uplifting [gfx_mode] best 12523386 combination reg byte a [ gfx_mode::$18 ]
Attempting to uplift remaining variables inzp[1]:174 [ gfx_mode::$23 ]
Uplifting [gfx_mode] best 12523403 combination reg byte a [ gfx_mode::$23 ]
Uplifting [gfx_mode] best 12523380 combination reg byte a [ gfx_mode::$23 ]
Attempting to uplift remaining variables inzp[1]:175 [ gfx_mode::$25 ]
Uplifting [gfx_mode] best 12523397 combination reg byte a [ gfx_mode::$25 ]
Uplifting [gfx_mode] best 12523374 combination reg byte a [ gfx_mode::$25 ]
Attempting to uplift remaining variables inzp[1]:178 [ gfx_mode::$27 ]
Uplifting [gfx_mode] best 12523391 combination reg byte a [ gfx_mode::$27 ]
Uplifting [gfx_mode] best 12523368 combination reg byte a [ gfx_mode::$27 ]
Attempting to uplift remaining variables inzp[1]:179 [ gfx_mode::$28 ]
Uplifting [gfx_mode] best 12523385 combination reg byte a [ gfx_mode::$28 ]
Uplifting [gfx_mode] best 12523362 combination reg byte a [ gfx_mode::$28 ]
Attempting to uplift remaining variables inzp[1]:180 [ gfx_mode::$29 ]
Uplifting [gfx_mode] best 12523379 combination reg byte a [ gfx_mode::$29 ]
Uplifting [gfx_mode] best 12523356 combination reg byte a [ gfx_mode::$29 ]
Attempting to uplift remaining variables inzp[1]:181 [ gfx_mode::$30 ]
Uplifting [gfx_mode] best 12523373 combination reg byte a [ gfx_mode::$30 ]
Uplifting [gfx_mode] best 12523350 combination reg byte a [ gfx_mode::$30 ]
Attempting to uplift remaining variables inzp[1]:182 [ gfx_mode::$31 ]
Uplifting [gfx_mode] best 12523367 combination reg byte a [ gfx_mode::$31 ]
Uplifting [gfx_mode] best 12523344 combination reg byte a [ gfx_mode::$31 ]
Attempting to uplift remaining variables inzp[1]:183 [ gfx_mode::$32 ]
Uplifting [gfx_mode] best 12523361 combination reg byte a [ gfx_mode::$32 ]
Uplifting [gfx_mode] best 12523338 combination reg byte a [ gfx_mode::$32 ]
Attempting to uplift remaining variables inzp[1]:199 [ gfx_mode::$37 ]
Uplifting [gfx_mode] best 12523355 combination reg byte a [ gfx_mode::$37 ]
Uplifting [gfx_mode] best 12523332 combination reg byte a [ gfx_mode::$37 ]
Attempting to uplift remaining variables inzp[1]:200 [ gfx_mode::$39 ]
Uplifting [gfx_mode] best 12523349 combination reg byte a [ gfx_mode::$39 ]
Uplifting [gfx_mode] best 12523326 combination reg byte a [ gfx_mode::$39 ]
Attempting to uplift remaining variables inzp[1]:203 [ gfx_mode::$41 ]
Uplifting [gfx_mode] best 12523343 combination reg byte a [ gfx_mode::$41 ]
Uplifting [gfx_mode] best 12523320 combination reg byte a [ gfx_mode::$41 ]
Attempting to uplift remaining variables inzp[1]:204 [ gfx_mode::$42 ]
Uplifting [gfx_mode] best 12523337 combination reg byte a [ gfx_mode::$42 ]
Uplifting [gfx_mode] best 12523314 combination reg byte a [ gfx_mode::$42 ]
Attempting to uplift remaining variables inzp[1]:205 [ gfx_mode::$43 ]
Uplifting [gfx_mode] best 12523331 combination reg byte a [ gfx_mode::$43 ]
Uplifting [gfx_mode] best 12523308 combination reg byte a [ gfx_mode::$43 ]
Attempting to uplift remaining variables inzp[1]:206 [ gfx_mode::$44 ]
Uplifting [gfx_mode] best 12523325 combination reg byte a [ gfx_mode::$44 ]
Uplifting [gfx_mode] best 12523302 combination reg byte a [ gfx_mode::$44 ]
Attempting to uplift remaining variables inzp[1]:207 [ gfx_mode::$45 ]
Uplifting [gfx_mode] best 12523319 combination reg byte a [ gfx_mode::$45 ]
Uplifting [gfx_mode] best 12523296 combination reg byte a [ gfx_mode::$45 ]
Attempting to uplift remaining variables inzp[1]:223 [ gfx_mode::$51 ]
Uplifting [gfx_mode] best 12523313 combination reg byte a [ gfx_mode::$51 ]
Uplifting [gfx_mode] best 12523290 combination reg byte a [ gfx_mode::$51 ]
Attempting to uplift remaining variables inzp[1]:225 [ gfx_mode::$84 ]
Uplifting [gfx_mode] best 12523307 combination reg byte a [ gfx_mode::$84 ]
Uplifting [gfx_mode] best 12523284 combination reg byte a [ gfx_mode::$84 ]
Attempting to uplift remaining variables inzp[1]:226 [ gfx_mode::$53 ]
Uplifting [gfx_mode] best 12523301 combination reg byte a [ gfx_mode::$53 ]
Uplifting [gfx_mode] best 12523278 combination reg byte a [ gfx_mode::$53 ]
Attempting to uplift remaining variables inzp[1]:229 [ gfx_mode::$55 ]
Uplifting [gfx_mode] best 12523295 combination reg byte a [ gfx_mode::$55 ]
Uplifting [gfx_mode] best 12523272 combination reg byte a [ gfx_mode::$55 ]
Attempting to uplift remaining variables inzp[1]:230 [ gfx_mode::$56 ]
Uplifting [gfx_mode] best 12523289 combination reg byte a [ gfx_mode::$56 ]
Uplifting [gfx_mode] best 12523266 combination reg byte a [ gfx_mode::$56 ]
Attempting to uplift remaining variables inzp[1]:231 [ gfx_mode::$57 ]
Uplifting [gfx_mode] best 12523283 combination reg byte a [ gfx_mode::$57 ]
Uplifting [gfx_mode] best 12523260 combination reg byte a [ gfx_mode::$57 ]
Attempting to uplift remaining variables inzp[1]:232 [ gfx_mode::$58 ]
Uplifting [gfx_mode] best 12523277 combination reg byte a [ gfx_mode::$58 ]
Uplifting [gfx_mode] best 12523254 combination reg byte a [ gfx_mode::$58 ]
Attempting to uplift remaining variables inzp[1]:233 [ gfx_mode::$59 ]
Uplifting [gfx_mode] best 12523271 combination reg byte a [ gfx_mode::$59 ]
Uplifting [gfx_mode] best 12523248 combination reg byte a [ gfx_mode::$59 ]
Attempting to uplift remaining variables inzp[1]:234 [ gfx_mode::$60 ]
Uplifting [gfx_mode] best 12523265 combination reg byte a [ gfx_mode::$60 ]
Uplifting [gfx_mode] best 12523242 combination reg byte a [ gfx_mode::$60 ]
Attempting to uplift remaining variables inzp[1]:235 [ gfx_mode::$61 ]
Uplifting [gfx_mode] best 12523259 combination reg byte a [ gfx_mode::$61 ]
Uplifting [gfx_mode] best 12523236 combination reg byte a [ gfx_mode::$61 ]
Attempting to uplift remaining variables inzp[1]:236 [ gfx_mode::$62 ]
Uplifting [gfx_mode] best 12523253 combination reg byte a [ gfx_mode::$62 ]
Uplifting [gfx_mode] best 12523230 combination reg byte a [ gfx_mode::$62 ]
Attempting to uplift remaining variables inzp[1]:4 [ gfx_mode::vic_control2#2 ]
Uplifting [gfx_mode] best 12523244 combination reg byte a [ gfx_mode::vic_control2#2 ]
Uplifting [gfx_mode] best 12523221 combination reg byte a [ gfx_mode::vic_control2#2 ]
Attempting to uplift remaining variables inzp[1]:224 [ gfx_mode::$52 ]
Uplifting [gfx_mode] best 12523244 combination zp[1]:224 [ gfx_mode::$52 ]
Uplifting [gfx_mode] best 12523221 combination zp[1]:224 [ gfx_mode::$52 ]
Attempting to uplift remaining variables inzp[1]:159 [ gfx_mode::plane_a_offs#0 ]
Uplifting [gfx_mode] best 12523242 combination reg byte x [ gfx_mode::plane_a_offs#0 ]
Uplifting [gfx_mode] best 12523219 combination reg byte x [ gfx_mode::plane_a_offs#0 ]
Attempting to uplift remaining variables inzp[1]:184 [ gfx_mode::plane_b_offs#0 ]
Uplifting [gfx_mode] best 12523240 combination reg byte x [ gfx_mode::plane_b_offs#0 ]
Uplifting [gfx_mode] best 12523217 combination reg byte x [ gfx_mode::plane_b_offs#0 ]
Coalescing zero page register [ zp[2]:6 [ gfx_mode::vic_colors#2 gfx_mode::vic_colors#3 gfx_mode::vic_colors#1 gfx_mode::vic_colors#0 ] ] with [ zp[2]:227 [ get_vic_screen::return#11 ] ] - score: 1
Coalescing zero page register [ zp[2]:21 [ get_vic_screen::return#5 ] ] with [ zp[2]:208 [ get_vic_screen::return#10 ] ] - score: 1
Coalescing zero page register [ zp[2]:23 [ get_vic_charset::return#2 ] ] with [ zp[2]:217 [ get_vic_charset::return#4 ] ] - score: 1
@ -21809,21 +21798,10 @@ get_plane: {
jmp __b1
// get_plane::@1
__b1:
// [250] phi from get_plane::@1 to get_plane::@return [phi:get_plane::@1->get_plane::@return]
__breturn_from___b1:
// [250] phi (dword) get_plane::return#14 = (dword)(const nomodify byte*) VIC_SCREEN0 [phi:get_plane::@1->get_plane::@return#0] -- vduz1=vduc1
lda #<VIC_SCREEN0
sta.z return
lda #>VIC_SCREEN0
sta.z return+1
lda #<VIC_SCREEN0>>$10
sta.z return+2
lda #>VIC_SCREEN0>>$10
sta.z return+3
jmp __breturn
// [250] phi from get_plane to get_plane::@return [phi:get_plane->get_plane::@return]
// [250] phi from get_plane get_plane::@1 to get_plane::@return [phi:get_plane/get_plane::@1->get_plane::@return]
__breturn_from_get_plane:
// [250] phi (dword) get_plane::return#14 = (dword)(const nomodify byte*) VIC_SCREEN0 [phi:get_plane->get_plane::@return#0] -- vduz1=vduc1
__breturn_from___b1:
// [250] phi (dword) get_plane::return#14 = (dword)(const nomodify byte*) VIC_SCREEN0 [phi:get_plane/get_plane::@1->get_plane::@return#0] -- vduz1=vduc1
lda #<VIC_SCREEN0
sta.z return
lda #>VIC_SCREEN0
@ -25996,6 +25974,7 @@ Replacing label __breturn_from_get_vic_screen with __b1
Replacing label __b1_from___b5 with __b1
Replacing label __breturn_from_get_vic_charset with __b1
Replacing label __b1_from___b2 with __b1
Replacing label __breturn_from_get_plane with __b1
Replacing label __b1_from___b14 with __b1
Replacing label __b1_from___b1 with __b1
Replacing label __b3_from___b19 with __b3_from___b6
@ -26122,6 +26101,7 @@ Removing instruction __b1_from___b2:
Removing instruction __breturn_from_get_vic_charset:
Removing instruction __breturn_from___b1:
Removing instruction __b1_from___b14:
Removing instruction __breturn_from_get_plane:
Removing instruction __breturn_from___b1:
Removing instruction __b8_from_form_mode:
Removing instruction __b9_from___b8:
@ -26588,7 +26568,6 @@ Replacing jump to rts with rts in jmp __breturn
Replacing jump to rts with rts in jmp __breturn
Replacing jump to rts with rts in jmp __breturn
Replacing jump to rts with rts in jmp __breturn
Replacing jump to rts with rts in jmp __breturn
Skipping double jump to __b14 in bne __b23
Replacing jump to rts with rts in jmp __breturn
Skipping double jump to __breturn_from___b6 in bne __b6
@ -26612,19 +26591,18 @@ Relabelling long label __b9_from___b19 to __b6
Relabelling long label __breturn_from___b2 to __b2
Relabelling long label __breturn_from___b3 to __b3
Relabelling long label __breturn_from___b4 to __b4
Relabelling long label __breturn_from_get_plane to __b2
Relabelling long label __breturn_from___b10 to __b3
Relabelling long label __breturn_from___b11 to __b4
Relabelling long label __breturn_from___b12 to __b5
Relabelling long label __breturn_from___b13 to __b6
Relabelling long label __breturn_from___b2 to __b7
Relabelling long label __breturn_from___b3 to __b8
Relabelling long label __breturn_from___b4 to __b9
Relabelling long label __breturn_from___b5 to __b10
Relabelling long label __breturn_from___b6 to __b11
Relabelling long label __breturn_from___b7 to __b12
Relabelling long label __breturn_from___b8 to __b13
Relabelling long label __breturn_from___b9 to __b14
Relabelling long label __breturn_from___b10 to __b2
Relabelling long label __breturn_from___b11 to __b3
Relabelling long label __breturn_from___b12 to __b4
Relabelling long label __breturn_from___b13 to __b5
Relabelling long label __breturn_from___b2 to __b6
Relabelling long label __breturn_from___b3 to __b7
Relabelling long label __breturn_from___b4 to __b8
Relabelling long label __breturn_from___b5 to __b9
Relabelling long label __breturn_from___b6 to __b10
Relabelling long label __breturn_from___b7 to __b11
Relabelling long label __breturn_from___b8 to __b12
Relabelling long label __breturn_from___b9 to __b13
Relabelling long label __b3_from___b6 to __b2
Relabelling long label __b2_from___b12 to __b3
Relabelling long label __b2_from___b10 to __b4
@ -26711,15 +26689,15 @@ Removing unreachable instruction jmp __b9
Removing unreachable instruction jmp __b14
Removing unreachable instruction jmp __b7
Succesful ASM optimization Pass5UnreachableCodeElimination
Fixing long branch [742] beq __b7 to bne
Fixing long branch [746] beq __b8 to bne
Fixing long branch [750] beq __b9 to bne
Fixing long branch [754] beq __b10 to bne
Fixing long branch [758] beq __b11 to bne
Fixing long branch [762] beq __b12 to bne
Fixing long branch [766] beq __b13 to bne
Fixing long branch [770] beq __b14 to bne
Fixing long branch [1345] bmi __b2 to bpl
Fixing long branch [742] beq __b6 to bne
Fixing long branch [746] beq __b7 to bne
Fixing long branch [750] beq __b8 to bne
Fixing long branch [754] beq __b9 to bne
Fixing long branch [758] beq __b10 to bne
Fixing long branch [762] beq __b11 to bne
Fixing long branch [766] beq __b12 to bne
Fixing long branch [770] beq __b13 to bne
Fixing long branch [1335] bmi __b2 to bpl
FINAL SYMBOL TABLE
(label) @1
@ -28207,7 +28185,7 @@ reg byte a [ gfx_init_screen0::$3 ]
FINAL ASSEMBLER
Score: 10118916
Score: 10118890
// File Comments
// Interactive Explorer for C64DTV Screen Modes
@ -29537,83 +29515,83 @@ get_plane: {
// if(idx==0)
// [235] if((byte) get_plane::idx#10==(byte) 0) goto get_plane::@return -- vbuaa_eq_0_then_la1
cmp #0
beq __b2
beq __b1
// get_plane::@2
// if(idx==1)
// [236] if((byte) get_plane::idx#10==(byte) 1) goto get_plane::@return -- vbuaa_eq_vbuc1_then_la1
cmp #1
bne !__b7+
jmp __b7
!__b7:
bne !__b6+
jmp __b6
!__b6:
// get_plane::@3
// if(idx==2)
// [237] if((byte) get_plane::idx#10==(byte) 2) goto get_plane::@return -- vbuaa_eq_vbuc1_then_la1
cmp #2
bne !__b8+
jmp __b8
!__b8:
bne !__b7+
jmp __b7
!__b7:
// get_plane::@4
// if(idx==3)
// [238] if((byte) get_plane::idx#10==(byte) 3) goto get_plane::@return -- vbuaa_eq_vbuc1_then_la1
cmp #3
bne !__b9+
jmp __b9
!__b9:
bne !__b8+
jmp __b8
!__b8:
// get_plane::@5
// if(idx==4)
// [239] if((byte) get_plane::idx#10==(byte) 4) goto get_plane::@return -- vbuaa_eq_vbuc1_then_la1
cmp #4
bne !__b10+
jmp __b10
!__b10:
bne !__b9+
jmp __b9
!__b9:
// get_plane::@6
// if(idx==5)
// [240] if((byte) get_plane::idx#10==(byte) 5) goto get_plane::@return -- vbuaa_eq_vbuc1_then_la1
cmp #5
bne !__b11+
jmp __b11
!__b11:
bne !__b10+
jmp __b10
!__b10:
// get_plane::@7
// if(idx==6)
// [241] if((byte) get_plane::idx#10==(byte) 6) goto get_plane::@return -- vbuaa_eq_vbuc1_then_la1
cmp #6
bne !__b12+
jmp __b12
!__b12:
bne !__b11+
jmp __b11
!__b11:
// get_plane::@8
// if(idx==7)
// [242] if((byte) get_plane::idx#10==(byte) 7) goto get_plane::@return -- vbuaa_eq_vbuc1_then_la1
cmp #7
bne !__b13+
jmp __b13
!__b13:
bne !__b12+
jmp __b12
!__b12:
// get_plane::@9
// if(idx==8)
// [243] if((byte) get_plane::idx#10==(byte) 8) goto get_plane::@return -- vbuaa_eq_vbuc1_then_la1
cmp #8
bne !__b14+
jmp __b14
!__b14:
bne !__b13+
jmp __b13
!__b13:
// get_plane::@10
// if(idx==9)
// [244] if((byte) get_plane::idx#10==(byte) 9) goto get_plane::@return -- vbuaa_eq_vbuc1_then_la1
cmp #9
beq __b3
beq __b2
// get_plane::@11
// if(idx==10)
// [245] if((byte) get_plane::idx#10==(byte) $a) goto get_plane::@return -- vbuaa_eq_vbuc1_then_la1
cmp #$a
beq __b4
beq __b3
// get_plane::@12
// if(idx==11)
// [246] if((byte) get_plane::idx#10==(byte) $b) goto get_plane::@return -- vbuaa_eq_vbuc1_then_la1
cmp #$b
beq __b5
beq __b4
// get_plane::@13
// if(idx==12)
// [247] if((byte) get_plane::idx#10==(byte) $c) goto get_plane::@return -- vbuaa_eq_vbuc1_then_la1
cmp #$c
beq __b6
beq __b5
// get_plane::@14
// if(idx==13)
// [248] if((byte) get_plane::idx#10!=(byte) $d) goto get_plane::@1 -- vbuaa_neq_vbuc1_then_la1
@ -29633,20 +29611,8 @@ get_plane: {
// [249] phi from get_plane::@14 to get_plane::@1 [phi:get_plane::@14->get_plane::@1]
// get_plane::@1
__b1:
// [250] phi from get_plane::@1 to get_plane::@return [phi:get_plane::@1->get_plane::@return]
// [250] phi (dword) get_plane::return#14 = (dword)(const nomodify byte*) VIC_SCREEN0 [phi:get_plane::@1->get_plane::@return#0] -- vduz1=vduc1
lda #<VIC_SCREEN0
sta.z return
lda #>VIC_SCREEN0
sta.z return+1
lda #<VIC_SCREEN0>>$10
sta.z return+2
lda #>VIC_SCREEN0>>$10
sta.z return+3
rts
// [250] phi from get_plane to get_plane::@return [phi:get_plane->get_plane::@return]
__b2:
// [250] phi (dword) get_plane::return#14 = (dword)(const nomodify byte*) VIC_SCREEN0 [phi:get_plane->get_plane::@return#0] -- vduz1=vduc1
// [250] phi from get_plane get_plane::@1 to get_plane::@return [phi:get_plane/get_plane::@1->get_plane::@return]
// [250] phi (dword) get_plane::return#14 = (dword)(const nomodify byte*) VIC_SCREEN0 [phi:get_plane/get_plane::@1->get_plane::@return#0] -- vduz1=vduc1
lda #<VIC_SCREEN0
sta.z return
lda #>VIC_SCREEN0
@ -29657,7 +29623,7 @@ get_plane: {
sta.z return+3
rts
// [250] phi from get_plane::@10 to get_plane::@return [phi:get_plane::@10->get_plane::@return]
__b3:
__b2:
// [250] phi (dword) get_plane::return#14 = (const nomodify dword) PLANE_HORISONTAL2 [phi:get_plane::@10->get_plane::@return#0] -- vduz1=vduc1
lda #<PLANE_HORISONTAL2
sta.z return
@ -29669,7 +29635,7 @@ get_plane: {
sta.z return+3
rts
// [250] phi from get_plane::@11 to get_plane::@return [phi:get_plane::@11->get_plane::@return]
__b4:
__b3:
// [250] phi (dword) get_plane::return#14 = (const nomodify dword) PLANE_VERTICAL2 [phi:get_plane::@11->get_plane::@return#0] -- vduz1=vduc1
lda #<PLANE_VERTICAL2
sta.z return
@ -29681,7 +29647,7 @@ get_plane: {
sta.z return+3
rts
// [250] phi from get_plane::@12 to get_plane::@return [phi:get_plane::@12->get_plane::@return]
__b5:
__b4:
// [250] phi (dword) get_plane::return#14 = (const nomodify dword) PLANE_CHARSET8 [phi:get_plane::@12->get_plane::@return#0] -- vduz1=vduc1
lda #<PLANE_CHARSET8
sta.z return
@ -29693,7 +29659,7 @@ get_plane: {
sta.z return+3
rts
// [250] phi from get_plane::@13 to get_plane::@return [phi:get_plane::@13->get_plane::@return]
__b6:
__b5:
// [250] phi (dword) get_plane::return#14 = (const nomodify dword) PLANE_BLANK [phi:get_plane::@13->get_plane::@return#0] -- vduz1=vduc1
lda #<PLANE_BLANK
sta.z return
@ -29705,7 +29671,7 @@ get_plane: {
sta.z return+3
rts
// [250] phi from get_plane::@2 to get_plane::@return [phi:get_plane::@2->get_plane::@return]
__b7:
__b6:
// [250] phi (dword) get_plane::return#14 = (dword)(const nomodify byte*) VIC_SCREEN1 [phi:get_plane::@2->get_plane::@return#0] -- vduz1=vduc1
lda #<VIC_SCREEN1
sta.z return
@ -29717,7 +29683,7 @@ get_plane: {
sta.z return+3
rts
// [250] phi from get_plane::@3 to get_plane::@return [phi:get_plane::@3->get_plane::@return]
__b8:
__b7:
// [250] phi (dword) get_plane::return#14 = (dword)(const nomodify byte*) VIC_SCREEN2 [phi:get_plane::@3->get_plane::@return#0] -- vduz1=vduc1
lda #<VIC_SCREEN2
sta.z return
@ -29729,7 +29695,7 @@ get_plane: {
sta.z return+3
rts
// [250] phi from get_plane::@4 to get_plane::@return [phi:get_plane::@4->get_plane::@return]
__b9:
__b8:
// [250] phi (dword) get_plane::return#14 = (dword)(const nomodify byte*) VIC_SCREEN3 [phi:get_plane::@4->get_plane::@return#0] -- vduz1=vduc1
lda #<VIC_SCREEN3
sta.z return
@ -29741,7 +29707,7 @@ get_plane: {
sta.z return+3
rts
// [250] phi from get_plane::@5 to get_plane::@return [phi:get_plane::@5->get_plane::@return]
__b10:
__b9:
// [250] phi (dword) get_plane::return#14 = (dword)(const nomodify byte*) VIC_BITMAP [phi:get_plane::@5->get_plane::@return#0] -- vduz1=vduc1
lda #<VIC_BITMAP
sta.z return
@ -29753,7 +29719,7 @@ get_plane: {
sta.z return+3
rts
// [250] phi from get_plane::@6 to get_plane::@return [phi:get_plane::@6->get_plane::@return]
__b11:
__b10:
// [250] phi (dword) get_plane::return#14 = (dword)(const nomodify byte*) VIC_CHARSET_ROM [phi:get_plane::@6->get_plane::@return#0] -- vduz1=vduc1
lda #<VIC_CHARSET_ROM
sta.z return
@ -29765,7 +29731,7 @@ get_plane: {
sta.z return+3
rts
// [250] phi from get_plane::@7 to get_plane::@return [phi:get_plane::@7->get_plane::@return]
__b12:
__b11:
// [250] phi (dword) get_plane::return#14 = (const nomodify dword) PLANE_8BPP_CHUNKY [phi:get_plane::@7->get_plane::@return#0] -- vduz1=vduc1
lda #<PLANE_8BPP_CHUNKY
sta.z return
@ -29777,7 +29743,7 @@ get_plane: {
sta.z return+3
rts
// [250] phi from get_plane::@8 to get_plane::@return [phi:get_plane::@8->get_plane::@return]
__b13:
__b12:
// [250] phi (dword) get_plane::return#14 = (const nomodify dword) PLANE_HORISONTAL [phi:get_plane::@8->get_plane::@return#0] -- vduz1=vduc1
lda #<PLANE_HORISONTAL
sta.z return
@ -29789,7 +29755,7 @@ get_plane: {
sta.z return+3
rts
// [250] phi from get_plane::@9 to get_plane::@return [phi:get_plane::@9->get_plane::@return]
__b14:
__b13:
// [250] phi (dword) get_plane::return#14 = (const nomodify dword) PLANE_VERTICAL [phi:get_plane::@9->get_plane::@return#0] -- vduz1=vduc1
lda #<PLANE_VERTICAL
sta.z return

View File

@ -34,10 +34,6 @@ main: {
sta.z memset.str
lda #>SCREEN
sta.z memset.str+1
lda #<$28*$19
sta.z memset.num
lda #>$28*$19
sta.z memset.num+1
jsr memset
// memset(COLS, WHITE, 40*25)
ldx #WHITE
@ -45,10 +41,6 @@ main: {
sta.z memset.str
lda #>COLS
sta.z memset.str+1
lda #<$28*$19
sta.z memset.num
lda #>$28*$19
sta.z memset.num+1
jsr memset
lda #<SCREEN+$28
sta.z sc
@ -98,25 +90,18 @@ main: {
jmp __b1
}
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zp(8) str, byte register(X) c, word zp(6) num)
// memset(void* zp(6) str, byte register(X) c)
memset: {
.label end = 6
.label dst = 8
.label num = 6
.label str = 8
// if(num>0)
lda.z num
bne !+
lda.z num+1
beq __breturn
!:
.label end = 8
.label dst = 6
.label str = 6
// end = (char*)str + num
lda.z end
lda.z str
clc
adc.z str
adc #<$28*$19
sta.z end
lda.z end+1
adc.z str+1
lda.z str+1
adc #>$28*$19
sta.z end+1
__b2:
// for(char* dst = str; dst!=end; dst++)
@ -126,7 +111,6 @@ memset: {
lda.z dst
cmp.z end
bne __b3
__breturn:
// }
rts
__b3:

View File

@ -44,37 +44,35 @@ main::@2: scope:[main] from main::@1
memset: scope:[memset] from main main::@6
[17] (byte) memset::c#4 ← phi( main/(byte) ' ' main::@6/(const nomodify byte) WHITE )
[17] (void*) memset::str#3 ← phi( main/(void*)(const nomodify byte*) SCREEN main::@6/(void*)(const nomodify byte*) COLS )
[17] (word) memset::num#2 ← phi( main/(word)(number) $28*(number) $19 main::@6/(word)(number) $28*(number) $19 )
[18] if((word) memset::num#2<=(byte) 0) goto memset::@return
to:memset::@1
memset::@1: scope:[memset] from memset
[19] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2
[20] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3
[18] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word)(number) $28*(number) $19
[19] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3
to:memset::@2
memset::@2: scope:[memset] from memset::@1 memset::@3
[21] (byte*) memset::dst#2 ← phi( memset::@1/(byte*) memset::dst#4 memset::@3/(byte*) memset::dst#1 )
[22] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3
[20] (byte*) memset::dst#2 ← phi( memset::@1/(byte*) memset::dst#4 memset::@3/(byte*) memset::dst#1 )
[21] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3
to:memset::@return
memset::@return: scope:[memset] from memset memset::@2
[23] return
memset::@return: scope:[memset] from memset::@2
[22] return
to:@return
memset::@3: scope:[memset] from memset::@2
[24] *((byte*) memset::dst#2) ← (byte) memset::c#4
[25] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[23] *((byte*) memset::dst#2) ← (byte) memset::c#4
[24] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
to:memset::@2
(void()) syscall2()
syscall2: scope:[syscall2] from
[26] *((const nomodify byte*) SCREEN+(byte) $4e) ← (byte) '<'
[25] *((const nomodify byte*) SCREEN+(byte) $4e) ← (byte) '<'
to:syscall2::@return
syscall2::@return: scope:[syscall2] from syscall2
[27] return
[26] return
to:@return
(void()) syscall1()
syscall1: scope:[syscall1] from
[28] *((const nomodify byte*) SCREEN+(byte) $4f) ← (byte) '>'
[27] *((const nomodify byte*) SCREEN+(byte) $4f) ← (byte) '>'
to:syscall1::@return
syscall1::@return: scope:[syscall1] from syscall1
[29] return
[28] return
to:@return

View File

@ -324,6 +324,10 @@ Constant inlined memset::c#0 = (byte) ' '
Constant inlined memset::num#0 = (word)(number) $28*(number) $19
Constant inlined memset::c#1 = (const nomodify byte) WHITE
Successful SSA optimization Pass2ConstantInlining
Identical Phi Values (word) memset::num#2 (word)(number) $28*(number) $19
Successful SSA optimization Pass2IdenticalPhiElimination
if() condition always false - eliminating [1] if((word)(number) $28*(number) $19<=(byte) 0) goto memset::@1
Successful SSA optimization Pass2ConstantIfs
Adding NOP phi() at start of @begin
Adding NOP phi() at start of @1
Adding NOP phi() at start of @2
@ -336,11 +340,11 @@ CALL GRAPH
Calls in [] to main:2
Calls in [main] to memset:6 memset:8
Created 6 initial phi equivalence classes
Created 5 initial phi equivalence classes
Coalesced [20] main::msg#4 ← main::msg#1
Coalesced [21] main::sc#4 ← main::sc#1
Coalesced [32] memset::dst#5 ← memset::dst#1
Coalesced down to 6 phi equivalence classes
Coalesced [31] memset::dst#5 ← memset::dst#1
Coalesced down to 5 phi equivalence classes
Culled Empty Block (label) @2
Culled Empty Block (label) main::@8
Culled Empty Block (label) main::@3
@ -405,39 +409,37 @@ main::@2: scope:[main] from main::@1
memset: scope:[memset] from main main::@6
[17] (byte) memset::c#4 ← phi( main/(byte) ' ' main::@6/(const nomodify byte) WHITE )
[17] (void*) memset::str#3 ← phi( main/(void*)(const nomodify byte*) SCREEN main::@6/(void*)(const nomodify byte*) COLS )
[17] (word) memset::num#2 ← phi( main/(word)(number) $28*(number) $19 main::@6/(word)(number) $28*(number) $19 )
[18] if((word) memset::num#2<=(byte) 0) goto memset::@return
to:memset::@1
memset::@1: scope:[memset] from memset
[19] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2
[20] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3
[18] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word)(number) $28*(number) $19
[19] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3
to:memset::@2
memset::@2: scope:[memset] from memset::@1 memset::@3
[21] (byte*) memset::dst#2 ← phi( memset::@1/(byte*) memset::dst#4 memset::@3/(byte*) memset::dst#1 )
[22] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3
[20] (byte*) memset::dst#2 ← phi( memset::@1/(byte*) memset::dst#4 memset::@3/(byte*) memset::dst#1 )
[21] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3
to:memset::@return
memset::@return: scope:[memset] from memset memset::@2
[23] return
memset::@return: scope:[memset] from memset::@2
[22] return
to:@return
memset::@3: scope:[memset] from memset::@2
[24] *((byte*) memset::dst#2) ← (byte) memset::c#4
[25] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
[23] *((byte*) memset::dst#2) ← (byte) memset::c#4
[24] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2
to:memset::@2
(void()) syscall2()
syscall2: scope:[syscall2] from
[26] *((const nomodify byte*) SCREEN+(byte) $4e) ← (byte) '<'
[25] *((const nomodify byte*) SCREEN+(byte) $4e) ← (byte) '<'
to:syscall2::@return
syscall2::@return: scope:[syscall2] from syscall2
[27] return
[26] return
to:@return
(void()) syscall1()
syscall1: scope:[syscall1] from
[28] *((const nomodify byte*) SCREEN+(byte) $4f) ← (byte) '>'
[27] *((const nomodify byte*) SCREEN+(byte) $4f) ← (byte) '>'
to:syscall1::@return
syscall1::@return: scope:[syscall1] from syscall1
[29] return
[28] return
to:@return
@ -454,7 +456,7 @@ VARIABLE REGISTER WEIGHTS
(byte*) main::sc#2 101.0
(void*()) memset((void*) memset::str , (byte) memset::c , (word) memset::num)
(byte) memset::c
(byte) memset::c#4 125.125
(byte) memset::c#4 143.0
(byte*) memset::dst
(byte*) memset::dst#1 2002.0
(byte*) memset::dst#2 1368.3333333333335
@ -462,7 +464,6 @@ VARIABLE REGISTER WEIGHTS
(byte*) memset::end
(byte*) memset::end#0 183.66666666666669
(word) memset::num
(word) memset::num#2 101.0
(void*) memset::return
(void*) memset::str
(void*) memset::str#3
@ -472,7 +473,6 @@ VARIABLE REGISTER WEIGHTS
Initial phi equivalence classes
[ main::msg#2 main::msg#1 ]
[ main::sc#2 main::sc#1 ]
[ memset::num#2 ]
[ memset::str#3 ]
[ memset::c#4 ]
[ memset::dst#2 memset::dst#4 memset::dst#1 ]
@ -480,18 +480,16 @@ Added variable memset::end#0 to live range equivalence class [ memset::end#0 ]
Complete equivalence classes
[ main::msg#2 main::msg#1 ]
[ main::sc#2 main::sc#1 ]
[ memset::num#2 ]
[ memset::str#3 ]
[ memset::c#4 ]
[ memset::dst#2 memset::dst#4 memset::dst#1 ]
[ memset::end#0 ]
Allocated zp[2]:2 [ main::msg#2 main::msg#1 ]
Allocated zp[2]:4 [ main::sc#2 main::sc#1 ]
Allocated zp[2]:6 [ memset::num#2 ]
Allocated zp[2]:8 [ memset::str#3 ]
Allocated zp[1]:10 [ memset::c#4 ]
Allocated zp[2]:11 [ memset::dst#2 memset::dst#4 memset::dst#1 ]
Allocated zp[2]:13 [ memset::end#0 ]
Allocated zp[2]:6 [ memset::str#3 ]
Allocated zp[1]:8 [ memset::c#4 ]
Allocated zp[2]:9 [ memset::dst#2 memset::dst#4 memset::dst#1 ]
Allocated zp[2]:11 [ memset::end#0 ]
INITIAL ASM
Target platform is custom / MOS6502X
@ -553,11 +551,6 @@ main: {
sta.z memset.str
lda #>SCREEN
sta.z memset.str+1
// [17] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main->memset#2] -- vwuz1=vwuc1
lda #<$28*$19
sta.z memset.num
lda #>$28*$19
sta.z memset.num+1
jsr memset
// [6] phi from main to main::@6 [phi:main->main::@6]
__b6_from_main:
@ -575,11 +568,6 @@ main: {
sta.z memset.str
lda #>COLS
sta.z memset.str+1
// [17] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@6->memset#2] -- vwuz1=vwuc1
lda #<$28*$19
sta.z memset.num
lda #>$28*$19
sta.z memset.num+1
jsr memset
// [8] phi from main::@6 to main::@1 [phi:main::@6->main::@1]
__b1_from___b6:
@ -653,43 +641,36 @@ main: {
}
// memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zp(8) str, byte zp($a) c, word zp(6) num)
// memset(void* zp(6) str, byte zp(8) c)
memset: {
.label end = $d
.label dst = $b
.label num = 6
.label str = 8
.label c = $a
// [18] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1
lda.z num
bne !+
lda.z num+1
beq __breturn
!:
.label end = $b
.label dst = 9
.label str = 6
.label c = 8
jmp __b1
// memset::@1
__b1:
// [19] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz3
// [18] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word)(number) $28*(number) $19 -- pbuz1=pbuz2_plus_vwuc1
lda.z str
clc
adc.z num
adc #<$28*$19
sta.z end
lda.z str+1
adc.z num+1
adc #>$28*$19
sta.z end+1
// [20] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3 -- pbuz1=pbuz2
// [19] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3 -- pbuz1=pbuz2
lda.z str
sta.z dst
lda.z str+1
sta.z dst+1
// [21] phi from memset::@1 memset::@3 to memset::@2 [phi:memset::@1/memset::@3->memset::@2]
// [20] phi from memset::@1 memset::@3 to memset::@2 [phi:memset::@1/memset::@3->memset::@2]
__b2_from___b1:
__b2_from___b3:
// [21] phi (byte*) memset::dst#2 = (byte*) memset::dst#4 [phi:memset::@1/memset::@3->memset::@2#0] -- register_copy
// [20] phi (byte*) memset::dst#2 = (byte*) memset::dst#4 [phi:memset::@1/memset::@3->memset::@2#0] -- register_copy
jmp __b2
// memset::@2
__b2:
// [22] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 -- pbuz1_neq_pbuz2_then_la1
// [21] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 -- pbuz1_neq_pbuz2_then_la1
lda.z dst+1
cmp.z end+1
bne __b3
@ -699,15 +680,15 @@ memset: {
jmp __breturn
// memset::@return
__breturn:
// [23] return
// [22] return
rts
// memset::@3
__b3:
// [24] *((byte*) memset::dst#2) ← (byte) memset::c#4 -- _deref_pbuz1=vbuz2
// [23] *((byte*) memset::dst#2) ← (byte) memset::c#4 -- _deref_pbuz1=vbuz2
lda.z c
ldy #0
sta (dst),y
// [25] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
// [24] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
inc.z dst
bne !+
inc.z dst+1
@ -716,24 +697,24 @@ memset: {
}
// syscall2
syscall2: {
// [26] *((const nomodify byte*) SCREEN+(byte) $4e) ← (byte) '<' -- _deref_pbuc1=vbuc2
// [25] *((const nomodify byte*) SCREEN+(byte) $4e) ← (byte) '<' -- _deref_pbuc1=vbuc2
lda #'<'
sta SCREEN+$4e
jmp __breturn
// syscall2::@return
__breturn:
// [27] return
// [26] return
rts
}
// syscall1
syscall1: {
// [28] *((const nomodify byte*) SCREEN+(byte) $4f) ← (byte) '>' -- _deref_pbuc1=vbuc2
// [27] *((const nomodify byte*) SCREEN+(byte) $4f) ← (byte) '>' -- _deref_pbuc1=vbuc2
lda #'>'
sta SCREEN+$4f
jmp __breturn
// syscall1::@return
__breturn:
// [29] return
// [28] return
rts
}
// File Data
@ -759,15 +740,14 @@ Statement [11] if(*((const nomodify byte*) RASTER)==(byte) $42) goto main::@4 [
Statement [12] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLACK [ ] ( [ ] { } main:2 [ ] { } ) always clobbers reg byte a
Statement [13] *((const nomodify byte*) BGCOL) ← (const nomodify byte) WHITE [ ] ( [ ] { } main:2 [ ] { } ) always clobbers reg byte a
Statement [14] *((byte*) main::sc#2) ← *((byte*) main::msg#2) [ main::msg#2 main::sc#2 ] ( [ main::msg#2 main::sc#2 ] { } main:2 [ main::msg#2 main::sc#2 ] { } ) always clobbers reg byte a reg byte y
Statement [18] if((word) memset::num#2<=(byte) 0) goto memset::@return [ memset::num#2 memset::str#3 memset::c#4 ] ( memset:5 [ memset::num#2 memset::str#3 memset::c#4 ] { } main:2::memset:5 [ memset::num#2 memset::str#3 memset::c#4 ] { } memset:7 [ memset::num#2 memset::str#3 memset::c#4 ] { } main:2::memset:7 [ memset::num#2 memset::str#3 memset::c#4 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:10 [ memset::c#4 ]
Statement [19] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 [ memset::str#3 memset::c#4 memset::end#0 ] ( memset:5 [ memset::str#3 memset::c#4 memset::end#0 ] { } main:2::memset:5 [ memset::str#3 memset::c#4 memset::end#0 ] { } memset:7 [ memset::str#3 memset::c#4 memset::end#0 ] { } main:2::memset:7 [ memset::str#3 memset::c#4 memset::end#0 ] { } ) always clobbers reg byte a
Statement [20] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3 [ memset::c#4 memset::end#0 memset::dst#4 ] ( memset:5 [ memset::c#4 memset::end#0 memset::dst#4 ] { } main:2::memset:5 [ memset::c#4 memset::end#0 memset::dst#4 ] { } memset:7 [ memset::c#4 memset::end#0 memset::dst#4 ] { } main:2::memset:7 [ memset::c#4 memset::end#0 memset::dst#4 ] { } ) always clobbers reg byte a
Statement [22] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 [ memset::c#4 memset::end#0 memset::dst#2 ] ( memset:5 [ memset::c#4 memset::end#0 memset::dst#2 ] { } main:2::memset:5 [ memset::c#4 memset::end#0 memset::dst#2 ] { } memset:7 [ memset::c#4 memset::end#0 memset::dst#2 ] { } main:2::memset:7 [ memset::c#4 memset::end#0 memset::dst#2 ] { } ) always clobbers reg byte a
Statement [24] *((byte*) memset::dst#2) ← (byte) memset::c#4 [ memset::c#4 memset::end#0 memset::dst#2 ] ( memset:5 [ memset::c#4 memset::end#0 memset::dst#2 ] { } main:2::memset:5 [ memset::c#4 memset::end#0 memset::dst#2 ] { } memset:7 [ memset::c#4 memset::end#0 memset::dst#2 ] { } main:2::memset:7 [ memset::c#4 memset::end#0 memset::dst#2 ] { } ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte y as potential for zp[1]:10 [ memset::c#4 ]
Statement [26] *((const nomodify byte*) SCREEN+(byte) $4e) ← (byte) '<' [ ] ( [ ] { } ) always clobbers reg byte a
Statement [28] *((const nomodify byte*) SCREEN+(byte) $4f) ← (byte) '>' [ ] ( [ ] { } ) always clobbers reg byte a
Statement [18] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word)(number) $28*(number) $19 [ memset::str#3 memset::c#4 memset::end#0 ] ( memset:5 [ memset::str#3 memset::c#4 memset::end#0 ] { } main:2::memset:5 [ memset::str#3 memset::c#4 memset::end#0 ] { } memset:7 [ memset::str#3 memset::c#4 memset::end#0 ] { } main:2::memset:7 [ memset::str#3 memset::c#4 memset::end#0 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:8 [ memset::c#4 ]
Statement [19] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3 [ memset::c#4 memset::end#0 memset::dst#4 ] ( memset:5 [ memset::c#4 memset::end#0 memset::dst#4 ] { } main:2::memset:5 [ memset::c#4 memset::end#0 memset::dst#4 ] { } memset:7 [ memset::c#4 memset::end#0 memset::dst#4 ] { } main:2::memset:7 [ memset::c#4 memset::end#0 memset::dst#4 ] { } ) always clobbers reg byte a
Statement [21] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 [ memset::c#4 memset::end#0 memset::dst#2 ] ( memset:5 [ memset::c#4 memset::end#0 memset::dst#2 ] { } main:2::memset:5 [ memset::c#4 memset::end#0 memset::dst#2 ] { } memset:7 [ memset::c#4 memset::end#0 memset::dst#2 ] { } main:2::memset:7 [ memset::c#4 memset::end#0 memset::dst#2 ] { } ) always clobbers reg byte a
Statement [23] *((byte*) memset::dst#2) ← (byte) memset::c#4 [ memset::c#4 memset::end#0 memset::dst#2 ] ( memset:5 [ memset::c#4 memset::end#0 memset::dst#2 ] { } main:2::memset:5 [ memset::c#4 memset::end#0 memset::dst#2 ] { } memset:7 [ memset::c#4 memset::end#0 memset::dst#2 ] { } main:2::memset:7 [ memset::c#4 memset::end#0 memset::dst#2 ] { } ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte y as potential for zp[1]:8 [ memset::c#4 ]
Statement [25] *((const nomodify byte*) SCREEN+(byte) $4e) ← (byte) '<' [ ] ( [ ] { } ) always clobbers reg byte a
Statement [27] *((const nomodify byte*) SCREEN+(byte) $4f) ← (byte) '>' [ ] ( [ ] { } ) always clobbers reg byte a
Statement [4] *((const nomodify byte*) VIC_MEMORY) ← (byte) $14 [ ] ( [ ] { } main:2 [ ] { } ) always clobbers reg byte a
Statement [9] if((byte) 0!=*((byte*) main::msg#2)) goto main::@2 [ main::msg#2 main::sc#2 ] ( [ main::msg#2 main::sc#2 ] { } main:2 [ main::msg#2 main::sc#2 ] { } ) always clobbers reg byte a reg byte y
Statement [10] if(*((const nomodify byte*) RASTER)==(byte) $36) goto main::@4 [ ] ( [ ] { } main:2 [ ] { } ) always clobbers reg byte a
@ -775,37 +755,35 @@ Statement [11] if(*((const nomodify byte*) RASTER)==(byte) $42) goto main::@4 [
Statement [12] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLACK [ ] ( [ ] { } main:2 [ ] { } ) always clobbers reg byte a
Statement [13] *((const nomodify byte*) BGCOL) ← (const nomodify byte) WHITE [ ] ( [ ] { } main:2 [ ] { } ) always clobbers reg byte a
Statement [14] *((byte*) main::sc#2) ← *((byte*) main::msg#2) [ main::msg#2 main::sc#2 ] ( [ main::msg#2 main::sc#2 ] { } main:2 [ main::msg#2 main::sc#2 ] { } ) always clobbers reg byte a reg byte y
Statement [18] if((word) memset::num#2<=(byte) 0) goto memset::@return [ memset::num#2 memset::str#3 memset::c#4 ] ( memset:5 [ memset::num#2 memset::str#3 memset::c#4 ] { } main:2::memset:5 [ memset::num#2 memset::str#3 memset::c#4 ] { } memset:7 [ memset::num#2 memset::str#3 memset::c#4 ] { } main:2::memset:7 [ memset::num#2 memset::str#3 memset::c#4 ] { } ) always clobbers reg byte a
Statement [19] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 [ memset::str#3 memset::c#4 memset::end#0 ] ( memset:5 [ memset::str#3 memset::c#4 memset::end#0 ] { } main:2::memset:5 [ memset::str#3 memset::c#4 memset::end#0 ] { } memset:7 [ memset::str#3 memset::c#4 memset::end#0 ] { } main:2::memset:7 [ memset::str#3 memset::c#4 memset::end#0 ] { } ) always clobbers reg byte a
Statement [20] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3 [ memset::c#4 memset::end#0 memset::dst#4 ] ( memset:5 [ memset::c#4 memset::end#0 memset::dst#4 ] { } main:2::memset:5 [ memset::c#4 memset::end#0 memset::dst#4 ] { } memset:7 [ memset::c#4 memset::end#0 memset::dst#4 ] { } main:2::memset:7 [ memset::c#4 memset::end#0 memset::dst#4 ] { } ) always clobbers reg byte a
Statement [22] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 [ memset::c#4 memset::end#0 memset::dst#2 ] ( memset:5 [ memset::c#4 memset::end#0 memset::dst#2 ] { } main:2::memset:5 [ memset::c#4 memset::end#0 memset::dst#2 ] { } memset:7 [ memset::c#4 memset::end#0 memset::dst#2 ] { } main:2::memset:7 [ memset::c#4 memset::end#0 memset::dst#2 ] { } ) always clobbers reg byte a
Statement [24] *((byte*) memset::dst#2) ← (byte) memset::c#4 [ memset::c#4 memset::end#0 memset::dst#2 ] ( memset:5 [ memset::c#4 memset::end#0 memset::dst#2 ] { } main:2::memset:5 [ memset::c#4 memset::end#0 memset::dst#2 ] { } memset:7 [ memset::c#4 memset::end#0 memset::dst#2 ] { } main:2::memset:7 [ memset::c#4 memset::end#0 memset::dst#2 ] { } ) always clobbers reg byte a reg byte y
Statement [26] *((const nomodify byte*) SCREEN+(byte) $4e) ← (byte) '<' [ ] ( [ ] { } ) always clobbers reg byte a
Statement [28] *((const nomodify byte*) SCREEN+(byte) $4f) ← (byte) '>' [ ] ( [ ] { } ) always clobbers reg byte a
Statement [18] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word)(number) $28*(number) $19 [ memset::str#3 memset::c#4 memset::end#0 ] ( memset:5 [ memset::str#3 memset::c#4 memset::end#0 ] { } main:2::memset:5 [ memset::str#3 memset::c#4 memset::end#0 ] { } memset:7 [ memset::str#3 memset::c#4 memset::end#0 ] { } main:2::memset:7 [ memset::str#3 memset::c#4 memset::end#0 ] { } ) always clobbers reg byte a
Statement [19] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3 [ memset::c#4 memset::end#0 memset::dst#4 ] ( memset:5 [ memset::c#4 memset::end#0 memset::dst#4 ] { } main:2::memset:5 [ memset::c#4 memset::end#0 memset::dst#4 ] { } memset:7 [ memset::c#4 memset::end#0 memset::dst#4 ] { } main:2::memset:7 [ memset::c#4 memset::end#0 memset::dst#4 ] { } ) always clobbers reg byte a
Statement [21] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 [ memset::c#4 memset::end#0 memset::dst#2 ] ( memset:5 [ memset::c#4 memset::end#0 memset::dst#2 ] { } main:2::memset:5 [ memset::c#4 memset::end#0 memset::dst#2 ] { } memset:7 [ memset::c#4 memset::end#0 memset::dst#2 ] { } main:2::memset:7 [ memset::c#4 memset::end#0 memset::dst#2 ] { } ) always clobbers reg byte a
Statement [23] *((byte*) memset::dst#2) ← (byte) memset::c#4 [ memset::c#4 memset::end#0 memset::dst#2 ] ( memset:5 [ memset::c#4 memset::end#0 memset::dst#2 ] { } main:2::memset:5 [ memset::c#4 memset::end#0 memset::dst#2 ] { } memset:7 [ memset::c#4 memset::end#0 memset::dst#2 ] { } main:2::memset:7 [ memset::c#4 memset::end#0 memset::dst#2 ] { } ) always clobbers reg byte a reg byte y
Statement [25] *((const nomodify byte*) SCREEN+(byte) $4e) ← (byte) '<' [ ] ( [ ] { } ) always clobbers reg byte a
Statement [27] *((const nomodify byte*) SCREEN+(byte) $4f) ← (byte) '>' [ ] ( [ ] { } ) always clobbers reg byte a
Potential registers zp[2]:2 [ main::msg#2 main::msg#1 ] : zp[2]:2 ,
Potential registers zp[2]:4 [ main::sc#2 main::sc#1 ] : zp[2]:4 ,
Potential registers zp[2]:6 [ memset::num#2 ] : zp[2]:6 ,
Potential registers zp[2]:8 [ memset::str#3 ] : zp[2]:8 ,
Potential registers zp[1]:10 [ memset::c#4 ] : zp[1]:10 , reg byte x ,
Potential registers zp[2]:11 [ memset::dst#2 memset::dst#4 memset::dst#1 ] : zp[2]:11 ,
Potential registers zp[2]:13 [ memset::end#0 ] : zp[2]:13 ,
Potential registers zp[2]:6 [ memset::str#3 ] : zp[2]:6 ,
Potential registers zp[1]:8 [ memset::c#4 ] : zp[1]:8 , reg byte x ,
Potential registers zp[2]:9 [ memset::dst#2 memset::dst#4 memset::dst#1 ] : zp[2]:9 ,
Potential registers zp[2]:11 [ memset::end#0 ] : zp[2]:11 ,
REGISTER UPLIFT SCOPES
Uplift Scope [memset] 3,572.33: zp[2]:11 [ memset::dst#2 memset::dst#4 memset::dst#1 ] 183.67: zp[2]:13 [ memset::end#0 ] 125.12: zp[1]:10 [ memset::c#4 ] 101: zp[2]:6 [ memset::num#2 ] 0: zp[2]:8 [ memset::str#3 ]
Uplift Scope [memset] 3,572.33: zp[2]:9 [ memset::dst#2 memset::dst#4 memset::dst#1 ] 183.67: zp[2]:11 [ memset::end#0 ] 143: zp[1]:8 [ memset::c#4 ] 0: zp[2]:6 [ memset::str#3 ]
Uplift Scope [main] 303: zp[2]:2 [ main::msg#2 main::msg#1 ] 202: zp[2]:4 [ main::sc#2 main::sc#1 ]
Uplift Scope [syscall1]
Uplift Scope [syscall2]
Uplift Scope [SysCall]
Uplift Scope []
Uplifting [memset] best 1869 combination zp[2]:11 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:13 [ memset::end#0 ] reg byte x [ memset::c#4 ] zp[2]:6 [ memset::num#2 ] zp[2]:8 [ memset::str#3 ]
Uplifting [main] best 1869 combination zp[2]:2 [ main::msg#2 main::msg#1 ] zp[2]:4 [ main::sc#2 main::sc#1 ]
Uplifting [syscall1] best 1869 combination
Uplifting [syscall2] best 1869 combination
Uplifting [SysCall] best 1869 combination
Uplifting [] best 1869 combination
Coalescing zero page register [ zp[2]:6 [ memset::num#2 ] ] with [ zp[2]:13 [ memset::end#0 ] ] - score: 1
Coalescing zero page register [ zp[2]:8 [ memset::str#3 ] ] with [ zp[2]:11 [ memset::dst#2 memset::dst#4 memset::dst#1 ] ] - score: 1
Uplifting [memset] best 1863 combination zp[2]:9 [ memset::dst#2 memset::dst#4 memset::dst#1 ] zp[2]:11 [ memset::end#0 ] reg byte x [ memset::c#4 ] zp[2]:6 [ memset::str#3 ]
Uplifting [main] best 1863 combination zp[2]:2 [ main::msg#2 main::msg#1 ] zp[2]:4 [ main::sc#2 main::sc#1 ]
Uplifting [syscall1] best 1863 combination
Uplifting [syscall2] best 1863 combination
Uplifting [SysCall] best 1863 combination
Uplifting [] best 1863 combination
Coalescing zero page register [ zp[2]:6 [ memset::str#3 ] ] with [ zp[2]:9 [ memset::dst#2 memset::dst#4 memset::dst#1 ] ] - score: 1
Allocated (was zp[2]:11) zp[2]:8 [ memset::end#0 ]
ASSEMBLER BEFORE OPTIMIZATION
// File Comments
@ -865,11 +843,6 @@ main: {
sta.z memset.str
lda #>SCREEN
sta.z memset.str+1
// [17] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main->memset#2] -- vwuz1=vwuc1
lda #<$28*$19
sta.z memset.num
lda #>$28*$19
sta.z memset.num+1
jsr memset
// [6] phi from main to main::@6 [phi:main->main::@6]
__b6_from_main:
@ -886,11 +859,6 @@ main: {
sta.z memset.str
lda #>COLS
sta.z memset.str+1
// [17] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@6->memset#2] -- vwuz1=vwuc1
lda #<$28*$19
sta.z memset.num
lda #>$28*$19
sta.z memset.num+1
jsr memset
// [8] phi from main::@6 to main::@1 [phi:main::@6->main::@1]
__b1_from___b6:
@ -964,38 +932,31 @@ main: {
}
// memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zp(8) str, byte register(X) c, word zp(6) num)
// memset(void* zp(6) str, byte register(X) c)
memset: {
.label end = 6
.label dst = 8
.label num = 6
.label str = 8
// [18] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1
lda.z num
bne !+
lda.z num+1
beq __breturn
!:
.label end = 8
.label dst = 6
.label str = 6
jmp __b1
// memset::@1
__b1:
// [19] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz1
lda.z end
// [18] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word)(number) $28*(number) $19 -- pbuz1=pbuz2_plus_vwuc1
lda.z str
clc
adc.z str
adc #<$28*$19
sta.z end
lda.z end+1
adc.z str+1
lda.z str+1
adc #>$28*$19
sta.z end+1
// [20] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3
// [21] phi from memset::@1 memset::@3 to memset::@2 [phi:memset::@1/memset::@3->memset::@2]
// [19] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3
// [20] phi from memset::@1 memset::@3 to memset::@2 [phi:memset::@1/memset::@3->memset::@2]
__b2_from___b1:
__b2_from___b3:
// [21] phi (byte*) memset::dst#2 = (byte*) memset::dst#4 [phi:memset::@1/memset::@3->memset::@2#0] -- register_copy
// [20] phi (byte*) memset::dst#2 = (byte*) memset::dst#4 [phi:memset::@1/memset::@3->memset::@2#0] -- register_copy
jmp __b2
// memset::@2
__b2:
// [22] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 -- pbuz1_neq_pbuz2_then_la1
// [21] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 -- pbuz1_neq_pbuz2_then_la1
lda.z dst+1
cmp.z end+1
bne __b3
@ -1005,15 +966,15 @@ memset: {
jmp __breturn
// memset::@return
__breturn:
// [23] return
// [22] return
rts
// memset::@3
__b3:
// [24] *((byte*) memset::dst#2) ← (byte) memset::c#4 -- _deref_pbuz1=vbuxx
// [23] *((byte*) memset::dst#2) ← (byte) memset::c#4 -- _deref_pbuz1=vbuxx
txa
ldy #0
sta (dst),y
// [25] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
// [24] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
inc.z dst
bne !+
inc.z dst+1
@ -1022,24 +983,24 @@ memset: {
}
// syscall2
syscall2: {
// [26] *((const nomodify byte*) SCREEN+(byte) $4e) ← (byte) '<' -- _deref_pbuc1=vbuc2
// [25] *((const nomodify byte*) SCREEN+(byte) $4e) ← (byte) '<' -- _deref_pbuc1=vbuc2
lda #'<'
sta SCREEN+$4e
jmp __breturn
// syscall2::@return
__breturn:
// [27] return
// [26] return
rts
}
// syscall1
syscall1: {
// [28] *((const nomodify byte*) SCREEN+(byte) $4f) ← (byte) '>' -- _deref_pbuc1=vbuc2
// [27] *((const nomodify byte*) SCREEN+(byte) $4f) ← (byte) '>' -- _deref_pbuc1=vbuc2
lda #'>'
sta SCREEN+$4f
jmp __breturn
// syscall1::@return
__breturn:
// [29] return
// [28] return
rts
}
// File Data
@ -1092,6 +1053,7 @@ Removing instruction __b1_from___b2:
Removing instruction __b1:
Removing instruction __breturn:
Removing instruction __breturn:
Removing instruction __breturn:
Succesful ASM optimization Pass5UnusedLabelElimination
Removing instruction jsr main
Succesful ASM optimization Pass5SkipBegin
@ -1135,18 +1097,17 @@ FINAL SYMBOL TABLE
(label) memset::@3
(label) memset::@return
(byte) memset::c
(byte) memset::c#4 reg byte x 125.125
(byte) memset::c#4 reg byte x 143.0
(byte*) memset::dst
(byte*) memset::dst#1 dst zp[2]:8 2002.0
(byte*) memset::dst#2 dst zp[2]:8 1368.3333333333335
(byte*) memset::dst#4 dst zp[2]:8 202.0
(byte*) memset::dst#1 dst zp[2]:6 2002.0
(byte*) memset::dst#2 dst zp[2]:6 1368.3333333333335
(byte*) memset::dst#4 dst zp[2]:6 202.0
(byte*) memset::end
(byte*) memset::end#0 end zp[2]:6 183.66666666666669
(byte*) memset::end#0 end zp[2]:8 183.66666666666669
(word) memset::num
(word) memset::num#2 num zp[2]:6 101.0
(void*) memset::return
(void*) memset::str
(void*) memset::str#3 str zp[2]:8
(void*) memset::str#3 str zp[2]:6
(void()) syscall1()
(label) syscall1::@return
(void()) syscall2()
@ -1154,13 +1115,13 @@ FINAL SYMBOL TABLE
zp[2]:2 [ main::msg#2 main::msg#1 ]
zp[2]:4 [ main::sc#2 main::sc#1 ]
zp[2]:6 [ memset::num#2 memset::end#0 ]
zp[2]:8 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ]
zp[2]:6 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ]
reg byte x [ memset::c#4 ]
zp[2]:8 [ memset::end#0 ]
FINAL ASSEMBLER
Score: 1633
Score: 1600
// File Comments
// XMega65 Kernal Development Template
@ -1213,11 +1174,6 @@ main: {
sta.z memset.str
lda #>SCREEN
sta.z memset.str+1
// [17] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main->memset#2] -- vwuz1=vwuc1
lda #<$28*$19
sta.z memset.num
lda #>$28*$19
sta.z memset.num+1
jsr memset
// [6] phi from main to main::@6 [phi:main->main::@6]
// main::@6
@ -1231,11 +1187,6 @@ main: {
sta.z memset.str
lda #>COLS
sta.z memset.str+1
// [17] phi (word) memset::num#2 = (word)(number) $28*(number) $19 [phi:main::@6->memset#2] -- vwuz1=vwuc1
lda #<$28*$19
sta.z memset.num
lda #>$28*$19
sta.z memset.num+1
jsr memset
// [8] phi from main::@6 to main::@1 [phi:main::@6->main::@1]
// [8] phi (byte*) main::sc#2 = (const nomodify byte*) SCREEN+(byte) $28 [phi:main::@6->main::@1#0] -- pbuz1=pbuc1
@ -1306,36 +1257,28 @@ main: {
}
// memset
// Copies the character c (an unsigned char) to the first num characters of the object pointed to by the argument str.
// memset(void* zp(8) str, byte register(X) c, word zp(6) num)
// memset(void* zp(6) str, byte register(X) c)
memset: {
.label end = 6
.label dst = 8
.label num = 6
.label str = 8
// if(num>0)
// [18] if((word) memset::num#2<=(byte) 0) goto memset::@return -- vwuz1_le_0_then_la1
lda.z num
bne !+
lda.z num+1
beq __breturn
!:
.label end = 8
.label dst = 6
.label str = 6
// memset::@1
// end = (char*)str + num
// [19] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word) memset::num#2 -- pbuz1=pbuz2_plus_vwuz1
lda.z end
// [18] (byte*) memset::end#0 ← (byte*)(void*) memset::str#3 + (word)(number) $28*(number) $19 -- pbuz1=pbuz2_plus_vwuc1
lda.z str
clc
adc.z str
adc #<$28*$19
sta.z end
lda.z end+1
adc.z str+1
lda.z str+1
adc #>$28*$19
sta.z end+1
// [20] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3
// [21] phi from memset::@1 memset::@3 to memset::@2 [phi:memset::@1/memset::@3->memset::@2]
// [21] phi (byte*) memset::dst#2 = (byte*) memset::dst#4 [phi:memset::@1/memset::@3->memset::@2#0] -- register_copy
// [19] (byte*) memset::dst#4 ← (byte*)(void*) memset::str#3
// [20] phi from memset::@1 memset::@3 to memset::@2 [phi:memset::@1/memset::@3->memset::@2]
// [20] phi (byte*) memset::dst#2 = (byte*) memset::dst#4 [phi:memset::@1/memset::@3->memset::@2#0] -- register_copy
// memset::@2
__b2:
// for(char* dst = str; dst!=end; dst++)
// [22] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 -- pbuz1_neq_pbuz2_then_la1
// [21] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@3 -- pbuz1_neq_pbuz2_then_la1
lda.z dst+1
cmp.z end+1
bne __b3
@ -1343,19 +1286,18 @@ memset: {
cmp.z end
bne __b3
// memset::@return
__breturn:
// }
// [23] return
// [22] return
rts
// memset::@3
__b3:
// *dst = c
// [24] *((byte*) memset::dst#2) ← (byte) memset::c#4 -- _deref_pbuz1=vbuxx
// [23] *((byte*) memset::dst#2) ← (byte) memset::c#4 -- _deref_pbuz1=vbuxx
txa
ldy #0
sta (dst),y
// for(char* dst = str; dst!=end; dst++)
// [25] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
// [24] (byte*) memset::dst#1 ← ++ (byte*) memset::dst#2 -- pbuz1=_inc_pbuz1
inc.z dst
bne !+
inc.z dst+1
@ -1365,23 +1307,23 @@ memset: {
// syscall2
syscall2: {
// *(SCREEN+78) = '<'
// [26] *((const nomodify byte*) SCREEN+(byte) $4e) ← (byte) '<' -- _deref_pbuc1=vbuc2
// [25] *((const nomodify byte*) SCREEN+(byte) $4e) ← (byte) '<' -- _deref_pbuc1=vbuc2
lda #'<'
sta SCREEN+$4e
// syscall2::@return
// }
// [27] return
// [26] return
rts
}
// syscall1
syscall1: {
// *(SCREEN+79) = '>'
// [28] *((const nomodify byte*) SCREEN+(byte) $4f) ← (byte) '>' -- _deref_pbuc1=vbuc2
// [27] *((const nomodify byte*) SCREEN+(byte) $4f) ← (byte) '>' -- _deref_pbuc1=vbuc2
lda #'>'
sta SCREEN+$4f
// syscall1::@return
// }
// [29] return
// [28] return
rts
}
// File Data

View File

@ -36,18 +36,17 @@
(label) memset::@3
(label) memset::@return
(byte) memset::c
(byte) memset::c#4 reg byte x 125.125
(byte) memset::c#4 reg byte x 143.0
(byte*) memset::dst
(byte*) memset::dst#1 dst zp[2]:8 2002.0
(byte*) memset::dst#2 dst zp[2]:8 1368.3333333333335
(byte*) memset::dst#4 dst zp[2]:8 202.0
(byte*) memset::dst#1 dst zp[2]:6 2002.0
(byte*) memset::dst#2 dst zp[2]:6 1368.3333333333335
(byte*) memset::dst#4 dst zp[2]:6 202.0
(byte*) memset::end
(byte*) memset::end#0 end zp[2]:6 183.66666666666669
(byte*) memset::end#0 end zp[2]:8 183.66666666666669
(word) memset::num
(word) memset::num#2 num zp[2]:6 101.0
(void*) memset::return
(void*) memset::str
(void*) memset::str#3 str zp[2]:8
(void*) memset::str#3 str zp[2]:6
(void()) syscall1()
(label) syscall1::@return
(void()) syscall2()
@ -55,6 +54,6 @@
zp[2]:2 [ main::msg#2 main::msg#1 ]
zp[2]:4 [ main::sc#2 main::sc#1 ]
zp[2]:6 [ memset::num#2 memset::end#0 ]
zp[2]:8 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ]
zp[2]:6 [ memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ]
reg byte x [ memset::c#4 ]
zp[2]:8 [ memset::end#0 ]

View File

@ -289,7 +289,7 @@ __bend:
// main
main: {
.label port4Value = 2
// [4] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) ← *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) & (byte) $7f -- _deref_pbuc1=_deref_pbuc2_band_vbuc3
// [4] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) ← *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
lda #$7f
and CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_B
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_B
@ -356,7 +356,7 @@ __bend_from___b1:
__bend:
// main
main: {
// [4] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) ← *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) & (byte) $7f -- _deref_pbuc1=_deref_pbuc2_band_vbuc3
// [4] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) ← *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
lda #$7f
and CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_B
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_B
@ -515,7 +515,7 @@ Score: 26
// main
main: {
// (CIA2->PORT_B) &= 0x7f
// [4] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) ← *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) & (byte) $7f -- _deref_pbuc1=_deref_pbuc2_band_vbuc3
// [4] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) ← *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
lda #$7f
and CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_B
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_B

View File

@ -7,13 +7,15 @@
.pc = $80d "Program"
.label SPRITES_XPOS = $d000
.label SPRITES_YPOS = $d001
.label RASTER = $d012
.label SPRITES_ENABLE = $d015
.label BORDERCOL = $d020
.label SPRITES_COLS = $d027
// The VIC-II MOS 6567/6569
.label VICII = $d000
.const GREEN = 5
.const LIGHT_BLUE = $e
.const LIGHT_GREY = $f
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
// The rotated point - updated by calling rotate_matrix()
.label xr = $f0
.label yr = $f1
@ -65,22 +67,22 @@ anim: {
sta.z sy
sta.z sx
__b2:
// while(*RASTER!=$ff)
// while(VICII->RASTER!=$ff)
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
__b3:
// while(*RASTER!=$fe)
// while(VICII->RASTER!=$fe)
lda #$fe
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b3
__b4:
// while(*RASTER!=$fd)
// while(VICII->RASTER!=$fd)
lda #$fd
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b4
// (*BORDERCOL)++;
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// calculate_matrix(sx,sy,sz)
ldx.z sx
//calculate_matrix_16(sx,sy,sz);
@ -90,8 +92,8 @@ anim: {
lda #0
sta.z i
__b6:
// (*BORDERCOL)++;
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// rotate_matrix(xs[i], ys[i], zs[i])
ldy.z i
ldx xs,y
@ -140,14 +142,14 @@ anim: {
lda #8
cmp.z i
bne __b6
// *BORDERCOL = LIGHT_GREY
// VICII->BORDER_COLOR = LIGHT_GREY
lda #LIGHT_GREY
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// debug_print()
jsr debug_print
// *BORDERCOL = LIGHT_BLUE
// VICII->BORDER_COLOR = LIGHT_BLUE
lda #LIGHT_BLUE
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// sx +=2
// Increment angles
inc.z sx
@ -1199,9 +1201,9 @@ memset: {
sprites_init: {
.label SCREEN = $400
.label sprites_ptr = SCREEN+$3f8
// *SPRITES_ENABLE = %11111111
// VICII->SPRITES_ENABLE = %11111111
lda #$ff
sta SPRITES_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
ldx #0
__b1:
// sprites_ptr[i] = (char)(SPRITE/$40)

View File

@ -39,16 +39,16 @@ anim::@1: scope:[anim] from anim anim::@10
[13] (signed byte) sx#10 ← phi( anim/(signed byte) 0 anim::@10/(signed byte) sx#3 )
to:anim::@2
anim::@2: scope:[anim] from anim::@1 anim::@2
[14] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2
[14] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2
to:anim::@3
anim::@3: scope:[anim] from anim::@2 anim::@3
[15] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto anim::@3
[15] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto anim::@3
to:anim::@4
anim::@4: scope:[anim] from anim::@3 anim::@4
[16] if(*((const nomodify byte*) RASTER)!=(byte) $fd) goto anim::@4
[16] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fd) goto anim::@4
to:anim::@5
anim::@5: scope:[anim] from anim::@4
[17] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[18] (signed byte) calculate_matrix::sx#0 ← (signed byte) sx#10
[19] (signed byte) calculate_matrix::sy#0 ← (signed byte) sy#10
[20] call calculate_matrix
@ -59,7 +59,7 @@ anim::@8: scope:[anim] from anim::@5
to:anim::@6
anim::@6: scope:[anim] from anim::@8 anim::@9
[23] (byte) anim::i#2 ← phi( anim::@9/(byte) anim::i#1 anim::@8/(byte) 0 )
[24] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[24] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[25] (signed byte) rotate_matrix::x#0 ← *((const signed byte*) xs + (byte) anim::i#2)
[26] (signed byte) rotate_matrix::y#0 ← *((const signed byte*) ys + (byte) anim::i#2)
[27] (signed byte) rotate_matrix::z#0 ← *((const signed byte*) zs + (byte) anim::i#2)
@ -81,11 +81,11 @@ anim::@9: scope:[anim] from anim::@6
[41] if((byte) anim::i#1!=(byte) 8) goto anim::@6
to:anim::@7
anim::@7: scope:[anim] from anim::@9
[42] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_GREY
[42] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_GREY
[43] call debug_print
to:anim::@10
anim::@10: scope:[anim] from anim::@7
[44] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE
[44] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE
[45] (signed byte) sx#3 ← (signed byte) sx#10 + (signed byte) 2
[46] (signed byte) sy#3 ← (signed byte) sy#10 - (signed byte) 3
to:anim::@1
@ -486,7 +486,7 @@ memset::@2: scope:[memset] from memset::@1
(void()) sprites_init()
sprites_init: scope:[sprites_init] from main
[259] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff
[259] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff
to:sprites_init::@1
sprites_init::@1: scope:[sprites_init] from sprites_init sprites_init::@1
[260] (byte) sprites_init::i#2 ← phi( sprites_init/(byte) 0 sprites_init::@1/(byte) sprites_init::i#1 )

View File

@ -327,28 +327,28 @@ anim::@2: scope:[anim] from anim::@1 anim::@2
(byte*) print_screen#50 ← phi( anim::@1/(byte*) print_screen#51 anim::@2/(byte*) print_screen#50 )
(signed byte) sy#25 ← phi( anim::@1/(signed byte) sy#16 anim::@2/(signed byte) sy#25 )
(signed byte) sx#23 ← phi( anim::@1/(signed byte) sx#16 anim::@2/(signed byte) sx#23 )
(bool~) anim::$0 ← *((const nomodify byte*) RASTER) != (number) $ff
(bool~) anim::$0 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $ff
if((bool~) anim::$0) goto anim::@2
to:anim::@3
anim::@3: scope:[anim] from anim::@2 anim::@3
(byte*) print_screen#49 ← phi( anim::@2/(byte*) print_screen#50 anim::@3/(byte*) print_screen#49 )
(signed byte) sy#21 ← phi( anim::@2/(signed byte) sy#25 anim::@3/(signed byte) sy#21 )
(signed byte) sx#20 ← phi( anim::@2/(signed byte) sx#23 anim::@3/(signed byte) sx#20 )
(bool~) anim::$1 ← *((const nomodify byte*) RASTER) != (number) $fe
(bool~) anim::$1 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $fe
if((bool~) anim::$1) goto anim::@3
to:anim::@4
anim::@4: scope:[anim] from anim::@3 anim::@4
(byte*) print_screen#48 ← phi( anim::@3/(byte*) print_screen#49 anim::@4/(byte*) print_screen#48 )
(signed byte) sy#14 ← phi( anim::@3/(signed byte) sy#21 anim::@4/(signed byte) sy#14 )
(signed byte) sx#14 ← phi( anim::@3/(signed byte) sx#20 anim::@4/(signed byte) sx#14 )
(bool~) anim::$2 ← *((const nomodify byte*) RASTER) != (number) $fd
(bool~) anim::$2 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $fd
if((bool~) anim::$2) goto anim::@4
to:anim::@5
anim::@5: scope:[anim] from anim::@4
(byte*) print_screen#47 ← phi( anim::@4/(byte*) print_screen#48 )
(signed byte) sy#8 ← phi( anim::@4/(signed byte) sy#14 )
(signed byte) sx#8 ← phi( anim::@4/(signed byte) sx#14 )
*((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
(signed byte) calculate_matrix::sx#0 ← (signed byte) sx#8
(signed byte) calculate_matrix::sy#0 ← (signed byte) sy#8
(signed byte) calculate_matrix::sz#0 ← (const signed byte) sz
@ -371,7 +371,7 @@ anim::@6: scope:[anim] from anim::@10 anim::@9
(signed byte) sy#26 ← phi( anim::@10/(signed byte) sy#22 anim::@9/(signed byte) sy#28 )
(signed byte) sx#24 ← phi( anim::@10/(signed byte) sx#21 anim::@9/(signed byte) sx#25 )
(byte) anim::i#2 ← phi( anim::@10/(byte) anim::i#1 anim::@9/(byte) anim::i#0 )
*((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
(signed byte) rotate_matrix::x#0 ← *((const signed byte*) xs + (byte) anim::i#2)
(signed byte) rotate_matrix::y#0 ← *((const signed byte*) ys + (byte) anim::i#2)
(signed byte) rotate_matrix::z#0 ← *((const signed byte*) zs + (byte) anim::i#2)
@ -404,14 +404,14 @@ anim::@7: scope:[anim] from anim::@10
(byte*) print_screen#28 ← phi( anim::@10/(byte*) print_screen#41 )
(signed byte) sy#15 ← phi( anim::@10/(signed byte) sy#22 )
(signed byte) sx#15 ← phi( anim::@10/(signed byte) sx#21 )
*((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_GREY
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_GREY
call debug_print
to:anim::@11
anim::@11: scope:[anim] from anim::@7
(byte*) print_screen#53 ← phi( anim::@7/(byte*) print_screen#28 )
(signed byte) sy#9 ← phi( anim::@7/(signed byte) sy#15 )
(signed byte) sx#9 ← phi( anim::@7/(signed byte) sx#15 )
*((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE
(signed byte) sx#3 ← (signed byte) sx#9 + (number) 2
(signed byte) sy#3 ← (signed byte) sy#9 - (number) 3
to:anim::@1
@ -951,7 +951,7 @@ debug_print::@return: scope:[debug_print] from debug_print::@31
(void()) sprites_init()
sprites_init: scope:[sprites_init] from main
*((const nomodify byte*) SPRITES_ENABLE) ← (number) $ff
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (number) $ff
(byte*~) sprites_init::$0 ← (const byte*) sprites_init::SCREEN + (number) $3f8
(byte*) sprites_init::sprites_ptr#0 ← (byte*~) sprites_init::$0
(byte) sprites_init::i#0 ← (byte) 0
@ -1081,7 +1081,6 @@ SYMBOL TABLE SSA
(label) @4
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const signed byte*) COSH = (const signed byte*) SINH+(number) $40
(const signed byte*) COSQ = (const signed byte*) SINQ+(number) $40
(const nomodify byte) GREEN = (byte) 5
@ -1171,6 +1170,9 @@ SYMBOL TABLE SSA
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = (byte) $15
(const signed byte*) PERSP_Z[(number) $100] = kickasm {{ {
.var d = 256.0
.var z0 = 6.0
@ -1188,7 +1190,6 @@ SYMBOL TABLE SSA
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10
(const byte) RADIX::OCTAL = (number) 8
(const nomodify byte*) RASTER = (byte*)(number) $d012
(const byte*) SCREEN = (byte*)(number) $400
(const signed byte*) SINH[(number) $140] = kickasm {{ {
.var min = -$2000
@ -1212,9 +1213,9 @@ SYMBOL TABLE SSA
}}
(const byte*) SPRITE = (byte*)(number) $3000
(const nomodify byte*) SPRITES_COLS = (byte*)(number) $d027
(const nomodify byte*) SPRITES_ENABLE = (byte*)(number) $d015
(const nomodify byte*) SPRITES_XPOS = (byte*)(number) $d000
(const nomodify byte*) SPRITES_YPOS = (byte*)(number) $d001
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*)(number) $d000
(void()) anim()
(bool~) anim::$0
(bool~) anim::$1
@ -2041,9 +2042,9 @@ Adding number conversion cast (unumber) $f in (number~) print_uchar_at::$2 ← (
Adding number conversion cast (unumber) print_uchar_at::$2 in (number~) print_uchar_at::$2 ← (byte) print_uchar_at::b#2 & (unumber)(number) $f
Adding number conversion cast (unumber) 1 in (byte*~) print_uchar_at::$3 ← (byte*) print_uchar_at::at#2 + (number) 1
Adding number conversion cast (unumber) $3e8 in (word) memset::num#0 ← (number) $3e8
Adding number conversion cast (unumber) $ff in (bool~) anim::$0 ← *((const nomodify byte*) RASTER) != (number) $ff
Adding number conversion cast (unumber) $fe in (bool~) anim::$1 ← *((const nomodify byte*) RASTER) != (number) $fe
Adding number conversion cast (unumber) $fd in (bool~) anim::$2 ← *((const nomodify byte*) RASTER) != (number) $fd
Adding number conversion cast (unumber) $ff in (bool~) anim::$0 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $ff
Adding number conversion cast (unumber) $fe in (bool~) anim::$1 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $fe
Adding number conversion cast (unumber) $fd in (bool~) anim::$2 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $fd
Adding number conversion cast (unumber) 2 in (number~) anim::$8 ← (byte) anim::i#3 * (number) 2
Adding number conversion cast (unumber) anim::$8 in (number~) anim::$8 ← (byte) anim::i#3 * (unumber)(number) 2
Adding number conversion cast (unumber) $80 in (number~) anim::$9 ← (number) $80 + (byte~) anim::$13
@ -2149,7 +2150,7 @@ Adding number conversion cast (unumber) $28*3 in (byte*~) debug_print::$22 ← (
Adding number conversion cast (unumber) $28*4 in (byte*~) debug_print::$25 ← (byte*) debug_print::at_line#5 + (number) $28*(number) 4
Adding number conversion cast (unumber) $28*5 in (byte*~) debug_print::$28 ← (byte*) debug_print::at_line#6 + (number) $28*(number) 5
Adding number conversion cast (unumber) 4 in (byte) debug_print::c#1 ← (byte) debug_print::c#8 + (number) 4
Adding number conversion cast (unumber) $ff in *((const nomodify byte*) SPRITES_ENABLE) ← (number) $ff
Adding number conversion cast (unumber) $ff in *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (number) $ff
Adding number conversion cast (unumber) $3f8 in (byte*~) sprites_init::$0 ← (const byte*) sprites_init::SCREEN + (number) $3f8
Adding number conversion cast (unumber) $40 in (byte*~) sprites_init::$1 ← (const byte*) SPRITE / (number) $40
Adding number conversion cast (unumber) 0 in *((const signed byte*) rotation_matrix + (number) 0) ← (signed byte~) calculate_matrix::$10
@ -2188,14 +2189,12 @@ Inlining cast (byte) debug_print::print_schar_pos11_row#0 ← (unumber)(number)
Inlining cast (byte) debug_print::print_schar_pos11_col#0 ← (unumber)(number) $21
Inlining cast (byte) debug_print::print_schar_pos12_row#0 ← (unumber)(number) 6
Inlining cast (byte) debug_print::print_schar_pos12_col#0 ← (unumber)(number) $25
Inlining cast *((const nomodify byte*) SPRITES_ENABLE) ← (unumber)(number) $ff
Inlining cast *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (unumber)(number) $ff
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53248
Simplifying constant pointer cast (byte*) 53249
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 53269
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53287
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
Simplifying constant pointer cast (byte*) 55296
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (signed byte*) 240
@ -2587,9 +2586,9 @@ Simple Condition (bool~) memset::$1 [2] if((word) memset::num#0<=(byte) 0) goto
Simple Condition (bool~) memset::$3 [9] if((byte*) memset::dst#2!=(byte*) memset::end#0) goto memset::@4
Simple Condition (bool~) print_str_at::$0 [17] if((byte) 0!=*((byte*) print_str_at::str#13)) goto print_str_at::@2
Simple Condition (bool~) print_schar_at::$0 [24] if((signed byte) print_schar_at::b#22<(signed byte) 0) goto print_schar_at::@1
Simple Condition (bool~) anim::$0 [73] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2
Simple Condition (bool~) anim::$1 [76] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto anim::@3
Simple Condition (bool~) anim::$2 [79] if(*((const nomodify byte*) RASTER)!=(byte) $fd) goto anim::@4
Simple Condition (bool~) anim::$0 [73] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2
Simple Condition (bool~) anim::$1 [76] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto anim::@3
Simple Condition (bool~) anim::$2 [79] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fd) goto anim::@4
Simple Condition (bool~) anim::$11 [108] if((byte) anim::i#1!=rangelast(0,7)) goto anim::@6
Simple Condition (bool~) debug_print_init::$67 [214] if((byte) debug_print_init::j#1!=rangelast(0,3)) goto debug_print_init::@2
Simple Condition (bool~) debug_print_init::$68 [218] if((byte) debug_print_init::i#1!=rangelast(0,7)) goto debug_print_init::@1
@ -3292,16 +3291,16 @@ anim::@1: scope:[anim] from anim anim::@10
[13] (signed byte) sx#10 ← phi( anim/(signed byte) 0 anim::@10/(signed byte) sx#3 )
to:anim::@2
anim::@2: scope:[anim] from anim::@1 anim::@2
[14] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2
[14] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2
to:anim::@3
anim::@3: scope:[anim] from anim::@2 anim::@3
[15] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto anim::@3
[15] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto anim::@3
to:anim::@4
anim::@4: scope:[anim] from anim::@3 anim::@4
[16] if(*((const nomodify byte*) RASTER)!=(byte) $fd) goto anim::@4
[16] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fd) goto anim::@4
to:anim::@5
anim::@5: scope:[anim] from anim::@4
[17] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[18] (signed byte) calculate_matrix::sx#0 ← (signed byte) sx#10
[19] (signed byte) calculate_matrix::sy#0 ← (signed byte) sy#10
[20] call calculate_matrix
@ -3312,7 +3311,7 @@ anim::@8: scope:[anim] from anim::@5
to:anim::@6
anim::@6: scope:[anim] from anim::@8 anim::@9
[23] (byte) anim::i#2 ← phi( anim::@9/(byte) anim::i#1 anim::@8/(byte) 0 )
[24] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[24] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[25] (signed byte) rotate_matrix::x#0 ← *((const signed byte*) xs + (byte) anim::i#2)
[26] (signed byte) rotate_matrix::y#0 ← *((const signed byte*) ys + (byte) anim::i#2)
[27] (signed byte) rotate_matrix::z#0 ← *((const signed byte*) zs + (byte) anim::i#2)
@ -3334,11 +3333,11 @@ anim::@9: scope:[anim] from anim::@6
[41] if((byte) anim::i#1!=(byte) 8) goto anim::@6
to:anim::@7
anim::@7: scope:[anim] from anim::@9
[42] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_GREY
[42] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_GREY
[43] call debug_print
to:anim::@10
anim::@10: scope:[anim] from anim::@7
[44] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE
[44] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE
[45] (signed byte) sx#3 ← (signed byte) sx#10 + (signed byte) 2
[46] (signed byte) sy#3 ← (signed byte) sy#10 - (signed byte) 3
to:anim::@1
@ -3739,7 +3738,7 @@ memset::@2: scope:[memset] from memset::@1
(void()) sprites_init()
sprites_init: scope:[sprites_init] from main
[259] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff
[259] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff
to:sprites_init::@1
sprites_init::@1: scope:[sprites_init] from sprites_init sprites_init::@1
[260] (byte) sprites_init::i#2 ← phi( sprites_init/(byte) 0 sprites_init::@1/(byte) sprites_init::i#1 )
@ -4345,13 +4344,15 @@ Target platform is c64basic / MOS6502X
// Global Constants & labels
.label SPRITES_XPOS = $d000
.label SPRITES_YPOS = $d001
.label RASTER = $d012
.label SPRITES_ENABLE = $d015
.label BORDERCOL = $d020
.label SPRITES_COLS = $d027
// The VIC-II MOS 6567/6569
.label VICII = $d000
.const GREEN = 5
.const LIGHT_BLUE = $e
.const LIGHT_GREY = $f
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
// The rotated point - updated by calling rotate_matrix()
.label xr = $f0
.label yr = $f1
@ -4445,29 +4446,29 @@ anim: {
jmp __b2
// anim::@2
__b2:
// [14] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// [14] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
jmp __b3
// anim::@3
__b3:
// [15] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto anim::@3 -- _deref_pbuc1_neq_vbuc2_then_la1
// [15] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto anim::@3 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$fe
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b3
jmp __b4
// anim::@4
__b4:
// [16] if(*((const nomodify byte*) RASTER)!=(byte) $fd) goto anim::@4 -- _deref_pbuc1_neq_vbuc2_then_la1
// [16] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fd) goto anim::@4 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$fd
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b4
jmp __b5
// anim::@5
__b5:
// [17] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [18] (signed byte) calculate_matrix::sx#0 ← (signed byte) sx#10 -- vbsz1=vbsz2
lda.z sx
sta.z calculate_matrix.sx
@ -4496,8 +4497,8 @@ anim: {
jmp __b6
// anim::@6
__b6:
// [24] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [24] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [25] (signed byte) rotate_matrix::x#0 ← *((const signed byte*) xs + (byte) anim::i#2) -- vbsz1=pbsc1_derefidx_vbuz2
ldy.z i
lda xs,y
@ -4570,17 +4571,17 @@ anim: {
jmp __b7
// anim::@7
__b7:
// [42] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_GREY -- _deref_pbuc1=vbuc2
// [42] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_GREY -- _deref_pbuc1=vbuc2
lda #LIGHT_GREY
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [43] call debug_print
jsr debug_print
jmp __b10
// anim::@10
__b10:
// [44] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE -- _deref_pbuc1=vbuc2
// [44] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE -- _deref_pbuc1=vbuc2
lda #LIGHT_BLUE
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [45] (signed byte) sx#3 ← (signed byte) sx#10 + (signed byte) 2 -- vbsz1=vbsz1_plus_2
// Increment angles
inc.z sx
@ -6245,9 +6246,9 @@ sprites_init: {
.label SCREEN = $400
.label sprites_ptr = SCREEN+$3f8
.label i = $16
// [259] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
// [259] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
lda #$ff
sta SPRITES_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
// [260] phi from sprites_init to sprites_init::@1 [phi:sprites_init->sprites_init::@1]
__b1_from_sprites_init:
// [260] phi (byte) sprites_init::i#2 = (byte) 0 [phi:sprites_init->sprites_init::@1#0] -- vbuz1=vbuc1
@ -6370,11 +6371,11 @@ SINQ:
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [6] *((const word*) psp1) ← (word)(const byte*) mulf_sqr1 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [7] *((const word*) psp2) ← (word)(const byte*) mulf_sqr2 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [14] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [14] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ sx#10 sx#3 ]
Removing always clobbered register reg byte a as potential for zp[1]:3 [ sy#10 sy#3 ]
Statement [15] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto anim::@3 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [16] if(*((const nomodify byte*) RASTER)!=(byte) $fd) goto anim::@4 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [15] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto anim::@3 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [16] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fd) goto anim::@4 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [29] *((const signed byte*) xrs + (byte) anim::i#2) ← *((const signed byte*) xr) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:4 [ anim::i#2 anim::i#1 ]
Statement [30] *((const signed byte*) yrs + (byte) anim::i#2) ← *((const signed byte*) yr) [ sx#10 sy#10 anim::i#2 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 ] { } ) always clobbers reg byte a
@ -6386,8 +6387,8 @@ Statement [35] (byte) anim::i2#0 ← (byte) anim::i#2 << (byte) 1 [ sx#10 sy#10
Statement [36] (byte~) anim::$9 ← (byte) $80 + (byte)*((const signed byte*) xp) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$9 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$9 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:28 [ anim::i2#0 ]
Statement [38] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) yp) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] { } ) always clobbers reg byte a
Statement [42] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_GREY [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [44] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [42] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_GREY [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [44] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [46] (signed byte) sy#3 ← (signed byte) sy#10 - (signed byte) 3 [ sx#3 sy#3 ] ( main:2::anim:10 [ sx#3 sy#3 ] { } ) always clobbers reg byte a
Statement [83] (byte*) print_schar_at::at#15 ← (const byte*) debug_print::at_line#0 + (byte) debug_print::c#2 [ sx#10 sy#10 debug_print::c#2 debug_print::i#2 print_schar_at::at#15 ] ( main:2::anim:10::debug_print:43 [ sx#10 sy#10 debug_print::c#2 debug_print::i#2 print_schar_at::at#15 ] { { print_schar_at::b#16 = print_schar_at::b#22 } { print_schar_at::at#15 = print_schar_at::at#21 } } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:5 [ debug_print::c#2 debug_print::c#1 ]
@ -6501,15 +6502,15 @@ Statement [245] if((byte) 0!=*((byte*) print_str_at::str#13)) goto print_str_at:
Statement [247] *((byte*) print_str_at::at#13) ← *((byte*) print_str_at::str#13) [ print_str_at::str#13 print_str_at::at#13 ] ( main:2::debug_print_init:8::print_str_at:184 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:186 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:188 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:190 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:192 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:194 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:196 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:198 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:200 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:202 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:204 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:206 [ print_str_at::str#13 print_str_at::at#13 ] { } ) always clobbers reg byte a reg byte y
Statement [255] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::debug_print_init:8::print_cls:182::memset:251 [ memset::dst#2 ] { } ) always clobbers reg byte a
Statement [257] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::debug_print_init:8::print_cls:182::memset:251 [ memset::dst#2 ] { } ) always clobbers reg byte a reg byte y
Statement [259] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::sprites_init:5 [ ] { } ) always clobbers reg byte a
Statement [259] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::sprites_init:5 [ ] { } ) always clobbers reg byte a
Statement [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ sprites_init::i#2 ] ( main:2::sprites_init:5 [ sprites_init::i#2 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:22 [ sprites_init::i#2 sprites_init::i#1 ]
Statement [262] *((const nomodify byte*) SPRITES_COLS + (byte) sprites_init::i#2) ← (const nomodify byte) GREEN [ sprites_init::i#2 ] ( main:2::sprites_init:5 [ sprites_init::i#2 ] { } ) always clobbers reg byte a
Statement [6] *((const word*) psp1) ← (word)(const byte*) mulf_sqr1 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [7] *((const word*) psp2) ← (word)(const byte*) mulf_sqr2 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [14] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [15] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto anim::@3 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [16] if(*((const nomodify byte*) RASTER)!=(byte) $fd) goto anim::@4 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [14] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [15] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto anim::@3 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [16] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fd) goto anim::@4 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [25] (signed byte) rotate_matrix::x#0 ← *((const signed byte*) xs + (byte) anim::i#2) [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 ] { } ) always clobbers reg byte y
Statement [26] (signed byte) rotate_matrix::y#0 ← *((const signed byte*) ys + (byte) anim::i#2) [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 rotate_matrix::y#0 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 rotate_matrix::y#0 ] { } ) always clobbers reg byte y
Removing always clobbered register reg byte y as potential for zp[1]:25 [ rotate_matrix::x#0 ]
@ -6525,8 +6526,8 @@ Statement [35] (byte) anim::i2#0 ← (byte) anim::i#2 << (byte) 1 [ sx#10 sy#10
Statement [36] (byte~) anim::$9 ← (byte) $80 + (byte)*((const signed byte*) xp) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$9 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$9 ] { } ) always clobbers reg byte a
Statement [38] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) yp) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] { } ) always clobbers reg byte a
Statement [41] if((byte) anim::i#1!=(byte) 8) goto anim::@6 [ sx#10 sy#10 anim::i#1 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#1 ] { } ) always clobbers reg byte a
Statement [42] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_GREY [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [44] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [42] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_GREY [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [44] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [46] (signed byte) sy#3 ← (signed byte) sy#10 - (signed byte) 3 [ sx#3 sy#3 ] ( main:2::anim:10 [ sx#3 sy#3 ] { } ) always clobbers reg byte a reg byte x
Statement [83] (byte*) print_schar_at::at#15 ← (const byte*) debug_print::at_line#0 + (byte) debug_print::c#2 [ sx#10 sy#10 debug_print::c#2 debug_print::i#2 print_schar_at::at#15 ] ( main:2::anim:10::debug_print:43 [ sx#10 sy#10 debug_print::c#2 debug_print::i#2 print_schar_at::at#15 ] { { print_schar_at::b#16 = print_schar_at::b#22 } { print_schar_at::at#15 = print_schar_at::at#21 } } ) always clobbers reg byte a
Statement [86] (byte*) print_schar_at::at#16 ← (const byte*) debug_print::at_line#0+(byte)(number) $28*(number) 1 + (byte) debug_print::c#2 [ sx#10 sy#10 debug_print::c#2 debug_print::i#2 print_schar_at::at#16 ] ( main:2::anim:10::debug_print:43 [ sx#10 sy#10 debug_print::c#2 debug_print::i#2 print_schar_at::at#16 ] { { print_schar_at::b#17 = print_schar_at::b#22 } { print_schar_at::at#16 = print_schar_at::at#21 } } ) always clobbers reg byte a
@ -6610,14 +6611,14 @@ Statement [245] if((byte) 0!=*((byte*) print_str_at::str#13)) goto print_str_at:
Statement [247] *((byte*) print_str_at::at#13) ← *((byte*) print_str_at::str#13) [ print_str_at::str#13 print_str_at::at#13 ] ( main:2::debug_print_init:8::print_str_at:184 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:186 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:188 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:190 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:192 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:194 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:196 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:198 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:200 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:202 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:204 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:206 [ print_str_at::str#13 print_str_at::at#13 ] { } ) always clobbers reg byte a reg byte y
Statement [255] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::debug_print_init:8::print_cls:182::memset:251 [ memset::dst#2 ] { } ) always clobbers reg byte a
Statement [257] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::debug_print_init:8::print_cls:182::memset:251 [ memset::dst#2 ] { } ) always clobbers reg byte a reg byte y
Statement [259] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::sprites_init:5 [ ] { } ) always clobbers reg byte a
Statement [259] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::sprites_init:5 [ ] { } ) always clobbers reg byte a
Statement [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ sprites_init::i#2 ] ( main:2::sprites_init:5 [ sprites_init::i#2 ] { } ) always clobbers reg byte a
Statement [262] *((const nomodify byte*) SPRITES_COLS + (byte) sprites_init::i#2) ← (const nomodify byte) GREEN [ sprites_init::i#2 ] ( main:2::sprites_init:5 [ sprites_init::i#2 ] { } ) always clobbers reg byte a
Statement [6] *((const word*) psp1) ← (word)(const byte*) mulf_sqr1 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [7] *((const word*) psp2) ← (word)(const byte*) mulf_sqr2 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [14] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [15] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto anim::@3 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [16] if(*((const nomodify byte*) RASTER)!=(byte) $fd) goto anim::@4 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [14] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [15] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto anim::@3 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [16] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fd) goto anim::@4 [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [25] (signed byte) rotate_matrix::x#0 ← *((const signed byte*) xs + (byte) anim::i#2) [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 ] { } ) always clobbers reg byte y
Statement [26] (signed byte) rotate_matrix::y#0 ← *((const signed byte*) ys + (byte) anim::i#2) [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 rotate_matrix::y#0 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 rotate_matrix::y#0 ] { } ) always clobbers reg byte y
Statement [27] (signed byte) rotate_matrix::z#0 ← *((const signed byte*) zs + (byte) anim::i#2) [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 rotate_matrix::y#0 rotate_matrix::z#0 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 rotate_matrix::x#0 rotate_matrix::y#0 rotate_matrix::z#0 ] { } ) always clobbers reg byte y
@ -6631,8 +6632,8 @@ Statement [35] (byte) anim::i2#0 ← (byte) anim::i#2 << (byte) 1 [ sx#10 sy#10
Statement [36] (byte~) anim::$9 ← (byte) $80 + (byte)*((const signed byte*) xp) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$9 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$9 ] { } ) always clobbers reg byte a
Statement [38] (byte~) anim::$10 ← (byte) $80 + (byte)*((const signed byte*) yp) [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#2 anim::i2#0 anim::$10 ] { } ) always clobbers reg byte a
Statement [41] if((byte) anim::i#1!=(byte) 8) goto anim::@6 [ sx#10 sy#10 anim::i#1 ] ( main:2::anim:10 [ sx#10 sy#10 anim::i#1 ] { } ) always clobbers reg byte a
Statement [42] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_GREY [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [44] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [42] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_GREY [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [44] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE [ sx#10 sy#10 ] ( main:2::anim:10 [ sx#10 sy#10 ] { } ) always clobbers reg byte a
Statement [46] (signed byte) sy#3 ← (signed byte) sy#10 - (signed byte) 3 [ sx#3 sy#3 ] ( main:2::anim:10 [ sx#3 sy#3 ] { } ) always clobbers reg byte a reg byte x
Statement [83] (byte*) print_schar_at::at#15 ← (const byte*) debug_print::at_line#0 + (byte) debug_print::c#2 [ sx#10 sy#10 debug_print::c#2 debug_print::i#2 print_schar_at::at#15 ] ( main:2::anim:10::debug_print:43 [ sx#10 sy#10 debug_print::c#2 debug_print::i#2 print_schar_at::at#15 ] { { print_schar_at::b#16 = print_schar_at::b#22 } { print_schar_at::at#15 = print_schar_at::at#21 } } ) always clobbers reg byte a
Statement [84] (signed byte) print_schar_at::b#16 ← *((const signed byte*) xrs + (byte) debug_print::i#2) [ sx#10 sy#10 debug_print::c#2 debug_print::i#2 print_schar_at::at#15 print_schar_at::b#16 ] ( main:2::anim:10::debug_print:43 [ sx#10 sy#10 debug_print::c#2 debug_print::i#2 print_schar_at::at#15 print_schar_at::b#16 ] { { print_schar_at::b#16 = print_schar_at::b#22 } { print_schar_at::at#15 = print_schar_at::at#21 } } ) always clobbers reg byte y
@ -6721,7 +6722,7 @@ Statement [245] if((byte) 0!=*((byte*) print_str_at::str#13)) goto print_str_at:
Statement [247] *((byte*) print_str_at::at#13) ← *((byte*) print_str_at::str#13) [ print_str_at::str#13 print_str_at::at#13 ] ( main:2::debug_print_init:8::print_str_at:184 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:186 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:188 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:190 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:192 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:194 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:196 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:198 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:200 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:202 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:204 [ print_str_at::str#13 print_str_at::at#13 ] { } main:2::debug_print_init:8::print_str_at:206 [ print_str_at::str#13 print_str_at::at#13 ] { } ) always clobbers reg byte a reg byte y
Statement [255] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::debug_print_init:8::print_cls:182::memset:251 [ memset::dst#2 ] { } ) always clobbers reg byte a
Statement [257] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::debug_print_init:8::print_cls:182::memset:251 [ memset::dst#2 ] { } ) always clobbers reg byte a reg byte y
Statement [259] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::sprites_init:5 [ ] { } ) always clobbers reg byte a
Statement [259] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::sprites_init:5 [ ] { } ) always clobbers reg byte a
Statement [261] *((const byte*) sprites_init::sprites_ptr#0 + (byte) sprites_init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ sprites_init::i#2 ] ( main:2::sprites_init:5 [ sprites_init::i#2 ] { } ) always clobbers reg byte a
Statement [262] *((const nomodify byte*) SPRITES_COLS + (byte) sprites_init::i#2) ← (const nomodify byte) GREEN [ sprites_init::i#2 ] ( main:2::sprites_init:5 [ sprites_init::i#2 ] { } ) always clobbers reg byte a
Potential registers zp[1]:2 [ sx#10 sx#3 ] : zp[1]:2 ,
@ -7009,13 +7010,15 @@ ASSEMBLER BEFORE OPTIMIZATION
// Global Constants & labels
.label SPRITES_XPOS = $d000
.label SPRITES_YPOS = $d001
.label RASTER = $d012
.label SPRITES_ENABLE = $d015
.label BORDERCOL = $d020
.label SPRITES_COLS = $d027
// The VIC-II MOS 6567/6569
.label VICII = $d000
.const GREEN = 5
.const LIGHT_BLUE = $e
.const LIGHT_GREY = $f
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
// The rotated point - updated by calling rotate_matrix()
.label xr = $f0
.label yr = $f1
@ -7106,29 +7109,29 @@ anim: {
jmp __b2
// anim::@2
__b2:
// [14] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// [14] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
jmp __b3
// anim::@3
__b3:
// [15] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto anim::@3 -- _deref_pbuc1_neq_vbuc2_then_la1
// [15] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto anim::@3 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$fe
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b3
jmp __b4
// anim::@4
__b4:
// [16] if(*((const nomodify byte*) RASTER)!=(byte) $fd) goto anim::@4 -- _deref_pbuc1_neq_vbuc2_then_la1
// [16] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fd) goto anim::@4 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$fd
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b4
jmp __b5
// anim::@5
__b5:
// [17] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [18] (signed byte) calculate_matrix::sx#0 ← (signed byte) sx#10 -- vbsxx=vbsz1
ldx.z sx
// [19] (signed byte) calculate_matrix::sy#0 ← (signed byte) sy#10
@ -7154,8 +7157,8 @@ anim: {
jmp __b6
// anim::@6
__b6:
// [24] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [24] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [25] (signed byte) rotate_matrix::x#0 ← *((const signed byte*) xs + (byte) anim::i#2) -- vbsxx=pbsc1_derefidx_vbuz1
ldy.z i
ldx xs,y
@ -7221,17 +7224,17 @@ anim: {
jmp __b7
// anim::@7
__b7:
// [42] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_GREY -- _deref_pbuc1=vbuc2
// [42] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_GREY -- _deref_pbuc1=vbuc2
lda #LIGHT_GREY
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [43] call debug_print
jsr debug_print
jmp __b10
// anim::@10
__b10:
// [44] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE -- _deref_pbuc1=vbuc2
// [44] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE -- _deref_pbuc1=vbuc2
lda #LIGHT_BLUE
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [45] (signed byte) sx#3 ← (signed byte) sx#10 + (signed byte) 2 -- vbsz1=vbsz1_plus_2
// Increment angles
inc.z sx
@ -8739,9 +8742,9 @@ memset: {
sprites_init: {
.label SCREEN = $400
.label sprites_ptr = SCREEN+$3f8
// [259] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
// [259] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
lda #$ff
sta SPRITES_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
// [260] phi from sprites_init to sprites_init::@1 [phi:sprites_init->sprites_init::@1]
__b1_from_sprites_init:
// [260] phi (byte) sprites_init::i#2 = (byte) 0 [phi:sprites_init->sprites_init::@1#0] -- vbuxx=vbuc1
@ -9116,15 +9119,14 @@ Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
Fixing long branch [315] bne __b1 to beq
Fixing long branch [921] bne __b2 to beq
Fixing long branch [930] bne __b1 to beq
Fixing long branch [317] bne __b1 to beq
Fixing long branch [923] bne __b2 to beq
Fixing long branch [932] bne __b1 to beq
FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const signed byte*) COSH = (const signed byte*) SINH+(byte) $40
(const signed byte*) COSQ = (const signed byte*) SINQ+(byte) $40
(const nomodify byte) GREEN = (byte) 5
@ -9214,6 +9216,9 @@ FINAL SYMBOL TABLE
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = (byte) $15
(const signed byte*) PERSP_Z[(number) $100] = kickasm {{ {
.var d = 256.0
.var z0 = 6.0
@ -9231,7 +9236,6 @@ FINAL SYMBOL TABLE
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10
(const byte) RADIX::OCTAL = (number) 8
(const nomodify byte*) RASTER = (byte*) 53266
(const byte*) SCREEN = (byte*) 1024
(const signed byte*) SINH[(number) $140] = kickasm {{ {
.var min = -$2000
@ -9255,9 +9259,9 @@ FINAL SYMBOL TABLE
}}
(const byte*) SPRITE = (byte*) 12288
(const nomodify byte*) SPRITES_COLS = (byte*) 53287
(const nomodify byte*) SPRITES_ENABLE = (byte*) 53269
(const nomodify byte*) SPRITES_XPOS = (byte*) 53248
(const nomodify byte*) SPRITES_YPOS = (byte*) 53249
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(void()) anim()
(byte~) anim::$10 reg byte a 20002.0
(byte~) anim::$9 reg byte a 20002.0
@ -9735,13 +9739,15 @@ Score: 67977
// Global Constants & labels
.label SPRITES_XPOS = $d000
.label SPRITES_YPOS = $d001
.label RASTER = $d012
.label SPRITES_ENABLE = $d015
.label BORDERCOL = $d020
.label SPRITES_COLS = $d027
// The VIC-II MOS 6567/6569
.label VICII = $d000
.const GREEN = 5
.const LIGHT_BLUE = $e
.const LIGHT_GREY = $f
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
// The rotated point - updated by calling rotate_matrix()
.label xr = $f0
.label yr = $f1
@ -9819,29 +9825,29 @@ anim: {
// anim::@1
// anim::@2
__b2:
// while(*RASTER!=$ff)
// [14] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// while(VICII->RASTER!=$ff)
// [14] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
// anim::@3
__b3:
// while(*RASTER!=$fe)
// [15] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto anim::@3 -- _deref_pbuc1_neq_vbuc2_then_la1
// while(VICII->RASTER!=$fe)
// [15] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto anim::@3 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$fe
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b3
// anim::@4
__b4:
// while(*RASTER!=$fd)
// [16] if(*((const nomodify byte*) RASTER)!=(byte) $fd) goto anim::@4 -- _deref_pbuc1_neq_vbuc2_then_la1
// while(VICII->RASTER!=$fd)
// [16] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fd) goto anim::@4 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$fd
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b4
// anim::@5
// (*BORDERCOL)++;
// [17] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
// [17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// calculate_matrix(sx,sy,sz)
// [18] (signed byte) calculate_matrix::sx#0 ← (signed byte) sx#10 -- vbsxx=vbsz1
ldx.z sx
@ -9862,9 +9868,9 @@ anim: {
// [23] phi (byte) anim::i#2 = (byte) anim::i#1 [phi:anim::@9->anim::@6#0] -- register_copy
// anim::@6
__b6:
// (*BORDERCOL)++;
// [24] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
// [24] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// rotate_matrix(xs[i], ys[i], zs[i])
// [25] (signed byte) rotate_matrix::x#0 ← *((const signed byte*) xs + (byte) anim::i#2) -- vbsxx=pbsc1_derefidx_vbuz1
ldy.z i
@ -9932,18 +9938,18 @@ anim: {
cmp.z i
bne __b6
// anim::@7
// *BORDERCOL = LIGHT_GREY
// [42] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_GREY -- _deref_pbuc1=vbuc2
// VICII->BORDER_COLOR = LIGHT_GREY
// [42] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_GREY -- _deref_pbuc1=vbuc2
lda #LIGHT_GREY
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// debug_print()
// [43] call debug_print
jsr debug_print
// anim::@10
// *BORDERCOL = LIGHT_BLUE
// [44] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE -- _deref_pbuc1=vbuc2
// VICII->BORDER_COLOR = LIGHT_BLUE
// [44] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE -- _deref_pbuc1=vbuc2
lda #LIGHT_BLUE
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// sx +=2
// [45] (signed byte) sx#3 ← (signed byte) sx#10 + (signed byte) 2 -- vbsz1=vbsz1_plus_2
// Increment angles
@ -11416,10 +11422,10 @@ memset: {
sprites_init: {
.label SCREEN = $400
.label sprites_ptr = SCREEN+$3f8
// *SPRITES_ENABLE = %11111111
// [259] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
// VICII->SPRITES_ENABLE = %11111111
// [259] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
lda #$ff
sta SPRITES_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
// [260] phi from sprites_init to sprites_init::@1 [phi:sprites_init->sprites_init::@1]
// [260] phi (byte) sprites_init::i#2 = (byte) 0 [phi:sprites_init->sprites_init::@1#0] -- vbuxx=vbuc1
ldx #0

View File

@ -1,7 +1,6 @@
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const signed byte*) COSH = (const signed byte*) SINH+(byte) $40
(const signed byte*) COSQ = (const signed byte*) SINQ+(byte) $40
(const nomodify byte) GREEN = (byte) 5
@ -91,6 +90,9 @@
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = (byte) $15
(const signed byte*) PERSP_Z[(number) $100] = kickasm {{ {
.var d = 256.0
.var z0 = 6.0
@ -108,7 +110,6 @@
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10
(const byte) RADIX::OCTAL = (number) 8
(const nomodify byte*) RASTER = (byte*) 53266
(const byte*) SCREEN = (byte*) 1024
(const signed byte*) SINH[(number) $140] = kickasm {{ {
.var min = -$2000
@ -132,9 +133,9 @@
}}
(const byte*) SPRITE = (byte*) 12288
(const nomodify byte*) SPRITES_COLS = (byte*) 53287
(const nomodify byte*) SPRITES_ENABLE = (byte*) 53269
(const nomodify byte*) SPRITES_XPOS = (byte*) 53248
(const nomodify byte*) SPRITES_YPOS = (byte*) 53249
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(void()) anim()
(byte~) anim::$10 reg byte a 20002.0
(byte~) anim::$9 reg byte a 20002.0

View File

@ -1,22 +1,24 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label BORDERCOL = $d020
.label BGCOL = $d021
.label D011 = $d011
.const VIC_BMM = $20
.const VIC_DEN = $10
.const VIC_RSEL = 8
.label VIC_MEMORY = $d018
// The VIC-II MOS 6567/6569
.label VICII = $d000
.label SCREEN = $400
.label BITMAP = $2000
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const lines_cnt = 8
main: {
// *BORDERCOL = 0
// VICII->BORDER_COLOR = 0
lda #0
sta BORDERCOL
// *BGCOL = 0
sta BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// VICII->BG_COLOR = 0
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// *D011 = VIC_BMM|VIC_DEN|VIC_RSEL|3
lda #VIC_BMM|VIC_DEN|VIC_RSEL|3
sta D011

View File

@ -10,8 +10,8 @@
(void()) main()
main: scope:[main] from @1
[4] *((const nomodify byte*) BORDERCOL) ← (byte) 0
[5] *((const nomodify byte*) BGCOL) ← (byte) 0
[4] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) 0
[5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (byte) 0
[6] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_BMM|(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3
[7] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) $40|(word)(const nomodify byte*) BITMAP&(word) $3fff/(word) $400
[8] call bitmap_init

View File

@ -565,8 +565,8 @@ bitmap_line_ydxd::@return: scope:[bitmap_line_ydxd] from bitmap_line_ydxd::@2
(void()) main()
main: scope:[main] from @1
*((const nomodify byte*) BORDERCOL) ← (number) 0
*((const nomodify byte*) BGCOL) ← (number) 0
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (number) 0
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (number) 0
*((const nomodify byte*) D011) ← (const nomodify byte) VIC_BMM|(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(number) 3
*((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) SCREEN&(number) $3fff/(number) $40|(word)(const nomodify byte*) BITMAP&(number) $3fff/(number) $400
(byte*) bitmap_init::bitmap#0 ← (const nomodify byte*) BITMAP
@ -646,9 +646,7 @@ SYMBOL TABLE SSA
(label) @2
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*)(number) $d021
(const nomodify byte*) BITMAP = (byte*)(number) $2000
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify byte*) D011 = (byte*)(number) $d011
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
@ -734,7 +732,10 @@ SYMBOL TABLE SSA
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const nomodify byte*) SCREEN = (byte*)(number) $400
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*)(number) $d000
(const nomodify byte) VIC_BMM = (byte) $20
(const nomodify byte) VIC_DEN = (byte) $10
(const nomodify byte*) VIC_MEMORY = (byte*)(number) $d018
@ -1289,8 +1290,8 @@ Adding number conversion cast (unumber) bitmap_line_ydxi::$6 in (number~) bitmap
Adding number conversion cast (unumber) 1 in (byte~) bitmap_line_ydxd::$0 ← (byte) bitmap_line_ydxd::xd#2 >> (number) 1
Adding number conversion cast (unumber) 1 in (number~) bitmap_line_ydxd::$6 ← (byte) bitmap_line_ydxd::y1#2 + (number) 1
Adding number conversion cast (unumber) bitmap_line_ydxd::$6 in (number~) bitmap_line_ydxd::$6 ← (byte) bitmap_line_ydxd::y1#2 + (unumber)(number) 1
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) BORDERCOL) ← (number) 0
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) BGCOL) ← (number) 0
Adding number conversion cast (unumber) 0 in *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (number) 0
Adding number conversion cast (unumber) 0 in *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (number) 0
Adding number conversion cast (unumber) VIC_BMM|VIC_DEN|VIC_RSEL|3 in *((const nomodify byte*) D011) ← (const nomodify byte) VIC_BMM|(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(number) 3
Adding number conversion cast (unumber) 3 in *((const nomodify byte*) D011) ← ((unumber)) (const nomodify byte) VIC_BMM|(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(number) 3
Adding number conversion cast (unumber) $3fff in *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) SCREEN&(number) $3fff/(number) $40|(word)(const nomodify byte*) BITMAP&(number) $3fff/(number) $400
@ -1308,15 +1309,14 @@ Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte) bitmap_init::bits#2 ← (unumber)(number) $80
Inlining cast *((byte*) bitmap_clear::bitmap#2) ← (unumber)(number) 0
Inlining cast (byte*) bitmap_plot::plotter#0 ← (byte*)(word~) bitmap_plot::$0
Inlining cast *((const nomodify byte*) BORDERCOL) ← (unumber)(number) 0
Inlining cast *((const nomodify byte*) BGCOL) ← (unumber)(number) 0
Inlining cast *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (unumber)(number) 0
Inlining cast *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (unumber)(number) 0
Inlining cast *((const nomodify byte*) D011) ← (unumber)(const nomodify byte) VIC_BMM|(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(unumber)(number) 3
Inlining cast *((byte*) init_screen::c#3) ← (unumber)(number) $14
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53281
Simplifying constant pointer cast (byte*) 53265
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 8192
Simplifying constant integer cast $f8
@ -1823,8 +1823,8 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
[4] *((const nomodify byte*) BORDERCOL) ← (byte) 0
[5] *((const nomodify byte*) BGCOL) ← (byte) 0
[4] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) 0
[5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (byte) 0
[6] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_BMM|(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3
[7] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) $40|(word)(const nomodify byte*) BITMAP&(word) $3fff/(word) $400
[8] call bitmap_init
@ -2691,15 +2691,17 @@ Target platform is c64basic / MOS6502X
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
.label BORDERCOL = $d020
.label BGCOL = $d021
.label D011 = $d011
.const VIC_BMM = $20
.const VIC_DEN = $10
.const VIC_RSEL = 8
.label VIC_MEMORY = $d018
// The VIC-II MOS 6567/6569
.label VICII = $d000
.label SCREEN = $400
.label BITMAP = $2000
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const lines_cnt = 8
// @begin
__bbegin:
@ -2717,12 +2719,12 @@ __bend_from___b1:
__bend:
// main
main: {
// [4] *((const nomodify byte*) BORDERCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// [4] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
sta BORDERCOL
// [5] *((const nomodify byte*) BGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
sta BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// [6] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_BMM|(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 -- _deref_pbuc1=vbuc2
lda #VIC_BMM|VIC_DEN|VIC_RSEL|3
sta D011
@ -3767,8 +3769,8 @@ bitmap_init: {
REGISTER UPLIFT POTENTIAL REGISTERS
Equivalence Class zp[1]:65 [ bitmap_init::$7 ] has ALU potential.
Statement [4] *((const nomodify byte*) BORDERCOL) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [5] *((const nomodify byte*) BGCOL) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [4] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_BMM|(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [7] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) $40|(word)(const nomodify byte*) BITMAP&(word) $3fff/(word) $400 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [26] (byte) bitmap_line::xd#2 ← (byte) bitmap_line::x0#0 - (byte) bitmap_line::x1#0 [ bitmap_line::x0#0 bitmap_line::x1#0 bitmap_line::y0#0 bitmap_line::y1#0 bitmap_line::xd#2 ] ( main:2::lines:14::bitmap_line:23 [ lines::l#2 bitmap_line::x0#0 bitmap_line::x1#0 bitmap_line::y0#0 bitmap_line::y1#0 bitmap_line::xd#2 ] { } ) always clobbers reg byte a
@ -3867,8 +3869,8 @@ Removing always clobbered register reg byte a as potential for zp[1]:36 [ bitmap
Statement [176] *((const to_nomodify byte*) bitmap_plot_bit + (byte) bitmap_init::x#2) ← (byte) bitmap_init::bits#3 [ bitmap_init::x#2 bitmap_init::bits#3 ] ( main:2::bitmap_init:8 [ bitmap_init::x#2 bitmap_init::bits#3 ] { } ) always clobbers reg byte a
Statement [191] (byte*) bitmap_init::yoffs#1 ← (byte*) bitmap_init::yoffs#2 + (word)(number) $28*(number) 8 [ bitmap_init::y#2 bitmap_init::yoffs#1 ] ( main:2::bitmap_init:8 [ bitmap_init::y#2 bitmap_init::yoffs#1 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:37 [ bitmap_init::y#2 bitmap_init::y#1 ]
Statement [4] *((const nomodify byte*) BORDERCOL) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [5] *((const nomodify byte*) BGCOL) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [4] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_BMM|(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [7] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) $40|(word)(const nomodify byte*) BITMAP&(word) $3fff/(word) $400 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [26] (byte) bitmap_line::xd#2 ← (byte) bitmap_line::x0#0 - (byte) bitmap_line::x1#0 [ bitmap_line::x0#0 bitmap_line::x1#0 bitmap_line::y0#0 bitmap_line::y1#0 bitmap_line::xd#2 ] ( main:2::lines:14::bitmap_line:23 [ lines::l#2 bitmap_line::x0#0 bitmap_line::x1#0 bitmap_line::y0#0 bitmap_line::y1#0 bitmap_line::xd#2 ] { } ) always clobbers reg byte a
@ -4125,15 +4127,17 @@ ASSEMBLER BEFORE OPTIMIZATION
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
.label BORDERCOL = $d020
.label BGCOL = $d021
.label D011 = $d011
.const VIC_BMM = $20
.const VIC_DEN = $10
.const VIC_RSEL = 8
.label VIC_MEMORY = $d018
// The VIC-II MOS 6567/6569
.label VICII = $d000
.label SCREEN = $400
.label BITMAP = $2000
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const lines_cnt = 8
// @begin
__bbegin:
@ -4151,12 +4155,12 @@ __bend_from___b1:
__bend:
// main
main: {
// [4] *((const nomodify byte*) BORDERCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// [4] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
sta BORDERCOL
// [5] *((const nomodify byte*) BGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
sta BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// [6] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_BMM|(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 -- _deref_pbuc1=vbuc2
lda #VIC_BMM|VIC_DEN|VIC_RSEL|3
sta D011
@ -5270,9 +5274,7 @@ FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*) 53281
(const nomodify byte*) BITMAP = (byte*) 8192
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) D011 = (byte*) 53265
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
@ -5358,7 +5360,10 @@ FINAL SYMBOL TABLE
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const nomodify byte*) SCREEN = (byte*) 1024
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(const nomodify byte) VIC_BMM = (byte) $20
(const nomodify byte) VIC_DEN = (byte) $10
(const nomodify byte*) VIC_MEMORY = (byte*) 53272
@ -5681,15 +5686,17 @@ Score: 221364
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label BORDERCOL = $d020
.label BGCOL = $d021
.label D011 = $d011
.const VIC_BMM = $20
.const VIC_DEN = $10
.const VIC_RSEL = 8
.label VIC_MEMORY = $d018
// The VIC-II MOS 6567/6569
.label VICII = $d000
.label SCREEN = $400
.label BITMAP = $2000
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const lines_cnt = 8
// @begin
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -5699,13 +5706,13 @@ Score: 221364
// @end
// main
main: {
// *BORDERCOL = 0
// [4] *((const nomodify byte*) BORDERCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// VICII->BORDER_COLOR = 0
// [4] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
sta BORDERCOL
// *BGCOL = 0
// [5] *((const nomodify byte*) BGCOL) ← (byte) 0 -- _deref_pbuc1=vbuc2
sta BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// VICII->BG_COLOR = 0
// [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (byte) 0 -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// *D011 = VIC_BMM|VIC_DEN|VIC_RSEL|3
// [6] *((const nomodify byte*) D011) ← (const nomodify byte) VIC_BMM|(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 -- _deref_pbuc1=vbuc2
lda #VIC_BMM|VIC_DEN|VIC_RSEL|3

View File

@ -1,9 +1,7 @@
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*) 53281
(const nomodify byte*) BITMAP = (byte*) 8192
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) D011 = (byte*) 53265
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
@ -89,7 +87,10 @@
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const nomodify byte*) SCREEN = (byte*) 1024
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(const nomodify byte) VIC_BMM = (byte) $20
(const nomodify byte) VIC_DEN = (byte) $10
(const nomodify byte*) VIC_MEMORY = (byte*) 53272

View File

@ -376,11 +376,6 @@ printf_ulong: {
// Print using format
lda #0
sta.z printf_number_buffer.format_upper_case
lda #<printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_number_buffer.buffer_digits
lda #>printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_number_buffer.buffer_digits+1
lda #0
sta.z printf_number_buffer.format_zero_padding
sta.z printf_number_buffer.format_justify_left
sta.z printf_number_buffer.format_min_length
@ -390,7 +385,7 @@ printf_ulong: {
}
// Print the contents of the number buffer using a specific format.
// This handles minimum length, zero-filling, and left/right justification from the format
// printf_number_buffer(byte zp($16) buffer_sign, byte* zp($c) buffer_digits, byte zp($10) format_min_length, byte zp($24) format_justify_left, byte zp($15) format_zero_padding, byte zp($17) format_upper_case)
// printf_number_buffer(byte zp($16) buffer_sign, byte zp($10) format_min_length, byte zp($24) format_justify_left, byte zp($15) format_zero_padding, byte zp($17) format_upper_case)
printf_number_buffer: {
.label __19 = $a
.label buffer_sign = $16
@ -399,17 +394,12 @@ printf_number_buffer: {
.label format_min_length = $10
.label format_zero_padding = $15
.label format_justify_left = $24
.label buffer_digits = $c
.label format_upper_case = $17
// if(format.min_length)
lda #0
cmp.z format_min_length
beq __b6
// strlen(buffer.digits)
lda.z buffer_digits
sta.z strlen.str
lda.z buffer_digits+1
sta.z strlen.str+1
jsr strlen
// strlen(buffer.digits)
// len = (signed char)strlen(buffer.digits)
@ -481,13 +471,13 @@ printf_number_buffer: {
cmp.z format_upper_case
beq __b5
// strupr(buffer.digits)
lda.z buffer_digits
sta.z strupr.str
lda.z buffer_digits+1
sta.z strupr.str+1
jsr strupr
__b5:
// printf_str(buffer.digits)
lda #<printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_str.str
lda #>printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_str.str+1
jsr printf_str
// if(format.justify_left && !format.zero_padding && padding)
lda #0
@ -532,11 +522,14 @@ printf_padding: {
jmp __b1
}
// Converts a string to uppercase.
// strupr(byte* zp($1f) str)
strupr: {
.label str = printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
.label __0 = $f
.label src = $1f
.label str = $1f
.label src = $c
lda #<str
sta.z src
lda #>str
sta.z src+1
__b1:
// while(*src)
ldy #0
@ -594,6 +587,10 @@ strlen: {
lda #<0
sta.z len
sta.z len+1
lda #<printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z str
lda #>printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z str+1
__b1:
// while(*str)
ldy #0
@ -620,12 +617,12 @@ strlen: {
// - value : The number to be converted to RADIX
// - buffer : receives the string representing the number and zero-termination.
// - radix : The radix to convert the number to (from the enum RADIX)
// ultoa(dword zp(6) value, byte* zp($c) buffer)
// ultoa(dword zp(6) value, byte* zp($1f) buffer)
ultoa: {
.label __10 = $23
.label __11 = $18
.label digit_value = $19
.label buffer = $c
.label buffer = $1f
.label digit = $10
.label value = 6
.label started = $24
@ -720,9 +717,9 @@ ultoa: {
// - sub : the value of a '1' in the digit. Subtracted continually while the digit is increased.
// (For decimal the subs used are 10000, 1000, 100, 10, 1)
// returns : the value reduced by sub * digit so that it is less than sub.
// ultoa_append(byte* zp($c) buffer, dword zp(6) value, dword zp($19) sub)
// ultoa_append(byte* zp($1f) buffer, dword zp(6) value, dword zp($19) sub)
ultoa_append: {
.label buffer = $c
.label buffer = $1f
.label value = 6
.label sub = $19
.label return = 6
@ -976,10 +973,6 @@ printf_uint: {
// Print using format
lda #format_upper_case
sta.z printf_number_buffer.format_upper_case
lda #<printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_number_buffer.buffer_digits
lda #>printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_number_buffer.buffer_digits+1
lda #format_zero_padding
sta.z printf_number_buffer.format_zero_padding
lda #format_justify_left
@ -1349,11 +1342,6 @@ printf_uchar: {
// Print using format
lda #0
sta.z printf_number_buffer.format_upper_case
lda #<printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_number_buffer.buffer_digits
lda #>printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_number_buffer.buffer_digits+1
lda #0
sta.z printf_number_buffer.format_zero_padding
sta.z printf_number_buffer.format_justify_left
sta.z printf_number_buffer.format_min_length

View File

@ -83,7 +83,7 @@ main::@return: scope:[main] from main::@11
(void()) printf_str((byte*) printf_str::str)
printf_str: scope:[printf_str] from main::@1 main::@11 main::@2 main::@7 main::@9 print print::@10 print::@12 print::@4 print::@8 printf_number_buffer::@5 printf_string::@1
[45] (byte*) printf_str::str#15 ← phi( main::@1/(const byte*) main::str main::@11/(const byte*) main::str4 main::@2/(const byte*) main::str1 main::@7/(const byte*) main::str2 main::@9/(const byte*) main::str3 print/(const byte*) print::str print::@10/(const byte*) print::str4 print::@12/(const byte*) print::str1 print::@4/(const byte*) print::str2 print::@8/(const byte*) print::str3 printf_number_buffer::@5/(byte*) printf_str::str#1 printf_string::@1/(const byte*) tod_buffer )
[45] (byte*) printf_str::str#15 ← phi( main::@1/(const byte*) main::str main::@11/(const byte*) main::str4 main::@2/(const byte*) main::str1 main::@7/(const byte*) main::str2 main::@9/(const byte*) main::str3 print/(const byte*) print::str print::@10/(const byte*) print::str4 print::@12/(const byte*) print::str1 print::@4/(const byte*) print::str2 print::@8/(const byte*) print::str3 printf_number_buffer::@5/(byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS printf_string::@1/(const byte*) tod_buffer )
to:printf_str::@1
printf_str::@1: scope:[printf_str] from printf_str printf_str::@4 printf_str::@5
[46] (byte*) printf_str::str#13 ← phi( printf_str/(byte*) printf_str::str#15 printf_str::@4/(byte*) printf_str::str#0 printf_str::@5/(byte*) printf_str::str#0 )
@ -234,14 +234,13 @@ printf_ulong::@return: scope:[printf_ulong] from printf_ulong::@2
printf_number_buffer: scope:[printf_number_buffer] from printf_uchar::@2 printf_uint::@2 printf_ulong::@2
[108] (byte) printf_number_buffer::format_upper_case#10 ← phi( printf_uchar::@2/(byte) 0 printf_uint::@2/(const byte) printf_uint::format_upper_case#0 printf_ulong::@2/(byte) 0 )
[108] (byte) printf_number_buffer::buffer_sign#10 ← phi( printf_uchar::@2/(byte) printf_number_buffer::buffer_sign#2 printf_uint::@2/(byte) printf_number_buffer::buffer_sign#1 printf_ulong::@2/(byte) printf_number_buffer::buffer_sign#0 )
[108] (byte*) printf_number_buffer::buffer_digits#10 ← phi( printf_uchar::@2/(byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS printf_uint::@2/(byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS printf_ulong::@2/(byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS )
[108] (byte) printf_number_buffer::format_zero_padding#10 ← phi( printf_uchar::@2/(byte) 0 printf_uint::@2/(const byte) printf_uint::format_zero_padding#0 printf_ulong::@2/(byte) 0 )
[108] (byte) printf_number_buffer::format_justify_left#10 ← phi( printf_uchar::@2/(byte) 0 printf_uint::@2/(const byte) printf_uint::format_justify_left#0 printf_ulong::@2/(byte) 0 )
[108] (byte) printf_number_buffer::format_min_length#3 ← phi( printf_uchar::@2/(byte) 0 printf_uint::@2/(const byte) printf_uint::format_min_length#0 printf_ulong::@2/(byte) 0 )
[109] if((byte) 0==(byte) printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1
to:printf_number_buffer::@6
printf_number_buffer::@6: scope:[printf_number_buffer] from printf_number_buffer
[110] (byte*) strlen::str#1 ← (byte*) printf_number_buffer::buffer_digits#10
[110] phi()
[111] call strlen
[112] (word) strlen::return#2 ← (word) strlen::len#2
to:printf_number_buffer::@14
@ -296,11 +295,11 @@ printf_number_buffer::@4: scope:[printf_number_buffer] from printf_number_buffe
[134] if((byte) 0==(byte) printf_number_buffer::format_upper_case#10) goto printf_number_buffer::@5
to:printf_number_buffer::@11
printf_number_buffer::@11: scope:[printf_number_buffer] from printf_number_buffer::@4
[135] (byte*) strupr::str#0 ← (byte*) printf_number_buffer::buffer_digits#10
[135] phi()
[136] call strupr
to:printf_number_buffer::@5
printf_number_buffer::@5: scope:[printf_number_buffer] from printf_number_buffer::@11 printf_number_buffer::@4
[137] (byte*) printf_str::str#1 ← (byte*) printf_number_buffer::buffer_digits#10
[137] phi()
[138] call printf_str
to:printf_number_buffer::@15
printf_number_buffer::@15: scope:[printf_number_buffer] from printf_number_buffer::@5
@ -345,7 +344,7 @@ strupr: scope:[strupr] from printf_number_buffer::@11
[152] phi()
to:strupr::@1
strupr::@1: scope:[strupr] from strupr strupr::@3
[153] (byte*) strupr::src#2 ← phi( strupr/(byte*) strupr::str#0 strupr::@3/(byte*) strupr::src#1 )
[153] (byte*) strupr::src#2 ← phi( strupr/(const byte*) strupr::str#0 strupr::@3/(byte*) strupr::src#1 )
[154] if((byte) 0!=*((byte*) strupr::src#2)) goto strupr::@2
to:strupr::@return
strupr::@return: scope:[strupr] from strupr::@1
@ -383,7 +382,7 @@ strlen: scope:[strlen] from printf_number_buffer::@6
to:strlen::@1
strlen::@1: scope:[strlen] from strlen strlen::@2
[168] (word) strlen::len#2 ← phi( strlen/(word) 0 strlen::@2/(word) strlen::len#1 )
[168] (byte*) strlen::str#3 ← phi( strlen/(byte*) strlen::str#1 strlen::@2/(byte*) strlen::str#0 )
[168] (byte*) strlen::str#3 ← phi( strlen/(byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS strlen::@2/(byte*) strlen::str#0 )
[169] if((byte) 0!=*((byte*) strlen::str#3)) goto strlen::@2
to:strlen::@return
strlen::@return: scope:[strlen] from strlen::@1

File diff suppressed because one or more lines are too long

View File

@ -300,7 +300,6 @@ solutions: "
(label) printf_number_buffer::@return
(struct printf_buffer_number) printf_number_buffer::buffer
(byte*) printf_number_buffer::buffer_digits
(byte*) printf_number_buffer::buffer_digits#10 buffer_digits zp[2]:12 1.0344827586207E13
(byte) printf_number_buffer::buffer_sign
(byte) printf_number_buffer::buffer_sign#0 buffer_sign zp[1]:22 202.0
(byte) printf_number_buffer::buffer_sign#1 buffer_sign zp[1]:22 202.0
@ -356,9 +355,8 @@ solutions: "
(byte) printf_str::ch#0 ch zp[1]:15 1.0E26
(byte*) printf_str::str
(byte*) printf_str::str#0 str zp[2]:12 4.285714285714285E25
(byte*) printf_str::str#1 str zp[2]:12 2.00000000000002E14
(byte*) printf_str::str#13 str zp[2]:12 2.000000000005E26
(byte*) printf_str::str#15 str zp[2]:12 1.100000000000002E15
(byte*) printf_str::str#15 str zp[2]:12 1.000000000000001E15
(void()) printf_string((byte*) printf_string::str , (byte) printf_string::format_min_length , (byte) printf_string::format_justify_left)
(label) printf_string::@1
(label) printf_string::@return
@ -442,8 +440,7 @@ __stackcall (void()) queen((byte) queen::row)
(word) strlen::return#2 return zp[2]:10 2.00000000000002E14
(byte*) strlen::str
(byte*) strlen::str#0 str zp[2]:31 2.0E27
(byte*) strlen::str#1 str zp[2]:31 5.50000000000001E14
(byte*) strlen::str#3 str zp[2]:31 1.0000000000003332E27
(byte*) strlen::str#3 str zp[2]:31 1.0E27
(byte*()) strupr((byte*) strupr::str)
(byte~) strupr::$0 zp[1]:15 2.0E27
(label) strupr::@1
@ -452,10 +449,10 @@ __stackcall (void()) queen((byte) queen::row)
(label) strupr::@return
(byte*) strupr::return
(byte*) strupr::src
(byte*) strupr::src#1 src zp[2]:31 2.0E27
(byte*) strupr::src#2 src zp[2]:31 7.142857142858572E26
(byte*) strupr::src#1 src zp[2]:12 2.0E27
(byte*) strupr::src#2 src zp[2]:12 7.142857142857143E26
(byte*) strupr::str
(byte*) strupr::str#0 str zp[2]:31 5.50000000000001E14
(const byte*) strupr::str#0 str = (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
(const byte*) tod_buffer[] = (byte*) "00:00:00:00"
(void()) tod_init((byte) tod_init::tod_TENTHS , (byte) tod_init::tod_SEC , (byte) tod_init::tod_MIN , (byte) tod_init::tod_HOURS)
(label) tod_init::@return
@ -589,10 +586,10 @@ __stackcall (void()) queen((byte) queen::row)
(label) ultoa::@7
(label) ultoa::@return
(byte*) ultoa::buffer
(byte*) ultoa::buffer#11 buffer zp[2]:12 2.8571428571571855E13
(byte*) ultoa::buffer#14 buffer zp[2]:12 1.500000000000015E14
(byte*) ultoa::buffer#3 buffer zp[2]:12 2002.0
(byte*) ultoa::buffer#4 buffer zp[2]:12 2.00000000000002E14
(byte*) ultoa::buffer#11 buffer zp[2]:31 2.8571428571571855E13
(byte*) ultoa::buffer#14 buffer zp[2]:31 1.500000000000015E14
(byte*) ultoa::buffer#3 buffer zp[2]:31 2002.0
(byte*) ultoa::buffer#4 buffer zp[2]:31 2.00000000000002E14
(byte) ultoa::digit
(byte) ultoa::digit#1 digit zp[1]:16 2.00000000000002E14
(byte) ultoa::digit#2 digit zp[1]:16 2.8571428571428855E13
@ -615,7 +612,7 @@ __stackcall (void()) queen((byte) queen::row)
(label) ultoa_append::@3
(label) ultoa_append::@return
(byte*) ultoa_append::buffer
(byte*) ultoa_append::buffer#0 buffer zp[2]:12 1.3750000000000025E14
(byte*) ultoa_append::buffer#0 buffer zp[2]:31 1.3750000000000025E14
(byte) ultoa_append::digit
(byte) ultoa_append::digit#1 digit zp[1]:21 1.0E27
(byte) ultoa_append::digit#2 digit zp[1]:21 1.0000000000005E27
@ -681,7 +678,7 @@ __stackcall (void()) queen((byte) queen::row)
zp[4]:2 [ printf_ulong::uvalue#2 printf_ulong::uvalue#0 printf_ulong::uvalue#1 count ]
zp[4]:6 [ ultoa::value#2 ultoa::value#6 ultoa::value#1 ultoa::value#0 ultoa_append::value#2 ultoa_append::value#0 ultoa_append::value#1 ultoa_append::return#0 ]
zp[2]:10 [ utoa::value#2 utoa::value#6 utoa::value#0 utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 utoa_append::return#0 strlen::len#2 strlen::len#1 strlen::return#2 printf_number_buffer::$19 memcpy::dst#2 memcpy::dst#1 memset::str#3 memset::dst#2 memset::dst#4 memset::dst#1 ]
zp[2]:12 [ uctoa::buffer#11 uctoa::buffer#14 uctoa::buffer#4 uctoa::buffer#3 uctoa_append::buffer#0 utoa::buffer#11 utoa::buffer#14 utoa::buffer#4 utoa::buffer#3 utoa_append::buffer#0 ultoa::buffer#11 ultoa::buffer#14 ultoa::buffer#4 ultoa::buffer#3 ultoa_append::buffer#0 printf_str::str#13 printf_str::str#15 printf_str::str#1 printf_str::str#0 printf_number_buffer::buffer_digits#10 ]
zp[2]:12 [ uctoa::buffer#11 uctoa::buffer#14 uctoa::buffer#4 uctoa::buffer#3 uctoa_append::buffer#0 utoa::buffer#11 utoa::buffer#14 utoa::buffer#4 utoa::buffer#3 utoa_append::buffer#0 strupr::src#2 strupr::src#1 printf_str::str#13 printf_str::str#15 printf_str::str#0 ]
zp[1]:14 [ legal::return#4 legal::return#0 queen::$1 uctoa::digit#2 uctoa::digit#1 printf_number_buffer::len#2 printf_number_buffer::len#0 printf_number_buffer::len#1 memset::c#4 ]
zp[1]:15 [ diff::a#2 diff::a#0 diff::a#1 diff::return#4 diff::return#2 diff::return#3 diff::return#1 legal::$4 uctoa::value#2 uctoa::value#6 uctoa::value#1 uctoa::value#0 uctoa_append::value#2 uctoa_append::value#0 uctoa_append::value#1 uctoa_append::return#0 toupper::return#2 toupper::return#0 toupper::ch#0 toupper::return#3 strupr::$0 printf_char::ch#3 printf_char::ch#2 printf_char::ch#0 printf_char::ch#1 printf_padding::pad#7 printf_str::ch#0 ]
zp[1]:16 [ diff::b#2 diff::b#0 diff::b#1 uctoa::started#2 uctoa::started#4 ultoa::digit#2 ultoa::digit#1 printf_number_buffer::format_min_length#3 printf_number_buffer::padding#10 printf_number_buffer::padding#1 ]
@ -695,7 +692,7 @@ zp[1]:24 [ ultoa::$11 tod_read::return_HOURS#2 tod_str::tod_HOURS#0 tod_read::re
zp[4]:25 [ ultoa::digit_value#0 ultoa_append::sub#0 ]
zp[1]:29 [ utoa::$11 tod_str::$4 tod_str::$5 print::j#2 print::j#1 printf_padding::i#2 printf_padding::i#1 ]
zp[1]:30 [ utoa::$10 tod_str::$8 tod_str::$9 legal::i#2 legal::i#1 print::i#2 print::i#1 printf_uchar::uvalue#2 printf_uchar::uvalue#1 printf_uchar::uvalue#0 print::i1#2 print::i1#1 ]
zp[2]:31 [ utoa::digit_value#0 utoa_append::sub#0 strlen::str#3 strlen::str#1 strlen::str#0 strupr::src#2 strupr::str#0 strupr::src#1 memcpy::src#2 memcpy::src#1 memset::num#2 memset::end#0 ]
zp[2]:31 [ utoa::digit_value#0 utoa_append::sub#0 ultoa::buffer#11 ultoa::buffer#14 ultoa::buffer#4 ultoa::buffer#3 ultoa_append::buffer#0 strlen::str#3 strlen::str#0 memcpy::src#2 memcpy::src#1 memset::num#2 memset::end#0 ]
zp[1]:33 [ queen::row#0 queen::r legal::row#0 queen::$4 tod_str::$12 tod_str::$13 ]
zp[1]:34 [ queen::column legal::column#0 ]
zp[1]:35 [ legal::$0 uctoa::digit_value#0 uctoa_append::sub#0 tod_str::$0 tod_str::$1 ultoa::$10 ]

View File

@ -360,11 +360,6 @@ printf_ulong: {
// Print using format
lda #0
sta.z printf_number_buffer.format_upper_case
lda #<printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_number_buffer.buffer_digits
lda #>printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_number_buffer.buffer_digits+1
lda #0
sta.z printf_number_buffer.format_zero_padding
sta.z printf_number_buffer.format_justify_left
tax
@ -374,23 +369,18 @@ printf_ulong: {
}
// Print the contents of the number buffer using a specific format.
// This handles minimum length, zero-filling, and left/right justification from the format
// printf_number_buffer(byte zp($b) buffer_sign, byte* zp($e) buffer_digits, byte register(X) format_min_length, byte zp($1f) format_justify_left, byte zp($a) format_zero_padding, byte zp($c) format_upper_case)
// printf_number_buffer(byte zp($b) buffer_sign, byte register(X) format_min_length, byte zp($1f) format_justify_left, byte zp($a) format_zero_padding, byte zp($c) format_upper_case)
printf_number_buffer: {
.label __19 = $21
.label buffer_sign = $b
.label padding = $20
.label format_zero_padding = $a
.label format_justify_left = $1f
.label buffer_digits = $e
.label format_upper_case = $c
// if(format.min_length)
cpx #0
beq __b6
// strlen(buffer.digits)
lda.z buffer_digits
sta.z strlen.str
lda.z buffer_digits+1
sta.z strlen.str+1
jsr strlen
// strlen(buffer.digits)
// len = (signed char)strlen(buffer.digits)
@ -462,13 +452,13 @@ printf_number_buffer: {
cmp.z format_upper_case
beq __b5
// strupr(buffer.digits)
lda.z buffer_digits
sta.z strupr.str
lda.z buffer_digits+1
sta.z strupr.str+1
jsr strupr
__b5:
// printf_str(buffer.digits)
lda #<printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_str.str
lda #>printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_str.str+1
jsr printf_str
// if(format.justify_left && !format.zero_padding && padding)
lda #0
@ -514,10 +504,13 @@ printf_padding: {
jmp __b1
}
// Converts a string to uppercase.
// strupr(byte* zp($10) str)
strupr: {
.label src = $10
.label str = $10
.label str = printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
.label src = $e
lda #<str
sta.z src
lda #>str
sta.z src+1
__b1:
// while(*src)
ldy #0
@ -569,6 +562,10 @@ strlen: {
lda #<0
sta.z len
sta.z len+1
lda #<printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z str
lda #>printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z str+1
__b1:
// while(*str)
ldy #0
@ -595,10 +592,10 @@ strlen: {
// - value : The number to be converted to RADIX
// - buffer : receives the string representing the number and zero-termination.
// - radix : The radix to convert the number to (from the enum RADIX)
// ultoa(dword zp(6) value, byte* zp($e) buffer)
// ultoa(dword zp(6) value, byte* zp($10) buffer)
ultoa: {
.label digit_value = $1b
.label buffer = $e
.label buffer = $10
.label digit = $1f
.label value = 6
lda #<printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
@ -688,9 +685,9 @@ ultoa: {
// - sub : the value of a '1' in the digit. Subtracted continually while the digit is increased.
// (For decimal the subs used are 10000, 1000, 100, 10, 1)
// returns : the value reduced by sub * digit so that it is less than sub.
// ultoa_append(byte* zp($e) buffer, dword zp(6) value, dword zp($1b) sub)
// ultoa_append(byte* zp($10) buffer, dword zp(6) value, dword zp($1b) sub)
ultoa_append: {
.label buffer = $e
.label buffer = $10
.label value = 6
.label sub = $1b
.label return = 6
@ -1025,11 +1022,6 @@ printf_uchar: {
// Print using format
lda #0
sta.z printf_number_buffer.format_upper_case
lda #<printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_number_buffer.buffer_digits
lda #>printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_number_buffer.buffer_digits+1
lda #0
sta.z printf_number_buffer.format_zero_padding
sta.z printf_number_buffer.format_justify_left
tax
@ -1256,10 +1248,6 @@ printf_uint: {
// Print using format
lda #format_upper_case
sta.z printf_number_buffer.format_upper_case
lda #<printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_number_buffer.buffer_digits
lda #>printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
sta.z printf_number_buffer.buffer_digits+1
lda #format_zero_padding
sta.z printf_number_buffer.format_zero_padding
lda #format_justify_left

View File

@ -82,7 +82,7 @@ main::@return: scope:[main] from main::@12
(void()) printf_str((byte*) printf_str::str)
printf_str: scope:[printf_str] from main::@1 main::@10 main::@12 main::@2 main::@8 print print::@10 print::@12 print::@4 print::@8 printf_number_buffer::@5 printf_string::@1
[44] (byte*) printf_str::str#15 ← phi( main::@1/(const byte*) main::str main::@10/(const byte*) main::str3 main::@12/(const byte*) main::str4 main::@2/(const byte*) main::str1 main::@8/(const byte*) main::str2 print/(const byte*) print::str print::@10/(const byte*) print::str4 print::@12/(const byte*) print::str1 print::@4/(const byte*) print::str2 print::@8/(const byte*) print::str3 printf_number_buffer::@5/(byte*) printf_str::str#1 printf_string::@1/(const byte*) tod_buffer )
[44] (byte*) printf_str::str#15 ← phi( main::@1/(const byte*) main::str main::@10/(const byte*) main::str3 main::@12/(const byte*) main::str4 main::@2/(const byte*) main::str1 main::@8/(const byte*) main::str2 print/(const byte*) print::str print::@10/(const byte*) print::str4 print::@12/(const byte*) print::str1 print::@4/(const byte*) print::str2 print::@8/(const byte*) print::str3 printf_number_buffer::@5/(byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS printf_string::@1/(const byte*) tod_buffer )
to:printf_str::@1
printf_str::@1: scope:[printf_str] from printf_str printf_str::@4 printf_str::@5
[45] (byte*) printf_str::str#13 ← phi( printf_str/(byte*) printf_str::str#15 printf_str::@4/(byte*) printf_str::str#0 printf_str::@5/(byte*) printf_str::str#0 )
@ -233,14 +233,13 @@ printf_ulong::@return: scope:[printf_ulong] from printf_ulong::@2
printf_number_buffer: scope:[printf_number_buffer] from printf_uchar::@2 printf_uint::@2 printf_ulong::@2
[107] (byte) printf_number_buffer::format_upper_case#10 ← phi( printf_uchar::@2/(byte) 0 printf_uint::@2/(const byte) printf_uint::format_upper_case#0 printf_ulong::@2/(byte) 0 )
[107] (byte) printf_number_buffer::buffer_sign#10 ← phi( printf_uchar::@2/(byte) printf_number_buffer::buffer_sign#2 printf_uint::@2/(byte) printf_number_buffer::buffer_sign#1 printf_ulong::@2/(byte) printf_number_buffer::buffer_sign#0 )
[107] (byte*) printf_number_buffer::buffer_digits#10 ← phi( printf_uchar::@2/(byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS printf_uint::@2/(byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS printf_ulong::@2/(byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS )
[107] (byte) printf_number_buffer::format_zero_padding#10 ← phi( printf_uchar::@2/(byte) 0 printf_uint::@2/(const byte) printf_uint::format_zero_padding#0 printf_ulong::@2/(byte) 0 )
[107] (byte) printf_number_buffer::format_justify_left#10 ← phi( printf_uchar::@2/(byte) 0 printf_uint::@2/(const byte) printf_uint::format_justify_left#0 printf_ulong::@2/(byte) 0 )
[107] (byte) printf_number_buffer::format_min_length#3 ← phi( printf_uchar::@2/(byte) 0 printf_uint::@2/(const byte) printf_uint::format_min_length#0 printf_ulong::@2/(byte) 0 )
[108] if((byte) 0==(byte) printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1
to:printf_number_buffer::@6
printf_number_buffer::@6: scope:[printf_number_buffer] from printf_number_buffer
[109] (byte*) strlen::str#1 ← (byte*) printf_number_buffer::buffer_digits#10
[109] phi()
[110] call strlen
[111] (word) strlen::return#2 ← (word) strlen::len#2
to:printf_number_buffer::@14
@ -295,11 +294,11 @@ printf_number_buffer::@4: scope:[printf_number_buffer] from printf_number_buffe
[133] if((byte) 0==(byte) printf_number_buffer::format_upper_case#10) goto printf_number_buffer::@5
to:printf_number_buffer::@11
printf_number_buffer::@11: scope:[printf_number_buffer] from printf_number_buffer::@4
[134] (byte*) strupr::str#0 ← (byte*) printf_number_buffer::buffer_digits#10
[134] phi()
[135] call strupr
to:printf_number_buffer::@5
printf_number_buffer::@5: scope:[printf_number_buffer] from printf_number_buffer::@11 printf_number_buffer::@4
[136] (byte*) printf_str::str#1 ← (byte*) printf_number_buffer::buffer_digits#10
[136] phi()
[137] call printf_str
to:printf_number_buffer::@15
printf_number_buffer::@15: scope:[printf_number_buffer] from printf_number_buffer::@5
@ -344,7 +343,7 @@ strupr: scope:[strupr] from printf_number_buffer::@11
[151] phi()
to:strupr::@1
strupr::@1: scope:[strupr] from strupr strupr::@3
[152] (byte*) strupr::src#2 ← phi( strupr/(byte*) strupr::str#0 strupr::@3/(byte*) strupr::src#1 )
[152] (byte*) strupr::src#2 ← phi( strupr/(const byte*) strupr::str#0 strupr::@3/(byte*) strupr::src#1 )
[153] if((byte) 0!=*((byte*) strupr::src#2)) goto strupr::@2
to:strupr::@return
strupr::@return: scope:[strupr] from strupr::@1
@ -382,7 +381,7 @@ strlen: scope:[strlen] from printf_number_buffer::@6
to:strlen::@1
strlen::@1: scope:[strlen] from strlen strlen::@2
[167] (word) strlen::len#2 ← phi( strlen/(word) 0 strlen::@2/(word) strlen::len#1 )
[167] (byte*) strlen::str#3 ← phi( strlen/(byte*) strlen::str#1 strlen::@2/(byte*) strlen::str#0 )
[167] (byte*) strlen::str#3 ← phi( strlen/(byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS strlen::@2/(byte*) strlen::str#0 )
[168] if((byte) 0!=*((byte*) strlen::str#3)) goto strlen::@2
to:strlen::@return
strlen::@return: scope:[strlen] from strlen::@1

File diff suppressed because one or more lines are too long

View File

@ -301,7 +301,6 @@ solutions: "
(label) printf_number_buffer::@return
(struct printf_buffer_number) printf_number_buffer::buffer
(byte*) printf_number_buffer::buffer_digits
(byte*) printf_number_buffer::buffer_digits#10 buffer_digits zp[2]:14 1.0344827689655172E7
(byte) printf_number_buffer::buffer_sign
(byte) printf_number_buffer::buffer_sign#0 buffer_sign zp[1]:11 200002.0
(byte) printf_number_buffer::buffer_sign#1 buffer_sign zp[1]:11 202.0
@ -357,9 +356,8 @@ solutions: "
(byte) printf_str::ch#0 reg byte a 1.0000000001E10
(byte*) printf_str::str
(byte*) printf_str::str#0 str zp[2]:14 4.2857142861428566E9
(byte*) printf_str::str#1 str zp[2]:14 2.00000002E8
(byte*) printf_str::str#13 str zp[2]:14 2.05000000025E10
(byte*) printf_str::str#15 str zp[2]:14 1.100000002E9
(byte*) printf_str::str#15 str zp[2]:14 1.000000001E9
(void()) printf_string((byte*) printf_string::str , (byte) printf_string::format_min_length , (byte) printf_string::format_justify_left)
(label) printf_string::@1
(label) printf_string::@return
@ -443,8 +441,7 @@ solutions: "
(word) strlen::return#2 return zp[2]:33 2.00000002E8
(byte*) strlen::str
(byte*) strlen::str#0 str zp[2]:16 2.000000000002E12
(byte*) strlen::str#1 str zp[2]:16 5.50000001E8
(byte*) strlen::str#3 str zp[2]:16 1.0003333333346667E12
(byte*) strlen::str#3 str zp[2]:16 1.000000000001E12
(byte*()) strupr((byte*) strupr::str)
(byte~) strupr::$0 reg byte a 2.000000000002E12
(label) strupr::@1
@ -453,10 +450,10 @@ solutions: "
(label) strupr::@return
(byte*) strupr::return
(byte*) strupr::src
(byte*) strupr::src#1 src zp[2]:16 2.000000000002E12
(byte*) strupr::src#2 src zp[2]:16 7.144285714294285E11
(byte*) strupr::src#1 src zp[2]:14 2.000000000002E12
(byte*) strupr::src#2 src zp[2]:14 7.142857142864285E11
(byte*) strupr::str
(byte*) strupr::str#0 str zp[2]:16 5.50000001E8
(const byte*) strupr::str#0 str = (byte*)&(struct printf_buffer_number) printf_buffer+(const byte) OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS
(const byte*) tod_buffer[] = (byte*) "00:00:00:00"
(void()) tod_init((byte) tod_init::tod_TENTHS , (byte) tod_init::tod_SEC , (byte) tod_init::tod_MIN , (byte) tod_init::tod_HOURS)
(label) tod_init::@return
@ -590,10 +587,10 @@ solutions: "
(label) ultoa::@7
(label) ultoa::@return
(byte*) ultoa::buffer
(byte*) ultoa::buffer#11 buffer zp[2]:14 2.871428614285714E7
(byte*) ultoa::buffer#14 buffer zp[2]:14 1.500000015E8
(byte*) ultoa::buffer#3 buffer zp[2]:14 2000002.0
(byte*) ultoa::buffer#4 buffer zp[2]:14 2.00000002E8
(byte*) ultoa::buffer#11 buffer zp[2]:16 2.871428614285714E7
(byte*) ultoa::buffer#14 buffer zp[2]:16 1.500000015E8
(byte*) ultoa::buffer#3 buffer zp[2]:16 2000002.0
(byte*) ultoa::buffer#4 buffer zp[2]:16 2.00000002E8
(byte) ultoa::digit
(byte) ultoa::digit#1 digit zp[1]:31 2.00000002E8
(byte) ultoa::digit#2 digit zp[1]:31 2.857142885714286E7
@ -616,7 +613,7 @@ solutions: "
(label) ultoa_append::@3
(label) ultoa_append::@return
(byte*) ultoa_append::buffer
(byte*) ultoa_append::buffer#0 buffer zp[2]:14 1.3750000025E8
(byte*) ultoa_append::buffer#0 buffer zp[2]:16 1.3750000025E8
(byte) ultoa_append::digit
(byte) ultoa_append::digit#1 reg byte x 1.000000000001E12
(byte) ultoa_append::digit#2 reg byte x 1.0005000000015E12
@ -699,9 +696,9 @@ reg byte y [ legal::i#10 legal::i#1 ]
reg byte a [ legal::return#4 ]
reg byte a [ legal::diff2_return#2 legal::diff2_return#0 legal::diff2_return#1 ]
zp[1]:13 [ utoa::digit#2 utoa::digit#1 printf_padding::length#6 printf_padding::length#1 printf_padding::length#2 printf_padding::length#0 ]
zp[2]:14 [ utoa::value#2 utoa::value#6 utoa::value#0 utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 utoa_append::return#0 ultoa::buffer#11 ultoa::buffer#14 ultoa::buffer#4 ultoa::buffer#3 ultoa_append::buffer#0 printf_str::str#13 printf_str::str#15 printf_str::str#1 printf_str::str#0 printf_number_buffer::buffer_digits#10 ]
zp[2]:14 [ utoa::value#2 utoa::value#6 utoa::value#0 utoa_append::value#2 utoa_append::value#0 utoa_append::value#1 utoa_append::return#0 strupr::src#2 strupr::src#1 printf_str::str#13 printf_str::str#15 printf_str::str#0 ]
reg byte x [ utoa::started#2 utoa::started#4 ]
zp[2]:16 [ utoa::buffer#11 utoa::buffer#14 utoa::buffer#4 utoa::buffer#3 utoa_append::buffer#0 strlen::str#3 strlen::str#1 strlen::str#0 strupr::src#2 strupr::str#0 strupr::src#1 memcpy::src#2 memcpy::src#1 memset::num#2 memset::end#0 ]
zp[2]:16 [ utoa::buffer#11 utoa::buffer#14 utoa::buffer#4 utoa::buffer#3 utoa_append::buffer#0 ultoa::buffer#11 ultoa::buffer#14 ultoa::buffer#4 ultoa::buffer#3 ultoa_append::buffer#0 strlen::str#3 strlen::str#0 memcpy::src#2 memcpy::src#1 memset::num#2 memset::end#0 ]
reg byte x [ utoa_append::digit#2 utoa_append::digit#1 ]
zp[1]:18 [ printf_cursor_x ]
zp[1]:19 [ printf_cursor_y ]

View File

@ -6,13 +6,13 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label BORDERCOL = $d020
.label BGCOL = $d021
.label D018 = $d018
// SID Channel Control Register Noise Waveform
.const SID_CONTROL_NOISE = $80
// The SID MOS 6581/8580
.label SID = $d400
// The VIC-II MOS 6567/6569
.label VICII = $d000
// Color Ram
.label COLS = $d800
// The colors of the C64
@ -21,6 +21,8 @@
.const OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = $e
.const OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = $12
.const OFFSET_STRUCT_MOS6581_SID_CH3_OSC = $1b
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.label SCREEN1 = $3800
.label SCREEN2 = $3c00
.label BUFFER = $4000
@ -30,11 +32,11 @@ main: {
.const toD0182_return = (>(SCREEN2&$3fff)*4)|(>CHARSET)/4&$f
// asm
sei
// *BORDERCOL = BLACK
// VICII->BORDER_COLOR = BLACK
lda #BLACK
sta BORDERCOL
// *BGCOL = BLACK
sta BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// VICII->BG_COLOR = BLACK
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// fillscreen(BUFFER, 00)
lda #<BUFFER
sta.z fillscreen.screen

View File

@ -11,8 +11,8 @@
(void()) main()
main: scope:[main] from @1
asm { sei }
[5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK
[6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLACK
[5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK
[6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLACK
[7] call fillscreen
to:main::@5
main::@5: scope:[main] from main

View File

@ -11,8 +11,8 @@ CONTROL FLOW GRAPH SSA
(void()) main()
main: scope:[main] from @1
asm { sei }
*((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK
*((const nomodify byte*) BGCOL) ← (const nomodify byte) BLACK
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLACK
(byte*) fillscreen::screen#0 ← (const byte*) BUFFER
(byte) fillscreen::fill#0 ← (number) 0
call fillscreen
@ -360,9 +360,7 @@ SYMBOL TABLE SSA
(label) @2
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*)(number) $d021
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const byte*) BUFFER = (byte*)(number) $4000
(const byte*) CHARSET = (byte*)(number) $3000
(const nomodify byte*) COLS = (byte*)(number) $d800
@ -451,6 +449,8 @@ SYMBOL TABLE SSA
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = (byte) $12
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = (byte) $e
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_OSC = (byte) $1b
@ -458,6 +458,7 @@ SYMBOL TABLE SSA
(const byte*) SCREEN2 = (byte*)(number) $3c00
(const nomodify struct MOS6581_SID*) SID = (struct MOS6581_SID*)(number) $d400
(const nomodify byte) SID_CONTROL_NOISE = (byte) $80
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*)(number) $d000
(const nomodify byte) YELLOW = (byte) 7
(void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill)
(bool~) fillscreen::$0
@ -794,10 +795,9 @@ Inlining cast *((word*)(const nomodify struct MOS6581_SID*) SID+(const byte) OFF
Inlining cast *((byte*) makecharset::font#3) ← (unumber)(number) 0
Inlining cast *((byte*) makecharset::font1#3) ← (unumber)(number) $ff
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53281
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (struct MOS6581_SID*) 54272
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
Simplifying constant pointer cast (byte*) 55296
Simplifying constant pointer cast (byte*) 14336
Simplifying constant pointer cast (byte*) 15360
@ -1240,8 +1240,8 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
asm { sei }
[5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK
[6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLACK
[5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK
[6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLACK
[7] call fillscreen
to:main::@5
main::@5: scope:[main] from main
@ -1682,13 +1682,13 @@ Target platform is c64basic / MOS6502X
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
.label BORDERCOL = $d020
.label BGCOL = $d021
.label D018 = $d018
// SID Channel Control Register Noise Waveform
.const SID_CONTROL_NOISE = $80
// The SID MOS 6581/8580
.label SID = $d400
// The VIC-II MOS 6567/6569
.label VICII = $d000
// Color Ram
.label COLS = $d800
// The colors of the C64
@ -1697,6 +1697,8 @@ Target platform is c64basic / MOS6502X
.const OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = $e
.const OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = $12
.const OFFSET_STRUCT_MOS6581_SID_CH3_OSC = $1b
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.label SCREEN1 = $3800
.label SCREEN2 = $3c00
.label BUFFER = $4000
@ -1721,12 +1723,12 @@ main: {
.const toD0182_return = (>(SCREEN2&$3fff)*4)|(>CHARSET)/4&$f
// asm { sei }
sei
// [5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
// [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
lda #BLACK
sta BORDERCOL
// [6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
lda #BLACK
sta BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// [7] call fillscreen
// [83] phi from main to fillscreen [phi:main->fillscreen]
fillscreen_from_main:
@ -2333,8 +2335,8 @@ fillscreen: {
// File Data
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLACK [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLACK [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [14] *((word*)(const nomodify struct MOS6581_SID*) SID+(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_FREQ) ← (word) $ffff [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [15] *((byte*)(const nomodify struct MOS6581_SID*) SID+(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL) ← (const nomodify byte) SID_CONTROL_NOISE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [21] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
@ -2383,8 +2385,8 @@ Statement [85] *((byte*) fillscreen::screen#5) ← (byte) fillscreen::fill#5 [ f
Removing always clobbered register reg byte y as potential for zp[1]:22 [ fillscreen::fill#5 ]
Statement [88] if((word) fillscreen::i#1!=(word) $3e8) goto fillscreen::@1 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] ( main:2::fillscreen:7 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] { } main:2::fillscreen:9 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] { } main:2::fillscreen:11 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] { } main:2::fillscreen:13 [ fillscreen::fill#5 fillscreen::screen#4 fillscreen::i#1 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:22 [ fillscreen::fill#5 ]
Statement [5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLACK [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLACK [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [14] *((word*)(const nomodify struct MOS6581_SID*) SID+(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_FREQ) ← (word) $ffff [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [15] *((byte*)(const nomodify struct MOS6581_SID*) SID+(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL) ← (const nomodify byte) SID_CONTROL_NOISE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [21] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
@ -2515,13 +2517,13 @@ ASSEMBLER BEFORE OPTIMIZATION
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
.label BORDERCOL = $d020
.label BGCOL = $d021
.label D018 = $d018
// SID Channel Control Register Noise Waveform
.const SID_CONTROL_NOISE = $80
// The SID MOS 6581/8580
.label SID = $d400
// The VIC-II MOS 6567/6569
.label VICII = $d000
// Color Ram
.label COLS = $d800
// The colors of the C64
@ -2530,6 +2532,8 @@ ASSEMBLER BEFORE OPTIMIZATION
.const OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = $e
.const OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = $12
.const OFFSET_STRUCT_MOS6581_SID_CH3_OSC = $1b
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.label SCREEN1 = $3800
.label SCREEN2 = $3c00
.label BUFFER = $4000
@ -2554,12 +2558,12 @@ main: {
.const toD0182_return = (>(SCREEN2&$3fff)*4)|(>CHARSET)/4&$f
// asm { sei }
sei
// [5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
// [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
lda #BLACK
sta BORDERCOL
// [6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
lda #BLACK
sta BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// [7] call fillscreen
// [83] phi from main to fillscreen [phi:main->fillscreen]
fillscreen_from_main:
@ -3236,18 +3240,16 @@ Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
Fixing long branch [194] bne __b2 to beq
Fixing long branch [199] bne __b2 to beq
Fixing long branch [209] bne __b4 to beq
Fixing long branch [214] bne __b4 to beq
Fixing long branch [196] bne __b2 to beq
Fixing long branch [201] bne __b2 to beq
Fixing long branch [211] bne __b4 to beq
Fixing long branch [216] bne __b4 to beq
FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*) 53281
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const byte*) BUFFER = (byte*) 16384
(const byte*) CHARSET = (byte*) 12288
(const nomodify byte*) COLS = (byte*) 55296
@ -3336,6 +3338,8 @@ FINAL SYMBOL TABLE
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = (byte) $12
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = (byte) $e
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_OSC = (byte) $1b
@ -3343,6 +3347,7 @@ FINAL SYMBOL TABLE
(const byte*) SCREEN2 = (byte*) 15360
(const nomodify struct MOS6581_SID*) SID = (struct MOS6581_SID*) 54272
(const nomodify byte) SID_CONTROL_NOISE = (byte) $80
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(const nomodify byte) YELLOW = (byte) 7
(void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill)
(label) fillscreen::@1
@ -3495,13 +3500,13 @@ Score: 102503
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label BORDERCOL = $d020
.label BGCOL = $d021
.label D018 = $d018
// SID Channel Control Register Noise Waveform
.const SID_CONTROL_NOISE = $80
// The SID MOS 6581/8580
.label SID = $d400
// The VIC-II MOS 6567/6569
.label VICII = $d000
// Color Ram
.label COLS = $d800
// The colors of the C64
@ -3510,6 +3515,8 @@ Score: 102503
.const OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = $e
.const OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = $12
.const OFFSET_STRUCT_MOS6581_SID_CH3_OSC = $1b
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.label SCREEN1 = $3800
.label SCREEN2 = $3c00
.label BUFFER = $4000
@ -3527,13 +3534,13 @@ main: {
// asm
// asm { sei }
sei
// *BORDERCOL = BLACK
// [5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
// VICII->BORDER_COLOR = BLACK
// [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
lda #BLACK
sta BORDERCOL
// *BGCOL = BLACK
// [6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
sta BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// VICII->BG_COLOR = BLACK
// [6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// fillscreen(BUFFER, 00)
// [7] call fillscreen
// [83] phi from main to fillscreen [phi:main->fillscreen]

View File

@ -1,9 +1,7 @@
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*) 53281
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const byte*) BUFFER = (byte*) 16384
(const byte*) CHARSET = (byte*) 12288
(const nomodify byte*) COLS = (byte*) 55296
@ -92,6 +90,8 @@
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = (byte) $12
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = (byte) $e
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_OSC = (byte) $1b
@ -99,6 +99,7 @@
(const byte*) SCREEN2 = (byte*) 15360
(const nomodify struct MOS6581_SID*) SID = (struct MOS6581_SID*) 54272
(const nomodify byte) SID_CONTROL_NOISE = (byte) $80
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(const nomodify byte) YELLOW = (byte) 7
(void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill)
(label) fillscreen::@1

View File

@ -4,16 +4,11 @@
.pc = $80d "Program"
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
.label RASTER = $d012
.label BORDERCOL = $d020
.label VIC_CONTROL = $d011
.const VIC_RSEL = 8
// VIC II IRQ Status Register
.label IRQ_STATUS = $d019
// VIC II IRQ Enable Register
.label IRQ_ENABLE = $d01a
// Bits for the VICII IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The vector used when the KERNAL serves IRQ interrupts
@ -22,6 +17,11 @@
.const RED = 2
.label GHOST_BYTE = $3fff
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = $1a
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = $19
main: {
// *GHOST_BYTE = 0
lda #0
@ -32,18 +32,18 @@ main: {
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// *VIC_CONTROL &=$7f
// VICII->CONTROL1 &=$7f
// Set raster line to $fa
lda #$7f
and VIC_CONTROL
sta VIC_CONTROL
// *RASTER = $fa
and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// VICII->RASTER = $fa
lda #$fa
sta RASTER
// *IRQ_ENABLE = IRQ_RASTER
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// VICII->IRQ_ENABLE = IRQ_RASTER
// Enable Raster Interrupt
lda #IRQ_RASTER
sta IRQ_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE
// *KERNEL_IRQ = &irq_bottom_1
// Set the IRQ routine
lda #<irq_bottom_1
@ -57,59 +57,59 @@ main: {
}
// Interrupt Routine 2
irq_bottom_2: {
// *BORDERCOL = WHITE
// VICII->BORDER_COLOR = WHITE
lda #WHITE
sta BORDERCOL
// *VIC_CONTROL |= VIC_RSEL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// VICII->CONTROL1 |= VIC_RSEL
// Set screen height back to 25 lines (preparing for the next screen)
lda #VIC_RSEL
ora VIC_CONTROL
sta VIC_CONTROL
// *IRQ_STATUS = IRQ_RASTER
ora VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// VICII->IRQ_STATUS = IRQ_RASTER
// Acknowledge the IRQ
lda #IRQ_RASTER
sta IRQ_STATUS
// *RASTER = $fa
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS
// VICII->RASTER = $fa
// Trigger IRQ 1 at line $fa
lda #$fa
sta RASTER
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// *KERNEL_IRQ = &irq_bottom_1
lda #<irq_bottom_1
sta KERNEL_IRQ
lda #>irq_bottom_1
sta KERNEL_IRQ+1
// *BORDERCOL = RED
// VICII->BORDER_COLOR = RED
lda #RED
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// }
jmp $ea31
}
// Interrupt Routine 1
irq_bottom_1: {
// *BORDERCOL = WHITE
// VICII->BORDER_COLOR = WHITE
lda #WHITE
sta BORDERCOL
// *VIC_CONTROL &= ($ff^VIC_RSEL)
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// VICII->CONTROL1 &= ($ff^VIC_RSEL)
// Set screen height to 24 lines - this is done after the border should have started drawing - so it wont start
lda #$ff^VIC_RSEL
and VIC_CONTROL
sta VIC_CONTROL
// *IRQ_STATUS = IRQ_RASTER
and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// VICII->IRQ_STATUS = IRQ_RASTER
// Acknowledge the IRQ
lda #IRQ_RASTER
sta IRQ_STATUS
// *RASTER = $fd
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS
// VICII->RASTER = $fd
// Trigger IRQ 2 at line $fd
lda #$fd
sta RASTER
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// *KERNEL_IRQ = &irq_bottom_2
lda #<irq_bottom_2
sta KERNEL_IRQ
lda #>irq_bottom_2
sta KERNEL_IRQ+1
// *BORDERCOL = RED
// VICII->BORDER_COLOR = RED
lda #RED
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// }
jmp $ea81
}

View File

@ -13,9 +13,9 @@ main: scope:[main] from @1
[4] *((const nomodify byte*) GHOST_BYTE) ← (byte) 0
asm { sei }
[6] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[7] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f
[8] *((const nomodify byte*) RASTER) ← (byte) $fa
[9] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
[7] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $7f
[8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fa
[9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
[10] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq_bottom_1()
asm { cli }
to:main::@return
@ -25,12 +25,12 @@ main::@return: scope:[main] from main
interrupt(KERNEL_KEYBOARD)(void()) irq_bottom_2()
irq_bottom_2: scope:[irq_bottom_2] from
[13] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE
[14] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (const nomodify byte) VIC_RSEL
[15] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
[16] *((const nomodify byte*) RASTER) ← (byte) $fa
[13] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE
[14] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) | (const nomodify byte) VIC_RSEL
[15] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
[16] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fa
[17] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq_bottom_1()
[18] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) RED
[18] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) RED
to:irq_bottom_2::@return
irq_bottom_2::@return: scope:[irq_bottom_2] from irq_bottom_2
[19] return
@ -38,12 +38,12 @@ irq_bottom_2::@return: scope:[irq_bottom_2] from irq_bottom_2
interrupt(KERNEL_MIN)(void()) irq_bottom_1()
irq_bottom_1: scope:[irq_bottom_1] from
[20] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE
[21] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $ff^(const nomodify byte) VIC_RSEL
[22] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
[23] *((const nomodify byte*) RASTER) ← (byte) $fd
[20] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE
[21] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $ff^(const nomodify byte) VIC_RSEL
[22] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
[23] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fd
[24] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_KEYBOARD)(void()) irq_bottom_2()
[25] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) RED
[25] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) RED
to:irq_bottom_1::@return
irq_bottom_1::@return: scope:[irq_bottom_1] from irq_bottom_1
[26] return

View File

@ -11,9 +11,9 @@ main: scope:[main] from @1
*((const nomodify byte*) GHOST_BYTE) ← (number) 0
asm { sei }
*((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
*((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (number) $7f
*((const nomodify byte*) RASTER) ← (number) $fa
*((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (number) $7f
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (number) $fa
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
*((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq_bottom_1()
asm { cli }
to:main::@return
@ -23,12 +23,12 @@ main::@return: scope:[main] from main
interrupt(KERNEL_MIN)(void()) irq_bottom_1()
irq_bottom_1: scope:[irq_bottom_1] from
*((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE
*((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (number) $ff^(const nomodify byte) VIC_RSEL
*((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
*((const nomodify byte*) RASTER) ← (number) $fd
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (number) $ff^(const nomodify byte) VIC_RSEL
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (number) $fd
*((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_KEYBOARD)(void()) irq_bottom_2()
*((const nomodify byte*) BORDERCOL) ← (const nomodify byte) RED
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) RED
to:irq_bottom_1::@return
irq_bottom_1::@return: scope:[irq_bottom_1] from irq_bottom_1
return
@ -36,12 +36,12 @@ irq_bottom_1::@return: scope:[irq_bottom_1] from irq_bottom_1
interrupt(KERNEL_KEYBOARD)(void()) irq_bottom_2()
irq_bottom_2: scope:[irq_bottom_2] from
*((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE
*((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (const nomodify byte) VIC_RSEL
*((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
*((const nomodify byte*) RASTER) ← (number) $fa
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) | (const nomodify byte) VIC_RSEL
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (number) $fa
*((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq_bottom_1()
*((const nomodify byte*) BORDERCOL) ← (const nomodify byte) RED
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) RED
to:irq_bottom_2::@return
irq_bottom_2::@return: scope:[irq_bottom_2] from irq_bottom_2
return
@ -58,13 +58,10 @@ SYMBOL TABLE SSA
(label) @2
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*)(number) $dc00
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) GHOST_BYTE = (byte*)(number) $3fff
(const nomodify byte*) IRQ_ENABLE = (byte*)(number) $d01a
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*)(number) $d019
(const nomodify void()**) KERNEL_IRQ = (void()**)(number) $314
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
@ -151,9 +148,13 @@ SYMBOL TABLE SSA
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const nomodify byte*) RASTER = (byte*)(number) $d012
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = (byte) $11
(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = (byte) $1a
(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = (byte) $19
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify byte) RED = (byte) 2
(const nomodify byte*) VIC_CONTROL = (byte*)(number) $d011
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*)(number) $d000
(const nomodify byte) VIC_RSEL = (byte) 8
(const nomodify byte) WHITE = (byte) 1
interrupt(KERNEL_MIN)(void()) irq_bottom_1()
@ -164,23 +165,19 @@ interrupt(KERNEL_KEYBOARD)(void()) irq_bottom_2()
(label) main::@return
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) GHOST_BYTE) ← (number) 0
Adding number conversion cast (unumber) $7f in *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (number) $7f
Adding number conversion cast (unumber) $fa in *((const nomodify byte*) RASTER) ← (number) $fa
Adding number conversion cast (unumber) $ff^VIC_RSEL in *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (number) $ff^(const nomodify byte) VIC_RSEL
Adding number conversion cast (unumber) $ff in *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (unumber)(number) $ff^(const nomodify byte) VIC_RSEL
Adding number conversion cast (unumber) $fd in *((const nomodify byte*) RASTER) ← (number) $fd
Adding number conversion cast (unumber) $fa in *((const nomodify byte*) RASTER) ← (number) $fa
Adding number conversion cast (unumber) $7f in *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (number) $7f
Adding number conversion cast (unumber) $fa in *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (number) $fa
Adding number conversion cast (unumber) $ff^VIC_RSEL in *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (number) $ff^(const nomodify byte) VIC_RSEL
Adding number conversion cast (unumber) $ff in *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (unumber)(number) $ff^(const nomodify byte) VIC_RSEL
Adding number conversion cast (unumber) $fd in *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (number) $fd
Adding number conversion cast (unumber) $fa in *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (number) $fa
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast *((const nomodify byte*) GHOST_BYTE) ← (unumber)(number) 0
Inlining cast *((const nomodify byte*) RASTER) ← (unumber)(number) $fa
Inlining cast *((const nomodify byte*) RASTER) ← (unumber)(number) $fd
Inlining cast *((const nomodify byte*) RASTER) ← (unumber)(number) $fa
Inlining cast *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (unumber)(number) $fa
Inlining cast *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (unumber)(number) $fd
Inlining cast *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (unumber)(number) $fa
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53265
Simplifying constant pointer cast (byte*) 53273
Simplifying constant pointer cast (byte*) 53274
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
Simplifying constant pointer cast (struct MOS6526_CIA*) 56320
Simplifying constant pointer cast (void()**) 788
Simplifying constant pointer cast (byte*) 16383
@ -229,9 +226,9 @@ main: scope:[main] from @1
[4] *((const nomodify byte*) GHOST_BYTE) ← (byte) 0
asm { sei }
[6] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[7] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f
[8] *((const nomodify byte*) RASTER) ← (byte) $fa
[9] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
[7] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $7f
[8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fa
[9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
[10] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq_bottom_1()
asm { cli }
to:main::@return
@ -241,12 +238,12 @@ main::@return: scope:[main] from main
interrupt(KERNEL_KEYBOARD)(void()) irq_bottom_2()
irq_bottom_2: scope:[irq_bottom_2] from
[13] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE
[14] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (const nomodify byte) VIC_RSEL
[15] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
[16] *((const nomodify byte*) RASTER) ← (byte) $fa
[13] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE
[14] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) | (const nomodify byte) VIC_RSEL
[15] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
[16] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fa
[17] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq_bottom_1()
[18] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) RED
[18] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) RED
to:irq_bottom_2::@return
irq_bottom_2::@return: scope:[irq_bottom_2] from irq_bottom_2
[19] return
@ -254,12 +251,12 @@ irq_bottom_2::@return: scope:[irq_bottom_2] from irq_bottom_2
interrupt(KERNEL_MIN)(void()) irq_bottom_1()
irq_bottom_1: scope:[irq_bottom_1] from
[20] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE
[21] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $ff^(const nomodify byte) VIC_RSEL
[22] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
[23] *((const nomodify byte*) RASTER) ← (byte) $fd
[20] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE
[21] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $ff^(const nomodify byte) VIC_RSEL
[22] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
[23] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fd
[24] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_KEYBOARD)(void()) irq_bottom_2()
[25] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) RED
[25] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) RED
to:irq_bottom_1::@return
irq_bottom_1::@return: scope:[irq_bottom_1] from irq_bottom_1
[26] return
@ -369,16 +366,11 @@ Target platform is c64basic / MOS6502X
// Global Constants & labels
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
.label RASTER = $d012
.label BORDERCOL = $d020
.label VIC_CONTROL = $d011
.const VIC_RSEL = 8
// VIC II IRQ Status Register
.label IRQ_STATUS = $d019
// VIC II IRQ Enable Register
.label IRQ_ENABLE = $d01a
// Bits for the VICII IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The vector used when the KERNAL serves IRQ interrupts
@ -387,6 +379,11 @@ Target platform is c64basic / MOS6502X
.const RED = 2
.label GHOST_BYTE = $3fff
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = $1a
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = $19
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -412,18 +409,18 @@ main: {
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// [7] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
// [7] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
// Set raster line to $fa
lda #$7f
and VIC_CONTROL
sta VIC_CONTROL
// [8] *((const nomodify byte*) RASTER) ← (byte) $fa -- _deref_pbuc1=vbuc2
and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// [8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fa -- _deref_pbuc1=vbuc2
lda #$fa
sta RASTER
// [9] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// Enable Raster Interrupt
lda #IRQ_RASTER
sta IRQ_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE
// [10] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq_bottom_1() -- _deref_pptc1=pprc2
// Set the IRQ routine
lda #<irq_bottom_1
@ -442,30 +439,30 @@ main: {
// Interrupt Routine 2
irq_bottom_2: {
// entry interrupt(KERNEL_KEYBOARD)
// [13] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2
// [13] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2
lda #WHITE
sta BORDERCOL
// [14] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (const nomodify byte) VIC_RSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [14] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) | (const nomodify byte) VIC_RSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2
// Set screen height back to 25 lines (preparing for the next screen)
lda #VIC_RSEL
ora VIC_CONTROL
sta VIC_CONTROL
// [15] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
ora VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// [15] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// Acknowledge the IRQ
lda #IRQ_RASTER
sta IRQ_STATUS
// [16] *((const nomodify byte*) RASTER) ← (byte) $fa -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS
// [16] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fa -- _deref_pbuc1=vbuc2
// Trigger IRQ 1 at line $fa
lda #$fa
sta RASTER
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// [17] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq_bottom_1() -- _deref_pptc1=pprc2
lda #<irq_bottom_1
sta KERNEL_IRQ
lda #>irq_bottom_1
sta KERNEL_IRQ+1
// [18] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) RED -- _deref_pbuc1=vbuc2
// [18] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) RED -- _deref_pbuc1=vbuc2
lda #RED
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __breturn
// irq_bottom_2::@return
__breturn:
@ -476,30 +473,30 @@ irq_bottom_2: {
// Interrupt Routine 1
irq_bottom_1: {
// entry interrupt(KERNEL_MIN)
// [20] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2
// [20] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2
lda #WHITE
sta BORDERCOL
// [21] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $ff^(const nomodify byte) VIC_RSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [21] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $ff^(const nomodify byte) VIC_RSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
// Set screen height to 24 lines - this is done after the border should have started drawing - so it wont start
lda #$ff^VIC_RSEL
and VIC_CONTROL
sta VIC_CONTROL
// [22] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// [22] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// Acknowledge the IRQ
lda #IRQ_RASTER
sta IRQ_STATUS
// [23] *((const nomodify byte*) RASTER) ← (byte) $fd -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS
// [23] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fd -- _deref_pbuc1=vbuc2
// Trigger IRQ 2 at line $fd
lda #$fd
sta RASTER
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// [24] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_KEYBOARD)(void()) irq_bottom_2() -- _deref_pptc1=pprc2
lda #<irq_bottom_2
sta KERNEL_IRQ
lda #>irq_bottom_2
sta KERNEL_IRQ+1
// [25] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) RED -- _deref_pbuc1=vbuc2
// [25] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) RED -- _deref_pbuc1=vbuc2
lda #RED
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __breturn
// irq_bottom_1::@return
__breturn:
@ -511,22 +508,22 @@ irq_bottom_1: {
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [4] *((const nomodify byte*) GHOST_BYTE) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [7] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [8] *((const nomodify byte*) RASTER) ← (byte) $fa [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [9] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [7] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $7f [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fa [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [10] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq_bottom_1() [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [13] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE [ ] ( [ ] { } ) always clobbers reg byte a
Statement [14] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (const nomodify byte) VIC_RSEL [ ] ( [ ] { } ) always clobbers reg byte a
Statement [15] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ ] ( [ ] { } ) always clobbers reg byte a
Statement [16] *((const nomodify byte*) RASTER) ← (byte) $fa [ ] ( [ ] { } ) always clobbers reg byte a
Statement [13] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE [ ] ( [ ] { } ) always clobbers reg byte a
Statement [14] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) | (const nomodify byte) VIC_RSEL [ ] ( [ ] { } ) always clobbers reg byte a
Statement [15] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ ] ( [ ] { } ) always clobbers reg byte a
Statement [16] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fa [ ] ( [ ] { } ) always clobbers reg byte a
Statement [17] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq_bottom_1() [ ] ( [ ] { } ) always clobbers reg byte a
Statement [18] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) RED [ ] ( [ ] { } ) always clobbers reg byte a
Statement [20] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE [ ] ( [ ] { } ) always clobbers reg byte a
Statement [21] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $ff^(const nomodify byte) VIC_RSEL [ ] ( [ ] { } ) always clobbers reg byte a
Statement [22] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ ] ( [ ] { } ) always clobbers reg byte a
Statement [23] *((const nomodify byte*) RASTER) ← (byte) $fd [ ] ( [ ] { } ) always clobbers reg byte a
Statement [18] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) RED [ ] ( [ ] { } ) always clobbers reg byte a
Statement [20] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE [ ] ( [ ] { } ) always clobbers reg byte a
Statement [21] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $ff^(const nomodify byte) VIC_RSEL [ ] ( [ ] { } ) always clobbers reg byte a
Statement [22] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ ] ( [ ] { } ) always clobbers reg byte a
Statement [23] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fd [ ] ( [ ] { } ) always clobbers reg byte a
Statement [24] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_KEYBOARD)(void()) irq_bottom_2() [ ] ( [ ] { } ) always clobbers reg byte a
Statement [25] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) RED [ ] ( [ ] { } ) always clobbers reg byte a
Statement [25] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) RED [ ] ( [ ] { } ) always clobbers reg byte a
REGISTER UPLIFT SCOPES
Uplift Scope [MOS6526_CIA]
@ -555,16 +552,11 @@ ASSEMBLER BEFORE OPTIMIZATION
// Global Constants & labels
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
.label RASTER = $d012
.label BORDERCOL = $d020
.label VIC_CONTROL = $d011
.const VIC_RSEL = 8
// VIC II IRQ Status Register
.label IRQ_STATUS = $d019
// VIC II IRQ Enable Register
.label IRQ_ENABLE = $d01a
// Bits for the VICII IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The vector used when the KERNAL serves IRQ interrupts
@ -573,6 +565,11 @@ ASSEMBLER BEFORE OPTIMIZATION
.const RED = 2
.label GHOST_BYTE = $3fff
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = $1a
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = $19
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -598,18 +595,18 @@ main: {
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// [7] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
// [7] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
// Set raster line to $fa
lda #$7f
and VIC_CONTROL
sta VIC_CONTROL
// [8] *((const nomodify byte*) RASTER) ← (byte) $fa -- _deref_pbuc1=vbuc2
and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// [8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fa -- _deref_pbuc1=vbuc2
lda #$fa
sta RASTER
// [9] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// Enable Raster Interrupt
lda #IRQ_RASTER
sta IRQ_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE
// [10] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq_bottom_1() -- _deref_pptc1=pprc2
// Set the IRQ routine
lda #<irq_bottom_1
@ -628,30 +625,30 @@ main: {
// Interrupt Routine 2
irq_bottom_2: {
// entry interrupt(KERNEL_KEYBOARD)
// [13] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2
// [13] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2
lda #WHITE
sta BORDERCOL
// [14] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (const nomodify byte) VIC_RSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [14] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) | (const nomodify byte) VIC_RSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2
// Set screen height back to 25 lines (preparing for the next screen)
lda #VIC_RSEL
ora VIC_CONTROL
sta VIC_CONTROL
// [15] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
ora VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// [15] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// Acknowledge the IRQ
lda #IRQ_RASTER
sta IRQ_STATUS
// [16] *((const nomodify byte*) RASTER) ← (byte) $fa -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS
// [16] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fa -- _deref_pbuc1=vbuc2
// Trigger IRQ 1 at line $fa
lda #$fa
sta RASTER
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// [17] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq_bottom_1() -- _deref_pptc1=pprc2
lda #<irq_bottom_1
sta KERNEL_IRQ
lda #>irq_bottom_1
sta KERNEL_IRQ+1
// [18] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) RED -- _deref_pbuc1=vbuc2
// [18] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) RED -- _deref_pbuc1=vbuc2
lda #RED
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __breturn
// irq_bottom_2::@return
__breturn:
@ -662,30 +659,30 @@ irq_bottom_2: {
// Interrupt Routine 1
irq_bottom_1: {
// entry interrupt(KERNEL_MIN)
// [20] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2
// [20] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2
lda #WHITE
sta BORDERCOL
// [21] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $ff^(const nomodify byte) VIC_RSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [21] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $ff^(const nomodify byte) VIC_RSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
// Set screen height to 24 lines - this is done after the border should have started drawing - so it wont start
lda #$ff^VIC_RSEL
and VIC_CONTROL
sta VIC_CONTROL
// [22] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// [22] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// Acknowledge the IRQ
lda #IRQ_RASTER
sta IRQ_STATUS
// [23] *((const nomodify byte*) RASTER) ← (byte) $fd -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS
// [23] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fd -- _deref_pbuc1=vbuc2
// Trigger IRQ 2 at line $fd
lda #$fd
sta RASTER
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// [24] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_KEYBOARD)(void()) irq_bottom_2() -- _deref_pptc1=pprc2
lda #<irq_bottom_2
sta KERNEL_IRQ
lda #>irq_bottom_2
sta KERNEL_IRQ+1
// [25] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) RED -- _deref_pbuc1=vbuc2
// [25] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) RED -- _deref_pbuc1=vbuc2
lda #RED
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __breturn
// irq_bottom_1::@return
__breturn:
@ -720,13 +717,10 @@ FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) GHOST_BYTE = (byte*) 16383
(const nomodify byte*) IRQ_ENABLE = (byte*) 53274
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*) 53273
(const nomodify void()**) KERNEL_IRQ = (void()**) 788
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
@ -813,9 +807,13 @@ FINAL SYMBOL TABLE
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const nomodify byte*) RASTER = (byte*) 53266
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = (byte) $11
(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = (byte) $1a
(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = (byte) $19
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify byte) RED = (byte) 2
(const nomodify byte*) VIC_CONTROL = (byte*) 53265
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(const nomodify byte) VIC_RSEL = (byte) 8
(const nomodify byte) WHITE = (byte) 1
interrupt(KERNEL_MIN)(void()) irq_bottom_1()
@ -839,16 +837,11 @@ Score: 154
// Global Constants & labels
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
.label RASTER = $d012
.label BORDERCOL = $d020
.label VIC_CONTROL = $d011
.const VIC_RSEL = 8
// VIC II IRQ Status Register
.label IRQ_STATUS = $d019
// VIC II IRQ Enable Register
.label IRQ_ENABLE = $d01a
// Bits for the VICII IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The vector used when the KERNAL serves IRQ interrupts
@ -857,6 +850,11 @@ Score: 154
.const RED = 2
.label GHOST_BYTE = $3fff
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = $1a
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = $19
// @begin
// [1] phi from @begin to @1 [phi:@begin->@1]
// @1
@ -877,21 +875,21 @@ main: {
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// *VIC_CONTROL &=$7f
// [7] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
// VICII->CONTROL1 &=$7f
// [7] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
// Set raster line to $fa
lda #$7f
and VIC_CONTROL
sta VIC_CONTROL
// *RASTER = $fa
// [8] *((const nomodify byte*) RASTER) ← (byte) $fa -- _deref_pbuc1=vbuc2
and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// VICII->RASTER = $fa
// [8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fa -- _deref_pbuc1=vbuc2
lda #$fa
sta RASTER
// *IRQ_ENABLE = IRQ_RASTER
// [9] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// VICII->IRQ_ENABLE = IRQ_RASTER
// [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// Enable Raster Interrupt
lda #IRQ_RASTER
sta IRQ_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE
// *KERNEL_IRQ = &irq_bottom_1
// [10] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq_bottom_1() -- _deref_pptc1=pprc2
// Set the IRQ routine
@ -911,36 +909,36 @@ main: {
// Interrupt Routine 2
irq_bottom_2: {
// entry interrupt(KERNEL_KEYBOARD)
// *BORDERCOL = WHITE
// [13] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2
// VICII->BORDER_COLOR = WHITE
// [13] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2
lda #WHITE
sta BORDERCOL
// *VIC_CONTROL |= VIC_RSEL
// [14] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (const nomodify byte) VIC_RSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// VICII->CONTROL1 |= VIC_RSEL
// [14] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) | (const nomodify byte) VIC_RSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2
// Set screen height back to 25 lines (preparing for the next screen)
lda #VIC_RSEL
ora VIC_CONTROL
sta VIC_CONTROL
// *IRQ_STATUS = IRQ_RASTER
// [15] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
ora VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// VICII->IRQ_STATUS = IRQ_RASTER
// [15] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// Acknowledge the IRQ
lda #IRQ_RASTER
sta IRQ_STATUS
// *RASTER = $fa
// [16] *((const nomodify byte*) RASTER) ← (byte) $fa -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS
// VICII->RASTER = $fa
// [16] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fa -- _deref_pbuc1=vbuc2
// Trigger IRQ 1 at line $fa
lda #$fa
sta RASTER
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// *KERNEL_IRQ = &irq_bottom_1
// [17] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_MIN)(void()) irq_bottom_1() -- _deref_pptc1=pprc2
lda #<irq_bottom_1
sta KERNEL_IRQ
lda #>irq_bottom_1
sta KERNEL_IRQ+1
// *BORDERCOL = RED
// [18] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) RED -- _deref_pbuc1=vbuc2
// VICII->BORDER_COLOR = RED
// [18] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) RED -- _deref_pbuc1=vbuc2
lda #RED
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// irq_bottom_2::@return
// }
// [19] return - exit interrupt(KERNEL_KEYBOARD)
@ -950,36 +948,36 @@ irq_bottom_2: {
// Interrupt Routine 1
irq_bottom_1: {
// entry interrupt(KERNEL_MIN)
// *BORDERCOL = WHITE
// [20] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2
// VICII->BORDER_COLOR = WHITE
// [20] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE -- _deref_pbuc1=vbuc2
lda #WHITE
sta BORDERCOL
// *VIC_CONTROL &= ($ff^VIC_RSEL)
// [21] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $ff^(const nomodify byte) VIC_RSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// VICII->CONTROL1 &= ($ff^VIC_RSEL)
// [21] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $ff^(const nomodify byte) VIC_RSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
// Set screen height to 24 lines - this is done after the border should have started drawing - so it wont start
lda #$ff^VIC_RSEL
and VIC_CONTROL
sta VIC_CONTROL
// *IRQ_STATUS = IRQ_RASTER
// [22] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// VICII->IRQ_STATUS = IRQ_RASTER
// [22] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// Acknowledge the IRQ
lda #IRQ_RASTER
sta IRQ_STATUS
// *RASTER = $fd
// [23] *((const nomodify byte*) RASTER) ← (byte) $fd -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS
// VICII->RASTER = $fd
// [23] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fd -- _deref_pbuc1=vbuc2
// Trigger IRQ 2 at line $fd
lda #$fd
sta RASTER
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// *KERNEL_IRQ = &irq_bottom_2
// [24] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_KEYBOARD)(void()) irq_bottom_2() -- _deref_pptc1=pprc2
lda #<irq_bottom_2
sta KERNEL_IRQ
lda #>irq_bottom_2
sta KERNEL_IRQ+1
// *BORDERCOL = RED
// [25] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) RED -- _deref_pbuc1=vbuc2
// VICII->BORDER_COLOR = RED
// [25] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) RED -- _deref_pbuc1=vbuc2
lda #RED
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// irq_bottom_1::@return
// }
// [26] return - exit interrupt(KERNEL_MIN)

View File

@ -1,13 +1,10 @@
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) GHOST_BYTE = (byte*) 16383
(const nomodify byte*) IRQ_ENABLE = (byte*) 53274
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*) 53273
(const nomodify void()**) KERNEL_IRQ = (void()**) 788
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
@ -94,9 +91,13 @@
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const nomodify byte*) RASTER = (byte*) 53266
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = (byte) $11
(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = (byte) $1a
(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = (byte) $19
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify byte) RED = (byte) 2
(const nomodify byte*) VIC_CONTROL = (byte*) 53265
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(const nomodify byte) VIC_RSEL = (byte) 8
(const nomodify byte) WHITE = (byte) 1
interrupt(KERNEL_MIN)(void()) irq_bottom_1()

View File

@ -19,14 +19,16 @@
.const SPRITE_PTRS = $3f8
.label SPRITES_XPOS = $d000
.label SPRITES_YPOS = $d001
.label SPRITES_ENABLE = $d015
.label BORDERCOL = $d020
.label SPRITES_COLS = $d027
// The VIC-II MOS 6567/6569
.label VICII = $d000
.const GREEN = 5
// Address to load to
.label LOAD_SPRITE = $3000
.label SCREEN = $400
.label SPRITES_PTR = SCREEN+SPRITE_PTRS
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
__bbegin:
.segment Code
main: {
@ -39,17 +41,17 @@ main: {
// if(status!=0xff)
cpx #$ff
beq __b1
// *BORDERCOL = 0x02
// VICII->BORDER_COLOR = 0x02
lda #2
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// error(status)
txa
jsr error
__b1:
// *SPRITES_ENABLE = %00000001
// VICII->SPRITES_ENABLE = %00000001
// Show the loaded sprite on screen
lda #1
sta SPRITES_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
// SPRITES_PTR[0] = toSpritePtr(LOAD_SPRITE)
lda #toSpritePtr1_return
sta SPRITES_PTR

View File

@ -19,12 +19,12 @@ main::@4: scope:[main] from main
[8] if((byte) main::status#0==(byte) $ff) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@4
[9] *((const nomodify byte*) BORDERCOL) ← (byte) 2
[9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) 2
[10] (byte) error::err#0 ← (byte) main::status#0
[11] call error
to:main::@1
main::@1: scope:[main] from main::@2 main::@4
[12] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) 1
[12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) 1
to:main::toSpritePtr1
main::toSpritePtr1: scope:[main] from main::@1
[13] phi()

View File

@ -50,7 +50,7 @@ main::@4: scope:[main] from main
if((bool~) main::$2) goto main::@1
to:main::@2
main::@1: scope:[main] from main::@4 main::@5
*((const nomodify byte*) SPRITES_ENABLE) ← (number) 1
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (number) 1
(byte*) main::toSpritePtr1_sprite#0 ← (const nomodify byte*) LOAD_SPRITE
to:main::toSpritePtr1
main::toSpritePtr1: scope:[main] from main::@1
@ -73,7 +73,7 @@ main::@3: scope:[main] from main::toSpritePtr1_@return
to:main::@return
main::@2: scope:[main] from main::@4
(byte) main::status#1 ← phi( main::@4/(byte) main::status#0 )
*((const nomodify byte*) BORDERCOL) ← (number) 2
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (number) 2
(byte) error::err#0 ← (byte) main::status#1
call error
to:main::@5
@ -180,7 +180,6 @@ SYMBOL TABLE SSA
(label) @2
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify byte) GREEN = (byte) 5
(const nomodify byte*) LOAD_SPRITE = (byte*)(number) $3000
(byte) MOS6526_CIA::INTERRUPT
@ -267,6 +266,8 @@ SYMBOL TABLE SSA
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = (byte) $15
(const nomodify byte*) SCREEN = (byte*)(number) $400
(const byte*) SPRITE[] = kickasm {{ .var pic = LoadPicture("sprite.png", List().add($000000, $ffffff))
.for (var y=0; y<21; y++)
@ -274,11 +275,11 @@ SYMBOL TABLE SSA
.byte pic.getSinglecolorByte(x,y)
}}
(const nomodify byte*) SPRITES_COLS = (byte*)(number) $d027
(const nomodify byte*) SPRITES_ENABLE = (byte*)(number) $d015
(const nomodify byte*) SPRITES_PTR = (const nomodify byte*) SCREEN+(const nomodify word) SPRITE_PTRS
(const nomodify byte*) SPRITES_XPOS = (byte*)(number) $d000
(const nomodify byte*) SPRITES_YPOS = (byte*)(number) $d001
(const nomodify word) SPRITE_PTRS = (word) $3f8
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*)(number) $d000
(void()) error((byte) error::err)
(label) error::@return
(byte) error::err
@ -397,7 +398,7 @@ SYMBOL TABLE SSA
Adding number conversion cast (unumber) 0 in (bool~) strlen::$0 ← (number) 0 != *((byte*) strlen::str#2)
Adding number conversion cast (unumber) 8 in (byte) loadFileToMemory::device#0 ← (number) 8
Adding number conversion cast (unumber) $ff in (bool~) main::$1 ← (byte) main::status#0 != (number) $ff
Adding number conversion cast (unumber) 1 in *((const nomodify byte*) SPRITES_ENABLE) ← (number) 1
Adding number conversion cast (unumber) 1 in *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (number) 1
Adding number conversion cast (unumber) $40 in (number~) main::toSpritePtr1_$0 ← (word~) main::toSpritePtr1_$1 / (number) $40
Adding number conversion cast (unumber) main::toSpritePtr1_$0 in (number~) main::toSpritePtr1_$0 ← (word~) main::toSpritePtr1_$1 / (unumber)(number) $40
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) SPRITES_PTR + (number) 0) ← (byte~) main::$3
@ -406,19 +407,18 @@ Adding number conversion cast (unumber) $15 in *((const nomodify byte*) SPRITES_
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) SPRITES_XPOS + (number) 0) ← ((unumber)) (number) $15
Adding number conversion cast (unumber) $33 in *((const nomodify byte*) SPRITES_YPOS + (number) 0) ← (number) $33
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) SPRITES_YPOS + (number) 0) ← ((unumber)) (number) $33
Adding number conversion cast (unumber) 2 in *((const nomodify byte*) BORDERCOL) ← (number) 2
Adding number conversion cast (unumber) 2 in *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (number) 2
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte) loadFileToMemory::device#0 ← (unumber)(number) 8
Inlining cast *((const nomodify byte*) SPRITES_ENABLE) ← (unumber)(number) 1
Inlining cast *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (unumber)(number) 1
Inlining cast *((const nomodify byte*) SPRITES_XPOS + (unumber)(number) 0) ← (unumber)(number) $15
Inlining cast *((const nomodify byte*) SPRITES_YPOS + (unumber)(number) 0) ← (unumber)(number) $33
Inlining cast *((const nomodify byte*) BORDERCOL) ← (unumber)(number) 2
Inlining cast *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (unumber)(number) 2
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53248
Simplifying constant pointer cast (byte*) 53249
Simplifying constant pointer cast (byte*) 53269
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53287
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
Simplifying constant pointer cast (byte*) 12288
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 255
@ -589,12 +589,12 @@ main::@4: scope:[main] from main
[8] if((byte) main::status#0==(byte) $ff) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@4
[9] *((const nomodify byte*) BORDERCOL) ← (byte) 2
[9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) 2
[10] (byte) error::err#0 ← (byte) main::status#0
[11] call error
to:main::@1
main::@1: scope:[main] from main::@2 main::@4
[12] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) 1
[12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) 1
to:main::toSpritePtr1
main::toSpritePtr1: scope:[main] from main::@1
[13] phi()
@ -873,14 +873,16 @@ Target platform is custom / MOS6502X
.const SPRITE_PTRS = $3f8
.label SPRITES_XPOS = $d000
.label SPRITES_YPOS = $d001
.label SPRITES_ENABLE = $d015
.label BORDERCOL = $d020
.label SPRITES_COLS = $d027
// The VIC-II MOS 6567/6569
.label VICII = $d000
.const GREEN = 5
// Address to load to
.label LOAD_SPRITE = $3000
.label SCREEN = $400
.label SPRITES_PTR = SCREEN+SPRITE_PTRS
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -922,9 +924,9 @@ main: {
jmp __b2
// main::@2
__b2:
// [9] *((const nomodify byte*) BORDERCOL) ← (byte) 2 -- _deref_pbuc1=vbuc2
// [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) 2 -- _deref_pbuc1=vbuc2
lda #2
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [10] (byte) error::err#0 ← (byte) main::status#0 -- vbuz1=vbuz2
lda.z status
sta.z error.err
@ -933,10 +935,10 @@ main: {
jmp __b1
// main::@1
__b1:
// [12] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) 1 -- _deref_pbuc1=vbuc2
// [12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) 1 -- _deref_pbuc1=vbuc2
// Show the loaded sprite on screen
lda #1
sta SPRITES_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
// [13] phi from main::@1 to main::toSpritePtr1 [phi:main::@1->main::toSpritePtr1]
toSpritePtr1_from___b1:
jmp toSpritePtr1
@ -1184,9 +1186,9 @@ SPRITE:
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [9] *((const nomodify byte*) BORDERCOL) ← (byte) 2 [ main::status#0 ] ( main:2 [ main::status#0 ] { { error::err#0 = main::status#0 } } ) always clobbers reg byte a
Statement [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) 2 [ main::status#0 ] ( main:2 [ main::status#0 ] { { error::err#0 = main::status#0 } } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:7 [ main::status#0 ]
Statement [12] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) 1 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) 1 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [14] *((const nomodify byte*) SPRITES_PTR) ← (const byte) main::toSpritePtr1_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [15] *((const nomodify byte*) SPRITES_COLS) ← (const nomodify byte) GREEN [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [16] *((const nomodify byte*) SPRITES_XPOS) ← (byte) $15 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
@ -1203,8 +1205,8 @@ Statement [43] *((const nomodify byte*) setnam::filename_len) ← (byte)(word~)
Statement [44] *((const nomodify byte**) setnam::filename_ptr) ← (const byte*) main::filename [ ] ( main:2::loadFileToMemory:5::setnam:23 [ ] { { loadFileToMemory::return#0 = loadFileToMemory::return#1 } } ) always clobbers reg byte a
Statement asm { ldafilename_len ldxfilename_ptr ldyfilename_ptr+1 jsr$ffbd } always clobbers reg byte a reg byte x reg byte y
Statement [49] if((byte) 0!=*((byte*) strlen::str#2)) goto strlen::@2 [ strlen::len#2 strlen::str#2 ] ( main:2::loadFileToMemory:5::setnam:23::strlen:40 [ strlen::len#2 strlen::str#2 ] { { loadFileToMemory::return#0 = loadFileToMemory::return#1 } { strlen::return#2 = strlen::len#2 } } ) always clobbers reg byte a reg byte y
Statement [9] *((const nomodify byte*) BORDERCOL) ← (byte) 2 [ main::status#0 ] ( main:2 [ main::status#0 ] { { error::err#0 = main::status#0 } } ) always clobbers reg byte a
Statement [12] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) 1 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) 2 [ main::status#0 ] ( main:2 [ main::status#0 ] { { error::err#0 = main::status#0 } } ) always clobbers reg byte a
Statement [12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) 1 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [14] *((const nomodify byte*) SPRITES_PTR) ← (const byte) main::toSpritePtr1_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [15] *((const nomodify byte*) SPRITES_COLS) ← (const nomodify byte) GREEN [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [16] *((const nomodify byte*) SPRITES_XPOS) ← (byte) $15 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
@ -1284,14 +1286,16 @@ ASSEMBLER BEFORE OPTIMIZATION
.const SPRITE_PTRS = $3f8
.label SPRITES_XPOS = $d000
.label SPRITES_YPOS = $d001
.label SPRITES_ENABLE = $d015
.label BORDERCOL = $d020
.label SPRITES_COLS = $d027
// The VIC-II MOS 6567/6569
.label VICII = $d000
.const GREEN = 5
// Address to load to
.label LOAD_SPRITE = $3000
.label SCREEN = $400
.label SPRITES_PTR = SCREEN+SPRITE_PTRS
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -1328,9 +1332,9 @@ main: {
jmp __b2
// main::@2
__b2:
// [9] *((const nomodify byte*) BORDERCOL) ← (byte) 2 -- _deref_pbuc1=vbuc2
// [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) 2 -- _deref_pbuc1=vbuc2
lda #2
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [10] (byte) error::err#0 ← (byte) main::status#0 -- vbuaa=vbuxx
txa
// [11] call error
@ -1338,10 +1342,10 @@ main: {
jmp __b1
// main::@1
__b1:
// [12] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) 1 -- _deref_pbuc1=vbuc2
// [12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) 1 -- _deref_pbuc1=vbuc2
// Show the loaded sprite on screen
lda #1
sta SPRITES_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
// [13] phi from main::@1 to main::toSpritePtr1 [phi:main::@1->main::toSpritePtr1]
toSpritePtr1_from___b1:
jmp toSpritePtr1
@ -1633,7 +1637,6 @@ FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte) GREEN = (byte) 5
(const nomodify byte*) LOAD_SPRITE = (byte*) 12288
(byte) MOS6526_CIA::INTERRUPT
@ -1720,6 +1723,8 @@ FINAL SYMBOL TABLE
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = (byte) $15
(const nomodify byte*) SCREEN = (byte*) 1024
(const byte*) SPRITE[] = kickasm {{ .var pic = LoadPicture("sprite.png", List().add($000000, $ffffff))
.for (var y=0; y<21; y++)
@ -1727,11 +1732,11 @@ FINAL SYMBOL TABLE
.byte pic.getSinglecolorByte(x,y)
}}
(const nomodify byte*) SPRITES_COLS = (byte*) 53287
(const nomodify byte*) SPRITES_ENABLE = (byte*) 53269
(const nomodify byte*) SPRITES_PTR = (const nomodify byte*) SCREEN+(const nomodify word) SPRITE_PTRS
(const nomodify byte*) SPRITES_XPOS = (byte*) 53248
(const nomodify byte*) SPRITES_YPOS = (byte*) 53249
(const nomodify word) SPRITE_PTRS = (word) $3f8
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(void()) error((byte) error::err)
(label) error::@return
(byte) error::err
@ -1833,14 +1838,16 @@ Score: 811
.const SPRITE_PTRS = $3f8
.label SPRITES_XPOS = $d000
.label SPRITES_YPOS = $d001
.label SPRITES_ENABLE = $d015
.label BORDERCOL = $d020
.label SPRITES_COLS = $d027
// The VIC-II MOS 6567/6569
.label VICII = $d000
.const GREEN = 5
// Address to load to
.label LOAD_SPRITE = $3000
.label SCREEN = $400
.label SPRITES_PTR = SCREEN+SPRITE_PTRS
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -1868,10 +1875,10 @@ main: {
cpx #$ff
beq __b1
// main::@2
// *BORDERCOL = 0x02
// [9] *((const nomodify byte*) BORDERCOL) ← (byte) 2 -- _deref_pbuc1=vbuc2
// VICII->BORDER_COLOR = 0x02
// [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) 2 -- _deref_pbuc1=vbuc2
lda #2
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// error(status)
// [10] (byte) error::err#0 ← (byte) main::status#0 -- vbuaa=vbuxx
txa
@ -1879,11 +1886,11 @@ main: {
jsr error
// main::@1
__b1:
// *SPRITES_ENABLE = %00000001
// [12] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) 1 -- _deref_pbuc1=vbuc2
// VICII->SPRITES_ENABLE = %00000001
// [12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) 1 -- _deref_pbuc1=vbuc2
// Show the loaded sprite on screen
lda #1
sta SPRITES_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
// [13] phi from main::@1 to main::toSpritePtr1 [phi:main::@1->main::toSpritePtr1]
// main::toSpritePtr1
// main::@3

View File

@ -1,7 +1,6 @@
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte) GREEN = (byte) 5
(const nomodify byte*) LOAD_SPRITE = (byte*) 12288
(byte) MOS6526_CIA::INTERRUPT
@ -88,6 +87,8 @@
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = (byte) $15
(const nomodify byte*) SCREEN = (byte*) 1024
(const byte*) SPRITE[] = kickasm {{ .var pic = LoadPicture("sprite.png", List().add($000000, $ffffff))
.for (var y=0; y<21; y++)
@ -95,11 +96,11 @@
.byte pic.getSinglecolorByte(x,y)
}}
(const nomodify byte*) SPRITES_COLS = (byte*) 53287
(const nomodify byte*) SPRITES_ENABLE = (byte*) 53269
(const nomodify byte*) SPRITES_PTR = (const nomodify byte*) SCREEN+(const nomodify word) SPRITE_PTRS
(const nomodify byte*) SPRITES_XPOS = (byte*) 53248
(const nomodify byte*) SPRITES_YPOS = (byte*) 53249
(const nomodify word) SPRITE_PTRS = (word) $3f8
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(void()) error((byte) error::err)
(label) error::@return
(byte) error::err

View File

@ -5,19 +5,21 @@
.label SPRITES_XPOS = $d000
.label SPRITES_YPOS = $d001
.label SPRITES_XMSB = $d010
.label RASTER = $d012
.label SPRITES_ENABLE = $d015
.label BORDERCOL = $d020
.label SPRITES_COLS = $d027
.label D011 = $d011
.const VIC_RST8 = $80
.const VIC_DEN = $10
.const VIC_RSEL = 8
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The colors of the C64
.const BLACK = 0
.const GREEN = 5
// The number of sprites in the multiplexer
.const PLEX_COUNT = $20
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
// Location of screen & sprites
.label SCREEN = $400
.label SPRITE = $2000
@ -65,12 +67,12 @@ loop: {
lda #0
sta.z sin_idx
__b2:
// while(*RASTER!=$ff)
// while(VICII->RASTER!=$ff)
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
// (*BORDERCOL)++;
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
ldx.z sin_idx
ldy #0
__b4:
@ -86,13 +88,13 @@ loop: {
bne __b4
// sin_idx +=1
inc.z sin_idx
// (*BORDERCOL)++;
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// plexSort()
jsr plexSort
// *BORDERCOL = BLACK
// VICII->BORDER_COLOR = BLACK
lda #BLACK
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
__b6:
// *D011&VIC_RST8
lda #VIC_RST8
@ -104,20 +106,20 @@ loop: {
sta.z ss
// Show the sprites
__b7:
// *BORDERCOL = BLACK
// VICII->BORDER_COLOR = BLACK
lda #BLACK
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// return PLEX_FREE_YPOS[plex_free_next];
ldy.z plex_free_next
lda PLEX_FREE_YPOS,y
sta.z plexFreeNextYpos1_return
__b8:
// while(*RASTER<rasterY)
lda RASTER
// while(VICII->RASTER<rasterY)
lda VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
cmp.z plexFreeNextYpos1_return
bcc __b8
// (*BORDERCOL)++;
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// plexShowSprite()
jsr plexShowSprite
// for( char ss: 0..PLEX_COUNT-1)
@ -125,9 +127,9 @@ loop: {
lda #PLEX_COUNT-1+1
cmp.z ss
bne __b7
// *BORDERCOL = BLACK
// VICII->BORDER_COLOR = BLACK
lda #BLACK
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __b2
}
// Show the next sprite.
@ -332,10 +334,10 @@ init: {
inx
cpx #PLEX_COUNT-1+1
bne __b1
// *SPRITES_ENABLE = $ff
// VICII->SPRITES_ENABLE = $ff
// Enable & initialize sprites
lda #$ff
sta SPRITES_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
ldx #0
__b3:
// SPRITES_COLS[ss] = GREEN

View File

@ -44,10 +44,10 @@ loop::@1: scope:[loop] from loop loop::@10
[15] (byte) loop::sin_idx#6 ← phi( loop/(byte) 0 loop::@10/(byte) loop::sin_idx#1 )
to:loop::@2
loop::@2: scope:[loop] from loop::@1 loop::@2
[16] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto loop::@2
[16] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto loop::@2
to:loop::@3
loop::@3: scope:[loop] from loop::@2
[17] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[18] (byte) loop::y_idx#3 ← (byte) loop::sin_idx#6
to:loop::@4
loop::@4: scope:[loop] from loop::@3 loop::@4
@ -60,11 +60,11 @@ loop::@4: scope:[loop] from loop::@3 loop::@4
to:loop::@5
loop::@5: scope:[loop] from loop::@4
[24] (byte) loop::sin_idx#1 ← (byte) loop::sin_idx#6 + (byte) 1
[25] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[25] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[26] call plexSort
to:loop::@11
loop::@11: scope:[loop] from loop::@5
[27] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK
[27] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK
to:loop::@6
loop::@6: scope:[loop] from loop::@11 loop::@6
[28] (byte~) loop::$5 ← *((const nomodify byte*) D011) & (const nomodify byte) VIC_RST8
@ -72,16 +72,16 @@ loop::@6: scope:[loop] from loop::@11 loop::@6
to:loop::@7
loop::@7: scope:[loop] from loop::@12 loop::@6
[30] (byte) loop::ss#5 ← phi( loop::@12/(byte) loop::ss#1 loop::@6/(byte) 0 )
[31] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK
[31] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK
to:loop::plexFreeNextYpos1
loop::plexFreeNextYpos1: scope:[loop] from loop::@7
[32] (byte) loop::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next)
to:loop::@8
loop::@8: scope:[loop] from loop::@8 loop::plexFreeNextYpos1
[33] if(*((const nomodify byte*) RASTER)<(byte) loop::plexFreeNextYpos1_return#0) goto loop::@8
[33] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)<(byte) loop::plexFreeNextYpos1_return#0) goto loop::@8
to:loop::@9
loop::@9: scope:[loop] from loop::@8
[34] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[34] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[35] call plexShowSprite
to:loop::@12
loop::@12: scope:[loop] from loop::@9
@ -89,7 +89,7 @@ loop::@12: scope:[loop] from loop::@9
[37] if((byte) loop::ss#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto loop::@7
to:loop::@10
loop::@10: scope:[loop] from loop::@12
[38] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK
[38] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK
to:loop::@1
(void()) plexShowSprite()
@ -203,7 +203,7 @@ init::@1: scope:[init] from init init::@1
[98] if((byte) init::sx#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto init::@1
to:init::@2
init::@2: scope:[init] from init::@1
[99] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff
[99] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff
to:init::@3
init::@3: scope:[init] from init::@2 init::@3
[100] (byte) init::ss#2 ← phi( init::@2/(byte) 0 init::@3/(byte) init::ss#1 )

View File

@ -225,7 +225,7 @@ init::@1: scope:[init] from init::@1 init::@4
to:init::@2
init::@2: scope:[init] from init::@1
(byte*) PLEX_SCREEN_PTR#24 ← phi( init::@1/(byte*) PLEX_SCREEN_PTR#28 )
*((const nomodify byte*) SPRITES_ENABLE) ← (number) $ff
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (number) $ff
(byte) init::ss#0 ← (byte) 0
to:init::@3
init::@3: scope:[init] from init::@2 init::@3
@ -255,13 +255,13 @@ loop::@1: scope:[loop] from loop loop::@11
loop::@2: scope:[loop] from loop::@1 loop::@2
(byte*) PLEX_SCREEN_PTR#41 ← phi( loop::@1/(byte*) PLEX_SCREEN_PTR#42 loop::@2/(byte*) PLEX_SCREEN_PTR#41 )
(byte) loop::sin_idx#4 ← phi( loop::@1/(byte) loop::sin_idx#6 loop::@2/(byte) loop::sin_idx#4 )
(bool~) loop::$0 ← *((const nomodify byte*) RASTER) != (number) $ff
(bool~) loop::$0 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $ff
if((bool~) loop::$0) goto loop::@2
to:loop::@3
loop::@3: scope:[loop] from loop::@2
(byte*) PLEX_SCREEN_PTR#40 ← phi( loop::@2/(byte*) PLEX_SCREEN_PTR#41 )
(byte) loop::sin_idx#2 ← phi( loop::@2/(byte) loop::sin_idx#4 )
*((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
(byte) loop::y_idx#0 ← (byte) loop::sin_idx#2
(byte) loop::sy#0 ← (byte) 0
to:loop::@4
@ -280,13 +280,13 @@ loop::@5: scope:[loop] from loop::@4
(byte*) PLEX_SCREEN_PTR#38 ← phi( loop::@4/(byte*) PLEX_SCREEN_PTR#39 )
(byte) loop::sin_idx#3 ← phi( loop::@4/(byte) loop::sin_idx#5 )
(byte) loop::sin_idx#1 ← (byte) loop::sin_idx#3 + (number) 1
*((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
call plexSort
to:loop::@13
loop::@13: scope:[loop] from loop::@5
(byte) loop::sin_idx#17 ← phi( loop::@5/(byte) loop::sin_idx#1 )
(byte*) PLEX_SCREEN_PTR#37 ← phi( loop::@5/(byte*) PLEX_SCREEN_PTR#38 )
*((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK
to:loop::@6
loop::@6: scope:[loop] from loop::@13 loop::@6
(byte) loop::sin_idx#16 ← phi( loop::@13/(byte) loop::sin_idx#17 loop::@6/(byte) loop::sin_idx#16 )
@ -304,7 +304,7 @@ loop::@8: scope:[loop] from loop::@14 loop::@7
(byte) loop::sin_idx#14 ← phi( loop::@14/(byte) loop::sin_idx#8 loop::@7/(byte) loop::sin_idx#15 )
(byte*) PLEX_SCREEN_PTR#33 ← phi( loop::@14/(byte*) PLEX_SCREEN_PTR#34 loop::@7/(byte*) PLEX_SCREEN_PTR#35 )
(byte) loop::ss#8 ← phi( loop::@14/(byte) loop::ss#1 loop::@7/(byte) loop::ss#0 )
*((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK
to:loop::plexFreeNextYpos1
loop::plexFreeNextYpos1: scope:[loop] from loop::@8
(byte) loop::sin_idx#13 ← phi( loop::@8/(byte) loop::sin_idx#14 )
@ -332,14 +332,14 @@ loop::@9: scope:[loop] from loop::@12 loop::@9
(byte*) PLEX_SCREEN_PTR#29 ← phi( loop::@12/(byte*) PLEX_SCREEN_PTR#30 loop::@9/(byte*) PLEX_SCREEN_PTR#29 )
(byte) loop::ss#4 ← phi( loop::@12/(byte) loop::ss#5 loop::@9/(byte) loop::ss#4 )
(byte) loop::rasterY#1 ← phi( loop::@12/(byte) loop::rasterY#0 loop::@9/(byte) loop::rasterY#1 )
(bool~) loop::$8 ← *((const nomodify byte*) RASTER) < (byte) loop::rasterY#1
(bool~) loop::$8 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) < (byte) loop::rasterY#1
if((bool~) loop::$8) goto loop::@9
to:loop::@10
loop::@10: scope:[loop] from loop::@9
(byte) loop::sin_idx#9 ← phi( loop::@9/(byte) loop::sin_idx#10 )
(byte*) PLEX_SCREEN_PTR#26 ← phi( loop::@9/(byte*) PLEX_SCREEN_PTR#29 )
(byte) loop::ss#3 ← phi( loop::@9/(byte) loop::ss#4 )
*((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
call plexShowSprite
to:loop::@14
loop::@14: scope:[loop] from loop::@10
@ -353,7 +353,7 @@ loop::@14: scope:[loop] from loop::@10
loop::@11: scope:[loop] from loop::@14
(byte*) PLEX_SCREEN_PTR#44 ← phi( loop::@14/(byte*) PLEX_SCREEN_PTR#34 )
(byte) loop::sin_idx#7 ← phi( loop::@14/(byte) loop::sin_idx#8 )
*((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK
to:loop::@1
loop::@return: scope:[loop] from loop::@1
return
@ -377,7 +377,6 @@ SYMBOL TABLE SSA
(label) @begin
(label) @end
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify byte*) D011 = (byte*)(number) $d011
(const nomodify byte) GREEN = (byte) 5
(byte) MOS6526_CIA::INTERRUPT
@ -464,6 +463,9 @@ SYMBOL TABLE SSA
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = (byte) $15
(const nomodify byte) PLEX_COUNT = (byte) $20
(const byte*) PLEX_FREE_YPOS[(number) 8] = { fill( 8, 0) }
(const byte*) PLEX_PTR[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
@ -516,15 +518,14 @@ SYMBOL TABLE SSA
(const byte*) PLEX_SORTED_IDX[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
(const word*) PLEX_XPOS[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
(const byte*) PLEX_YPOS[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
(const nomodify byte*) RASTER = (byte*)(number) $d012
(const byte*) SCREEN = (byte*)(number) $400
(const byte) SIZEOF_WORD = (byte) 2
(const byte*) SPRITE = (byte*)(number) $2000
(const nomodify byte*) SPRITES_COLS = (byte*)(number) $d027
(const nomodify byte*) SPRITES_ENABLE = (byte*)(number) $d015
(const nomodify byte*) SPRITES_XMSB = (byte*)(number) $d010
(const nomodify byte*) SPRITES_XPOS = (byte*)(number) $d000
(const nomodify byte*) SPRITES_YPOS = (byte*)(number) $d001
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*)(number) $d000
(const nomodify byte) VIC_DEN = (byte) $10
(const nomodify byte) VIC_RSEL = (byte) 8
(const nomodify byte) VIC_RST8 = (byte) $80
@ -768,8 +769,8 @@ Adding number conversion cast (unumber) 3 in *((const nomodify byte*) D011) ←
Adding number conversion cast (unumber) $40 in (byte*~) init::$1 ← (const byte*) SPRITE / (number) $40
Adding number conversion cast (unumber) 9 in (word) init::xp#1 ← (word) init::xp#2 + (number) 9
Adding number conversion cast (unumber) 1 in (byte) init::sx#1 ← (byte) init::sx#2 + rangenext(0,PLEX_COUNT-1)
Adding number conversion cast (unumber) $ff in *((const nomodify byte*) SPRITES_ENABLE) ← (number) $ff
Adding number conversion cast (unumber) $ff in (bool~) loop::$0 ← *((const nomodify byte*) RASTER) != (number) $ff
Adding number conversion cast (unumber) $ff in *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (number) $ff
Adding number conversion cast (unumber) $ff in (bool~) loop::$0 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $ff
Adding number conversion cast (unumber) 8 in (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (number) 8
Adding number conversion cast (unumber) 1 in (byte) loop::sy#1 ← (byte) loop::sy#2 + rangenext(0,PLEX_COUNT-1)
Adding number conversion cast (unumber) 1 in (byte) loop::sin_idx#1 ← (byte) loop::sin_idx#3 + (number) 1
@ -783,16 +784,14 @@ Inlining cast *((const byte*) PLEX_FREE_YPOS + (byte) plexSort::plexFreePrepare1
Inlining cast (volatile byte) plex_free_next ← (unumber)(number) 0
Inlining cast (volatile byte) plex_sprite_msb ← (unumber)(number) 1
Inlining cast *((const nomodify byte*) D011) ← (unumber)(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(unumber)(number) 3
Inlining cast *((const nomodify byte*) SPRITES_ENABLE) ← (unumber)(number) $ff
Inlining cast *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (unumber)(number) $ff
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53248
Simplifying constant pointer cast (byte*) 53249
Simplifying constant pointer cast (byte*) 53264
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 53269
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53287
Simplifying constant pointer cast (byte*) 53265
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 8192
Simplifying constant integer cast $3f8
@ -954,10 +953,10 @@ Simple Condition (bool~) plexShowSprite::$4 [62] if((byte~) plexShowSprite::$3!=
Simple Condition (bool~) plexShowSprite::$8 [72] if((volatile byte) plex_sprite_msb!=(byte) 0) goto plexShowSprite::@return
Simple Condition (bool~) init::$2 [98] if((byte) init::sx#1!=rangelast(0,PLEX_COUNT-1)) goto init::@1
Simple Condition (bool~) init::$3 [105] if((byte) init::ss#1!=rangelast(0,7)) goto init::@3
Simple Condition (bool~) loop::$0 [113] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto loop::@2
Simple Condition (bool~) loop::$0 [113] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto loop::@2
Simple Condition (bool~) loop::$2 [121] if((byte) loop::sy#1!=rangelast(0,PLEX_COUNT-1)) goto loop::@4
Simple Condition (bool~) loop::$6 [129] if((byte~) loop::$5!=(byte) 0) goto loop::@6
Simple Condition (bool~) loop::$8 [136] if(*((const nomodify byte*) RASTER)<(byte) loop::plexFreeNextYpos1_return#0) goto loop::@9
Simple Condition (bool~) loop::$8 [136] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)<(byte) loop::plexFreeNextYpos1_return#0) goto loop::@9
Simple Condition (bool~) loop::$11 [141] if((byte) loop::ss#1!=rangelast(0,PLEX_COUNT-1)) goto loop::@8
Successful SSA optimization Pass2ConditionalJumpSimplification
Rewriting && if()-condition to two if()s [30] (bool~) plexSort::$7 ← (bool~) plexSort::$5 && (bool~) plexSort::$6
@ -1212,10 +1211,10 @@ loop::@1: scope:[loop] from loop loop::@10
[15] (byte) loop::sin_idx#6 ← phi( loop/(byte) 0 loop::@10/(byte) loop::sin_idx#1 )
to:loop::@2
loop::@2: scope:[loop] from loop::@1 loop::@2
[16] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto loop::@2
[16] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto loop::@2
to:loop::@3
loop::@3: scope:[loop] from loop::@2
[17] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[18] (byte) loop::y_idx#3 ← (byte) loop::sin_idx#6
to:loop::@4
loop::@4: scope:[loop] from loop::@3 loop::@4
@ -1228,11 +1227,11 @@ loop::@4: scope:[loop] from loop::@3 loop::@4
to:loop::@5
loop::@5: scope:[loop] from loop::@4
[24] (byte) loop::sin_idx#1 ← (byte) loop::sin_idx#6 + (byte) 1
[25] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[25] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[26] call plexSort
to:loop::@11
loop::@11: scope:[loop] from loop::@5
[27] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK
[27] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK
to:loop::@6
loop::@6: scope:[loop] from loop::@11 loop::@6
[28] (byte~) loop::$5 ← *((const nomodify byte*) D011) & (const nomodify byte) VIC_RST8
@ -1240,16 +1239,16 @@ loop::@6: scope:[loop] from loop::@11 loop::@6
to:loop::@7
loop::@7: scope:[loop] from loop::@12 loop::@6
[30] (byte) loop::ss#5 ← phi( loop::@12/(byte) loop::ss#1 loop::@6/(byte) 0 )
[31] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK
[31] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK
to:loop::plexFreeNextYpos1
loop::plexFreeNextYpos1: scope:[loop] from loop::@7
[32] (byte) loop::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next)
to:loop::@8
loop::@8: scope:[loop] from loop::@8 loop::plexFreeNextYpos1
[33] if(*((const nomodify byte*) RASTER)<(byte) loop::plexFreeNextYpos1_return#0) goto loop::@8
[33] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)<(byte) loop::plexFreeNextYpos1_return#0) goto loop::@8
to:loop::@9
loop::@9: scope:[loop] from loop::@8
[34] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[34] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[35] call plexShowSprite
to:loop::@12
loop::@12: scope:[loop] from loop::@9
@ -1257,7 +1256,7 @@ loop::@12: scope:[loop] from loop::@9
[37] if((byte) loop::ss#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto loop::@7
to:loop::@10
loop::@10: scope:[loop] from loop::@12
[38] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK
[38] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK
to:loop::@1
(void()) plexShowSprite()
@ -1371,7 +1370,7 @@ init::@1: scope:[init] from init init::@1
[98] if((byte) init::sx#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto init::@1
to:init::@2
init::@2: scope:[init] from init::@1
[99] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff
[99] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff
to:init::@3
init::@3: scope:[init] from init::@2 init::@3
[100] (byte) init::ss#2 ← phi( init::@2/(byte) 0 init::@3/(byte) init::ss#1 )
@ -1675,19 +1674,21 @@ Target platform is c64basic / MOS6502X
.label SPRITES_XPOS = $d000
.label SPRITES_YPOS = $d001
.label SPRITES_XMSB = $d010
.label RASTER = $d012
.label SPRITES_ENABLE = $d015
.label BORDERCOL = $d020
.label SPRITES_COLS = $d027
.label D011 = $d011
.const VIC_RST8 = $80
.const VIC_DEN = $10
.const VIC_RSEL = 8
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The colors of the C64
.const BLACK = 0
.const GREEN = 5
// The number of sprites in the multiplexer
.const PLEX_COUNT = $20
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
// Location of screen & sprites
.label SCREEN = $400
.label SPRITE = $2000
@ -1779,15 +1780,15 @@ loop: {
jmp __b2
// loop::@2
__b2:
// [16] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto loop::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// [16] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto loop::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
jmp __b3
// loop::@3
__b3:
// [17] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [18] (byte) loop::y_idx#3 ← (byte) loop::sin_idx#6 -- vbuz1=vbuz2
lda.z sin_idx
sta.z y_idx
@ -1825,8 +1826,8 @@ loop: {
__b5:
// [24] (byte) loop::sin_idx#1 ← (byte) loop::sin_idx#6 + (byte) 1 -- vbuz1=vbuz1_plus_1
inc.z sin_idx
// [25] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [25] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [26] call plexSort
// [65] phi from loop::@5 to plexSort [phi:loop::@5->plexSort]
plexSort_from___b5:
@ -1834,9 +1835,9 @@ loop: {
jmp __b11
// loop::@11
__b11:
// [27] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
// [27] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
lda #BLACK
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __b6
// loop::@6
__b6:
@ -1861,9 +1862,9 @@ loop: {
jmp __b7
// loop::@7
__b7:
// [31] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
// [31] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
lda #BLACK
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp plexFreeNextYpos1
// loop::plexFreeNextYpos1
plexFreeNextYpos1:
@ -1874,15 +1875,15 @@ loop: {
jmp __b8
// loop::@8
__b8:
// [33] if(*((const nomodify byte*) RASTER)<(byte) loop::plexFreeNextYpos1_return#0) goto loop::@8 -- _deref_pbuc1_lt_vbuz1_then_la1
lda RASTER
// [33] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)<(byte) loop::plexFreeNextYpos1_return#0) goto loop::@8 -- _deref_pbuc1_lt_vbuz1_then_la1
lda VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
cmp.z plexFreeNextYpos1_return
bcc __b8
jmp __b9
// loop::@9
__b9:
// [34] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [34] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [35] call plexShowSprite
jsr plexShowSprite
jmp __b12
@ -1897,9 +1898,9 @@ loop: {
jmp __b10
// loop::@10
__b10:
// [38] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
// [38] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
lda #BLACK
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [15] phi from loop::@10 to loop::@1 [phi:loop::@10->loop::@1]
__b1_from___b10:
// [15] phi (byte) loop::sin_idx#6 = (byte) loop::sin_idx#1 [phi:loop::@10->loop::@1#0] -- register_copy
@ -2253,10 +2254,10 @@ init: {
jmp __b2
// init::@2
__b2:
// [99] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
// [99] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
// Enable & initialize sprites
lda #$ff
sta SPRITES_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
// [100] phi from init::@2 to init::@3 [phi:init::@2->init::@3]
__b3_from___b2:
// [100] phi (byte) init::ss#2 = (byte) 0 [phi:init::@2->init::@3#0] -- vbuz1=vbuc1
@ -2353,20 +2354,20 @@ Statement [1] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( [ ] { } ) alway
Statement [2] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a
Statement [3] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( [ ] { } ) always clobbers reg byte a
Statement [4] (volatile byte) plex_free_next ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a
Statement [16] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto loop::@2 [ loop::sin_idx#6 ] ( main:7::loop:12 [ loop::sin_idx#6 ] { } ) always clobbers reg byte a
Statement [16] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto loop::@2 [ loop::sin_idx#6 ] ( main:7::loop:12 [ loop::sin_idx#6 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ loop::sin_idx#6 loop::sin_idx#1 ]
Statement [20] *((const byte*) PLEX_YPOS + (byte) loop::sy#2) ← *((const byte*) YSIN + (byte) loop::y_idx#2) [ loop::sin_idx#6 loop::y_idx#2 loop::sy#2 ] ( main:7::loop:12 [ loop::sin_idx#6 loop::y_idx#2 loop::sy#2 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:3 [ loop::y_idx#2 loop::y_idx#3 loop::y_idx#1 ]
Removing always clobbered register reg byte a as potential for zp[1]:4 [ loop::sy#2 loop::sy#1 ]
Statement [21] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte) 8 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ( main:7::loop:12 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] { } ) always clobbers reg byte a
Statement [27] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 ] { } ) always clobbers reg byte a
Statement [27] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 ] { } ) always clobbers reg byte a
Statement [28] (byte~) loop::$5 ← *((const nomodify byte*) D011) & (const nomodify byte) VIC_RST8 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::$5 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::$5 ] { } ) always clobbers reg byte a
Statement [31] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 ] { } ) always clobbers reg byte a
Statement [31] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:5 [ loop::ss#5 loop::ss#1 ]
Statement [32] (byte) loop::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 loop::plexFreeNextYpos1_return#0 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 loop::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte y
Removing always clobbered register reg byte y as potential for zp[1]:2 [ loop::sin_idx#6 loop::sin_idx#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:5 [ loop::ss#5 loop::ss#1 ]
Statement [38] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK [ loop::sin_idx#1 ] ( main:7::loop:12 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a
Statement [38] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK [ loop::sin_idx#1 ] ( main:7::loop:12 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a
Statement [39] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( main:7::loop:12::plexShowSprite:35 [ loop::sin_idx#1 loop::ss#5 plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a
Statement [40] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( main:7::loop:12::plexShowSprite:35 [ loop::sin_idx#1 loop::ss#5 plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte x reg byte y
Removing always clobbered register reg byte x as potential for zp[1]:2 [ loop::sin_idx#6 loop::sin_idx#1 ]
@ -2407,22 +2408,22 @@ Removing always clobbered register reg byte a as potential for zp[1]:9 [ init::s
Statement [94] (byte~) init::$4 ← (byte) init::sx#2 << (byte) 1 [ init::sx#2 init::xp#2 init::$4 ] ( main:7::init:10 [ init::sx#2 init::xp#2 init::$4 ] { } ) always clobbers reg byte a
Statement [95] *((const word*) PLEX_XPOS + (byte~) init::$4) ← (word) init::xp#2 [ init::sx#2 init::xp#2 ] ( main:7::init:10 [ init::sx#2 init::xp#2 ] { } ) always clobbers reg byte a
Statement [96] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 [ init::sx#2 init::xp#1 ] ( main:7::init:10 [ init::sx#2 init::xp#1 ] { } ) always clobbers reg byte a
Statement [99] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:7::init:10 [ ] { } ) always clobbers reg byte a
Statement [99] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff [ ] ( main:7::init:10 [ ] { } ) always clobbers reg byte a
Statement [101] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN [ init::ss#2 ] ( main:7::init:10 [ init::ss#2 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:12 [ init::ss#2 init::ss#1 ]
Statement [1] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a
Statement [2] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a
Statement [3] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( [ ] { } ) always clobbers reg byte a
Statement [4] (volatile byte) plex_free_next ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a
Statement [16] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto loop::@2 [ loop::sin_idx#6 ] ( main:7::loop:12 [ loop::sin_idx#6 ] { } ) always clobbers reg byte a
Statement [16] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto loop::@2 [ loop::sin_idx#6 ] ( main:7::loop:12 [ loop::sin_idx#6 ] { } ) always clobbers reg byte a
Statement [20] *((const byte*) PLEX_YPOS + (byte) loop::sy#2) ← *((const byte*) YSIN + (byte) loop::y_idx#2) [ loop::sin_idx#6 loop::y_idx#2 loop::sy#2 ] ( main:7::loop:12 [ loop::sin_idx#6 loop::y_idx#2 loop::sy#2 ] { } ) always clobbers reg byte a
Statement [21] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte) 8 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ( main:7::loop:12 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] { } ) always clobbers reg byte a
Statement [27] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 ] { } ) always clobbers reg byte a
Statement [27] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 ] { } ) always clobbers reg byte a
Statement [28] (byte~) loop::$5 ← *((const nomodify byte*) D011) & (const nomodify byte) VIC_RST8 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::$5 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::$5 ] { } ) always clobbers reg byte a
Statement [31] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 ] { } ) always clobbers reg byte a
Statement [31] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 ] { } ) always clobbers reg byte a
Statement [32] (byte) loop::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 loop::plexFreeNextYpos1_return#0 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 loop::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte y
Statement [37] if((byte) loop::ss#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto loop::@7 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#1 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#1 ] { } ) always clobbers reg byte a
Statement [38] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK [ loop::sin_idx#1 ] ( main:7::loop:12 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a
Statement [38] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK [ loop::sin_idx#1 ] ( main:7::loop:12 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a
Statement [39] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( main:7::loop:12::plexShowSprite:35 [ loop::sin_idx#1 loop::ss#5 plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a
Statement [40] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( main:7::loop:12::plexShowSprite:35 [ loop::sin_idx#1 loop::ss#5 plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte x reg byte y
Statement [41] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( main:7::loop:12::plexShowSprite:35 [ loop::sin_idx#1 loop::ss#5 plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte y
@ -2453,21 +2454,21 @@ Statement [93] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const by
Statement [94] (byte~) init::$4 ← (byte) init::sx#2 << (byte) 1 [ init::sx#2 init::xp#2 init::$4 ] ( main:7::init:10 [ init::sx#2 init::xp#2 init::$4 ] { } ) always clobbers reg byte a
Statement [95] *((const word*) PLEX_XPOS + (byte~) init::$4) ← (word) init::xp#2 [ init::sx#2 init::xp#2 ] ( main:7::init:10 [ init::sx#2 init::xp#2 ] { } ) always clobbers reg byte a
Statement [96] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 [ init::sx#2 init::xp#1 ] ( main:7::init:10 [ init::sx#2 init::xp#1 ] { } ) always clobbers reg byte a
Statement [99] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:7::init:10 [ ] { } ) always clobbers reg byte a
Statement [99] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff [ ] ( main:7::init:10 [ ] { } ) always clobbers reg byte a
Statement [101] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN [ init::ss#2 ] ( main:7::init:10 [ init::ss#2 ] { } ) always clobbers reg byte a
Statement [1] (volatile byte) plex_show_idx ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a
Statement [2] (volatile byte) plex_sprite_idx ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a
Statement [3] (volatile byte) plex_sprite_msb ← (byte) 1 [ ] ( [ ] { } ) always clobbers reg byte a
Statement [4] (volatile byte) plex_free_next ← (byte) 0 [ ] ( [ ] { } ) always clobbers reg byte a
Statement [16] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto loop::@2 [ loop::sin_idx#6 ] ( main:7::loop:12 [ loop::sin_idx#6 ] { } ) always clobbers reg byte a
Statement [16] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto loop::@2 [ loop::sin_idx#6 ] ( main:7::loop:12 [ loop::sin_idx#6 ] { } ) always clobbers reg byte a
Statement [20] *((const byte*) PLEX_YPOS + (byte) loop::sy#2) ← *((const byte*) YSIN + (byte) loop::y_idx#2) [ loop::sin_idx#6 loop::y_idx#2 loop::sy#2 ] ( main:7::loop:12 [ loop::sin_idx#6 loop::y_idx#2 loop::sy#2 ] { } ) always clobbers reg byte a
Statement [21] (byte) loop::y_idx#1 ← (byte) loop::y_idx#2 + (byte) 8 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] ( main:7::loop:12 [ loop::sin_idx#6 loop::sy#2 loop::y_idx#1 ] { } ) always clobbers reg byte a
Statement [27] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 ] { } ) always clobbers reg byte a
Statement [27] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 ] { } ) always clobbers reg byte a
Statement [28] (byte~) loop::$5 ← *((const nomodify byte*) D011) & (const nomodify byte) VIC_RST8 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::$5 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::$5 ] { } ) always clobbers reg byte a
Statement [31] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 ] { } ) always clobbers reg byte a
Statement [31] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 ] { } ) always clobbers reg byte a
Statement [32] (byte) loop::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 loop::plexFreeNextYpos1_return#0 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#5 loop::plexFreeNextYpos1_return#0 ] { } ) always clobbers reg byte y
Statement [37] if((byte) loop::ss#1!=(const nomodify byte) PLEX_COUNT-(byte) 1+(byte) 1) goto loop::@7 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#1 ] ( main:7::loop:12 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next loop::sin_idx#1 loop::ss#1 ] { } ) always clobbers reg byte a
Statement [38] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK [ loop::sin_idx#1 ] ( main:7::loop:12 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a
Statement [38] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK [ loop::sin_idx#1 ] ( main:7::loop:12 [ loop::sin_idx#1 ] { } ) always clobbers reg byte a
Statement [39] (byte) plexShowSprite::plex_sprite_idx2#0 ← (volatile byte) plex_sprite_idx << (byte) 1 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] ( main:7::loop:12::plexShowSprite:35 [ loop::sin_idx#1 loop::ss#5 plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 ] { } ) always clobbers reg byte a
Statement [40] (byte) plexShowSprite::plexFreeAdd1_ypos#0 ← *((const byte*) PLEX_YPOS + *((const byte*) PLEX_SORTED_IDX + (volatile byte) plex_show_idx)) [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( main:7::loop:12::plexShowSprite:35 [ loop::sin_idx#1 loop::ss#5 plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte x reg byte y
Statement [41] *((const nomodify byte*) SPRITES_YPOS + (byte) plexShowSprite::plex_sprite_idx2#0) ← (byte) plexShowSprite::plexFreeAdd1_ypos#0 [ plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] ( main:7::loop:12::plexShowSprite:35 [ loop::sin_idx#1 loop::ss#5 plex_show_idx plex_sprite_idx plex_sprite_msb plex_free_next plexShowSprite::plex_sprite_idx2#0 plexShowSprite::plexFreeAdd1_ypos#0 ] { } ) always clobbers reg byte y
@ -2497,7 +2498,7 @@ Statement [93] *((const byte*) PLEX_PTR + (byte) init::sx#2) ← (byte)(const by
Statement [94] (byte~) init::$4 ← (byte) init::sx#2 << (byte) 1 [ init::sx#2 init::xp#2 init::$4 ] ( main:7::init:10 [ init::sx#2 init::xp#2 init::$4 ] { } ) always clobbers reg byte a
Statement [95] *((const word*) PLEX_XPOS + (byte~) init::$4) ← (word) init::xp#2 [ init::sx#2 init::xp#2 ] ( main:7::init:10 [ init::sx#2 init::xp#2 ] { } ) always clobbers reg byte a
Statement [96] (word) init::xp#1 ← (word) init::xp#2 + (byte) 9 [ init::sx#2 init::xp#1 ] ( main:7::init:10 [ init::sx#2 init::xp#1 ] { } ) always clobbers reg byte a
Statement [99] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:7::init:10 [ ] { } ) always clobbers reg byte a
Statement [99] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff [ ] ( main:7::init:10 [ ] { } ) always clobbers reg byte a
Statement [101] *((const nomodify byte*) SPRITES_COLS + (byte) init::ss#2) ← (const nomodify byte) GREEN [ init::ss#2 ] ( main:7::init:10 [ init::ss#2 ] { } ) always clobbers reg byte a
Potential registers zp[1]:2 [ loop::sin_idx#6 loop::sin_idx#1 ] : zp[1]:2 ,
Potential registers zp[1]:3 [ loop::y_idx#2 loop::y_idx#3 loop::y_idx#1 ] : zp[1]:3 , reg byte x , reg byte y ,
@ -2630,19 +2631,21 @@ ASSEMBLER BEFORE OPTIMIZATION
.label SPRITES_XPOS = $d000
.label SPRITES_YPOS = $d001
.label SPRITES_XMSB = $d010
.label RASTER = $d012
.label SPRITES_ENABLE = $d015
.label BORDERCOL = $d020
.label SPRITES_COLS = $d027
.label D011 = $d011
.const VIC_RST8 = $80
.const VIC_DEN = $10
.const VIC_RSEL = 8
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The colors of the C64
.const BLACK = 0
.const GREEN = 5
// The number of sprites in the multiplexer
.const PLEX_COUNT = $20
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
// Location of screen & sprites
.label SCREEN = $400
.label SPRITE = $2000
@ -2731,15 +2734,15 @@ loop: {
jmp __b2
// loop::@2
__b2:
// [16] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto loop::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// [16] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto loop::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
jmp __b3
// loop::@3
__b3:
// [17] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [18] (byte) loop::y_idx#3 ← (byte) loop::sin_idx#6 -- vbuxx=vbuz1
ldx.z sin_idx
// [19] phi from loop::@3 to loop::@4 [phi:loop::@3->loop::@4]
@ -2771,8 +2774,8 @@ loop: {
__b5:
// [24] (byte) loop::sin_idx#1 ← (byte) loop::sin_idx#6 + (byte) 1 -- vbuz1=vbuz1_plus_1
inc.z sin_idx
// [25] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [25] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [26] call plexSort
// [65] phi from loop::@5 to plexSort [phi:loop::@5->plexSort]
plexSort_from___b5:
@ -2780,9 +2783,9 @@ loop: {
jmp __b11
// loop::@11
__b11:
// [27] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
// [27] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
lda #BLACK
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __b6
// loop::@6
__b6:
@ -2805,9 +2808,9 @@ loop: {
jmp __b7
// loop::@7
__b7:
// [31] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
// [31] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
lda #BLACK
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp plexFreeNextYpos1
// loop::plexFreeNextYpos1
plexFreeNextYpos1:
@ -2818,15 +2821,15 @@ loop: {
jmp __b8
// loop::@8
__b8:
// [33] if(*((const nomodify byte*) RASTER)<(byte) loop::plexFreeNextYpos1_return#0) goto loop::@8 -- _deref_pbuc1_lt_vbuz1_then_la1
lda RASTER
// [33] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)<(byte) loop::plexFreeNextYpos1_return#0) goto loop::@8 -- _deref_pbuc1_lt_vbuz1_then_la1
lda VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
cmp.z plexFreeNextYpos1_return
bcc __b8
jmp __b9
// loop::@9
__b9:
// [34] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [34] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [35] call plexShowSprite
jsr plexShowSprite
jmp __b12
@ -2841,9 +2844,9 @@ loop: {
jmp __b10
// loop::@10
__b10:
// [38] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
// [38] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
lda #BLACK
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [15] phi from loop::@10 to loop::@1 [phi:loop::@10->loop::@1]
__b1_from___b10:
// [15] phi (byte) loop::sin_idx#6 = (byte) loop::sin_idx#1 [phi:loop::@10->loop::@1#0] -- register_copy
@ -3146,10 +3149,10 @@ init: {
jmp __b2
// init::@2
__b2:
// [99] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
// [99] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
// Enable & initialize sprites
lda #$ff
sta SPRITES_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
// [100] phi from init::@2 to init::@3 [phi:init::@2->init::@3]
__b3_from___b2:
// [100] phi (byte) init::ss#2 = (byte) 0 [phi:init::@2->init::@3#0] -- vbuxx=vbuc1
@ -3373,7 +3376,6 @@ FINAL SYMBOL TABLE
(label) @begin
(label) @end
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) D011 = (byte*) 53265
(const nomodify byte) GREEN = (byte) 5
(byte) MOS6526_CIA::INTERRUPT
@ -3460,6 +3462,9 @@ FINAL SYMBOL TABLE
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = (byte) $15
(const nomodify byte) PLEX_COUNT = (byte) $20
(const byte*) PLEX_FREE_YPOS[(number) 8] = { fill( 8, 0) }
(const byte*) PLEX_PTR[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
@ -3468,14 +3473,13 @@ FINAL SYMBOL TABLE
(const byte*) PLEX_SORTED_IDX[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
(const word*) PLEX_XPOS[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
(const byte*) PLEX_YPOS[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
(const nomodify byte*) RASTER = (byte*) 53266
(const byte*) SCREEN = (byte*) 1024
(const byte*) SPRITE = (byte*) 8192
(const nomodify byte*) SPRITES_COLS = (byte*) 53287
(const nomodify byte*) SPRITES_ENABLE = (byte*) 53269
(const nomodify byte*) SPRITES_XMSB = (byte*) 53264
(const nomodify byte*) SPRITES_XPOS = (byte*) 53248
(const nomodify byte*) SPRITES_YPOS = (byte*) 53249
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(const nomodify byte) VIC_DEN = (byte) $10
(const nomodify byte) VIC_RSEL = (byte) 8
(const nomodify byte) VIC_RST8 = (byte) $80
@ -3645,19 +3649,21 @@ Score: 60648
.label SPRITES_XPOS = $d000
.label SPRITES_YPOS = $d001
.label SPRITES_XMSB = $d010
.label RASTER = $d012
.label SPRITES_ENABLE = $d015
.label BORDERCOL = $d020
.label SPRITES_COLS = $d027
.label D011 = $d011
.const VIC_RST8 = $80
.const VIC_DEN = $10
.const VIC_RSEL = 8
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The colors of the C64
.const BLACK = 0
.const GREEN = 5
// The number of sprites in the multiplexer
.const PLEX_COUNT = $20
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
// Location of screen & sprites
.label SCREEN = $400
.label SPRITE = $2000
@ -3733,15 +3739,15 @@ loop: {
// loop::@1
// loop::@2
__b2:
// while(*RASTER!=$ff)
// [16] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto loop::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// while(VICII->RASTER!=$ff)
// [16] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto loop::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
// loop::@3
// (*BORDERCOL)++;
// [17] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
// [17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [18] (byte) loop::y_idx#3 ← (byte) loop::sin_idx#6 -- vbuxx=vbuz1
ldx.z sin_idx
// [19] phi from loop::@3 to loop::@4 [phi:loop::@3->loop::@4]
@ -3771,18 +3777,18 @@ loop: {
// sin_idx +=1
// [24] (byte) loop::sin_idx#1 ← (byte) loop::sin_idx#6 + (byte) 1 -- vbuz1=vbuz1_plus_1
inc.z sin_idx
// (*BORDERCOL)++;
// [25] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
// [25] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// plexSort()
// [26] call plexSort
// [65] phi from loop::@5 to plexSort [phi:loop::@5->plexSort]
jsr plexSort
// loop::@11
// *BORDERCOL = BLACK
// [27] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
// VICII->BORDER_COLOR = BLACK
// [27] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
lda #BLACK
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// loop::@6
__b6:
// *D011&VIC_RST8
@ -3802,10 +3808,10 @@ loop: {
// [30] phi (byte) loop::ss#5 = (byte) loop::ss#1 [phi:loop::@12->loop::@7#0] -- register_copy
// loop::@7
__b7:
// *BORDERCOL = BLACK
// [31] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
// VICII->BORDER_COLOR = BLACK
// [31] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
lda #BLACK
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// loop::plexFreeNextYpos1
// return PLEX_FREE_YPOS[plex_free_next];
// [32] (byte) loop::plexFreeNextYpos1_return#0 ← *((const byte*) PLEX_FREE_YPOS + (volatile byte) plex_free_next) -- vbuz1=pbuc1_derefidx_vbuz2
@ -3814,15 +3820,15 @@ loop: {
sta.z plexFreeNextYpos1_return
// loop::@8
__b8:
// while(*RASTER<rasterY)
// [33] if(*((const nomodify byte*) RASTER)<(byte) loop::plexFreeNextYpos1_return#0) goto loop::@8 -- _deref_pbuc1_lt_vbuz1_then_la1
lda RASTER
// while(VICII->RASTER<rasterY)
// [33] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)<(byte) loop::plexFreeNextYpos1_return#0) goto loop::@8 -- _deref_pbuc1_lt_vbuz1_then_la1
lda VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
cmp.z plexFreeNextYpos1_return
bcc __b8
// loop::@9
// (*BORDERCOL)++;
// [34] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
// [34] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// plexShowSprite()
// [35] call plexShowSprite
jsr plexShowSprite
@ -3835,10 +3841,10 @@ loop: {
cmp.z ss
bne __b7
// loop::@10
// *BORDERCOL = BLACK
// [38] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
// VICII->BORDER_COLOR = BLACK
// [38] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLACK -- _deref_pbuc1=vbuc2
lda #BLACK
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [15] phi from loop::@10 to loop::@1 [phi:loop::@10->loop::@1]
// [15] phi (byte) loop::sin_idx#6 = (byte) loop::sin_idx#1 [phi:loop::@10->loop::@1#0] -- register_copy
jmp __b2
@ -4140,11 +4146,11 @@ init: {
cpx #PLEX_COUNT-1+1
bne __b1
// init::@2
// *SPRITES_ENABLE = $ff
// [99] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
// VICII->SPRITES_ENABLE = $ff
// [99] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
// Enable & initialize sprites
lda #$ff
sta SPRITES_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
// [100] phi from init::@2 to init::@3 [phi:init::@2->init::@3]
// [100] phi (byte) init::ss#2 = (byte) 0 [phi:init::@2->init::@3#0] -- vbuxx=vbuc1
ldx #0

View File

@ -5,7 +5,6 @@
(label) @begin
(label) @end
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) D011 = (byte*) 53265
(const nomodify byte) GREEN = (byte) 5
(byte) MOS6526_CIA::INTERRUPT
@ -92,6 +91,9 @@
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = (byte) $15
(const nomodify byte) PLEX_COUNT = (byte) $20
(const byte*) PLEX_FREE_YPOS[(number) 8] = { fill( 8, 0) }
(const byte*) PLEX_PTR[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
@ -100,14 +102,13 @@
(const byte*) PLEX_SORTED_IDX[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
(const word*) PLEX_XPOS[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
(const byte*) PLEX_YPOS[(const nomodify byte) PLEX_COUNT] = { fill( PLEX_COUNT, 0) }
(const nomodify byte*) RASTER = (byte*) 53266
(const byte*) SCREEN = (byte*) 1024
(const byte*) SPRITE = (byte*) 8192
(const nomodify byte*) SPRITES_COLS = (byte*) 53287
(const nomodify byte*) SPRITES_ENABLE = (byte*) 53269
(const nomodify byte*) SPRITES_XMSB = (byte*) 53264
(const nomodify byte*) SPRITES_XPOS = (byte*) 53248
(const nomodify byte*) SPRITES_YPOS = (byte*) 53249
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(const nomodify byte) VIC_DEN = (byte) $10
(const nomodify byte) VIC_RSEL = (byte) 8
(const nomodify byte) VIC_RST8 = (byte) $80

View File

@ -2,9 +2,11 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label RASTER = $d012
.label BORDERCOL = $d020
// The VIC-II MOS 6567/6569
.label VICII = $d000
.label MUSIC = $1000
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
// kickasm
// Load the SID
.const music = LoadSid("toiletrensdyr.sid")
@ -17,17 +19,17 @@ main: {
jsr music.init
// Wait for the RASTER
__b1:
// while (*RASTER != $fd)
// while (VICII->RASTER != $fd)
lda #$fd
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b1
// (*BORDERCOL)++;
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// asm
// Play the music
jsr music.play
// (*BORDERCOL)--;
dec BORDERCOL
// (VICII->BORDER_COLOR)--;
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __b1
}
.pc = MUSIC "MUSIC"

View File

@ -19,10 +19,10 @@ main: scope:[main] from @2
asm { jsrmusic.init }
to:main::@1
main::@1: scope:[main] from main main::@1 main::@2
[7] if(*((const nomodify byte*) RASTER)!=(byte) $fd) goto main::@1
[7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fd) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
[8] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
asm { jsrmusic.play }
[10] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL)
[10] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
to:main::@1

View File

@ -15,13 +15,13 @@ main: scope:[main] from @2
asm { jsrmusic.init }
to:main::@1
main::@1: scope:[main] from main main::@1 main::@2
(bool~) main::$0 ← *((const nomodify byte*) RASTER) != (number) $fd
(bool~) main::$0 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $fd
if((bool~) main::$0) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
*((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
asm { jsrmusic.play }
*((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
if(true) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@2
@ -40,7 +40,6 @@ SYMBOL TABLE SSA
(label) @3
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
(byte) MOS6526_CIA::PORT_A_DDR
@ -126,23 +125,24 @@ SYMBOL TABLE SSA
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const nomodify byte*) MUSIC = (byte*)(number) $1000
(const nomodify byte*) RASTER = (byte*)(number) $d012
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*)(number) $d000
(void()) main()
(bool~) main::$0
(label) main::@1
(label) main::@2
(label) main::@return
Adding number conversion cast (unumber) $fd in (bool~) main::$0 ← *((const nomodify byte*) RASTER) != (number) $fd
Adding number conversion cast (unumber) $fd in (bool~) main::$0 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $fd
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
Simplifying constant pointer cast (byte*) 4096
Simplifying constant integer cast $fd
Successful SSA optimization PassNCastSimplification
Finalized unsigned number type (byte) $fd
Successful SSA optimization PassNFinalizeNumberTypeConversions
Simple Condition (bool~) main::$0 [4] if(*((const nomodify byte*) RASTER)!=(byte) $fd) goto main::@1
Simple Condition (bool~) main::$0 [4] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fd) goto main::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
if() condition always true - replacing block destination [8] if(true) goto main::@1
Successful SSA optimization Pass2ConstantIfs
@ -184,12 +184,12 @@ main: scope:[main] from @2
asm { jsrmusic.init }
to:main::@1
main::@1: scope:[main] from main main::@1 main::@2
[7] if(*((const nomodify byte*) RASTER)!=(byte) $fd) goto main::@1
[7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fd) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1
[8] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
asm { jsrmusic.play }
[10] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL)
[10] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
to:main::@1
@ -292,9 +292,11 @@ Target platform is c64basic / MOS6502X
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
.label RASTER = $d012
.label BORDERCOL = $d020
// The VIC-II MOS 6567/6569
.label VICII = $d000
.label MUSIC = $1000
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
// @begin
__bbegin:
jmp __b1
@ -328,20 +330,20 @@ main: {
// Wait for the RASTER
// main::@1
__b1:
// [7] if(*((const nomodify byte*) RASTER)!=(byte) $fd) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
// [7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fd) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$fd
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b1
jmp __b2
// main::@2
__b2:
// [8] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// asm { jsrmusic.play }
// Play the music
jsr music.play
// [10] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BORDERCOL
// [10] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __b1
}
// File Data
@ -351,7 +353,7 @@ main: {
REGISTER UPLIFT POTENTIAL REGISTERS
Statement asm { jsrmusic.init } always clobbers reg byte a reg byte x reg byte y
Statement [7] if(*((const nomodify byte*) RASTER)!=(byte) $fd) goto main::@1 [ ] ( main:4 [ ] { } ) always clobbers reg byte a
Statement [7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fd) goto main::@1 [ ] ( main:4 [ ] { } ) always clobbers reg byte a
Statement asm { jsrmusic.play } always clobbers reg byte a reg byte x reg byte y
REGISTER UPLIFT SCOPES
@ -375,9 +377,11 @@ ASSEMBLER BEFORE OPTIMIZATION
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
.label RASTER = $d012
.label BORDERCOL = $d020
// The VIC-II MOS 6567/6569
.label VICII = $d000
.label MUSIC = $1000
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
// @begin
__bbegin:
jmp __b1
@ -411,20 +415,20 @@ main: {
// Wait for the RASTER
// main::@1
__b1:
// [7] if(*((const nomodify byte*) RASTER)!=(byte) $fd) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
// [7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fd) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$fd
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b1
jmp __b2
// main::@2
__b2:
// [8] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// asm { jsrmusic.play }
// Play the music
jsr music.play
// [10] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BORDERCOL
// [10] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __b1
}
// File Data
@ -458,7 +462,6 @@ FINAL SYMBOL TABLE
(label) @2
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*) 53280
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
(byte) MOS6526_CIA::PORT_A_DDR
@ -544,7 +547,9 @@ FINAL SYMBOL TABLE
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const nomodify byte*) MUSIC = (byte*) 4096
(const nomodify byte*) RASTER = (byte*) 53266
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(void()) main()
(label) main::@1
(label) main::@2
@ -561,9 +566,11 @@ Score: 3882
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label RASTER = $d012
.label BORDERCOL = $d020
// The VIC-II MOS 6567/6569
.label VICII = $d000
.label MUSIC = $1000
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
// @begin
// @1
// kickasm
@ -588,22 +595,22 @@ main: {
// Wait for the RASTER
// main::@1
__b1:
// while (*RASTER != $fd)
// [7] if(*((const nomodify byte*) RASTER)!=(byte) $fd) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
// while (VICII->RASTER != $fd)
// [7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fd) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$fd
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b1
// main::@2
// (*BORDERCOL)++;
// [8] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
// [8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// asm
// asm { jsrmusic.play }
// Play the music
jsr music.play
// (*BORDERCOL)--;
// [10] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BORDERCOL
// (VICII->BORDER_COLOR)--;
// [10] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __b1
}
// File Data

View File

@ -2,7 +2,6 @@
(label) @2
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*) 53280
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
(byte) MOS6526_CIA::PORT_A_DDR
@ -88,7 +87,9 @@
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const nomodify byte*) MUSIC = (byte*) 4096
(const nomodify byte*) RASTER = (byte*) 53266
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(void()) main()
(label) main::@1
(label) main::@2

View File

@ -4,21 +4,21 @@
.pc = $80d "Program"
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
.label RASTER = $d012
.label BORDERCOL = $d020
.label VIC_CONTROL = $d011
// VIC II IRQ Status Register
.label IRQ_STATUS = $d019
// VIC II IRQ Enable Register
.label IRQ_ENABLE = $d01a
// Bits for the VICII IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The vector used when the KERNAL serves IRQ interrupts
.label KERNEL_IRQ = $314
.label MUSIC = $1000
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = $1a
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = $19
// kickasm
// Load the SID
.const music = LoadSid("toiletrensdyr.sid")
@ -33,18 +33,18 @@ main: {
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// *VIC_CONTROL &=$7f
// VICII->CONTROL1 &=$7f
// Set raster line to $fd
lda #$7f
and VIC_CONTROL
sta VIC_CONTROL
// *RASTER = $fd
and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// VICII->RASTER = $fd
lda #$fd
sta RASTER
// *IRQ_ENABLE = IRQ_RASTER
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// VICII->IRQ_ENABLE = IRQ_RASTER
// Enable Raster Interrupt
lda #IRQ_RASTER
sta IRQ_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE
// *KERNEL_IRQ = &irq_play
// Set the IRQ routine
lda #<irq_play
@ -58,17 +58,17 @@ main: {
}
// Raster IRQ Routine playing music
irq_play: {
// (*BORDERCOL)++;
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// asm
// Play SID
jsr music.play
// *IRQ_STATUS = IRQ_RASTER
// VICII->IRQ_STATUS = IRQ_RASTER
// Acknowledge the IRQ
lda #IRQ_RASTER
sta IRQ_STATUS
// (*BORDERCOL)--;
dec BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS
// (VICII->BORDER_COLOR)--;
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// }
jmp $ea31
}

View File

@ -18,9 +18,9 @@
main: scope:[main] from @2
asm { sei jsrmusic.init }
[7] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[8] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f
[9] *((const nomodify byte*) RASTER) ← (byte) $fd
[10] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
[8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $7f
[9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fd
[10] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
[11] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_KEYBOARD)(void()) irq_play()
asm { cli }
to:main::@return
@ -30,10 +30,10 @@ main::@return: scope:[main] from main
interrupt(KERNEL_KEYBOARD)(void()) irq_play()
irq_play: scope:[irq_play] from
[14] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[14] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
asm { jsrmusic.play }
[16] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
[17] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL)
[16] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
[17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
to:irq_play::@return
irq_play::@return: scope:[irq_play] from irq_play
[18] return

View File

@ -15,9 +15,9 @@ CONTROL FLOW GRAPH SSA
main: scope:[main] from @2
asm { sei jsrmusic.init }
*((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
*((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (number) $7f
*((const nomodify byte*) RASTER) ← (number) $fd
*((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (number) $7f
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (number) $fd
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
*((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_KEYBOARD)(void()) irq_play()
asm { cli }
to:main::@return
@ -27,10 +27,10 @@ main::@return: scope:[main] from main
interrupt(KERNEL_KEYBOARD)(void()) irq_play()
irq_play: scope:[irq_play] from
*((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
asm { jsrmusic.play }
*((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
*((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
to:irq_play::@return
irq_play::@return: scope:[irq_play] from irq_play
return
@ -48,12 +48,9 @@ SYMBOL TABLE SSA
(label) @3
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*)(number) $dc00
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) IRQ_ENABLE = (byte*)(number) $d01a
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*)(number) $d019
(const nomodify void()**) KERNEL_IRQ = (void()**)(number) $314
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
@ -141,23 +138,23 @@ SYMBOL TABLE SSA
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const nomodify byte*) MUSIC = (byte*)(number) $1000
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const nomodify byte*) RASTER = (byte*)(number) $d012
(const nomodify byte*) VIC_CONTROL = (byte*)(number) $d011
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = (byte) $11
(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = (byte) $1a
(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = (byte) $19
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*)(number) $d000
interrupt(KERNEL_KEYBOARD)(void()) irq_play()
(label) irq_play::@return
(void()) main()
(label) main::@return
Adding number conversion cast (unumber) $7f in *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (number) $7f
Adding number conversion cast (unumber) $fd in *((const nomodify byte*) RASTER) ← (number) $fd
Adding number conversion cast (unumber) $7f in *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (number) $7f
Adding number conversion cast (unumber) $fd in *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (number) $fd
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast *((const nomodify byte*) RASTER) ← (unumber)(number) $fd
Inlining cast *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (unumber)(number) $fd
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53265
Simplifying constant pointer cast (byte*) 53273
Simplifying constant pointer cast (byte*) 53274
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
Simplifying constant pointer cast (struct MOS6526_CIA*) 56320
Simplifying constant pointer cast (void()**) 788
Simplifying constant pointer cast (byte*) 4096
@ -202,9 +199,9 @@ FINAL CONTROL FLOW GRAPH
main: scope:[main] from @2
asm { sei jsrmusic.init }
[7] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[8] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f
[9] *((const nomodify byte*) RASTER) ← (byte) $fd
[10] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
[8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $7f
[9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fd
[10] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
[11] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_KEYBOARD)(void()) irq_play()
asm { cli }
to:main::@return
@ -214,10 +211,10 @@ main::@return: scope:[main] from main
interrupt(KERNEL_KEYBOARD)(void()) irq_play()
irq_play: scope:[irq_play] from
[14] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[14] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
asm { jsrmusic.play }
[16] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
[17] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL)
[16] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER
[17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
to:irq_play::@return
irq_play::@return: scope:[irq_play] from irq_play
[18] return
@ -326,21 +323,21 @@ Target platform is c64basic / MOS6502X
// Global Constants & labels
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
.label RASTER = $d012
.label BORDERCOL = $d020
.label VIC_CONTROL = $d011
// VIC II IRQ Status Register
.label IRQ_STATUS = $d019
// VIC II IRQ Enable Register
.label IRQ_ENABLE = $d01a
// Bits for the VICII IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The vector used when the KERNAL serves IRQ interrupts
.label KERNEL_IRQ = $314
.label MUSIC = $1000
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = $1a
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = $19
// @begin
__bbegin:
jmp __b1
@ -374,18 +371,18 @@ main: {
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// [8] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
// [8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
// Set raster line to $fd
lda #$7f
and VIC_CONTROL
sta VIC_CONTROL
// [9] *((const nomodify byte*) RASTER) ← (byte) $fd -- _deref_pbuc1=vbuc2
and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fd -- _deref_pbuc1=vbuc2
lda #$fd
sta RASTER
// [10] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// [10] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// Enable Raster Interrupt
lda #IRQ_RASTER
sta IRQ_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE
// [11] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_KEYBOARD)(void()) irq_play() -- _deref_pptc1=pprc2
// Set the IRQ routine
lda #<irq_play
@ -404,17 +401,17 @@ main: {
// Raster IRQ Routine playing music
irq_play: {
// entry interrupt(KERNEL_KEYBOARD)
// [14] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [14] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// asm { jsrmusic.play }
// Play SID
jsr music.play
// [16] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// [16] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// Acknowledge the IRQ
lda #IRQ_RASTER
sta IRQ_STATUS
// [17] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS
// [17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __breturn
// irq_play::@return
__breturn:
@ -429,12 +426,12 @@ irq_play: {
REGISTER UPLIFT POTENTIAL REGISTERS
Statement asm { sei jsrmusic.init } always clobbers reg byte a reg byte x reg byte y
Statement [7] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:4 [ ] { } ) always clobbers reg byte a
Statement [8] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f [ ] ( main:4 [ ] { } ) always clobbers reg byte a
Statement [9] *((const nomodify byte*) RASTER) ← (byte) $fd [ ] ( main:4 [ ] { } ) always clobbers reg byte a
Statement [10] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:4 [ ] { } ) always clobbers reg byte a
Statement [8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $7f [ ] ( main:4 [ ] { } ) always clobbers reg byte a
Statement [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fd [ ] ( main:4 [ ] { } ) always clobbers reg byte a
Statement [10] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:4 [ ] { } ) always clobbers reg byte a
Statement [11] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_KEYBOARD)(void()) irq_play() [ ] ( main:4 [ ] { } ) always clobbers reg byte a
Statement asm { jsrmusic.play } always clobbers reg byte a reg byte x reg byte y
Statement [16] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ ] ( [ ] { } ) always clobbers reg byte a
Statement [16] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER [ ] ( [ ] { } ) always clobbers reg byte a
REGISTER UPLIFT SCOPES
Uplift Scope [MOS6526_CIA]
@ -461,21 +458,21 @@ ASSEMBLER BEFORE OPTIMIZATION
// Global Constants & labels
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
.label RASTER = $d012
.label BORDERCOL = $d020
.label VIC_CONTROL = $d011
// VIC II IRQ Status Register
.label IRQ_STATUS = $d019
// VIC II IRQ Enable Register
.label IRQ_ENABLE = $d01a
// Bits for the VICII IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The vector used when the KERNAL serves IRQ interrupts
.label KERNEL_IRQ = $314
.label MUSIC = $1000
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = $1a
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = $19
// @begin
__bbegin:
jmp __b1
@ -509,18 +506,18 @@ main: {
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// [8] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
// [8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
// Set raster line to $fd
lda #$7f
and VIC_CONTROL
sta VIC_CONTROL
// [9] *((const nomodify byte*) RASTER) ← (byte) $fd -- _deref_pbuc1=vbuc2
and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fd -- _deref_pbuc1=vbuc2
lda #$fd
sta RASTER
// [10] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// [10] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// Enable Raster Interrupt
lda #IRQ_RASTER
sta IRQ_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE
// [11] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_KEYBOARD)(void()) irq_play() -- _deref_pptc1=pprc2
// Set the IRQ routine
lda #<irq_play
@ -539,17 +536,17 @@ main: {
// Raster IRQ Routine playing music
irq_play: {
// entry interrupt(KERNEL_KEYBOARD)
// [14] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [14] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// asm { jsrmusic.play }
// Play SID
jsr music.play
// [16] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// [16] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// Acknowledge the IRQ
lda #IRQ_RASTER
sta IRQ_STATUS
// [17] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS
// [17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __breturn
// irq_play::@return
__breturn:
@ -588,12 +585,9 @@ FINAL SYMBOL TABLE
(label) @2
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) IRQ_ENABLE = (byte*) 53274
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*) 53273
(const nomodify void()**) KERNEL_IRQ = (void()**) 788
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
@ -681,8 +675,12 @@ FINAL SYMBOL TABLE
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const nomodify byte*) MUSIC = (byte*) 4096
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const nomodify byte*) RASTER = (byte*) 53266
(const nomodify byte*) VIC_CONTROL = (byte*) 53265
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = (byte) $11
(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = (byte) $1a
(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = (byte) $19
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
interrupt(KERNEL_KEYBOARD)(void()) irq_play()
(label) irq_play::@return
(void()) main()
@ -702,21 +700,21 @@ Score: 2899
// Global Constants & labels
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
.label RASTER = $d012
.label BORDERCOL = $d020
.label VIC_CONTROL = $d011
// VIC II IRQ Status Register
.label IRQ_STATUS = $d019
// VIC II IRQ Enable Register
.label IRQ_ENABLE = $d01a
// Bits for the VICII IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The vector used when the KERNAL serves IRQ interrupts
.label KERNEL_IRQ = $314
.label MUSIC = $1000
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = $11
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = $1a
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = $19
// @begin
// @1
// kickasm
@ -743,21 +741,21 @@ main: {
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// *VIC_CONTROL &=$7f
// [8] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
// VICII->CONTROL1 &=$7f
// [8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2
// Set raster line to $fd
lda #$7f
and VIC_CONTROL
sta VIC_CONTROL
// *RASTER = $fd
// [9] *((const nomodify byte*) RASTER) ← (byte) $fd -- _deref_pbuc1=vbuc2
and VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL1
// VICII->RASTER = $fd
// [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) ← (byte) $fd -- _deref_pbuc1=vbuc2
lda #$fd
sta RASTER
// *IRQ_ENABLE = IRQ_RASTER
// [10] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
// VICII->IRQ_ENABLE = IRQ_RASTER
// [10] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// Enable Raster Interrupt
lda #IRQ_RASTER
sta IRQ_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE
// *KERNEL_IRQ = &irq_play
// [11] *((const nomodify void()**) KERNEL_IRQ) ← &interrupt(KERNEL_KEYBOARD)(void()) irq_play() -- _deref_pptc1=pprc2
// Set the IRQ routine
@ -777,21 +775,21 @@ main: {
// Raster IRQ Routine playing music
irq_play: {
// entry interrupt(KERNEL_KEYBOARD)
// (*BORDERCOL)++;
// [14] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
// [14] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// asm
// asm { jsrmusic.play }
// Play SID
jsr music.play
// *IRQ_STATUS = IRQ_RASTER
// [16] *((const nomodify byte*) IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// VICII->IRQ_STATUS = IRQ_RASTER
// [16] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS) ← (const nomodify byte) IRQ_RASTER -- _deref_pbuc1=vbuc2
// Acknowledge the IRQ
lda #IRQ_RASTER
sta IRQ_STATUS
// (*BORDERCOL)--;
// [17] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS
// (VICII->BORDER_COLOR)--;
// [17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// irq_play::@return
// }
// [18] return - exit interrupt(KERNEL_KEYBOARD)

View File

@ -2,12 +2,9 @@
(label) @2
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) IRQ_ENABLE = (byte*) 53274
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*) 53273
(const nomodify void()**) KERNEL_IRQ = (void()**) 788
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
@ -95,8 +92,12 @@
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const nomodify byte*) MUSIC = (byte*) 4096
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const nomodify byte*) RASTER = (byte*) 53266
(const nomodify byte*) VIC_CONTROL = (byte*) 53265
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL1 = (byte) $11
(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_ENABLE = (byte) $1a
(const byte) OFFSET_STRUCT_MOS6569_VICII_IRQ_STATUS = (byte) $19
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
interrupt(KERNEL_KEYBOARD)(void()) irq_play()
(label) irq_play::@return
(void()) main()

View File

@ -6,9 +6,10 @@
.pc = $80d "Program"
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
.label BORDERCOL = $d020
// The SID MOS 6581/8580
.label SID = $d400
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// CIA#2 Interrupt for reading in ASM
@ -19,6 +20,7 @@
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A = 4
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE = $18
.label sample = 2
__bbegin:
@ -71,8 +73,8 @@ nmi2: {
sta rega+1
stx regx+1
sty regy+1
// (*BORDERCOL)++;
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// asm
lda CIA2_INTERRUPT
// *sample >> 4
@ -105,8 +107,8 @@ nmi2: {
sta KERNEL_NMI
lda #>nmi
sta KERNEL_NMI+1
// (*BORDERCOL)--;
dec BORDERCOL
// (VICII->BORDER_COLOR)--;
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// }
rega:
lda #00
@ -120,8 +122,8 @@ nmi: {
sta rega+1
stx regx+1
sty regy+1
// (*BORDERCOL)++;
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// asm
lda CIA2_INTERRUPT
// *sample & $0f
@ -135,8 +137,8 @@ nmi: {
sta KERNEL_NMI
lda #>nmi2
sta KERNEL_NMI+1
// (*BORDERCOL)--;
dec BORDERCOL
// (VICII->BORDER_COLOR)--;
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// }
rega:
lda #00

View File

@ -28,7 +28,7 @@ main::@return: scope:[main] from main
interrupt(HARDWARE_ALL)(void()) nmi2()
nmi2: scope:[nmi2] from
[14] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[14] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
asm { ldaCIA2_INTERRUPT }
[16] (byte~) nmi2::$1 ← *((volatile byte*) sample) >> (byte) 4
[17] *((byte*)(const nomodify struct MOS6581_SID*) SID+(const byte) OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE) ← (byte~) nmi2::$1
@ -41,7 +41,7 @@ nmi2::@2: scope:[nmi2] from nmi2
to:nmi2::@1
nmi2::@1: scope:[nmi2] from nmi2 nmi2::@2
[22] *((const nomodify void()**) KERNEL_NMI) ← &interrupt(HARDWARE_ALL)(void()) nmi()
[23] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL)
[23] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
to:nmi2::@return
nmi2::@return: scope:[nmi2] from nmi2::@1
[24] return
@ -49,12 +49,12 @@ nmi2::@return: scope:[nmi2] from nmi2::@1
interrupt(HARDWARE_ALL)(void()) nmi()
nmi: scope:[nmi] from
[25] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[25] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
asm { ldaCIA2_INTERRUPT }
[27] (byte~) nmi::$1 ← *((volatile byte*) sample) & (byte) $f
[28] *((byte*)(const nomodify struct MOS6581_SID*) SID+(const byte) OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE) ← (byte~) nmi::$1
[29] *((const nomodify void()**) KERNEL_NMI) ← &interrupt(HARDWARE_ALL)(void()) nmi2()
[30] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL)
[30] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
to:nmi::@return
nmi::@return: scope:[nmi] from nmi
[31] return

View File

@ -26,12 +26,12 @@ main::@return: scope:[main] from main
interrupt(HARDWARE_ALL)(void()) nmi()
nmi: scope:[nmi] from
*((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
asm { ldaCIA2_INTERRUPT }
(number~) nmi::$1 ← *((volatile byte*) sample) & (number) $f
*((byte*)(const nomodify struct MOS6581_SID*) SID+(const byte) OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE) ← (number~) nmi::$1
*((const nomodify void()**) KERNEL_NMI) ← &interrupt(HARDWARE_ALL)(void()) nmi2()
*((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
to:nmi::@return
nmi::@return: scope:[nmi] from nmi
return
@ -39,7 +39,7 @@ nmi::@return: scope:[nmi] from nmi
interrupt(HARDWARE_ALL)(void()) nmi2()
nmi2: scope:[nmi2] from
*((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
asm { ldaCIA2_INTERRUPT }
(byte~) nmi2::$1 ← *((volatile byte*) sample) >> (number) 4
*((byte*)(const nomodify struct MOS6581_SID*) SID+(const byte) OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE) ← (byte~) nmi2::$1
@ -51,7 +51,7 @@ nmi2: scope:[nmi2] from
to:nmi2::@2
nmi2::@1: scope:[nmi2] from nmi2 nmi2::@2
*((const nomodify void()**) KERNEL_NMI) ← &interrupt(HARDWARE_ALL)(void()) nmi()
*((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
to:nmi2::@return
nmi2::@2: scope:[nmi2] from nmi2
(volatile byte*) sample ← (const byte*) SAMPLE
@ -72,7 +72,6 @@ SYMBOL TABLE SSA
(label) @3
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*)(number) $dd00
(const nomodify byte*) CIA2_INTERRUPT = (byte*)(number) $dd0d
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
@ -164,10 +163,12 @@ SYMBOL TABLE SSA
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A = (byte) 4
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = (byte) $e
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE = (byte) $18
(const byte*) SAMPLE[(const nomodify word) SAMPLE_SIZE] = kickasm {{ .import binary "moments_sample.bin" }}
(const nomodify word) SAMPLE_SIZE = (word) $6100
(const nomodify struct MOS6581_SID*) SID = (struct MOS6581_SID*)(number) $d400
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*)(number) $d000
(void()) main()
(label) main::@return
interrupt(HARDWARE_ALL)(void()) nmi()
@ -195,8 +196,8 @@ Inlining cast *((word*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OF
Inlining cast *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (unumber)(number) $81
Inlining cast *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (unumber)(number) 1
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (struct MOS6581_SID*) 54272
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
Simplifying constant pointer cast (struct MOS6526_CIA*) 56576
Simplifying constant pointer cast (byte*) 56589
Simplifying constant pointer cast (void()**) 792
@ -264,7 +265,7 @@ main::@return: scope:[main] from main
interrupt(HARDWARE_ALL)(void()) nmi2()
nmi2: scope:[nmi2] from
[14] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[14] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
asm { ldaCIA2_INTERRUPT }
[16] (byte~) nmi2::$1 ← *((volatile byte*) sample) >> (byte) 4
[17] *((byte*)(const nomodify struct MOS6581_SID*) SID+(const byte) OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE) ← (byte~) nmi2::$1
@ -277,7 +278,7 @@ nmi2::@2: scope:[nmi2] from nmi2
to:nmi2::@1
nmi2::@1: scope:[nmi2] from nmi2 nmi2::@2
[22] *((const nomodify void()**) KERNEL_NMI) ← &interrupt(HARDWARE_ALL)(void()) nmi()
[23] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL)
[23] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
to:nmi2::@return
nmi2::@return: scope:[nmi2] from nmi2::@1
[24] return
@ -285,12 +286,12 @@ nmi2::@return: scope:[nmi2] from nmi2::@1
interrupt(HARDWARE_ALL)(void()) nmi()
nmi: scope:[nmi] from
[25] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[25] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
asm { ldaCIA2_INTERRUPT }
[27] (byte~) nmi::$1 ← *((volatile byte*) sample) & (byte) $f
[28] *((byte*)(const nomodify struct MOS6581_SID*) SID+(const byte) OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE) ← (byte~) nmi::$1
[29] *((const nomodify void()**) KERNEL_NMI) ← &interrupt(HARDWARE_ALL)(void()) nmi2()
[30] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL)
[30] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
to:nmi::@return
nmi::@return: scope:[nmi] from nmi
[31] return
@ -418,9 +419,10 @@ Target platform is c64basic / MOS6502X
// Global Constants & labels
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
.label BORDERCOL = $d020
// The SID MOS 6581/8580
.label SID = $d400
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// CIA#2 Interrupt for reading in ASM
@ -431,6 +433,7 @@ Target platform is c64basic / MOS6502X
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A = 4
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE = $18
.label sample = 2
// @begin
@ -506,8 +509,8 @@ nmi2: {
sta rega+1
stx regx+1
sty regy+1
// [14] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [14] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// asm { ldaCIA2_INTERRUPT }
lda CIA2_INTERRUPT
// [16] (byte~) nmi2::$1 ← *((volatile byte*) sample) >> (byte) 4 -- vbuz1=_deref_pbuz2_ror_4
@ -549,8 +552,8 @@ nmi2: {
sta KERNEL_NMI
lda #>nmi
sta KERNEL_NMI+1
// [23] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BORDERCOL
// [23] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __breturn
// nmi2::@return
__breturn:
@ -570,8 +573,8 @@ nmi: {
sta rega+1
stx regx+1
sty regy+1
// [25] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [25] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// asm { ldaCIA2_INTERRUPT }
lda CIA2_INTERRUPT
// [27] (byte~) nmi::$1 ← *((volatile byte*) sample) & (byte) $f -- vbuz1=_deref_pbuz2_band_vbuc1
@ -587,8 +590,8 @@ nmi: {
sta KERNEL_NMI
lda #>nmi2
sta KERNEL_NMI+1
// [30] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BORDERCOL
// [30] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __breturn
// nmi::@return
__breturn:
@ -656,9 +659,10 @@ ASSEMBLER BEFORE OPTIMIZATION
// Global Constants & labels
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
.label BORDERCOL = $d020
// The SID MOS 6581/8580
.label SID = $d400
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// CIA#2 Interrupt for reading in ASM
@ -669,6 +673,7 @@ ASSEMBLER BEFORE OPTIMIZATION
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A = 4
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE = $18
.label sample = 2
// @begin
@ -742,8 +747,8 @@ nmi2: {
sta rega+1
stx regx+1
sty regy+1
// [14] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [14] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// asm { ldaCIA2_INTERRUPT }
lda CIA2_INTERRUPT
// [16] (byte~) nmi2::$1 ← *((volatile byte*) sample) >> (byte) 4 -- vbuaa=_deref_pbuz1_ror_4
@ -781,8 +786,8 @@ nmi2: {
sta KERNEL_NMI
lda #>nmi
sta KERNEL_NMI+1
// [23] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BORDERCOL
// [23] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __breturn
// nmi2::@return
__breturn:
@ -801,8 +806,8 @@ nmi: {
sta rega+1
stx regx+1
sty regy+1
// [25] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [25] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// asm { ldaCIA2_INTERRUPT }
lda CIA2_INTERRUPT
// [27] (byte~) nmi::$1 ← *((volatile byte*) sample) & (byte) $f -- vbuaa=_deref_pbuz1_band_vbuc1
@ -816,8 +821,8 @@ nmi: {
sta KERNEL_NMI
lda #>nmi2
sta KERNEL_NMI+1
// [30] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BORDERCOL
// [30] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __breturn
// nmi::@return
__breturn:
@ -863,7 +868,6 @@ FINAL SYMBOL TABLE
(label) @2
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify byte*) CIA2_INTERRUPT = (byte*) 56589
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
@ -955,10 +959,12 @@ FINAL SYMBOL TABLE
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A = (byte) 4
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = (byte) $e
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE = (byte) $18
(const byte*) SAMPLE[(const nomodify word) SAMPLE_SIZE] = kickasm {{ .import binary "moments_sample.bin" }}
(const nomodify word) SAMPLE_SIZE = (word) $6100
(const nomodify struct MOS6581_SID*) SID = (struct MOS6581_SID*) 54272
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(void()) main()
(label) main::@return
interrupt(HARDWARE_ALL)(void()) nmi()
@ -992,9 +998,10 @@ Score: 483
// Global Constants & labels
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
.label BORDERCOL = $d020
// The SID MOS 6581/8580
.label SID = $d400
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// CIA#2 Interrupt for reading in ASM
@ -1005,6 +1012,7 @@ Score: 483
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A = 4
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE = $18
.label sample = 2
// @begin
@ -1078,9 +1086,9 @@ nmi2: {
sta rega+1
stx regx+1
sty regy+1
// (*BORDERCOL)++;
// [14] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
// [14] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// asm
// asm { ldaCIA2_INTERRUPT }
lda CIA2_INTERRUPT
@ -1123,9 +1131,9 @@ nmi2: {
sta KERNEL_NMI
lda #>nmi
sta KERNEL_NMI+1
// (*BORDERCOL)--;
// [23] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BORDERCOL
// (VICII->BORDER_COLOR)--;
// [23] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// nmi2::@return
// }
// [24] return - exit interrupt(HARDWARE_ALL)
@ -1143,9 +1151,9 @@ nmi: {
sta rega+1
stx regx+1
sty regy+1
// (*BORDERCOL)++;
// [25] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
// [25] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// asm
// asm { ldaCIA2_INTERRUPT }
lda CIA2_INTERRUPT
@ -1163,9 +1171,9 @@ nmi: {
sta KERNEL_NMI
lda #>nmi2
sta KERNEL_NMI+1
// (*BORDERCOL)--;
// [30] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BORDERCOL
// (VICII->BORDER_COLOR)--;
// [30] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// nmi::@return
// }
// [31] return - exit interrupt(HARDWARE_ALL)

View File

@ -2,7 +2,6 @@
(label) @2
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify byte*) CIA2_INTERRUPT = (byte*) 56589
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
@ -94,10 +93,12 @@
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A = (byte) 4
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = (byte) $e
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6581_SID_VOLUME_FILTER_MODE = (byte) $18
(const byte*) SAMPLE[(const nomodify word) SAMPLE_SIZE] = kickasm {{ .import binary "moments_sample.bin" }}
(const nomodify word) SAMPLE_SIZE = (word) $6100
(const nomodify struct MOS6581_SID*) SID = (struct MOS6581_SID*) 54272
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(void()) main()
(label) main::@return
interrupt(HARDWARE_ALL)(void()) nmi()

View File

@ -8,13 +8,13 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label BORDERCOL = $d020
.label BGCOL = $d021
.label D018 = $d018
// SID Channel Control Register Noise Waveform
.const SID_CONTROL_NOISE = $80
// The SID MOS 6581/8580
.label SID = $d400
// The VIC-II MOS 6567/6569
.label VICII = $d000
// Color Ram
.label COLS = $d800
// The colors of the C64
@ -25,6 +25,8 @@
.const OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = $e
.const OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = $12
.const OFFSET_STRUCT_MOS6581_SID_CH3_OSC = $1b
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.label print_line_cursor = $400
.label print_char_cursor = $b
// Plasma state variables
@ -37,11 +39,11 @@ main: {
.label col = $b
// asm
sei
// *BORDERCOL = BLUE
// VICII->BORDER_COLOR = BLUE
lda #BLUE
sta BORDERCOL
// *BGCOL = BLUE
sta BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// VICII->BG_COLOR = BLUE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
lda #<COLS
sta.z col
lda #>COLS

View File

@ -11,8 +11,8 @@
(void()) main()
main: scope:[main] from @1
asm { sei }
[5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLUE
[6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLUE
[5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLUE
[6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLUE
to:main::@1
main::@1: scope:[main] from main main::@1
[7] (byte*) main::col#2 ← phi( main/(const nomodify byte*) COLS main::@1/(byte*) main::col#1 )

View File

@ -101,8 +101,8 @@ main: scope:[main] from @3
(byte*) print_char_cursor#33 ← phi( @3/(byte*) print_char_cursor#25 )
(byte*) print_line_cursor#25 ← phi( @3/(byte*) print_line_cursor#18 )
asm { sei }
*((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLUE
*((const nomodify byte*) BGCOL) ← (const nomodify byte) BLUE
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLUE
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLUE
(byte*) main::col#0 ← (const nomodify byte*) COLS
to:main::@1
main::@1: scope:[main] from main main::@1
@ -624,10 +624,8 @@ SYMBOL TABLE SSA
(label) @4
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*)(number) $d021
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte) BLUE = (byte) 6
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify byte*) CHARSET = (byte*)(number) $2000
(const nomodify byte*) COLS = (byte*)(number) $d800
(const nomodify byte*) D018 = (byte*)(number) $d018
@ -715,6 +713,8 @@ SYMBOL TABLE SSA
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = (byte) $12
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = (byte) $e
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_OSC = (byte) $1b
@ -728,6 +728,7 @@ SYMBOL TABLE SSA
(const to_nomodify byte*) SINTABLE[(number) $100] = kickasm {{ .for(var i=0;i<$100;i++)
.byte round(127.5+127.5*sin(toRadians(360*i/256)))
}}
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*)(number) $d000
(byte) c1A
(byte) c1A#0
(byte) c1A#1
@ -1309,10 +1310,9 @@ Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast *((word*)(const nomodify struct MOS6581_SID*) SID+(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_FREQ) ← (unumber)(number) $ffff
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53281
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (struct MOS6581_SID*) 54272
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
Simplifying constant pointer cast (byte*) 55296
Simplifying constant pointer cast (byte*) 10240
Simplifying constant pointer cast (byte*) 8192
@ -2574,8 +2574,8 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
asm { sei }
[5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLUE
[6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLUE
[5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLUE
[6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLUE
to:main::@1
main::@1: scope:[main] from main main::@1
[7] (byte*) main::col#2 ← phi( main/(const nomodify byte*) COLS main::@1/(byte*) main::col#1 )
@ -3260,13 +3260,13 @@ Target platform is c64basic / MOS6502X
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
.label BORDERCOL = $d020
.label BGCOL = $d021
.label D018 = $d018
// SID Channel Control Register Noise Waveform
.const SID_CONTROL_NOISE = $80
// The SID MOS 6581/8580
.label SID = $d400
// The VIC-II MOS 6567/6569
.label VICII = $d000
// Color Ram
.label COLS = $d800
// The colors of the C64
@ -3277,6 +3277,8 @@ Target platform is c64basic / MOS6502X
.const OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = $e
.const OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = $12
.const OFFSET_STRUCT_MOS6581_SID_CH3_OSC = $1b
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.label print_line_cursor = $400
.label print_char_cursor = $12
// Plasma state variables
@ -3304,12 +3306,12 @@ main: {
.label col = 2
// asm { sei }
sei
// [5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
// [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
lda #BLUE
sta BORDERCOL
// [6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
lda #BLUE
sta BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// [7] phi from main to main::@1 [phi:main->main::@1]
__b1_from_main:
// [7] phi (byte*) main::col#2 = (const nomodify byte*) COLS [phi:main->main::@1#0] -- pbuz1=pbuc1
@ -4204,8 +4206,8 @@ SINTABLE:
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLUE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLUE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLUE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLUE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [8] *((byte*) main::col#2) ← (const nomodify byte) BLACK [ main::col#2 ] ( main:2 [ main::col#2 ] { } ) always clobbers reg byte a reg byte y
Statement [10] if((byte*) main::col#1!=(const nomodify byte*) COLS+(word) $3e8+(byte) 1) goto main::@1 [ main::col#1 ] ( main:2 [ main::col#1 ] { } ) always clobbers reg byte a
Statement [14] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
@ -4275,8 +4277,8 @@ Removing always clobbered register reg byte a as potential for zp[1]:21 [ makech
Statement [128] *((byte*) print_char_cursor#18) ← (const byte) print_char::ch#0 [ print_char_cursor#18 ] ( main:2::makecharset:12::print_char:112 [ makecharset::c#2 print_char_cursor#18 ] { } ) always clobbers reg byte a reg byte y
Statement [136] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::makecharset:12::print_cls:101::memset:132 [ memset::dst#2 ] { } ) always clobbers reg byte a
Statement [138] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::makecharset:12::print_cls:101::memset:132 [ memset::dst#2 ] { } ) always clobbers reg byte a reg byte y
Statement [5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLUE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLUE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLUE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLUE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [8] *((byte*) main::col#2) ← (const nomodify byte) BLACK [ main::col#2 ] ( main:2 [ main::col#2 ] { } ) always clobbers reg byte a reg byte y
Statement [10] if((byte*) main::col#1!=(const nomodify byte*) COLS+(word) $3e8+(byte) 1) goto main::@1 [ main::col#1 ] ( main:2 [ main::col#1 ] { } ) always clobbers reg byte a
Statement [14] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
@ -4536,13 +4538,13 @@ ASSEMBLER BEFORE OPTIMIZATION
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
.label BORDERCOL = $d020
.label BGCOL = $d021
.label D018 = $d018
// SID Channel Control Register Noise Waveform
.const SID_CONTROL_NOISE = $80
// The SID MOS 6581/8580
.label SID = $d400
// The VIC-II MOS 6567/6569
.label VICII = $d000
// Color Ram
.label COLS = $d800
// The colors of the C64
@ -4553,6 +4555,8 @@ ASSEMBLER BEFORE OPTIMIZATION
.const OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = $e
.const OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = $12
.const OFFSET_STRUCT_MOS6581_SID_CH3_OSC = $1b
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.label print_line_cursor = $400
.label print_char_cursor = $b
// Plasma state variables
@ -4580,12 +4584,12 @@ main: {
.label col = $b
// asm { sei }
sei
// [5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
// [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
lda #BLUE
sta BORDERCOL
// [6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
lda #BLUE
sta BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// [7] phi from main to main::@1 [phi:main->main::@1]
__b1_from_main:
// [7] phi (byte*) main::col#2 = (const nomodify byte*) COLS [phi:main->main::@1#0] -- pbuz1=pbuc1
@ -5484,17 +5488,15 @@ Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
Fixing long branch [92] bcc __b2 to bcs
Fixing long branch [110] bcc __b5 to bcs
Fixing long branch [94] bcc __b2 to bcs
Fixing long branch [112] bcc __b5 to bcs
FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*) 53281
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte) BLUE = (byte) 6
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CHARSET = (byte*) 8192
(const nomodify byte*) COLS = (byte*) 55296
(const nomodify byte*) D018 = (byte*) 53272
@ -5582,6 +5584,8 @@ FINAL SYMBOL TABLE
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = (byte) $12
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = (byte) $e
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_OSC = (byte) $1b
@ -5595,6 +5599,7 @@ FINAL SYMBOL TABLE
(const to_nomodify byte*) SINTABLE[(number) $100] = kickasm {{ .for(var i=0;i<$100;i++)
.byte round(127.5+127.5*sin(toRadians(360*i/256)))
}}
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(byte) c1A
(byte) c1A#1 c1A zp[1]:2 161.76923076923077
(byte) c1A#3 c1A zp[1]:2 15.971014492753623
@ -5858,13 +5863,13 @@ Score: 95644
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label BORDERCOL = $d020
.label BGCOL = $d021
.label D018 = $d018
// SID Channel Control Register Noise Waveform
.const SID_CONTROL_NOISE = $80
// The SID MOS 6581/8580
.label SID = $d400
// The VIC-II MOS 6567/6569
.label VICII = $d000
// Color Ram
.label COLS = $d800
// The colors of the C64
@ -5875,6 +5880,8 @@ Score: 95644
.const OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = $e
.const OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = $12
.const OFFSET_STRUCT_MOS6581_SID_CH3_OSC = $1b
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.label print_line_cursor = $400
.label print_char_cursor = $b
// Plasma state variables
@ -5895,13 +5902,13 @@ main: {
// asm
// asm { sei }
sei
// *BORDERCOL = BLUE
// [5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
// VICII->BORDER_COLOR = BLUE
// [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
lda #BLUE
sta BORDERCOL
// *BGCOL = BLUE
// [6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
sta BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// VICII->BG_COLOR = BLUE
// [6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// [7] phi from main to main::@1 [phi:main->main::@1]
// [7] phi (byte*) main::col#2 = (const nomodify byte*) COLS [phi:main->main::@1#0] -- pbuz1=pbuc1
lda #<COLS

View File

@ -1,10 +1,8 @@
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*) 53281
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte) BLUE = (byte) 6
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CHARSET = (byte*) 8192
(const nomodify byte*) COLS = (byte*) 55296
(const nomodify byte*) D018 = (byte*) 53272
@ -92,6 +90,8 @@
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = (byte) $12
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = (byte) $e
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_OSC = (byte) $1b
@ -105,6 +105,7 @@
(const to_nomodify byte*) SINTABLE[(number) $100] = kickasm {{ .for(var i=0;i<$100;i++)
.byte round(127.5+127.5*sin(toRadians(360*i/256)))
}}
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(byte) c1A
(byte) c1A#1 c1A zp[1]:2 161.76923076923077
(byte) c1A#3 c1A zp[1]:2 15.971014492753623

View File

@ -6,13 +6,13 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label BORDERCOL = $d020
.label BGCOL = $d021
.label D018 = $d018
// SID Channel Control Register Noise Waveform
.const SID_CONTROL_NOISE = $80
// The SID MOS 6581/8580
.label SID = $d400
// The VIC-II MOS 6567/6569
.label VICII = $d000
// Color Ram
.label COLS = $d800
// The colors of the C64
@ -24,6 +24,8 @@
.const OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = $e
.const OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = $12
.const OFFSET_STRUCT_MOS6581_SID_CH3_OSC = $1b
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.label print_line_cursor = $400
.label print_char_cursor = $b
// Plasma state variables
@ -37,11 +39,11 @@ main: {
.label col = $b
// asm
sei
// *BORDERCOL = BLUE
// VICII->BORDER_COLOR = BLUE
lda #BLUE
sta BORDERCOL
// *BGCOL = BLUE
sta BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// VICII->BG_COLOR = BLUE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
lda #<COLS
sta.z col
lda #>COLS

View File

@ -11,8 +11,8 @@
(void()) main()
main: scope:[main] from @1
asm { sei }
[5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLUE
[6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLUE
[5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLUE
[6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLUE
to:main::@1
main::@1: scope:[main] from main main::@1
[7] (byte*) main::col#2 ← phi( main/(const nomodify byte*) COLS main::@1/(byte*) main::col#1 )

View File

@ -102,8 +102,8 @@ main: scope:[main] from @3
(byte*) print_char_cursor#32 ← phi( @3/(byte*) print_char_cursor#25 )
(byte*) print_line_cursor#24 ← phi( @3/(byte*) print_line_cursor#18 )
asm { sei }
*((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLUE
*((const nomodify byte*) BGCOL) ← (const nomodify byte) BLUE
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLUE
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLUE
(byte*) main::col#0 ← (const nomodify byte*) COLS
to:main::@1
main::@1: scope:[main] from main main::@1
@ -671,10 +671,8 @@ SYMBOL TABLE SSA
(label) @4
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*)(number) $d021
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte) BLUE = (byte) 6
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify byte*) CHARSET = (byte*)(number) $2000
(const nomodify byte*) COLS = (byte*)(number) $d800
(const nomodify byte*) D018 = (byte*)(number) $d018
@ -762,6 +760,8 @@ SYMBOL TABLE SSA
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = (byte) $12
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = (byte) $e
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_OSC = (byte) $1b
@ -776,6 +776,7 @@ SYMBOL TABLE SSA
(const to_nomodify byte*) SINTABLE[(number) $100] = kickasm {{ .for(var i=0;i<$100;i++)
.byte round(127.5+127.5*sin(2*PI*i/256))
}}
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*)(number) $d000
(byte) c1A
(byte) c1A#0
(byte) c1A#1
@ -1406,10 +1407,9 @@ Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast *((word*)(const nomodify struct MOS6581_SID*) SID+(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_FREQ) ← (unumber)(number) $ffff
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53281
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (struct MOS6581_SID*) 54272
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
Simplifying constant pointer cast (byte*) 55296
Simplifying constant pointer cast (byte*) 10240
Simplifying constant pointer cast (byte*) 11264
@ -1999,8 +1999,8 @@ FINAL CONTROL FLOW GRAPH
(void()) main()
main: scope:[main] from @1
asm { sei }
[5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLUE
[6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLUE
[5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLUE
[6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLUE
to:main::@1
main::@1: scope:[main] from main main::@1
[7] (byte*) main::col#2 ← phi( main/(const nomodify byte*) COLS main::@1/(byte*) main::col#1 )
@ -2506,13 +2506,13 @@ Target platform is c64basic / MOS6502X
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
.label BORDERCOL = $d020
.label BGCOL = $d021
.label D018 = $d018
// SID Channel Control Register Noise Waveform
.const SID_CONTROL_NOISE = $80
// The SID MOS 6581/8580
.label SID = $d400
// The VIC-II MOS 6567/6569
.label VICII = $d000
// Color Ram
.label COLS = $d800
// The colors of the C64
@ -2524,6 +2524,8 @@ Target platform is c64basic / MOS6502X
.const OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = $e
.const OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = $12
.const OFFSET_STRUCT_MOS6581_SID_CH3_OSC = $1b
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.label print_line_cursor = $400
.label print_char_cursor = $14
// Plasma state variables
@ -2552,12 +2554,12 @@ main: {
.label col = 2
// asm { sei }
sei
// [5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
// [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
lda #BLUE
sta BORDERCOL
// [6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
lda #BLUE
sta BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// [7] phi from main to main::@1 [phi:main->main::@1]
__b1_from_main:
// [7] phi (byte*) main::col#2 = (const nomodify byte*) COLS [phi:main->main::@1#0] -- pbuz1=pbuc1
@ -3184,8 +3186,8 @@ SINTABLE:
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLUE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLUE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLUE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLUE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [8] *((byte*) main::col#2) ← (const nomodify byte) BLACK [ main::col#2 ] ( main:2 [ main::col#2 ] { } ) always clobbers reg byte a reg byte y
Statement [10] if((byte*) main::col#1!=(const nomodify byte*) COLS+(word) $3e8+(byte) 1) goto main::@1 [ main::col#1 ] ( main:2 [ main::col#1 ] { } ) always clobbers reg byte a
Statement [17] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 [ c1A#4 c1B#4 c2A#4 c2B#4 ] ( main:2 [ c1A#4 c1B#4 c2A#4 c2B#4 ] { { c1A#10 = c1A#4 } { c1B#10 = c1B#4 } { c2A#24 = c2A#4 } { c2B#24 = c2B#4 } } ) always clobbers reg byte a
@ -3231,8 +3233,8 @@ Removing always clobbered register reg byte a as potential for zp[1]:23 [ makech
Statement [85] *((byte*) print_char_cursor#18) ← (const byte) print_char::ch#0 [ print_char_cursor#18 ] ( main:2::makecharset:12::print_char:69 [ makecharset::c#2 print_char_cursor#18 ] { } ) always clobbers reg byte a reg byte y
Statement [93] if((byte*) memset::dst#2!=(const byte*) memset::end#0) goto memset::@2 [ memset::dst#2 ] ( main:2::makecharset:12::print_cls:58::memset:89 [ memset::dst#2 ] { } ) always clobbers reg byte a
Statement [95] *((byte*) memset::dst#2) ← (const byte) memset::c#0 [ memset::dst#2 ] ( main:2::makecharset:12::print_cls:58::memset:89 [ memset::dst#2 ] { } ) always clobbers reg byte a reg byte y
Statement [5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLUE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLUE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLUE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLUE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [8] *((byte*) main::col#2) ← (const nomodify byte) BLACK [ main::col#2 ] ( main:2 [ main::col#2 ] { } ) always clobbers reg byte a reg byte y
Statement [10] if((byte*) main::col#1!=(const nomodify byte*) COLS+(word) $3e8+(byte) 1) goto main::@1 [ main::col#1 ] ( main:2 [ main::col#1 ] { } ) always clobbers reg byte a
Statement [17] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 [ c1A#4 c1B#4 c2A#4 c2B#4 ] ( main:2 [ c1A#4 c1B#4 c2A#4 c2B#4 ] { { c1A#10 = c1A#4 } { c1B#10 = c1B#4 } { c2A#24 = c2A#4 } { c2B#24 = c2B#4 } } ) always clobbers reg byte a
@ -3386,13 +3388,13 @@ ASSEMBLER BEFORE OPTIMIZATION
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
.label BORDERCOL = $d020
.label BGCOL = $d021
.label D018 = $d018
// SID Channel Control Register Noise Waveform
.const SID_CONTROL_NOISE = $80
// The SID MOS 6581/8580
.label SID = $d400
// The VIC-II MOS 6567/6569
.label VICII = $d000
// Color Ram
.label COLS = $d800
// The colors of the C64
@ -3404,6 +3406,8 @@ ASSEMBLER BEFORE OPTIMIZATION
.const OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = $e
.const OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = $12
.const OFFSET_STRUCT_MOS6581_SID_CH3_OSC = $1b
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.label print_line_cursor = $400
.label print_char_cursor = $b
// Plasma state variables
@ -3432,12 +3436,12 @@ main: {
.label col = $b
// asm { sei }
sei
// [5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
// [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
lda #BLUE
sta BORDERCOL
// [6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
lda #BLUE
sta BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// [7] phi from main to main::@1 [phi:main->main::@1]
__b1_from_main:
// [7] phi (byte*) main::col#2 = (const nomodify byte*) COLS [phi:main->main::@1#0] -- pbuz1=pbuc1
@ -4153,10 +4157,8 @@ FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*) 53281
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte) BLUE = (byte) 6
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CHARSET = (byte*) 8192
(const nomodify byte*) COLS = (byte*) 55296
(const nomodify byte*) D018 = (byte*) 53272
@ -4244,6 +4246,8 @@ FINAL SYMBOL TABLE
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = (byte) $12
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = (byte) $e
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_OSC = (byte) $1b
@ -4258,6 +4262,7 @@ FINAL SYMBOL TABLE
(const to_nomodify byte*) SINTABLE[(number) $100] = kickasm {{ .for(var i=0;i<$100;i++)
.byte round(127.5+127.5*sin(2*PI*i/256))
}}
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(byte) c1A
(byte) c1A#10 c1A zp[1]:2 220.39999999999998
(byte) c1A#14 c1A zp[1]:2 101.0
@ -4453,13 +4458,13 @@ Score: 95730
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label BORDERCOL = $d020
.label BGCOL = $d021
.label D018 = $d018
// SID Channel Control Register Noise Waveform
.const SID_CONTROL_NOISE = $80
// The SID MOS 6581/8580
.label SID = $d400
// The VIC-II MOS 6567/6569
.label VICII = $d000
// Color Ram
.label COLS = $d800
// The colors of the C64
@ -4471,6 +4476,8 @@ Score: 95730
.const OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = $e
.const OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = $12
.const OFFSET_STRUCT_MOS6581_SID_CH3_OSC = $1b
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.label print_line_cursor = $400
.label print_char_cursor = $b
// Plasma state variables
@ -4492,13 +4499,13 @@ main: {
// asm
// asm { sei }
sei
// *BORDERCOL = BLUE
// [5] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
// VICII->BORDER_COLOR = BLUE
// [5] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
lda #BLUE
sta BORDERCOL
// *BGCOL = BLUE
// [6] *((const nomodify byte*) BGCOL) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
sta BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// VICII->BG_COLOR = BLUE
// [6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (const nomodify byte) BLUE -- _deref_pbuc1=vbuc2
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// [7] phi from main to main::@1 [phi:main->main::@1]
// [7] phi (byte*) main::col#2 = (const nomodify byte*) COLS [phi:main->main::@1#0] -- pbuz1=pbuc1
lda #<COLS

View File

@ -1,10 +1,8 @@
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*) 53281
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte) BLUE = (byte) 6
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CHARSET = (byte*) 8192
(const nomodify byte*) COLS = (byte*) 55296
(const nomodify byte*) D018 = (byte*) 53272
@ -92,6 +90,8 @@
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_CONTROL = (byte) $12
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_FREQ = (byte) $e
(const byte) OFFSET_STRUCT_MOS6581_SID_CH3_OSC = (byte) $1b
@ -106,6 +106,7 @@
(const to_nomodify byte*) SINTABLE[(number) $100] = kickasm {{ .for(var i=0;i<$100;i++)
.byte round(127.5+127.5*sin(2*PI*i/256))
}}
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(byte) c1A
(byte) c1A#10 c1A zp[1]:2 220.39999999999998
(byte) c1A#14 c1A zp[1]:2 101.0

View File

@ -1,21 +1,23 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label RASTER = $d012
.label BORDERCOL = $d020
.label BGCOL = $d021
// The VIC-II MOS 6567/6569
.label VICII = $d000
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
main: {
// asm
sei
__b1:
// while (*RASTER!=$a)
// while (VICII->RASTER!=$a)
lda #$a
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b1
__b2:
// while (*RASTER!=$b)
// while (VICII->RASTER!=$b)
lda #$b
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
// raster()
jsr raster
@ -46,10 +48,10 @@ raster: {
lda rastercols
ldx #0
__b1:
// *BGCOL = col
sta BGCOL
// *BORDERCOL = col
sta BORDERCOL
// VICII->BG_COLOR = col
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// VICII->BORDER_COLOR = col
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// col = rastercols[++i];
inx
// col = rastercols[++i]

View File

@ -13,10 +13,10 @@ main: scope:[main] from @1
asm { sei }
to:main::@1
main::@1: scope:[main] from main main::@1 main::@3
[5] if(*((const nomodify byte*) RASTER)!=(byte) $a) goto main::@1
[5] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $a) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[6] if(*((const nomodify byte*) RASTER)!=(byte) $b) goto main::@2
[6] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $b) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
[7] phi()
@ -31,8 +31,8 @@ raster: scope:[raster] from main::@3
raster::@1: scope:[raster] from raster raster::@1
[11] (byte) raster::i#2 ← phi( raster/(byte) 0 raster::@1/(byte) raster::i#1 )
[11] (byte) raster::col#2 ← phi( raster/(byte) raster::col#0 raster::@1/(byte) raster::col#1 )
[12] *((const nomodify byte*) BGCOL) ← (byte) raster::col#2
[13] *((const nomodify byte*) BORDERCOL) ← (byte) raster::col#2
[12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (byte) raster::col#2
[13] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) raster::col#2
[14] (byte) raster::i#1 ← ++ (byte) raster::i#2
[15] (byte) raster::col#1 ← *((const byte*) rastercols + (byte) raster::i#1)
asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }

View File

@ -9,11 +9,11 @@ main: scope:[main] from @1
asm { sei }
to:main::@1
main::@1: scope:[main] from main main::@1 main::@4
(bool~) main::$0 ← *((const nomodify byte*) RASTER) != (number) $a
(bool~) main::$0 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $a
if((bool~) main::$0) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
(bool~) main::$1 ← *((const nomodify byte*) RASTER) != (number) $b
(bool~) main::$1 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $b
if((bool~) main::$1) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
@ -35,8 +35,8 @@ raster: scope:[raster] from main::@3
raster::@1: scope:[raster] from raster raster::@1
(byte) raster::i#2 ← phi( raster/(byte) raster::i#0 raster::@1/(byte) raster::i#1 )
(byte) raster::col#2 ← phi( raster/(byte) raster::col#0 raster::@1/(byte) raster::col#1 )
*((const nomodify byte*) BGCOL) ← (byte) raster::col#2
*((const nomodify byte*) BORDERCOL) ← (byte) raster::col#2
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (byte) raster::col#2
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) raster::col#2
(byte) raster::i#1 ← ++ (byte) raster::i#2
(byte) raster::col#1 ← *((const byte*) rastercols + (byte) raster::i#1)
asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
@ -58,8 +58,6 @@ SYMBOL TABLE SSA
(label) @2
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*)(number) $d021
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
(byte) MOS6526_CIA::PORT_A_DDR
@ -144,7 +142,10 @@ SYMBOL TABLE SSA
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const nomodify byte*) RASTER = (byte*)(number) $d012
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*)(number) $d000
(void()) main()
(bool~) main::$0
(bool~) main::$1
@ -167,13 +168,11 @@ SYMBOL TABLE SSA
(byte) raster::i#2
(const byte*) rastercols[] = { (byte) $b, (byte) 0, (byte) $b, (byte) $b, (byte) $c, (byte) $b, (byte) $c, (byte) $c, (byte) $f, (byte) $c, (byte) $f, (byte) $f, (byte) 1, (byte) $f, (byte) 1, (byte) 1, (byte) $f, (byte) 1, (byte) $f, (byte) $f, (byte) $c, (byte) $f, (byte) $c, (byte) $c, (byte) $b, (byte) $c, (byte) $b, (byte) $b, (byte) 0, (byte) $b, (byte) 0, (byte) $ff }
Adding number conversion cast (unumber) $a in (bool~) main::$0 ← *((const nomodify byte*) RASTER) != (number) $a
Adding number conversion cast (unumber) $b in (bool~) main::$1 ← *((const nomodify byte*) RASTER) != (number) $b
Adding number conversion cast (unumber) $a in (bool~) main::$0 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $a
Adding number conversion cast (unumber) $b in (bool~) main::$1 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $b
Adding number conversion cast (unumber) $ff in (bool~) raster::$0 ← (byte) raster::col#1 != (number) $ff
Successful SSA optimization PassNAddNumberTypeConversions
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53281
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
Simplifying constant integer cast $a
Simplifying constant integer cast $b
Simplifying constant integer cast $ff
@ -182,8 +181,8 @@ Finalized unsigned number type (byte) $a
Finalized unsigned number type (byte) $b
Finalized unsigned number type (byte) $ff
Successful SSA optimization PassNFinalizeNumberTypeConversions
Simple Condition (bool~) main::$0 [2] if(*((const nomodify byte*) RASTER)!=(byte) $a) goto main::@1
Simple Condition (bool~) main::$1 [4] if(*((const nomodify byte*) RASTER)!=(byte) $b) goto main::@2
Simple Condition (bool~) main::$0 [2] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $a) goto main::@1
Simple Condition (bool~) main::$1 [4] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $b) goto main::@2
Simple Condition (bool~) raster::$0 [18] if((byte) raster::col#1!=(byte) $ff) goto raster::@1
Successful SSA optimization Pass2ConditionalJumpSimplification
Constant (const byte) raster::i#0 = 0
@ -237,10 +236,10 @@ main: scope:[main] from @1
asm { sei }
to:main::@1
main::@1: scope:[main] from main main::@1 main::@3
[5] if(*((const nomodify byte*) RASTER)!=(byte) $a) goto main::@1
[5] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $a) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[6] if(*((const nomodify byte*) RASTER)!=(byte) $b) goto main::@2
[6] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $b) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
[7] phi()
@ -255,8 +254,8 @@ raster: scope:[raster] from main::@3
raster::@1: scope:[raster] from raster raster::@1
[11] (byte) raster::i#2 ← phi( raster/(byte) 0 raster::@1/(byte) raster::i#1 )
[11] (byte) raster::col#2 ← phi( raster/(byte) raster::col#0 raster::@1/(byte) raster::col#1 )
[12] *((const nomodify byte*) BGCOL) ← (byte) raster::col#2
[13] *((const nomodify byte*) BORDERCOL) ← (byte) raster::col#2
[12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (byte) raster::col#2
[13] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) raster::col#2
[14] (byte) raster::i#1 ← ++ (byte) raster::i#2
[15] (byte) raster::col#1 ← *((const byte*) rastercols + (byte) raster::i#1)
asm { nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop }
@ -379,9 +378,11 @@ Target platform is c64basic / MOS6502X
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
.label RASTER = $d012
.label BORDERCOL = $d020
.label BGCOL = $d021
// The VIC-II MOS 6567/6569
.label VICII = $d000
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -403,16 +404,16 @@ main: {
jmp __b1
// main::@1
__b1:
// [5] if(*((const nomodify byte*) RASTER)!=(byte) $a) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
// [5] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $a) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$a
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b1
jmp __b2
// main::@2
__b2:
// [6] if(*((const nomodify byte*) RASTER)!=(byte) $b) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// [6] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $b) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$b
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
// [7] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
__b3_from___b2:
@ -464,12 +465,12 @@ raster: {
jmp __b1
// raster::@1
__b1:
// [12] *((const nomodify byte*) BGCOL) ← (byte) raster::col#2 -- _deref_pbuc1=vbuz1
// [12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (byte) raster::col#2 -- _deref_pbuc1=vbuz1
lda.z col
sta BGCOL
// [13] *((const nomodify byte*) BORDERCOL) ← (byte) raster::col#2 -- _deref_pbuc1=vbuz1
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// [13] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) raster::col#2 -- _deref_pbuc1=vbuz1
lda.z col
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [14] (byte) raster::i#1 ← ++ (byte) raster::i#2 -- vbuz1=_inc_vbuz1
inc.z i
// [15] (byte) raster::col#1 ← *((const byte*) rastercols + (byte) raster::i#1) -- vbuz1=pbuc1_derefidx_vbuz2
@ -513,8 +514,8 @@ raster: {
rastercols: .byte $b, 0, $b, $b, $c, $b, $c, $c, $f, $c, $f, $f, 1, $f, 1, 1, $f, 1, $f, $f, $c, $f, $c, $c, $b, $c, $b, $b, 0, $b, 0, $ff
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [5] if(*((const nomodify byte*) RASTER)!=(byte) $a) goto main::@1 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] if(*((const nomodify byte*) RASTER)!=(byte) $b) goto main::@2 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [5] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $a) goto main::@1 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $b) goto main::@2 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Potential registers zp[1]:2 [ raster::col#2 raster::col#0 raster::col#1 ] : zp[1]:2 , reg byte a , reg byte x , reg byte y ,
Potential registers zp[1]:3 [ raster::i#2 raster::i#1 ] : zp[1]:3 , reg byte a , reg byte x , reg byte y ,
@ -540,9 +541,11 @@ ASSEMBLER BEFORE OPTIMIZATION
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
.label RASTER = $d012
.label BORDERCOL = $d020
.label BGCOL = $d021
// The VIC-II MOS 6567/6569
.label VICII = $d000
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -564,16 +567,16 @@ main: {
jmp __b1
// main::@1
__b1:
// [5] if(*((const nomodify byte*) RASTER)!=(byte) $a) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
// [5] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $a) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$a
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b1
jmp __b2
// main::@2
__b2:
// [6] if(*((const nomodify byte*) RASTER)!=(byte) $b) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// [6] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $b) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$b
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
// [7] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
__b3_from___b2:
@ -621,10 +624,10 @@ raster: {
jmp __b1
// raster::@1
__b1:
// [12] *((const nomodify byte*) BGCOL) ← (byte) raster::col#2 -- _deref_pbuc1=vbuaa
sta BGCOL
// [13] *((const nomodify byte*) BORDERCOL) ← (byte) raster::col#2 -- _deref_pbuc1=vbuaa
sta BORDERCOL
// [12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (byte) raster::col#2 -- _deref_pbuc1=vbuaa
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// [13] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) raster::col#2 -- _deref_pbuc1=vbuaa
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [14] (byte) raster::i#1 ← ++ (byte) raster::i#2 -- vbuxx=_inc_vbuxx
inx
// [15] (byte) raster::col#1 ← *((const byte*) rastercols + (byte) raster::i#1) -- vbuaa=pbuc1_derefidx_vbuxx
@ -697,8 +700,6 @@ FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*) 53281
(const nomodify byte*) BORDERCOL = (byte*) 53280
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
(byte) MOS6526_CIA::PORT_A_DDR
@ -783,7 +784,10 @@ FINAL SYMBOL TABLE
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const nomodify byte*) RASTER = (byte*) 53266
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(void()) main()
(label) main::@1
(label) main::@2
@ -813,9 +817,11 @@ Score: 8340
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
.label RASTER = $d012
.label BORDERCOL = $d020
.label BGCOL = $d021
// The VIC-II MOS 6567/6569
.label VICII = $d000
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
// @begin
// [1] phi from @begin to @1 [phi:@begin->@1]
// @1
@ -829,17 +835,17 @@ main: {
sei
// main::@1
__b1:
// while (*RASTER!=$a)
// [5] if(*((const nomodify byte*) RASTER)!=(byte) $a) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
// while (VICII->RASTER!=$a)
// [5] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $a) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$a
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b1
// main::@2
__b2:
// while (*RASTER!=$b)
// [6] if(*((const nomodify byte*) RASTER)!=(byte) $b) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// while (VICII->RASTER!=$b)
// [6] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $b) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$b
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
// [7] phi from main::@2 to main::@3 [phi:main::@2->main::@3]
// main::@3
@ -883,12 +889,12 @@ raster: {
// [11] phi (byte) raster::col#2 = (byte) raster::col#1 [phi:raster::@1->raster::@1#1] -- register_copy
// raster::@1
__b1:
// *BGCOL = col
// [12] *((const nomodify byte*) BGCOL) ← (byte) raster::col#2 -- _deref_pbuc1=vbuaa
sta BGCOL
// *BORDERCOL = col
// [13] *((const nomodify byte*) BORDERCOL) ← (byte) raster::col#2 -- _deref_pbuc1=vbuaa
sta BORDERCOL
// VICII->BG_COLOR = col
// [12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← (byte) raster::col#2 -- _deref_pbuc1=vbuaa
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// VICII->BORDER_COLOR = col
// [13] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (byte) raster::col#2 -- _deref_pbuc1=vbuaa
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// col = rastercols[++i];
// [14] (byte) raster::i#1 ← ++ (byte) raster::i#2 -- vbuxx=_inc_vbuxx
inx

View File

@ -1,8 +1,6 @@
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*) 53281
(const nomodify byte*) BORDERCOL = (byte*) 53280
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
(byte) MOS6526_CIA::PORT_A_DDR
@ -87,7 +85,10 @@
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const nomodify byte*) RASTER = (byte*) 53266
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(void()) main()
(label) main::@1
(label) main::@2

View File

@ -8,11 +8,9 @@
.const CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = $40
.label SPRITES_XPOS = $d000
.label SPRITES_YPOS = $d001
.label SPRITES_XMSB = $d010
.label RASTER = $d012
.label SPRITES_ENABLE = $d015
.label BORDERCOL = $d020
.label SPRITES_COLS = $d027
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// CIA#2 timer A&B as one single 32-bit value
@ -24,6 +22,10 @@
.const CLOCKS_PER_INIT = $12
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB = $10
.label SCREEN = $400
.label COS = SIN+$40
// A single sprite
@ -61,12 +63,12 @@ anim: {
lda #0
sta.z angle
__b2:
// while(*RASTER!=$ff)
// while(VICII->RASTER!=$ff)
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
// (*BORDERCOL)++;
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// clock_start()
jsr clock_start
lda #0
@ -191,9 +193,9 @@ anim: {
beq !__b4+
jmp __b4
!__b4:
// *SPRITES_XMSB = sprite_msb
// VICII->SPRITES_XMSB = sprite_msb
lda.z sprite_msb
sta SPRITES_XMSB
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB
// angle++;
inc.z angle
// clock()
@ -215,9 +217,9 @@ anim: {
// print_ulong_at(cyclecount, SCREEN)
// Print cycle count
jsr print_ulong_at
// *BORDERCOL = LIGHT_BLUE
// VICII->BORDER_COLOR = LIGHT_BLUE
lda #LIGHT_BLUE
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __b2
}
// Print a unsigned long as HEX at a specific position
@ -451,9 +453,9 @@ init: {
.label sprites_ptr = SCREEN+$3f8
// mulf_init()
jsr mulf_init
// *SPRITES_ENABLE = %11111111
// VICII->SPRITES_ENABLE = %11111111
lda #$ff
sta SPRITES_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
ldx #0
__b1:
// sprites_ptr[i] = (char)(SPRITE/$40)

View File

@ -33,10 +33,10 @@ anim::@1: scope:[anim] from anim anim::@15
[10] (byte) anim::angle#9 ← phi( anim/(byte) 0 anim::@15/(byte) anim::angle#1 )
to:anim::@2
anim::@2: scope:[anim] from anim::@1 anim::@2
[11] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2
[11] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2
to:anim::@3
anim::@3: scope:[anim] from anim::@2
[12] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[13] call clock_start
to:anim::@4
anim::@4: scope:[anim] from anim::@3 anim::@5
@ -103,7 +103,7 @@ anim::@5: scope:[anim] from anim::@13 anim::@6
[53] if((byte) anim::i#1!=(byte) 8) goto anim::@4
to:anim::@7
anim::@7: scope:[anim] from anim::@5
[54] *((const nomodify byte*) SPRITES_XMSB) ← (byte) anim::sprite_msb#5
[54] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB) ← (byte) anim::sprite_msb#5
[55] (byte) anim::angle#1 ← ++ (byte) anim::angle#9
[56] call clock
[57] (dword) clock::return#2 ← (dword) clock::return#0
@ -115,7 +115,7 @@ anim::@14: scope:[anim] from anim::@7
[61] call print_ulong_at
to:anim::@15
anim::@15: scope:[anim] from anim::@14
[62] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE
[62] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE
to:anim::@1
(void()) print_ulong_at((dword) print_ulong_at::dw , (byte*) print_ulong_at::at)
@ -255,7 +255,7 @@ init: scope:[init] from main
[122] call mulf_init
to:init::@2
init::@2: scope:[init] from init
[123] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff
[123] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff
to:init::@1
init::@1: scope:[init] from init::@1 init::@2
[124] (byte) init::i#2 ← phi( init::@1/(byte) init::i#1 init::@2/(byte) 0 )

View File

@ -307,7 +307,7 @@ init: scope:[init] from main
call mulf_init
to:init::@2
init::@2: scope:[init] from init
*((const nomodify byte*) SPRITES_ENABLE) ← (number) $ff
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (number) $ff
(byte*~) init::$1 ← (const byte*) SCREEN + (number) $3f8
(byte*) init::sprites_ptr#0 ← (byte*~) init::$1
(byte) init::i#0 ← (byte) 0
@ -336,12 +336,12 @@ anim::@1: scope:[anim] from anim anim::@18
to:anim::@return
anim::@2: scope:[anim] from anim::@1 anim::@2
(byte) anim::angle#6 ← phi( anim::@1/(byte) anim::angle#9 anim::@2/(byte) anim::angle#6 )
(bool~) anim::$0 ← *((const nomodify byte*) RASTER) != (number) $ff
(bool~) anim::$0 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $ff
if((bool~) anim::$0) goto anim::@2
to:anim::@3
anim::@3: scope:[anim] from anim::@2
(byte) anim::angle#4 ← phi( anim::@2/(byte) anim::angle#6 )
*((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
call clock_start
to:anim::@10
anim::@10: scope:[anim] from anim::@3
@ -539,7 +539,7 @@ anim::@6: scope:[anim] from anim::@16
anim::@7: scope:[anim] from anim::@5
(byte) anim::angle#3 ← phi( anim::@5/(byte) anim::angle#5 )
(byte) anim::sprite_msb#5 ← phi( anim::@5/(byte) anim::sprite_msb#7 )
*((const nomodify byte*) SPRITES_XMSB) ← (byte) anim::sprite_msb#5
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB) ← (byte) anim::sprite_msb#5
(byte) anim::angle#1 ← ++ (byte) anim::angle#3
call clock
(dword) clock::return#2 ← (dword) clock::return#1
@ -556,7 +556,7 @@ anim::@17: scope:[anim] from anim::@7
to:anim::@18
anim::@18: scope:[anim] from anim::@17
(byte) anim::angle#11 ← phi( anim::@17/(byte) anim::angle#14 )
*((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE
to:anim::@1
anim::@return: scope:[anim] from anim::@1
return
@ -578,7 +578,6 @@ SYMBOL TABLE SSA
(label) @2
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*)(number) $dd00
(const nomodify dword*) CIA2_TIMER_AB = (dword*)(number) $dd04
(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES = (byte) 0
@ -676,21 +675,23 @@ SYMBOL TABLE SSA
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = (byte) $e
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = (byte) $f
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = (byte) $15
(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB = (byte) $10
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10
(const byte) RADIX::OCTAL = (number) 8
(const nomodify byte*) RASTER = (byte*)(number) $d012
(const byte*) SCREEN = (byte*)(number) $400
(const byte*) SIN[(number) $140] = kickasm {{ .for(var i=0;i<$140;i++)
.byte >round($7fff*sin(i*2*PI/256))
}}
(const byte*) SPRITE = (byte*)(number) $3000
(const nomodify byte*) SPRITES_COLS = (byte*)(number) $d027
(const nomodify byte*) SPRITES_ENABLE = (byte*)(number) $d015
(const nomodify byte*) SPRITES_XMSB = (byte*)(number) $d010
(const nomodify byte*) SPRITES_XPOS = (byte*)(number) $d000
(const nomodify byte*) SPRITES_YPOS = (byte*)(number) $d001
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*)(number) $d000
(void()) anim()
(bool~) anim::$0
(number~) anim::$10
@ -1160,10 +1161,10 @@ Adding number conversion cast (unumber) 4 in (byte~) print_uchar_at::$0 ← (byt
Adding number conversion cast (unumber) $f in (number~) print_uchar_at::$2 ← (byte) print_uchar_at::b#3 & (number) $f
Adding number conversion cast (unumber) print_uchar_at::$2 in (number~) print_uchar_at::$2 ← (byte) print_uchar_at::b#3 & (unumber)(number) $f
Adding number conversion cast (unumber) 1 in (byte*~) print_uchar_at::$3 ← (byte*) print_uchar_at::at#3 + (number) 1
Adding number conversion cast (unumber) $ff in *((const nomodify byte*) SPRITES_ENABLE) ← (number) $ff
Adding number conversion cast (unumber) $ff in *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (number) $ff
Adding number conversion cast (unumber) $3f8 in (byte*~) init::$1 ← (const byte*) SCREEN + (number) $3f8
Adding number conversion cast (unumber) $40 in (byte*~) init::$2 ← (const byte*) SPRITE / (number) $40
Adding number conversion cast (unumber) $ff in (bool~) anim::$0 ← *((const nomodify byte*) RASTER) != (number) $ff
Adding number conversion cast (unumber) $ff in (bool~) anim::$0 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $ff
Adding number conversion cast (snumber) 2 in (number~) anim::$5 ← (signed word~) anim::$4 * (number) 2
Adding number conversion cast (snumber) anim::$5 in (number~) anim::$5 ← (signed word~) anim::$4 * (snumber)(number) 2
Adding number conversion cast (snumber) 2 in (number~) anim::$7 ← (signed word~) anim::$6 * (number) 2
@ -1189,15 +1190,12 @@ Adding number conversion cast (unumber) $80 in (byte) anim::sprite_msb#2 ← (by
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte) mulf_init::dir#1 ← (unumber)(number) 1
Inlining cast *((const nomodify dword*) CIA2_TIMER_AB) ← (unumber)(number) $ffffffff
Inlining cast *((const nomodify byte*) SPRITES_ENABLE) ← (unumber)(number) $ff
Inlining cast *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (unumber)(number) $ff
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53248
Simplifying constant pointer cast (byte*) 53249
Simplifying constant pointer cast (byte*) 53264
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 53269
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53287
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
Simplifying constant pointer cast (struct MOS6526_CIA*) 56576
Simplifying constant pointer cast (dword*) 56580
Simplifying constant pointer cast (byte*) 253
@ -1398,7 +1396,7 @@ Simple Condition (bool~) mulf_init::$10 [34] if((byte) mulf_init::x_255#1!=(byte
Simple Condition (bool~) mulf8s_prepared::$2 [56] if(*((const nomodify signed byte*) mulf8s_prepared::memA)>=(signed byte) 0) goto mulf8s_prepared::@1
Simple Condition (bool~) mulf8s_prepared::$4 [59] if((signed byte) mulf8s_prepared::b#4>=(signed byte) 0) goto mulf8s_prepared::@2
Simple Condition (bool~) init::$3 [122] if((byte) init::i#1!=rangelast(0,7)) goto init::@1
Simple Condition (bool~) anim::$0 [129] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2
Simple Condition (bool~) anim::$0 [129] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2
Simple Condition (bool~) anim::$19 [172] if((byte~) anim::$17==(byte) 0) goto anim::@5
Simple Condition (bool~) anim::$25 [183] if((byte) anim::i#1!=rangelast(0,7)) goto anim::@4
Successful SSA optimization Pass2ConditionalJumpSimplification
@ -1671,10 +1669,10 @@ anim::@1: scope:[anim] from anim anim::@15
[10] (byte) anim::angle#9 ← phi( anim/(byte) 0 anim::@15/(byte) anim::angle#1 )
to:anim::@2
anim::@2: scope:[anim] from anim::@1 anim::@2
[11] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2
[11] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2
to:anim::@3
anim::@3: scope:[anim] from anim::@2
[12] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[13] call clock_start
to:anim::@4
anim::@4: scope:[anim] from anim::@3 anim::@5
@ -1741,7 +1739,7 @@ anim::@5: scope:[anim] from anim::@13 anim::@6
[53] if((byte) anim::i#1!=(byte) 8) goto anim::@4
to:anim::@7
anim::@7: scope:[anim] from anim::@5
[54] *((const nomodify byte*) SPRITES_XMSB) ← (byte) anim::sprite_msb#5
[54] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB) ← (byte) anim::sprite_msb#5
[55] (byte) anim::angle#1 ← ++ (byte) anim::angle#9
[56] call clock
[57] (dword) clock::return#2 ← (dword) clock::return#0
@ -1753,7 +1751,7 @@ anim::@14: scope:[anim] from anim::@7
[61] call print_ulong_at
to:anim::@15
anim::@15: scope:[anim] from anim::@14
[62] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE
[62] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE
to:anim::@1
(void()) print_ulong_at((dword) print_ulong_at::dw , (byte*) print_ulong_at::at)
@ -1893,7 +1891,7 @@ init: scope:[init] from main
[122] call mulf_init
to:init::@2
init::@2: scope:[init] from init
[123] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff
[123] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff
to:init::@1
init::@1: scope:[init] from init::@1 init::@2
[124] (byte) init::i#2 ← phi( init::@1/(byte) init::i#1 init::@2/(byte) 0 )
@ -2396,11 +2394,9 @@ Target platform is c64basic / MOS6502X
.const CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = $40
.label SPRITES_XPOS = $d000
.label SPRITES_YPOS = $d001
.label SPRITES_XMSB = $d010
.label RASTER = $d012
.label SPRITES_ENABLE = $d015
.label BORDERCOL = $d020
.label SPRITES_COLS = $d027
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// CIA#2 timer A&B as one single 32-bit value
@ -2412,6 +2408,10 @@ Target platform is c64basic / MOS6502X
.const CLOCKS_PER_INIT = $12
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB = $10
.label SCREEN = $400
.label COS = SIN+$40
// A single sprite
@ -2491,15 +2491,15 @@ anim: {
jmp __b2
// anim::@2
__b2:
// [11] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// [11] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
jmp __b3
// anim::@3
__b3:
// [12] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [13] call clock_start
jsr clock_start
// [14] phi from anim::@3 to anim::@4 [phi:anim::@3->anim::@4]
@ -2736,9 +2736,9 @@ anim: {
jmp __b7
// anim::@7
__b7:
// [54] *((const nomodify byte*) SPRITES_XMSB) ← (byte) anim::sprite_msb#5 -- _deref_pbuc1=vbuz1
// [54] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB) ← (byte) anim::sprite_msb#5 -- _deref_pbuc1=vbuz1
lda.z sprite_msb
sta SPRITES_XMSB
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB
// [55] (byte) anim::angle#1 ← ++ (byte) anim::angle#9 -- vbuz1=_inc_vbuz1
inc.z angle
// [56] call clock
@ -2793,9 +2793,9 @@ anim: {
jmp __b15
// anim::@15
__b15:
// [62] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE -- _deref_pbuc1=vbuc2
// [62] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE -- _deref_pbuc1=vbuc2
lda #LIGHT_BLUE
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [10] phi from anim::@15 to anim::@1 [phi:anim::@15->anim::@1]
__b1_from___b15:
// [10] phi (byte) anim::angle#9 = (byte) anim::angle#1 [phi:anim::@15->anim::@1#0] -- register_copy
@ -3183,9 +3183,9 @@ init: {
jmp __b2
// init::@2
__b2:
// [123] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
// [123] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
lda #$ff
sta SPRITES_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
// [124] phi from init::@2 to init::@1 [phi:init::@2->init::@1]
__b1_from___b2:
// [124] phi (byte) init::i#2 = (byte) 0 [phi:init::@2->init::@1#0] -- vbuz1=vbuc1
@ -3478,7 +3478,7 @@ SIN:
REGISTER UPLIFT POTENTIAL REGISTERS
Equivalence Class zp[1]:60 [ anim::$21 ] has ALU potential.
Statement [11] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2 [ anim::angle#9 ] ( main:2::anim:7 [ anim::angle#9 ] { } ) always clobbers reg byte a
Statement [11] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2 [ anim::angle#9 ] ( main:2::anim:7 [ anim::angle#9 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ anim::angle#9 anim::angle#1 ]
Statement [21] (signed word~) anim::$4 ← (signed word)(word) mulf8s_prepared::m#4 [ anim::angle#9 anim::i#10 anim::sprite_msb#10 anim::x#0 anim::y#0 anim::$4 ] ( main:2::anim:7 [ anim::angle#9 anim::i#10 anim::sprite_msb#10 anim::x#0 anim::y#0 anim::$4 ] { { mulf8s_prepared::b#1 = mulf8s_prepared::b#4 anim::y#0 } } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:3 [ anim::i#10 anim::i#1 ]
@ -3506,7 +3506,7 @@ Statement [57] (dword) clock::return#2 ← (dword) clock::return#0 [ anim::angle
Statement [58] (dword~) anim::$26 ← (dword) clock::return#2 [ anim::angle#1 anim::$26 ] ( main:2::anim:7 [ anim::angle#1 anim::$26 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } } ) always clobbers reg byte a
Statement [59] (dword) anim::cyclecount#0 ← (dword~) anim::$26 - (const nomodify dword) CLOCKS_PER_INIT [ anim::angle#1 anim::cyclecount#0 ] ( main:2::anim:7 [ anim::angle#1 anim::cyclecount#0 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } } ) always clobbers reg byte a
Statement [60] (dword) print_ulong_at::dw#0 ← (dword) anim::cyclecount#0 [ anim::angle#1 print_ulong_at::dw#0 ] ( main:2::anim:7 [ anim::angle#1 print_ulong_at::dw#0 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } } ) always clobbers reg byte a
Statement [62] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE [ anim::angle#1 ] ( main:2::anim:7 [ anim::angle#1 ] { } ) always clobbers reg byte a
Statement [62] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE [ anim::angle#1 ] ( main:2::anim:7 [ anim::angle#1 ] { } ) always clobbers reg byte a
Statement [63] (word) print_uint_at::w#0 ← > (dword) print_ulong_at::dw#0 [ print_ulong_at::dw#0 print_uint_at::w#0 ] ( main:2::anim:7::print_ulong_at:61 [ anim::angle#1 print_ulong_at::dw#0 print_uint_at::w#0 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } { print_uint_at::w#0 = print_uint_at::w#2 } } ) always clobbers reg byte a
Statement [65] (word) print_uint_at::w#1 ← < (dword) print_ulong_at::dw#0 [ print_uint_at::w#1 ] ( main:2::anim:7::print_ulong_at:61 [ anim::angle#1 print_uint_at::w#1 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } { print_uint_at::w#1 = print_uint_at::w#2 } } ) always clobbers reg byte a
Statement [70] (byte*) print_uchar_at::at#0 ← (byte*) print_uint_at::at#2 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#0 print_uchar_at::at#0 ] ( main:2::anim:7::print_ulong_at:61::print_uint_at:64 [ anim::angle#1 print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#0 print_uchar_at::at#0 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } } main:2::anim:7::print_ulong_at:61::print_uint_at:66 [ anim::angle#1 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#0 print_uchar_at::at#0 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } } ) always clobbers reg byte a
@ -3539,7 +3539,7 @@ Statement [116] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte)
Statement [117] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff [ ] ( main:2::anim:7::clock_start:13 [ anim::angle#9 ] { } ) always clobbers reg byte a
Statement [118] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::anim:7::clock_start:13 [ anim::angle#9 ] { } ) always clobbers reg byte a
Statement [119] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START [ ] ( main:2::anim:7::clock_start:13 [ anim::angle#9 ] { } ) always clobbers reg byte a
Statement [123] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::init:5 [ ] { } ) always clobbers reg byte a
Statement [123] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::init:5 [ ] { } ) always clobbers reg byte a
Statement [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:19 [ init::i#2 init::i#1 ]
Statement [126] *((const nomodify byte*) SPRITES_COLS + (byte) init::i#2) ← (const nomodify byte) GREEN [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] { } ) always clobbers reg byte a
@ -3562,7 +3562,7 @@ Removing always clobbered register reg byte y as potential for zp[1]:22 [ mulf_i
Removing always clobbered register reg byte y as potential for zp[1]:25 [ mulf_init::x_2#3 mulf_init::x_2#2 mulf_init::x_2#1 ]
Statement [155] *((byte*) mulf_init::sqr1_hi#2) ← (byte~) mulf_init::$5 [ mulf_init::sqr1_lo#2 mulf_init::sqr1_hi#2 mulf_init::c#1 mulf_init::x_2#2 mulf_init::sqr#3 ] ( main:2::init:5::mulf_init:122 [ mulf_init::sqr1_lo#2 mulf_init::sqr1_hi#2 mulf_init::c#1 mulf_init::x_2#2 mulf_init::sqr#3 ] { } ) always clobbers reg byte y
Statement [157] (word) mulf_init::sqr#1 ← (word) mulf_init::sqr#3 + (byte) mulf_init::x_2#2 [ mulf_init::sqr1_lo#2 mulf_init::c#1 mulf_init::sqr#1 mulf_init::sqr1_hi#1 mulf_init::x_2#2 ] ( main:2::init:5::mulf_init:122 [ mulf_init::sqr1_lo#2 mulf_init::c#1 mulf_init::sqr#1 mulf_init::sqr1_hi#1 mulf_init::x_2#2 ] { } ) always clobbers reg byte a
Statement [11] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2 [ anim::angle#9 ] ( main:2::anim:7 [ anim::angle#9 ] { } ) always clobbers reg byte a
Statement [11] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2 [ anim::angle#9 ] ( main:2::anim:7 [ anim::angle#9 ] { } ) always clobbers reg byte a
Statement [17] (byte) mulf8u_prepare::a#3 ← (byte)(signed byte)*((const byte*) COS + (byte) anim::angle#9) [ anim::angle#9 anim::i#10 anim::sprite_msb#10 anim::x#0 anim::y#0 mulf8u_prepare::a#3 ] ( main:2::anim:7 [ anim::angle#9 anim::i#10 anim::sprite_msb#10 anim::x#0 anim::y#0 mulf8u_prepare::a#3 ] { { mulf8u_prepare::a#2 = mulf8u_prepare::a#3 } } ) always clobbers reg byte y
Removing always clobbered register reg byte y as potential for zp[1]:3 [ anim::i#10 anim::i#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:4 [ anim::sprite_msb#10 anim::sprite_msb#5 anim::sprite_msb#1 anim::sprite_msb#2 ]
@ -3584,12 +3584,12 @@ Statement [44] (byte) anim::sprite_msb#2 ← (byte) anim::sprite_msb#1 | (byte)
Statement [48] (byte) anim::i2#0 ← (byte) anim::i#10 << (byte) 1 [ anim::angle#9 anim::i#10 anim::sprite_msb#5 anim::xpos#0 anim::ypos#0 anim::i2#0 ] ( main:2::anim:7 [ anim::angle#9 anim::i#10 anim::sprite_msb#5 anim::xpos#0 anim::ypos#0 anim::i2#0 ] { } ) always clobbers reg byte a
Statement [51] *((const nomodify byte*) SPRITES_YPOS + (byte) anim::i2#0) ← (byte) anim::ypos#0 [ anim::angle#9 anim::i#10 anim::sprite_msb#5 ] ( main:2::anim:7 [ anim::angle#9 anim::i#10 anim::sprite_msb#5 ] { } ) always clobbers reg byte a
Statement [53] if((byte) anim::i#1!=(byte) 8) goto anim::@4 [ anim::angle#9 anim::i#1 anim::sprite_msb#5 ] ( main:2::anim:7 [ anim::angle#9 anim::i#1 anim::sprite_msb#5 ] { } ) always clobbers reg byte a
Statement [54] *((const nomodify byte*) SPRITES_XMSB) ← (byte) anim::sprite_msb#5 [ anim::angle#9 ] ( main:2::anim:7 [ anim::angle#9 ] { { clock::return#0 = clock::return#2 } } ) always clobbers reg byte a
Statement [54] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB) ← (byte) anim::sprite_msb#5 [ anim::angle#9 ] ( main:2::anim:7 [ anim::angle#9 ] { { clock::return#0 = clock::return#2 } } ) always clobbers reg byte a
Statement [57] (dword) clock::return#2 ← (dword) clock::return#0 [ anim::angle#1 clock::return#2 ] ( main:2::anim:7 [ anim::angle#1 clock::return#2 ] { { clock::return#0 = clock::return#2 } } ) always clobbers reg byte a
Statement [58] (dword~) anim::$26 ← (dword) clock::return#2 [ anim::angle#1 anim::$26 ] ( main:2::anim:7 [ anim::angle#1 anim::$26 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } } ) always clobbers reg byte a
Statement [59] (dword) anim::cyclecount#0 ← (dword~) anim::$26 - (const nomodify dword) CLOCKS_PER_INIT [ anim::angle#1 anim::cyclecount#0 ] ( main:2::anim:7 [ anim::angle#1 anim::cyclecount#0 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } } ) always clobbers reg byte a
Statement [60] (dword) print_ulong_at::dw#0 ← (dword) anim::cyclecount#0 [ anim::angle#1 print_ulong_at::dw#0 ] ( main:2::anim:7 [ anim::angle#1 print_ulong_at::dw#0 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } } ) always clobbers reg byte a
Statement [62] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE [ anim::angle#1 ] ( main:2::anim:7 [ anim::angle#1 ] { } ) always clobbers reg byte a
Statement [62] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE [ anim::angle#1 ] ( main:2::anim:7 [ anim::angle#1 ] { } ) always clobbers reg byte a
Statement [63] (word) print_uint_at::w#0 ← > (dword) print_ulong_at::dw#0 [ print_ulong_at::dw#0 print_uint_at::w#0 ] ( main:2::anim:7::print_ulong_at:61 [ anim::angle#1 print_ulong_at::dw#0 print_uint_at::w#0 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } { print_uint_at::w#0 = print_uint_at::w#2 } } ) always clobbers reg byte a
Statement [65] (word) print_uint_at::w#1 ← < (dword) print_ulong_at::dw#0 [ print_uint_at::w#1 ] ( main:2::anim:7::print_ulong_at:61 [ anim::angle#1 print_uint_at::w#1 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } { print_uint_at::w#1 = print_uint_at::w#2 } } ) always clobbers reg byte a
Statement [70] (byte*) print_uchar_at::at#0 ← (byte*) print_uint_at::at#2 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#0 print_uchar_at::at#0 ] ( main:2::anim:7::print_ulong_at:61::print_uint_at:64 [ anim::angle#1 print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#0 print_uchar_at::at#0 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } } main:2::anim:7::print_ulong_at:61::print_uint_at:66 [ anim::angle#1 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#0 print_uchar_at::at#0 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } } ) always clobbers reg byte a
@ -3613,7 +3613,7 @@ Statement [116] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte)
Statement [117] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff [ ] ( main:2::anim:7::clock_start:13 [ anim::angle#9 ] { } ) always clobbers reg byte a
Statement [118] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::anim:7::clock_start:13 [ anim::angle#9 ] { } ) always clobbers reg byte a
Statement [119] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START [ ] ( main:2::anim:7::clock_start:13 [ anim::angle#9 ] { } ) always clobbers reg byte a
Statement [123] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::init:5 [ ] { } ) always clobbers reg byte a
Statement [123] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::init:5 [ ] { } ) always clobbers reg byte a
Statement [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] { } ) always clobbers reg byte a
Statement [126] *((const nomodify byte*) SPRITES_COLS + (byte) init::i#2) ← (const nomodify byte) GREEN [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] { } ) always clobbers reg byte a
Statement [132] if((byte*) mulf_init::sqr1_lo#2!=(const byte*) mulf_sqr1_lo+(word) $200) goto mulf_init::@2 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] ( main:2::init:5::mulf_init:122 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] { } ) always clobbers reg byte a
@ -3627,7 +3627,7 @@ Statement [147] (byte~) mulf_init::$1 ← (byte) mulf_init::c#1 & (byte) 1 [ mul
Statement [153] *((byte*) mulf_init::sqr1_lo#2) ← (byte~) mulf_init::$4 [ mulf_init::sqr1_lo#2 mulf_init::sqr1_hi#2 mulf_init::c#1 mulf_init::x_2#2 mulf_init::sqr#3 ] ( main:2::init:5::mulf_init:122 [ mulf_init::sqr1_lo#2 mulf_init::sqr1_hi#2 mulf_init::c#1 mulf_init::x_2#2 mulf_init::sqr#3 ] { } ) always clobbers reg byte y
Statement [155] *((byte*) mulf_init::sqr1_hi#2) ← (byte~) mulf_init::$5 [ mulf_init::sqr1_lo#2 mulf_init::sqr1_hi#2 mulf_init::c#1 mulf_init::x_2#2 mulf_init::sqr#3 ] ( main:2::init:5::mulf_init:122 [ mulf_init::sqr1_lo#2 mulf_init::sqr1_hi#2 mulf_init::c#1 mulf_init::x_2#2 mulf_init::sqr#3 ] { } ) always clobbers reg byte y
Statement [157] (word) mulf_init::sqr#1 ← (word) mulf_init::sqr#3 + (byte) mulf_init::x_2#2 [ mulf_init::sqr1_lo#2 mulf_init::c#1 mulf_init::sqr#1 mulf_init::sqr1_hi#1 mulf_init::x_2#2 ] ( main:2::init:5::mulf_init:122 [ mulf_init::sqr1_lo#2 mulf_init::c#1 mulf_init::sqr#1 mulf_init::sqr1_hi#1 mulf_init::x_2#2 ] { } ) always clobbers reg byte a
Statement [11] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2 [ anim::angle#9 ] ( main:2::anim:7 [ anim::angle#9 ] { } ) always clobbers reg byte a
Statement [11] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2 [ anim::angle#9 ] ( main:2::anim:7 [ anim::angle#9 ] { } ) always clobbers reg byte a
Statement [15] (signed byte) anim::x#0 ← *((const signed byte*) xs + (byte) anim::i#10) [ anim::angle#9 anim::i#10 anim::sprite_msb#10 anim::x#0 ] ( main:2::anim:7 [ anim::angle#9 anim::i#10 anim::sprite_msb#10 anim::x#0 ] { } ) always clobbers reg byte a reg byte y
Statement [16] (signed byte) anim::y#0 ← *((const signed byte*) ys + (byte) anim::i#10) [ anim::angle#9 anim::i#10 anim::sprite_msb#10 anim::x#0 anim::y#0 ] ( main:2::anim:7 [ anim::angle#9 anim::i#10 anim::sprite_msb#10 anim::x#0 anim::y#0 ] { } ) always clobbers reg byte a reg byte y
Statement [17] (byte) mulf8u_prepare::a#3 ← (byte)(signed byte)*((const byte*) COS + (byte) anim::angle#9) [ anim::angle#9 anim::i#10 anim::sprite_msb#10 anim::x#0 anim::y#0 mulf8u_prepare::a#3 ] ( main:2::anim:7 [ anim::angle#9 anim::i#10 anim::sprite_msb#10 anim::x#0 anim::y#0 mulf8u_prepare::a#3 ] { { mulf8u_prepare::a#2 = mulf8u_prepare::a#3 } } ) always clobbers reg byte y
@ -3647,12 +3647,12 @@ Statement [44] (byte) anim::sprite_msb#2 ← (byte) anim::sprite_msb#1 | (byte)
Statement [48] (byte) anim::i2#0 ← (byte) anim::i#10 << (byte) 1 [ anim::angle#9 anim::i#10 anim::sprite_msb#5 anim::xpos#0 anim::ypos#0 anim::i2#0 ] ( main:2::anim:7 [ anim::angle#9 anim::i#10 anim::sprite_msb#5 anim::xpos#0 anim::ypos#0 anim::i2#0 ] { } ) always clobbers reg byte a
Statement [51] *((const nomodify byte*) SPRITES_YPOS + (byte) anim::i2#0) ← (byte) anim::ypos#0 [ anim::angle#9 anim::i#10 anim::sprite_msb#5 ] ( main:2::anim:7 [ anim::angle#9 anim::i#10 anim::sprite_msb#5 ] { } ) always clobbers reg byte a
Statement [53] if((byte) anim::i#1!=(byte) 8) goto anim::@4 [ anim::angle#9 anim::i#1 anim::sprite_msb#5 ] ( main:2::anim:7 [ anim::angle#9 anim::i#1 anim::sprite_msb#5 ] { } ) always clobbers reg byte a
Statement [54] *((const nomodify byte*) SPRITES_XMSB) ← (byte) anim::sprite_msb#5 [ anim::angle#9 ] ( main:2::anim:7 [ anim::angle#9 ] { { clock::return#0 = clock::return#2 } } ) always clobbers reg byte a
Statement [54] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB) ← (byte) anim::sprite_msb#5 [ anim::angle#9 ] ( main:2::anim:7 [ anim::angle#9 ] { { clock::return#0 = clock::return#2 } } ) always clobbers reg byte a
Statement [57] (dword) clock::return#2 ← (dword) clock::return#0 [ anim::angle#1 clock::return#2 ] ( main:2::anim:7 [ anim::angle#1 clock::return#2 ] { { clock::return#0 = clock::return#2 } } ) always clobbers reg byte a
Statement [58] (dword~) anim::$26 ← (dword) clock::return#2 [ anim::angle#1 anim::$26 ] ( main:2::anim:7 [ anim::angle#1 anim::$26 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } } ) always clobbers reg byte a
Statement [59] (dword) anim::cyclecount#0 ← (dword~) anim::$26 - (const nomodify dword) CLOCKS_PER_INIT [ anim::angle#1 anim::cyclecount#0 ] ( main:2::anim:7 [ anim::angle#1 anim::cyclecount#0 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } } ) always clobbers reg byte a
Statement [60] (dword) print_ulong_at::dw#0 ← (dword) anim::cyclecount#0 [ anim::angle#1 print_ulong_at::dw#0 ] ( main:2::anim:7 [ anim::angle#1 print_ulong_at::dw#0 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } } ) always clobbers reg byte a
Statement [62] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE [ anim::angle#1 ] ( main:2::anim:7 [ anim::angle#1 ] { } ) always clobbers reg byte a
Statement [62] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE [ anim::angle#1 ] ( main:2::anim:7 [ anim::angle#1 ] { } ) always clobbers reg byte a
Statement [63] (word) print_uint_at::w#0 ← > (dword) print_ulong_at::dw#0 [ print_ulong_at::dw#0 print_uint_at::w#0 ] ( main:2::anim:7::print_ulong_at:61 [ anim::angle#1 print_ulong_at::dw#0 print_uint_at::w#0 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } { print_uint_at::w#0 = print_uint_at::w#2 } } ) always clobbers reg byte a
Statement [65] (word) print_uint_at::w#1 ← < (dword) print_ulong_at::dw#0 [ print_uint_at::w#1 ] ( main:2::anim:7::print_ulong_at:61 [ anim::angle#1 print_uint_at::w#1 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } { print_uint_at::w#1 = print_uint_at::w#2 } } ) always clobbers reg byte a
Statement [70] (byte*) print_uchar_at::at#0 ← (byte*) print_uint_at::at#2 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#0 print_uchar_at::at#0 ] ( main:2::anim:7::print_ulong_at:61::print_uint_at:64 [ anim::angle#1 print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#0 print_uchar_at::at#0 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } } main:2::anim:7::print_ulong_at:61::print_uint_at:66 [ anim::angle#1 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#0 print_uchar_at::at#0 ] { { print_ulong_at::dw#0 = anim::cyclecount#0 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_uchar_at::at#0 = print_uchar_at::at#2 print_uint_at::at#2 } } ) always clobbers reg byte a
@ -3676,7 +3676,7 @@ Statement [116] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte)
Statement [117] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff [ ] ( main:2::anim:7::clock_start:13 [ anim::angle#9 ] { } ) always clobbers reg byte a
Statement [118] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::anim:7::clock_start:13 [ anim::angle#9 ] { } ) always clobbers reg byte a
Statement [119] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START [ ] ( main:2::anim:7::clock_start:13 [ anim::angle#9 ] { } ) always clobbers reg byte a
Statement [123] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::init:5 [ ] { } ) always clobbers reg byte a
Statement [123] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff [ ] ( main:2::init:5 [ ] { } ) always clobbers reg byte a
Statement [125] *((const byte*) init::sprites_ptr#0 + (byte) init::i#2) ← (byte)(const byte*) SPRITE/(byte) $40 [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] { } ) always clobbers reg byte a
Statement [126] *((const nomodify byte*) SPRITES_COLS + (byte) init::i#2) ← (const nomodify byte) GREEN [ init::i#2 ] ( main:2::init:5 [ init::i#2 ] { } ) always clobbers reg byte a
Statement [132] if((byte*) mulf_init::sqr1_lo#2!=(const byte*) mulf_sqr1_lo+(word) $200) goto mulf_init::@2 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] ( main:2::init:5::mulf_init:122 [ mulf_init::sqr1_lo#2 mulf_init::c#2 mulf_init::sqr#4 mulf_init::sqr1_hi#2 mulf_init::x_2#3 ] { } ) always clobbers reg byte a
@ -3867,11 +3867,9 @@ ASSEMBLER BEFORE OPTIMIZATION
.const CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = $40
.label SPRITES_XPOS = $d000
.label SPRITES_YPOS = $d001
.label SPRITES_XMSB = $d010
.label RASTER = $d012
.label SPRITES_ENABLE = $d015
.label BORDERCOL = $d020
.label SPRITES_COLS = $d027
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// CIA#2 timer A&B as one single 32-bit value
@ -3883,6 +3881,10 @@ ASSEMBLER BEFORE OPTIMIZATION
.const CLOCKS_PER_INIT = $12
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB = $10
.label SCREEN = $400
.label COS = SIN+$40
// A single sprite
@ -3954,15 +3956,15 @@ anim: {
jmp __b2
// anim::@2
__b2:
// [11] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// [11] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
jmp __b3
// anim::@3
__b3:
// [12] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// [12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [13] call clock_start
jsr clock_start
// [14] phi from anim::@3 to anim::@4 [phi:anim::@3->anim::@4]
@ -4160,9 +4162,9 @@ anim: {
jmp __b7
// anim::@7
__b7:
// [54] *((const nomodify byte*) SPRITES_XMSB) ← (byte) anim::sprite_msb#5 -- _deref_pbuc1=vbuz1
// [54] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB) ← (byte) anim::sprite_msb#5 -- _deref_pbuc1=vbuz1
lda.z sprite_msb
sta SPRITES_XMSB
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB
// [55] (byte) anim::angle#1 ← ++ (byte) anim::angle#9 -- vbuz1=_inc_vbuz1
inc.z angle
// [56] call clock
@ -4193,9 +4195,9 @@ anim: {
jmp __b15
// anim::@15
__b15:
// [62] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE -- _deref_pbuc1=vbuc2
// [62] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE -- _deref_pbuc1=vbuc2
lda #LIGHT_BLUE
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [10] phi from anim::@15 to anim::@1 [phi:anim::@15->anim::@1]
__b1_from___b15:
// [10] phi (byte) anim::angle#9 = (byte) anim::angle#1 [phi:anim::@15->anim::@1#0] -- register_copy
@ -4543,9 +4545,9 @@ init: {
jmp __b2
// init::@2
__b2:
// [123] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
// [123] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
lda #$ff
sta SPRITES_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
// [124] phi from init::@2 to init::@1 [phi:init::@2->init::@1]
__b1_from___b2:
// [124] phi (byte) init::i#2 = (byte) 0 [phi:init::@2->init::@1#0] -- vbuxx=vbuc1
@ -4971,13 +4973,12 @@ Removing instruction jmp __b8
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction __bbegin:
Succesful ASM optimization Pass5UnusedLabelElimination
Fixing long branch [151] bne __b4 to beq
Fixing long branch [153] bne __b4 to beq
FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify dword*) CIA2_TIMER_AB = (dword*) 56580
(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = (byte) $40
@ -5072,21 +5073,23 @@ FINAL SYMBOL TABLE
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = (byte) $e
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = (byte) $f
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = (byte) $15
(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB = (byte) $10
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10
(const byte) RADIX::OCTAL = (number) 8
(const nomodify byte*) RASTER = (byte*) 53266
(const byte*) SCREEN = (byte*) 1024
(const byte*) SIN[(number) $140] = kickasm {{ .for(var i=0;i<$140;i++)
.byte >round($7fff*sin(i*2*PI/256))
}}
(const byte*) SPRITE = (byte*) 12288
(const nomodify byte*) SPRITES_COLS = (byte*) 53287
(const nomodify byte*) SPRITES_ENABLE = (byte*) 53269
(const nomodify byte*) SPRITES_XMSB = (byte*) 53264
(const nomodify byte*) SPRITES_XPOS = (byte*) 53248
(const nomodify byte*) SPRITES_YPOS = (byte*) 53249
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(void()) anim()
(signed word~) anim::$10 zp[2]:3 20002.0
(signed word~) anim::$11 zp[2]:3 20002.0
@ -5351,11 +5354,9 @@ Score: 30994
.const CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = $40
.label SPRITES_XPOS = $d000
.label SPRITES_YPOS = $d001
.label SPRITES_XMSB = $d010
.label RASTER = $d012
.label SPRITES_ENABLE = $d015
.label BORDERCOL = $d020
.label SPRITES_COLS = $d027
// The VIC-II MOS 6567/6569
.label VICII = $d000
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// CIA#2 timer A&B as one single 32-bit value
@ -5367,6 +5368,10 @@ Score: 30994
.const CLOCKS_PER_INIT = $12
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = $15
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB = $10
.label SCREEN = $400
.label COS = SIN+$40
// A single sprite
@ -5425,15 +5430,15 @@ anim: {
// anim::@1
// anim::@2
__b2:
// while(*RASTER!=$ff)
// [11] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto anim::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// while(VICII->RASTER!=$ff)
// [11] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto anim::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
// anim::@3
// (*BORDERCOL)++;
// [12] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
// [12] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// clock_start()
// [13] call clock_start
jsr clock_start
@ -5629,10 +5634,10 @@ anim: {
jmp __b4
!__b4:
// anim::@7
// *SPRITES_XMSB = sprite_msb
// [54] *((const nomodify byte*) SPRITES_XMSB) ← (byte) anim::sprite_msb#5 -- _deref_pbuc1=vbuz1
// VICII->SPRITES_XMSB = sprite_msb
// [54] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB) ← (byte) anim::sprite_msb#5 -- _deref_pbuc1=vbuz1
lda.z sprite_msb
sta SPRITES_XMSB
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB
// angle++;
// [55] (byte) anim::angle#1 ← ++ (byte) anim::angle#9 -- vbuz1=_inc_vbuz1
inc.z angle
@ -5663,10 +5668,10 @@ anim: {
// Print cycle count
jsr print_ulong_at
// anim::@15
// *BORDERCOL = LIGHT_BLUE
// [62] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) LIGHT_BLUE -- _deref_pbuc1=vbuc2
// VICII->BORDER_COLOR = LIGHT_BLUE
// [62] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) LIGHT_BLUE -- _deref_pbuc1=vbuc2
lda #LIGHT_BLUE
sta BORDERCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// [10] phi from anim::@15 to anim::@1 [phi:anim::@15->anim::@1]
// [10] phi (byte) anim::angle#9 = (byte) anim::angle#1 [phi:anim::@15->anim::@1#0] -- register_copy
jmp __b2
@ -6005,10 +6010,10 @@ init: {
// [130] phi from init to mulf_init [phi:init->mulf_init]
jsr mulf_init
// init::@2
// *SPRITES_ENABLE = %11111111
// [123] *((const nomodify byte*) SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
// VICII->SPRITES_ENABLE = %11111111
// [123] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE) ← (byte) $ff -- _deref_pbuc1=vbuc2
lda #$ff
sta SPRITES_ENABLE
sta VICII+OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE
// [124] phi from init::@2 to init::@1 [phi:init::@2->init::@1]
// [124] phi (byte) init::i#2 = (byte) 0 [phi:init::@2->init::@1#0] -- vbuxx=vbuc1
ldx #0

View File

@ -1,7 +1,6 @@
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify dword*) CIA2_TIMER_AB = (dword*) 56580
(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = (byte) $40
@ -96,21 +95,23 @@
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = (byte) $e
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = (byte) $f
(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = (byte) $20
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_ENABLE = (byte) $15
(const byte) OFFSET_STRUCT_MOS6569_VICII_SPRITES_XMSB = (byte) $10
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10
(const byte) RADIX::OCTAL = (number) 8
(const nomodify byte*) RASTER = (byte*) 53266
(const byte*) SCREEN = (byte*) 1024
(const byte*) SIN[(number) $140] = kickasm {{ .for(var i=0;i<$140;i++)
.byte >round($7fff*sin(i*2*PI/256))
}}
(const byte*) SPRITE = (byte*) 12288
(const nomodify byte*) SPRITES_COLS = (byte*) 53287
(const nomodify byte*) SPRITES_ENABLE = (byte*) 53269
(const nomodify byte*) SPRITES_XMSB = (byte*) 53264
(const nomodify byte*) SPRITES_XPOS = (byte*) 53248
(const nomodify byte*) SPRITES_YPOS = (byte*) 53249
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(void()) anim()
(signed word~) anim::$10 zp[2]:3 20002.0
(signed word~) anim::$11 zp[2]:3 20002.0

View File

@ -1,10 +1,12 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
// The VIC-II MOS 6567/6569
.label VICII = $d000
.label SCREEN = $400
.label RASTER = $d012
.label BGCOL = $d020
.label SCROLL = $d016
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16
main: {
.label line = SCREEN+$28
.label nxt = 2
@ -17,17 +19,17 @@ main: {
ldx #7
// Wait for raster
__b1:
// while(*RASTER!=$fe)
// while(VICII->RASTER!=$fe)
lda #$fe
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b1
__b2:
// while(*RASTER!=$ff)
// while(VICII->RASTER!=$ff)
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
// ++*BGCOL;
inc BGCOL
// ++VICII->BG_COLOR;
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// if(--scroll==$ff)
dex
cpx #$ff
@ -62,10 +64,10 @@ main: {
!:
ldx #7
__b4:
// *SCROLL = scroll
stx SCROLL
// --*BGCOL;
dec BGCOL
// VICII->CONTROL2 = scroll
stx VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2
// --VICII->BG_COLOR;
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
jmp __b1
__b6:
// line[i]=line[i+1]

View File

@ -16,13 +16,13 @@ main: scope:[main] from @1
main::@1: scope:[main] from main main::@1 main::@4
[6] (byte*) main::nxt#10 ← phi( main::@1/(byte*) main::nxt#10 main/(const to_nomodify byte*) TEXT main::@4/(byte*) main::nxt#11 )
[6] (byte) main::scroll#7 ← phi( main::@1/(byte) main::scroll#7 main/(byte) 7 main::@4/(byte) main::scroll#4 )
[7] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto main::@1
[7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[8] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto main::@2
[8] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
[9] *((const nomodify byte*) BGCOL) ← ++ *((const nomodify byte*) BGCOL)
[9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR)
[10] (byte) main::scroll#1 ← -- (byte) main::scroll#7
[11] if((byte) main::scroll#1!=(byte) $ff) goto main::@4
to:main::@5
@ -46,8 +46,8 @@ main::@9: scope:[main] from main::@7 main::@8
main::@4: scope:[main] from main::@3 main::@9
[20] (byte*) main::nxt#11 ← phi( main::@9/(byte*) main::nxt#1 main::@3/(byte*) main::nxt#10 )
[20] (byte) main::scroll#4 ← phi( main::@9/(byte) 7 main::@3/(byte) main::scroll#1 )
[21] *((const nomodify byte*) SCROLL) ← (byte) main::scroll#4
[22] *((const nomodify byte*) BGCOL) ← -- *((const nomodify byte*) BGCOL)
[21] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte) main::scroll#4
[22] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR)
to:main::@1
main::@6: scope:[main] from main::@5
[23] *((const nomodify byte*) main::line + (byte) main::i#2) ← *((const nomodify byte*) main::line+(byte) 1 + (byte) main::i#2)

View File

@ -1,3 +1,4 @@
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
@ -16,19 +17,19 @@ main::@11: scope:[main] from main
main::@1: scope:[main] from main::@1 main::@11 main::@5
(byte*) main::nxt#10 ← phi( main::@1/(byte*) main::nxt#10 main::@11/(byte*) main::nxt#0 main::@5/(byte*) main::nxt#11 )
(byte) main::scroll#7 ← phi( main::@1/(byte) main::scroll#7 main::@11/(byte) main::scroll#0 main::@5/(byte) main::scroll#4 )
(bool~) main::$1 ← *((const nomodify byte*) RASTER) != (number) $fe
(bool~) main::$1 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $fe
if((bool~) main::$1) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
(byte*) main::nxt#9 ← phi( main::@1/(byte*) main::nxt#10 main::@2/(byte*) main::nxt#9 )
(byte) main::scroll#5 ← phi( main::@1/(byte) main::scroll#7 main::@2/(byte) main::scroll#5 )
(bool~) main::$2 ← *((const nomodify byte*) RASTER) != (number) $ff
(bool~) main::$2 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $ff
if((bool~) main::$2) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
(byte*) main::nxt#8 ← phi( main::@2/(byte*) main::nxt#9 )
(byte) main::scroll#3 ← phi( main::@2/(byte) main::scroll#5 )
*((const nomodify byte*) BGCOL) ← ++ *((const nomodify byte*) BGCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR)
(byte) main::scroll#1 ← -- (byte) main::scroll#3
(bool~) main::$4 ← (byte) main::scroll#1 == (number) $ff
(bool~) main::$5 ← ! (bool~) main::$4
@ -37,8 +38,8 @@ main::@3: scope:[main] from main::@2
main::@5: scope:[main] from main::@10 main::@3
(byte*) main::nxt#11 ← phi( main::@10/(byte*) main::nxt#1 main::@3/(byte*) main::nxt#8 )
(byte) main::scroll#4 ← phi( main::@10/(byte) main::scroll#6 main::@3/(byte) main::scroll#1 )
*((const nomodify byte*) SCROLL) ← (byte) main::scroll#4
*((const nomodify byte*) BGCOL) ← -- *((const nomodify byte*) BGCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte) main::scroll#4
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR)
if(true) goto main::@1
to:main::@return
main::@4: scope:[main] from main::@3
@ -121,11 +122,96 @@ SYMBOL TABLE SSA
(label) @2
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*)(number) $d020
(const nomodify byte*) RASTER = (byte*)(number) $d012
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
(byte) MOS6526_CIA::PORT_A_DDR
(byte) MOS6526_CIA::PORT_B
(byte) MOS6526_CIA::PORT_B_DDR
(byte) MOS6526_CIA::SERIAL_DATA
(word) MOS6526_CIA::TIMER_A
(byte) MOS6526_CIA::TIMER_A_CONTROL
(word) MOS6526_CIA::TIMER_B
(byte) MOS6526_CIA::TIMER_B_CONTROL
(byte) MOS6526_CIA::TOD_10THS
(byte) MOS6526_CIA::TOD_HOURS
(byte) MOS6526_CIA::TOD_MIN
(byte) MOS6526_CIA::TOD_SEC
(byte) MOS6569_VICII::BG_COLOR
(byte) MOS6569_VICII::BG_COLOR1
(byte) MOS6569_VICII::BG_COLOR2
(byte) MOS6569_VICII::BG_COLOR3
(byte) MOS6569_VICII::BORDER_COLOR
(byte) MOS6569_VICII::CONTROL1
(byte) MOS6569_VICII::CONTROL2
(byte) MOS6569_VICII::IRQ_ENABLE
(byte) MOS6569_VICII::IRQ_STATUS
(byte) MOS6569_VICII::LIGHTPEN_X
(byte) MOS6569_VICII::LIGHTPEN_Y
(byte) MOS6569_VICII::MEMORY
(byte) MOS6569_VICII::RASTER
(byte) MOS6569_VICII::SPRITE0_COLOR
(byte) MOS6569_VICII::SPRITE0_X
(byte) MOS6569_VICII::SPRITE0_Y
(byte) MOS6569_VICII::SPRITE1_COLOR
(byte) MOS6569_VICII::SPRITE1_X
(byte) MOS6569_VICII::SPRITE1_Y
(byte) MOS6569_VICII::SPRITE2_COLOR
(byte) MOS6569_VICII::SPRITE2_X
(byte) MOS6569_VICII::SPRITE2_Y
(byte) MOS6569_VICII::SPRITE3_COLOR
(byte) MOS6569_VICII::SPRITE3_X
(byte) MOS6569_VICII::SPRITE3_Y
(byte) MOS6569_VICII::SPRITE4_COLOR
(byte) MOS6569_VICII::SPRITE4_X
(byte) MOS6569_VICII::SPRITE4_Y
(byte) MOS6569_VICII::SPRITE5_COLOR
(byte) MOS6569_VICII::SPRITE5_X
(byte) MOS6569_VICII::SPRITE5_Y
(byte) MOS6569_VICII::SPRITE6_COLOR
(byte) MOS6569_VICII::SPRITE6_X
(byte) MOS6569_VICII::SPRITE6_Y
(byte) MOS6569_VICII::SPRITE7_COLOR
(byte) MOS6569_VICII::SPRITE7_X
(byte) MOS6569_VICII::SPRITE7_Y
(byte) MOS6569_VICII::SPRITES_BG_COLLISION
(byte) MOS6569_VICII::SPRITES_COLLISION
(byte) MOS6569_VICII::SPRITES_ENABLE
(byte) MOS6569_VICII::SPRITES_EXPAND_X
(byte) MOS6569_VICII::SPRITES_EXPAND_Y
(byte) MOS6569_VICII::SPRITES_MC
(byte) MOS6569_VICII::SPRITES_MCOLOR1
(byte) MOS6569_VICII::SPRITES_MCOLOR2
(byte) MOS6569_VICII::SPRITES_PRIORITY
(byte) MOS6569_VICII::SPRITES_XMSB
(byte) MOS6581_SID::CH1_ATTACK_DECAY
(byte) MOS6581_SID::CH1_CONTROL
(word) MOS6581_SID::CH1_FREQ
(word) MOS6581_SID::CH1_PULSE_WIDTH
(byte) MOS6581_SID::CH1_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH2_ATTACK_DECAY
(byte) MOS6581_SID::CH2_CONTROL
(word) MOS6581_SID::CH2_FREQ
(word) MOS6581_SID::CH2_PULSE_WIDTH
(byte) MOS6581_SID::CH2_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH3_ATTACK_DECAY
(byte) MOS6581_SID::CH3_CONTROL
(byte) MOS6581_SID::CH3_ENV
(word) MOS6581_SID::CH3_FREQ
(byte) MOS6581_SID::CH3_OSC
(word) MOS6581_SID::CH3_PULSE_WIDTH
(byte) MOS6581_SID::CH3_SUSTAIN_RELEASE
(byte) MOS6581_SID::FILTER_CUTOFF_HIGH
(byte) MOS6581_SID::FILTER_CUTOFF_LOW
(byte) MOS6581_SID::FILTER_SETUP
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = (byte) $16
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify byte*) SCREEN = (byte*)(number) $400
(const nomodify byte*) SCROLL = (byte*)(number) $d016
(const to_nomodify byte*) TEXT[] = (byte*) "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =- "
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*)(number) $d000
(void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill)
(byte*~) fillscreen::$0
(bool~) fillscreen::$1
@ -207,8 +293,8 @@ SYMBOL TABLE SSA
Adding number conversion cast (unumber) $28 in
Adding number conversion cast (unumber) $20 in (byte) fillscreen::fill#0 ← (number) $20
Adding number conversion cast (unumber) $fe in (bool~) main::$1 ← *((const nomodify byte*) RASTER) != (number) $fe
Adding number conversion cast (unumber) $ff in (bool~) main::$2 ← *((const nomodify byte*) RASTER) != (number) $ff
Adding number conversion cast (unumber) $fe in (bool~) main::$1 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $fe
Adding number conversion cast (unumber) $ff in (bool~) main::$2 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $ff
Adding number conversion cast (unumber) $ff in (bool~) main::$4 ← (byte) main::scroll#1 == (number) $ff
Adding number conversion cast (unumber) 7 in (byte) main::scroll#2 ← (number) 7
Adding number conversion cast (unumber) $27 in (bool~) main::$6 ← (byte) main::i#2 != (number) $27
@ -221,10 +307,8 @@ Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte) fillscreen::fill#0 ← (unumber)(number) $20
Inlining cast (byte) main::scroll#2 ← (unumber)(number) 7
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53270
Simplifying constant integer cast $28
Simplifying constant integer cast $20
Simplifying constant integer cast $fe
@ -274,8 +358,8 @@ Identical Phi Values (byte) fillscreen::fill#3 (byte) fillscreen::fill#0
Identical Phi Values (byte*) fillscreen::screen#2 (byte*) fillscreen::cursor#0
Identical Phi Values (byte) fillscreen::fill#1 (byte) fillscreen::fill#3
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::$1 [7] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto main::@1
Simple Condition (bool~) main::$2 [10] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto main::@2
Simple Condition (bool~) main::$1 [7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@1
Simple Condition (bool~) main::$2 [10] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@2
Simple Condition (bool~) main::$5 [14] if((byte) main::scroll#1!=(byte) $ff) goto main::@5
Simple Condition (bool~) main::$6 [23] if((byte) main::i#2!=(byte) $27) goto main::@7
Simple Condition (bool~) main::$9 [29] if((byte) main::c#0!=(byte) 0) goto main::@10
@ -381,13 +465,13 @@ main: scope:[main] from @1
main::@1: scope:[main] from main main::@1 main::@4
[6] (byte*) main::nxt#10 ← phi( main::@1/(byte*) main::nxt#10 main/(const to_nomodify byte*) TEXT main::@4/(byte*) main::nxt#11 )
[6] (byte) main::scroll#7 ← phi( main::@1/(byte) main::scroll#7 main/(byte) 7 main::@4/(byte) main::scroll#4 )
[7] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto main::@1
[7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[8] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto main::@2
[8] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
[9] *((const nomodify byte*) BGCOL) ← ++ *((const nomodify byte*) BGCOL)
[9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR)
[10] (byte) main::scroll#1 ← -- (byte) main::scroll#7
[11] if((byte) main::scroll#1!=(byte) $ff) goto main::@4
to:main::@5
@ -411,8 +495,8 @@ main::@9: scope:[main] from main::@7 main::@8
main::@4: scope:[main] from main::@3 main::@9
[20] (byte*) main::nxt#11 ← phi( main::@9/(byte*) main::nxt#1 main::@3/(byte*) main::nxt#10 )
[20] (byte) main::scroll#4 ← phi( main::@9/(byte) 7 main::@3/(byte) main::scroll#1 )
[21] *((const nomodify byte*) SCROLL) ← (byte) main::scroll#4
[22] *((const nomodify byte*) BGCOL) ← -- *((const nomodify byte*) BGCOL)
[21] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte) main::scroll#4
[22] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR)
to:main::@1
main::@6: scope:[main] from main::@5
[23] *((const nomodify byte*) main::line + (byte) main::i#2) ← *((const nomodify byte*) main::line+(byte) 1 + (byte) main::i#2)
@ -437,6 +521,90 @@ fillscreen::@2: scope:[fillscreen] from fillscreen::@1
VARIABLE REGISTER WEIGHTS
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
(byte) MOS6526_CIA::PORT_A_DDR
(byte) MOS6526_CIA::PORT_B
(byte) MOS6526_CIA::PORT_B_DDR
(byte) MOS6526_CIA::SERIAL_DATA
(word) MOS6526_CIA::TIMER_A
(byte) MOS6526_CIA::TIMER_A_CONTROL
(word) MOS6526_CIA::TIMER_B
(byte) MOS6526_CIA::TIMER_B_CONTROL
(byte) MOS6526_CIA::TOD_10THS
(byte) MOS6526_CIA::TOD_HOURS
(byte) MOS6526_CIA::TOD_MIN
(byte) MOS6526_CIA::TOD_SEC
(byte) MOS6569_VICII::BG_COLOR
(byte) MOS6569_VICII::BG_COLOR1
(byte) MOS6569_VICII::BG_COLOR2
(byte) MOS6569_VICII::BG_COLOR3
(byte) MOS6569_VICII::BORDER_COLOR
(byte) MOS6569_VICII::CONTROL1
(byte) MOS6569_VICII::CONTROL2
(byte) MOS6569_VICII::IRQ_ENABLE
(byte) MOS6569_VICII::IRQ_STATUS
(byte) MOS6569_VICII::LIGHTPEN_X
(byte) MOS6569_VICII::LIGHTPEN_Y
(byte) MOS6569_VICII::MEMORY
(byte) MOS6569_VICII::RASTER
(byte) MOS6569_VICII::SPRITE0_COLOR
(byte) MOS6569_VICII::SPRITE0_X
(byte) MOS6569_VICII::SPRITE0_Y
(byte) MOS6569_VICII::SPRITE1_COLOR
(byte) MOS6569_VICII::SPRITE1_X
(byte) MOS6569_VICII::SPRITE1_Y
(byte) MOS6569_VICII::SPRITE2_COLOR
(byte) MOS6569_VICII::SPRITE2_X
(byte) MOS6569_VICII::SPRITE2_Y
(byte) MOS6569_VICII::SPRITE3_COLOR
(byte) MOS6569_VICII::SPRITE3_X
(byte) MOS6569_VICII::SPRITE3_Y
(byte) MOS6569_VICII::SPRITE4_COLOR
(byte) MOS6569_VICII::SPRITE4_X
(byte) MOS6569_VICII::SPRITE4_Y
(byte) MOS6569_VICII::SPRITE5_COLOR
(byte) MOS6569_VICII::SPRITE5_X
(byte) MOS6569_VICII::SPRITE5_Y
(byte) MOS6569_VICII::SPRITE6_COLOR
(byte) MOS6569_VICII::SPRITE6_X
(byte) MOS6569_VICII::SPRITE6_Y
(byte) MOS6569_VICII::SPRITE7_COLOR
(byte) MOS6569_VICII::SPRITE7_X
(byte) MOS6569_VICII::SPRITE7_Y
(byte) MOS6569_VICII::SPRITES_BG_COLLISION
(byte) MOS6569_VICII::SPRITES_COLLISION
(byte) MOS6569_VICII::SPRITES_ENABLE
(byte) MOS6569_VICII::SPRITES_EXPAND_X
(byte) MOS6569_VICII::SPRITES_EXPAND_Y
(byte) MOS6569_VICII::SPRITES_MC
(byte) MOS6569_VICII::SPRITES_MCOLOR1
(byte) MOS6569_VICII::SPRITES_MCOLOR2
(byte) MOS6569_VICII::SPRITES_PRIORITY
(byte) MOS6569_VICII::SPRITES_XMSB
(byte) MOS6581_SID::CH1_ATTACK_DECAY
(byte) MOS6581_SID::CH1_CONTROL
(word) MOS6581_SID::CH1_FREQ
(word) MOS6581_SID::CH1_PULSE_WIDTH
(byte) MOS6581_SID::CH1_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH2_ATTACK_DECAY
(byte) MOS6581_SID::CH2_CONTROL
(word) MOS6581_SID::CH2_FREQ
(word) MOS6581_SID::CH2_PULSE_WIDTH
(byte) MOS6581_SID::CH2_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH3_ATTACK_DECAY
(byte) MOS6581_SID::CH3_CONTROL
(byte) MOS6581_SID::CH3_ENV
(word) MOS6581_SID::CH3_FREQ
(byte) MOS6581_SID::CH3_OSC
(word) MOS6581_SID::CH3_PULSE_WIDTH
(byte) MOS6581_SID::CH3_SUSTAIN_RELEASE
(byte) MOS6581_SID::FILTER_CUTOFF_HIGH
(byte) MOS6581_SID::FILTER_CUTOFF_LOW
(byte) MOS6581_SID::FILTER_SETUP
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill)
(byte*) fillscreen::cursor
(byte*) fillscreen::cursor#1 2002.0
@ -487,10 +655,12 @@ Target platform is c64basic / MOS6502X
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
// The VIC-II MOS 6567/6569
.label VICII = $d000
.label SCREEN = $400
.label RASTER = $d012
.label BGCOL = $d020
.label SCROLL = $d016
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -538,22 +708,22 @@ main: {
jmp __b1
// main::@1
__b1:
// [7] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
// [7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$fe
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b1_from___b1
jmp __b2
// main::@2
__b2:
// [8] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// [8] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
jmp __b3
// main::@3
__b3:
// [9] *((const nomodify byte*) BGCOL) ← ++ *((const nomodify byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BGCOL
// [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// [10] (byte) main::scroll#1 ← -- (byte) main::scroll#7 -- vbuz1=_dec_vbuz1
dec.z scroll
// [11] if((byte) main::scroll#1!=(byte) $ff) goto main::@4 -- vbuz1_neq_vbuc1_then_la1
@ -629,11 +799,11 @@ main: {
jmp __b4
// main::@4
__b4:
// [21] *((const nomodify byte*) SCROLL) ← (byte) main::scroll#4 -- _deref_pbuc1=vbuz1
// [21] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte) main::scroll#4 -- _deref_pbuc1=vbuz1
lda.z scroll
sta SCROLL
// [22] *((const nomodify byte*) BGCOL) ← -- *((const nomodify byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BGCOL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2
// [22] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
jmp __b1_from___b4
// main::@6
__b6:
@ -697,16 +867,16 @@ fillscreen: {
.byte 0
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto main::@1 [ main::scroll#7 main::nxt#10 ] ( main:2 [ main::scroll#7 main::nxt#10 ] { } ) always clobbers reg byte a
Statement [7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@1 [ main::scroll#7 main::nxt#10 ] ( main:2 [ main::scroll#7 main::nxt#10 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::scroll#7 main::scroll#4 main::scroll#1 ]
Statement [8] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto main::@2 [ main::scroll#7 main::nxt#10 ] ( main:2 [ main::scroll#7 main::nxt#10 ] { } ) always clobbers reg byte a
Statement [8] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@2 [ main::scroll#7 main::nxt#10 ] ( main:2 [ main::scroll#7 main::nxt#10 ] { } ) always clobbers reg byte a
Statement [14] (byte) main::c#0 ← *((byte*) main::nxt#10) [ main::nxt#10 main::c#0 ] ( main:2 [ main::nxt#10 main::c#0 ] { } ) always clobbers reg byte a reg byte y
Statement [23] *((const nomodify byte*) main::line + (byte) main::i#2) ← *((const nomodify byte*) main::line+(byte) 1 + (byte) main::i#2) [ main::nxt#10 main::i#2 ] ( main:2 [ main::nxt#10 main::i#2 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:3 [ main::i#2 main::i#1 ]
Statement [27] if((byte*) fillscreen::cursor#2<(const nomodify byte*) SCREEN+(word) $3e8) goto fillscreen::@2 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] { } ) always clobbers reg byte a
Statement [29] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] { } ) always clobbers reg byte a reg byte y
Statement [7] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto main::@1 [ main::scroll#7 main::nxt#10 ] ( main:2 [ main::scroll#7 main::nxt#10 ] { } ) always clobbers reg byte a
Statement [8] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto main::@2 [ main::scroll#7 main::nxt#10 ] ( main:2 [ main::scroll#7 main::nxt#10 ] { } ) always clobbers reg byte a
Statement [7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@1 [ main::scroll#7 main::nxt#10 ] ( main:2 [ main::scroll#7 main::nxt#10 ] { } ) always clobbers reg byte a
Statement [8] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@2 [ main::scroll#7 main::nxt#10 ] ( main:2 [ main::scroll#7 main::nxt#10 ] { } ) always clobbers reg byte a
Statement [14] (byte) main::c#0 ← *((byte*) main::nxt#10) [ main::nxt#10 main::c#0 ] ( main:2 [ main::nxt#10 main::c#0 ] { } ) always clobbers reg byte a reg byte y
Statement [23] *((const nomodify byte*) main::line + (byte) main::i#2) ← *((const nomodify byte*) main::line+(byte) 1 + (byte) main::i#2) [ main::nxt#10 main::i#2 ] ( main:2 [ main::nxt#10 main::i#2 ] { } ) always clobbers reg byte a
Statement [27] if((byte*) fillscreen::cursor#2<(const nomodify byte*) SCREEN+(word) $3e8) goto fillscreen::@2 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] { } ) always clobbers reg byte a
@ -720,10 +890,16 @@ Potential registers zp[2]:7 [ fillscreen::cursor#2 fillscreen::cursor#1 ] : zp[2
REGISTER UPLIFT SCOPES
Uplift Scope [main] 3,670.33: zp[1]:3 [ main::i#2 main::i#1 ] 803.5: zp[1]:2 [ main::scroll#7 main::scroll#4 main::scroll#1 ] 656.5: zp[1]:4 [ main::c#2 main::c#0 main::c#1 ] 604.5: zp[2]:5 [ main::nxt#4 main::nxt#10 main::nxt#11 main::nxt#1 ]
Uplift Scope [fillscreen] 3,336.67: zp[2]:7 [ fillscreen::cursor#2 fillscreen::cursor#1 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [MOS6569_VICII]
Uplift Scope [MOS6581_SID]
Uplift Scope []
Uplifting [main] best 8284 combination reg byte x [ main::i#2 main::i#1 ] reg byte x [ main::scroll#7 main::scroll#4 main::scroll#1 ] reg byte x [ main::c#2 main::c#0 main::c#1 ] zp[2]:5 [ main::nxt#4 main::nxt#10 main::nxt#11 main::nxt#1 ]
Uplifting [fillscreen] best 8284 combination zp[2]:7 [ fillscreen::cursor#2 fillscreen::cursor#1 ]
Uplifting [MOS6526_CIA] best 8284 combination
Uplifting [MOS6569_VICII] best 8284 combination
Uplifting [MOS6581_SID] best 8284 combination
Uplifting [] best 8284 combination
Allocated (was zp[2]:5) zp[2]:2 [ main::nxt#4 main::nxt#10 main::nxt#11 main::nxt#1 ]
Allocated (was zp[2]:7) zp[2]:4 [ fillscreen::cursor#2 fillscreen::cursor#1 ]
@ -735,10 +911,12 @@ ASSEMBLER BEFORE OPTIMIZATION
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
// The VIC-II MOS 6567/6569
.label VICII = $d000
.label SCREEN = $400
.label RASTER = $d012
.label BGCOL = $d020
.label SCROLL = $d016
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -782,22 +960,22 @@ main: {
jmp __b1
// main::@1
__b1:
// [7] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
// [7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$fe
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b1_from___b1
jmp __b2
// main::@2
__b2:
// [8] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// [8] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
jmp __b3
// main::@3
__b3:
// [9] *((const nomodify byte*) BGCOL) ← ++ *((const nomodify byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BGCOL
// [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// [10] (byte) main::scroll#1 ← -- (byte) main::scroll#7 -- vbuxx=_dec_vbuxx
dex
// [11] if((byte) main::scroll#1!=(byte) $ff) goto main::@4 -- vbuxx_neq_vbuc1_then_la1
@ -866,10 +1044,10 @@ main: {
jmp __b4
// main::@4
__b4:
// [21] *((const nomodify byte*) SCROLL) ← (byte) main::scroll#4 -- _deref_pbuc1=vbuxx
stx SCROLL
// [22] *((const nomodify byte*) BGCOL) ← -- *((const nomodify byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BGCOL
// [21] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte) main::scroll#4 -- _deref_pbuc1=vbuxx
stx VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2
// [22] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
jmp __b1_from___b4
// main::@6
__b6:
@ -986,11 +1164,96 @@ FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*) 53280
(const nomodify byte*) RASTER = (byte*) 53266
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
(byte) MOS6526_CIA::PORT_A_DDR
(byte) MOS6526_CIA::PORT_B
(byte) MOS6526_CIA::PORT_B_DDR
(byte) MOS6526_CIA::SERIAL_DATA
(word) MOS6526_CIA::TIMER_A
(byte) MOS6526_CIA::TIMER_A_CONTROL
(word) MOS6526_CIA::TIMER_B
(byte) MOS6526_CIA::TIMER_B_CONTROL
(byte) MOS6526_CIA::TOD_10THS
(byte) MOS6526_CIA::TOD_HOURS
(byte) MOS6526_CIA::TOD_MIN
(byte) MOS6526_CIA::TOD_SEC
(byte) MOS6569_VICII::BG_COLOR
(byte) MOS6569_VICII::BG_COLOR1
(byte) MOS6569_VICII::BG_COLOR2
(byte) MOS6569_VICII::BG_COLOR3
(byte) MOS6569_VICII::BORDER_COLOR
(byte) MOS6569_VICII::CONTROL1
(byte) MOS6569_VICII::CONTROL2
(byte) MOS6569_VICII::IRQ_ENABLE
(byte) MOS6569_VICII::IRQ_STATUS
(byte) MOS6569_VICII::LIGHTPEN_X
(byte) MOS6569_VICII::LIGHTPEN_Y
(byte) MOS6569_VICII::MEMORY
(byte) MOS6569_VICII::RASTER
(byte) MOS6569_VICII::SPRITE0_COLOR
(byte) MOS6569_VICII::SPRITE0_X
(byte) MOS6569_VICII::SPRITE0_Y
(byte) MOS6569_VICII::SPRITE1_COLOR
(byte) MOS6569_VICII::SPRITE1_X
(byte) MOS6569_VICII::SPRITE1_Y
(byte) MOS6569_VICII::SPRITE2_COLOR
(byte) MOS6569_VICII::SPRITE2_X
(byte) MOS6569_VICII::SPRITE2_Y
(byte) MOS6569_VICII::SPRITE3_COLOR
(byte) MOS6569_VICII::SPRITE3_X
(byte) MOS6569_VICII::SPRITE3_Y
(byte) MOS6569_VICII::SPRITE4_COLOR
(byte) MOS6569_VICII::SPRITE4_X
(byte) MOS6569_VICII::SPRITE4_Y
(byte) MOS6569_VICII::SPRITE5_COLOR
(byte) MOS6569_VICII::SPRITE5_X
(byte) MOS6569_VICII::SPRITE5_Y
(byte) MOS6569_VICII::SPRITE6_COLOR
(byte) MOS6569_VICII::SPRITE6_X
(byte) MOS6569_VICII::SPRITE6_Y
(byte) MOS6569_VICII::SPRITE7_COLOR
(byte) MOS6569_VICII::SPRITE7_X
(byte) MOS6569_VICII::SPRITE7_Y
(byte) MOS6569_VICII::SPRITES_BG_COLLISION
(byte) MOS6569_VICII::SPRITES_COLLISION
(byte) MOS6569_VICII::SPRITES_ENABLE
(byte) MOS6569_VICII::SPRITES_EXPAND_X
(byte) MOS6569_VICII::SPRITES_EXPAND_Y
(byte) MOS6569_VICII::SPRITES_MC
(byte) MOS6569_VICII::SPRITES_MCOLOR1
(byte) MOS6569_VICII::SPRITES_MCOLOR2
(byte) MOS6569_VICII::SPRITES_PRIORITY
(byte) MOS6569_VICII::SPRITES_XMSB
(byte) MOS6581_SID::CH1_ATTACK_DECAY
(byte) MOS6581_SID::CH1_CONTROL
(word) MOS6581_SID::CH1_FREQ
(word) MOS6581_SID::CH1_PULSE_WIDTH
(byte) MOS6581_SID::CH1_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH2_ATTACK_DECAY
(byte) MOS6581_SID::CH2_CONTROL
(word) MOS6581_SID::CH2_FREQ
(word) MOS6581_SID::CH2_PULSE_WIDTH
(byte) MOS6581_SID::CH2_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH3_ATTACK_DECAY
(byte) MOS6581_SID::CH3_CONTROL
(byte) MOS6581_SID::CH3_ENV
(word) MOS6581_SID::CH3_FREQ
(byte) MOS6581_SID::CH3_OSC
(word) MOS6581_SID::CH3_PULSE_WIDTH
(byte) MOS6581_SID::CH3_SUSTAIN_RELEASE
(byte) MOS6581_SID::FILTER_CUTOFF_HIGH
(byte) MOS6581_SID::FILTER_CUTOFF_LOW
(byte) MOS6581_SID::FILTER_SETUP
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = (byte) $16
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify byte*) SCREEN = (byte*) 1024
(const nomodify byte*) SCROLL = (byte*) 53270
(const to_nomodify byte*) TEXT[] = (byte*) "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =- "
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill)
(label) fillscreen::@1
(label) fillscreen::@2
@ -1045,10 +1308,12 @@ Score: 6262
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// The VIC-II MOS 6567/6569
.label VICII = $d000
.label SCREEN = $400
.label RASTER = $d012
.label BGCOL = $d020
.label SCROLL = $d016
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16
// @begin
// [1] phi from @begin to @1 [phi:@begin->@1]
// @1
@ -1078,22 +1343,22 @@ main: {
// [6] phi (byte) main::scroll#7 = (byte) main::scroll#7 [phi:main::@1/main::@4->main::@1#1] -- register_copy
// main::@1
__b1:
// while(*RASTER!=$fe)
// [7] if(*((const nomodify byte*) RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
// while(VICII->RASTER!=$fe)
// [7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$fe
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b1
// main::@2
__b2:
// while(*RASTER!=$ff)
// [8] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// while(VICII->RASTER!=$ff)
// [8] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
// main::@3
// ++*BGCOL;
// [9] *((const nomodify byte*) BGCOL) ← ++ *((const nomodify byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BGCOL
// ++VICII->BG_COLOR;
// [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// if(--scroll==$ff)
// [10] (byte) main::scroll#1 ← -- (byte) main::scroll#7 -- vbuxx=_dec_vbuxx
dex
@ -1155,12 +1420,12 @@ main: {
// [20] phi (byte) main::scroll#4 = (byte) main::scroll#1 [phi:main::@3->main::@4#1] -- register_copy
// main::@4
__b4:
// *SCROLL = scroll
// [21] *((const nomodify byte*) SCROLL) ← (byte) main::scroll#4 -- _deref_pbuc1=vbuxx
stx SCROLL
// --*BGCOL;
// [22] *((const nomodify byte*) BGCOL) ← -- *((const nomodify byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BGCOL
// VICII->CONTROL2 = scroll
// [21] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte) main::scroll#4 -- _deref_pbuc1=vbuxx
stx VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2
// --VICII->BG_COLOR;
// [22] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
jmp __b1
// main::@6
__b6:

View File

@ -1,11 +1,96 @@
(label) @1
(label) @begin
(label) @end
(const nomodify byte*) BGCOL = (byte*) 53280
(const nomodify byte*) RASTER = (byte*) 53266
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
(byte) MOS6526_CIA::PORT_A_DDR
(byte) MOS6526_CIA::PORT_B
(byte) MOS6526_CIA::PORT_B_DDR
(byte) MOS6526_CIA::SERIAL_DATA
(word) MOS6526_CIA::TIMER_A
(byte) MOS6526_CIA::TIMER_A_CONTROL
(word) MOS6526_CIA::TIMER_B
(byte) MOS6526_CIA::TIMER_B_CONTROL
(byte) MOS6526_CIA::TOD_10THS
(byte) MOS6526_CIA::TOD_HOURS
(byte) MOS6526_CIA::TOD_MIN
(byte) MOS6526_CIA::TOD_SEC
(byte) MOS6569_VICII::BG_COLOR
(byte) MOS6569_VICII::BG_COLOR1
(byte) MOS6569_VICII::BG_COLOR2
(byte) MOS6569_VICII::BG_COLOR3
(byte) MOS6569_VICII::BORDER_COLOR
(byte) MOS6569_VICII::CONTROL1
(byte) MOS6569_VICII::CONTROL2
(byte) MOS6569_VICII::IRQ_ENABLE
(byte) MOS6569_VICII::IRQ_STATUS
(byte) MOS6569_VICII::LIGHTPEN_X
(byte) MOS6569_VICII::LIGHTPEN_Y
(byte) MOS6569_VICII::MEMORY
(byte) MOS6569_VICII::RASTER
(byte) MOS6569_VICII::SPRITE0_COLOR
(byte) MOS6569_VICII::SPRITE0_X
(byte) MOS6569_VICII::SPRITE0_Y
(byte) MOS6569_VICII::SPRITE1_COLOR
(byte) MOS6569_VICII::SPRITE1_X
(byte) MOS6569_VICII::SPRITE1_Y
(byte) MOS6569_VICII::SPRITE2_COLOR
(byte) MOS6569_VICII::SPRITE2_X
(byte) MOS6569_VICII::SPRITE2_Y
(byte) MOS6569_VICII::SPRITE3_COLOR
(byte) MOS6569_VICII::SPRITE3_X
(byte) MOS6569_VICII::SPRITE3_Y
(byte) MOS6569_VICII::SPRITE4_COLOR
(byte) MOS6569_VICII::SPRITE4_X
(byte) MOS6569_VICII::SPRITE4_Y
(byte) MOS6569_VICII::SPRITE5_COLOR
(byte) MOS6569_VICII::SPRITE5_X
(byte) MOS6569_VICII::SPRITE5_Y
(byte) MOS6569_VICII::SPRITE6_COLOR
(byte) MOS6569_VICII::SPRITE6_X
(byte) MOS6569_VICII::SPRITE6_Y
(byte) MOS6569_VICII::SPRITE7_COLOR
(byte) MOS6569_VICII::SPRITE7_X
(byte) MOS6569_VICII::SPRITE7_Y
(byte) MOS6569_VICII::SPRITES_BG_COLLISION
(byte) MOS6569_VICII::SPRITES_COLLISION
(byte) MOS6569_VICII::SPRITES_ENABLE
(byte) MOS6569_VICII::SPRITES_EXPAND_X
(byte) MOS6569_VICII::SPRITES_EXPAND_Y
(byte) MOS6569_VICII::SPRITES_MC
(byte) MOS6569_VICII::SPRITES_MCOLOR1
(byte) MOS6569_VICII::SPRITES_MCOLOR2
(byte) MOS6569_VICII::SPRITES_PRIORITY
(byte) MOS6569_VICII::SPRITES_XMSB
(byte) MOS6581_SID::CH1_ATTACK_DECAY
(byte) MOS6581_SID::CH1_CONTROL
(word) MOS6581_SID::CH1_FREQ
(word) MOS6581_SID::CH1_PULSE_WIDTH
(byte) MOS6581_SID::CH1_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH2_ATTACK_DECAY
(byte) MOS6581_SID::CH2_CONTROL
(word) MOS6581_SID::CH2_FREQ
(word) MOS6581_SID::CH2_PULSE_WIDTH
(byte) MOS6581_SID::CH2_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH3_ATTACK_DECAY
(byte) MOS6581_SID::CH3_CONTROL
(byte) MOS6581_SID::CH3_ENV
(word) MOS6581_SID::CH3_FREQ
(byte) MOS6581_SID::CH3_OSC
(word) MOS6581_SID::CH3_PULSE_WIDTH
(byte) MOS6581_SID::CH3_SUSTAIN_RELEASE
(byte) MOS6581_SID::FILTER_CUTOFF_HIGH
(byte) MOS6581_SID::FILTER_CUTOFF_LOW
(byte) MOS6581_SID::FILTER_SETUP
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = (byte) $16
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify byte*) SCREEN = (byte*) 1024
(const nomodify byte*) SCROLL = (byte*) 53270
(const to_nomodify byte*) TEXT[] = (byte*) "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =- "
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(void()) fillscreen((byte*) fillscreen::screen , (byte) fillscreen::fill)
(label) fillscreen::@1
(label) fillscreen::@2

View File

@ -2,12 +2,16 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
// Processor Port Register controlling RAM/ROM configuration and the datasette
.label PROCPORT = 1
// The address of the CHARGEN character set
.label CHARGEN = $d000
// The VIC-II MOS 6567/6569
.label VICII = $d000
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16
.label SCREEN = $400
.label RASTER = $d012
.label BGCOL = $d020
.label SCROLL = $d016
.label current_bit = 2
// Scroll the next bit from the current char onto the screen - trigger next char if needed
.label current_chargen = 3
@ -28,21 +32,21 @@ main: {
ldx #7
// Wait for raster
__b1:
// while(*RASTER!=$fe)
// while(VICII->RASTER!=$fe)
lda #$fe
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b1
__b2:
// while(*RASTER!=$ff)
// while(VICII->RASTER!=$ff)
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
// ++*BGCOL;
inc BGCOL
// ++VICII->BG_COLOR;
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// scroll_soft()
jsr scroll_soft
// --*BGCOL;
dec BGCOL
// --VICII->BG_COLOR;
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
jmp __b1
}
scroll_soft: {
@ -54,8 +58,8 @@ scroll_soft: {
jsr scroll_bit
ldx #7
__b1:
// *SCROLL = scroll
stx SCROLL
// VICII->CONTROL2 = scroll
stx VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2
// }
rts
}

View File

@ -14,21 +14,21 @@ main: scope:[main] from @1
[5] call fillscreen
to:main::@1
main::@1: scope:[main] from main main::@1 main::@4
[6] (byte*) current_chargen#27 ← phi( main::@1/(byte*) current_chargen#27 main/(const byte*) CHARGEN main::@4/(byte*) current_chargen#11 )
[6] (byte*) current_chargen#27 ← phi( main::@1/(byte*) current_chargen#27 main/(const nomodify byte*) CHARGEN main::@4/(byte*) current_chargen#11 )
[6] (byte*) nxt#31 ← phi( main::@1/(byte*) nxt#31 main/(const byte*) TEXT main::@4/(byte*) nxt#14 )
[6] (byte) current_bit#29 ← phi( main::@1/(byte) current_bit#29 main/(byte) 1 main::@4/(byte) current_bit#12 )
[6] (byte) scroll#18 ← phi( main::@1/(byte) scroll#18 main/(byte) 7 main::@4/(byte) scroll#10 )
[7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1
[7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2
[8] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
[9] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL)
[9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR)
[10] call scroll_soft
to:main::@4
main::@4: scope:[main] from main::@3
[11] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL)
[11] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR)
to:main::@1
(void()) scroll_soft()
@ -45,7 +45,7 @@ scroll_soft::@1: scope:[scroll_soft] from scroll_soft scroll_soft::@2
[16] (byte*) nxt#14 ← phi( scroll_soft/(byte*) nxt#31 scroll_soft::@2/(byte*) nxt#35 )
[16] (byte) current_bit#12 ← phi( scroll_soft/(byte) current_bit#29 scroll_soft::@2/(byte) current_bit#21 )
[16] (byte) scroll#10 ← phi( scroll_soft/(byte) scroll#3 scroll_soft::@2/(byte) 7 )
[17] *((const byte*) SCROLL) ← (byte) scroll#10
[17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte) scroll#10
to:scroll_soft::@return
scroll_soft::@return: scope:[scroll_soft] from scroll_soft::@1
[18] return
@ -64,7 +64,7 @@ scroll_bit::@2: scope:[scroll_bit] from scroll_bit
scroll_bit::@8: scope:[scroll_bit] from scroll_bit::@2
[24] (word) scroll_bit::c#0 ← (byte) next_char::return#0
[25] (word~) scroll_bit::$7 ← (word) scroll_bit::c#0 << (byte) 3
[26] (byte*) current_chargen#5 ← (const byte*) CHARGEN + (word~) scroll_bit::$7
[26] (byte*) current_chargen#5 ← (const nomodify byte*) CHARGEN + (word~) scroll_bit::$7
to:scroll_bit::@1
scroll_bit::@1: scope:[scroll_bit] from scroll_bit scroll_bit::@8
[27] (byte*) nxt#35 ← phi( scroll_bit/(byte*) nxt#31 scroll_bit::@8/(byte*) nxt#19 )
@ -74,7 +74,7 @@ scroll_bit::@1: scope:[scroll_bit] from scroll_bit scroll_bit::@8
to:scroll_bit::@7
scroll_bit::@7: scope:[scroll_bit] from scroll_bit::@1
asm { sei }
[30] *((const byte*) PROCPORT) ← (byte) $32
[30] *((const nomodify byte*) PROCPORT) ← (byte) $32
to:scroll_bit::@3
scroll_bit::@3: scope:[scroll_bit] from scroll_bit::@4 scroll_bit::@7
[31] (byte*) scroll_bit::sc#2 ← phi( scroll_bit::@4/(byte*) scroll_bit::sc#1 scroll_bit::@7/(const byte*) SCREEN+(byte) $28+(byte) $27 )
@ -94,7 +94,7 @@ scroll_bit::@4: scope:[scroll_bit] from scroll_bit::@3 scroll_bit::@5
[40] if((byte) scroll_bit::r#1!=(byte) 8) goto scroll_bit::@3
to:scroll_bit::@6
scroll_bit::@6: scope:[scroll_bit] from scroll_bit::@4
[41] *((const byte*) PROCPORT) ← (byte) $37
[41] *((const nomodify byte*) PROCPORT) ← (byte) $37
asm { cli }
to:scroll_bit::@return
scroll_bit::@return: scope:[scroll_bit] from scroll_bit::@6

View File

@ -1,3 +1,4 @@
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA
@begin: scope:[] from
@ -24,7 +25,7 @@ main::@1: scope:[main] from main::@1 main::@4 main::@5
(byte*) nxt#31 ← phi( main::@1/(byte*) nxt#31 main::@4/(byte*) nxt#34 main::@5/(byte*) nxt#0 )
(byte) current_bit#29 ← phi( main::@1/(byte) current_bit#29 main::@4/(byte) current_bit#30 main::@5/(byte) current_bit#0 )
(byte) scroll#18 ← phi( main::@1/(byte) scroll#18 main::@4/(byte) scroll#20 main::@5/(byte) scroll#0 )
(bool~) main::$1 ← *((const byte*) RASTER) != (number) $fe
(bool~) main::$1 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $fe
if((bool~) main::$1) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
@ -32,7 +33,7 @@ main::@2: scope:[main] from main::@1 main::@2
(byte*) nxt#27 ← phi( main::@1/(byte*) nxt#31 main::@2/(byte*) nxt#27 )
(byte) current_bit#24 ← phi( main::@1/(byte) current_bit#29 main::@2/(byte) current_bit#24 )
(byte) scroll#16 ← phi( main::@1/(byte) scroll#18 main::@2/(byte) scroll#16 )
(bool~) main::$2 ← *((const byte*) RASTER) != (number) $ff
(bool~) main::$2 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $ff
if((bool~) main::$2) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
@ -40,7 +41,7 @@ main::@3: scope:[main] from main::@2
(byte*) nxt#21 ← phi( main::@2/(byte*) nxt#27 )
(byte) current_bit#17 ← phi( main::@2/(byte) current_bit#24 )
(byte) scroll#13 ← phi( main::@2/(byte) scroll#16 )
*((const byte*) BGCOL) ← ++ *((const byte*) BGCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR)
call scroll_soft
to:main::@5
main::@5: scope:[main] from main::@3
@ -52,7 +53,7 @@ main::@5: scope:[main] from main::@3
(byte) current_bit#0 ← (byte) current_bit#9
(byte*) nxt#0 ← (byte*) nxt#11
(byte*) current_chargen#0 ← (byte*) current_chargen#8
*((const byte*) BGCOL) ← -- *((const byte*) BGCOL)
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR)
if(true) goto main::@1
to:main::@return
main::@return: scope:[main] from main::@5
@ -86,7 +87,7 @@ scroll_soft::@1: scope:[scroll_soft] from scroll_soft scroll_soft::@3
(byte*) nxt#23 ← phi( scroll_soft/(byte*) nxt#28 scroll_soft::@3/(byte*) nxt#2 )
(byte) current_bit#19 ← phi( scroll_soft/(byte) current_bit#25 scroll_soft::@3/(byte) current_bit#2 )
(byte) scroll#10 ← phi( scroll_soft/(byte) scroll#3 scroll_soft::@3/(byte) scroll#14 )
*((const byte*) SCROLL) ← (byte) scroll#10
*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte) scroll#10
to:scroll_soft::@return
scroll_soft::@2: scope:[scroll_soft] from scroll_soft
(byte*) current_chargen#16 ← phi( scroll_soft/(byte*) current_chargen#23 )
@ -117,7 +118,7 @@ scroll_soft::@return: scope:[scroll_soft] from scroll_soft::@1
to:@return
@2: scope:[] from @1
(byte) scroll#19 ← phi( @1/(byte) scroll#2 )
(byte*) current_chargen#4 ← (const byte*) CHARGEN
(byte*) current_chargen#4 ← (const nomodify byte*) CHARGEN
(byte) current_bit#4 ← (byte) 1
to:@3
@ -143,7 +144,7 @@ scroll_bit::@7: scope:[scroll_bit] from scroll_bit::@1
(byte) current_bit#21 ← phi( scroll_bit::@1/(byte) current_bit#26 )
(byte*) current_chargen#19 ← phi( scroll_bit::@1/(byte*) current_chargen#24 )
asm { sei }
*((const byte*) PROCPORT) ← (number) $32
*((const nomodify byte*) PROCPORT) ← (number) $32
(byte*~) scroll_bit::$4 ← (const byte*) SCREEN + (number) $28
(byte*~) scroll_bit::$5 ← (byte*~) scroll_bit::$4 + (number) $27
(byte*) scroll_bit::sc#0 ← (byte*~) scroll_bit::$5
@ -161,7 +162,7 @@ scroll_bit::@8: scope:[scroll_bit] from scroll_bit::@2
(byte*) nxt#4 ← (byte*) nxt#15
(word) scroll_bit::c#0 ← (byte~) scroll_bit::$6
(number~) scroll_bit::$7 ← (word) scroll_bit::c#0 * (number) 8
(byte*~) scroll_bit::$8 ← (const byte*) CHARGEN + (number~) scroll_bit::$7
(byte*~) scroll_bit::$8 ← (const nomodify byte*) CHARGEN + (number~) scroll_bit::$7
(byte*) current_chargen#5 ← (byte*~) scroll_bit::$8
(byte) current_bit#6 ← (number) $80
to:scroll_bit::@1
@ -204,7 +205,7 @@ scroll_bit::@6: scope:[scroll_bit] from scroll_bit::@4
(byte*) current_chargen#20 ← phi( scroll_bit::@4/(byte*) current_chargen#18 )
(byte*) nxt#25 ← phi( scroll_bit::@4/(byte*) nxt#30 )
(byte) current_bit#22 ← phi( scroll_bit::@4/(byte) current_bit#20 )
*((const byte*) PROCPORT) ← (number) $37
*((const nomodify byte*) PROCPORT) ← (number) $37
asm { cli }
to:scroll_bit::@return
scroll_bit::@return: scope:[scroll_bit] from scroll_bit::@6
@ -349,13 +350,98 @@ SYMBOL TABLE SSA
(label) @5
(label) @begin
(label) @end
(const byte*) BGCOL = (byte*)(number) $d020
(const byte*) CHARGEN = (byte*)(number) $d000
(const byte*) PROCPORT = (byte*)(number) 1
(const byte*) RASTER = (byte*)(number) $d012
(const nomodify byte*) CHARGEN = (byte*)(number) $d000
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
(byte) MOS6526_CIA::PORT_A_DDR
(byte) MOS6526_CIA::PORT_B
(byte) MOS6526_CIA::PORT_B_DDR
(byte) MOS6526_CIA::SERIAL_DATA
(word) MOS6526_CIA::TIMER_A
(byte) MOS6526_CIA::TIMER_A_CONTROL
(word) MOS6526_CIA::TIMER_B
(byte) MOS6526_CIA::TIMER_B_CONTROL
(byte) MOS6526_CIA::TOD_10THS
(byte) MOS6526_CIA::TOD_HOURS
(byte) MOS6526_CIA::TOD_MIN
(byte) MOS6526_CIA::TOD_SEC
(byte) MOS6569_VICII::BG_COLOR
(byte) MOS6569_VICII::BG_COLOR1
(byte) MOS6569_VICII::BG_COLOR2
(byte) MOS6569_VICII::BG_COLOR3
(byte) MOS6569_VICII::BORDER_COLOR
(byte) MOS6569_VICII::CONTROL1
(byte) MOS6569_VICII::CONTROL2
(byte) MOS6569_VICII::IRQ_ENABLE
(byte) MOS6569_VICII::IRQ_STATUS
(byte) MOS6569_VICII::LIGHTPEN_X
(byte) MOS6569_VICII::LIGHTPEN_Y
(byte) MOS6569_VICII::MEMORY
(byte) MOS6569_VICII::RASTER
(byte) MOS6569_VICII::SPRITE0_COLOR
(byte) MOS6569_VICII::SPRITE0_X
(byte) MOS6569_VICII::SPRITE0_Y
(byte) MOS6569_VICII::SPRITE1_COLOR
(byte) MOS6569_VICII::SPRITE1_X
(byte) MOS6569_VICII::SPRITE1_Y
(byte) MOS6569_VICII::SPRITE2_COLOR
(byte) MOS6569_VICII::SPRITE2_X
(byte) MOS6569_VICII::SPRITE2_Y
(byte) MOS6569_VICII::SPRITE3_COLOR
(byte) MOS6569_VICII::SPRITE3_X
(byte) MOS6569_VICII::SPRITE3_Y
(byte) MOS6569_VICII::SPRITE4_COLOR
(byte) MOS6569_VICII::SPRITE4_X
(byte) MOS6569_VICII::SPRITE4_Y
(byte) MOS6569_VICII::SPRITE5_COLOR
(byte) MOS6569_VICII::SPRITE5_X
(byte) MOS6569_VICII::SPRITE5_Y
(byte) MOS6569_VICII::SPRITE6_COLOR
(byte) MOS6569_VICII::SPRITE6_X
(byte) MOS6569_VICII::SPRITE6_Y
(byte) MOS6569_VICII::SPRITE7_COLOR
(byte) MOS6569_VICII::SPRITE7_X
(byte) MOS6569_VICII::SPRITE7_Y
(byte) MOS6569_VICII::SPRITES_BG_COLLISION
(byte) MOS6569_VICII::SPRITES_COLLISION
(byte) MOS6569_VICII::SPRITES_ENABLE
(byte) MOS6569_VICII::SPRITES_EXPAND_X
(byte) MOS6569_VICII::SPRITES_EXPAND_Y
(byte) MOS6569_VICII::SPRITES_MC
(byte) MOS6569_VICII::SPRITES_MCOLOR1
(byte) MOS6569_VICII::SPRITES_MCOLOR2
(byte) MOS6569_VICII::SPRITES_PRIORITY
(byte) MOS6569_VICII::SPRITES_XMSB
(byte) MOS6581_SID::CH1_ATTACK_DECAY
(byte) MOS6581_SID::CH1_CONTROL
(word) MOS6581_SID::CH1_FREQ
(word) MOS6581_SID::CH1_PULSE_WIDTH
(byte) MOS6581_SID::CH1_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH2_ATTACK_DECAY
(byte) MOS6581_SID::CH2_CONTROL
(word) MOS6581_SID::CH2_FREQ
(word) MOS6581_SID::CH2_PULSE_WIDTH
(byte) MOS6581_SID::CH2_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH3_ATTACK_DECAY
(byte) MOS6581_SID::CH3_CONTROL
(byte) MOS6581_SID::CH3_ENV
(word) MOS6581_SID::CH3_FREQ
(byte) MOS6581_SID::CH3_OSC
(word) MOS6581_SID::CH3_PULSE_WIDTH
(byte) MOS6581_SID::CH3_SUSTAIN_RELEASE
(byte) MOS6581_SID::FILTER_CUTOFF_HIGH
(byte) MOS6581_SID::FILTER_CUTOFF_LOW
(byte) MOS6581_SID::FILTER_SETUP
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = (byte) $16
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify byte*) PROCPORT = (byte*)(number) 1
(const byte*) SCREEN = (byte*)(number) $400
(const byte*) SCROLL = (byte*)(number) $d016
(const byte*) TEXT = (byte*) "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =- "
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*)(number) $d000
(byte) current_bit
(byte) current_bit#0
(byte) current_bit#1
@ -615,14 +701,14 @@ SYMBOL TABLE SSA
(label) scroll_soft::@return
Adding number conversion cast (unumber) $20 in (byte) fillscreen::fill#0 ← (number) $20
Adding number conversion cast (unumber) $fe in (bool~) main::$1 ← *((const byte*) RASTER) != (number) $fe
Adding number conversion cast (unumber) $ff in (bool~) main::$2 ← *((const byte*) RASTER) != (number) $ff
Adding number conversion cast (unumber) $fe in (bool~) main::$1 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $fe
Adding number conversion cast (unumber) $ff in (bool~) main::$2 ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER) != (number) $ff
Adding number conversion cast (unumber) $ff in (bool~) scroll_soft::$0 ← (byte) scroll#3 == (number) $ff
Adding number conversion cast (unumber) 7 in (byte) scroll#4 ← (number) 7
Adding number conversion cast (unumber) 2 in (number~) scroll_bit::$0 ← (byte) current_bit#13 / (number) 2
Adding number conversion cast (unumber) scroll_bit::$0 in (number~) scroll_bit::$0 ← (byte) current_bit#13 / (unumber)(number) 2
Adding number conversion cast (unumber) 0 in (bool~) scroll_bit::$1 ← (byte) current_bit#5 == (number) 0
Adding number conversion cast (unumber) $32 in *((const byte*) PROCPORT) ← (number) $32
Adding number conversion cast (unumber) $32 in *((const nomodify byte*) PROCPORT) ← (number) $32
Adding number conversion cast (unumber) $28 in (byte*~) scroll_bit::$4 ← (const byte*) SCREEN + (number) $28
Adding number conversion cast (unumber) $27 in (byte*~) scroll_bit::$5 ← (byte*~) scroll_bit::$4 + (number) $27
Adding number conversion cast (unumber) 8 in (number~) scroll_bit::$7 ← (word) scroll_bit::c#0 * (number) 8
@ -632,7 +718,7 @@ Adding number conversion cast (unumber) 0 in (bool~) scroll_bit::$10 ← (byte~)
Adding number conversion cast (unumber) $28 in (byte*~) scroll_bit::$12 ← (byte*) scroll_bit::sc#2 + (number) $28
Adding number conversion cast (unumber) $80+' ' in (byte) scroll_bit::b#1 ← (number) $80+(byte) ' '
Adding number conversion cast (unumber) $80 in (byte) scroll_bit::b#1 ← ((unumber)) (number) $80+(byte) ' '
Adding number conversion cast (unumber) $37 in *((const byte*) PROCPORT) ← (number) $37
Adding number conversion cast (unumber) $37 in *((const nomodify byte*) PROCPORT) ← (number) $37
Adding number conversion cast (unumber) 0 in (bool~) next_char::$0 ← (byte) next_char::c#0 == (number) 0
Adding number conversion cast (unumber) $27 in (bool~) scroll_hard::$0 ← (byte) scroll_hard::i#2 != (number) $27
Adding number conversion cast (unumber) $28*0 in (byte*~) scroll_hard::$1 ← (const byte*) SCREEN + (number) $28*(number) 0
@ -671,17 +757,15 @@ Adding number conversion cast (unumber) $3e8 in (byte*~) fillscreen::$0 ← (byt
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte) fillscreen::fill#0 ← (unumber)(number) $20
Inlining cast (byte) scroll#4 ← (unumber)(number) 7
Inlining cast *((const byte*) PROCPORT) ← (unumber)(number) $32
Inlining cast *((const nomodify byte*) PROCPORT) ← (unumber)(number) $32
Inlining cast (byte) current_bit#6 ← (unumber)(number) $80
Inlining cast (byte) scroll_bit::b#1 ← (unumber)(unumber)(number) $80+(byte) ' '
Inlining cast *((const byte*) PROCPORT) ← (unumber)(number) $37
Inlining cast *((const nomodify byte*) PROCPORT) ← (unumber)(number) $37
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 1
Simplifying constant pointer cast (byte*) 53248
Simplifying constant pointer cast (struct MOS6569_VICII*) 53248
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53270
Simplifying constant integer cast $20
Simplifying constant integer cast $fe
Simplifying constant integer cast $ff
@ -854,8 +938,8 @@ Identical Phi Values (byte) current_bit#16 (byte) current_bit#0
Identical Phi Values (byte*) nxt#10 (byte*) nxt#0
Identical Phi Values (byte*) current_chargen#14 (byte*) current_chargen#0
Successful SSA optimization Pass2IdenticalPhiElimination
Simple Condition (bool~) main::$1 [6] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1
Simple Condition (bool~) main::$2 [9] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2
Simple Condition (bool~) main::$1 [6] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@1
Simple Condition (bool~) main::$2 [9] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@2
Simple Condition (bool~) scroll_soft::$1 [20] if((byte) scroll#3!=(byte) $ff) goto scroll_soft::@1
Simple Condition (bool~) scroll_bit::$2 [32] if((byte) current_bit#5!=(byte) 0) goto scroll_bit::@1
Simple Condition (bool~) scroll_bit::$11 [52] if((byte~) scroll_bit::$9==(byte) 0) goto scroll_bit::@4
@ -962,7 +1046,7 @@ Constant inlined scroll_bit::r#0 = (byte) 0
Constant inlined current_bit#23 = (byte) 1
Constant inlined fillscreen::screen#0 = (const byte*) SCREEN
Constant inlined nxt#8 = (const byte*) TEXT
Constant inlined current_chargen#21 = (const byte*) CHARGEN
Constant inlined current_chargen#21 = (const nomodify byte*) CHARGEN
Constant inlined scroll_hard::$8 = (const byte*) SCREEN+(byte)(number) $28*(number) 2
Constant inlined scroll_hard::$7 = (const byte*) SCREEN+(byte)(number) $28*(number) 2
Constant inlined scroll_hard::$20 = (const byte*) SCREEN+(byte)(number) $28*(number) 6
@ -1089,21 +1173,21 @@ main: scope:[main] from @1
[5] call fillscreen
to:main::@1
main::@1: scope:[main] from main main::@1 main::@4
[6] (byte*) current_chargen#27 ← phi( main::@1/(byte*) current_chargen#27 main/(const byte*) CHARGEN main::@4/(byte*) current_chargen#11 )
[6] (byte*) current_chargen#27 ← phi( main::@1/(byte*) current_chargen#27 main/(const nomodify byte*) CHARGEN main::@4/(byte*) current_chargen#11 )
[6] (byte*) nxt#31 ← phi( main::@1/(byte*) nxt#31 main/(const byte*) TEXT main::@4/(byte*) nxt#14 )
[6] (byte) current_bit#29 ← phi( main::@1/(byte) current_bit#29 main/(byte) 1 main::@4/(byte) current_bit#12 )
[6] (byte) scroll#18 ← phi( main::@1/(byte) scroll#18 main/(byte) 7 main::@4/(byte) scroll#10 )
[7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1
[7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@1
to:main::@2
main::@2: scope:[main] from main::@1 main::@2
[8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2
[8] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@2
to:main::@3
main::@3: scope:[main] from main::@2
[9] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL)
[9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR)
[10] call scroll_soft
to:main::@4
main::@4: scope:[main] from main::@3
[11] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL)
[11] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR)
to:main::@1
(void()) scroll_soft()
@ -1120,7 +1204,7 @@ scroll_soft::@1: scope:[scroll_soft] from scroll_soft scroll_soft::@2
[16] (byte*) nxt#14 ← phi( scroll_soft/(byte*) nxt#31 scroll_soft::@2/(byte*) nxt#35 )
[16] (byte) current_bit#12 ← phi( scroll_soft/(byte) current_bit#29 scroll_soft::@2/(byte) current_bit#21 )
[16] (byte) scroll#10 ← phi( scroll_soft/(byte) scroll#3 scroll_soft::@2/(byte) 7 )
[17] *((const byte*) SCROLL) ← (byte) scroll#10
[17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte) scroll#10
to:scroll_soft::@return
scroll_soft::@return: scope:[scroll_soft] from scroll_soft::@1
[18] return
@ -1139,7 +1223,7 @@ scroll_bit::@2: scope:[scroll_bit] from scroll_bit
scroll_bit::@8: scope:[scroll_bit] from scroll_bit::@2
[24] (word) scroll_bit::c#0 ← (byte) next_char::return#0
[25] (word~) scroll_bit::$7 ← (word) scroll_bit::c#0 << (byte) 3
[26] (byte*) current_chargen#5 ← (const byte*) CHARGEN + (word~) scroll_bit::$7
[26] (byte*) current_chargen#5 ← (const nomodify byte*) CHARGEN + (word~) scroll_bit::$7
to:scroll_bit::@1
scroll_bit::@1: scope:[scroll_bit] from scroll_bit scroll_bit::@8
[27] (byte*) nxt#35 ← phi( scroll_bit/(byte*) nxt#31 scroll_bit::@8/(byte*) nxt#19 )
@ -1149,7 +1233,7 @@ scroll_bit::@1: scope:[scroll_bit] from scroll_bit scroll_bit::@8
to:scroll_bit::@7
scroll_bit::@7: scope:[scroll_bit] from scroll_bit::@1
asm { sei }
[30] *((const byte*) PROCPORT) ← (byte) $32
[30] *((const nomodify byte*) PROCPORT) ← (byte) $32
to:scroll_bit::@3
scroll_bit::@3: scope:[scroll_bit] from scroll_bit::@4 scroll_bit::@7
[31] (byte*) scroll_bit::sc#2 ← phi( scroll_bit::@4/(byte*) scroll_bit::sc#1 scroll_bit::@7/(const byte*) SCREEN+(byte) $28+(byte) $27 )
@ -1169,7 +1253,7 @@ scroll_bit::@4: scope:[scroll_bit] from scroll_bit::@3 scroll_bit::@5
[40] if((byte) scroll_bit::r#1!=(byte) 8) goto scroll_bit::@3
to:scroll_bit::@6
scroll_bit::@6: scope:[scroll_bit] from scroll_bit::@4
[41] *((const byte*) PROCPORT) ← (byte) $37
[41] *((const nomodify byte*) PROCPORT) ← (byte) $37
asm { cli }
to:scroll_bit::@return
scroll_bit::@return: scope:[scroll_bit] from scroll_bit::@6
@ -1234,6 +1318,90 @@ fillscreen::@2: scope:[fillscreen] from fillscreen::@1
VARIABLE REGISTER WEIGHTS
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
(byte) MOS6526_CIA::PORT_A_DDR
(byte) MOS6526_CIA::PORT_B
(byte) MOS6526_CIA::PORT_B_DDR
(byte) MOS6526_CIA::SERIAL_DATA
(word) MOS6526_CIA::TIMER_A
(byte) MOS6526_CIA::TIMER_A_CONTROL
(word) MOS6526_CIA::TIMER_B
(byte) MOS6526_CIA::TIMER_B_CONTROL
(byte) MOS6526_CIA::TOD_10THS
(byte) MOS6526_CIA::TOD_HOURS
(byte) MOS6526_CIA::TOD_MIN
(byte) MOS6526_CIA::TOD_SEC
(byte) MOS6569_VICII::BG_COLOR
(byte) MOS6569_VICII::BG_COLOR1
(byte) MOS6569_VICII::BG_COLOR2
(byte) MOS6569_VICII::BG_COLOR3
(byte) MOS6569_VICII::BORDER_COLOR
(byte) MOS6569_VICII::CONTROL1
(byte) MOS6569_VICII::CONTROL2
(byte) MOS6569_VICII::IRQ_ENABLE
(byte) MOS6569_VICII::IRQ_STATUS
(byte) MOS6569_VICII::LIGHTPEN_X
(byte) MOS6569_VICII::LIGHTPEN_Y
(byte) MOS6569_VICII::MEMORY
(byte) MOS6569_VICII::RASTER
(byte) MOS6569_VICII::SPRITE0_COLOR
(byte) MOS6569_VICII::SPRITE0_X
(byte) MOS6569_VICII::SPRITE0_Y
(byte) MOS6569_VICII::SPRITE1_COLOR
(byte) MOS6569_VICII::SPRITE1_X
(byte) MOS6569_VICII::SPRITE1_Y
(byte) MOS6569_VICII::SPRITE2_COLOR
(byte) MOS6569_VICII::SPRITE2_X
(byte) MOS6569_VICII::SPRITE2_Y
(byte) MOS6569_VICII::SPRITE3_COLOR
(byte) MOS6569_VICII::SPRITE3_X
(byte) MOS6569_VICII::SPRITE3_Y
(byte) MOS6569_VICII::SPRITE4_COLOR
(byte) MOS6569_VICII::SPRITE4_X
(byte) MOS6569_VICII::SPRITE4_Y
(byte) MOS6569_VICII::SPRITE5_COLOR
(byte) MOS6569_VICII::SPRITE5_X
(byte) MOS6569_VICII::SPRITE5_Y
(byte) MOS6569_VICII::SPRITE6_COLOR
(byte) MOS6569_VICII::SPRITE6_X
(byte) MOS6569_VICII::SPRITE6_Y
(byte) MOS6569_VICII::SPRITE7_COLOR
(byte) MOS6569_VICII::SPRITE7_X
(byte) MOS6569_VICII::SPRITE7_Y
(byte) MOS6569_VICII::SPRITES_BG_COLLISION
(byte) MOS6569_VICII::SPRITES_COLLISION
(byte) MOS6569_VICII::SPRITES_ENABLE
(byte) MOS6569_VICII::SPRITES_EXPAND_X
(byte) MOS6569_VICII::SPRITES_EXPAND_Y
(byte) MOS6569_VICII::SPRITES_MC
(byte) MOS6569_VICII::SPRITES_MCOLOR1
(byte) MOS6569_VICII::SPRITES_MCOLOR2
(byte) MOS6569_VICII::SPRITES_PRIORITY
(byte) MOS6569_VICII::SPRITES_XMSB
(byte) MOS6581_SID::CH1_ATTACK_DECAY
(byte) MOS6581_SID::CH1_CONTROL
(word) MOS6581_SID::CH1_FREQ
(word) MOS6581_SID::CH1_PULSE_WIDTH
(byte) MOS6581_SID::CH1_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH2_ATTACK_DECAY
(byte) MOS6581_SID::CH2_CONTROL
(word) MOS6581_SID::CH2_FREQ
(word) MOS6581_SID::CH2_PULSE_WIDTH
(byte) MOS6581_SID::CH2_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH3_ATTACK_DECAY
(byte) MOS6581_SID::CH3_CONTROL
(byte) MOS6581_SID::CH3_ENV
(word) MOS6581_SID::CH3_FREQ
(byte) MOS6581_SID::CH3_OSC
(word) MOS6581_SID::CH3_PULSE_WIDTH
(byte) MOS6581_SID::CH3_SUSTAIN_RELEASE
(byte) MOS6581_SID::FILTER_CUTOFF_HIGH
(byte) MOS6581_SID::FILTER_CUTOFF_LOW
(byte) MOS6581_SID::FILTER_SETUP
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(byte) current_bit
(byte) current_bit#12 420.59999999999997
(byte) current_bit#21 56166.83333333333
@ -1346,12 +1514,16 @@ Target platform is c64basic / MOS6502X
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
// Processor Port Register controlling RAM/ROM configuration and the datasette
.label PROCPORT = 1
// The address of the CHARGEN character set
.label CHARGEN = $d000
// The VIC-II MOS 6567/6569
.label VICII = $d000
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16
.label SCREEN = $400
.label RASTER = $d012
.label BGCOL = $d020
.label SCROLL = $d016
// Soft-scroll using $d016 - trigger bit-scroll/char-scroll when needed
.label scroll = 2
.label current_bit = 3
@ -1382,7 +1554,7 @@ main: {
jsr fillscreen
// [6] phi from main to main::@1 [phi:main->main::@1]
__b1_from_main:
// [6] phi (byte*) current_chargen#27 = (const byte*) CHARGEN [phi:main->main::@1#0] -- pbuz1=pbuc1
// [6] phi (byte*) current_chargen#27 = (const nomodify byte*) CHARGEN [phi:main->main::@1#0] -- pbuz1=pbuc1
lda #<CHARGEN
sta.z current_chargen
lda #>CHARGEN
@ -1410,29 +1582,29 @@ main: {
jmp __b1
// main::@1
__b1:
// [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
// [7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$fe
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b1_from___b1
jmp __b2
// main::@2
__b2:
// [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// [8] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
jmp __b3
// main::@3
__b3:
// [9] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BGCOL
// [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// [10] call scroll_soft
jsr scroll_soft
jmp __b4
// main::@4
__b4:
// [11] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BGCOL
// [11] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
jmp __b1_from___b4
}
// scroll_soft
@ -1468,9 +1640,9 @@ scroll_soft: {
jmp __b1
// scroll_soft::@1
__b1:
// [17] *((const byte*) SCROLL) ← (byte) scroll#10 -- _deref_pbuc1=vbuz1
// [17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte) scroll#10 -- _deref_pbuc1=vbuz1
lda.z scroll
sta SCROLL
sta VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2
jmp __breturn
// scroll_soft::@return
__breturn:
@ -1521,7 +1693,7 @@ scroll_bit: {
rol.z __7+1
asl.z __7
rol.z __7+1
// [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN + (word~) scroll_bit::$7 -- pbuz1=pbuc1_plus_vwuz2
// [26] (byte*) current_chargen#5 ← (const nomodify byte*) CHARGEN + (word~) scroll_bit::$7 -- pbuz1=pbuc1_plus_vwuz2
lda.z __7
clc
adc #<CHARGEN
@ -1554,7 +1726,7 @@ scroll_bit: {
__b7:
// asm { sei }
sei
// [30] *((const byte*) PROCPORT) ← (byte) $32 -- _deref_pbuc1=vbuc2
// [30] *((const nomodify byte*) PROCPORT) ← (byte) $32 -- _deref_pbuc1=vbuc2
lda #$32
sta PROCPORT
// [31] phi from scroll_bit::@7 to scroll_bit::@3 [phi:scroll_bit::@7->scroll_bit::@3]
@ -1627,7 +1799,7 @@ scroll_bit: {
jmp __b6
// scroll_bit::@6
__b6:
// [41] *((const byte*) PROCPORT) ← (byte) $37 -- _deref_pbuc1=vbuc2
// [41] *((const nomodify byte*) PROCPORT) ← (byte) $37 -- _deref_pbuc1=vbuc2
lda #$37
sta PROCPORT
// asm { cli }
@ -1797,21 +1969,21 @@ fillscreen: {
.byte 0
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ( main:2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] { } ) always clobbers reg byte a
Statement [7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@1 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ( main:2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ scroll#18 scroll#10 scroll#3 ]
Removing always clobbered register reg byte a as potential for zp[1]:3 [ current_bit#29 current_bit#12 current_bit#21 current_bit#5 ]
Statement [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ( main:2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] { } ) always clobbers reg byte a
Statement [8] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ( main:2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] { } ) always clobbers reg byte a
Statement [24] (word) scroll_bit::c#0 ← (byte) next_char::return#0 [ scroll_bit::c#0 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ scroll_bit::c#0 nxt#19 ] { } ) always clobbers reg byte a
Statement [25] (word~) scroll_bit::$7 ← (word) scroll_bit::c#0 << (byte) 3 [ scroll_bit::$7 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ scroll_bit::$7 nxt#19 ] { } ) always clobbers reg byte a
Statement [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN + (word~) scroll_bit::$7 [ current_chargen#5 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_chargen#5 nxt#19 ] { } ) always clobbers reg byte a
Statement [30] *((const byte*) PROCPORT) ← (byte) $32 [ current_bit#21 nxt#35 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 ] { } ) always clobbers reg byte a
Statement [26] (byte*) current_chargen#5 ← (const nomodify byte*) CHARGEN + (word~) scroll_bit::$7 [ current_chargen#5 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_chargen#5 nxt#19 ] { } ) always clobbers reg byte a
Statement [30] *((const nomodify byte*) PROCPORT) ← (byte) $32 [ current_bit#21 nxt#35 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 ] { } ) always clobbers reg byte a
Statement [32] (byte) scroll_bit::bits#0 ← *((byte*) current_chargen#19 + (byte) scroll_bit::r#2) [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 scroll_bit::bits#0 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 scroll_bit::bits#0 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:6 [ scroll_bit::r#2 scroll_bit::r#1 ]
Statement [37] *((byte*) scroll_bit::sc#2) ← (byte) scroll_bit::b#2 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 ] { } ) always clobbers reg byte y
Removing always clobbered register reg byte y as potential for zp[1]:3 [ current_bit#29 current_bit#12 current_bit#21 current_bit#5 ]
Removing always clobbered register reg byte y as potential for zp[1]:6 [ scroll_bit::r#2 scroll_bit::r#1 ]
Statement [38] (byte*) scroll_bit::sc#1 ← (byte*) scroll_bit::sc#2 + (byte) $28 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#1 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#1 ] { } ) always clobbers reg byte a
Statement [41] *((const byte*) PROCPORT) ← (byte) $37 [ current_bit#21 nxt#35 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 ] { } ) always clobbers reg byte a
Statement [41] *((const nomodify byte*) PROCPORT) ← (byte) $37 [ current_bit#21 nxt#35 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 ] { } ) always clobbers reg byte a
Statement [48] *((const byte*) SCREEN + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:10 [ scroll_hard::i#2 scroll_hard::i#1 ]
Statement [49] *((const byte*) SCREEN+(byte)(number) $28*(number) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 1+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] { } ) always clobbers reg byte a
@ -1824,16 +1996,16 @@ Statement [55] *((const byte*) SCREEN+(word)(number) $28*(number) 7 + (byte) scr
Statement [57] (byte) next_char::c#0 ← *((byte*) nxt#31) [ nxt#31 next_char::c#0 ] ( main:2::scroll_soft:10::scroll_bit:15::next_char:22 [ nxt#31 next_char::c#0 ] { { next_char::return#0 = next_char::return#1 } } ) always clobbers reg byte a reg byte y
Statement [65] if((byte*) fillscreen::cursor#2<(const byte*) SCREEN+(word) $3e8) goto fillscreen::@2 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] { } ) always clobbers reg byte a
Statement [67] *((byte*) fillscreen::cursor#2) ← (const byte) fillscreen::fill#0 [ fillscreen::cursor#2 ] ( main:2::fillscreen:5 [ fillscreen::cursor#2 ] { } ) always clobbers reg byte a reg byte y
Statement [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ( main:2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] { } ) always clobbers reg byte a
Statement [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ( main:2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] { } ) always clobbers reg byte a
Statement [7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@1 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ( main:2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] { } ) always clobbers reg byte a
Statement [8] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] ( main:2 [ scroll#18 current_bit#29 nxt#31 current_chargen#27 ] { } ) always clobbers reg byte a
Statement [24] (word) scroll_bit::c#0 ← (byte) next_char::return#0 [ scroll_bit::c#0 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ scroll_bit::c#0 nxt#19 ] { } ) always clobbers reg byte a
Statement [25] (word~) scroll_bit::$7 ← (word) scroll_bit::c#0 << (byte) 3 [ scroll_bit::$7 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ scroll_bit::$7 nxt#19 ] { } ) always clobbers reg byte a
Statement [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN + (word~) scroll_bit::$7 [ current_chargen#5 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_chargen#5 nxt#19 ] { } ) always clobbers reg byte a
Statement [30] *((const byte*) PROCPORT) ← (byte) $32 [ current_bit#21 nxt#35 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 ] { } ) always clobbers reg byte a
Statement [26] (byte*) current_chargen#5 ← (const nomodify byte*) CHARGEN + (word~) scroll_bit::$7 [ current_chargen#5 nxt#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_chargen#5 nxt#19 ] { } ) always clobbers reg byte a
Statement [30] *((const nomodify byte*) PROCPORT) ← (byte) $32 [ current_bit#21 nxt#35 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 ] { } ) always clobbers reg byte a
Statement [32] (byte) scroll_bit::bits#0 ← *((byte*) current_chargen#19 + (byte) scroll_bit::r#2) [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 scroll_bit::bits#0 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 scroll_bit::bits#0 ] { } ) always clobbers reg byte a reg byte y
Statement [37] *((byte*) scroll_bit::sc#2) ← (byte) scroll_bit::b#2 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#2 ] { } ) always clobbers reg byte y
Statement [38] (byte*) scroll_bit::sc#1 ← (byte*) scroll_bit::sc#2 + (byte) $28 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#1 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 scroll_bit::r#2 scroll_bit::sc#1 ] { } ) always clobbers reg byte a
Statement [41] *((const byte*) PROCPORT) ← (byte) $37 [ current_bit#21 nxt#35 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 ] { } ) always clobbers reg byte a
Statement [41] *((const nomodify byte*) PROCPORT) ← (byte) $37 [ current_bit#21 nxt#35 current_chargen#19 ] ( main:2::scroll_soft:10::scroll_bit:15 [ current_bit#21 nxt#35 current_chargen#19 ] { } ) always clobbers reg byte a
Statement [48] *((const byte*) SCREEN + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] { } ) always clobbers reg byte a
Statement [49] *((const byte*) SCREEN+(byte)(number) $28*(number) 1 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 1+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] { } ) always clobbers reg byte a
Statement [50] *((const byte*) SCREEN+(byte)(number) $28*(number) 2 + (byte) scroll_hard::i#2) ← *((const byte*) SCREEN+(byte)(number) $28*(number) 2+(byte) 1 + (byte) scroll_hard::i#2) [ scroll_hard::i#2 ] ( main:2::scroll_soft:10::scroll_bit:15::scroll_hard:28 [ current_bit#21 nxt#35 current_chargen#19 scroll_hard::i#2 ] { } ) always clobbers reg byte a
@ -1867,6 +2039,9 @@ Uplift Scope [scroll_bit] 2,000,002: zp[1]:21 [ scroll_bit::bits#0 ] 2,000,002:
Uplift Scope [next_char] 402,504.25: zp[1]:13 [ next_char::return#1 next_char::c#0 next_char::c#1 ] 20,002: zp[1]:16 [ next_char::return#0 ]
Uplift Scope [] 235,062.92: zp[2]:11 [ nxt#18 nxt#31 nxt#14 nxt#35 nxt#19 ] 78,601.16: zp[2]:4 [ current_chargen#27 current_chargen#11 current_chargen#19 current_chargen#5 ] 73,461.08: zp[1]:3 [ current_bit#29 current_bit#12 current_bit#21 current_bit#5 ] 2,698.1: zp[1]:2 [ scroll#18 scroll#10 scroll#3 ]
Uplift Scope [fillscreen] 3,336.67: zp[2]:14 [ fillscreen::cursor#2 fillscreen::cursor#1 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [MOS6569_VICII]
Uplift Scope [MOS6581_SID]
Uplift Scope [main]
Uplift Scope [scroll_soft]
@ -1876,6 +2051,9 @@ Limited combination testing to 100 combinations of 128 possible.
Uplifting [next_char] best 24648 combination reg byte x [ next_char::return#1 next_char::c#0 next_char::c#1 ] reg byte a [ next_char::return#0 ]
Uplifting [] best 24336 combination zp[2]:11 [ nxt#18 nxt#31 nxt#14 nxt#35 nxt#19 ] zp[2]:4 [ current_chargen#27 current_chargen#11 current_chargen#19 current_chargen#5 ] zp[1]:3 [ current_bit#29 current_bit#12 current_bit#21 current_bit#5 ] reg byte x [ scroll#18 scroll#10 scroll#3 ]
Uplifting [fillscreen] best 24336 combination zp[2]:14 [ fillscreen::cursor#2 fillscreen::cursor#1 ]
Uplifting [MOS6526_CIA] best 24336 combination
Uplifting [MOS6569_VICII] best 24336 combination
Uplifting [MOS6581_SID] best 24336 combination
Uplifting [main] best 24336 combination
Uplifting [scroll_soft] best 24336 combination
Attempting to uplift remaining variables inzp[1]:3 [ current_bit#29 current_bit#12 current_bit#21 current_bit#5 ]
@ -1896,12 +2074,16 @@ ASSEMBLER BEFORE OPTIMIZATION
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
// Processor Port Register controlling RAM/ROM configuration and the datasette
.label PROCPORT = 1
// The address of the CHARGEN character set
.label CHARGEN = $d000
// The VIC-II MOS 6567/6569
.label VICII = $d000
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16
.label SCREEN = $400
.label RASTER = $d012
.label BGCOL = $d020
.label SCROLL = $d016
.label current_bit = 2
// Scroll the next bit from the current char onto the screen - trigger next char if needed
.label current_chargen = 3
@ -1930,7 +2112,7 @@ main: {
jsr fillscreen
// [6] phi from main to main::@1 [phi:main->main::@1]
__b1_from_main:
// [6] phi (byte*) current_chargen#27 = (const byte*) CHARGEN [phi:main->main::@1#0] -- pbuz1=pbuc1
// [6] phi (byte*) current_chargen#27 = (const nomodify byte*) CHARGEN [phi:main->main::@1#0] -- pbuz1=pbuc1
lda #<CHARGEN
sta.z current_chargen
lda #>CHARGEN
@ -1957,29 +2139,29 @@ main: {
jmp __b1
// main::@1
__b1:
// [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
// [7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$fe
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b1_from___b1
jmp __b2
// main::@2
__b2:
// [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// [8] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
jmp __b3
// main::@3
__b3:
// [9] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BGCOL
// [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// [10] call scroll_soft
jsr scroll_soft
jmp __b4
// main::@4
__b4:
// [11] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BGCOL
// [11] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
jmp __b1_from___b4
}
// scroll_soft
@ -2013,8 +2195,8 @@ scroll_soft: {
jmp __b1
// scroll_soft::@1
__b1:
// [17] *((const byte*) SCROLL) ← (byte) scroll#10 -- _deref_pbuc1=vbuxx
stx SCROLL
// [17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte) scroll#10 -- _deref_pbuc1=vbuxx
stx VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2
jmp __breturn
// scroll_soft::@return
__breturn:
@ -2055,7 +2237,7 @@ scroll_bit: {
rol.z __7+1
asl.z __7
rol.z __7+1
// [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN + (word~) scroll_bit::$7 -- pbuz1=pbuc1_plus_vwuz1
// [26] (byte*) current_chargen#5 ← (const nomodify byte*) CHARGEN + (word~) scroll_bit::$7 -- pbuz1=pbuc1_plus_vwuz1
clc
lda.z current_chargen
adc #<CHARGEN
@ -2088,7 +2270,7 @@ scroll_bit: {
__b7:
// asm { sei }
sei
// [30] *((const byte*) PROCPORT) ← (byte) $32 -- _deref_pbuc1=vbuc2
// [30] *((const nomodify byte*) PROCPORT) ← (byte) $32 -- _deref_pbuc1=vbuc2
lda #$32
sta PROCPORT
// [31] phi from scroll_bit::@7 to scroll_bit::@3 [phi:scroll_bit::@7->scroll_bit::@3]
@ -2153,7 +2335,7 @@ scroll_bit: {
jmp __b6
// scroll_bit::@6
__b6:
// [41] *((const byte*) PROCPORT) ← (byte) $37 -- _deref_pbuc1=vbuc2
// [41] *((const nomodify byte*) PROCPORT) ← (byte) $37 -- _deref_pbuc1=vbuc2
lda #$37
sta PROCPORT
// asm { cli }
@ -2399,13 +2581,98 @@ FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const byte*) BGCOL = (byte*) 53280
(const byte*) CHARGEN = (byte*) 53248
(const byte*) PROCPORT = (byte*) 1
(const byte*) RASTER = (byte*) 53266
(const nomodify byte*) CHARGEN = (byte*) 53248
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
(byte) MOS6526_CIA::PORT_A_DDR
(byte) MOS6526_CIA::PORT_B
(byte) MOS6526_CIA::PORT_B_DDR
(byte) MOS6526_CIA::SERIAL_DATA
(word) MOS6526_CIA::TIMER_A
(byte) MOS6526_CIA::TIMER_A_CONTROL
(word) MOS6526_CIA::TIMER_B
(byte) MOS6526_CIA::TIMER_B_CONTROL
(byte) MOS6526_CIA::TOD_10THS
(byte) MOS6526_CIA::TOD_HOURS
(byte) MOS6526_CIA::TOD_MIN
(byte) MOS6526_CIA::TOD_SEC
(byte) MOS6569_VICII::BG_COLOR
(byte) MOS6569_VICII::BG_COLOR1
(byte) MOS6569_VICII::BG_COLOR2
(byte) MOS6569_VICII::BG_COLOR3
(byte) MOS6569_VICII::BORDER_COLOR
(byte) MOS6569_VICII::CONTROL1
(byte) MOS6569_VICII::CONTROL2
(byte) MOS6569_VICII::IRQ_ENABLE
(byte) MOS6569_VICII::IRQ_STATUS
(byte) MOS6569_VICII::LIGHTPEN_X
(byte) MOS6569_VICII::LIGHTPEN_Y
(byte) MOS6569_VICII::MEMORY
(byte) MOS6569_VICII::RASTER
(byte) MOS6569_VICII::SPRITE0_COLOR
(byte) MOS6569_VICII::SPRITE0_X
(byte) MOS6569_VICII::SPRITE0_Y
(byte) MOS6569_VICII::SPRITE1_COLOR
(byte) MOS6569_VICII::SPRITE1_X
(byte) MOS6569_VICII::SPRITE1_Y
(byte) MOS6569_VICII::SPRITE2_COLOR
(byte) MOS6569_VICII::SPRITE2_X
(byte) MOS6569_VICII::SPRITE2_Y
(byte) MOS6569_VICII::SPRITE3_COLOR
(byte) MOS6569_VICII::SPRITE3_X
(byte) MOS6569_VICII::SPRITE3_Y
(byte) MOS6569_VICII::SPRITE4_COLOR
(byte) MOS6569_VICII::SPRITE4_X
(byte) MOS6569_VICII::SPRITE4_Y
(byte) MOS6569_VICII::SPRITE5_COLOR
(byte) MOS6569_VICII::SPRITE5_X
(byte) MOS6569_VICII::SPRITE5_Y
(byte) MOS6569_VICII::SPRITE6_COLOR
(byte) MOS6569_VICII::SPRITE6_X
(byte) MOS6569_VICII::SPRITE6_Y
(byte) MOS6569_VICII::SPRITE7_COLOR
(byte) MOS6569_VICII::SPRITE7_X
(byte) MOS6569_VICII::SPRITE7_Y
(byte) MOS6569_VICII::SPRITES_BG_COLLISION
(byte) MOS6569_VICII::SPRITES_COLLISION
(byte) MOS6569_VICII::SPRITES_ENABLE
(byte) MOS6569_VICII::SPRITES_EXPAND_X
(byte) MOS6569_VICII::SPRITES_EXPAND_Y
(byte) MOS6569_VICII::SPRITES_MC
(byte) MOS6569_VICII::SPRITES_MCOLOR1
(byte) MOS6569_VICII::SPRITES_MCOLOR2
(byte) MOS6569_VICII::SPRITES_PRIORITY
(byte) MOS6569_VICII::SPRITES_XMSB
(byte) MOS6581_SID::CH1_ATTACK_DECAY
(byte) MOS6581_SID::CH1_CONTROL
(word) MOS6581_SID::CH1_FREQ
(word) MOS6581_SID::CH1_PULSE_WIDTH
(byte) MOS6581_SID::CH1_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH2_ATTACK_DECAY
(byte) MOS6581_SID::CH2_CONTROL
(word) MOS6581_SID::CH2_FREQ
(word) MOS6581_SID::CH2_PULSE_WIDTH
(byte) MOS6581_SID::CH2_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH3_ATTACK_DECAY
(byte) MOS6581_SID::CH3_CONTROL
(byte) MOS6581_SID::CH3_ENV
(word) MOS6581_SID::CH3_FREQ
(byte) MOS6581_SID::CH3_OSC
(word) MOS6581_SID::CH3_PULSE_WIDTH
(byte) MOS6581_SID::CH3_SUSTAIN_RELEASE
(byte) MOS6581_SID::FILTER_CUTOFF_HIGH
(byte) MOS6581_SID::FILTER_CUTOFF_LOW
(byte) MOS6581_SID::FILTER_SETUP
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = (byte) $16
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify byte*) PROCPORT = (byte*) 1
(const byte*) SCREEN = (byte*) 1024
(const byte*) SCROLL = (byte*) 53270
(const byte*) TEXT = (byte*) "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =- "
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(byte) current_bit
(byte) current_bit#12 current_bit zp[1]:2 420.59999999999997
(byte) current_bit#21 current_bit zp[1]:2 56166.83333333333
@ -2511,12 +2778,16 @@ Score: 20886
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// Processor Port Register controlling RAM/ROM configuration and the datasette
.label PROCPORT = 1
// The address of the CHARGEN character set
.label CHARGEN = $d000
// The VIC-II MOS 6567/6569
.label VICII = $d000
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = $16
.label SCREEN = $400
.label RASTER = $d012
.label BGCOL = $d020
.label SCROLL = $d016
.label current_bit = 2
// Scroll the next bit from the current char onto the screen - trigger next char if needed
.label current_chargen = 3
@ -2535,7 +2806,7 @@ main: {
// [63] phi from main to fillscreen [phi:main->fillscreen]
jsr fillscreen
// [6] phi from main to main::@1 [phi:main->main::@1]
// [6] phi (byte*) current_chargen#27 = (const byte*) CHARGEN [phi:main->main::@1#0] -- pbuz1=pbuc1
// [6] phi (byte*) current_chargen#27 = (const nomodify byte*) CHARGEN [phi:main->main::@1#0] -- pbuz1=pbuc1
lda #<CHARGEN
sta.z current_chargen
lda #>CHARGEN
@ -2558,29 +2829,29 @@ main: {
// [6] phi (byte) scroll#18 = (byte) scroll#18 [phi:main::@1/main::@4->main::@1#3] -- register_copy
// main::@1
__b1:
// while(*RASTER!=$fe)
// [7] if(*((const byte*) RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
// while(VICII->RASTER!=$fe)
// [7] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $fe) goto main::@1 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$fe
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b1
// main::@2
__b2:
// while(*RASTER!=$ff)
// [8] if(*((const byte*) RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
// while(VICII->RASTER!=$ff)
// [8] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto main::@2 -- _deref_pbuc1_neq_vbuc2_then_la1
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
// main::@3
// ++*BGCOL;
// [9] *((const byte*) BGCOL) ← ++ *((const byte*) BGCOL) -- _deref_pbuc1=_inc__deref_pbuc1
inc BGCOL
// ++VICII->BG_COLOR;
// [9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) -- _deref_pbuc1=_inc__deref_pbuc1
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// scroll_soft()
// [10] call scroll_soft
jsr scroll_soft
// main::@4
// --*BGCOL;
// [11] *((const byte*) BGCOL) ← -- *((const byte*) BGCOL) -- _deref_pbuc1=_dec__deref_pbuc1
dec BGCOL
// --VICII->BG_COLOR;
// [11] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) -- _deref_pbuc1=_dec__deref_pbuc1
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
jmp __b1
}
// scroll_soft
@ -2609,9 +2880,9 @@ scroll_soft: {
// [16] phi (byte) scroll#10 = (byte) scroll#3 [phi:scroll_soft->scroll_soft::@1#3] -- register_copy
// scroll_soft::@1
__b1:
// *SCROLL = scroll
// [17] *((const byte*) SCROLL) ← (byte) scroll#10 -- _deref_pbuc1=vbuxx
stx SCROLL
// VICII->CONTROL2 = scroll
// [17] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2) ← (byte) scroll#10 -- _deref_pbuc1=vbuxx
stx VICII+OFFSET_STRUCT_MOS6569_VICII_CONTROL2
// scroll_soft::@return
// }
// [18] return
@ -2652,7 +2923,7 @@ scroll_bit: {
asl.z __7
rol.z __7+1
// current_chargen = CHARGEN+c*8
// [26] (byte*) current_chargen#5 ← (const byte*) CHARGEN + (word~) scroll_bit::$7 -- pbuz1=pbuc1_plus_vwuz1
// [26] (byte*) current_chargen#5 ← (const nomodify byte*) CHARGEN + (word~) scroll_bit::$7 -- pbuz1=pbuc1_plus_vwuz1
clc
lda.z current_chargen
adc #<CHARGEN
@ -2681,7 +2952,7 @@ scroll_bit: {
// asm { sei }
sei
// *PROCPORT = $32
// [30] *((const byte*) PROCPORT) ← (byte) $32 -- _deref_pbuc1=vbuc2
// [30] *((const nomodify byte*) PROCPORT) ← (byte) $32 -- _deref_pbuc1=vbuc2
lda #$32
sta PROCPORT
// [31] phi from scroll_bit::@7 to scroll_bit::@3 [phi:scroll_bit::@7->scroll_bit::@3]
@ -2742,7 +3013,7 @@ scroll_bit: {
bne __b3
// scroll_bit::@6
// *PROCPORT = $37
// [41] *((const byte*) PROCPORT) ← (byte) $37 -- _deref_pbuc1=vbuc2
// [41] *((const nomodify byte*) PROCPORT) ← (byte) $37 -- _deref_pbuc1=vbuc2
lda #$37
sta PROCPORT
// asm

View File

@ -1,13 +1,98 @@
(label) @1
(label) @begin
(label) @end
(const byte*) BGCOL = (byte*) 53280
(const byte*) CHARGEN = (byte*) 53248
(const byte*) PROCPORT = (byte*) 1
(const byte*) RASTER = (byte*) 53266
(const nomodify byte*) CHARGEN = (byte*) 53248
(byte) MOS6526_CIA::INTERRUPT
(byte) MOS6526_CIA::PORT_A
(byte) MOS6526_CIA::PORT_A_DDR
(byte) MOS6526_CIA::PORT_B
(byte) MOS6526_CIA::PORT_B_DDR
(byte) MOS6526_CIA::SERIAL_DATA
(word) MOS6526_CIA::TIMER_A
(byte) MOS6526_CIA::TIMER_A_CONTROL
(word) MOS6526_CIA::TIMER_B
(byte) MOS6526_CIA::TIMER_B_CONTROL
(byte) MOS6526_CIA::TOD_10THS
(byte) MOS6526_CIA::TOD_HOURS
(byte) MOS6526_CIA::TOD_MIN
(byte) MOS6526_CIA::TOD_SEC
(byte) MOS6569_VICII::BG_COLOR
(byte) MOS6569_VICII::BG_COLOR1
(byte) MOS6569_VICII::BG_COLOR2
(byte) MOS6569_VICII::BG_COLOR3
(byte) MOS6569_VICII::BORDER_COLOR
(byte) MOS6569_VICII::CONTROL1
(byte) MOS6569_VICII::CONTROL2
(byte) MOS6569_VICII::IRQ_ENABLE
(byte) MOS6569_VICII::IRQ_STATUS
(byte) MOS6569_VICII::LIGHTPEN_X
(byte) MOS6569_VICII::LIGHTPEN_Y
(byte) MOS6569_VICII::MEMORY
(byte) MOS6569_VICII::RASTER
(byte) MOS6569_VICII::SPRITE0_COLOR
(byte) MOS6569_VICII::SPRITE0_X
(byte) MOS6569_VICII::SPRITE0_Y
(byte) MOS6569_VICII::SPRITE1_COLOR
(byte) MOS6569_VICII::SPRITE1_X
(byte) MOS6569_VICII::SPRITE1_Y
(byte) MOS6569_VICII::SPRITE2_COLOR
(byte) MOS6569_VICII::SPRITE2_X
(byte) MOS6569_VICII::SPRITE2_Y
(byte) MOS6569_VICII::SPRITE3_COLOR
(byte) MOS6569_VICII::SPRITE3_X
(byte) MOS6569_VICII::SPRITE3_Y
(byte) MOS6569_VICII::SPRITE4_COLOR
(byte) MOS6569_VICII::SPRITE4_X
(byte) MOS6569_VICII::SPRITE4_Y
(byte) MOS6569_VICII::SPRITE5_COLOR
(byte) MOS6569_VICII::SPRITE5_X
(byte) MOS6569_VICII::SPRITE5_Y
(byte) MOS6569_VICII::SPRITE6_COLOR
(byte) MOS6569_VICII::SPRITE6_X
(byte) MOS6569_VICII::SPRITE6_Y
(byte) MOS6569_VICII::SPRITE7_COLOR
(byte) MOS6569_VICII::SPRITE7_X
(byte) MOS6569_VICII::SPRITE7_Y
(byte) MOS6569_VICII::SPRITES_BG_COLLISION
(byte) MOS6569_VICII::SPRITES_COLLISION
(byte) MOS6569_VICII::SPRITES_ENABLE
(byte) MOS6569_VICII::SPRITES_EXPAND_X
(byte) MOS6569_VICII::SPRITES_EXPAND_Y
(byte) MOS6569_VICII::SPRITES_MC
(byte) MOS6569_VICII::SPRITES_MCOLOR1
(byte) MOS6569_VICII::SPRITES_MCOLOR2
(byte) MOS6569_VICII::SPRITES_PRIORITY
(byte) MOS6569_VICII::SPRITES_XMSB
(byte) MOS6581_SID::CH1_ATTACK_DECAY
(byte) MOS6581_SID::CH1_CONTROL
(word) MOS6581_SID::CH1_FREQ
(word) MOS6581_SID::CH1_PULSE_WIDTH
(byte) MOS6581_SID::CH1_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH2_ATTACK_DECAY
(byte) MOS6581_SID::CH2_CONTROL
(word) MOS6581_SID::CH2_FREQ
(word) MOS6581_SID::CH2_PULSE_WIDTH
(byte) MOS6581_SID::CH2_SUSTAIN_RELEASE
(byte) MOS6581_SID::CH3_ATTACK_DECAY
(byte) MOS6581_SID::CH3_CONTROL
(byte) MOS6581_SID::CH3_ENV
(word) MOS6581_SID::CH3_FREQ
(byte) MOS6581_SID::CH3_OSC
(word) MOS6581_SID::CH3_PULSE_WIDTH
(byte) MOS6581_SID::CH3_SUSTAIN_RELEASE
(byte) MOS6581_SID::FILTER_CUTOFF_HIGH
(byte) MOS6581_SID::FILTER_CUTOFF_LOW
(byte) MOS6581_SID::FILTER_SETUP
(byte) MOS6581_SID::POT_X
(byte) MOS6581_SID::POT_Y
(byte) MOS6581_SID::VOLUME_FILTER_MODE
(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = (byte) $21
(const byte) OFFSET_STRUCT_MOS6569_VICII_CONTROL2 = (byte) $16
(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER = (byte) $12
(const nomodify byte*) PROCPORT = (byte*) 1
(const byte*) SCREEN = (byte*) 1024
(const byte*) SCROLL = (byte*) 53270
(const byte*) TEXT = (byte*) "-= this is rex of camelot testing a scroller created in kickc. kickc is an optimizing c-compiler for 6502 assembler. =- "
(const nomodify struct MOS6569_VICII*) VICII = (struct MOS6569_VICII*) 53248
(byte) current_bit
(byte) current_bit#12 current_bit zp[1]:2 420.59999999999997
(byte) current_bit#21 current_bit zp[1]:2 56166.83333333333

View File

@ -1,14 +1,11 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
.label RASTER = $d012
.label BORDERCOL = $d020
.label BGCOL = $d021
.label BGCOL2 = $d022
.label BGCOL3 = $d023
.label D016 = $d016
.const VIC_MCM = $10
.label D018 = $d018
// The VIC-II MOS 6567/6569
.label VICII = $d000
// Color Ram
.label COLS = $d800
// The colors of the C64
@ -23,6 +20,11 @@
.const PI_HALF_u4f28 = $1921fb54
.const XSIN_SIZE = $200
.const SIZEOF_SIGNED_WORD = 2
.const OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR = $20
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR1 = $22
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR = $21
.const OFFSET_STRUCT_MOS6569_VICII_BG_COLOR2 = $23
.const OFFSET_STRUCT_MOS6569_VICII_RASTER = $12
.label SCREEN = $400
.label LOGO = $2000
// Remainder after unsigned 16-bit division
@ -33,17 +35,17 @@ main: {
.const toD0181_return = (>(SCREEN&$3fff)*4)|(>LOGO)/4&$f
// asm
sei
// *BORDERCOL = WHITE
// VICII->BORDER_COLOR = WHITE
lda #WHITE
sta BORDERCOL
// *BGCOL2 = DARK_GREY
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// VICII->BG_COLOR1 = DARK_GREY
lda #DARK_GREY
sta BGCOL2
// *BGCOL = *BGCOL2 = DARK_GREY
sta BGCOL
// *BGCOL3 = BLACK
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR1
// VICII->BG_COLOR = VICII->BG_COLOR1 = DARK_GREY
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR
// VICII->BG_COLOR2 = BLACK
lda #BLACK
sta BGCOL3
sta VICII+OFFSET_STRUCT_MOS6569_VICII_BG_COLOR2
// *D018 = toD018(SCREEN, LOGO)
lda #toD0181_return
sta D018
@ -90,12 +92,12 @@ loop: {
__b1:
// Wait for the raster to reach the bottom of the screen
__b2:
// while(*RASTER!=$ff)
// while(VICII->RASTER!=$ff)
lda #$ff
cmp RASTER
cmp VICII+OFFSET_STRUCT_MOS6569_VICII_RASTER
bne __b2
// (*BORDERCOL)++;
inc BORDERCOL
// (VICII->BORDER_COLOR)++;
inc VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
// xsin+xsin_idx
lda.z xsin_idx
asl
@ -136,8 +138,8 @@ loop: {
sta.z xsin_idx
sta.z xsin_idx+1
__b4:
// (*BORDERCOL)--;
dec BORDERCOL
// (VICII->BORDER_COLOR)--;
dec VICII+OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR
jmp __b1
}
// render_logo(signed word zp($18) xpos)

View File

@ -19,10 +19,10 @@
(void()) main()
main: scope:[main] from @2
asm { sei }
[6] *((const nomodify byte*) BORDERCOL) ← (const nomodify byte) WHITE
[7] *((const nomodify byte*) BGCOL2) ← (const nomodify byte) DARK_GREY
[8] *((const nomodify byte*) BGCOL) ← *((const nomodify byte*) BGCOL2)
[9] *((const nomodify byte*) BGCOL3) ← (const nomodify byte) BLACK
[6] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← (const nomodify byte) WHITE
[7] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR1) ← (const nomodify byte) DARK_GREY
[8] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR) ← *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR1)
[9] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BG_COLOR2) ← (const nomodify byte) BLACK
to:main::toD0181
main::toD0181: scope:[main] from main
[10] phi()
@ -62,10 +62,10 @@ loop::@1: scope:[loop] from loop loop::@4
[26] (word) xsin_idx#11 ← phi( loop/(word) 0 loop::@4/(word) xsin_idx#19 )
to:loop::@2
loop::@2: scope:[loop] from loop::@1 loop::@2
[27] if(*((const nomodify byte*) RASTER)!=(byte) $ff) goto loop::@2
[27] if(*((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_RASTER)!=(byte) $ff) goto loop::@2
to:loop::@3
loop::@3: scope:[loop] from loop::@2
[28] *((const nomodify byte*) BORDERCOL) ← ++ *((const nomodify byte*) BORDERCOL)
[28] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← ++ *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
[29] (word~) loop::$7 ← (word) xsin_idx#11 << (byte) 1
[30] (signed word*~) loop::$2 ← (const signed word*) xsin + (word~) loop::$7
[31] (signed word) loop::xpos#0 ← *((signed word*~) loop::$2)
@ -81,7 +81,7 @@ loop::@6: scope:[loop] from loop::@5
to:loop::@4
loop::@4: scope:[loop] from loop::@5 loop::@6
[37] (word) xsin_idx#19 ← phi( loop::@5/(byte) 0 loop::@6/(word) xsin_idx#3 )
[38] *((const nomodify byte*) BORDERCOL) ← -- *((const nomodify byte*) BORDERCOL)
[38] *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR) ← -- *((byte*)(const nomodify struct MOS6569_VICII*) VICII+(const byte) OFFSET_STRUCT_MOS6569_VICII_BORDER_COLOR)
to:loop::@1
(void()) render_logo((signed word) render_logo::xpos)

Some files were not shown because too many files have changed in this diff Show More