1
0
mirror of https://gitlab.com/camelot/kickc.git synced 2024-11-26 12:49:21 +00:00

Added time-of-day utility for commodore 64 <tod.h>. Moved MOS 6526 CIA to structs.

This commit is contained in:
jespergravgaard 2020-04-26 23:30:04 +02:00
parent d8d0cc1ff8
commit b82c3f0a07
280 changed files with 21139 additions and 8650 deletions

View File

@ -81,65 +81,51 @@ const char IRQ_LIGHTPEN = %00001000;
// Color Ram
char* const COLS = $d800;
// CIA#1 Port A: keyboard matrix columns and joystick #2
char* const CIA1_PORT_A = $dc00;
// CIA#1 Port B: keyboard matrix rows and joystick #1.
char* const CIA1_PORT_B = $dc01;
// CIA #1 Port A data direction register.
char* const CIA1_PORT_A_DDR = $dc02;
// CIA #1 Port B data direction register.
char* const CIA1_PORT_B_DDR = $dc03;
// CIA #1 Timer A Value
unsigned int* const CIA1_TIMER_A = $dc04;
// CIA #1 Timer B Value
unsigned int* const CIA1_TIMER_B = $dc06;
// CIA #1 Time-of-day real-time-clock tenth seconds (BCD)
char* const CIA1_TOD_10THS = $dc08;
// CIA #1 Time-of-day real-time-clock seconds (BCD)
char* const CIA1_TOD_SEC = $dc09;
// CIA #1 Time-of-day real-time-clock minutes (BCD)
char* const CIA1_TOD_MIN = $dc0a;
// CIA #1 Time-of-day real-time-clock hours (BCD)
char* const CIA1_TOD_HOURS = $dc0b;
// CIA #1 Serial Shift Register
char* const CIA1_SERIAL_SHIFT_OUT = $dc0c;
// CIA#1 Interrupt Status & Control Register
char* const CIA1_INTERRUPT = $dc0d;
// CIA#1 Timer A Control Register
char* const CIA1_TIMER_A_CONTROL = $dc0e;
// CIA#1 Timer B Control Register
char* const CIA1_TIMER_B_CONTROL = $dc0f;
// The MOS 6526 Complex Interface Adapter (CIA)
// http://archive.6502.org/datasheets/mos_6526_cia_recreated.pdf
struct MOS6526_CIA {
// Port A
char PORT_A;
// Port B
char PORT_B;
// Port A data direction register.
char PORT_A_DDR;
// Port B data direction register.
char PORT_B_DDR;
// Timer A Value
unsigned int TIMER_A;
// Timer B Value
unsigned int TIMER_B;
// Time-of-day real-time-clock tenth seconds (BCD)
char TOD_10THS;
// Time-of-day real-time-clock seconds (BCD)
char TOD_SEC;
// Time-of-day real-time-clock minutes (BCD)
char TOD_MIN;
// Time-of-day real-time-clock hours (BCD)
char TOD_HOURS;
// Serial Shift Register
char SERIAL_DATA;
// Interrupt Status & Control Register
char INTERRUPT;
// Timer A Control Register
char TIMER_A_CONTROL;
// Timer B Control Register
char TIMER_B_CONTROL;
};
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
char* const CIA2_PORT_A = $dd00;
// CIA#2 Port B: RS-232
char* const CIA2_PORT_B = $dd01;
// CIA #2 Port A data direction register.
char* const CIA2_PORT_A_DDR = $dd02;
// CIA #2 Port B data direction register.
char* const CIA2_PORT_B_DDR = $dd03;
// CIA #2 Timer A+B Value (32-bit)
unsigned long* const CIA2_TIMER_AB = $dd04;
// CIA #2 Timer A Value (16-bit)
unsigned int* const CIA2_TIMER_A = $dd04;
// CIA #2 Timer B Value (16-bit)
unsigned int* const CIA2_TIMER_B = $dd06;
// CIA #2 Time-of-day real-time-clock tenth seconds (BCD)
char* const CIA2_TOD_10THS = $dd08;
// CIA #2 Time-of-day real-time-clock seconds (BCD)
char* const CIA2_TOD_SEC = $dd09;
// CIA #2 Time-of-day real-time-clock minutes (BCD)
char* const CIA2_TOD_MIN = $dd0a;
// CIA #2 Time-of-day real-time-clock hours (BCD)
char* const CIA2_TOD_HOURS = $dd0b;
// CIA #2 Serial Shift Register
char* const CIA2_SERIAL_SHIFT_OUT = $dd0c;
// CIA #2 Interrupt Status & Control Register
char* const CIA2_INTERRUPT = $dd0d;
// CIA #2 Timer A Control Register
char* const CIA2_TIMER_A_CONTROL = $dd0e;
// CIA #2 Timer B Control Register
char* const CIA2_TIMER_B_CONTROL = $dd0f;
// The CIA#1: keyboard matrix, joystick #1/#2
struct MOS6526_CIA * const CIA1 = 0xdc00;
// The CIA#2: Serial bus, RS-232, VIC memory bank
struct MOS6526_CIA * const CIA2 = 0xdd00;
// CIA#1 Interrupt for reading in ASM
char * const CIA1_INTERRUPT = 0xdc0d;
// CIA#2 Interrupt for reading in ASM
char * const CIA2_INTERRUPT = 0xdd0d;
// CIA#2 timer A&B as one single 32-bit value
unsigned long* const CIA2_TIMER_AB = 0xdd04;
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
const char CIA_INTERRUPT_CLEAR = $7f;

27
src/main/kc/include/tod.h Normal file
View File

@ -0,0 +1,27 @@
// Time-of-day helper
// Uses the MOS6526 CIA#1 on Commodore 64
// Time-of-day 24 hour format
struct TIME_OF_DAY {
// Time-of-day real-time-clock tenth seconds (BCD)
char TENTHS;
// Time-of-day real-time-clock seconds (BCD)
char SEC;
// Time-of-day real-time-clock minutes (BCD)
char MIN;
// Time-of-day real-time-clock hours (BCD) (bit 7 is AM/PM)
char HOURS;
};
// Time of Day 00:00:00:00
struct TIME_OF_DAY TOD_ZERO = { 0,0,0,0 };
// Initialize time-of-day clock
// This uses the MOS6526 CIA#1
void tod_init(struct TIME_OF_DAY tod);
// Read time of day
struct TIME_OF_DAY tod_read();
// Convert time of day to a human-readable string "hh:mm:ss:10"
char* tod_str(struct TIME_OF_DAY tod);

View File

@ -22,6 +22,6 @@ inline char toSpritePtr(char* sprite) {
// Select a specific VIC graphics bank by setting the CIA 2 port A ($dd00) as needed
inline void vicSelectGfxBank(char* gfx) {
*CIA2_PORT_A_DDR = %00000011;
*CIA2_PORT_A = toDd00(gfx);
CIA2->PORT_A_DDR = %00000011;
CIA2->PORT_A = toDd00(gfx);
}

View File

@ -41,16 +41,16 @@ char keyboard_matrix_col_bitmask[8] = { %00000001, %00000010, %00000100, %000010
// Initialize keyboard reading by setting CIA#$ Data Direction Registers
void keyboard_init() {
// Keyboard Matrix Columns Write Mode
*CIA1_PORT_A_DDR = $ff;
CIA1->PORT_A_DDR = $ff;
// Keyboard Matrix Columns Read Mode
*CIA1_PORT_B_DDR = $00;
CIA1->PORT_B_DDR = $00;
}
// Check if any key is currently pressed on the keyboard matrix
// Return 0 if no key is pressed and not 0 if any key is pressed
char keyboard_matrix_any(void) {
*CIA1_PORT_A = 0;
return ~*CIA1_PORT_B;
CIA1->PORT_A = 0;
return ~CIA1->PORT_B;
}
// Read a single row of the keyboard matrix
@ -59,8 +59,8 @@ char keyboard_matrix_any(void) {
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
char keyboard_matrix_read(char rowid) {
*CIA1_PORT_A = keyboard_matrix_row_bitmask[rowid];
char row_pressed_bits = ~*CIA1_PORT_B;
CIA1->PORT_A = keyboard_matrix_row_bitmask[rowid];
char row_pressed_bits = ~CIA1->PORT_B;
return row_pressed_bits;
}

View File

@ -3,6 +3,7 @@
#include <time.h>
#include <c64.h>
// Returns the processor clock time used since the beginning of an implementation defined era (normally the beginning of the program).
// This uses CIA #2 Timer A+B on the C64, and must be initialized using clock_start()
clock_t clock(void) {
@ -13,9 +14,9 @@ clock_t clock(void) {
// This uses CIA #2 Timer A+B on the C64
void clock_start(void) {
// Setup CIA#2 timer A to count (down) CPU cycles
*CIA2_TIMER_A_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES;
*CIA2_TIMER_B_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A;
CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES;
CIA2->TIMER_B_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A;
*CIA2_TIMER_AB = 0xffffffff;
*CIA2_TIMER_B_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A;
*CIA2_TIMER_A_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES;
CIA2->TIMER_B_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A;
CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES;
}

46
src/main/kc/lib/tod.c Normal file
View File

@ -0,0 +1,46 @@
// Time-of-day helper
// Uses the MOS6526 CIA#1 on Commodore 64
#include <tod.h>
#include <c64.h>
// Initialize time-of-day clock
// This uses the MOS6526 CIA#1
void tod_init(struct TIME_OF_DAY tod) {
// Set 50hz (this assumes PAL!) (bit7=1)
CIA1->TIMER_A_CONTROL |= 0x80;
// Writing TOD clock (bit7=0)
CIA1->TIMER_B_CONTROL &= 0x7f;
// Reset TOD clock
// Writing sequence is important. TOD stops when hours is written and starts when 10ths is written.
CIA1->TOD_HOURS = tod.HOURS;
CIA1->TOD_MIN = tod.MIN;
CIA1->TOD_SEC = tod.SEC;
CIA1->TOD_10THS = tod.TENTHS;
}
// Read time of day
struct TIME_OF_DAY tod_read() {
// Reading sequence is important. TOD latches on reading hours until 10ths is read.
char hours = CIA1->TOD_HOURS;
char mins = CIA1->TOD_MIN;
char secs = CIA1->TOD_SEC;
char tenths = CIA1->TOD_10THS;
struct TIME_OF_DAY tod = { tenths, secs, mins, hours };
return tod;
}
// The buffer used by tod_str()
char tod_buffer[] = "00:00:00:00";
// Convert time of day to a human-readable string "hh:mm:ss:10"
char* tod_str(struct TIME_OF_DAY tod) {
tod_buffer[0] = '0'+(tod.HOURS>>4);
tod_buffer[1] = '0'+(tod.HOURS&0x0f);
tod_buffer[3] = '0'+(tod.MIN>>4);
tod_buffer[4] = '0'+(tod.MIN&0x0f);
tod_buffer[6] = '0'+(tod.SEC>>4);
tod_buffer[7] = '0'+(tod.SEC&0x0f);
tod_buffer[9] = '0'+(tod.TENTHS>>4);
tod_buffer[10] = '0'+(tod.TENTHS&0x0f);
return tod_buffer;
}

View File

@ -40,6 +40,11 @@ public class TestPrograms {
public TestPrograms() {
}
@Test
public void testTod1() throws IOException, URISyntaxException {
compileAndCompare("tod-1.c");
}
@Test
public void testEightQueensRecursive() throws IOException, URISyntaxException {
compileAndCompare("examples/eightqueens/eightqueens-recursive.c");

View File

@ -38,7 +38,7 @@ void init_irq() {
*PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK;
*PROCPORT = PROCPORT_RAM_IO;
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to $100
*VIC_CONTROL |=$80;
*RASTER = $00;

View File

@ -45,7 +45,7 @@ void init_irq() {
*PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK;
*PROCPORT = PROCPORT_RAM_IO;
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to $100
*VIC_CONTROL |=$80;
*RASTER = $00;

View File

@ -54,7 +54,7 @@ void init_irq() {
*PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK;
*PROCPORT = PROCPORT_RAM_IO;
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to $100
*VIC_CONTROL |=$80;
*RASTER = $00;

View File

@ -33,8 +33,8 @@ void main() {
*DTV_PLANEB_MODULO_LO = 0;
*DTV_PLANEB_MODULO_HI = 0;
// VIC Graphics Bank
*CIA2_PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
*CIA2_PORT_A = %00000011 ^ (byte)((word)SCREEN/$4000); // Set VIC Bank
CIA2->PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
CIA2->PORT_A = %00000011 ^ (byte)((word)SCREEN/$4000); // Set VIC Bank
// VIC memory
*VIC_MEMORY = (byte)((((word)SCREEN)&$3fff)/$40) | ((>(((word)SCREEN)&$3fff))/4);

View File

@ -24,8 +24,8 @@ void main() {
*DTV_PLANEB_MODULO_LO = 0;
*DTV_PLANEB_MODULO_HI = 0;
// VIC Graphics Bank
*CIA2_PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
*CIA2_PORT_A = %00000011 ^ (byte)((word)CHUNKY/$4000); // Set VIC Bank
CIA2->PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
CIA2->PORT_A = %00000011 ^ (byte)((word)CHUNKY/$4000); // Set VIC Bank
// VIC memory
*VIC_MEMORY = (byte)((((word)CHUNKY)&$3fff)/$40) | ((>(((word)CHUNKY)&$3fff))/4);

View File

@ -352,8 +352,8 @@ void gfx_mode() {
*DTV_PLANEB_MODULO_HI = 0;
// VIC Graphics Bank
*CIA2_PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
*CIA2_PORT_A = %00000011 ^ (byte)((word)VIC_SCREEN0/$4000); // Set VIC Bank
CIA2->PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
CIA2->PORT_A = %00000011 ^ (byte)((word)VIC_SCREEN0/$4000); // Set VIC Bank
// VIC memory
*VIC_MEMORY = (byte)(((word)get_vic_screen(*form_vic_screen)&$3fff)/$40) | ((>((word)get_vic_charset(*form_vic_gfx)&$3fff))/4);
@ -644,8 +644,8 @@ void form_mode() {
*DTV_COLOR_BANK_LO = <((word)(DTV_COLOR_BANK_DEFAULT/$400));
*DTV_COLOR_BANK_HI = >((word)(DTV_COLOR_BANK_DEFAULT/$400));
// VIC Graphics Bank
*CIA2_PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
*CIA2_PORT_A = %00000011 ^ (byte)((word)FORM_CHARSET/$4000); // Set VIC Bank
CIA2->PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
CIA2->PORT_A = %00000011 ^ (byte)((word)FORM_CHARSET/$4000); // Set VIC Bank
// DTV Graphics Mode
*DTV_CONTROL = 0;
// VIC Graphics Mode

View File

@ -52,8 +52,8 @@ void menu() {
// DTV Graphics Mode
*DTV_CONTROL = 0;
// VIC Graphics Bank
*CIA2_PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
*CIA2_PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000); // Set VIC Bank
CIA2->PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
CIA2->PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000); // Set VIC Bank
// VIC Graphics Mode
*VIC_CONTROL = VIC_DEN|VIC_RSEL|3;
*VIC_CONTROL2 = VIC_CSEL;
@ -199,8 +199,8 @@ void mode_stdchar() {
dtv_control = 0;
*DTV_CONTROL = 0;
// VIC Graphics Bank
*CIA2_PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
*CIA2_PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000); // Set VIC Bank
CIA2->PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
CIA2->PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000); // Set VIC Bank
// VIC Graphics Mode
*VIC_CONTROL = VIC_DEN|VIC_RSEL|3;
*VIC_CONTROL2 = VIC_CSEL;
@ -250,8 +250,8 @@ void mode_ecmchar() {
dtv_control = 0;
*DTV_CONTROL = 0;
// VIC Graphics Bank
*CIA2_PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
*CIA2_PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000); // Set VIC Bank
CIA2->PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
CIA2->PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000); // Set VIC Bank
// VIC Graphics Mode
*VIC_CONTROL = VIC_DEN|VIC_RSEL|VIC_ECM|3;
*VIC_CONTROL2 = VIC_CSEL;
@ -306,8 +306,8 @@ void mode_mcchar() {
dtv_control = 0;
*DTV_CONTROL = 0;
// VIC Graphics Bank
*CIA2_PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
*CIA2_PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000); // Set VIC Bank
CIA2->PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
CIA2->PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000); // Set VIC Bank
// VIC Graphics Mode
*VIC_CONTROL = VIC_DEN|VIC_RSEL|3;
*VIC_CONTROL2 = VIC_CSEL|VIC_MCM;
@ -352,8 +352,8 @@ void mode_stdbitmap() {
dtv_control = 0;
*DTV_CONTROL = 0;
// VIC Graphics Bank
*CIA2_PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
*CIA2_PORT_A = %00000011 ^ (byte)((word)BITMAP/$4000); // Set VIC Bank
CIA2->PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
CIA2->PORT_A = %00000011 ^ (byte)((word)BITMAP/$4000); // Set VIC Bank
// VIC Graphics Mode
*VIC_CONTROL = VIC_BMM|VIC_DEN|VIC_RSEL|3;
*VIC_CONTROL2 = VIC_CSEL;
@ -408,8 +408,8 @@ void mode_hicolstdchar() {
dtv_control = DTV_HIGHCOLOR;
*DTV_CONTROL = DTV_HIGHCOLOR;
// VIC Graphics Bank
*CIA2_PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
*CIA2_PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000); // Set VIC Bank
CIA2->PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
CIA2->PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000); // Set VIC Bank
// VIC Graphics Mode
*VIC_CONTROL = VIC_DEN|VIC_RSEL|3;
*VIC_CONTROL2 = VIC_CSEL;
@ -461,8 +461,8 @@ void mode_hicolecmchar() {
dtv_control = DTV_HIGHCOLOR;
*DTV_CONTROL = DTV_HIGHCOLOR;
// VIC Graphics Bank
*CIA2_PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
*CIA2_PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000); // Set VIC Bank
CIA2->PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
CIA2->PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000); // Set VIC Bank
// VIC Graphics Mode
*VIC_CONTROL = VIC_DEN|VIC_RSEL|VIC_ECM|3;
*VIC_CONTROL2 = VIC_CSEL;
@ -517,8 +517,8 @@ void mode_hicolmcchar() {
dtv_control = DTV_HIGHCOLOR;
*DTV_CONTROL = DTV_HIGHCOLOR;
// VIC Graphics Bank
*CIA2_PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
*CIA2_PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000); // Set VIC Bank
CIA2->PORT_A_DDR = %00000011; // Set VIC Bank bits to output - all others to input
CIA2->PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000); // Set VIC Bank
// VIC Graphics Mode
*VIC_CONTROL = VIC_DEN|VIC_RSEL|3;
*VIC_CONTROL2 = VIC_CSEL|VIC_MCM;

View File

@ -288,7 +288,7 @@ void setupRasterIrq(unsigned int raster, void()* irqRoutine) {
*PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK;
*PROCPORT = PROCPORT_RAM_IO;
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
if(raster<0x100) {
*VIC_CONTROL &=0x7f;
} else {

View File

@ -69,7 +69,7 @@ void main() {
// Enable the plex IRQ
asm { sei }
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to 0x00
*VIC_CONTROL &=0x7f;
*RASTER = 0x28;

View File

@ -46,6 +46,7 @@ volatile char irq_sprite_ptr = toSpritePtr(PLAYFIELD_SPRITES) + 3;
// Counting the 10 IRQs
volatile char irq_cnt = 0;
// Setup the IRQ
void sprites_irq_init() {
asm { sei }
@ -57,7 +58,7 @@ void sprites_irq_init() {
*PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK;
*PROCPORT = PROCPORT_RAM_IO;
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line
*VIC_CONTROL &=0x7f;
*RASTER = IRQ_RASTER_FIRST;

View File

@ -4,8 +4,8 @@
#include <c64.h>
char* const SCREEN = 0x0400;
void main() {
(*CIA2_PORT_B) &= 0x7f;
(CIA2->PORT_B) &= 0x7f;
asm { lda #0 }
char port4Value = *CIA2_PORT_B;
char port4Value = CIA2->PORT_B;
*SCREEN = port4Value;
}

View File

@ -5,6 +5,7 @@
// This is an iterative solution.
#include<stdio.h>
#include<tod.h>
#define QUEENS 8
#define PRINT_SOLUTIONS
@ -18,10 +19,14 @@ unsigned long count = 0;
void main() {
printf_cls();
printf(" - n queens problem using backtracking -");
printf("\nNumber of queens:%u",QUEENS);
printf("\nnumber of queens:%u",QUEENS);
tod_init(TOD_ZERO);
queens();
struct TIME_OF_DAY tod = tod_read();
printf("\ntime: %s",tod_str(tod));
}
// Generates all valid placements of queens on a NxN board without recursion
// Works exactly like the recursive solution by generating all legal placements af a queen for a specific row taking into consideration the queens already placed on the rows below
// and then moving on to generating all legal placements on the rows above.
@ -31,8 +36,8 @@ void main() {
void queens() {
// The current row where the queen is moving
char row = 1;
while(true) {
// Move the queen forward the current row
while(1) {
// Move the queen forward on the current row
board[row]++;
if(board[row]==QUEENS+1) {
// We moved past the end of the row - reset position and go down to the lower row
@ -48,19 +53,15 @@ void queens() {
if(legal(row, board[row])) {
// position is legal - move up to the next row
if(row==QUEENS) {
// We have a complete legal board - print it!
// We have a complete legal board - print it - and move forward on top row!
++count;
#ifdef PRINT_SOLUTIONS
print();
#endif
// Move forward on the top row!
continue;
} else {
// Move up to the next row
row++;
}
} else {
// position is illegal - move forward on the same row
continue;
}
}
}
@ -84,16 +85,16 @@ char legal(char row,char column) {
}
// Find the absolute difference between two unsigned chars
char diff(char a, char b) {
inline char diff(char a, char b) {
if(a<b)
return b-a;
else
return a-b;
}
// Print the board with a legal placement. Also increments the solution count.
// Print the board with a legal placement.
void print() {
printf("\n#%lu:\n ",++count);
printf("\n#%lu:\n ",count);
for(char i=1;i<=QUEENS;++i)
printf("%x",i);
for(char i=1;i<=QUEENS;++i) {

View File

@ -7,7 +7,7 @@ void main() {
*GHOST_BYTE = 0;
asm { sei }
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to $fa
*VIC_CONTROL &=$7f;
*RASTER = $fa;

View File

@ -21,7 +21,7 @@ void main() {
jsr music.init
}
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to $fd
*VIC_CONTROL &=$7f;
*RASTER = $fd;

View File

@ -24,11 +24,11 @@ void main() {
sta $d412
}
asm { sei }
*CIA2_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA2->INTERRUPT = CIA_INTERRUPT_CLEAR;
*KERNEL_NMI = &nmi;
*CIA2_TIMER_A = 0x88; // speed
*CIA2_INTERRUPT = 0x81;
*CIA2_TIMER_A_CONTROL = 0x01;
CIA2->TIMER_A = 0x88; // speed
CIA2->INTERRUPT = 0x81;
CIA2->TIMER_A_CONTROL = 0x01;
asm { cli }
}

View File

@ -7,7 +7,7 @@ void main() {
*PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK;
*PROCPORT = PROCPORT_RAM_IO;
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to $100
*VIC_CONTROL |=$80;
*RASTER = $00;

View File

@ -35,7 +35,7 @@ void main() {
*PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK;
*PROCPORT = PROCPORT_RAM_IO;
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to $100
*VIC_CONTROL |=$80;
*RASTER = $00;

View File

@ -35,7 +35,7 @@ void main() {
*PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK;
*PROCPORT = PROCPORT_RAM_IO;
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to $100
*VIC_CONTROL |=$80;
*RASTER = $00;

View File

@ -35,7 +35,7 @@ void main() {
*PROCPORT_DDR = PROCPORT_DDR_MEMORY_MASK;
*PROCPORT = PROCPORT_RAM_IO;
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to $100
*VIC_CONTROL |=$80;
*RASTER = $00;

View File

@ -6,7 +6,7 @@ byte* const SCREEN = $0400;
void main() {
asm { sei }
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to $60
*VIC_CONTROL &=$7f;
*RASTER = $60;

View File

@ -19,7 +19,7 @@ const byte CIA_INTERRUPT_CLEAR = $7f;
void main() {
asm { sei }
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to $100
*VIC_CONTROL |=$80;
*RASTER = $00;

View File

@ -16,7 +16,7 @@ const byte CIA_INTERRUPT_CLEAR = $7f;
void main() {
asm { sei }
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to $0fd
*VIC_CONTROL &=$7f;
*RASTER = $fd;

View File

@ -19,7 +19,7 @@ const byte CIA_INTERRUPT_CLEAR = $7f;
void main() {
asm { sei }
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to $100
*VIC_CONTROL |=$80;
*RASTER = $00;

View File

@ -16,7 +16,7 @@ const byte CIA_INTERRUPT_CLEAR = $7f;
void main() {
asm { sei }
// Disable CIA 1 Timer IRQ
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
// Set raster line to $0fd
*VIC_CONTROL &=$7f;
*RASTER = $fd;

View File

@ -118,11 +118,11 @@ int main (void)
makechar();
start();
block = *CIA2_PORT_A;
block = CIA2->PORT_A;
char tmp;
tmp = block & 0xFC;
tmp |= (char)((((unsigned int)SCREEN1) >> 14) ^ 0x03);
*CIA2_PORT_A = tmp;
CIA2->PORT_A = tmp;
v = *VIC_MEMORY;
/* Run the demo until a key was hit */
@ -140,7 +140,7 @@ int main (void)
}
*VIC_MEMORY = v;
*CIA2_PORT_A = block;
CIA2->PORT_A = block;
/* Reset screen colors */
end();

View File

@ -40,7 +40,7 @@ void init() {
}
// enable the interrupt
asm { sei }
*CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR;
CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR;
*IRQ_ENABLE = IRQ_RASTER;
*IRQ_STATUS = IRQ_RASTER;
*KERNEL_IRQ = &plex_irq;

12
src/test/kc/tod-1.c Normal file
View File

@ -0,0 +1,12 @@
// Time of Day / RTOS test using the 6526 CIA on C64
#include <conio.h>
#include <tod.h>
void main() {
tod_init(TOD_ZERO);
while(1) {
struct TIME_OF_DAY tod = tod_read();
gotoxy(0,0);
cputs(tod_str(tod));
}
}

View File

@ -1,3 +1,5 @@
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA
@ -284,6 +286,20 @@ SYMBOL TABLE SSA
(const nomodify byte) BLUE = (byte) 6
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify byte*) D011 = (byte*)(number) $d011
(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
(const nomodify byte*) SCREEN = (byte*)(number) $400
(const nomodify byte) VIC_BMM = (byte) $20
(const nomodify byte) VIC_DEN = (byte) $10
@ -963,6 +979,20 @@ fill::@2: scope:[fill] from fill::@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
(void()) circle((signed word) circle::xc , (signed word) circle::yc , (signed word) circle::r)
(signed word~) circle::$0 2002.0
(signed word~) circle::$10 200002.0
@ -1969,6 +1999,7 @@ Uplift Scope [plot] 2,080,017.2: zp[2]:12 [ plot::y#8 plot::y#5 plot::y#6 plot::
Uplift Scope [circle] 470,831.01: zp[2]:8 [ circle::p#3 circle::p#0 circle::p#10 circle::p#1 circle::p#2 ] 236,113.47: zp[2]:4 [ circle::x1#10 circle::x1#1 ] 200,002: zp[2]:21 [ circle::$5 ] 200,002: zp[2]:23 [ circle::$6 ] 200,002: zp[2]:25 [ circle::$7 ] 200,002: zp[2]:27 [ circle::$9 ] 200,002: zp[2]:29 [ circle::$10 ] 169,843.88: zp[2]:6 [ circle::y#13 circle::r#0 circle::y#10 circle::y#1 ] 2,002: zp[2]:19 [ circle::$0 ]
Uplift Scope [fill] 3,471.33: zp[2]:17 [ fill::addr#2 fill::addr#0 fill::addr#1 ] 220.4: zp[2]:51 [ fill::end#0 ] 166.83: zp[1]:16 [ fill::val#4 ] 101: zp[2]:14 [ fill::size#2 ]
Uplift Scope [main] 303: zp[2]:2 [ main::i#2 main::i#1 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope []
Uplifting [plot] best 53688 combination zp[2]:12 [ plot::y#8 plot::y#5 plot::y#6 plot::y#7 plot::y#0 plot::y#1 plot::y#2 plot::y#3 plot::y#4 ] zp[2]:31 [ plot::$8 ] reg byte a [ plot::$9 ] reg byte a [ plot::$10 ] zp[2]:41 [ plot::$15 ] zp[2]:43 [ plot::$16 ] zp[2]:45 [ plot::$12 ] reg byte a [ plot::$13 ] reg byte a [ plot::$14 ] zp[2]:39 [ plot::$11 ] zp[2]:10 [ plot::x#8 plot::x#5 plot::x#6 plot::x#7 plot::x#0 plot::x#1 plot::x#2 plot::x#3 plot::x#4 ] zp[2]:47 [ plot::location#3 ] zp[2]:33 [ plot::location#1 ] zp[2]:37 [ plot::location#2 ]
@ -1976,6 +2007,7 @@ Limited combination testing to 100 combinations of 256 possible.
Uplifting [circle] best 53688 combination zp[2]:8 [ circle::p#3 circle::p#0 circle::p#10 circle::p#1 circle::p#2 ] zp[2]:4 [ circle::x1#10 circle::x1#1 ] zp[2]:21 [ circle::$5 ] zp[2]:23 [ circle::$6 ] zp[2]:25 [ circle::$7 ] zp[2]:27 [ circle::$9 ] zp[2]:29 [ circle::$10 ] zp[2]:6 [ circle::y#13 circle::r#0 circle::y#10 circle::y#1 ] zp[2]:19 [ circle::$0 ]
Uplifting [fill] best 53672 combination zp[2]:17 [ fill::addr#2 fill::addr#0 fill::addr#1 ] zp[2]:51 [ fill::end#0 ] reg byte x [ fill::val#4 ] zp[2]:14 [ fill::size#2 ]
Uplifting [main] best 53672 combination zp[2]:2 [ main::i#2 main::i#1 ]
Uplifting [MOS6526_CIA] best 53672 combination
Uplifting [] best 53672 combination
Coalescing zero page register [ zp[2]:8 [ circle::p#3 circle::p#0 circle::p#10 circle::p#1 circle::p#2 ] ] with [ zp[2]:25 [ circle::$7 ] ] - score: 2
Coalescing zero page register [ zp[2]:8 [ circle::p#3 circle::p#0 circle::p#10 circle::p#1 circle::p#2 circle::$7 ] ] with [ zp[2]:29 [ circle::$10 ] ] - score: 2
@ -2774,6 +2806,20 @@ FINAL SYMBOL TABLE
(const nomodify byte) BLUE = (byte) 6
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) D011 = (byte*) 53265
(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
(const nomodify byte*) SCREEN = (byte*) 1024
(const nomodify byte) VIC_BMM = (byte) $20
(const nomodify byte) VIC_DEN = (byte) $10

View File

@ -5,6 +5,20 @@
(const nomodify byte) BLUE = (byte) 6
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) D011 = (byte*) 53265
(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
(const nomodify byte*) SCREEN = (byte*) 1024
(const nomodify byte) VIC_BMM = (byte) $20
(const nomodify byte) VIC_DEN = (byte) $10

View File

@ -1,3 +1,5 @@
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA
@ -260,6 +262,20 @@ SYMBOL TABLE SSA
(const nomodify byte) BLUE = (byte) 6
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify byte*) D011 = (byte*)(number) $d011
(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
(const nomodify byte*) SCREEN = (byte*)(number) $400
(const nomodify byte) VIC_BMM = (byte) $20
(const nomodify byte) VIC_DEN = (byte) $10
@ -869,6 +885,20 @@ fill::@2: scope:[fill] from fill::@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
(void()) circle((signed word) circle::xc , (signed word) circle::yc , (signed word) circle::r)
(signed word~) circle::$10 2002.0
(signed word~) circle::$5 2002.0
@ -1760,6 +1790,7 @@ REGISTER UPLIFT SCOPES
Uplift Scope [plot] 20,684.33: zp[2]:10 [ plot::y#8 plot::y#5 plot::y#6 plot::y#7 plot::y#0 plot::y#1 plot::y#2 plot::y#3 plot::y#4 ] 20,002: zp[2]:27 [ plot::$0 ] 20,002: zp[1]:31 [ plot::$1 ] 20,002: zp[1]:32 [ plot::$2 ] 20,002: zp[2]:37 [ plot::$7 ] 20,002: zp[2]:39 [ plot::$8 ] 20,002: zp[2]:41 [ plot::$4 ] 20,002: zp[1]:45 [ plot::$5 ] 20,002: zp[1]:46 [ plot::$6 ] 15,001.5: zp[2]:35 [ plot::$3 ] 10,554.36: zp[2]:8 [ plot::x#8 plot::x#5 plot::x#6 plot::x#7 plot::x#0 plot::x#1 plot::x#2 plot::x#3 plot::x#4 ] 10,001: zp[2]:43 [ plot::location#3 ] 6,667.33: zp[2]:29 [ plot::location#1 ] 4,000.4: zp[2]:33 [ plot::location#2 ]
Uplift Scope [circle] 4,691.5: zp[2]:6 [ circle::p#3 circle::p#10 circle::p#1 circle::p#2 ] 2,363.47: zp[2]:2 [ circle::x1#10 circle::x1#1 ] 2,002: zp[2]:17 [ circle::$5 ] 2,002: zp[2]:19 [ circle::$6 ] 2,002: zp[2]:21 [ circle::$7 ] 2,002: zp[2]:23 [ circle::$9 ] 2,002: zp[2]:25 [ circle::$10 ] 1,691.43: zp[2]:4 [ circle::y#13 circle::y#10 circle::y#1 ]
Uplift Scope [fill] 3,471.33: zp[2]:15 [ fill::addr#2 fill::addr#0 fill::addr#1 ] 220.4: zp[2]:47 [ fill::end#0 ] 166.83: zp[1]:14 [ fill::val#4 ] 101: zp[2]:12 [ fill::size#2 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [main]
Uplift Scope []
@ -1767,6 +1798,7 @@ Uplifting [plot] best 6419 combination zp[2]:10 [ plot::y#8 plot::y#5 plot::y#6
Limited combination testing to 100 combinations of 256 possible.
Uplifting [circle] best 6419 combination zp[2]:6 [ circle::p#3 circle::p#10 circle::p#1 circle::p#2 ] zp[2]:2 [ circle::x1#10 circle::x1#1 ] zp[2]:17 [ circle::$5 ] zp[2]:19 [ circle::$6 ] zp[2]:21 [ circle::$7 ] zp[2]:23 [ circle::$9 ] zp[2]:25 [ circle::$10 ] zp[2]:4 [ circle::y#13 circle::y#10 circle::y#1 ]
Uplifting [fill] best 6403 combination zp[2]:15 [ fill::addr#2 fill::addr#0 fill::addr#1 ] zp[2]:47 [ fill::end#0 ] reg byte x [ fill::val#4 ] zp[2]:12 [ fill::size#2 ]
Uplifting [MOS6526_CIA] best 6403 combination
Uplifting [main] best 6403 combination
Uplifting [] best 6403 combination
Coalescing zero page register [ zp[2]:6 [ circle::p#3 circle::p#10 circle::p#1 circle::p#2 ] ] with [ zp[2]:21 [ circle::$7 ] ] - score: 2
@ -2468,6 +2500,20 @@ FINAL SYMBOL TABLE
(const nomodify byte) BLUE = (byte) 6
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) D011 = (byte*) 53265
(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
(const nomodify byte*) SCREEN = (byte*) 1024
(const nomodify byte) VIC_BMM = (byte) $20
(const nomodify byte) VIC_DEN = (byte) $10

View File

@ -5,6 +5,20 @@
(const nomodify byte) BLUE = (byte) 6
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) D011 = (byte*) 53265
(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
(const nomodify byte*) SCREEN = (byte*) 1024
(const nomodify byte) VIC_BMM = (byte) $20
(const nomodify byte) VIC_DEN = (byte) $10

View File

@ -1,3 +1,5 @@
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA
@ -643,6 +645,20 @@ SYMBOL TABLE SSA
(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
(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
(const nomodify byte*) SCREEN = (byte*)(number) $400
(const nomodify byte) VIC_BMM = (byte) $20
(const nomodify byte) VIC_DEN = (byte) $10
@ -2119,6 +2135,20 @@ bitmap_init::@return: scope:[bitmap_init] from bitmap_init::@4
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
(void()) bitmap_clear()
(byte*) bitmap_clear::bitmap
(word) bitmap_clear::bitmap#0 101.0
@ -3431,6 +3461,7 @@ Uplift Scope [bitmap_init] 3,628.62: zp[2]:26 [ bitmap_init::yoffs#2 bitmap_init
Uplift Scope [bitmap_line] 1,334.67: zp[1]:29 [ bitmap_line::xd#2 ] 1,334.67: zp[1]:32 [ bitmap_line::xd#1 ] 851: zp[1]:28 [ bitmap_line::x1#0 ]
Uplift Scope [init_screen] 3,336.67: zp[2]:17 [ init_screen::c#2 init_screen::c#1 ]
Uplift Scope [] 303: zp[1]:2 [ next#4 next#1 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [main]
Uplifting [bitmap_plot] best 40165 combination reg byte y [ bitmap_plot::y#4 bitmap_plot::y#1 bitmap_plot::y#0 bitmap_plot::y#3 bitmap_plot::y#2 ] zp[2]:39 [ bitmap_plot::plotter_y#0 ] reg byte a [ bitmap_plot::$1 ] reg byte x [ bitmap_plot::x#4 bitmap_plot::x#1 bitmap_plot::x#0 bitmap_plot::x#3 bitmap_plot::x#2 ] zp[2]:37 [ bitmap_plot::plotter_x#0 ] zp[2]:41 [ bitmap_plot::plotter#0 ]
@ -3444,6 +3475,7 @@ Limited combination testing to 100 combinations of 34560 possible.
Uplifting [bitmap_line] best 38089 combination reg byte x [ bitmap_line::xd#2 ] reg byte x [ bitmap_line::xd#1 ] reg byte a [ bitmap_line::x1#0 ]
Uplifting [init_screen] best 38089 combination zp[2]:17 [ init_screen::c#2 init_screen::c#1 ]
Uplifting [] best 38089 combination zp[1]:2 [ next#4 next#1 ]
Uplifting [MOS6526_CIA] best 38089 combination
Uplifting [main] best 38089 combination
Attempting to uplift remaining variables inzp[1]:10 [ 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 38089 combination zp[1]:10 [ 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 ]
@ -4453,6 +4485,20 @@ FINAL SYMBOL TABLE
(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
(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
(const nomodify byte*) SCREEN = (byte*) 1024
(const nomodify byte) VIC_BMM = (byte) $20
(const nomodify byte) VIC_DEN = (byte) $10

View File

@ -5,6 +5,20 @@
(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
(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
(const nomodify byte*) SCREEN = (byte*) 1024
(const nomodify byte) VIC_BMM = (byte) $20
(const nomodify byte) VIC_DEN = (byte) $10

View File

@ -1,3 +1,5 @@
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA
@ -560,6 +562,20 @@ SYMBOL TABLE SSA
(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
(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
(const nomodify byte) PURPLE = (byte) 4
(const nomodify byte*) SCREEN = (byte*)(number) $400
(const nomodify byte) VIC_BMM = (byte) $20
@ -1864,6 +1880,20 @@ bitmap_init::@return: scope:[bitmap_init] from bitmap_init::@4
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
(word()) abs_u16((word) abs_u16::w)
(byte~) abs_u16::$0 20002.0
(byte~) abs_u16::$1 20002.0
@ -3170,6 +3200,7 @@ Uplift Scope [sgn_u16] 20,002: zp[1]:58 [ sgn_u16::$0 ] 20,002: zp[1]:59 [ sgn_u
Uplift Scope [memset] 35,672.33: zp[2]:26 [ memset::dst#2 memset::dst#4 memset::dst#1 ] 1,833.67: zp[2]:62 [ memset::end#0 ] 1,250.12: zp[1]:25 [ memset::c#4 ] 1,001: zp[2]:21 [ memset::num#2 ] 0: zp[2]:23 [ memset::str#3 ]
Uplift Scope [bitmap_init] 3,628.62: zp[2]:31 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] 3,169.83: zp[1]:28 [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] 2,002: zp[1]:29 [ bitmap_init::x#2 bitmap_init::x#1 ] 2,002: zp[1]:30 [ bitmap_init::y#2 bitmap_init::y#1 ] 2,002: zp[1]:65 [ bitmap_init::$4 ] 2,002: zp[1]:66 [ bitmap_init::$5 ] 2,002: zp[1]:67 [ bitmap_init::$6 ] 500.5: zp[1]:64 [ bitmap_init::$7 ]
Uplift Scope [] 404: zp[2]:2 [ next#5 next#3 next#1 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [bitmap_clear]
Uplift Scope [main]
@ -3181,6 +3212,7 @@ Uplifting [memset] best 37048 combination zp[2]:26 [ memset::dst#2 memset::dst#4
Uplifting [bitmap_init] best 36538 combination zp[2]:31 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] reg byte a [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ] reg byte x [ bitmap_init::y#2 bitmap_init::y#1 ] reg byte a [ bitmap_init::$4 ] zp[1]:66 [ bitmap_init::$5 ] zp[1]:67 [ bitmap_init::$6 ] zp[1]:64 [ bitmap_init::$7 ]
Limited combination testing to 100 combinations of 15360 possible.
Uplifting [] best 36538 combination zp[2]:2 [ next#5 next#3 next#1 ]
Uplifting [MOS6526_CIA] best 36538 combination
Uplifting [bitmap_clear] best 36538 combination
Uplifting [main] best 36538 combination
Attempting to uplift remaining variables inzp[1]:66 [ bitmap_init::$5 ]
@ -4203,6 +4235,20 @@ FINAL SYMBOL TABLE
(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
(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
(const nomodify byte) PURPLE = (byte) 4
(const nomodify byte*) SCREEN = (byte*) 1024
(const nomodify byte) VIC_BMM = (byte) $20

View File

@ -5,6 +5,20 @@
(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
(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
(const nomodify byte) PURPLE = (byte) 4
(const nomodify byte*) SCREEN = (byte*) 1024
(const nomodify byte) VIC_BMM = (byte) $20

View File

@ -25,8 +25,8 @@
.label IRQ_ENABLE = $d01a
// Bits for the IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// CIA#1 Interrupt Status & Control Register
.label CIA1_INTERRUPT = $dc0d
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
// The vector used when the HARDWARE serves IRQ interrupts
@ -34,6 +34,7 @@
// The colors of the C64
.const BLACK = 0
.const WHITE = 1
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.label BITMAP = $2000
.label SCREEN = $400
.label frame_cnt = 8
@ -176,10 +177,10 @@ init_irq: {
// *PROCPORT = PROCPORT_RAM_IO
lda #PROCPORT_RAM_IO
sta PROCPORT
// *CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR
// CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1_INTERRUPT
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// *VIC_CONTROL |=$80
// Set raster line to $100
lda #$80

View File

@ -84,7 +84,7 @@ init_irq: scope:[init_irq] from main::@7
asm { sei }
[35] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK
[36] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO
[37] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[37] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[38] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80
[39] *((const nomodify byte*) RASTER) ← (byte) 0
[40] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER

View File

@ -2,6 +2,9 @@ Resolved forward reference frame_cnt to (volatile byte) frame_cnt
Resolved forward reference frame_cnt to (volatile byte) frame_cnt
Resolved forward reference frame_cnt to (volatile byte) frame_cnt
Resolved forward reference irq to interrupt(HARDWARE_CLOBBER)(void()) irq()
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).INTERRUPT with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Inlined call (byte~) main::$2 ← call toD018 (const byte*) SCREEN (const byte*) BITMAP
@ -342,7 +345,7 @@ init_irq: scope:[init_irq] from main::@7
asm { sei }
*((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK
*((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO
*((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
*((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) $80
*((const nomodify byte*) RASTER) ← (number) 0
*((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
@ -393,7 +396,7 @@ SYMBOL TABLE SSA
(const nomodify byte*) BGCOL = (byte*)(number) $d021
(const byte*) BITMAP = (byte*)(number) $2000
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte*) CIA1_INTERRUPT = (byte*)(number) $dc0d
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*)(number) $dc00
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) D011 = (byte*)(number) $d011
(const nomodify byte*) D018 = (byte*)(number) $d018
@ -401,6 +404,21 @@ SYMBOL TABLE SSA
(const nomodify byte*) IRQ_ENABLE = (byte*)(number) $d01a
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*)(number) $d019
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const nomodify byte*) PROCPORT = (byte*)(number) 1
(const nomodify byte*) PROCPORT_DDR = (byte*)(number) 0
(const nomodify byte) PROCPORT_DDR_MEMORY_MASK = (byte) 7
@ -762,7 +780,7 @@ Simplifying constant pointer cast (byte*) 53265
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (byte*) 53273
Simplifying constant pointer cast (byte*) 53274
Simplifying constant pointer cast (byte*) 56333
Simplifying constant pointer cast (struct MOS6526_CIA*) 56320
Simplifying constant pointer cast (void()**) 65534
Simplifying constant pointer cast (byte*) 8192
Simplifying constant pointer cast (byte*) 1024
@ -1252,7 +1270,7 @@ init_irq: scope:[init_irq] from main::@7
asm { sei }
[35] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK
[36] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO
[37] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[37] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[38] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80
[39] *((const nomodify byte*) RASTER) ← (byte) 0
[40] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
@ -1359,6 +1377,20 @@ irq::@return: scope:[irq] from irq::@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
(void()) bitmap_clear((byte) bitmap_clear::bgcol , (byte) bitmap_clear::fgcol)
(byte) bitmap_clear::bgcol
(byte) bitmap_clear::col
@ -1539,8 +1571,8 @@ Target platform is c64basic / MOS6502X
.label IRQ_ENABLE = $d01a
// Bits for the IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// CIA#1 Interrupt Status & Control Register
.label CIA1_INTERRUPT = $dc0d
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
// The vector used when the HARDWARE serves IRQ interrupts
@ -1548,6 +1580,7 @@ Target platform is c64basic / MOS6502X
// The colors of the C64
.const BLACK = 0
.const WHITE = 1
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.label BITMAP = $2000
.label SCREEN = $400
.label frame_cnt = $14
@ -1794,10 +1827,10 @@ init_irq: {
// [36] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2
lda #PROCPORT_RAM_IO
sta PROCPORT
// [37] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// [37] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1_INTERRUPT
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// [38] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2
// Set raster line to $100
lda #$80
@ -2145,7 +2178,7 @@ Removing always clobbered register reg byte y as potential for zp[1]:4 [ main::y
Removing always clobbered register reg byte y as potential for zp[1]:7 [ main::vy#2 main::vy#8 main::vy#1 ]
Statement [35] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK [ ] ( main:3::init_irq:12 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [36] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO [ ] ( main:3::init_irq:12 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [37] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:3::init_irq:12 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [37] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:3::init_irq:12 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [38] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80 [ ] ( main:3::init_irq:12 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [39] *((const nomodify byte*) RASTER) ← (byte) 0 [ ] ( main:3::init_irq:12 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [40] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:3::init_irq:12 [ frame_cnt ] { } ) always clobbers reg byte a
@ -2183,7 +2216,7 @@ Statement [30] (byte*) bitmap_plot::plotter#1 ← (byte*)(word) bitmap_plot::plo
Statement [32] *((byte*) bitmap_plot::plotter#1) ← *((byte*) bitmap_plot::plotter#1) | *((const to_nomodify byte*) bitmap_plot_bit + (byte~) bitmap_plot::$1) [ ] ( main:3::bitmap_plot:16 [ frame_cnt main::x#2 main::y#2 main::vx#2 main::vy#2 ] { { bitmap_plot::x#0 = main::x#2 } { bitmap_plot::y#0 = main::y#2 } } ) always clobbers reg byte a reg byte y
Statement [35] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK [ ] ( main:3::init_irq:12 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [36] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO [ ] ( main:3::init_irq:12 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [37] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:3::init_irq:12 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [37] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:3::init_irq:12 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [38] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80 [ ] ( main:3::init_irq:12 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [39] *((const nomodify byte*) RASTER) ← (byte) 0 [ ] ( main:3::init_irq:12 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [40] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:3::init_irq:12 [ frame_cnt ] { } ) always clobbers reg byte a
@ -2231,6 +2264,7 @@ Uplift Scope [bitmap_init] 3,628.62: zp[2]:18 [ bitmap_init::yoffs#2 bitmap_init
Uplift Scope [bitmap_plot] 2,103: zp[1]:23 [ bitmap_plot::y#0 ] 2,002: zp[2]:26 [ bitmap_plot::$0 ] 2,002: zp[1]:30 [ bitmap_plot::$1 ] 1,501.5: zp[2]:28 [ bitmap_plot::plotter#1 ] 500.5: zp[2]:24 [ bitmap_plot::plotter#0 ] 420.6: zp[2]:21 [ bitmap_plot::x#0 ]
Uplift Scope [main] 387.17: zp[1]:7 [ main::vy#2 main::vy#8 main::vy#1 ] 303: zp[2]:5 [ main::vx#2 main::vx#6 main::vx#1 ] 112.48: zp[2]:2 [ main::x#2 main::x#1 ] 101: zp[1]:4 [ main::y#2 main::y#1 ]
Uplift Scope [] 7.78: zp[1]:20 [ frame_cnt ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [bitmap_clear]
Uplift Scope [init_irq]
Uplift Scope [irq]
@ -2241,6 +2275,7 @@ Limited combination testing to 100 combinations of 15360 possible.
Uplifting [bitmap_plot] best 4316 combination reg byte x [ bitmap_plot::y#0 ] zp[2]:26 [ bitmap_plot::$0 ] reg byte x [ bitmap_plot::$1 ] zp[2]:28 [ bitmap_plot::plotter#1 ] zp[2]:24 [ bitmap_plot::plotter#0 ] zp[2]:21 [ bitmap_plot::x#0 ]
Uplifting [main] best 4316 combination zp[1]:7 [ main::vy#2 main::vy#8 main::vy#1 ] zp[2]:5 [ main::vx#2 main::vx#6 main::vx#1 ] zp[2]:2 [ main::x#2 main::x#1 ] zp[1]:4 [ main::y#2 main::y#1 ]
Uplifting [] best 4316 combination zp[1]:20 [ frame_cnt ]
Uplifting [MOS6526_CIA] best 4316 combination
Uplifting [bitmap_clear] best 4316 combination
Uplifting [init_irq] best 4316 combination
Uplifting [irq] best 4316 combination
@ -2306,8 +2341,8 @@ ASSEMBLER BEFORE OPTIMIZATION
.label IRQ_ENABLE = $d01a
// Bits for the IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// CIA#1 Interrupt Status & Control Register
.label CIA1_INTERRUPT = $dc0d
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
// The vector used when the HARDWARE serves IRQ interrupts
@ -2315,6 +2350,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// The colors of the C64
.const BLACK = 0
.const WHITE = 1
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.label BITMAP = $2000
.label SCREEN = $400
.label frame_cnt = 8
@ -2550,10 +2586,10 @@ init_irq: {
// [36] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2
lda #PROCPORT_RAM_IO
sta PROCPORT
// [37] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// [37] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1_INTERRUPT
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// [38] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2
// Set raster line to $100
lda #$80
@ -2954,7 +2990,7 @@ FINAL SYMBOL TABLE
(const nomodify byte*) BGCOL = (byte*) 53281
(const byte*) BITMAP = (byte*) 8192
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte*) CIA1_INTERRUPT = (byte*) 56333
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) D011 = (byte*) 53265
(const nomodify byte*) D018 = (byte*) 53272
@ -2962,6 +2998,21 @@ FINAL SYMBOL TABLE
(const nomodify byte*) IRQ_ENABLE = (byte*) 53274
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*) 53273
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const nomodify byte*) PROCPORT = (byte*) 1
(const nomodify byte*) PROCPORT_DDR = (byte*) 0
(const nomodify byte) PROCPORT_DDR_MEMORY_MASK = (byte) 7
@ -3135,8 +3186,8 @@ Score: 3175
.label IRQ_ENABLE = $d01a
// Bits for the IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// CIA#1 Interrupt Status & Control Register
.label CIA1_INTERRUPT = $dc0d
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
// The vector used when the HARDWARE serves IRQ interrupts
@ -3144,6 +3195,7 @@ Score: 3175
// The colors of the C64
.const BLACK = 0
.const WHITE = 1
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.label BITMAP = $2000
.label SCREEN = $400
.label frame_cnt = 8
@ -3356,11 +3408,11 @@ init_irq: {
// [36] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2
lda #PROCPORT_RAM_IO
sta PROCPORT
// *CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR
// [37] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR
// [37] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1_INTERRUPT
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// *VIC_CONTROL |=$80
// [38] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2
// Set raster line to $100

View File

@ -5,7 +5,7 @@
(const nomodify byte*) BGCOL = (byte*) 53281
(const byte*) BITMAP = (byte*) 8192
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte*) CIA1_INTERRUPT = (byte*) 56333
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) D011 = (byte*) 53265
(const nomodify byte*) D018 = (byte*) 53272
@ -13,6 +13,21 @@
(const nomodify byte*) IRQ_ENABLE = (byte*) 53274
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*) 53273
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const nomodify byte*) PROCPORT = (byte*) 1
(const nomodify byte*) PROCPORT_DDR = (byte*) 0
(const nomodify byte) PROCPORT_DDR_MEMORY_MASK = (byte) 7

View File

@ -25,8 +25,8 @@
.label IRQ_ENABLE = $d01a
// Bits for the IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// CIA#1 Interrupt Status & Control Register
.label CIA1_INTERRUPT = $dc0d
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
// The vector used when the HARDWARE serves IRQ interrupts
@ -41,6 +41,7 @@
// PI/2 in u[4.28] format
.const PI_HALF_u4f28 = $1921fb54
.const SIZEOF_SIGNED_WORD = 2
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.label BITMAP = $2000
.label SCREEN = $400
.label frame_cnt = $16
@ -421,10 +422,10 @@ init_irq: {
// *PROCPORT = PROCPORT_RAM_IO
lda #PROCPORT_RAM_IO
sta PROCPORT
// *CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR
// CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1_INTERRUPT
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// *VIC_CONTROL |=$80
// Set raster line to $100
lda #$80

View File

@ -167,7 +167,7 @@ init_irq: scope:[init_irq] from main::@5
asm { sei }
[84] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK
[85] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO
[86] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[86] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[87] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80
[88] *((const nomodify byte*) RASTER) ← (byte) 0
[89] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER

View File

@ -2,6 +2,9 @@ Resolved forward reference frame_cnt to (volatile byte) frame_cnt
Resolved forward reference frame_cnt to (volatile byte) frame_cnt
Resolved forward reference frame_cnt to (volatile byte) frame_cnt
Resolved forward reference irq to interrupt(HARDWARE_CLOBBER)(void()) irq()
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).INTERRUPT with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Inlined call (byte~) main::$3 ← call toD018 (const byte*) SCREEN (const byte*) BITMAP
@ -862,7 +865,7 @@ init_irq: scope:[init_irq] from main::@7
asm { sei }
*((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK
*((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO
*((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
*((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) $80
*((const nomodify byte*) RASTER) ← (number) 0
*((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
@ -917,7 +920,7 @@ SYMBOL TABLE SSA
(const nomodify byte*) BGCOL = (byte*)(number) $d021
(const byte*) BITMAP = (byte*)(number) $2000
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte*) CIA1_INTERRUPT = (byte*)(number) $dc0d
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*)(number) $dc00
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) D011 = (byte*)(number) $d011
(const nomodify byte*) D018 = (byte*)(number) $d018
@ -925,6 +928,21 @@ SYMBOL TABLE SSA
(const nomodify byte*) IRQ_ENABLE = (byte*)(number) $d01a
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*)(number) $d019
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const nomodify dword) PI2_u4f28 = (dword) $6487ed51
(const nomodify dword) PI_HALF_u4f28 = (dword) $1921fb54
(const nomodify dword) PI_u4f28 = (dword) $3243f6a9
@ -1818,7 +1836,7 @@ Simplifying constant pointer cast (byte*) 53265
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (byte*) 53273
Simplifying constant pointer cast (byte*) 53274
Simplifying constant pointer cast (byte*) 56333
Simplifying constant pointer cast (struct MOS6526_CIA*) 56320
Simplifying constant pointer cast (void()**) 65534
Simplifying constant pointer cast (byte*) 8192
Simplifying constant pointer cast (byte*) 1024
@ -2798,7 +2816,7 @@ init_irq: scope:[init_irq] from main::@5
asm { sei }
[84] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK
[85] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO
[86] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[86] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[87] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80
[88] *((const nomodify byte*) RASTER) ← (byte) 0
[89] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
@ -3093,6 +3111,20 @@ irq::@return: scope:[irq] from irq::@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
(void()) bitmap_clear((byte) bitmap_clear::bgcol , (byte) bitmap_clear::fgcol)
(byte) bitmap_clear::bgcol
(byte) bitmap_clear::col
@ -3673,8 +3705,8 @@ Target platform is c64basic / MOS6502X
.label IRQ_ENABLE = $d01a
// Bits for the IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// CIA#1 Interrupt Status & Control Register
.label CIA1_INTERRUPT = $dc0d
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
// The vector used when the HARDWARE serves IRQ interrupts
@ -3689,6 +3721,7 @@ Target platform is c64basic / MOS6502X
// PI/2 in u[4.28] format
.const PI_HALF_u4f28 = $1921fb54
.const SIZEOF_SIGNED_WORD = 2
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.label BITMAP = $2000
.label SCREEN = $400
.label frame_cnt = $41
@ -4354,10 +4387,10 @@ init_irq: {
// [85] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2
lda #PROCPORT_RAM_IO
sta PROCPORT
// [86] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// [86] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1_INTERRUPT
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// [87] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2
// Set raster line to $100
lda #$80
@ -5569,7 +5602,7 @@ Statement [77] (byte~) mul16u::$1 ← (word) mul16u::a#3 & (byte) 1 [ mul16u::re
Statement [79] (dword) mul16u::res#1 ← (dword) mul16u::res#2 + (dword) mul16u::mb#2 [ mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] ( main:3::mul16s:20::mul16u:57 [ frame_cnt main::idx_x#3 main::idx_y#3 mul16s::a#3 mul16s::b#3 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { mul16s::b#1 = mul16s::b#3 main::cos_x#0 } { mul16s::return#0 = mul16s::return#3 } { mul16u::b#0 = mul16u::b#2 } { mul16u::a#1 = mul16u::a#6 } { mul16u::return#2 = mul16u::res#2 } } main:3::mul16s:30::mul16u:57 [ frame_cnt main::idx_x#3 main::idx_y#3 main::x#0 mul16s::a#3 mul16s::b#3 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { mul16s::b#2 = mul16s::b#3 main::sin_y#0 } { mul16s::return#0 = mul16s::return#4 } { mul16u::b#0 = mul16u::b#2 } { mul16u::a#1 = mul16u::a#6 } { mul16u::return#2 = mul16u::res#2 } } main:3::sin16s_gen2:6::mul16s:140::mul16u:57 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 mul16s::a#3 mul16s::b#3 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { mul16s::a#0 = mul16s::a#3 sin16s::return#0 } { mul16s::return#0 = mul16s::return#2 } { mul16u::b#0 = mul16u::b#2 } { mul16u::a#1 = mul16u::a#6 } { mul16u::return#2 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:137::mulu16_sel:158::mul16u:191 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#0 = mulu16_sel::return#12 } { mul16u::a#2 = mul16u::a#6 mul16u::b#2 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#0 mulu16_sel::v1#5 mulu16_sel::v1#0 sin16s::x1#0 } { mul16u::return#3 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:137::mulu16_sel:163::mul16u:191 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#1 = mulu16_sel::return#12 } { mul16u::b#1 = mul16u::b#2 mulu16_sel::v2#5 mulu16_sel::v2#1 sin16s::x1#0 } { mul16u::a#2 = mul16u::a#6 mulu16_sel::v1#5 mulu16_sel::v1#1 sin16s::x2#0 } { mul16u::return#3 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:137::mulu16_sel:167::mul16u:191 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 sin16s::x3#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#12 = mulu16_sel::return#2 } { mul16u::b#1 = mul16u::b#2 mulu16_sel::v2#5 } { mul16u::a#2 = mul16u::a#6 mulu16_sel::v1#5 mulu16_sel::v1#2 sin16s::x3#0 } { mul16u::return#3 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:137::mulu16_sel:173::mul16u:191 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 sin16s::usinx#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#10 = mulu16_sel::return#12 } { mul16u::b#1 = mul16u::b#2 mulu16_sel::v2#5 mulu16_sel::v2#3 sin16s::x1#0 } { mul16u::a#2 = mul16u::a#6 mulu16_sel::v1#5 mulu16_sel::v1#3 sin16s::x3#0 } { mul16u::return#3 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:137::mulu16_sel:178::mul16u:191 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::usinx#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#11 = mulu16_sel::return#12 } { mul16u::b#1 = mul16u::b#2 mulu16_sel::v2#5 mulu16_sel::v2#4 sin16s::x1#0 } { mul16u::a#2 = mul16u::a#6 mulu16_sel::v1#5 mulu16_sel::v1#4 sin16s::x4#0 } { mul16u::return#3 = mul16u::res#2 } } ) always clobbers reg byte a
Statement [84] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [85] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [86] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [86] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [87] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80 [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [88] *((const nomodify byte*) RASTER) ← (byte) 0 [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [89] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
@ -5694,7 +5727,7 @@ Statement [77] (byte~) mul16u::$1 ← (word) mul16u::a#3 & (byte) 1 [ mul16u::re
Statement [79] (dword) mul16u::res#1 ← (dword) mul16u::res#2 + (dword) mul16u::mb#2 [ mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] ( main:3::mul16s:20::mul16u:57 [ frame_cnt main::idx_x#3 main::idx_y#3 mul16s::a#3 mul16s::b#3 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { mul16s::b#1 = mul16s::b#3 main::cos_x#0 } { mul16s::return#0 = mul16s::return#3 } { mul16u::b#0 = mul16u::b#2 } { mul16u::a#1 = mul16u::a#6 } { mul16u::return#2 = mul16u::res#2 } } main:3::mul16s:30::mul16u:57 [ frame_cnt main::idx_x#3 main::idx_y#3 main::x#0 mul16s::a#3 mul16s::b#3 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { mul16s::b#2 = mul16s::b#3 main::sin_y#0 } { mul16s::return#0 = mul16s::return#4 } { mul16u::b#0 = mul16u::b#2 } { mul16u::a#1 = mul16u::a#6 } { mul16u::return#2 = mul16u::res#2 } } main:3::sin16s_gen2:6::mul16s:140::mul16u:57 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 mul16s::a#3 mul16s::b#3 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { mul16s::a#0 = mul16s::a#3 sin16s::return#0 } { mul16s::return#0 = mul16s::return#2 } { mul16u::b#0 = mul16u::b#2 } { mul16u::a#1 = mul16u::a#6 } { mul16u::return#2 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:137::mulu16_sel:158::mul16u:191 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#0 = mulu16_sel::return#12 } { mul16u::a#2 = mul16u::a#6 mul16u::b#2 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#0 mulu16_sel::v1#5 mulu16_sel::v1#0 sin16s::x1#0 } { mul16u::return#3 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:137::mulu16_sel:163::mul16u:191 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#1 = mulu16_sel::return#12 } { mul16u::b#1 = mul16u::b#2 mulu16_sel::v2#5 mulu16_sel::v2#1 sin16s::x1#0 } { mul16u::a#2 = mul16u::a#6 mulu16_sel::v1#5 mulu16_sel::v1#1 sin16s::x2#0 } { mul16u::return#3 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:137::mulu16_sel:167::mul16u:191 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 sin16s::x3#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#12 = mulu16_sel::return#2 } { mul16u::b#1 = mul16u::b#2 mulu16_sel::v2#5 } { mul16u::a#2 = mul16u::a#6 mulu16_sel::v1#5 mulu16_sel::v1#2 sin16s::x3#0 } { mul16u::return#3 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:137::mulu16_sel:173::mul16u:191 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 sin16s::usinx#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#10 = mulu16_sel::return#12 } { mul16u::b#1 = mul16u::b#2 mulu16_sel::v2#5 mulu16_sel::v2#3 sin16s::x1#0 } { mul16u::a#2 = mul16u::a#6 mulu16_sel::v1#5 mulu16_sel::v1#3 sin16s::x3#0 } { mul16u::return#3 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:137::mulu16_sel:178::mul16u:191 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::usinx#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#11 = mulu16_sel::return#12 } { mul16u::b#1 = mul16u::b#2 mulu16_sel::v2#5 mulu16_sel::v2#4 sin16s::x1#0 } { mul16u::a#2 = mul16u::a#6 mulu16_sel::v1#5 mulu16_sel::v1#4 sin16s::x4#0 } { mul16u::return#3 = mul16u::res#2 } } ) always clobbers reg byte a
Statement [84] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [85] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [86] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [86] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [87] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80 [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [88] *((const nomodify byte*) RASTER) ← (byte) 0 [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [89] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
@ -5881,6 +5914,7 @@ Uplift Scope [sin16s_gen2] 2,233: zp[2]:38 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ]
Uplift Scope [div32u16u] 2,002: zp[2]:215 [ div32u16u::quotient_lo#0 ] 400.4: zp[2]:211 [ div32u16u::quotient_hi#0 ] 367.33: zp[4]:217 [ div32u16u::return#0 ] 202: zp[4]:143 [ div32u16u::return#2 ]
Uplift Scope [main] 212.82: zp[2]:4 [ main::idx_y#3 main::idx_y#10 main::idx_y#1 ] 202: zp[2]:66 [ main::$19 ] 202: zp[2]:68 [ main::$21 ] 202: zp[2]:70 [ main::cos_x#0 ] 202: zp[4]:76 [ main::xpos#0 ] 202: zp[4]:80 [ main::$6 ] 202: zp[2]:84 [ main::$7 ] 202: zp[2]:88 [ main::$20 ] 202: zp[2]:90 [ main::$22 ] 202: zp[2]:92 [ main::sin_y#0 ] 202: zp[4]:98 [ main::ypos#0 ] 202: zp[4]:102 [ main::$10 ] 202: zp[2]:106 [ main::$11 ] 147.29: zp[2]:2 [ main::idx_x#3 main::idx_x#10 main::idx_x#1 ] 50.5: zp[2]:108 [ main::y#0 ] 18.36: zp[2]:86 [ main::x#0 ]
Uplift Scope [] 2,200.4: zp[2]:223 [ rem16u#1 ] 4.47: zp[1]:65 [ frame_cnt ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [bitmap_clear]
Uplift Scope [init_irq]
Uplift Scope [irq]
@ -5898,6 +5932,7 @@ Uplifting [sin16s_gen2] best 26843 combination zp[2]:38 [ sin16s_gen2::i#2 sin16
Uplifting [div32u16u] best 26843 combination zp[2]:215 [ div32u16u::quotient_lo#0 ] zp[2]:211 [ div32u16u::quotient_hi#0 ] zp[4]:217 [ div32u16u::return#0 ] zp[4]:143 [ div32u16u::return#2 ]
Uplifting [main] best 26603 combination zp[2]:4 [ main::idx_y#3 main::idx_y#10 main::idx_y#1 ] zp[2]:66 [ main::$19 ] zp[2]:68 [ main::$21 ] zp[2]:70 [ main::cos_x#0 ] zp[4]:76 [ main::xpos#0 ] zp[4]:80 [ main::$6 ] reg byte alu [ main::$7 ] zp[2]:88 [ main::$20 ] zp[2]:90 [ main::$22 ] zp[2]:92 [ main::sin_y#0 ] zp[4]:98 [ main::ypos#0 ] zp[4]:102 [ main::$10 ] reg byte alu [ main::$11 ] zp[2]:2 [ main::idx_x#3 main::idx_x#10 main::idx_x#1 ] zp[2]:108 [ main::y#0 ] zp[2]:86 [ main::x#0 ]
Uplifting [] best 26603 combination zp[2]:223 [ rem16u#1 ] zp[1]:65 [ frame_cnt ]
Uplifting [MOS6526_CIA] best 26603 combination
Uplifting [bitmap_clear] best 26603 combination
Uplifting [init_irq] best 26603 combination
Uplifting [irq] best 26603 combination
@ -6027,8 +6062,8 @@ ASSEMBLER BEFORE OPTIMIZATION
.label IRQ_ENABLE = $d01a
// Bits for the IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// CIA#1 Interrupt Status & Control Register
.label CIA1_INTERRUPT = $dc0d
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
// The vector used when the HARDWARE serves IRQ interrupts
@ -6043,6 +6078,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// PI/2 in u[4.28] format
.const PI_HALF_u4f28 = $1921fb54
.const SIZEOF_SIGNED_WORD = 2
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.label BITMAP = $2000
.label SCREEN = $400
.label frame_cnt = $16
@ -6605,10 +6641,10 @@ init_irq: {
// [85] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2
lda #PROCPORT_RAM_IO
sta PROCPORT
// [86] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// [86] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1_INTERRUPT
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// [87] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2
// Set raster line to $100
lda #$80
@ -7817,7 +7853,7 @@ FINAL SYMBOL TABLE
(const nomodify byte*) BGCOL = (byte*) 53281
(const byte*) BITMAP = (byte*) 8192
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte*) CIA1_INTERRUPT = (byte*) 56333
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) D011 = (byte*) 53265
(const nomodify byte*) D018 = (byte*) 53272
@ -7825,6 +7861,21 @@ FINAL SYMBOL TABLE
(const nomodify byte*) IRQ_ENABLE = (byte*) 53274
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*) 53273
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const nomodify dword) PI2_u4f28 = (dword) $6487ed51
(const nomodify dword) PI_HALF_u4f28 = (dword) $1921fb54
(const nomodify dword) PI_u4f28 = (dword) $3243f6a9
@ -8246,8 +8297,8 @@ Score: 20648
.label IRQ_ENABLE = $d01a
// Bits for the IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// CIA#1 Interrupt Status & Control Register
.label CIA1_INTERRUPT = $dc0d
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
// The vector used when the HARDWARE serves IRQ interrupts
@ -8262,6 +8313,7 @@ Score: 20648
// PI/2 in u[4.28] format
.const PI_HALF_u4f28 = $1921fb54
.const SIZEOF_SIGNED_WORD = 2
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.label BITMAP = $2000
.label SCREEN = $400
.label frame_cnt = $16
@ -8793,11 +8845,11 @@ init_irq: {
// [85] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2
lda #PROCPORT_RAM_IO
sta PROCPORT
// *CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR
// [86] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR
// [86] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1_INTERRUPT
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// *VIC_CONTROL |=$80
// [87] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2
// Set raster line to $100

View File

@ -5,7 +5,7 @@
(const nomodify byte*) BGCOL = (byte*) 53281
(const byte*) BITMAP = (byte*) 8192
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte*) CIA1_INTERRUPT = (byte*) 56333
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) D011 = (byte*) 53265
(const nomodify byte*) D018 = (byte*) 53272
@ -13,6 +13,21 @@
(const nomodify byte*) IRQ_ENABLE = (byte*) 53274
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*) 53273
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const nomodify dword) PI2_u4f28 = (dword) $6487ed51
(const nomodify dword) PI_HALF_u4f28 = (dword) $1921fb54
(const nomodify dword) PI_u4f28 = (dword) $3243f6a9

View File

@ -26,8 +26,8 @@
.label IRQ_ENABLE = $d01a
// Bits for the IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// CIA#1 Interrupt Status & Control Register
.label CIA1_INTERRUPT = $dc0d
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
// The vector used when the HARDWARE serves IRQ interrupts
@ -42,6 +42,7 @@
// PI/2 in u[4.28] format
.const PI_HALF_u4f28 = $1921fb54
.const SIZEOF_SIGNED_WORD = 2
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.label BITMAP = $2000
.label SCREEN = $400
.label frame_cnt = $1b
@ -458,10 +459,10 @@ init_irq: {
// *PROCPORT = PROCPORT_RAM_IO
lda #PROCPORT_RAM_IO
sta PROCPORT
// *CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR
// CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1_INTERRUPT
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// *VIC_CONTROL |=$80
// Set raster line to $100
lda #$80

View File

@ -186,7 +186,7 @@ init_irq: scope:[init_irq] from main::@8
asm { sei }
[93] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK
[94] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO
[95] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[95] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[96] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80
[97] *((const nomodify byte*) RASTER) ← (byte) 0
[98] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER

View File

@ -2,6 +2,9 @@ Resolved forward reference frame_cnt to (volatile byte) frame_cnt
Resolved forward reference frame_cnt to (volatile byte) frame_cnt
Resolved forward reference frame_cnt to (volatile byte) frame_cnt
Resolved forward reference irq to interrupt(HARDWARE_CLOBBER)(void()) irq()
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).INTERRUPT with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Inlined call (byte~) main::$3 ← call toD018 (const byte*) SCREEN (const byte*) BITMAP
@ -924,7 +927,7 @@ init_irq: scope:[init_irq] from main::@11
asm { sei }
*((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK
*((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO
*((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
*((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) $80
*((const nomodify byte*) RASTER) ← (number) 0
*((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
@ -980,7 +983,7 @@ SYMBOL TABLE SSA
(const byte*) BITMAP = (byte*)(number) $2000
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify byte*) CIA1_INTERRUPT = (byte*)(number) $dc0d
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*)(number) $dc00
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) D011 = (byte*)(number) $d011
(const nomodify byte*) D018 = (byte*)(number) $d018
@ -988,6 +991,21 @@ SYMBOL TABLE SSA
(const nomodify byte*) IRQ_ENABLE = (byte*)(number) $d01a
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*)(number) $d019
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const nomodify dword) PI2_u4f28 = (dword) $6487ed51
(const nomodify dword) PI_HALF_u4f28 = (dword) $1921fb54
(const nomodify dword) PI_u4f28 = (dword) $3243f6a9
@ -1938,7 +1956,7 @@ Simplifying constant pointer cast (byte*) 53265
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (byte*) 53273
Simplifying constant pointer cast (byte*) 53274
Simplifying constant pointer cast (byte*) 56333
Simplifying constant pointer cast (struct MOS6526_CIA*) 56320
Simplifying constant pointer cast (void()**) 65534
Simplifying constant pointer cast (byte*) 8192
Simplifying constant pointer cast (byte*) 1024
@ -2989,7 +3007,7 @@ init_irq: scope:[init_irq] from main::@8
asm { sei }
[93] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK
[94] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO
[95] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[95] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[96] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80
[97] *((const nomodify byte*) RASTER) ← (byte) 0
[98] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER
@ -3284,6 +3302,20 @@ irq::@return: scope:[irq] from irq::@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
(void()) bitmap_clear((byte) bitmap_clear::bgcol , (byte) bitmap_clear::fgcol)
(byte) bitmap_clear::bgcol
(byte) bitmap_clear::col
@ -3880,8 +3912,8 @@ Target platform is c64basic / MOS6502X
.label IRQ_ENABLE = $d01a
// Bits for the IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// CIA#1 Interrupt Status & Control Register
.label CIA1_INTERRUPT = $dc0d
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
// The vector used when the HARDWARE serves IRQ interrupts
@ -3896,6 +3928,7 @@ Target platform is c64basic / MOS6502X
// PI/2 in u[4.28] format
.const PI_HALF_u4f28 = $1921fb54
.const SIZEOF_SIGNED_WORD = 2
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.label BITMAP = $2000
.label SCREEN = $400
.label frame_cnt = $44
@ -4608,10 +4641,10 @@ init_irq: {
// [94] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2
lda #PROCPORT_RAM_IO
sta PROCPORT
// [95] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// [95] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1_INTERRUPT
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// [96] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2
// Set raster line to $100
lda #$80
@ -5834,7 +5867,7 @@ Statement [86] (byte~) mul16u::$1 ← (word) mul16u::a#3 & (byte) 1 [ mul16u::re
Statement [88] (dword) mul16u::res#1 ← (dword) mul16u::res#2 + (dword) mul16u::mb#2 [ mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] ( main:3::mul16s:21::mul16u:66 [ frame_cnt main::idx_x#11 main::r#10 main::idx_y#3 main::r_add#10 mul16s::a#3 mul16s::b#3 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { mul16s::a#1 = mul16s::a#3 main::r#10 } { mul16s::b#1 = mul16s::b#3 main::cos_x#0 } { mul16s::return#0 = mul16s::return#3 } { mul16u::b#0 = mul16u::b#2 } { mul16u::a#1 = mul16u::a#6 } { mul16u::return#2 = mul16u::res#2 } } main:3::mul16s:32::mul16u:66 [ frame_cnt main::idx_x#11 main::r#10 main::idx_y#3 main::r_add#10 main::x#0 mul16s::a#3 mul16s::b#3 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { mul16s::a#2 = mul16s::a#3 main::r#10 } { mul16s::b#2 = mul16s::b#3 main::sin_y#0 } { mul16s::return#0 = mul16s::return#4 } { mul16u::b#0 = mul16u::b#2 } { mul16u::a#1 = mul16u::a#6 } { mul16u::return#2 = mul16u::res#2 } } main:3::sin16s_gen2:6::mul16s:149::mul16u:66 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 mul16s::a#3 mul16s::b#3 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { mul16s::a#0 = mul16s::a#3 sin16s::return#0 } { mul16s::return#0 = mul16s::return#2 } { mul16u::b#0 = mul16u::b#2 } { mul16u::a#1 = mul16u::a#6 } { mul16u::return#2 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:146::mulu16_sel:167::mul16u:200 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#0 = mulu16_sel::return#12 } { mul16u::a#2 = mul16u::a#6 mul16u::b#2 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#0 mulu16_sel::v1#5 mulu16_sel::v1#0 sin16s::x1#0 } { mul16u::return#3 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:146::mulu16_sel:172::mul16u:200 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#1 = mulu16_sel::return#12 } { mul16u::b#1 = mul16u::b#2 mulu16_sel::v2#5 mulu16_sel::v2#1 sin16s::x1#0 } { mul16u::a#2 = mul16u::a#6 mulu16_sel::v1#5 mulu16_sel::v1#1 sin16s::x2#0 } { mul16u::return#3 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:146::mulu16_sel:176::mul16u:200 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 sin16s::x3#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#12 = mulu16_sel::return#2 } { mul16u::b#1 = mul16u::b#2 mulu16_sel::v2#5 } { mul16u::a#2 = mul16u::a#6 mulu16_sel::v1#5 mulu16_sel::v1#2 sin16s::x3#0 } { mul16u::return#3 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:146::mulu16_sel:182::mul16u:200 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 sin16s::usinx#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#10 = mulu16_sel::return#12 } { mul16u::b#1 = mul16u::b#2 mulu16_sel::v2#5 mulu16_sel::v2#3 sin16s::x1#0 } { mul16u::a#2 = mul16u::a#6 mulu16_sel::v1#5 mulu16_sel::v1#3 sin16s::x3#0 } { mul16u::return#3 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:146::mulu16_sel:187::mul16u:200 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::usinx#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#11 = mulu16_sel::return#12 } { mul16u::b#1 = mul16u::b#2 mulu16_sel::v2#5 mulu16_sel::v2#4 sin16s::x1#0 } { mul16u::a#2 = mul16u::a#6 mulu16_sel::v1#5 mulu16_sel::v1#4 sin16s::x4#0 } { mul16u::return#3 = mul16u::res#2 } } ) always clobbers reg byte a
Statement [93] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [94] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [95] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [95] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [96] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80 [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [97] *((const nomodify byte*) RASTER) ← (byte) 0 [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [98] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
@ -5969,7 +6002,7 @@ Statement [86] (byte~) mul16u::$1 ← (word) mul16u::a#3 & (byte) 1 [ mul16u::re
Statement [88] (dword) mul16u::res#1 ← (dword) mul16u::res#2 + (dword) mul16u::mb#2 [ mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] ( main:3::mul16s:21::mul16u:66 [ frame_cnt main::idx_x#11 main::r#10 main::idx_y#3 main::r_add#10 mul16s::a#3 mul16s::b#3 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { mul16s::a#1 = mul16s::a#3 main::r#10 } { mul16s::b#1 = mul16s::b#3 main::cos_x#0 } { mul16s::return#0 = mul16s::return#3 } { mul16u::b#0 = mul16u::b#2 } { mul16u::a#1 = mul16u::a#6 } { mul16u::return#2 = mul16u::res#2 } } main:3::mul16s:32::mul16u:66 [ frame_cnt main::idx_x#11 main::r#10 main::idx_y#3 main::r_add#10 main::x#0 mul16s::a#3 mul16s::b#3 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { mul16s::a#2 = mul16s::a#3 main::r#10 } { mul16s::b#2 = mul16s::b#3 main::sin_y#0 } { mul16s::return#0 = mul16s::return#4 } { mul16u::b#0 = mul16u::b#2 } { mul16u::a#1 = mul16u::a#6 } { mul16u::return#2 = mul16u::res#2 } } main:3::sin16s_gen2:6::mul16s:149::mul16u:66 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 mul16s::a#3 mul16s::b#3 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { mul16s::a#0 = mul16s::a#3 sin16s::return#0 } { mul16s::return#0 = mul16s::return#2 } { mul16u::b#0 = mul16u::b#2 } { mul16u::a#1 = mul16u::a#6 } { mul16u::return#2 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:146::mulu16_sel:167::mul16u:200 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#0 = mulu16_sel::return#12 } { mul16u::a#2 = mul16u::a#6 mul16u::b#2 mul16u::b#1 mulu16_sel::v2#5 mulu16_sel::v2#0 mulu16_sel::v1#5 mulu16_sel::v1#0 sin16s::x1#0 } { mul16u::return#3 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:146::mulu16_sel:172::mul16u:200 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#1 = mulu16_sel::return#12 } { mul16u::b#1 = mul16u::b#2 mulu16_sel::v2#5 mulu16_sel::v2#1 sin16s::x1#0 } { mul16u::a#2 = mul16u::a#6 mulu16_sel::v1#5 mulu16_sel::v1#1 sin16s::x2#0 } { mul16u::return#3 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:146::mulu16_sel:176::mul16u:200 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 sin16s::x3#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#12 = mulu16_sel::return#2 } { mul16u::b#1 = mul16u::b#2 mulu16_sel::v2#5 } { mul16u::a#2 = mul16u::a#6 mulu16_sel::v1#5 mulu16_sel::v1#2 sin16s::x3#0 } { mul16u::return#3 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:146::mulu16_sel:182::mul16u:200 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::x1#0 sin16s::usinx#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#10 = mulu16_sel::return#12 } { mul16u::b#1 = mul16u::b#2 mulu16_sel::v2#5 mulu16_sel::v2#3 sin16s::x1#0 } { mul16u::a#2 = mul16u::a#6 mulu16_sel::v1#5 mulu16_sel::v1#3 sin16s::x3#0 } { mul16u::return#3 = mul16u::res#2 } } main:3::sin16s_gen2:6::sin16s:146::mulu16_sel:187::mul16u:200 [ frame_cnt sin16s_gen2::step#0 sin16s_gen2::i#2 sin16s_gen2::x#2 sin16s_gen2::sintab#2 sin16s::isUpper#2 sin16s::usinx#0 mulu16_sel::select#5 mul16u::a#3 mul16u::mb#2 mul16u::res#1 ] { { sin16s::x#0 = sin16s_gen2::x#2 } { sin16s::return#0 = sin16s::return#1 } { mulu16_sel::return#11 = mulu16_sel::return#12 } { mul16u::b#1 = mul16u::b#2 mulu16_sel::v2#5 mulu16_sel::v2#4 sin16s::x1#0 } { mul16u::a#2 = mul16u::a#6 mulu16_sel::v1#5 mulu16_sel::v1#4 sin16s::x4#0 } { mul16u::return#3 = mul16u::res#2 } } ) always clobbers reg byte a
Statement [93] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [94] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [95] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [95] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [96] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80 [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [97] *((const nomodify byte*) RASTER) ← (byte) 0 [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
Statement [98] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:3::init_irq:14 [ frame_cnt ] { } ) always clobbers reg byte a
@ -6158,6 +6191,7 @@ Uplift Scope [sin16s_gen2] 2,233: zp[2]:41 [ sin16s_gen2::i#2 sin16s_gen2::i#1 ]
Uplift Scope [div32u16u] 2,002: zp[2]:214 [ div32u16u::quotient_lo#0 ] 400.4: zp[2]:210 [ div32u16u::quotient_hi#0 ] 367.33: zp[4]:216 [ div32u16u::return#0 ] 202: zp[4]:142 [ div32u16u::return#2 ]
Uplift Scope [main] 372.11: zp[1]:8 [ main::r_add#10 main::r_add#12 main::r_add#1 ] 202: zp[2]:69 [ main::$26 ] 202: zp[2]:71 [ main::$30 ] 202: zp[4]:79 [ main::xpos#0 ] 202: zp[2]:85 [ main::$7 ] 202: zp[2]:89 [ main::$27 ] 202: zp[2]:91 [ main::$31 ] 202: zp[4]:99 [ main::ypos#0 ] 202: zp[2]:105 [ main::$11 ] 139.77: zp[2]:2 [ main::idx_x#11 main::idx_x#10 main::idx_x#1 ] 139.63: zp[2]:6 [ main::idx_y#3 main::idx_y#10 main::idx_y#1 ] 101: zp[2]:73 [ main::cos_x#0 ] 101: zp[2]:83 [ main::$28 ] 101: zp[2]:93 [ main::sin_y#0 ] 101: zp[2]:103 [ main::$29 ] 62.04: zp[2]:4 [ main::r#10 main::r#1 ] 50.5: zp[2]:107 [ main::y#0 ] 8.42: zp[2]:87 [ main::x#0 ]
Uplift Scope [] 2,200.4: zp[2]:222 [ rem16u#1 ] 3.82: zp[1]:68 [ frame_cnt ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [bitmap_clear]
Uplift Scope [init_irq]
Uplift Scope [irq]
@ -6175,6 +6209,7 @@ Uplifting [sin16s_gen2] best 26768 combination zp[2]:41 [ sin16s_gen2::i#2 sin16
Uplifting [div32u16u] best 26768 combination zp[2]:214 [ div32u16u::quotient_lo#0 ] zp[2]:210 [ div32u16u::quotient_hi#0 ] zp[4]:216 [ div32u16u::return#0 ] zp[4]:142 [ div32u16u::return#2 ]
Uplifting [main] best 26768 combination zp[1]:8 [ main::r_add#10 main::r_add#12 main::r_add#1 ] zp[2]:69 [ main::$26 ] zp[2]:71 [ main::$30 ] zp[4]:79 [ main::xpos#0 ] zp[2]:85 [ main::$7 ] zp[2]:89 [ main::$27 ] zp[2]:91 [ main::$31 ] zp[4]:99 [ main::ypos#0 ] zp[2]:105 [ main::$11 ] zp[2]:2 [ main::idx_x#11 main::idx_x#10 main::idx_x#1 ] zp[2]:6 [ main::idx_y#3 main::idx_y#10 main::idx_y#1 ] zp[2]:73 [ main::cos_x#0 ] zp[2]:83 [ main::$28 ] zp[2]:93 [ main::sin_y#0 ] zp[2]:103 [ main::$29 ] zp[2]:4 [ main::r#10 main::r#1 ] zp[2]:107 [ main::y#0 ] zp[2]:87 [ main::x#0 ]
Uplifting [] best 26768 combination zp[2]:222 [ rem16u#1 ] zp[1]:68 [ frame_cnt ]
Uplifting [MOS6526_CIA] best 26768 combination
Uplifting [bitmap_clear] best 26768 combination
Uplifting [init_irq] best 26768 combination
Uplifting [irq] best 26768 combination
@ -6309,8 +6344,8 @@ ASSEMBLER BEFORE OPTIMIZATION
.label IRQ_ENABLE = $d01a
// Bits for the IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// CIA#1 Interrupt Status & Control Register
.label CIA1_INTERRUPT = $dc0d
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
// The vector used when the HARDWARE serves IRQ interrupts
@ -6325,6 +6360,7 @@ ASSEMBLER BEFORE OPTIMIZATION
// PI/2 in u[4.28] format
.const PI_HALF_u4f28 = $1921fb54
.const SIZEOF_SIGNED_WORD = 2
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.label BITMAP = $2000
.label SCREEN = $400
.label frame_cnt = $1b
@ -6946,10 +6982,10 @@ init_irq: {
// [94] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2
lda #PROCPORT_RAM_IO
sta PROCPORT
// [95] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// [95] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1_INTERRUPT
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// [96] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2
// Set raster line to $100
lda #$80
@ -8177,7 +8213,7 @@ FINAL SYMBOL TABLE
(const byte*) BITMAP = (byte*) 8192
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CIA1_INTERRUPT = (byte*) 56333
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) D011 = (byte*) 53265
(const nomodify byte*) D018 = (byte*) 53272
@ -8185,6 +8221,21 @@ FINAL SYMBOL TABLE
(const nomodify byte*) IRQ_ENABLE = (byte*) 53274
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*) 53273
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const nomodify dword) PI2_u4f28 = (dword) $6487ed51
(const nomodify dword) PI_HALF_u4f28 = (dword) $1921fb54
(const nomodify dword) PI_u4f28 = (dword) $3243f6a9
@ -8619,8 +8670,8 @@ Score: 20833
.label IRQ_ENABLE = $d01a
// Bits for the IRQ Status/Enable Registers
.const IRQ_RASTER = 1
// CIA#1 Interrupt Status & Control Register
.label CIA1_INTERRUPT = $dc0d
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
// The vector used when the HARDWARE serves IRQ interrupts
@ -8635,6 +8686,7 @@ Score: 20833
// PI/2 in u[4.28] format
.const PI_HALF_u4f28 = $1921fb54
.const SIZEOF_SIGNED_WORD = 2
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
.label BITMAP = $2000
.label SCREEN = $400
.label frame_cnt = $1b
@ -9221,11 +9273,11 @@ init_irq: {
// [94] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2
lda #PROCPORT_RAM_IO
sta PROCPORT
// *CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR
// [95] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR
// [95] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1_INTERRUPT
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// *VIC_CONTROL |=$80
// [96] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) | (byte) $80 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2
// Set raster line to $100

View File

@ -6,7 +6,7 @@
(const byte*) BITMAP = (byte*) 8192
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CIA1_INTERRUPT = (byte*) 56333
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) D011 = (byte*) 53265
(const nomodify byte*) D018 = (byte*) 53272
@ -14,6 +14,21 @@
(const nomodify byte*) IRQ_ENABLE = (byte*) 53274
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*) 53273
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const nomodify dword) PI2_u4f28 = (dword) $6487ed51
(const nomodify dword) PI_HALF_u4f28 = (dword) $1921fb54
(const nomodify dword) PI_u4f28 = (dword) $3243f6a9

View File

@ -1,3 +1,5 @@
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Inlined call (byte~) main::$2 ← call toD018 (const byte*) SCREEN (const byte*) BITMAP
@ -591,6 +593,20 @@ SYMBOL TABLE SSA
(const byte*) COSTAB = (const byte*) SINTAB+(number) $40
(const nomodify byte*) D011 = (byte*)(number) $d011
(const nomodify byte*) D018 = (byte*)(number) $d018
(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
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10
@ -1988,6 +2004,20 @@ bitmap_init::@return: scope:[bitmap_init] from bitmap_init::@4
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
(word()) abs_u16((word) abs_u16::w)
(byte~) abs_u16::$0 20002.0
(byte~) abs_u16::$1 20002.0
@ -3425,6 +3455,7 @@ Uplift Scope [sgn_u16] 20,002: zp[1]:64 [ sgn_u16::$0 ] 20,002: zp[1]:65 [ sgn_u
Uplift Scope [memset] 35,672.33: zp[2]:26 [ memset::dst#2 memset::dst#4 memset::dst#1 ] 1,833.67: zp[2]:68 [ memset::end#0 ] 1,250.12: zp[1]:25 [ memset::c#4 ] 1,001: zp[2]:21 [ memset::num#2 ] 0: zp[2]:23 [ memset::str#3 ]
Uplift Scope [bitmap_init] 3,628.62: zp[2]:31 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] 3,169.83: zp[1]:28 [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] 2,002: zp[1]:29 [ bitmap_init::x#2 bitmap_init::x#1 ] 2,002: zp[1]:30 [ bitmap_init::y#2 bitmap_init::y#1 ] 2,002: zp[1]:71 [ bitmap_init::$4 ] 2,002: zp[1]:72 [ bitmap_init::$5 ] 2,002: zp[1]:73 [ bitmap_init::$6 ] 500.5: zp[1]:70 [ bitmap_init::$7 ]
Uplift Scope [main] 232.3: zp[1]:2 [ main::i#2 main::i#1 ] 202: zp[2]:33 [ main::$13 ] 202: zp[2]:35 [ main::$14 ] 123.44: zp[1]:3 [ main::a#2 main::a#1 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [bitmap_clear]
Uplift Scope [RADIX]
Uplift Scope []
@ -3437,6 +3468,7 @@ Uplifting [memset] best 33028 combination zp[2]:26 [ memset::dst#2 memset::dst#4
Uplifting [bitmap_init] best 32518 combination zp[2]:31 [ bitmap_init::yoffs#2 bitmap_init::yoffs#4 bitmap_init::yoffs#1 ] reg byte a [ bitmap_init::bits#3 bitmap_init::bits#4 bitmap_init::bits#1 ] reg byte x [ bitmap_init::x#2 bitmap_init::x#1 ] reg byte x [ bitmap_init::y#2 bitmap_init::y#1 ] reg byte a [ bitmap_init::$4 ] zp[1]:72 [ bitmap_init::$5 ] zp[1]:73 [ bitmap_init::$6 ] zp[1]:70 [ bitmap_init::$7 ]
Limited combination testing to 100 combinations of 15360 possible.
Uplifting [main] best 32518 combination zp[1]:2 [ main::i#2 main::i#1 ] zp[2]:33 [ main::$13 ] zp[2]:35 [ main::$14 ] zp[1]:3 [ main::a#2 main::a#1 ]
Uplifting [MOS6526_CIA] best 32518 combination
Uplifting [bitmap_clear] best 32518 combination
Uplifting [RADIX] best 32518 combination
Uplifting [] best 32518 combination
@ -4477,6 +4509,20 @@ FINAL SYMBOL TABLE
(const byte*) COSTAB = (const byte*) SINTAB+(byte) $40
(const nomodify byte*) D011 = (byte*) 53265
(const nomodify byte*) D018 = (byte*) 53272
(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
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10

View File

@ -5,6 +5,20 @@
(const byte*) COSTAB = (const byte*) SINTAB+(byte) $40
(const nomodify byte*) D011 = (byte*) 53265
(const nomodify byte*) D018 = (byte*) 53272
(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
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10

View File

@ -24,10 +24,8 @@
.const VIC_MCM = $10
.const VIC_CSEL = 8
.label VIC_MEMORY = $d018
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// Feature enables or disables the extra C64 DTV features
.label DTV_FEATURE = $d03f
.const DTV_FEATURE_ENABLE = 1
@ -57,6 +55,7 @@
.label SCREEN = $7c00
// Plane with all pixels
.label CHARSET8 = $8000
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
main: {
// asm
sei
@ -117,14 +116,14 @@ main: {
sta DTV_PLANEB_MODULO_LO
// *DTV_PLANEB_MODULO_HI = 0
sta DTV_PLANEB_MODULO_HI
// *CIA2_PORT_A_DDR = %00000011
// CIA2->PORT_A_DDR = %00000011
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = %00000011 ^ (byte)((word)SCREEN/$4000)
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = %00000011 ^ (byte)((word)SCREEN/$4000)
// Set VIC Bank bits to output - all others to input
lda #3^SCREEN/$4000
sta CIA2_PORT_A
sta CIA2
// *VIC_MEMORY = (byte)((((word)SCREEN)&$3fff)/$40) | ((>(((word)SCREEN)&$3fff))/4)
// Set VIC Bank
// VIC memory

View File

@ -32,8 +32,8 @@ main::@6: scope:[main] from main
[21] *((const nomodify byte*) DTV_PLANEB_STEP) ← (byte) 0
[22] *((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (byte) 0
[23] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0
[24] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[25] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) SCREEN/(word) $4000
[24] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
[25] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) SCREEN/(word) $4000
[26] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) $40|>(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) 4
to:main::@1
main::@1: scope:[main] from main::@1 main::@6

View File

@ -1,3 +1,7 @@
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA
@ -38,8 +42,8 @@ main::@7: scope:[main] from main
*((const nomodify byte*) DTV_PLANEB_STEP) ← (number) 0
*((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (number) 0
*((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (number) 0
*((const nomodify byte*) CIA2_PORT_A_DDR) ← (number) 3
*((const nomodify byte*) CIA2_PORT_A) ← (number) 3^(byte)(word)(const nomodify byte*) SCREEN/(number) $4000
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) 3
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (number) 3^(byte)(word)(const nomodify byte*) SCREEN/(number) $4000
*((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) SCREEN&(number) $3fff/(number) $40|>(word)(const nomodify byte*) SCREEN&(number) $3fff/(number) 4
(byte) main::j#0 ← (byte) 0
to:main::@1
@ -248,8 +252,7 @@ SYMBOL TABLE SSA
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify byte*) CHARGEN = (byte*)(number) $d000
(const nomodify byte*) CHARSET8 = (byte*)(number) $8000
(const nomodify byte*) CIA2_PORT_A = (byte*)(number) $dd00
(const nomodify byte*) CIA2_PORT_A_DDR = (byte*)(number) $dd02
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*)(number) $dd00
(const nomodify byte) DTV_BADLINE_OFF = (byte) $20
(const nomodify byte) DTV_CHUNKY = (byte) $40
(const nomodify byte*) DTV_CONTROL = (byte*)(number) $d03c
@ -270,6 +273,22 @@ SYMBOL TABLE SSA
(const nomodify byte*) DTV_PLANEB_START_LO = (byte*)(number) $d049
(const nomodify byte*) DTV_PLANEB_START_MI = (byte*)(number) $d04a
(const nomodify byte*) DTV_PLANEB_STEP = (byte*)(number) $d04c
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A = (byte) 0
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = (byte) 2
(const nomodify byte*) PROCPORT = (byte*)(number) 1
(const nomodify byte*) PROCPORT_DDR = (byte*)(number) 0
(const nomodify byte) PROCPORT_DDR_MEMORY_MASK = (byte) 7
@ -444,10 +463,10 @@ Adding number conversion cast (unumber) 0 in *((const nomodify byte*) DTV_PLANEB
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) DTV_PLANEB_STEP) ← (number) 0
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (number) 0
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (number) 0
Adding number conversion cast (unumber) 3 in *((const nomodify byte*) CIA2_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) 3^(byte)(word)SCREEN/$4000 in *((const nomodify byte*) CIA2_PORT_A) ← (number) 3^(byte)(word)(const nomodify byte*) SCREEN/(number) $4000
Adding number conversion cast (unumber) 3 in *((const nomodify byte*) CIA2_PORT_A) ← ((unumber)) (number) 3^(byte)(word)(const nomodify byte*) SCREEN/(number) $4000
Adding number conversion cast (unumber) $4000 in *((const nomodify byte*) CIA2_PORT_A) ← ((unumber)) (unumber)(number) 3^(byte)(word)(const nomodify byte*) SCREEN/(number) $4000
Adding number conversion cast (unumber) 3 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) 3^(byte)(word)SCREEN/$4000 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (number) 3^(byte)(word)(const nomodify byte*) SCREEN/(number) $4000
Adding number conversion cast (unumber) 3 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← ((unumber)) (number) 3^(byte)(word)(const nomodify byte*) SCREEN/(number) $4000
Adding number conversion cast (unumber) $4000 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← ((unumber)) (unumber)(number) 3^(byte)(word)(const nomodify byte*) SCREEN/(number) $4000
Adding number conversion cast (unumber) (byte)(word)SCREEN&$3fff/$40|>(word)SCREEN&$3fff/4 in *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) SCREEN&(number) $3fff/(number) $40|>(word)(const nomodify byte*) SCREEN&(number) $3fff/(number) 4
Adding number conversion cast (unumber) >(word)SCREEN&$3fff/4 in *((const nomodify byte*) VIC_MEMORY) ← ((unumber)) (byte)(word)(const nomodify byte*) SCREEN&(number) $3fff/(number) $40|>(word)(const nomodify byte*) SCREEN&(number) $3fff/(number) 4
Adding number conversion cast (unumber) $3fff in *((const nomodify byte*) VIC_MEMORY) ← ((unumber)) (byte)(word)(const nomodify byte*) SCREEN&(number) $3fff/(number) $40|(unumber)>(word)(const nomodify byte*) SCREEN&(number) $3fff/(number) 4
@ -490,8 +509,8 @@ Inlining cast *((const nomodify byte*) DTV_PLANEB_START_HI) ← (unumber)(number
Inlining cast *((const nomodify byte*) DTV_PLANEB_STEP) ← (unumber)(number) 0
Inlining cast *((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (unumber)(number) 0
Inlining cast *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (unumber)(number) 0
Inlining cast *((const nomodify byte*) CIA2_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast *((const nomodify byte*) CIA2_PORT_A) ← (unumber)(unumber)(number) 3^(byte)(word)(const nomodify byte*) SCREEN/(unumber)(number) $4000
Inlining cast *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (unumber)(unumber)(number) 3^(byte)(word)(const nomodify byte*) SCREEN/(unumber)(number) $4000
Inlining cast *((const nomodify byte*) VIC_MEMORY) ← (unumber)(byte)(word)(const nomodify byte*) SCREEN&(unumber)(number) $3fff/(unumber)(number) $40|(unumber)>(word)(const nomodify byte*) SCREEN&(unumber)(number) $3fff/(unumber)(number) 4
Inlining cast *((const nomodify byte*) VIC_CONTROL) ← (unumber)(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_ECM|(const nomodify byte) VIC_RSEL|(unumber)(number) 3
Inlining cast *((const nomodify byte*) BORDERCOL) ← (unumber)(number) 0
@ -504,8 +523,7 @@ Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53265
Simplifying constant pointer cast (byte*) 53270
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (byte*) 56576
Simplifying constant pointer cast (byte*) 56578
Simplifying constant pointer cast (struct MOS6526_CIA*) 56576
Simplifying constant pointer cast (byte*) 53311
Simplifying constant pointer cast (byte*) 53308
Simplifying constant pointer cast (byte*) 53760
@ -683,8 +701,10 @@ Simplifying constant evaluating to zero <(const nomodify byte*) SCREEN in [12] *
Simplifying constant evaluating to zero <(const nomodify byte*) CHARSET8 in [18] *((const nomodify byte*) DTV_PLANEB_START_LO) ← <(const nomodify byte*) CHARSET8
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero $4000 in
Simplifying expression containing zero (byte*)CIA2 in [25] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) SCREEN/(word) $4000
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (byte) gfx_init_plane_charset8::gfxbCpuBank#1 and assignment [62] (byte) gfx_init_plane_charset8::gfxbCpuBank#1 ← ++ (const byte) gfx_init_plane_charset8::gfxbCpuBank#0
Eliminating unused constant (const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
@ -850,8 +870,8 @@ main::@6: scope:[main] from main
[21] *((const nomodify byte*) DTV_PLANEB_STEP) ← (byte) 0
[22] *((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (byte) 0
[23] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0
[24] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[25] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) SCREEN/(word) $4000
[24] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
[25] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) SCREEN/(word) $4000
[26] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) $40|>(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) 4
to:main::@1
main::@1: scope:[main] from main::@1 main::@6
@ -993,6 +1013,20 @@ gfx_init_screen0::@return: scope:[gfx_init_screen0] from gfx_init_screen0::@3
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
(void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx)
(byte) dtvSetCpuBankSegment1::cpuBankIdx
(byte) dtvSetCpuBankSegment1::cpuBankIdx#2 10001.0
@ -1155,10 +1189,8 @@ Target platform is c64basic / MOS6502X
.const VIC_MCM = $10
.const VIC_CSEL = 8
.label VIC_MEMORY = $d018
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// Feature enables or disables the extra C64 DTV features
.label DTV_FEATURE = $d03f
.const DTV_FEATURE_ENABLE = 1
@ -1188,6 +1220,7 @@ Target platform is c64basic / MOS6502X
.label SCREEN = $7c00
// Plane with all pixels
.label CHARSET8 = $8000
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -1278,14 +1311,14 @@ main: {
// [23] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_PLANEB_MODULO_HI
// [24] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// [24] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// [25] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) SCREEN/(word) $4000 -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [25] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) SCREEN/(word) $4000 -- _deref_pbuc1=vbuc2
// Set VIC Bank bits to output - all others to input
lda #3^SCREEN/$4000
sta CIA2_PORT_A
sta CIA2
// [26] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) $40|>(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) 4 -- _deref_pbuc1=vbuc2
// Set VIC Bank
// VIC memory
@ -1778,8 +1811,8 @@ Statement [20] *((const nomodify byte*) DTV_PLANEB_START_HI) ← (byte) 0 [ ] (
Statement [21] *((const nomodify byte*) DTV_PLANEB_STEP) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [22] *((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [23] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [24] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [25] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) SCREEN/(word) $4000 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [24] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [25] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) SCREEN/(word) $4000 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [26] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) $40|>(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) 4 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement asm { ldx#$ff rff: cpxRASTER bnerff stabilize: nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop cpxRASTER beqeat+0 eat: inx cpx#$08 bnestabilize } always clobbers reg byte x
Statement [32] *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_ECM|(const nomodify byte) VIC_RSEL|(byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
@ -1827,8 +1860,8 @@ Statement [20] *((const nomodify byte*) DTV_PLANEB_START_HI) ← (byte) 0 [ ] (
Statement [21] *((const nomodify byte*) DTV_PLANEB_STEP) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [22] *((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [23] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [24] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [25] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) SCREEN/(word) $4000 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [24] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [25] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) SCREEN/(word) $4000 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [26] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) $40|>(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) 4 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement asm { ldx#$ff rff: cpxRASTER bnerff stabilize: nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop cpxRASTER beqeat+0 eat: inx cpx#$08 bnestabilize } always clobbers reg byte x
Statement [32] *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_ECM|(const nomodify byte) VIC_RSEL|(byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
@ -1874,6 +1907,7 @@ Uplift Scope [gfx_init_plane_charset8] 4,000,004: zp[1]:12 [ gfx_init_plane_char
Uplift Scope [gfx_init_screen0] 200,002: zp[1]:23 [ gfx_init_screen0::$0 ] 200,002: zp[1]:25 [ gfx_init_screen0::$2 ] 200,002: zp[1]:26 [ gfx_init_screen0::$3 ] 192,859.07: zp[1]:15 [ gfx_init_screen0::cx#2 gfx_init_screen0::cx#1 ] 113,669.93: zp[2]:16 [ gfx_init_screen0::ch#2 gfx_init_screen0::ch#3 gfx_init_screen0::ch#1 ] 100,001: zp[1]:24 [ gfx_init_screen0::$1 ] 27,001.8: zp[1]:14 [ gfx_init_screen0::cy#4 gfx_init_screen0::cy#1 ]
Uplift Scope [dtvSetCpuBankSegment1] 10,001: zp[1]:13 [ dtvSetCpuBankSegment1::cpuBankIdx#2 ]
Uplift Scope [main] 2,002: zp[1]:19 [ main::$3 ] 2,002: zp[1]:20 [ main::$4 ] 2,002: zp[1]:21 [ main::$5 ] 572: zp[1]:18 [ main::rst#1 ] 353.5: zp[1]:2 [ main::j#2 main::j#1 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [gfx_init]
Uplift Scope []
@ -1884,6 +1918,7 @@ Limited combination testing to 100 combinations of 768 possible.
Uplifting [dtvSetCpuBankSegment1] best 95585 combination reg byte a [ dtvSetCpuBankSegment1::cpuBankIdx#2 ]
Uplifting [main] best 92985 combination reg byte a [ main::$3 ] reg byte a [ main::$4 ] reg byte a [ main::$5 ] reg byte x [ main::rst#1 ] zp[1]:2 [ main::j#2 main::j#1 ]
Limited combination testing to 100 combinations of 768 possible.
Uplifting [MOS6526_CIA] best 92985 combination
Uplifting [gfx_init] best 92985 combination
Uplifting [] best 92985 combination
Attempting to uplift remaining variables inzp[1]:7 [ gfx_init_plane_charset8::bits#2 gfx_init_plane_charset8::bits#0 gfx_init_plane_charset8::bits#1 ]
@ -1940,10 +1975,8 @@ ASSEMBLER BEFORE OPTIMIZATION
.const VIC_MCM = $10
.const VIC_CSEL = 8
.label VIC_MEMORY = $d018
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// Feature enables or disables the extra C64 DTV features
.label DTV_FEATURE = $d03f
.const DTV_FEATURE_ENABLE = 1
@ -1973,6 +2006,7 @@ ASSEMBLER BEFORE OPTIMIZATION
.label SCREEN = $7c00
// Plane with all pixels
.label CHARSET8 = $8000
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -2058,14 +2092,14 @@ main: {
// [23] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_PLANEB_MODULO_HI
// [24] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// [24] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// [25] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) SCREEN/(word) $4000 -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [25] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) SCREEN/(word) $4000 -- _deref_pbuc1=vbuc2
// Set VIC Bank bits to output - all others to input
lda #3^SCREEN/$4000
sta CIA2_PORT_A
sta CIA2
// [26] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) $40|>(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) 4 -- _deref_pbuc1=vbuc2
// Set VIC Bank
// VIC memory
@ -2602,8 +2636,7 @@ FINAL SYMBOL TABLE
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CHARGEN = (byte*) 53248
(const nomodify byte*) CHARSET8 = (byte*) 32768
(const nomodify byte*) CIA2_PORT_A = (byte*) 56576
(const nomodify byte*) CIA2_PORT_A_DDR = (byte*) 56578
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify byte) DTV_BADLINE_OFF = (byte) $20
(const nomodify byte) DTV_CHUNKY = (byte) $40
(const nomodify byte*) DTV_CONTROL = (byte*) 53308
@ -2624,6 +2657,21 @@ FINAL SYMBOL TABLE
(const nomodify byte*) DTV_PLANEB_START_LO = (byte*) 53321
(const nomodify byte*) DTV_PLANEB_START_MI = (byte*) 53322
(const nomodify byte*) DTV_PLANEB_STEP = (byte*) 53324
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = (byte) 2
(const nomodify byte*) PROCPORT = (byte*) 1
(const nomodify byte*) PROCPORT_DDR = (byte*) 0
(const nomodify byte) PROCPORT_DDR_MEMORY_MASK = (byte) 7
@ -2779,10 +2827,8 @@ Score: 75375
.const VIC_MCM = $10
.const VIC_CSEL = 8
.label VIC_MEMORY = $d018
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// Feature enables or disables the extra C64 DTV features
.label DTV_FEATURE = $d03f
.const DTV_FEATURE_ENABLE = 1
@ -2812,6 +2858,7 @@ Score: 75375
.label SCREEN = $7c00
// Plane with all pixels
.label CHARSET8 = $8000
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
// @begin
// [1] phi from @begin to @1 [phi:@begin->@1]
// @1
@ -2901,16 +2948,16 @@ main: {
// *DTV_PLANEB_MODULO_HI = 0
// [23] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0 -- _deref_pbuc1=vbuc2
sta DTV_PLANEB_MODULO_HI
// *CIA2_PORT_A_DDR = %00000011
// [24] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// CIA2->PORT_A_DDR = %00000011
// [24] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = %00000011 ^ (byte)((word)SCREEN/$4000)
// [25] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) SCREEN/(word) $4000 -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = %00000011 ^ (byte)((word)SCREEN/$4000)
// [25] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) SCREEN/(word) $4000 -- _deref_pbuc1=vbuc2
// Set VIC Bank bits to output - all others to input
lda #3^SCREEN/$4000
sta CIA2_PORT_A
sta CIA2
// *VIC_MEMORY = (byte)((((word)SCREEN)&$3fff)/$40) | ((>(((word)SCREEN)&$3fff))/4)
// [26] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) $40|>(word)(const nomodify byte*) SCREEN&(word) $3fff/(byte) 4 -- _deref_pbuc1=vbuc2
// Set VIC Bank

View File

@ -4,8 +4,7 @@
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CHARGEN = (byte*) 53248
(const nomodify byte*) CHARSET8 = (byte*) 32768
(const nomodify byte*) CIA2_PORT_A = (byte*) 56576
(const nomodify byte*) CIA2_PORT_A_DDR = (byte*) 56578
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify byte) DTV_BADLINE_OFF = (byte) $20
(const nomodify byte) DTV_CHUNKY = (byte) $40
(const nomodify byte*) DTV_CONTROL = (byte*) 53308
@ -26,6 +25,21 @@
(const nomodify byte*) DTV_PLANEB_START_LO = (byte*) 53321
(const nomodify byte*) DTV_PLANEB_START_MI = (byte*) 53322
(const nomodify byte*) DTV_PLANEB_STEP = (byte*) 53324
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = (byte) 2
(const nomodify byte*) PROCPORT = (byte*) 1
(const nomodify byte*) PROCPORT_DDR = (byte*) 0
(const nomodify byte) PROCPORT_DDR_MEMORY_MASK = (byte) 7

View File

@ -20,10 +20,8 @@
.const VIC_MCM = $10
.const VIC_CSEL = 8
.label VIC_MEMORY = $d018
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// Feature enables or disables the extra C64 DTV features
.label DTV_FEATURE = $d03f
.const DTV_FEATURE_ENABLE = 1
@ -45,6 +43,7 @@
.label DTV_PLANEB_MODULO_HI = $d048
// Plane with all pixels
.label CHUNKY = $8000
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
main: {
// asm
sei
@ -90,14 +89,14 @@ main: {
sta DTV_PLANEB_MODULO_LO
// *DTV_PLANEB_MODULO_HI = 0
sta DTV_PLANEB_MODULO_HI
// *CIA2_PORT_A_DDR = %00000011
// CIA2->PORT_A_DDR = %00000011
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = %00000011 ^ (byte)((word)CHUNKY/$4000)
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = %00000011 ^ (byte)((word)CHUNKY/$4000)
// Set VIC Bank bits to output - all others to input
lda #3^CHUNKY/$4000
sta CIA2_PORT_A
sta CIA2
// *VIC_MEMORY = (byte)((((word)CHUNKY)&$3fff)/$40) | ((>(((word)CHUNKY)&$3fff))/4)
// Set VIC Bank
// VIC memory

View File

@ -26,8 +26,8 @@ main::@6: scope:[main] from main
[15] *((const nomodify byte*) DTV_PLANEB_STEP) ← (byte) 8
[16] *((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (byte) 0
[17] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0
[18] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[19] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) CHUNKY/(word) $4000
[18] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
[19] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) CHUNKY/(word) $4000
[20] *((const nomodify byte*) VIC_MEMORY) ← (byte) 0
to:main::@1
main::@1: scope:[main] from main::@1 main::@6

View File

@ -1,3 +1,7 @@
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA
@ -32,8 +36,8 @@ main::@7: scope:[main] from main
*((const nomodify byte*) DTV_PLANEB_STEP) ← (number) 8
*((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (number) 0
*((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (number) 0
*((const nomodify byte*) CIA2_PORT_A_DDR) ← (number) 3
*((const nomodify byte*) CIA2_PORT_A) ← (number) 3^(byte)(word)(const nomodify byte*) CHUNKY/(number) $4000
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) 3
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (number) 3^(byte)(word)(const nomodify byte*) CHUNKY/(number) $4000
*((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) CHUNKY&(number) $3fff/(number) $40|>(word)(const nomodify byte*) CHUNKY&(number) $3fff/(number) 4
(byte) main::j#0 ← (byte) 0
to:main::@1
@ -161,8 +165,7 @@ SYMBOL TABLE SSA
(label) @end
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify byte*) CHUNKY = (byte*)(number) $8000
(const nomodify byte*) CIA2_PORT_A = (byte*)(number) $dd00
(const nomodify byte*) CIA2_PORT_A_DDR = (byte*)(number) $dd02
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*)(number) $dd00
(const nomodify byte) DTV_BADLINE_OFF = (byte) $20
(const nomodify byte) DTV_CHUNKY = (byte) $40
(const nomodify byte) DTV_COLORRAM_OFF = (byte) $10
@ -178,6 +181,22 @@ SYMBOL TABLE SSA
(const nomodify byte*) DTV_PLANEB_START_LO = (byte*)(number) $d049
(const nomodify byte*) DTV_PLANEB_START_MI = (byte*)(number) $d04a
(const nomodify byte*) DTV_PLANEB_STEP = (byte*)(number) $d04c
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A = (byte) 0
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = (byte) 2
(const nomodify byte*) PROCPORT = (byte*)(number) 1
(const nomodify byte*) PROCPORT_DDR = (byte*)(number) 0
(const nomodify byte) PROCPORT_DDR_MEMORY_MASK = (byte) 7
@ -282,10 +301,10 @@ Adding number conversion cast (unumber) 0 in *((const nomodify byte*) DTV_PLANEB
Adding number conversion cast (unumber) 8 in *((const nomodify byte*) DTV_PLANEB_STEP) ← (number) 8
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (number) 0
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (number) 0
Adding number conversion cast (unumber) 3 in *((const nomodify byte*) CIA2_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) 3^(byte)(word)CHUNKY/$4000 in *((const nomodify byte*) CIA2_PORT_A) ← (number) 3^(byte)(word)(const nomodify byte*) CHUNKY/(number) $4000
Adding number conversion cast (unumber) 3 in *((const nomodify byte*) CIA2_PORT_A) ← ((unumber)) (number) 3^(byte)(word)(const nomodify byte*) CHUNKY/(number) $4000
Adding number conversion cast (unumber) $4000 in *((const nomodify byte*) CIA2_PORT_A) ← ((unumber)) (unumber)(number) 3^(byte)(word)(const nomodify byte*) CHUNKY/(number) $4000
Adding number conversion cast (unumber) 3 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) 3^(byte)(word)CHUNKY/$4000 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (number) 3^(byte)(word)(const nomodify byte*) CHUNKY/(number) $4000
Adding number conversion cast (unumber) 3 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← ((unumber)) (number) 3^(byte)(word)(const nomodify byte*) CHUNKY/(number) $4000
Adding number conversion cast (unumber) $4000 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← ((unumber)) (unumber)(number) 3^(byte)(word)(const nomodify byte*) CHUNKY/(number) $4000
Adding number conversion cast (unumber) (byte)(word)CHUNKY&$3fff/$40|>(word)CHUNKY&$3fff/4 in *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) CHUNKY&(number) $3fff/(number) $40|>(word)(const nomodify byte*) CHUNKY&(number) $3fff/(number) 4
Adding number conversion cast (unumber) >(word)CHUNKY&$3fff/4 in *((const nomodify byte*) VIC_MEMORY) ← ((unumber)) (byte)(word)(const nomodify byte*) CHUNKY&(number) $3fff/(number) $40|>(word)(const nomodify byte*) CHUNKY&(number) $3fff/(number) 4
Adding number conversion cast (unumber) $3fff in *((const nomodify byte*) VIC_MEMORY) ← ((unumber)) (byte)(word)(const nomodify byte*) CHUNKY&(number) $3fff/(number) $40|(unumber)>(word)(const nomodify byte*) CHUNKY&(number) $3fff/(number) 4
@ -310,8 +329,8 @@ Inlining cast *((const nomodify byte*) DTV_PLANEB_START_HI) ← (unumber)(number
Inlining cast *((const nomodify byte*) DTV_PLANEB_STEP) ← (unumber)(number) 8
Inlining cast *((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (unumber)(number) 0
Inlining cast *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (unumber)(number) 0
Inlining cast *((const nomodify byte*) CIA2_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast *((const nomodify byte*) CIA2_PORT_A) ← (unumber)(unumber)(number) 3^(byte)(word)(const nomodify byte*) CHUNKY/(unumber)(number) $4000
Inlining cast *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (unumber)(unumber)(number) 3^(byte)(word)(const nomodify byte*) CHUNKY/(unumber)(number) $4000
Inlining cast *((const nomodify byte*) VIC_MEMORY) ← (unumber)(byte)(word)(const nomodify byte*) CHUNKY&(unumber)(number) $3fff/(unumber)(number) $40|(unumber)>(word)(const nomodify byte*) CHUNKY&(unumber)(number) $3fff/(unumber)(number) 4
Inlining cast *((const nomodify byte*) VIC_CONTROL) ← (unumber)(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_ECM|(const nomodify byte) VIC_RSEL|(unumber)(number) 3
Inlining cast *((const nomodify byte*) BORDERCOL) ← (unumber)(number) 0
@ -324,8 +343,7 @@ Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53265
Simplifying constant pointer cast (byte*) 53270
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (byte*) 56576
Simplifying constant pointer cast (byte*) 56578
Simplifying constant pointer cast (struct MOS6526_CIA*) 56576
Simplifying constant pointer cast (byte*) 53311
Simplifying constant pointer cast (byte*) 53308
Simplifying constant pointer cast (byte*) 53760
@ -432,6 +450,10 @@ Resolved ranged comparison value [71] if(gfx_init_chunky::y#1!=rangelast(0,$32))
Simplifying constant evaluating to zero <(const nomodify byte*) CHUNKY in [12] *((const nomodify byte*) DTV_PLANEB_START_LO) ← <(const nomodify byte*) CHUNKY
Simplifying constant evaluating to zero (byte)(word)(const nomodify byte*) CHUNKY&(word) $3fff/(byte) $40|>(word)(const nomodify byte*) CHUNKY&(word) $3fff/(byte) 4 in [20] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) CHUNKY&(word) $3fff/(byte) $40|>(word)(const nomodify byte*) CHUNKY&(word) $3fff/(byte) 4
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero (byte*)CIA2 in [19] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) CHUNKY/(word) $4000
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A
Successful SSA optimization PassNEliminateUnusedVars
Removing unused block main::@return
Successful SSA optimization Pass2EliminateUnusedBlocks
Adding number conversion cast (unumber) $10 in if((byte) main::j#1!=(number) $10) goto main::@1
@ -555,8 +577,8 @@ main::@6: scope:[main] from main
[15] *((const nomodify byte*) DTV_PLANEB_STEP) ← (byte) 8
[16] *((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (byte) 0
[17] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0
[18] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[19] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) CHUNKY/(word) $4000
[18] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
[19] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) CHUNKY/(word) $4000
[20] *((const nomodify byte*) VIC_MEMORY) ← (byte) 0
to:main::@1
main::@1: scope:[main] from main::@1 main::@6
@ -644,6 +666,20 @@ dtvSetCpuBankSegment1::@return: scope:[dtvSetCpuBankSegment1] from dtvSetCpuBan
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
(void()) dtvSetCpuBankSegment1((byte) dtvSetCpuBankSegment1::cpuBankIdx)
(byte) dtvSetCpuBankSegment1::cpuBankIdx
(byte) dtvSetCpuBankSegment1::cpuBankIdx#1 20002.0
@ -744,10 +780,8 @@ Target platform is c64basic / MOS6502X
.const VIC_MCM = $10
.const VIC_CSEL = 8
.label VIC_MEMORY = $d018
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// Feature enables or disables the extra C64 DTV features
.label DTV_FEATURE = $d03f
.const DTV_FEATURE_ENABLE = 1
@ -769,6 +803,7 @@ Target platform is c64basic / MOS6502X
.label DTV_PLANEB_MODULO_HI = $d048
// Plane with all pixels
.label CHUNKY = $8000
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -840,14 +875,14 @@ main: {
// [17] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_PLANEB_MODULO_HI
// [18] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// [18] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// [19] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) CHUNKY/(word) $4000 -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [19] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) CHUNKY/(word) $4000 -- _deref_pbuc1=vbuc2
// Set VIC Bank bits to output - all others to input
lda #3^CHUNKY/$4000
sta CIA2_PORT_A
sta CIA2
// [20] *((const nomodify byte*) VIC_MEMORY) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Set VIC Bank
// VIC memory
@ -1194,8 +1229,8 @@ Statement [14] *((const nomodify byte*) DTV_PLANEB_START_HI) ← (byte) 0 [ ] (
Statement [15] *((const nomodify byte*) DTV_PLANEB_STEP) ← (byte) 8 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [16] *((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [17] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [18] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [19] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) CHUNKY/(word) $4000 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [18] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [19] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) CHUNKY/(word) $4000 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [20] *((const nomodify byte*) VIC_MEMORY) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement asm { ldx#$ff rff: cpxRASTER bnerff stabilize: nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop cpxRASTER beqeat+0 eat: inx cpx#$08 bnestabilize } always clobbers reg byte x
Statement [26] *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_ECM|(const nomodify byte) VIC_RSEL|(byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
@ -1226,8 +1261,8 @@ Statement [14] *((const nomodify byte*) DTV_PLANEB_START_HI) ← (byte) 0 [ ] (
Statement [15] *((const nomodify byte*) DTV_PLANEB_STEP) ← (byte) 8 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [16] *((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [17] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [18] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [19] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) CHUNKY/(word) $4000 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [18] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [19] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) CHUNKY/(word) $4000 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [20] *((const nomodify byte*) VIC_MEMORY) ← (byte) 0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement asm { ldx#$ff rff: cpxRASTER bnerff stabilize: nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop nop cpxRASTER beqeat+0 eat: inx cpx#$08 bnestabilize } always clobbers reg byte x
Statement [26] *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_ECM|(const nomodify byte) VIC_RSEL|(byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
@ -1259,12 +1294,14 @@ REGISTER UPLIFT SCOPES
Uplift Scope [dtvSetCpuBankSegment1] 130,004: zp[1]:9 [ dtvSetCpuBankSegment1::cpuBankIdx#3 dtvSetCpuBankSegment1::cpuBankIdx#1 ]
Uplift Scope [gfx_init_chunky] 35,700.14: zp[1]:6 [ gfx_init_chunky::gfxbCpuBank#4 gfx_init_chunky::gfxbCpuBank#7 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::gfxbCpuBank#2 ] 29,205.35: zp[2]:7 [ gfx_init_chunky::gfxb#4 gfx_init_chunky::gfxb#3 gfx_init_chunky::gfxb#5 gfx_init_chunky::gfxb#1 ] 20,002: zp[1]:16 [ gfx_init_chunky::c#0 ] 18,001.8: zp[2]:4 [ gfx_init_chunky::x#2 gfx_init_chunky::x#1 ] 10,001: zp[2]:14 [ gfx_init_chunky::$5 ] 2,424.81: zp[1]:3 [ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ]
Uplift Scope [main] 2,002: zp[1]:11 [ main::$3 ] 2,002: zp[1]:12 [ main::$4 ] 2,002: zp[1]:13 [ main::$5 ] 572: zp[1]:10 [ main::rst#1 ] 353.5: zp[1]:2 [ main::j#2 main::j#1 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope []
Uplifting [dtvSetCpuBankSegment1] best 26171 combination reg byte a [ dtvSetCpuBankSegment1::cpuBankIdx#3 dtvSetCpuBankSegment1::cpuBankIdx#1 ]
Uplifting [gfx_init_chunky] best 25141 combination reg byte x [ gfx_init_chunky::gfxbCpuBank#4 gfx_init_chunky::gfxbCpuBank#7 gfx_init_chunky::gfxbCpuBank#8 gfx_init_chunky::gfxbCpuBank#2 ] zp[2]:7 [ gfx_init_chunky::gfxb#4 gfx_init_chunky::gfxb#3 gfx_init_chunky::gfxb#5 gfx_init_chunky::gfxb#1 ] reg byte a [ gfx_init_chunky::c#0 ] zp[2]:4 [ gfx_init_chunky::x#2 gfx_init_chunky::x#1 ] zp[2]:14 [ gfx_init_chunky::$5 ] zp[1]:3 [ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ]
Uplifting [main] best 22541 combination reg byte a [ main::$3 ] reg byte a [ main::$4 ] reg byte a [ main::$5 ] reg byte x [ main::rst#1 ] zp[1]:2 [ main::j#2 main::j#1 ]
Limited combination testing to 100 combinations of 768 possible.
Uplifting [MOS6526_CIA] best 22541 combination
Uplifting [] best 22541 combination
Attempting to uplift remaining variables inzp[1]:3 [ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ]
Uplifting [gfx_init_chunky] best 22541 combination zp[1]:3 [ gfx_init_chunky::y#6 gfx_init_chunky::y#1 ]
@ -1301,10 +1338,8 @@ ASSEMBLER BEFORE OPTIMIZATION
.const VIC_MCM = $10
.const VIC_CSEL = 8
.label VIC_MEMORY = $d018
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// Feature enables or disables the extra C64 DTV features
.label DTV_FEATURE = $d03f
.const DTV_FEATURE_ENABLE = 1
@ -1326,6 +1361,7 @@ ASSEMBLER BEFORE OPTIMIZATION
.label DTV_PLANEB_MODULO_HI = $d048
// Plane with all pixels
.label CHUNKY = $8000
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -1392,14 +1428,14 @@ main: {
// [17] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_PLANEB_MODULO_HI
// [18] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// [18] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// [19] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) CHUNKY/(word) $4000 -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [19] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) CHUNKY/(word) $4000 -- _deref_pbuc1=vbuc2
// Set VIC Bank bits to output - all others to input
lda #3^CHUNKY/$4000
sta CIA2_PORT_A
sta CIA2
// [20] *((const nomodify byte*) VIC_MEMORY) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Set VIC Bank
// VIC memory
@ -1784,8 +1820,7 @@ FINAL SYMBOL TABLE
(label) @end
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CHUNKY = (byte*) 32768
(const nomodify byte*) CIA2_PORT_A = (byte*) 56576
(const nomodify byte*) CIA2_PORT_A_DDR = (byte*) 56578
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify byte) DTV_BADLINE_OFF = (byte) $20
(const nomodify byte) DTV_CHUNKY = (byte) $40
(const nomodify byte) DTV_COLORRAM_OFF = (byte) $10
@ -1801,6 +1836,21 @@ FINAL SYMBOL TABLE
(const nomodify byte*) DTV_PLANEB_START_LO = (byte*) 53321
(const nomodify byte*) DTV_PLANEB_START_MI = (byte*) 53322
(const nomodify byte*) DTV_PLANEB_STEP = (byte*) 53324
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = (byte) 2
(const nomodify byte*) PROCPORT = (byte*) 1
(const nomodify byte*) PROCPORT_DDR = (byte*) 0
(const nomodify byte) PROCPORT_DDR_MEMORY_MASK = (byte) 7
@ -1906,10 +1956,8 @@ Score: 19882
.const VIC_MCM = $10
.const VIC_CSEL = 8
.label VIC_MEMORY = $d018
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// Feature enables or disables the extra C64 DTV features
.label DTV_FEATURE = $d03f
.const DTV_FEATURE_ENABLE = 1
@ -1931,6 +1979,7 @@ Score: 19882
.label DTV_PLANEB_MODULO_HI = $d048
// Plane with all pixels
.label CHUNKY = $8000
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
// @begin
// [1] phi from @begin to @1 [phi:@begin->@1]
// @1
@ -1999,16 +2048,16 @@ main: {
// *DTV_PLANEB_MODULO_HI = 0
// [17] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0 -- _deref_pbuc1=vbuc2
sta DTV_PLANEB_MODULO_HI
// *CIA2_PORT_A_DDR = %00000011
// [18] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// CIA2->PORT_A_DDR = %00000011
// [18] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = %00000011 ^ (byte)((word)CHUNKY/$4000)
// [19] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) CHUNKY/(word) $4000 -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = %00000011 ^ (byte)((word)CHUNKY/$4000)
// [19] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) CHUNKY/(word) $4000 -- _deref_pbuc1=vbuc2
// Set VIC Bank bits to output - all others to input
lda #3^CHUNKY/$4000
sta CIA2_PORT_A
sta CIA2
// *VIC_MEMORY = (byte)((((word)CHUNKY)&$3fff)/$40) | ((>(((word)CHUNKY)&$3fff))/4)
// [20] *((const nomodify byte*) VIC_MEMORY) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Set VIC Bank

View File

@ -3,8 +3,7 @@
(label) @end
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CHUNKY = (byte*) 32768
(const nomodify byte*) CIA2_PORT_A = (byte*) 56576
(const nomodify byte*) CIA2_PORT_A_DDR = (byte*) 56578
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify byte) DTV_BADLINE_OFF = (byte) $20
(const nomodify byte) DTV_CHUNKY = (byte) $40
(const nomodify byte) DTV_COLORRAM_OFF = (byte) $10
@ -20,6 +19,21 @@
(const nomodify byte*) DTV_PLANEB_START_LO = (byte*) 53321
(const nomodify byte*) DTV_PLANEB_START_MI = (byte*) 53322
(const nomodify byte*) DTV_PLANEB_STEP = (byte*) 53324
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = (byte) 2
(const nomodify byte*) PROCPORT = (byte*) 1
(const nomodify byte*) PROCPORT_DDR = (byte*) 0
(const nomodify byte) PROCPORT_DDR_MEMORY_MASK = (byte) 7

View File

@ -1,3 +1,5 @@
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA
@ -100,6 +102,20 @@ SYMBOL TABLE SSA
(const nomodify byte) DTV_BLIT_TRANSPARANCY_NONE = (byte) 0
(const nomodify byte*) DTV_FEATURE = (byte*)(number) $d03f
(const nomodify byte) DTV_FEATURE_ENABLE = (byte) 1
(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
(const nomodify byte*) SCREEN = (byte*)(number) $400
(const to_nomodify byte*) SRCA[] = (byte*) "camelot rules!"
(const to_nomodify byte*) SRCB[] = { (byte) $80 }
@ -290,6 +306,20 @@ main::@return: scope:[main] from main::@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
(void()) main()
(byte~) main::$0 202.0
@ -557,9 +587,11 @@ Potential registers zp[1]:2 [ main::$0 ] : zp[1]:2 , reg byte a , reg byte x , r
REGISTER UPLIFT SCOPES
Uplift Scope [main] 202: zp[1]:2 [ main::$0 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope []
Uplifting [main] best 348 combination reg byte a [ main::$0 ]
Uplifting [MOS6526_CIA] best 348 combination
Uplifting [] best 348 combination
ASSEMBLER BEFORE OPTIMIZATION
@ -849,6 +881,20 @@ FINAL SYMBOL TABLE
(const nomodify byte) DTV_BLIT_TRANSPARANCY_NONE = (byte) 0
(const nomodify byte*) DTV_FEATURE = (byte*) 53311
(const nomodify byte) DTV_FEATURE_ENABLE = (byte) 1
(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
(const nomodify byte*) SCREEN = (byte*) 1024
(const to_nomodify byte*) SRCA[] = (byte*) "camelot rules!"
(const to_nomodify byte*) SRCB[] = { (byte) $80 }

View File

@ -42,6 +42,20 @@
(const nomodify byte) DTV_BLIT_TRANSPARANCY_NONE = (byte) 0
(const nomodify byte*) DTV_FEATURE = (byte*) 53311
(const nomodify byte) DTV_FEATURE_ENABLE = (byte) 1
(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
(const nomodify byte*) SCREEN = (byte*) 1024
(const to_nomodify byte*) SRCA[] = (byte*) "camelot rules!"
(const to_nomodify byte*) SRCB[] = { (byte) $80 }

View File

@ -1,3 +1,5 @@
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA
@ -109,6 +111,20 @@ SYMBOL TABLE SSA
(const nomodify byte) DTV_BLIT_TRANSPARANCY_NONE = (byte) 0
(const nomodify byte*) DTV_FEATURE = (byte*)(number) $d03f
(const nomodify byte) DTV_FEATURE_ENABLE = (byte) 1
(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
(const nomodify byte*) SCREEN = (byte*)(number) $400
(const to_nomodify byte*) SRCA[] = { (byte) 'c', (byte) 'a', (byte) 'm', (byte) 'e', (byte) 'l', (byte) 'o', (byte) 't', (byte) '!', (byte) ' ' }
(const nomodify byte) SRCA_LEN = (byte) 9
@ -322,6 +338,20 @@ main::@return: scope:[main] from main::@2
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
(void()) main()
(byte~) main::$0 2002.0
(byte) main::r
@ -655,9 +685,11 @@ Potential registers zp[1]:3 [ main::$0 ] : zp[1]:3 , reg byte a , reg byte x , r
REGISTER UPLIFT SCOPES
Uplift Scope [main] 2,002: zp[1]:3 [ main::$0 ] 702.5: zp[1]:2 [ main::r#2 main::r#1 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope []
Uplifting [main] best 2515 combination reg byte a [ main::$0 ] reg byte x [ main::r#2 main::r#1 ]
Uplifting [MOS6526_CIA] best 2515 combination
Uplifting [] best 2515 combination
ASSEMBLER BEFORE OPTIMIZATION
@ -980,6 +1012,20 @@ FINAL SYMBOL TABLE
(const nomodify byte) DTV_BLIT_TRANSPARANCY_NONE = (byte) 0
(const nomodify byte*) DTV_FEATURE = (byte*) 53311
(const nomodify byte) DTV_FEATURE_ENABLE = (byte) 1
(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
(const nomodify byte*) SCREEN = (byte*) 1024
(const to_nomodify byte*) SRCA[] = { (byte) 'c', (byte) 'a', (byte) 'm', (byte) 'e', (byte) 'l', (byte) 'o', (byte) 't', (byte) '!', (byte) ' ' }
(const nomodify byte) SRCA_LEN = (byte) 9

View File

@ -42,6 +42,20 @@
(const nomodify byte) DTV_BLIT_TRANSPARANCY_NONE = (byte) 0
(const nomodify byte*) DTV_FEATURE = (byte*) 53311
(const nomodify byte) DTV_FEATURE_ENABLE = (byte) 1
(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
(const nomodify byte*) SCREEN = (byte*) 1024
(const to_nomodify byte*) SRCA[] = { (byte) 'c', (byte) 'a', (byte) 'm', (byte) 'e', (byte) 'l', (byte) 'o', (byte) 't', (byte) '!', (byte) ' ' }
(const nomodify byte) SRCA_LEN = (byte) 9

View File

@ -1,3 +1,5 @@
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA
@ -63,6 +65,20 @@ SYMBOL TABLE SSA
(const nomodify byte) DTV_FEATURE_ENABLE = (byte) 1
(const nomodify byte) DTV_HIGHCOLOR = (byte) 4
(const nomodify byte*) DTV_PALETTE = (byte*)(number) $d200
(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
(const nomodify byte*) RASTER = (byte*)(number) $d012
(void()) main()
(bool~) main::$0
@ -198,6 +214,20 @@ main::@4: scope:[main] from main::@3 main::@4
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
(void()) main()
(byte) main::c
(byte) main::c#1 1501.5
@ -370,9 +400,11 @@ Potential registers zp[1]:3 [ main::c#2 main::c#1 ] : zp[1]:3 , reg byte x , reg
REGISTER UPLIFT SCOPES
Uplift Scope [main] 3,503.5: zp[1]:3 [ main::c#2 main::c#1 ] 2,168.83: zp[1]:2 [ main::r#2 main::r#1 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope []
Uplifting [main] best 11689 combination reg byte x [ main::c#2 main::c#1 ] reg byte x [ main::r#2 main::r#1 ]
Uplifting [MOS6526_CIA] best 11689 combination
Uplifting [] best 11689 combination
ASSEMBLER BEFORE OPTIMIZATION
@ -546,6 +578,20 @@ FINAL SYMBOL TABLE
(const nomodify byte) DTV_FEATURE_ENABLE = (byte) 1
(const nomodify byte) DTV_HIGHCOLOR = (byte) 4
(const nomodify byte*) DTV_PALETTE = (byte*) 53760
(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
(const nomodify byte*) RASTER = (byte*) 53266
(void()) main()
(label) main::@1

View File

@ -9,6 +9,20 @@
(const nomodify byte) DTV_FEATURE_ENABLE = (byte) 1
(const nomodify byte) DTV_HIGHCOLOR = (byte) 4
(const nomodify byte*) DTV_PALETTE = (byte*) 53760
(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
(const nomodify byte*) RASTER = (byte*) 53266
(void()) main()
(label) main::@1

View File

@ -32,18 +32,10 @@
.label VIC_MEMORY = $d018
// Color Ram
.label COLS = $d800
// CIA#1 Port A: keyboard matrix columns and joystick #2
.label CIA1_PORT_A = $dc00
// CIA#1 Port B: keyboard matrix rows and joystick #1.
.label CIA1_PORT_B = $dc01
// CIA #1 Port A data direction register.
.label CIA1_PORT_A_DDR = $dc02
// CIA #1 Port B data direction register.
.label CIA1_PORT_B_DDR = $dc03
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// Feature enables or disables the extra C64 DTV features
.label DTV_FEATURE = $d03f
.const DTV_FEATURE_ENABLE = 1
@ -163,6 +155,9 @@
.label form_vic_bg3_lo = form_fields_val+$23
// The number of frames to use for a full blink cycle
.const FORM_CURSOR_BLINK = $28
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR = 3
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
// Number of form fields
.const form_fields_cnt = $24
.label print_line_cursor = 7
@ -457,14 +452,14 @@ gfx_mode: {
// *DTV_PLANEB_MODULO_HI = 0
lda #0
sta DTV_PLANEB_MODULO_HI
// *CIA2_PORT_A_DDR = %00000011
// CIA2->PORT_A_DDR = %00000011
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = %00000011 ^ (byte)((word)VIC_SCREEN0/$4000)
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = %00000011 ^ (byte)((word)VIC_SCREEN0/$4000)
// Set VIC Bank bits to output - all others to input
lda #3^VIC_SCREEN0/$4000
sta CIA2_PORT_A
sta CIA2
// get_vic_screen(*form_vic_screen)
lda form_vic_screen
jsr get_vic_screen
@ -820,11 +815,11 @@ keyboard_event_pressed: {
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(X) rowid)
keyboard_matrix_read: {
// *CIA1_PORT_A = keyboard_matrix_row_bitmask[rowid]
// CIA1->PORT_A = keyboard_matrix_row_bitmask[rowid]
lda keyboard_matrix_row_bitmask,x
sta CIA1_PORT_A
// ~*CIA1_PORT_B
lda CIA1_PORT_B
sta CIA1
// ~CIA1->PORT_B
lda CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B
eor #$ff
// }
rts
@ -1167,13 +1162,13 @@ form_mode: {
// *DTV_COLOR_BANK_HI = >((word)(DTV_COLOR_BANK_DEFAULT/$400))
lda #0
sta DTV_COLOR_BANK_HI
// *CIA2_PORT_A_DDR = %00000011
// CIA2->PORT_A_DDR = %00000011
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = %00000011 ^ (byte)((word)FORM_CHARSET/$4000)
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = %00000011 ^ (byte)((word)FORM_CHARSET/$4000)
// Set VIC Bank bits to output - all others to input
sta CIA2_PORT_A
sta CIA2
// *DTV_CONTROL = 0
// Set VIC Bank
// DTV Graphics Mode
@ -3146,14 +3141,14 @@ gfx_init_screen0: {
}
// Initialize keyboard reading by setting CIA#$ Data Direction Registers
keyboard_init: {
// *CIA1_PORT_A_DDR = $ff
// CIA1->PORT_A_DDR = $ff
// Keyboard Matrix Columns Write Mode
lda #$ff
sta CIA1_PORT_A_DDR
// *CIA1_PORT_B_DDR = $00
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA1->PORT_B_DDR = $00
// Keyboard Matrix Columns Read Mode
lda #0
sta CIA1_PORT_B_DDR
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR
// }
rts
}

View File

@ -150,8 +150,8 @@ gfx_mode::@28: scope:[gfx_mode] from gfx_mode::@27
[87] (byte~) gfx_mode::$45 ← (byte~) gfx_mode::$44 | *((const nomodify byte*) form_b_mod_lo)
[88] *((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (byte~) gfx_mode::$45
[89] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0
[90] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[91] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(word) $4000
[90] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
[91] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(word) $4000
[92] (byte) get_vic_screen::idx#0 ← *((const nomodify byte*) form_vic_screen)
[93] call get_vic_screen
[94] (byte*) get_vic_screen::return#10 ← (byte*) get_vic_screen::return#5
@ -385,8 +385,8 @@ keyboard_event_pressed::@return: scope:[keyboard_event_pressed] from keyboard_e
(byte()) keyboard_matrix_read((byte) keyboard_matrix_read::rowid)
keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_event_scan::@7
[217] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0)
[218] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B)
[217] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0)
[218] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B)
to:keyboard_matrix_read::@return
keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matrix_read
[219] return
@ -525,8 +525,8 @@ form_mode::@16: scope:[form_mode] from form_mode::@15
[270] *((const nomodify byte*) DTV_GRAPHICS_VIC_BANK) ← (byte) 0
[271] *((const nomodify byte*) DTV_COLOR_BANK_LO) ← <(word)(const nomodify dword) DTV_COLOR_BANK_DEFAULT/(word) $400
[272] *((const nomodify byte*) DTV_COLOR_BANK_HI) ← (byte) 0
[273] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[274] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3
[273] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
[274] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3
[275] *((const nomodify byte*) DTV_CONTROL) ← (byte) 0
[276] *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3
[277] *((const nomodify byte*) VIC_CONTROL2) ← (const nomodify byte) VIC_CSEL
@ -1809,8 +1809,8 @@ gfx_init_screen0::@return: scope:[gfx_init_screen0] from gfx_init_screen0::@3
(void()) keyboard_init()
keyboard_init: scope:[keyboard_init] from main
[863] *((const nomodify byte*) CIA1_PORT_A_DDR) ← (byte) $ff
[864] *((const nomodify byte*) CIA1_PORT_B_DDR) ← (byte) 0
[863] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) $ff
[864] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR) ← (byte) 0
to:keyboard_init::@return
keyboard_init::@return: scope:[keyboard_init] from keyboard_init
[865] return

View File

@ -1,3 +1,15 @@
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_B_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_B with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_B with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA
@ -231,8 +243,8 @@ print_set_screen::@return: scope:[print_set_screen] from print_set_screen
(void()) keyboard_init()
keyboard_init: scope:[keyboard_init] from main
*((const nomodify byte*) CIA1_PORT_A_DDR) ← (number) $ff
*((const nomodify byte*) CIA1_PORT_B_DDR) ← (number) 0
*((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) $ff
*((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR) ← (number) 0
to:keyboard_init::@return
keyboard_init::@return: scope:[keyboard_init] from keyboard_init
return
@ -241,8 +253,8 @@ keyboard_init::@return: scope:[keyboard_init] from keyboard_init
(byte()) keyboard_matrix_read((byte) keyboard_matrix_read::rowid)
keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_event_scan::@7
(byte) keyboard_matrix_read::rowid#1 ← phi( keyboard_event_scan::@7/(byte) keyboard_matrix_read::rowid#0 )
*((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#1)
(byte~) keyboard_matrix_read::$0 ← ~ *((const nomodify byte*) CIA1_PORT_B)
*((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#1)
(byte~) keyboard_matrix_read::$0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B)
(byte) keyboard_matrix_read::row_pressed_bits#0 ← (byte~) keyboard_matrix_read::$0
(byte) keyboard_matrix_read::return#0 ← (byte) keyboard_matrix_read::row_pressed_bits#0
to:keyboard_matrix_read::@return
@ -1787,8 +1799,8 @@ gfx_mode::@31: scope:[gfx_mode] from gfx_mode::@30
(number~) gfx_mode::$45 ← (number~) gfx_mode::$44 | *((const nomodify byte*) form_b_mod_lo)
*((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (number~) gfx_mode::$45
*((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (number) 0
*((const nomodify byte*) CIA2_PORT_A_DDR) ← (number) 3
*((const nomodify byte*) CIA2_PORT_A) ← (number) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(number) $4000
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) 3
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (number) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(number) $4000
(byte) get_vic_screen::idx#0 ← *((const nomodify byte*) form_vic_screen)
call get_vic_screen
(byte*) get_vic_screen::return#7 ← (byte*) get_vic_screen::return#5
@ -2803,8 +2815,8 @@ form_mode::@16: scope:[form_mode] from form_mode::@15
*((const nomodify byte*) DTV_GRAPHICS_VIC_BANK) ← (byte)(dword)(const nomodify byte*) FORM_CHARSET/(number) $10000
*((const nomodify byte*) DTV_COLOR_BANK_LO) ← <(word)(const nomodify dword) DTV_COLOR_BANK_DEFAULT/(number) $400
*((const nomodify byte*) DTV_COLOR_BANK_HI) ← >(word)(const nomodify dword) DTV_COLOR_BANK_DEFAULT/(number) $400
*((const nomodify byte*) CIA2_PORT_A_DDR) ← (number) 3
*((const nomodify byte*) CIA2_PORT_A) ← (number) 3^(byte)(word)(const nomodify byte*) FORM_CHARSET/(number) $4000
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) 3
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (number) 3^(byte)(word)(const nomodify byte*) FORM_CHARSET/(number) $4000
*((const nomodify byte*) DTV_CONTROL) ← (number) 0
*((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(number) 3
*((const nomodify byte*) VIC_CONTROL2) ← (const nomodify byte) VIC_CSEL
@ -3329,12 +3341,8 @@ SYMBOL TABLE SSA
(const nomodify byte*) BGCOL4 = (byte*)(number) $d024
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify byte*) CHARGEN = (byte*)(number) $d000
(const nomodify byte*) CIA1_PORT_A = (byte*)(number) $dc00
(const nomodify byte*) CIA1_PORT_A_DDR = (byte*)(number) $dc02
(const nomodify byte*) CIA1_PORT_B = (byte*)(number) $dc01
(const nomodify byte*) CIA1_PORT_B_DDR = (byte*)(number) $dc03
(const nomodify byte*) CIA2_PORT_A = (byte*)(number) $dd00
(const nomodify byte*) CIA2_PORT_A_DDR = (byte*)(number) $dd02
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*)(number) $dc00
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*)(number) $dd00
(const nomodify byte*) COLS = (byte*)(number) $d800
(const nomodify byte) DTV_BORDER_OFF = (byte) 2
(const nomodify byte) DTV_CHUNKY = (byte) $40
@ -3380,6 +3388,24 @@ SYMBOL TABLE SSA
(const nomodify byte) KEY_MODIFIER_SHIFT = (const nomodify byte) KEY_MODIFIER_LSHIFT|(const nomodify byte) KEY_MODIFIER_RSHIFT
(const nomodify byte) KEY_RSHIFT = (byte) $34
(const nomodify byte) KEY_SPACE = (byte) $3c
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A = (byte) 0
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = (byte) 2
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B = (byte) 1
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR = (byte) 3
(const nomodify dword) PLANE_8BPP_CHUNKY = (dword) $20000
(const nomodify dword) PLANE_BLANK = (dword) $38000
(const nomodify dword) PLANE_CHARSET8 = (dword) $3c000
@ -6081,8 +6107,8 @@ Adding number conversion cast (unumber) 0 in (bool~) print_str_lines::$4 ← (nu
Adding number conversion cast (unumber) 0 in (bool~) print_str_at::$0 ← (number) 0 != *((byte*) print_str_at::str#2)
Adding number conversion cast (unumber) $28 in (byte*~) print_ln::$0 ← (byte*) print_line_cursor#21 + (number) $28
Adding number conversion cast (unumber) $3e8 in (word) memset::num#0 ← (number) $3e8
Adding number conversion cast (unumber) $ff in *((const nomodify byte*) CIA1_PORT_A_DDR) ← (number) $ff
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) CIA1_PORT_B_DDR) ← (number) 0
Adding number conversion cast (unumber) $ff in *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) $ff
Adding number conversion cast (unumber) 0 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR) ← (number) 0
Adding number conversion cast (unumber) 8 in (number~) keyboard_event_scan::$14 ← (byte) keyboard_event_scan::keycode#3 + (number) 8
Adding number conversion cast (unumber) keyboard_event_scan::$14 in (number~) keyboard_event_scan::$14 ← (byte) keyboard_event_scan::keycode#3 + (unumber)(number) 8
Adding number conversion cast (unumber) 0 in (bool~) keyboard_event_scan::$17 ← (byte~) keyboard_event_scan::$16 != (number) 0
@ -6202,10 +6228,10 @@ Adding number conversion cast (unumber) $10 in (number~) gfx_mode::$44 ← *((co
Adding number conversion cast (unumber) gfx_mode::$44 in (number~) gfx_mode::$44 ← *((const nomodify byte*) form_b_mod_hi) * (unumber)(number) $10
Adding number conversion cast (unumber) gfx_mode::$45 in (number~) gfx_mode::$45 ← (unumber~) gfx_mode::$44 | *((const nomodify byte*) form_b_mod_lo)
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (number) 0
Adding number conversion cast (unumber) 3 in *((const nomodify byte*) CIA2_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) 3^(byte)(word)VIC_SCREEN0/$4000 in *((const nomodify byte*) CIA2_PORT_A) ← (number) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(number) $4000
Adding number conversion cast (unumber) 3 in *((const nomodify byte*) CIA2_PORT_A) ← ((unumber)) (number) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(number) $4000
Adding number conversion cast (unumber) $4000 in *((const nomodify byte*) CIA2_PORT_A) ← ((unumber)) (unumber)(number) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(number) $4000
Adding number conversion cast (unumber) 3 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) 3^(byte)(word)VIC_SCREEN0/$4000 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (number) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(number) $4000
Adding number conversion cast (unumber) 3 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← ((unumber)) (number) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(number) $4000
Adding number conversion cast (unumber) $4000 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← ((unumber)) (unumber)(number) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(number) $4000
Adding number conversion cast (unumber) $3fff in (number~) gfx_mode::$47 ← (word~) gfx_mode::$82 & (number) $3fff
Adding number conversion cast (unumber) gfx_mode::$47 in (number~) gfx_mode::$47 ← (word~) gfx_mode::$82 & (unumber)(number) $3fff
Adding number conversion cast (unumber) $40 in (number~) gfx_mode::$48 ← (unumber~) gfx_mode::$47 / (number) $40
@ -6300,10 +6326,10 @@ Adding number conversion cast (unumber) gfx_init_plane_fill::$6 in (number~) gfx
Adding number conversion cast (unumber) $10000 in *((const nomodify byte*) DTV_GRAPHICS_VIC_BANK) ← (byte)(dword)(const nomodify byte*) FORM_CHARSET/(number) $10000
Adding number conversion cast (unumber) $400 in *((const nomodify byte*) DTV_COLOR_BANK_LO) ← <(word)(const nomodify dword) DTV_COLOR_BANK_DEFAULT/(number) $400
Adding number conversion cast (unumber) $400 in *((const nomodify byte*) DTV_COLOR_BANK_HI) ← >(word)(const nomodify dword) DTV_COLOR_BANK_DEFAULT/(number) $400
Adding number conversion cast (unumber) 3 in *((const nomodify byte*) CIA2_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) 3^(byte)(word)FORM_CHARSET/$4000 in *((const nomodify byte*) CIA2_PORT_A) ← (number) 3^(byte)(word)(const nomodify byte*) FORM_CHARSET/(number) $4000
Adding number conversion cast (unumber) 3 in *((const nomodify byte*) CIA2_PORT_A) ← ((unumber)) (number) 3^(byte)(word)(const nomodify byte*) FORM_CHARSET/(number) $4000
Adding number conversion cast (unumber) $4000 in *((const nomodify byte*) CIA2_PORT_A) ← ((unumber)) (unumber)(number) 3^(byte)(word)(const nomodify byte*) FORM_CHARSET/(number) $4000
Adding number conversion cast (unumber) 3 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) 3^(byte)(word)FORM_CHARSET/$4000 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (number) 3^(byte)(word)(const nomodify byte*) FORM_CHARSET/(number) $4000
Adding number conversion cast (unumber) 3 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← ((unumber)) (number) 3^(byte)(word)(const nomodify byte*) FORM_CHARSET/(number) $4000
Adding number conversion cast (unumber) $4000 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← ((unumber)) (unumber)(number) 3^(byte)(word)(const nomodify byte*) FORM_CHARSET/(number) $4000
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) DTV_CONTROL) ← (number) 0
Adding number conversion cast (unumber) VIC_DEN|VIC_RSEL|3 in *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(number) 3
Adding number conversion cast (unumber) 3 in *((const nomodify byte*) VIC_CONTROL) ← ((unumber)) (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(number) 3
@ -6349,8 +6375,8 @@ Adding number conversion cast (unumber) $400 in *((const nomodify byte*) VIC_MEM
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast *((const nomodify byte*) CIA1_PORT_A_DDR) ← (unumber)(number) $ff
Inlining cast *((const nomodify byte*) CIA1_PORT_B_DDR) ← (unumber)(number) 0
Inlining cast *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (unumber)(number) $ff
Inlining cast *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR) ← (unumber)(number) 0
Inlining cast (byte) keyboard_modifiers#1 ← (unumber)(number) 0
Inlining cast (byte) keyboard_event_get::return#0 ← (unumber)(number) $ff
Inlining cast (byte) bitmap_init::bits#2 ← (unumber)(number) $80
@ -6358,8 +6384,8 @@ 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*) DTV_PLANEA_MODULO_HI) ← (unumber)(number) 0
Inlining cast *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (unumber)(number) 0
Inlining cast *((const nomodify byte*) CIA2_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast *((const nomodify byte*) CIA2_PORT_A) ← (unumber)(unumber)(number) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(unumber)(number) $4000
Inlining cast *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (unumber)(unumber)(number) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(unumber)(number) $4000
Inlining cast *((const nomodify byte*) BORDERCOL) ← (unumber)(number) 0
Inlining cast *((const nomodify byte*) PROCPORT) ← (unumber)(number) $32
Inlining cast *((const nomodify byte*) PROCPORT) ← (unumber)(number) $37
@ -6372,8 +6398,8 @@ Inlining cast (byte) gfx_init_plane_fill::fill#0 ← (unumber)(number) $1b
Inlining cast (byte) gfx_init_plane_fill::fill#1 ← (unumber)(number) 0
Inlining cast (byte) gfx_init_plane_fill::fill#2 ← (unumber)(number) $ff
Inlining cast (byte*) gfx_init_plane_fill::gfxb#0 ← (byte*)(unumber~) gfx_init_plane_fill::$6
Inlining cast *((const nomodify byte*) CIA2_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast *((const nomodify byte*) CIA2_PORT_A) ← (unumber)(unumber)(number) 3^(byte)(word)(const nomodify byte*) FORM_CHARSET/(unumber)(number) $4000
Inlining cast *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (unumber)(unumber)(number) 3^(byte)(word)(const nomodify byte*) FORM_CHARSET/(unumber)(number) $4000
Inlining cast *((const nomodify byte*) DTV_CONTROL) ← (unumber)(number) 0
Inlining cast *((const nomodify byte*) VIC_CONTROL) ← (unumber)(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(unumber)(number) 3
Inlining cast *((const nomodify byte*) DTV_PLANEA_START_HI) ← (unumber)(number) 0
@ -6401,12 +6427,8 @@ Simplifying constant pointer cast (byte*) 53265
Simplifying constant pointer cast (byte*) 53270
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (byte*) 55296
Simplifying constant pointer cast (byte*) 56320
Simplifying constant pointer cast (byte*) 56321
Simplifying constant pointer cast (byte*) 56322
Simplifying constant pointer cast (byte*) 56323
Simplifying constant pointer cast (byte*) 56576
Simplifying constant pointer cast (byte*) 56578
Simplifying constant pointer cast (struct MOS6526_CIA*) 56320
Simplifying constant pointer cast (struct MOS6526_CIA*) 56576
Simplifying constant pointer cast (byte*) 53311
Simplifying constant pointer cast (byte*) 53308
Simplifying constant pointer cast (byte*) 53760
@ -8035,18 +8057,21 @@ Simplifying constant evaluating to zero (const nomodify dword) PLANE_HORISONTAL2
Simplifying constant evaluating to zero (const nomodify dword) PLANE_CHARSET8&(word) $3fff in
Simplifying constant evaluating to zero (byte)(dword)(const nomodify byte*) FORM_CHARSET/(dword) $10000 in [1029] *((const nomodify byte*) DTV_GRAPHICS_VIC_BANK) ← (byte)(dword)(const nomodify byte*) FORM_CHARSET/(dword) $10000
Simplifying constant evaluating to zero >(word)(const nomodify dword) DTV_COLOR_BANK_DEFAULT/(word) $400 in [1031] *((const nomodify byte*) DTV_COLOR_BANK_HI) ← >(word)(const nomodify dword) DTV_COLOR_BANK_DEFAULT/(word) $400
Simplifying constant evaluating to zero (byte)(word)(const nomodify byte*) FORM_CHARSET/(word) $4000 in [1033] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) FORM_CHARSET/(word) $4000
Simplifying constant evaluating to zero (byte)(word)(const nomodify byte*) FORM_CHARSET/(word) $4000 in [1033] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) FORM_CHARSET/(word) $4000
Simplifying constant evaluating to zero <(const nomodify byte*) FORM_SCREEN in [1038] *((const nomodify byte*) DTV_PLANEA_START_LO) ← <(const nomodify byte*) FORM_SCREEN
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero form_fields_val in
Simplifying expression containing zero $4000 in
Simplifying expression containing zero $4000 in
Simplifying expression containing zero $4000 in
Simplifying expression containing zero (byte*)CIA1 in [68] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0)
Simplifying expression containing zero KEY_MODIFIER_LSHIFT in [124] (byte) keyboard_modifiers#2 ← (const byte) keyboard_modifiers#1 | (const nomodify byte) KEY_MODIFIER_LSHIFT
Simplifying expression containing zero bitmap_plot_xhi in [193] (word~) bitmap_clear::$3 ← *((const to_nomodify byte*) bitmap_plot_xhi + (byte) 0) w= *((const to_nomodify byte*) bitmap_plot_xlo + (byte) 0)
Simplifying expression containing zero bitmap_plot_xlo in [193] (word~) bitmap_clear::$3 ← *((const to_nomodify byte*) bitmap_plot_xhi) w= *((const to_nomodify byte*) bitmap_plot_xlo + (byte) 0)
Simplifying expression containing zero DTV_LINEAR in [537] (byte) gfx_mode::dtv_control#1 ← (const byte) gfx_mode::dtv_control#0 | (const nomodify byte) DTV_LINEAR
Simplifying expression containing zero 3 in [1033] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte) 0
Simplifying expression containing zero (byte*)CIA2 in [619] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(word) $4000
Simplifying expression containing zero 3 in [1033] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (byte) 3^(byte) 0
Simplifying expression containing zero (byte*)CIA2 in [1033] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (byte) 3
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused variable (void*) memset::return#2 and assignment [40] (void*) memset::return#2 ← (void*) memset::str#0
Eliminating unused variable - keeping the phi block (byte*) print_screen#13
@ -8064,6 +8089,7 @@ Eliminating unused constant (const byte) bitmap_line::xd#0
Eliminating unused constant (const byte) bitmap_line::yd#0
Eliminating unused constant (const byte*) apply_preset::preset#0
Eliminating unused constant (const byte*) render_preset_name::name#0
Eliminating unused constant (const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A
Successful SSA optimization PassNEliminateUnusedVars
Eliminating unused variable - keeping the phi block (byte) keyboard_modifiers#24
Eliminating unused variable - keeping the phi block (byte) keyboard_modifiers#13
@ -9662,8 +9688,8 @@ gfx_mode::@28: scope:[gfx_mode] from gfx_mode::@27
[87] (byte~) gfx_mode::$45 ← (byte~) gfx_mode::$44 | *((const nomodify byte*) form_b_mod_lo)
[88] *((const nomodify byte*) DTV_PLANEB_MODULO_LO) ← (byte~) gfx_mode::$45
[89] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0
[90] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[91] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(word) $4000
[90] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
[91] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(word) $4000
[92] (byte) get_vic_screen::idx#0 ← *((const nomodify byte*) form_vic_screen)
[93] call get_vic_screen
[94] (byte*) get_vic_screen::return#10 ← (byte*) get_vic_screen::return#5
@ -9897,8 +9923,8 @@ keyboard_event_pressed::@return: scope:[keyboard_event_pressed] from keyboard_e
(byte()) keyboard_matrix_read((byte) keyboard_matrix_read::rowid)
keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_event_scan::@7
[217] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0)
[218] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B)
[217] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0)
[218] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B)
to:keyboard_matrix_read::@return
keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matrix_read
[219] return
@ -10037,8 +10063,8 @@ form_mode::@16: scope:[form_mode] from form_mode::@15
[270] *((const nomodify byte*) DTV_GRAPHICS_VIC_BANK) ← (byte) 0
[271] *((const nomodify byte*) DTV_COLOR_BANK_LO) ← <(word)(const nomodify dword) DTV_COLOR_BANK_DEFAULT/(word) $400
[272] *((const nomodify byte*) DTV_COLOR_BANK_HI) ← (byte) 0
[273] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[274] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3
[273] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
[274] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3
[275] *((const nomodify byte*) DTV_CONTROL) ← (byte) 0
[276] *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3
[277] *((const nomodify byte*) VIC_CONTROL2) ← (const nomodify byte) VIC_CSEL
@ -11321,8 +11347,8 @@ gfx_init_screen0::@return: scope:[gfx_init_screen0] from gfx_init_screen0::@3
(void()) keyboard_init()
keyboard_init: scope:[keyboard_init] from main
[863] *((const nomodify byte*) CIA1_PORT_A_DDR) ← (byte) $ff
[864] *((const nomodify byte*) CIA1_PORT_B_DDR) ← (byte) 0
[863] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) $ff
[864] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR) ← (byte) 0
to:keyboard_init::@return
keyboard_init::@return: scope:[keyboard_init] from keyboard_init
[865] return
@ -11330,6 +11356,20 @@ keyboard_init::@return: scope:[keyboard_init] from keyboard_init
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
(void()) apply_preset((byte) apply_preset::idx)
(byte) apply_preset::i
(byte) apply_preset::i#1 2.000000002E9
@ -12899,18 +12939,10 @@ Target platform is c64basic / MOS6502X
.label VIC_MEMORY = $d018
// Color Ram
.label COLS = $d800
// CIA#1 Port A: keyboard matrix columns and joystick #2
.label CIA1_PORT_A = $dc00
// CIA#1 Port B: keyboard matrix rows and joystick #1.
.label CIA1_PORT_B = $dc01
// CIA #1 Port A data direction register.
.label CIA1_PORT_A_DDR = $dc02
// CIA #1 Port B data direction register.
.label CIA1_PORT_B_DDR = $dc03
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// Feature enables or disables the extra C64 DTV features
.label DTV_FEATURE = $d03f
.const DTV_FEATURE_ENABLE = 1
@ -13030,6 +13062,9 @@ Target platform is c64basic / MOS6502X
.label form_vic_bg3_lo = form_fields_val+$23
// The number of frames to use for a full blink cycle
.const FORM_CURSOR_BLINK = $28
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR = 3
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
// Number of form fields
.const form_fields_cnt = $24
.label print_line_cursor = $36
@ -13595,14 +13630,14 @@ gfx_mode: {
// [89] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_PLANEB_MODULO_HI
// [90] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// [90] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// [91] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(word) $4000 -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [91] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(word) $4000 -- _deref_pbuc1=vbuc2
// Set VIC Bank bits to output - all others to input
lda #3^VIC_SCREEN0/$4000
sta CIA2_PORT_A
sta CIA2
// [92] (byte) get_vic_screen::idx#0 ← *((const nomodify byte*) form_vic_screen) -- vbuz1=_deref_pbuc1
lda form_vic_screen
sta.z get_vic_screen.idx
@ -14351,12 +14386,12 @@ keyboard_matrix_read: {
.label return = $102
.label rowid = $ef
.label return_1 = $f0
// [217] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0) -- _deref_pbuc1=pbuc2_derefidx_vbuz1
// [217] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0) -- _deref_pbuc1=pbuc2_derefidx_vbuz1
ldy.z rowid
lda keyboard_matrix_row_bitmask,y
sta CIA1_PORT_A
// [218] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B) -- vbuz1=_bnot__deref_pbuc1
lda CIA1_PORT_B
sta CIA1
// [218] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) -- vbuz1=_bnot__deref_pbuc1
lda CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B
eor #$ff
sta.z return
jmp __breturn
@ -14911,14 +14946,14 @@ form_mode: {
// [272] *((const nomodify byte*) DTV_COLOR_BANK_HI) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_COLOR_BANK_HI
// [273] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// [273] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// [274] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3 -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [274] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3 -- _deref_pbuc1=vbuc2
// Set VIC Bank bits to output - all others to input
lda #3
sta CIA2_PORT_A
sta CIA2
// [275] *((const nomodify byte*) DTV_CONTROL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Set VIC Bank
// DTV Graphics Mode
@ -18730,14 +18765,14 @@ gfx_init_screen0: {
// keyboard_init
// Initialize keyboard reading by setting CIA#$ Data Direction Registers
keyboard_init: {
// [863] *((const nomodify byte*) CIA1_PORT_A_DDR) ← (byte) $ff -- _deref_pbuc1=vbuc2
// [863] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) $ff -- _deref_pbuc1=vbuc2
// Keyboard Matrix Columns Write Mode
lda #$ff
sta CIA1_PORT_A_DDR
// [864] *((const nomodify byte*) CIA1_PORT_B_DDR) ← (byte) 0 -- _deref_pbuc1=vbuc2
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [864] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Keyboard Matrix Columns Read Mode
lda #0
sta CIA1_PORT_B_DDR
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR
jmp __breturn
// keyboard_init::@return
__breturn:
@ -18851,8 +18886,8 @@ Statement [84] (byte~) gfx_mode::$43 ← (byte~) gfx_mode::$42 | *((const nomodi
Statement [86] (byte~) gfx_mode::$44 ← *((const nomodify byte*) form_b_mod_hi) << (byte) 4 [ keyboard_events_size#24 gfx_mode::$44 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 gfx_mode::$44 ] { { get_vic_screen::idx#0 = get_vic_screen::idx#2 } { get_vic_screen::return#10 = get_vic_screen::return#5 } } ) always clobbers reg byte a
Statement [87] (byte~) gfx_mode::$45 ← (byte~) gfx_mode::$44 | *((const nomodify byte*) form_b_mod_lo) [ keyboard_events_size#24 gfx_mode::$45 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 gfx_mode::$45 ] { { get_vic_screen::idx#0 = get_vic_screen::idx#2 } { get_vic_screen::return#10 = get_vic_screen::return#5 } } ) always clobbers reg byte a
Statement [89] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0 [ keyboard_events_size#24 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 ] { { get_vic_screen::idx#0 = get_vic_screen::idx#2 } { get_vic_screen::return#10 = get_vic_screen::return#5 } } ) always clobbers reg byte a
Statement [90] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ keyboard_events_size#24 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 ] { { get_vic_screen::idx#0 = get_vic_screen::idx#2 } { get_vic_screen::return#10 = get_vic_screen::return#5 } } ) always clobbers reg byte a
Statement [91] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(word) $4000 [ keyboard_events_size#24 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 ] { { get_vic_screen::idx#0 = get_vic_screen::idx#2 } { get_vic_screen::return#10 = get_vic_screen::return#5 } } ) always clobbers reg byte a
Statement [90] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ keyboard_events_size#24 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 ] { { get_vic_screen::idx#0 = get_vic_screen::idx#2 } { get_vic_screen::return#10 = get_vic_screen::return#5 } } ) always clobbers reg byte a
Statement [91] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(word) $4000 [ keyboard_events_size#24 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 ] { { get_vic_screen::idx#0 = get_vic_screen::idx#2 } { get_vic_screen::return#10 = get_vic_screen::return#5 } } ) always clobbers reg byte a
Statement [94] (byte*) get_vic_screen::return#10 ← (byte*) get_vic_screen::return#5 [ keyboard_events_size#24 get_vic_screen::return#10 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 get_vic_screen::return#10 ] { { get_vic_screen::idx#0 = get_vic_screen::idx#2 } { get_vic_screen::return#10 = get_vic_screen::return#5 } } ) always clobbers reg byte a
Statement [95] (byte*~) gfx_mode::$82 ← (byte*) get_vic_screen::return#10 [ keyboard_events_size#24 gfx_mode::$82 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 gfx_mode::$82 ] { { get_vic_charset::return#2 = get_vic_charset::return#4 } } ) always clobbers reg byte a
Statement [96] (word~) gfx_mode::$47 ← (word)(byte*~) gfx_mode::$82 & (word) $3fff [ keyboard_events_size#24 gfx_mode::$47 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 gfx_mode::$47 ] { { get_vic_charset::return#2 = get_vic_charset::return#4 } } ) always clobbers reg byte a
@ -18906,13 +18941,13 @@ Removing always clobbered register reg byte a as potential for zp[1]:15 [ keyboa
Statement [214] (byte~) keyboard_event_pressed::$1 ← (byte) keyboard_event_pressed::keycode#4 & (byte) 7 [ keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] ( main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:169 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#0 = keyboard_event_pressed::return#10 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:169 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#0 = keyboard_event_pressed::return#10 } } main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:175 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_modifiers#18 keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#1 = keyboard_event_pressed::return#10 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:175 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_modifiers#18 keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#1 = keyboard_event_pressed::return#10 } } main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:181 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_modifiers#19 keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#2 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:181 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_modifiers#19 keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#2 } } main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:187 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_modifiers#20 keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#3 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:187 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_modifiers#20 keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#3 } } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:255 [ keyboard_event_pressed::row_bits#0 ]
Statement [215] (byte) keyboard_event_pressed::return#10 ← (byte) keyboard_event_pressed::row_bits#0 & *((const byte*) keyboard_matrix_col_bitmask + (byte~) keyboard_event_pressed::$1) [ keyboard_event_pressed::return#10 ] ( main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:169 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_event_pressed::return#10 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#0 = keyboard_event_pressed::return#10 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:169 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_event_pressed::return#10 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#0 = keyboard_event_pressed::return#10 } } main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:175 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_modifiers#18 keyboard_event_pressed::return#10 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#1 = keyboard_event_pressed::return#10 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:175 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_modifiers#18 keyboard_event_pressed::return#10 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#1 = keyboard_event_pressed::return#10 } } main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:181 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_modifiers#19 keyboard_event_pressed::return#10 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#2 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:181 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_modifiers#19 keyboard_event_pressed::return#10 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#2 } } main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:187 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_modifiers#20 keyboard_event_pressed::return#10 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#3 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:187 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_modifiers#20 keyboard_event_pressed::return#10 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#3 } } ) always clobbers reg byte a
Statement [217] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0) [ ] ( main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_matrix_read:160 [ form_cursor_count#16 form_field_idx#18 keyboard_event_scan::row#2 keyboard_event_scan::keycode#11 keyboard_events_size#106 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_matrix_read::rowid#0 = keyboard_event_scan::row#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_matrix_read:160 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_event_scan::row#2 keyboard_event_scan::keycode#11 keyboard_events_size#106 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_matrix_read::rowid#0 = keyboard_event_scan::row#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [218] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B) [ keyboard_matrix_read::return#0 ] ( main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_matrix_read:160 [ form_cursor_count#16 form_field_idx#18 keyboard_event_scan::row#2 keyboard_event_scan::keycode#11 keyboard_events_size#106 keyboard_matrix_read::return#0 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_matrix_read::rowid#0 = keyboard_event_scan::row#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_matrix_read:160 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_event_scan::row#2 keyboard_event_scan::keycode#11 keyboard_events_size#106 keyboard_matrix_read::return#0 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_matrix_read::rowid#0 = keyboard_event_scan::row#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [217] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0) [ ] ( main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_matrix_read:160 [ form_cursor_count#16 form_field_idx#18 keyboard_event_scan::row#2 keyboard_event_scan::keycode#11 keyboard_events_size#106 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_matrix_read::rowid#0 = keyboard_event_scan::row#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_matrix_read:160 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_event_scan::row#2 keyboard_event_scan::keycode#11 keyboard_events_size#106 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_matrix_read::rowid#0 = keyboard_event_scan::row#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [218] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) [ keyboard_matrix_read::return#0 ] ( main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_matrix_read:160 [ form_cursor_count#16 form_field_idx#18 keyboard_event_scan::row#2 keyboard_event_scan::keycode#11 keyboard_events_size#106 keyboard_matrix_read::return#0 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_matrix_read::rowid#0 = keyboard_event_scan::row#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_matrix_read:160 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_event_scan::row#2 keyboard_event_scan::keycode#11 keyboard_events_size#106 keyboard_matrix_read::return#0 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_matrix_read::rowid#0 = keyboard_event_scan::row#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [270] *((const nomodify byte*) DTV_GRAPHICS_VIC_BANK) ← (byte) 0 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [271] *((const nomodify byte*) DTV_COLOR_BANK_LO) ← <(word)(const nomodify dword) DTV_COLOR_BANK_DEFAULT/(word) $400 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [272] *((const nomodify byte*) DTV_COLOR_BANK_HI) ← (byte) 0 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [273] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [274] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [273] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [274] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [275] *((const nomodify byte*) DTV_CONTROL) ← (byte) 0 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [276] *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [277] *((const nomodify byte*) VIC_CONTROL2) ← (const nomodify byte) VIC_CSEL [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
@ -19159,8 +19194,8 @@ Removing always clobbered register reg byte a as potential for zp[1]:347 [ gfx_i
Statement [856] *((byte*) gfx_init_screen0::ch#2) ← (byte~) gfx_init_screen0::$3 [ gfx_init_screen0::cy#4 gfx_init_screen0::cx#2 gfx_init_screen0::ch#2 ] ( main:2::gfx_init:10::gfx_init_screen0:453 [ gfx_init_screen0::cy#4 gfx_init_screen0::cx#2 gfx_init_screen0::ch#2 ] { } ) always clobbers reg byte y
Removing always clobbered register reg byte y as potential for zp[1]:154 [ gfx_init_screen0::cy#4 gfx_init_screen0::cy#1 ]
Removing always clobbered register reg byte y as potential for zp[1]:155 [ gfx_init_screen0::cx#2 gfx_init_screen0::cx#1 ]
Statement [863] *((const nomodify byte*) CIA1_PORT_A_DDR) ← (byte) $ff [ ] ( main:2::keyboard_init:8 [ ] { } ) always clobbers reg byte a
Statement [864] *((const nomodify byte*) CIA1_PORT_B_DDR) ← (byte) 0 [ ] ( main:2::keyboard_init:8 [ ] { } ) always clobbers reg byte a
Statement [863] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) $ff [ ] ( main:2::keyboard_init:8 [ ] { } ) always clobbers reg byte a
Statement [864] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR) ← (byte) 0 [ ] ( main:2::keyboard_init:8 [ ] { } ) always clobbers reg byte a
Statement [5] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [6] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [7] *((const nomodify byte*) DTV_FEATURE) ← (const nomodify byte) DTV_FEATURE_ENABLE [ ] ( main:2 [ ] { } ) always clobbers reg byte a
@ -19203,8 +19238,8 @@ Statement [84] (byte~) gfx_mode::$43 ← (byte~) gfx_mode::$42 | *((const nomodi
Statement [86] (byte~) gfx_mode::$44 ← *((const nomodify byte*) form_b_mod_hi) << (byte) 4 [ keyboard_events_size#24 gfx_mode::$44 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 gfx_mode::$44 ] { { get_vic_screen::idx#0 = get_vic_screen::idx#2 } { get_vic_screen::return#10 = get_vic_screen::return#5 } } ) always clobbers reg byte a
Statement [87] (byte~) gfx_mode::$45 ← (byte~) gfx_mode::$44 | *((const nomodify byte*) form_b_mod_lo) [ keyboard_events_size#24 gfx_mode::$45 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 gfx_mode::$45 ] { { get_vic_screen::idx#0 = get_vic_screen::idx#2 } { get_vic_screen::return#10 = get_vic_screen::return#5 } } ) always clobbers reg byte a
Statement [89] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0 [ keyboard_events_size#24 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 ] { { get_vic_screen::idx#0 = get_vic_screen::idx#2 } { get_vic_screen::return#10 = get_vic_screen::return#5 } } ) always clobbers reg byte a
Statement [90] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ keyboard_events_size#24 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 ] { { get_vic_screen::idx#0 = get_vic_screen::idx#2 } { get_vic_screen::return#10 = get_vic_screen::return#5 } } ) always clobbers reg byte a
Statement [91] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(word) $4000 [ keyboard_events_size#24 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 ] { { get_vic_screen::idx#0 = get_vic_screen::idx#2 } { get_vic_screen::return#10 = get_vic_screen::return#5 } } ) always clobbers reg byte a
Statement [90] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ keyboard_events_size#24 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 ] { { get_vic_screen::idx#0 = get_vic_screen::idx#2 } { get_vic_screen::return#10 = get_vic_screen::return#5 } } ) always clobbers reg byte a
Statement [91] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(word) $4000 [ keyboard_events_size#24 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 ] { { get_vic_screen::idx#0 = get_vic_screen::idx#2 } { get_vic_screen::return#10 = get_vic_screen::return#5 } } ) always clobbers reg byte a
Statement [94] (byte*) get_vic_screen::return#10 ← (byte*) get_vic_screen::return#5 [ keyboard_events_size#24 get_vic_screen::return#10 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 get_vic_screen::return#10 ] { { get_vic_screen::idx#0 = get_vic_screen::idx#2 } { get_vic_screen::return#10 = get_vic_screen::return#5 } } ) always clobbers reg byte a
Statement [95] (byte*~) gfx_mode::$82 ← (byte*) get_vic_screen::return#10 [ keyboard_events_size#24 gfx_mode::$82 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 gfx_mode::$82 ] { { get_vic_charset::return#2 = get_vic_charset::return#4 } } ) always clobbers reg byte a
Statement [96] (word~) gfx_mode::$47 ← (word)(byte*~) gfx_mode::$82 & (word) $3fff [ keyboard_events_size#24 gfx_mode::$47 ] ( main:2::gfx_mode:15 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#24 gfx_mode::$47 ] { { get_vic_charset::return#2 = get_vic_charset::return#4 } } ) always clobbers reg byte a
@ -19242,13 +19277,13 @@ Statement [208] (byte~) keyboard_event_scan::$23 ← (byte) keyboard_event_scan:
Statement [212] (byte~) keyboard_event_pressed::$0 ← (byte) keyboard_event_pressed::keycode#4 >> (byte) 3 [ keyboard_event_pressed::keycode#4 keyboard_event_pressed::$0 ] ( main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:169 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_event_pressed::keycode#4 keyboard_event_pressed::$0 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#0 = keyboard_event_pressed::return#10 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:169 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_event_pressed::keycode#4 keyboard_event_pressed::$0 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#0 = keyboard_event_pressed::return#10 } } main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:175 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_modifiers#18 keyboard_event_pressed::keycode#4 keyboard_event_pressed::$0 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#1 = keyboard_event_pressed::return#10 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:175 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_modifiers#18 keyboard_event_pressed::keycode#4 keyboard_event_pressed::$0 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#1 = keyboard_event_pressed::return#10 } } main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:181 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_modifiers#19 keyboard_event_pressed::keycode#4 keyboard_event_pressed::$0 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#2 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:181 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_modifiers#19 keyboard_event_pressed::keycode#4 keyboard_event_pressed::$0 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#2 } } main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:187 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_modifiers#20 keyboard_event_pressed::keycode#4 keyboard_event_pressed::$0 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#3 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:187 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_modifiers#20 keyboard_event_pressed::keycode#4 keyboard_event_pressed::$0 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#3 } } ) always clobbers reg byte a
Statement [214] (byte~) keyboard_event_pressed::$1 ← (byte) keyboard_event_pressed::keycode#4 & (byte) 7 [ keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] ( main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:169 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#0 = keyboard_event_pressed::return#10 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:169 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#0 = keyboard_event_pressed::return#10 } } main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:175 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_modifiers#18 keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#1 = keyboard_event_pressed::return#10 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:175 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_modifiers#18 keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#1 = keyboard_event_pressed::return#10 } } main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:181 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_modifiers#19 keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#2 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:181 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_modifiers#19 keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#2 } } main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:187 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_modifiers#20 keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#3 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:187 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_modifiers#20 keyboard_event_pressed::row_bits#0 keyboard_event_pressed::$1 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#3 } } ) always clobbers reg byte a
Statement [215] (byte) keyboard_event_pressed::return#10 ← (byte) keyboard_event_pressed::row_bits#0 & *((const byte*) keyboard_matrix_col_bitmask + (byte~) keyboard_event_pressed::$1) [ keyboard_event_pressed::return#10 ] ( main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:169 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_event_pressed::return#10 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#0 = keyboard_event_pressed::return#10 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:169 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_event_pressed::return#10 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#0 = keyboard_event_pressed::return#10 } } main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:175 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_modifiers#18 keyboard_event_pressed::return#10 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#1 = keyboard_event_pressed::return#10 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:175 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_modifiers#18 keyboard_event_pressed::return#10 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#1 = keyboard_event_pressed::return#10 } } main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:181 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_modifiers#19 keyboard_event_pressed::return#10 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#2 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:181 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_modifiers#19 keyboard_event_pressed::return#10 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#2 } } main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_event_pressed:187 [ form_cursor_count#16 form_field_idx#18 keyboard_events_size#100 keyboard_modifiers#20 keyboard_event_pressed::return#10 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#3 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_event_pressed:187 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_events_size#100 keyboard_modifiers#20 keyboard_event_pressed::return#10 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_event_pressed::return#10 = keyboard_event_pressed::return#3 } } ) always clobbers reg byte a
Statement [217] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0) [ ] ( main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_matrix_read:160 [ form_cursor_count#16 form_field_idx#18 keyboard_event_scan::row#2 keyboard_event_scan::keycode#11 keyboard_events_size#106 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_matrix_read::rowid#0 = keyboard_event_scan::row#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_matrix_read:160 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_event_scan::row#2 keyboard_event_scan::keycode#11 keyboard_events_size#106 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_matrix_read::rowid#0 = keyboard_event_scan::row#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [218] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B) [ keyboard_matrix_read::return#0 ] ( main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_matrix_read:160 [ form_cursor_count#16 form_field_idx#18 keyboard_event_scan::row#2 keyboard_event_scan::keycode#11 keyboard_events_size#106 keyboard_matrix_read::return#0 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_matrix_read::rowid#0 = keyboard_event_scan::row#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_matrix_read:160 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_event_scan::row#2 keyboard_event_scan::keycode#11 keyboard_events_size#106 keyboard_matrix_read::return#0 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_matrix_read::rowid#0 = keyboard_event_scan::row#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [217] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0) [ ] ( main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_matrix_read:160 [ form_cursor_count#16 form_field_idx#18 keyboard_event_scan::row#2 keyboard_event_scan::keycode#11 keyboard_events_size#106 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_matrix_read::rowid#0 = keyboard_event_scan::row#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_matrix_read:160 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_event_scan::row#2 keyboard_event_scan::keycode#11 keyboard_events_size#106 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_matrix_read::rowid#0 = keyboard_event_scan::row#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [218] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) [ keyboard_matrix_read::return#0 ] ( main:2::gfx_mode:15::keyboard_event_scan:141::keyboard_matrix_read:160 [ form_cursor_count#16 form_field_idx#18 keyboard_event_scan::row#2 keyboard_event_scan::keycode#11 keyboard_events_size#106 keyboard_matrix_read::return#0 ] { { keyboard_events_size#24 = keyboard_events_size#97 } { keyboard_matrix_read::rowid#0 = keyboard_event_scan::row#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::form_mode:13::form_control:292::keyboard_event_scan:372::keyboard_matrix_read:160 [ form_mode::preset_current#6 form_field_idx#28 form_control::field#0 form_cursor_count#15 keyboard_event_scan::row#2 keyboard_event_scan::keycode#11 keyboard_events_size#106 keyboard_matrix_read::return#0 ] { { form_control::return#0 = form_control::return#2 } { keyboard_events_size#47 = keyboard_events_size#97 } { keyboard_matrix_read::rowid#0 = keyboard_event_scan::row#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [270] *((const nomodify byte*) DTV_GRAPHICS_VIC_BANK) ← (byte) 0 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [271] *((const nomodify byte*) DTV_COLOR_BANK_LO) ← <(word)(const nomodify dword) DTV_COLOR_BANK_DEFAULT/(word) $400 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [272] *((const nomodify byte*) DTV_COLOR_BANK_HI) ← (byte) 0 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [273] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [274] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [273] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [274] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [275] *((const nomodify byte*) DTV_CONTROL) ← (byte) 0 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [276] *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
Statement [277] *((const nomodify byte*) VIC_CONTROL2) ← (const nomodify byte) VIC_CSEL [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] ( main:2::form_mode:13 [ form_cursor_count#1 keyboard_events_size#27 form_field_idx#1 ] { } ) always clobbers reg byte a
@ -19368,8 +19403,8 @@ Statement [852] (byte~) gfx_init_screen0::$0 ← (byte) gfx_init_screen0::cy#4 &
Statement [853] (byte~) gfx_init_screen0::$1 ← (byte~) gfx_init_screen0::$0 << (byte) 4 [ gfx_init_screen0::cy#4 gfx_init_screen0::cx#2 gfx_init_screen0::ch#2 gfx_init_screen0::$1 ] ( main:2::gfx_init:10::gfx_init_screen0:453 [ gfx_init_screen0::cy#4 gfx_init_screen0::cx#2 gfx_init_screen0::ch#2 gfx_init_screen0::$1 ] { } ) always clobbers reg byte a
Statement [854] (byte~) gfx_init_screen0::$2 ← (byte) gfx_init_screen0::cx#2 & (byte) $f [ gfx_init_screen0::cy#4 gfx_init_screen0::cx#2 gfx_init_screen0::ch#2 gfx_init_screen0::$1 gfx_init_screen0::$2 ] ( main:2::gfx_init:10::gfx_init_screen0:453 [ gfx_init_screen0::cy#4 gfx_init_screen0::cx#2 gfx_init_screen0::ch#2 gfx_init_screen0::$1 gfx_init_screen0::$2 ] { } ) always clobbers reg byte a
Statement [856] *((byte*) gfx_init_screen0::ch#2) ← (byte~) gfx_init_screen0::$3 [ gfx_init_screen0::cy#4 gfx_init_screen0::cx#2 gfx_init_screen0::ch#2 ] ( main:2::gfx_init:10::gfx_init_screen0:453 [ gfx_init_screen0::cy#4 gfx_init_screen0::cx#2 gfx_init_screen0::ch#2 ] { } ) always clobbers reg byte y
Statement [863] *((const nomodify byte*) CIA1_PORT_A_DDR) ← (byte) $ff [ ] ( main:2::keyboard_init:8 [ ] { } ) always clobbers reg byte a
Statement [864] *((const nomodify byte*) CIA1_PORT_B_DDR) ← (byte) 0 [ ] ( main:2::keyboard_init:8 [ ] { } ) always clobbers reg byte a
Statement [863] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) $ff [ ] ( main:2::keyboard_init:8 [ ] { } ) always clobbers reg byte a
Statement [864] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR) ← (byte) 0 [ ] ( main:2::keyboard_init:8 [ ] { } ) always clobbers reg byte a
Potential registers zp[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 ] : zp[1]:2 , reg byte x , reg byte y ,
Potential registers zp[1]:3 [ gfx_mode::vic_control#4 gfx_mode::vic_control#2 gfx_mode::vic_control#5 ] : zp[1]:3 , reg byte x , reg byte y ,
Potential registers zp[1]:4 [ gfx_mode::vic_control2#2 ] : zp[1]:4 , reg byte a , reg byte x , reg byte y ,
@ -19678,6 +19713,7 @@ Uplift Scope [gfx_init_vic_bitmap] 30,003: zp[1]:96 [ gfx_init_vic_bitmap::l#2 g
Uplift Scope [get_vic_screen] 14,405.4: zp[1]:20 [ get_vic_screen::idx#2 get_vic_screen::idx#0 get_vic_screen::idx#1 ] 2,002: zp[2]:208 [ get_vic_screen::return#10 ] 2,002: zp[2]:227 [ get_vic_screen::return#11 ] 500.5: zp[2]:21 [ get_vic_screen::return#5 ]
Uplift Scope [get_plane] 14,148: zp[1]:25 [ get_plane::idx#10 get_plane::idx#1 get_plane::idx#0 ] 2,002: zp[4]:160 [ get_plane::return#16 ] 2,002: zp[4]:185 [ get_plane::return#17 ] 500.5: zp[4]:26 [ get_plane::return#14 ]
Uplift Scope [get_vic_charset] 10,501.5: zp[1]:216 [ get_vic_charset::idx#0 ] 2,002: zp[2]:217 [ get_vic_charset::return#4 ] 333.67: zp[2]:23 [ get_vic_charset::return#2 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [RADIX]
Uplift Scope [print_ln]
Uplift Scope [print_cls]
@ -19756,6 +19792,7 @@ Uplifting [gfx_init_vic_bitmap] best 15320867 combination zp[1]:96 [ gfx_init_vi
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 [RADIX] best 15320789 combination
Uplifting [print_ln] best 15320789 combination
Uplifting [print_cls] best 15320789 combination
@ -20208,18 +20245,10 @@ ASSEMBLER BEFORE OPTIMIZATION
.label VIC_MEMORY = $d018
// Color Ram
.label COLS = $d800
// CIA#1 Port A: keyboard matrix columns and joystick #2
.label CIA1_PORT_A = $dc00
// CIA#1 Port B: keyboard matrix rows and joystick #1.
.label CIA1_PORT_B = $dc01
// CIA #1 Port A data direction register.
.label CIA1_PORT_A_DDR = $dc02
// CIA #1 Port B data direction register.
.label CIA1_PORT_B_DDR = $dc03
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// Feature enables or disables the extra C64 DTV features
.label DTV_FEATURE = $d03f
.const DTV_FEATURE_ENABLE = 1
@ -20339,6 +20368,9 @@ ASSEMBLER BEFORE OPTIMIZATION
.label form_vic_bg3_lo = form_fields_val+$23
// The number of frames to use for a full blink cycle
.const FORM_CURSOR_BLINK = $28
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR = 3
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
// Number of form fields
.const form_fields_cnt = $24
.label print_line_cursor = 7
@ -20787,14 +20819,14 @@ gfx_mode: {
// [89] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_PLANEB_MODULO_HI
// [90] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// [90] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// [91] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(word) $4000 -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [91] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(word) $4000 -- _deref_pbuc1=vbuc2
// Set VIC Bank bits to output - all others to input
lda #3^VIC_SCREEN0/$4000
sta CIA2_PORT_A
sta CIA2
// [92] (byte) get_vic_screen::idx#0 ← *((const nomodify byte*) form_vic_screen) -- vbuaa=_deref_pbuc1
lda form_vic_screen
// [93] call get_vic_screen
@ -21406,11 +21438,11 @@ keyboard_event_pressed: {
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(X) rowid)
keyboard_matrix_read: {
// [217] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0) -- _deref_pbuc1=pbuc2_derefidx_vbuxx
// [217] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0) -- _deref_pbuc1=pbuc2_derefidx_vbuxx
lda keyboard_matrix_row_bitmask,x
sta CIA1_PORT_A
// [218] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B) -- vbuaa=_bnot__deref_pbuc1
lda CIA1_PORT_B
sta CIA1
// [218] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) -- vbuaa=_bnot__deref_pbuc1
lda CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B
eor #$ff
jmp __breturn
// keyboard_matrix_read::@return
@ -21932,14 +21964,14 @@ form_mode: {
// [272] *((const nomodify byte*) DTV_COLOR_BANK_HI) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_COLOR_BANK_HI
// [273] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// [273] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// [274] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3 -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [274] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3 -- _deref_pbuc1=vbuc2
// Set VIC Bank bits to output - all others to input
lda #3
sta CIA2_PORT_A
sta CIA2
// [275] *((const nomodify byte*) DTV_CONTROL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Set VIC Bank
// DTV Graphics Mode
@ -25404,14 +25436,14 @@ gfx_init_screen0: {
// keyboard_init
// Initialize keyboard reading by setting CIA#$ Data Direction Registers
keyboard_init: {
// [863] *((const nomodify byte*) CIA1_PORT_A_DDR) ← (byte) $ff -- _deref_pbuc1=vbuc2
// [863] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) $ff -- _deref_pbuc1=vbuc2
// Keyboard Matrix Columns Write Mode
lda #$ff
sta CIA1_PORT_A_DDR
// [864] *((const nomodify byte*) CIA1_PORT_B_DDR) ← (byte) 0 -- _deref_pbuc1=vbuc2
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [864] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Keyboard Matrix Columns Read Mode
lda #0
sta CIA1_PORT_B_DDR
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR
jmp __breturn
// keyboard_init::@return
__breturn:
@ -26547,15 +26579,15 @@ Removing unreachable instruction jmp __b9
Removing unreachable instruction jmp __b14
Removing unreachable instruction jmp __b7
Succesful ASM optimization Pass5UnreachableCodeElimination
Fixing long branch [747] beq __b7 to bne
Fixing long branch [751] beq __b8 to bne
Fixing long branch [755] beq __b9 to bne
Fixing long branch [759] beq __b10 to bne
Fixing long branch [763] beq __b11 to bne
Fixing long branch [767] beq __b12 to bne
Fixing long branch [771] beq __b13 to bne
Fixing long branch [775] beq __b14 to bne
Fixing long branch [1350] bmi __b2 to bpl
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
FINAL SYMBOL TABLE
(label) @1
@ -26568,12 +26600,8 @@ FINAL SYMBOL TABLE
(const nomodify byte*) BGCOL4 = (byte*) 53284
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CHARGEN = (byte*) 53248
(const nomodify byte*) CIA1_PORT_A = (byte*) 56320
(const nomodify byte*) CIA1_PORT_A_DDR = (byte*) 56322
(const nomodify byte*) CIA1_PORT_B = (byte*) 56321
(const nomodify byte*) CIA1_PORT_B_DDR = (byte*) 56323
(const nomodify byte*) CIA2_PORT_A = (byte*) 56576
(const nomodify byte*) CIA2_PORT_A_DDR = (byte*) 56578
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify byte*) COLS = (byte*) 55296
(const nomodify byte) DTV_BORDER_OFF = (byte) 2
(const nomodify byte) DTV_CHUNKY = (byte) $40
@ -26619,6 +26647,23 @@ FINAL SYMBOL TABLE
(const nomodify byte) KEY_MODIFIER_SHIFT = (const nomodify byte) KEY_MODIFIER_LSHIFT|(const nomodify byte) KEY_MODIFIER_RSHIFT
(const nomodify byte) KEY_RSHIFT = (byte) $34
(const nomodify byte) KEY_SPACE = (byte) $3c
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = (byte) 2
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B = (byte) 1
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR = (byte) 3
(const nomodify dword) PLANE_8BPP_CHUNKY = (dword) $20000
(const nomodify dword) PLANE_BLANK = (dword) $38000
(const nomodify dword) PLANE_CHARSET8 = (dword) $3c000
@ -27999,18 +28044,10 @@ Score: 10118916
.label VIC_MEMORY = $d018
// Color Ram
.label COLS = $d800
// CIA#1 Port A: keyboard matrix columns and joystick #2
.label CIA1_PORT_A = $dc00
// CIA#1 Port B: keyboard matrix rows and joystick #1.
.label CIA1_PORT_B = $dc01
// CIA #1 Port A data direction register.
.label CIA1_PORT_A_DDR = $dc02
// CIA #1 Port B data direction register.
.label CIA1_PORT_B_DDR = $dc03
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// Feature enables or disables the extra C64 DTV features
.label DTV_FEATURE = $d03f
.const DTV_FEATURE_ENABLE = 1
@ -28130,6 +28167,9 @@ Score: 10118916
.label form_vic_bg3_lo = form_fields_val+$23
// The number of frames to use for a full blink cycle
.const FORM_CURSOR_BLINK = $28
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR = 3
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
// Number of form fields
.const form_fields_cnt = $24
.label print_line_cursor = 7
@ -28570,16 +28610,16 @@ gfx_mode: {
// [89] *((const nomodify byte*) DTV_PLANEB_MODULO_HI) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_PLANEB_MODULO_HI
// *CIA2_PORT_A_DDR = %00000011
// [90] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// CIA2->PORT_A_DDR = %00000011
// [90] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = %00000011 ^ (byte)((word)VIC_SCREEN0/$4000)
// [91] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(word) $4000 -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = %00000011 ^ (byte)((word)VIC_SCREEN0/$4000)
// [91] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) VIC_SCREEN0/(word) $4000 -- _deref_pbuc1=vbuc2
// Set VIC Bank bits to output - all others to input
lda #3^VIC_SCREEN0/$4000
sta CIA2_PORT_A
sta CIA2
// get_vic_screen(*form_vic_screen)
// [92] (byte) get_vic_screen::idx#0 ← *((const nomodify byte*) form_vic_screen) -- vbuaa=_deref_pbuc1
lda form_vic_screen
@ -29165,13 +29205,13 @@ keyboard_event_pressed: {
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(X) rowid)
keyboard_matrix_read: {
// *CIA1_PORT_A = keyboard_matrix_row_bitmask[rowid]
// [217] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0) -- _deref_pbuc1=pbuc2_derefidx_vbuxx
// CIA1->PORT_A = keyboard_matrix_row_bitmask[rowid]
// [217] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0) -- _deref_pbuc1=pbuc2_derefidx_vbuxx
lda keyboard_matrix_row_bitmask,x
sta CIA1_PORT_A
// ~*CIA1_PORT_B
// [218] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B) -- vbuaa=_bnot__deref_pbuc1
lda CIA1_PORT_B
sta CIA1
// ~CIA1->PORT_B
// [218] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) -- vbuaa=_bnot__deref_pbuc1
lda CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B
eor #$ff
// keyboard_matrix_read::@return
// }
@ -29656,15 +29696,15 @@ form_mode: {
// [272] *((const nomodify byte*) DTV_COLOR_BANK_HI) ← (byte) 0 -- _deref_pbuc1=vbuc2
lda #0
sta DTV_COLOR_BANK_HI
// *CIA2_PORT_A_DDR = %00000011
// [273] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// CIA2->PORT_A_DDR = %00000011
// [273] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = %00000011 ^ (byte)((word)FORM_CHARSET/$4000)
// [274] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3 -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = %00000011 ^ (byte)((word)FORM_CHARSET/$4000)
// [274] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3 -- _deref_pbuc1=vbuc2
// Set VIC Bank bits to output - all others to input
sta CIA2_PORT_A
sta CIA2
// *DTV_CONTROL = 0
// [275] *((const nomodify byte*) DTV_CONTROL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Set VIC Bank
@ -32875,16 +32915,16 @@ gfx_init_screen0: {
// keyboard_init
// Initialize keyboard reading by setting CIA#$ Data Direction Registers
keyboard_init: {
// *CIA1_PORT_A_DDR = $ff
// [863] *((const nomodify byte*) CIA1_PORT_A_DDR) ← (byte) $ff -- _deref_pbuc1=vbuc2
// CIA1->PORT_A_DDR = $ff
// [863] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) $ff -- _deref_pbuc1=vbuc2
// Keyboard Matrix Columns Write Mode
lda #$ff
sta CIA1_PORT_A_DDR
// *CIA1_PORT_B_DDR = $00
// [864] *((const nomodify byte*) CIA1_PORT_B_DDR) ← (byte) 0 -- _deref_pbuc1=vbuc2
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA1->PORT_B_DDR = $00
// [864] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Keyboard Matrix Columns Read Mode
lda #0
sta CIA1_PORT_B_DDR
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR
// keyboard_init::@return
// }
// [865] return

View File

@ -8,12 +8,8 @@
(const nomodify byte*) BGCOL4 = (byte*) 53284
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CHARGEN = (byte*) 53248
(const nomodify byte*) CIA1_PORT_A = (byte*) 56320
(const nomodify byte*) CIA1_PORT_A_DDR = (byte*) 56322
(const nomodify byte*) CIA1_PORT_B = (byte*) 56321
(const nomodify byte*) CIA1_PORT_B_DDR = (byte*) 56323
(const nomodify byte*) CIA2_PORT_A = (byte*) 56576
(const nomodify byte*) CIA2_PORT_A_DDR = (byte*) 56578
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify byte*) COLS = (byte*) 55296
(const nomodify byte) DTV_BORDER_OFF = (byte) 2
(const nomodify byte) DTV_CHUNKY = (byte) $40
@ -59,6 +55,23 @@
(const nomodify byte) KEY_MODIFIER_SHIFT = (const nomodify byte) KEY_MODIFIER_LSHIFT|(const nomodify byte) KEY_MODIFIER_RSHIFT
(const nomodify byte) KEY_RSHIFT = (byte) $34
(const nomodify byte) KEY_SPACE = (byte) $3c
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = (byte) 2
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B = (byte) 1
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR = (byte) 3
(const nomodify dword) PLANE_8BPP_CHUNKY = (dword) $20000
(const nomodify dword) PLANE_BLANK = (dword) $38000
(const nomodify dword) PLANE_CHARSET8 = (dword) $3c000

View File

@ -30,14 +30,10 @@
.label VIC_MEMORY = $d018
// Color Ram
.label COLS = $d800
// CIA#1 Port A: keyboard matrix columns and joystick #2
.label CIA1_PORT_A = $dc00
// CIA#1 Port B: keyboard matrix rows and joystick #1.
.label CIA1_PORT_B = $dc01
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// The colors of the C64
.const BLACK = 0
.const GREEN = 5
@ -96,6 +92,8 @@
.const KEY_1 = $38
.const KEY_2 = $3b
.const KEY_SPACE = $3c
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
.label print_char_cursor = 6
.label print_line_cursor = 8
main: {
@ -137,14 +135,14 @@ menu: {
// *DTV_CONTROL = 0
// DTV Graphics Mode
sta DTV_CONTROL
// *CIA2_PORT_A_DDR = %00000011
// CIA2->PORT_A_DDR = %00000011
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000)
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000)
// Set VIC Bank bits to output - all others to input
lda #3^CHARSET/$4000
sta CIA2_PORT_A
sta CIA2
// *VIC_CONTROL = VIC_DEN|VIC_RSEL|3
// Set VIC Bank
// VIC Graphics Mode
@ -625,11 +623,11 @@ keyboard_key_pressed: {
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
// keyboard_matrix_read(byte register(Y) rowid)
keyboard_matrix_read: {
// *CIA1_PORT_A = keyboard_matrix_row_bitmask[rowid]
// CIA1->PORT_A = keyboard_matrix_row_bitmask[rowid]
lda keyboard_matrix_row_bitmask,y
sta CIA1_PORT_A
// ~*CIA1_PORT_B
lda CIA1_PORT_B
sta CIA1
// ~CIA1->PORT_B
lda CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B
eor #$ff
// }
rts
@ -1478,14 +1476,14 @@ mode_hicolmcchar: {
// *DTV_CONTROL = DTV_HIGHCOLOR
lda #DTV_HIGHCOLOR
sta DTV_CONTROL
// *CIA2_PORT_A_DDR = %00000011
// CIA2->PORT_A_DDR = %00000011
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000)
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000)
// Set VIC Bank bits to output - all others to input
lda #3^CHARSET/$4000
sta CIA2_PORT_A
sta CIA2
// *VIC_CONTROL = VIC_DEN|VIC_RSEL|3
// Set VIC Bank
// VIC Graphics Mode
@ -1615,14 +1613,14 @@ mode_hicolecmchar: {
// *DTV_CONTROL = DTV_HIGHCOLOR
lda #DTV_HIGHCOLOR
sta DTV_CONTROL
// *CIA2_PORT_A_DDR = %00000011
// CIA2->PORT_A_DDR = %00000011
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000)
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000)
// Set VIC Bank bits to output - all others to input
lda #3^CHARSET/$4000
sta CIA2_PORT_A
sta CIA2
// *VIC_CONTROL = VIC_DEN|VIC_RSEL|VIC_ECM|3
// Set VIC Bank
// VIC Graphics Mode
@ -1751,14 +1749,14 @@ mode_hicolstdchar: {
// *DTV_CONTROL = DTV_HIGHCOLOR
lda #DTV_HIGHCOLOR
sta DTV_CONTROL
// *CIA2_PORT_A_DDR = %00000011
// CIA2->PORT_A_DDR = %00000011
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000)
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000)
// Set VIC Bank bits to output - all others to input
lda #3^CHARSET/$4000
sta CIA2_PORT_A
sta CIA2
// *VIC_CONTROL = VIC_DEN|VIC_RSEL|3
// Set VIC Bank
// VIC Graphics Mode
@ -1868,14 +1866,14 @@ mode_stdbitmap: {
sta DTV_GRAPHICS_VIC_BANK
// *DTV_CONTROL = 0
sta DTV_CONTROL
// *CIA2_PORT_A_DDR = %00000011
// CIA2->PORT_A_DDR = %00000011
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = %00000011 ^ (byte)((word)BITMAP/$4000)
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = %00000011 ^ (byte)((word)BITMAP/$4000)
// Set VIC Bank bits to output - all others to input
lda #3^BITMAP/$4000
sta CIA2_PORT_A
sta CIA2
// *VIC_CONTROL = VIC_BMM|VIC_DEN|VIC_RSEL|3
// Set VIC Bank
// VIC Graphics Mode
@ -2462,14 +2460,14 @@ mode_mcchar: {
sta DTV_COLOR_BANK_HI
// *DTV_CONTROL = 0
sta DTV_CONTROL
// *CIA2_PORT_A_DDR = %00000011
// CIA2->PORT_A_DDR = %00000011
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000)
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000)
// Set VIC Bank bits to output - all others to input
lda #3^CHARSET/$4000
sta CIA2_PORT_A
sta CIA2
// *VIC_CONTROL = VIC_DEN|VIC_RSEL|3
// Set VIC Bank
// VIC Graphics Mode
@ -2604,14 +2602,14 @@ mode_ecmchar: {
sta DTV_COLOR_BANK_HI
// *DTV_CONTROL = 0
sta DTV_CONTROL
// *CIA2_PORT_A_DDR = %00000011
// CIA2->PORT_A_DDR = %00000011
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000)
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000)
// Set VIC Bank bits to output - all others to input
lda #3^CHARSET/$4000
sta CIA2_PORT_A
sta CIA2
// *VIC_CONTROL = VIC_DEN|VIC_RSEL|VIC_ECM|3
// Set VIC Bank
// VIC Graphics Mode
@ -2744,14 +2742,14 @@ mode_stdchar: {
sta DTV_COLOR_BANK_HI
// *DTV_CONTROL = 0
sta DTV_CONTROL
// *CIA2_PORT_A_DDR = %00000011
// CIA2->PORT_A_DDR = %00000011
// VIC Graphics Bank
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000)
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = %00000011 ^ (byte)((word)CHARSET/$4000)
// Set VIC Bank bits to output - all others to input
lda #3^CHARSET/$4000
sta CIA2_PORT_A
sta CIA2
// *VIC_CONTROL = VIC_DEN|VIC_RSEL|3
// Set VIC Bank
// VIC Graphics Mode

View File

@ -26,8 +26,8 @@ menu: scope:[menu] from main::@1
[11] *((const nomodify byte*) DTV_COLOR_BANK_LO) ← <(word)(const nomodify dword) DTV_COLOR_BANK_DEFAULT/(word) $400
[12] *((const nomodify byte*) DTV_COLOR_BANK_HI) ← (byte) 0
[13] *((const nomodify byte*) DTV_CONTROL) ← (byte) 0
[14] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[15] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) menu::CHARSET/(word) $4000
[14] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
[15] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) menu::CHARSET/(word) $4000
[16] *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3
[17] *((const nomodify byte*) VIC_CONTROL2) ← (const nomodify byte) VIC_CSEL
[18] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) menu::CHARSET&(word) $3fff/(word) $400
@ -421,8 +421,8 @@ keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_p
(byte()) keyboard_matrix_read((byte) keyboard_matrix_read::rowid)
keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_key_pressed
[220] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0)
[221] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B)
[220] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0)
[221] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B)
to:keyboard_matrix_read::@return
keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matrix_read
[222] return
@ -824,8 +824,8 @@ mode_hicolmcchar: scope:[mode_hicolmcchar] from menu::@23
[451] *((const nomodify byte*) DTV_COLOR_BANK_LO) ← <(word)(const nomodify byte*) mode_hicolmcchar::COLORS/(word) $400
[452] *((const nomodify byte*) DTV_COLOR_BANK_HI) ← (byte) 0
[453] *((const nomodify byte*) DTV_CONTROL) ← (const nomodify byte) DTV_HIGHCOLOR
[454] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[455] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) mode_hicolmcchar::CHARSET/(word) $4000
[454] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
[455] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) mode_hicolmcchar::CHARSET/(word) $4000
[456] *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3
[457] *((const nomodify byte*) VIC_CONTROL2) ← (const nomodify byte) VIC_CSEL|(const nomodify byte) VIC_MCM
[458] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) mode_hicolmcchar::CHARSET&(word) $3fff/(word) $400
@ -880,8 +880,8 @@ mode_hicolecmchar: scope:[mode_hicolecmchar] from menu::@22
[485] *((const nomodify byte*) DTV_COLOR_BANK_LO) ← <(word)(const nomodify byte*) mode_hicolecmchar::COLORS/(word) $400
[486] *((const nomodify byte*) DTV_COLOR_BANK_HI) ← (byte) 0
[487] *((const nomodify byte*) DTV_CONTROL) ← (const nomodify byte) DTV_HIGHCOLOR
[488] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[489] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) mode_hicolecmchar::CHARSET/(word) $4000
[488] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
[489] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) mode_hicolecmchar::CHARSET/(word) $4000
[490] *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(const nomodify byte) VIC_ECM|(byte) 3
[491] *((const nomodify byte*) VIC_CONTROL2) ← (const nomodify byte) VIC_CSEL
[492] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) mode_hicolecmchar::CHARSET&(word) $3fff/(word) $400
@ -937,8 +937,8 @@ mode_hicolstdchar: scope:[mode_hicolstdchar] from menu::@21
[520] *((const nomodify byte*) DTV_COLOR_BANK_LO) ← <(word)(const nomodify byte*) mode_hicolstdchar::COLORS/(word) $400
[521] *((const nomodify byte*) DTV_COLOR_BANK_HI) ← (byte) 0
[522] *((const nomodify byte*) DTV_CONTROL) ← (const nomodify byte) DTV_HIGHCOLOR
[523] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[524] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) mode_hicolstdchar::CHARSET/(word) $4000
[523] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
[524] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) mode_hicolstdchar::CHARSET/(word) $4000
[525] *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3
[526] *((const nomodify byte*) VIC_CONTROL2) ← (const nomodify byte) VIC_CSEL
[527] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) mode_hicolstdchar::CHARSET&(word) $3fff/(word) $400
@ -989,8 +989,8 @@ mode_hicolstdchar::@return: scope:[mode_hicolstdchar] from mode_hicolstdchar::@
mode_stdbitmap: scope:[mode_stdbitmap] from menu::@20
[551] *((const nomodify byte*) DTV_GRAPHICS_VIC_BANK) ← (byte) 0
[552] *((const nomodify byte*) DTV_CONTROL) ← (byte) 0
[553] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[554] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) mode_stdbitmap::BITMAP/(word) $4000
[553] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
[554] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) mode_stdbitmap::BITMAP/(word) $4000
[555] *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_BMM|(const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3
[556] *((const nomodify byte*) VIC_CONTROL2) ← (const nomodify byte) VIC_CSEL
[557] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) mode_stdbitmap::BITMAP&(word) $3fff/(word) $400
@ -1386,8 +1386,8 @@ mode_mcchar: scope:[mode_mcchar] from menu::@19
[758] *((const nomodify byte*) DTV_COLOR_BANK_LO) ← <(word)(const nomodify dword) DTV_COLOR_BANK_DEFAULT/(word) $400
[759] *((const nomodify byte*) DTV_COLOR_BANK_HI) ← (byte) 0
[760] *((const nomodify byte*) DTV_CONTROL) ← (byte) 0
[761] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[762] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) mode_mcchar::CHARSET/(word) $4000
[761] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
[762] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) mode_mcchar::CHARSET/(word) $4000
[763] *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3
[764] *((const nomodify byte*) VIC_CONTROL2) ← (const nomodify byte) VIC_CSEL|(const nomodify byte) VIC_MCM
[765] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) mode_mcchar::CHARSET&(word) $3fff/(word) $400
@ -1444,8 +1444,8 @@ mode_ecmchar: scope:[mode_ecmchar] from menu::@18
[794] *((const nomodify byte*) DTV_COLOR_BANK_LO) ← <(word)(const nomodify dword) DTV_COLOR_BANK_DEFAULT/(word) $400
[795] *((const nomodify byte*) DTV_COLOR_BANK_HI) ← (byte) 0
[796] *((const nomodify byte*) DTV_CONTROL) ← (byte) 0
[797] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[798] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) mode_ecmchar::CHARSET/(word) $4000
[797] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
[798] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) mode_ecmchar::CHARSET/(word) $4000
[799] *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(const nomodify byte) VIC_ECM|(byte) 3
[800] *((const nomodify byte*) VIC_CONTROL2) ← (const nomodify byte) VIC_CSEL
[801] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) mode_ecmchar::CHARSET&(word) $3fff/(word) $400
@ -1503,8 +1503,8 @@ mode_stdchar: scope:[mode_stdchar] from menu::@17
[831] *((const nomodify byte*) DTV_COLOR_BANK_LO) ← <(word)(const nomodify dword) DTV_COLOR_BANK_DEFAULT/(word) $400
[832] *((const nomodify byte*) DTV_COLOR_BANK_HI) ← (byte) 0
[833] *((const nomodify byte*) DTV_CONTROL) ← (byte) 0
[834] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[835] *((const nomodify byte*) CIA2_PORT_A) ← (byte) 3^(byte)(word)(const nomodify byte*) mode_stdchar::CHARSET/(word) $4000
[834] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
[835] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (byte) 3^(byte)(word)(const nomodify byte*) mode_stdchar::CHARSET/(word) $4000
[836] *((const nomodify byte*) VIC_CONTROL) ← (const nomodify byte) VIC_DEN|(const nomodify byte) VIC_RSEL|(byte) 3
[837] *((const nomodify byte*) VIC_CONTROL2) ← (const nomodify byte) VIC_CSEL
[838] *((const nomodify byte*) VIC_MEMORY) ← (byte)(word)(const nomodify byte*) mode_stdchar::CHARSET&(word) $3fff/(word) $400

File diff suppressed because one or more lines are too long

View File

@ -9,10 +9,8 @@
(const nomodify byte) BLACK = (byte) 0
(const nomodify byte) BLUE = (byte) 6
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CIA1_PORT_A = (byte*) 56320
(const nomodify byte*) CIA1_PORT_B = (byte*) 56321
(const nomodify byte*) CIA2_PORT_A = (byte*) 56576
(const nomodify byte*) CIA2_PORT_A_DDR = (byte*) 56578
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify byte*) COLS = (byte*) 55296
(const nomodify byte) DTV_BORDER_OFF = (byte) 2
(const nomodify byte) DTV_CHUNKY = (byte) $40
@ -62,6 +60,22 @@
(const nomodify byte) KEY_U = (byte) $1e
(const nomodify byte) LIGHT_GREEN = (byte) $d
(const byte*) MENU_TEXT[] = (byte*) "C64DTV Graphics Modes CCLHBME@ OHIIMCC@ LUNCMMM@----------------------------------------@1. Standard Char (V) 0000000@2. Extended Color Char (V) 0000001@3. Multicolor Char (V) 0000010@4. Standard Bitmap (V) 0000100@5. Multicolor Bitmap (V) 0000110@6. High Color Standard Char (H) 0001000@7. High Extended Color Char (H) 0001001@8. High Multicolor Char (H) 0001010@9. High Multicolor Bitmap (H) 0001110@a. Sixs Fred 2 (D) 0010111@b. Two Plane Bitmap (D) 0011101@c. Sixs Fred (2 Plane MC BM) (D) 0011111@d. 8bpp Pixel Cell (D) 0111011@e. Chunky 8bpp Bitmap (D) 1111011@----------------------------------------@ (V) vicII (H) vicII+hicol (D) c64dtv@"
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = (byte) 2
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B = (byte) 1
(const nomodify byte*) PROCPORT = (byte*) 1
(const nomodify byte*) PROCPORT_DDR = (byte*) 0
(const nomodify byte) PROCPORT_DDR_MEMORY_MASK = (byte) 7

View File

@ -2,12 +2,8 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
// CIA #2 Timer A+B Value (32-bit)
.label CIA2_TIMER_AB = $dd04
// CIA #2 Timer A Control Register
.label CIA2_TIMER_A_CONTROL = $dd0e
// CIA #2 Timer B Control Register
.label CIA2_TIMER_B_CONTROL = $dd0f
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// Timer Control - Start/stop timer (0:stop, 1: start)
.const CIA_TIMER_CONTROL_START = 1
// Timer B Control - Timer counts (00:system cycles, 01: CNT pulses, 10: timer A underflow, 11: time A underflow while CNT is high)
@ -15,7 +11,11 @@
// Clock cycles used to start & read the cycle clock by calling clock_start() and clock() once. Can be subtracted when calculating the number of cycles used by a routine.
// To make precise cycle measurements interrupts and the display must be disabled so neither steals any cycles from the code.
.const CLOCKS_PER_INIT = $12
// CIA#2 timer A&B as one single 32-bit value
.label CIA2_TIMER_AB = $dd04
.label SCREEN = $400
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
main: {
.label __1 = 9
.label cyclecount = 9
@ -168,13 +168,13 @@ clock: {
// Reset & start the processor clock time. The value can be read using clock().
// This uses CIA #2 Timer A+B on the C64
clock_start: {
// *CIA2_TIMER_A_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
// CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
// Setup CIA#2 timer A to count (down) CPU cycles
lda #0
sta CIA2_TIMER_A_CONTROL
// *CIA2_TIMER_B_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
// CIA2->TIMER_B_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
lda #CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// *CIA2_TIMER_AB = 0xffffffff
lda #<$ffffffff
sta CIA2_TIMER_AB
@ -184,12 +184,12 @@ clock_start: {
sta CIA2_TIMER_AB+2
lda #>$ffffffff>>$10
sta CIA2_TIMER_AB+3
// *CIA2_TIMER_B_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
// CIA2->TIMER_B_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
lda #CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
// *CIA2_TIMER_A_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
lda #CIA_TIMER_CONTROL_START
sta CIA2_TIMER_A_CONTROL
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
// }
rts
}

View File

@ -97,11 +97,11 @@ clock::@return: scope:[clock] from clock
(void()) clock_start()
clock_start: scope:[clock_start] from main::@1
[42] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (byte) 0
[43] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
[42] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (byte) 0
[43] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
[44] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff
[45] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
[46] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START
[45] *((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
[46] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START
to:clock_start::@return
clock_start::@return: scope:[clock_start] from clock_start
[47] return

View File

@ -1,3 +1,9 @@
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).TIMER_A_CONTROL with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).TIMER_B_CONTROL with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).TIMER_B_CONTROL with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).TIMER_A_CONTROL with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA
@ -17,11 +23,11 @@ clock::@return: scope:[clock] from clock
(void()) clock_start()
clock_start: scope:[clock_start] from main::@2
*((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
*((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
*((const nomodify dword*) CIA2_TIMER_AB) ← (number) $ffffffff
*((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
*((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
*((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_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
to:clock_start::@return
clock_start::@return: scope:[clock_start] from clock_start
return
@ -149,15 +155,30 @@ SYMBOL TABLE SSA
(label) @2
(label) @begin
(label) @end
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*)(number) $dd00
(const nomodify dword*) CIA2_TIMER_AB = (dword*)(number) $dd04
(const nomodify byte*) CIA2_TIMER_A_CONTROL = (byte*)(number) $dd0e
(const nomodify byte*) CIA2_TIMER_B_CONTROL = (byte*)(number) $dd0f
(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES = (byte) 0
(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = (byte) $40
(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS = (byte) 0
(const nomodify byte) CIA_TIMER_CONTROL_START = (byte) 1
(const nomodify byte) CIA_TIMER_CONTROL_STOP = (byte) 0
(const nomodify dword) CLOCKS_PER_INIT = (dword) $12
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = (byte) $e
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = (byte) $f
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10
@ -258,9 +279,8 @@ Adding number conversion cast (unumber) 1 in (byte*~) print_uchar_at::$3 ← (by
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast *((const nomodify dword*) CIA2_TIMER_AB) ← (unumber)(number) $ffffffff
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (struct MOS6526_CIA*) 56576
Simplifying constant pointer cast (dword*) 56580
Simplifying constant pointer cast (byte*) 56590
Simplifying constant pointer cast (byte*) 56591
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $ffffffff
Simplifying constant integer cast $ffffffff
@ -306,14 +326,14 @@ Constant (const byte*) print_uint_at::at#0 = print_ulong_at::at#0
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [37] if(true) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Simplifying constant evaluating to zero (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES in [2] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
Simplifying constant evaluating to zero (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS in [3] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
Simplifying constant evaluating to zero (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES in [2] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
Simplifying constant evaluating to zero (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS in [3] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A in [3] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (byte) 0|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
Simplifying expression containing zero CIA_TIMER_CONTROL_START in [5] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
Simplifying expression containing zero CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_CONTINUOUS in [6] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
Simplifying expression containing zero CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A in [3] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (byte) 0|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
Simplifying expression containing zero CIA_TIMER_CONTROL_START in [5] *((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_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
Simplifying expression containing zero CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_CONTINUOUS in [6] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
Successful SSA optimization PassNSimplifyExpressionWithZero
Simplifying expression containing zero CIA_TIMER_CONTROL_START in [6] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS
Simplifying expression containing zero CIA_TIMER_CONTROL_START in [6] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const nomodify byte) CIA_TIMER_CONTROL_STOP
Eliminating unused constant (const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS
@ -476,11 +496,11 @@ clock::@return: scope:[clock] from clock
(void()) clock_start()
clock_start: scope:[clock_start] from main::@1
[42] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (byte) 0
[43] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
[42] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (byte) 0
[43] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
[44] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff
[45] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
[46] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START
[45] *((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
[46] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START
to:clock_start::@return
clock_start::@return: scope:[clock_start] from clock_start
[47] return
@ -488,6 +508,20 @@ clock_start::@return: scope:[clock_start] from clock_start
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
(dword()) clock()
(dword) clock::return
(dword) clock::return#0 367.33333333333337
@ -580,12 +614,8 @@ Target platform is c64basic / MOS6502X
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
// CIA #2 Timer A+B Value (32-bit)
.label CIA2_TIMER_AB = $dd04
// CIA #2 Timer A Control Register
.label CIA2_TIMER_A_CONTROL = $dd0e
// CIA #2 Timer B Control Register
.label CIA2_TIMER_B_CONTROL = $dd0f
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// Timer Control - Start/stop timer (0:stop, 1: start)
.const CIA_TIMER_CONTROL_START = 1
// Timer B Control - Timer counts (00:system cycles, 01: CNT pulses, 10: timer A underflow, 11: time A underflow while CNT is high)
@ -593,7 +623,11 @@ Target platform is c64basic / MOS6502X
// Clock cycles used to start & read the cycle clock by calling clock_start() and clock() once. Can be subtracted when calculating the number of cycles used by a routine.
// To make precise cycle measurements interrupts and the display must be disabled so neither steals any cycles from the code.
.const CLOCKS_PER_INIT = $12
// CIA#2 timer A&B as one single 32-bit value
.label CIA2_TIMER_AB = $dd04
.label SCREEN = $400
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -877,13 +911,13 @@ clock: {
// Reset & start the processor clock time. The value can be read using clock().
// This uses CIA #2 Timer A+B on the C64
clock_start: {
// [42] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// [42] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Setup CIA#2 timer A to count (down) CPU cycles
lda #0
sta CIA2_TIMER_A_CONTROL
// [43] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
// [43] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// [44] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff -- _deref_pduc1=vduc2
lda #<$ffffffff
sta CIA2_TIMER_AB
@ -893,12 +927,12 @@ clock_start: {
sta CIA2_TIMER_AB+2
lda #>$ffffffff>>$10
sta CIA2_TIMER_AB+3
// [45] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
// [45] *((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 -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
// [46] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// [46] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START
sta CIA2_TIMER_A_CONTROL
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
jmp __breturn
// clock_start::@return
__breturn:
@ -927,11 +961,11 @@ Removing always clobbered register reg byte a as potential for zp[1]:29 [ print_
Statement [38] *((byte*) print_char_at::at#2) ← (byte) print_char_at::ch#2 [ ] ( main:2::print_ulong_at:13::print_uint_at:15::print_uchar_at:22::print_char_at:31 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } } main:2::print_ulong_at:13::print_uint_at:17::print_uchar_at:22::print_char_at:31 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } } main:2::print_ulong_at:13::print_uint_at:15::print_uchar_at:25::print_char_at:31 [ print_ulong_at::dw#0 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } } main:2::print_ulong_at:13::print_uint_at:17::print_uchar_at:25::print_char_at:31 [ print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } } main:2::print_ulong_at:13::print_uint_at:15::print_uchar_at:22::print_char_at:35 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 ] { { print_ulong_at::dw#0 = main::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 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:13::print_uint_at:17::print_uchar_at:22::print_char_at:35 [ print_uint_at::w#2 print_uint_at::at#2 ] { { print_ulong_at::dw#0 = main::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 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:13::print_uint_at:15::print_uchar_at:25::print_char_at:35 [ print_ulong_at::dw#0 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:13::print_uint_at:17::print_uchar_at:25::print_char_at:35 [ ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte y as potential for zp[1]:6 [ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ]
Statement [40] (dword) clock::return#0 ← (dword) $ffffffff - *((const nomodify dword*) CIA2_TIMER_AB) [ clock::return#0 ] ( main:2::clock:8 [ clock::return#0 ] { { clock::return#0 = clock::return#2 } } ) always clobbers reg byte a
Statement [42] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (byte) 0 [ ] ( main:2::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [43] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [42] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (byte) 0 [ ] ( main:2::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [43] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [44] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff [ ] ( main:2::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [45] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [46] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START [ ] ( main:2::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [45] *((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::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [46] *((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::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [9] (dword) clock::return#2 ← (dword) clock::return#0 [ clock::return#2 ] ( main:2 [ clock::return#2 ] { { clock::return#0 = clock::return#2 } } ) always clobbers reg byte a
Statement [10] (dword~) main::$1 ← (dword) clock::return#2 [ main::$1 ] ( main:2 [ main::$1 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } } ) always clobbers reg byte a
Statement [11] (dword) main::cyclecount#0 ← (dword~) main::$1 - (const nomodify dword) CLOCKS_PER_INIT [ main::cyclecount#0 ] ( main:2 [ main::cyclecount#0 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } } ) always clobbers reg byte a
@ -946,11 +980,11 @@ Statement [32] (byte~) print_uchar_at::$2 ← (byte) print_uchar_at::b#2 & (byte
Statement [33] (byte*) print_char_at::at#1 ← (byte*) print_uchar_at::at#2 + (byte) 1 [ print_uchar_at::$2 print_char_at::at#1 ] ( main:2::print_ulong_at:13::print_uint_at:15::print_uchar_at:22 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::$2 print_char_at::at#1 ] { { print_ulong_at::dw#0 = main::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 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:13::print_uint_at:17::print_uchar_at:22 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::$2 print_char_at::at#1 ] { { print_ulong_at::dw#0 = main::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 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:13::print_uint_at:15::print_uchar_at:25 [ print_ulong_at::dw#0 print_uchar_at::$2 print_char_at::at#1 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:13::print_uint_at:17::print_uchar_at:25 [ print_uchar_at::$2 print_char_at::at#1 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } ) always clobbers reg byte a
Statement [38] *((byte*) print_char_at::at#2) ← (byte) print_char_at::ch#2 [ ] ( main:2::print_ulong_at:13::print_uint_at:15::print_uchar_at:22::print_char_at:31 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } } main:2::print_ulong_at:13::print_uint_at:17::print_uchar_at:22::print_char_at:31 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } } main:2::print_ulong_at:13::print_uint_at:15::print_uchar_at:25::print_char_at:31 [ print_ulong_at::dw#0 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } } main:2::print_ulong_at:13::print_uint_at:17::print_uchar_at:25::print_char_at:31 [ print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } } main:2::print_ulong_at:13::print_uint_at:15::print_uchar_at:22::print_char_at:35 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 ] { { print_ulong_at::dw#0 = main::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 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:13::print_uint_at:17::print_uchar_at:22::print_char_at:35 [ print_uint_at::w#2 print_uint_at::at#2 ] { { print_ulong_at::dw#0 = main::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 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:13::print_uint_at:15::print_uchar_at:25::print_char_at:35 [ print_ulong_at::dw#0 ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:13::print_uint_at:17::print_uchar_at:25::print_char_at:35 [ ] { { print_ulong_at::dw#0 = main::cyclecount#0 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } ) always clobbers reg byte a reg byte y
Statement [40] (dword) clock::return#0 ← (dword) $ffffffff - *((const nomodify dword*) CIA2_TIMER_AB) [ clock::return#0 ] ( main:2::clock:8 [ clock::return#0 ] { { clock::return#0 = clock::return#2 } } ) always clobbers reg byte a
Statement [42] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (byte) 0 [ ] ( main:2::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [43] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [42] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (byte) 0 [ ] ( main:2::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [43] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [44] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff [ ] ( main:2::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [45] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [46] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START [ ] ( main:2::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [45] *((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::clock_start:6 [ ] { } ) always clobbers reg byte a
Statement [46] *((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::clock_start:6 [ ] { } ) always clobbers reg byte a
Potential registers zp[2]:2 [ print_uint_at::w#2 print_uint_at::w#0 print_uint_at::w#1 ] : zp[2]:2 ,
Potential registers zp[2]:4 [ print_uint_at::at#2 ] : zp[2]:4 ,
Potential registers zp[1]:6 [ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ] : zp[1]:6 , reg byte x ,
@ -972,6 +1006,7 @@ Uplift Scope [print_uint_at] 9,505: zp[2]:2 [ print_uint_at::w#2 print_uint_at::
Uplift Scope [print_ulong_at] 701: zp[4]:24 [ print_ulong_at::dw#0 ]
Uplift Scope [clock] 367.33: zp[4]:30 [ clock::return#0 ] 202: zp[4]:12 [ clock::return#2 ]
Uplift Scope [main] 202: zp[4]:16 [ main::$1 ] 202: zp[4]:20 [ main::cyclecount#0 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [clock_start]
Uplift Scope [RADIX]
Uplift Scope []
@ -982,6 +1017,7 @@ Uplifting [print_uint_at] best 1731 combination zp[2]:2 [ print_uint_at::w#2 pri
Uplifting [print_ulong_at] best 1731 combination zp[4]:24 [ print_ulong_at::dw#0 ]
Uplifting [clock] best 1731 combination zp[4]:30 [ clock::return#0 ] zp[4]:12 [ clock::return#2 ]
Uplifting [main] best 1731 combination zp[4]:16 [ main::$1 ] zp[4]:20 [ main::cyclecount#0 ]
Uplifting [MOS6526_CIA] best 1731 combination
Uplifting [clock_start] best 1731 combination
Uplifting [RADIX] best 1731 combination
Uplifting [] best 1731 combination
@ -1003,12 +1039,8 @@ ASSEMBLER BEFORE OPTIMIZATION
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
// CIA #2 Timer A+B Value (32-bit)
.label CIA2_TIMER_AB = $dd04
// CIA #2 Timer A Control Register
.label CIA2_TIMER_A_CONTROL = $dd0e
// CIA #2 Timer B Control Register
.label CIA2_TIMER_B_CONTROL = $dd0f
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// Timer Control - Start/stop timer (0:stop, 1: start)
.const CIA_TIMER_CONTROL_START = 1
// Timer B Control - Timer counts (00:system cycles, 01: CNT pulses, 10: timer A underflow, 11: time A underflow while CNT is high)
@ -1016,7 +1048,11 @@ ASSEMBLER BEFORE OPTIMIZATION
// Clock cycles used to start & read the cycle clock by calling clock_start() and clock() once. Can be subtracted when calculating the number of cycles used by a routine.
// To make precise cycle measurements interrupts and the display must be disabled so neither steals any cycles from the code.
.const CLOCKS_PER_INIT = $12
// CIA#2 timer A&B as one single 32-bit value
.label CIA2_TIMER_AB = $dd04
.label SCREEN = $400
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -1264,13 +1300,13 @@ clock: {
// Reset & start the processor clock time. The value can be read using clock().
// This uses CIA #2 Timer A+B on the C64
clock_start: {
// [42] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// [42] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Setup CIA#2 timer A to count (down) CPU cycles
lda #0
sta CIA2_TIMER_A_CONTROL
// [43] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
// [43] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// [44] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff -- _deref_pduc1=vduc2
lda #<$ffffffff
sta CIA2_TIMER_AB
@ -1280,12 +1316,12 @@ clock_start: {
sta CIA2_TIMER_AB+2
lda #>$ffffffff>>$10
sta CIA2_TIMER_AB+3
// [45] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
// [45] *((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 -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
// [46] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// [46] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START
sta CIA2_TIMER_A_CONTROL
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
jmp __breturn
// clock_start::@return
__breturn:
@ -1348,12 +1384,27 @@ FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify dword*) CIA2_TIMER_AB = (dword*) 56580
(const nomodify byte*) CIA2_TIMER_A_CONTROL = (byte*) 56590
(const nomodify byte*) CIA2_TIMER_B_CONTROL = (byte*) 56591
(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = (byte) $40
(const nomodify byte) CIA_TIMER_CONTROL_START = (byte) 1
(const nomodify dword) CLOCKS_PER_INIT = (dword) $12
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = (byte) $e
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = (byte) $f
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10
@ -1433,12 +1484,8 @@ Score: 869
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// CIA #2 Timer A+B Value (32-bit)
.label CIA2_TIMER_AB = $dd04
// CIA #2 Timer A Control Register
.label CIA2_TIMER_A_CONTROL = $dd0e
// CIA #2 Timer B Control Register
.label CIA2_TIMER_B_CONTROL = $dd0f
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// Timer Control - Start/stop timer (0:stop, 1: start)
.const CIA_TIMER_CONTROL_START = 1
// Timer B Control - Timer counts (00:system cycles, 01: CNT pulses, 10: timer A underflow, 11: time A underflow while CNT is high)
@ -1446,7 +1493,11 @@ Score: 869
// Clock cycles used to start & read the cycle clock by calling clock_start() and clock() once. Can be subtracted when calculating the number of cycles used by a routine.
// To make precise cycle measurements interrupts and the display must be disabled so neither steals any cycles from the code.
.const CLOCKS_PER_INIT = $12
// CIA#2 timer A&B as one single 32-bit value
.label CIA2_TIMER_AB = $dd04
.label SCREEN = $400
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
// @begin
// [1] phi from @begin to @1 [phi:@begin->@1]
// @1
@ -1676,15 +1727,15 @@ clock: {
// Reset & start the processor clock time. The value can be read using clock().
// This uses CIA #2 Timer A+B on the C64
clock_start: {
// *CIA2_TIMER_A_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
// [42] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
// [42] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Setup CIA#2 timer A to count (down) CPU cycles
lda #0
sta CIA2_TIMER_A_CONTROL
// *CIA2_TIMER_B_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
// [43] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
// CIA2->TIMER_B_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
// [43] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// *CIA2_TIMER_AB = 0xffffffff
// [44] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff -- _deref_pduc1=vduc2
lda #<$ffffffff
@ -1695,14 +1746,14 @@ clock_start: {
sta CIA2_TIMER_AB+2
lda #>$ffffffff>>$10
sta CIA2_TIMER_AB+3
// *CIA2_TIMER_B_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
// [45] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
// CIA2->TIMER_B_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
// [45] *((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 -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
// *CIA2_TIMER_A_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
// [46] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
// [46] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START
sta CIA2_TIMER_A_CONTROL
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
// clock_start::@return
// }
// [47] return

View File

@ -1,12 +1,27 @@
(label) @1
(label) @begin
(label) @end
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify dword*) CIA2_TIMER_AB = (dword*) 56580
(const nomodify byte*) CIA2_TIMER_A_CONTROL = (byte*) 56590
(const nomodify byte*) CIA2_TIMER_B_CONTROL = (byte*) 56591
(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = (byte) $40
(const nomodify byte) CIA_TIMER_CONTROL_START = (byte) 1
(const nomodify dword) CLOCKS_PER_INIT = (dword) $12
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = (byte) $e
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = (byte) $f
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10

View File

@ -2,17 +2,17 @@
.pc = $801 "Basic"
:BasicUpstart(main)
.pc = $80d "Program"
// CIA #2 Timer A+B Value (32-bit)
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// CIA#2 timer A&B as one single 32-bit value
.label CIA2_TIMER_AB = $dd04
// CIA #2 Timer A Control Register
.label CIA2_TIMER_A_CONTROL = $dd0e
// CIA #2 Timer B Control Register
.label CIA2_TIMER_B_CONTROL = $dd0f
// Timer Control - Start/stop timer (0:stop, 1: start)
.const CIA_TIMER_CONTROL_START = 1
// Timer B Control - Timer counts (00:system cycles, 01: CNT pulses, 10: timer A underflow, 11: time A underflow while CNT is high)
.const CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = $40
.label SCREEN = $400
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
main: {
// clock_start()
// Reset & start the CIA#2 timer A+B
@ -146,13 +146,13 @@ clock: {
// Reset & start the processor clock time. The value can be read using clock().
// This uses CIA #2 Timer A+B on the C64
clock_start: {
// *CIA2_TIMER_A_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
// CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
// Setup CIA#2 timer A to count (down) CPU cycles
lda #0
sta CIA2_TIMER_A_CONTROL
// *CIA2_TIMER_B_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
// CIA2->TIMER_B_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
lda #CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// *CIA2_TIMER_AB = 0xffffffff
lda #<$ffffffff
sta CIA2_TIMER_AB
@ -162,12 +162,12 @@ clock_start: {
sta CIA2_TIMER_AB+2
lda #>$ffffffff>>$10
sta CIA2_TIMER_AB+3
// *CIA2_TIMER_B_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
// CIA2->TIMER_B_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
lda #CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
// *CIA2_TIMER_A_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
lda #CIA_TIMER_CONTROL_START
sta CIA2_TIMER_A_CONTROL
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
// }
rts
}

View File

@ -92,11 +92,11 @@ clock::@return: scope:[clock] from clock
(void()) clock_start()
clock_start: scope:[clock_start] from main
[39] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (byte) 0
[40] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
[39] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (byte) 0
[40] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
[41] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff
[42] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
[43] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START
[42] *((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
[43] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START
to:clock_start::@return
clock_start::@return: scope:[clock_start] from clock_start
[44] return

View File

@ -1,3 +1,9 @@
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).TIMER_A_CONTROL with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).TIMER_B_CONTROL with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).TIMER_B_CONTROL with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).TIMER_A_CONTROL with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA
@ -17,11 +23,11 @@ clock::@return: scope:[clock] from clock
(void()) clock_start()
clock_start: scope:[clock_start] from main
*((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
*((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
*((const nomodify dword*) CIA2_TIMER_AB) ← (number) $ffffffff
*((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
*((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
*((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_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
to:clock_start::@return
clock_start::@return: scope:[clock_start] from clock_start
return
@ -146,14 +152,29 @@ SYMBOL TABLE SSA
(label) @2
(label) @begin
(label) @end
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*)(number) $dd00
(const nomodify dword*) CIA2_TIMER_AB = (dword*)(number) $dd04
(const nomodify byte*) CIA2_TIMER_A_CONTROL = (byte*)(number) $dd0e
(const nomodify byte*) CIA2_TIMER_B_CONTROL = (byte*)(number) $dd0f
(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES = (byte) 0
(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = (byte) $40
(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS = (byte) 0
(const nomodify byte) CIA_TIMER_CONTROL_START = (byte) 1
(const nomodify byte) CIA_TIMER_CONTROL_STOP = (byte) 0
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = (byte) $e
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = (byte) $f
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10
@ -251,9 +272,8 @@ Adding number conversion cast (unumber) 1 in (byte*~) print_uchar_at::$3 ← (by
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast *((const nomodify dword*) CIA2_TIMER_AB) ← (unumber)(number) $ffffffff
Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (struct MOS6526_CIA*) 56576
Simplifying constant pointer cast (dword*) 56580
Simplifying constant pointer cast (byte*) 56590
Simplifying constant pointer cast (byte*) 56591
Simplifying constant pointer cast (byte*) 1024
Simplifying constant integer cast $ffffffff
Simplifying constant integer cast $ffffffff
@ -299,14 +319,14 @@ Constant (const byte*) print_uint_at::at#0 = print_ulong_at::at#0
Successful SSA optimization Pass2ConstantIdentification
if() condition always true - replacing block destination [38] if(true) goto main::@2
Successful SSA optimization Pass2ConstantIfs
Simplifying constant evaluating to zero (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES in [2] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
Simplifying constant evaluating to zero (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS in [3] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
Simplifying constant evaluating to zero (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES in [2] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
Simplifying constant evaluating to zero (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS in [3] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_STOP|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A in [3] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (byte) 0|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
Simplifying expression containing zero CIA_TIMER_CONTROL_START in [5] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
Simplifying expression containing zero CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_CONTINUOUS in [6] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
Simplifying expression containing zero CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A in [3] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (byte) 0|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
Simplifying expression containing zero CIA_TIMER_CONTROL_START in [5] *((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_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
Simplifying expression containing zero CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_CONTINUOUS in [6] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS|(const nomodify byte) CIA_TIMER_CONTROL_A_COUNT_CYCLES
Successful SSA optimization PassNSimplifyExpressionWithZero
Simplifying expression containing zero CIA_TIMER_CONTROL_START in [6] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS
Simplifying expression containing zero CIA_TIMER_CONTROL_START in [6] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS
Successful SSA optimization PassNSimplifyExpressionWithZero
Eliminating unused constant (const nomodify byte) CIA_TIMER_CONTROL_STOP
Eliminating unused constant (const nomodify byte) CIA_TIMER_CONTROL_CONTINUOUS
@ -465,11 +485,11 @@ clock::@return: scope:[clock] from clock
(void()) clock_start()
clock_start: scope:[clock_start] from main
[39] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (byte) 0
[40] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
[39] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (byte) 0
[40] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
[41] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff
[42] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
[43] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START
[42] *((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
[43] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START
to:clock_start::@return
clock_start::@return: scope:[clock_start] from clock_start
[44] return
@ -477,6 +497,20 @@ clock_start::@return: scope:[clock_start] from clock_start
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
(dword()) clock()
(dword) clock::return
(dword) clock::return#0 367.33333333333337
@ -560,17 +594,17 @@ Target platform is c64basic / MOS6502X
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
// CIA #2 Timer A+B Value (32-bit)
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// CIA#2 timer A&B as one single 32-bit value
.label CIA2_TIMER_AB = $dd04
// CIA #2 Timer A Control Register
.label CIA2_TIMER_A_CONTROL = $dd0e
// CIA #2 Timer B Control Register
.label CIA2_TIMER_B_CONTROL = $dd0f
// Timer Control - Start/stop timer (0:stop, 1: start)
.const CIA_TIMER_CONTROL_START = 1
// Timer B Control - Timer counts (00:system cycles, 01: CNT pulses, 10: timer A underflow, 11: time A underflow while CNT is high)
.const CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = $40
.label SCREEN = $400
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -823,13 +857,13 @@ clock: {
// Reset & start the processor clock time. The value can be read using clock().
// This uses CIA #2 Timer A+B on the C64
clock_start: {
// [39] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// [39] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Setup CIA#2 timer A to count (down) CPU cycles
lda #0
sta CIA2_TIMER_A_CONTROL
// [40] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
// [40] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// [41] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff -- _deref_pduc1=vduc2
lda #<$ffffffff
sta CIA2_TIMER_AB
@ -839,12 +873,12 @@ clock_start: {
sta CIA2_TIMER_AB+2
lda #>$ffffffff>>$10
sta CIA2_TIMER_AB+3
// [42] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
// [42] *((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 -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
// [43] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// [43] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START
sta CIA2_TIMER_A_CONTROL
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
jmp __breturn
// clock_start::@return
__breturn:
@ -871,11 +905,11 @@ Removing always clobbered register reg byte a as potential for zp[1]:21 [ print_
Statement [35] *((byte*) print_char_at::at#2) ← (byte) print_char_at::ch#2 [ ] ( main:2::print_ulong_at:10::print_uint_at:12::print_uchar_at:19::print_char_at:28 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } } main:2::print_ulong_at:10::print_uint_at:14::print_uchar_at:19::print_char_at:28 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } } main:2::print_ulong_at:10::print_uint_at:12::print_uchar_at:22::print_char_at:28 [ print_ulong_at::dw#0 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } } main:2::print_ulong_at:10::print_uint_at:14::print_uchar_at:22::print_char_at:28 [ print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } } main:2::print_ulong_at:10::print_uint_at:12::print_uchar_at:19::print_char_at:32 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { 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 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:10::print_uint_at:14::print_uchar_at:19::print_char_at:32 [ print_uint_at::w#2 print_uint_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { 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 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:10::print_uint_at:12::print_uchar_at:22::print_char_at:32 [ print_ulong_at::dw#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:10::print_uint_at:14::print_uchar_at:22::print_char_at:32 [ ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } ) always clobbers reg byte a reg byte y
Removing always clobbered register reg byte y as potential for zp[1]:6 [ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ]
Statement [37] (dword) clock::return#0 ← (dword) $ffffffff - *((const nomodify dword*) CIA2_TIMER_AB) [ clock::return#0 ] ( main:2::clock:7 [ clock::return#0 ] { { clock::return#0 = clock::return#2 } } ) always clobbers reg byte a
Statement [39] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (byte) 0 [ ] ( main:2::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [40] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [39] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (byte) 0 [ ] ( main:2::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [40] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [41] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff [ ] ( main:2::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [42] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [43] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START [ ] ( main:2::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [42] *((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::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [43] *((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::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [8] (dword) clock::return#2 ← (dword) clock::return#0 [ clock::return#2 ] ( main:2 [ clock::return#2 ] { { clock::return#0 = clock::return#2 } } ) always clobbers reg byte a
Statement [9] (dword) print_ulong_at::dw#0 ← (dword) clock::return#2 [ print_ulong_at::dw#0 ] ( main:2 [ print_ulong_at::dw#0 ] { { print_ulong_at::dw#0 = clock::return#2 } } ) always clobbers reg byte a
Statement [11] (word) print_uint_at::w#0 ← > (dword) print_ulong_at::dw#0 [ print_ulong_at::dw#0 print_uint_at::w#0 ] ( main:2::print_ulong_at:10 [ print_ulong_at::dw#0 print_uint_at::w#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } } ) always clobbers reg byte a
@ -888,11 +922,11 @@ Statement [29] (byte~) print_uchar_at::$2 ← (byte) print_uchar_at::b#2 & (byte
Statement [30] (byte*) print_char_at::at#1 ← (byte*) print_uchar_at::at#2 + (byte) 1 [ print_uchar_at::$2 print_char_at::at#1 ] ( main:2::print_ulong_at:10::print_uint_at:12::print_uchar_at:19 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::$2 print_char_at::at#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { 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 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:10::print_uint_at:14::print_uchar_at:19 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::$2 print_char_at::at#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { 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 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:10::print_uint_at:12::print_uchar_at:22 [ print_ulong_at::dw#0 print_uchar_at::$2 print_char_at::at#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:10::print_uint_at:14::print_uchar_at:22 [ print_uchar_at::$2 print_char_at::at#1 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } ) always clobbers reg byte a
Statement [35] *((byte*) print_char_at::at#2) ← (byte) print_char_at::ch#2 [ ] ( main:2::print_ulong_at:10::print_uint_at:12::print_uchar_at:19::print_char_at:28 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } } main:2::print_ulong_at:10::print_uint_at:14::print_uchar_at:19::print_char_at:28 [ print_uint_at::w#2 print_uint_at::at#2 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#0 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#0 print_uint_at::at#2 } } main:2::print_ulong_at:10::print_uint_at:12::print_uchar_at:22::print_char_at:28 [ print_ulong_at::dw#0 print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } } main:2::print_ulong_at:10::print_uint_at:14::print_uchar_at:22::print_char_at:28 [ print_uchar_at::b#2 print_uchar_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_char_at::ch#0 = print_char_at::ch#2 } { print_char_at::at#0 = print_char_at::at#2 print_uchar_at::at#2 print_uchar_at::at#1 } } main:2::print_ulong_at:10::print_uint_at:12::print_uchar_at:19::print_char_at:32 [ print_ulong_at::dw#0 print_uint_at::w#2 print_uint_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { 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 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:10::print_uint_at:14::print_uchar_at:19::print_char_at:32 [ print_uint_at::w#2 print_uint_at::at#2 ] { { print_ulong_at::dw#0 = clock::return#2 } { 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 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:10::print_uint_at:12::print_uchar_at:22::print_char_at:32 [ print_ulong_at::dw#0 ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#0 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } main:2::print_ulong_at:10::print_uint_at:14::print_uchar_at:22::print_char_at:32 [ ] { { print_ulong_at::dw#0 = clock::return#2 } { print_uint_at::w#1 = print_uint_at::w#2 } { print_uchar_at::b#1 = print_uchar_at::b#2 } { print_uchar_at::at#1 = print_uchar_at::at#2 } { print_char_at::ch#1 = print_char_at::ch#2 } { print_char_at::at#1 = print_char_at::at#2 } } ) always clobbers reg byte a reg byte y
Statement [37] (dword) clock::return#0 ← (dword) $ffffffff - *((const nomodify dword*) CIA2_TIMER_AB) [ clock::return#0 ] ( main:2::clock:7 [ clock::return#0 ] { { clock::return#0 = clock::return#2 } } ) always clobbers reg byte a
Statement [39] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (byte) 0 [ ] ( main:2::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [40] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [39] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (byte) 0 [ ] ( main:2::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [40] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [41] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff [ ] ( main:2::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [42] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A [ ] ( main:2::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [43] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START [ ] ( main:2::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [42] *((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::clock_start:5 [ ] { } ) always clobbers reg byte a
Statement [43] *((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::clock_start:5 [ ] { } ) always clobbers reg byte a
Potential registers zp[2]:2 [ print_uint_at::w#2 print_uint_at::w#0 print_uint_at::w#1 ] : zp[2]:2 ,
Potential registers zp[2]:4 [ print_uint_at::at#2 ] : zp[2]:4 ,
Potential registers zp[1]:6 [ print_uchar_at::b#2 print_uchar_at::b#0 print_uchar_at::b#1 ] : zp[1]:6 , reg byte x ,
@ -911,6 +945,7 @@ Uplift Scope [print_uchar_at] 200,002: zp[1]:20 [ print_uchar_at::$0 ] 100,001:
Uplift Scope [print_uint_at] 9,505: zp[2]:2 [ print_uint_at::w#2 print_uint_at::w#0 print_uint_at::w#1 ] 4,000.4: zp[2]:4 [ print_uint_at::at#2 ]
Uplift Scope [print_ulong_at] 701: zp[4]:16 [ print_ulong_at::dw#0 ]
Uplift Scope [clock] 367.33: zp[4]:22 [ clock::return#0 ] 202: zp[4]:12 [ clock::return#2 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [clock_start]
Uplift Scope [RADIX]
Uplift Scope [main]
@ -921,6 +956,7 @@ Uplifting [print_uchar_at] best 1047 combination reg byte a [ print_uchar_at::$0
Uplifting [print_uint_at] best 1047 combination zp[2]:2 [ print_uint_at::w#2 print_uint_at::w#0 print_uint_at::w#1 ] zp[2]:4 [ print_uint_at::at#2 ]
Uplifting [print_ulong_at] best 1047 combination zp[4]:16 [ print_ulong_at::dw#0 ]
Uplifting [clock] best 1047 combination zp[4]:22 [ clock::return#0 ] zp[4]:12 [ clock::return#2 ]
Uplifting [MOS6526_CIA] best 1047 combination
Uplifting [clock_start] best 1047 combination
Uplifting [RADIX] best 1047 combination
Uplifting [main] best 1047 combination
@ -941,17 +977,17 @@ ASSEMBLER BEFORE OPTIMIZATION
:BasicUpstart(__bbegin)
.pc = $80d "Program"
// Global Constants & labels
// CIA #2 Timer A+B Value (32-bit)
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// CIA#2 timer A&B as one single 32-bit value
.label CIA2_TIMER_AB = $dd04
// CIA #2 Timer A Control Register
.label CIA2_TIMER_A_CONTROL = $dd0e
// CIA #2 Timer B Control Register
.label CIA2_TIMER_B_CONTROL = $dd0f
// Timer Control - Start/stop timer (0:stop, 1: start)
.const CIA_TIMER_CONTROL_START = 1
// Timer B Control - Timer counts (00:system cycles, 01: CNT pulses, 10: timer A underflow, 11: time A underflow while CNT is high)
.const CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = $40
.label SCREEN = $400
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
// @begin
__bbegin:
// [1] phi from @begin to @1 [phi:@begin->@1]
@ -1176,13 +1212,13 @@ clock: {
// Reset & start the processor clock time. The value can be read using clock().
// This uses CIA #2 Timer A+B on the C64
clock_start: {
// [39] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// [39] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Setup CIA#2 timer A to count (down) CPU cycles
lda #0
sta CIA2_TIMER_A_CONTROL
// [40] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
// [40] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// [41] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff -- _deref_pduc1=vduc2
lda #<$ffffffff
sta CIA2_TIMER_AB
@ -1192,12 +1228,12 @@ clock_start: {
sta CIA2_TIMER_AB+2
lda #>$ffffffff>>$10
sta CIA2_TIMER_AB+3
// [42] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
// [42] *((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 -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
// [43] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// [43] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START
sta CIA2_TIMER_A_CONTROL
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
jmp __breturn
// clock_start::@return
__breturn:
@ -1258,11 +1294,26 @@ FINAL SYMBOL TABLE
(label) @1
(label) @begin
(label) @end
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify dword*) CIA2_TIMER_AB = (dword*) 56580
(const nomodify byte*) CIA2_TIMER_A_CONTROL = (byte*) 56590
(const nomodify byte*) CIA2_TIMER_B_CONTROL = (byte*) 56591
(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = (byte) $40
(const nomodify byte) CIA_TIMER_CONTROL_START = (byte) 1
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = (byte) $e
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = (byte) $f
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10
@ -1338,17 +1389,17 @@ Score: 455
:BasicUpstart(main)
.pc = $80d "Program"
// Global Constants & labels
// CIA #2 Timer A+B Value (32-bit)
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
// CIA#2 timer A&B as one single 32-bit value
.label CIA2_TIMER_AB = $dd04
// CIA #2 Timer A Control Register
.label CIA2_TIMER_A_CONTROL = $dd0e
// CIA #2 Timer B Control Register
.label CIA2_TIMER_B_CONTROL = $dd0f
// Timer Control - Start/stop timer (0:stop, 1: start)
.const CIA_TIMER_CONTROL_START = 1
// Timer B Control - Timer counts (00:system cycles, 01: CNT pulses, 10: timer A underflow, 11: time A underflow while CNT is high)
.const CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = $40
.label SCREEN = $400
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = $e
.const OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = $f
// @begin
// [1] phi from @begin to @1 [phi:@begin->@1]
// @1
@ -1555,15 +1606,15 @@ clock: {
// Reset & start the processor clock time. The value can be read using clock().
// This uses CIA #2 Timer A+B on the C64
clock_start: {
// *CIA2_TIMER_A_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
// [39] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
// [39] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (byte) 0 -- _deref_pbuc1=vbuc2
// Setup CIA#2 timer A to count (down) CPU cycles
lda #0
sta CIA2_TIMER_A_CONTROL
// *CIA2_TIMER_B_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
// [40] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
// CIA2->TIMER_B_CONTROL = CIA_TIMER_CONTROL_STOP | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
// [40] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// *CIA2_TIMER_AB = 0xffffffff
// [41] *((const nomodify dword*) CIA2_TIMER_AB) ← (dword) $ffffffff -- _deref_pduc1=vduc2
lda #<$ffffffff
@ -1574,14 +1625,14 @@ clock_start: {
sta CIA2_TIMER_AB+2
lda #>$ffffffff>>$10
sta CIA2_TIMER_AB+3
// *CIA2_TIMER_B_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
// [42] *((const nomodify byte*) CIA2_TIMER_B_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START|(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A -- _deref_pbuc1=vbuc2
// CIA2->TIMER_B_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
// [42] *((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 -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START|CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A
sta CIA2_TIMER_B_CONTROL
// *CIA2_TIMER_A_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
// [43] *((const nomodify byte*) CIA2_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START -- _deref_pbuc1=vbuc2
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL
// CIA2->TIMER_A_CONTROL = CIA_TIMER_CONTROL_START | CIA_TIMER_CONTROL_CONTINUOUS | CIA_TIMER_CONTROL_A_COUNT_CYCLES
// [43] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL) ← (const nomodify byte) CIA_TIMER_CONTROL_START -- _deref_pbuc1=vbuc2
lda #CIA_TIMER_CONTROL_START
sta CIA2_TIMER_A_CONTROL
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL
// clock_start::@return
// }
// [44] return

View File

@ -1,11 +1,26 @@
(label) @1
(label) @begin
(label) @end
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify dword*) CIA2_TIMER_AB = (dword*) 56580
(const nomodify byte*) CIA2_TIMER_A_CONTROL = (byte*) 56590
(const nomodify byte*) CIA2_TIMER_B_CONTROL = (byte*) 56591
(const nomodify byte) CIA_TIMER_CONTROL_B_COUNT_UNDERFLOW_A = (byte) $40
(const nomodify byte) CIA_TIMER_CONTROL_START = (byte) 1
(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
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL = (byte) $e
(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL = (byte) $f
(const byte) RADIX::BINARY = (number) 2
(const byte) RADIX::DECIMAL = (number) $a
(const byte) RADIX::HEXADECIMAL = (number) $10

View File

@ -41,8 +41,8 @@
.const IRQ_RASTER = 1
// Color Ram
.label COLS = $d800
// CIA#1 Interrupt Status & Control Register
.label CIA1_INTERRUPT = $dc0d
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
// The vector used when the HARDWARE serves IRQ interrupts
@ -74,6 +74,7 @@
.const OFFSET_STRUCT_PROCESSINGSPRITE_COL = $a
.const OFFSET_STRUCT_PROCESSINGSPRITE_STATUS = $b
.const OFFSET_STRUCT_PROCESSINGSPRITE_SCREENPTR = $c
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
// Top of the heap used by malloc()
.label HEAP_TOP = $a000
// Head of the heap. Moved backward each malloc()
@ -656,10 +657,10 @@ setupRasterIrq: {
// *PROCPORT = PROCPORT_RAM_IO
lda #PROCPORT_RAM_IO
sta PROCPORT
// *CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR
// CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1_INTERRUPT
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// *VIC_CONTROL &=0x7f
lda #$7f
and VIC_CONTROL

View File

@ -245,7 +245,7 @@ setupRasterIrq: scope:[setupRasterIrq] from main::@10
asm { sei }
[138] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK
[139] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO
[140] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[140] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
to:setupRasterIrq::@1
setupRasterIrq::@1: scope:[setupRasterIrq] from setupRasterIrq
[141] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f

View File

@ -60,6 +60,8 @@ Adding value simple copy *((byte*)(const struct ProcessingSprite*) PROCESSING+(c
Adding value simple copy *((byte*)(const struct ProcessingSprite*) PROCESSING+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_COL + (byte~) startProcessing::$22) ← (byte) startProcessing::spriteCol
Adding value simple copy *((byte*)(const struct ProcessingSprite*) PROCESSING+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_STATUS + (byte~) startProcessing::$22) ← (const byte) STATUS_NEW
Adding value simple copy *((byte**)(const struct ProcessingSprite*) PROCESSING+(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_SCREENPTR + (byte~) startProcessing::$22) ← (byte*) startProcessing::screenPtr
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference (struct ProcessingChar) main::center.dist with member unwinding reference (byte) main::center_dist
Replacing struct member reference (struct ProcessingChar) getCharToProcess::closest.dist with member unwinding reference (byte) getCharToProcess::closest_dist
Replacing struct member reference (struct ProcessingChar) getCharToProcess::closest.dist with member unwinding reference (byte) getCharToProcess::closest_dist
@ -96,6 +98,7 @@ Replacing struct member reference *((struct ProcessingSprite*) processChars::pro
Replacing struct member reference *((struct ProcessingSprite*) processChars::processing).y with member unwinding reference *((word*~) processChars::$54)
Replacing struct member reference *((struct ProcessingSprite*) processChars::processing).vy with member unwinding reference *((word*~) processChars::$55)
Replacing struct member reference *((struct ProcessingSprite*) processChars::processing).y with member unwinding reference *((word*~) processChars::$56)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).INTERRUPT with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Eliminating unused variable with no statement (struct ProcessingChar~) main::$5
Unwinding list assignment { (byte~) main::$5_x, (byte~) main::$5_y, (byte~) main::$5_dist } ← { (byte) getCharToProcess::return_x, (byte) getCharToProcess::return_y, (byte) getCharToProcess::return_dist }
@ -1033,7 +1036,7 @@ setupRasterIrq: scope:[setupRasterIrq] from main::@11
asm { sei }
*((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK
*((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO
*((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
*((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
(bool~) setupRasterIrq::$0 ← (word) setupRasterIrq::raster#1 < (number) $100
if((bool~) setupRasterIrq::$0) goto setupRasterIrq::@1
to:setupRasterIrq::@3
@ -1164,7 +1167,7 @@ SYMBOL TABLE SSA
(const nomodify byte) BORDER_YPOS_BOTTOM = (byte) $fa
(const nomodify byte) BORDER_YPOS_TOP = (byte) $32
(const nomodify byte*) CHARGEN = (byte*)(number) $d000
(const nomodify byte*) CIA1_INTERRUPT = (byte*)(number) $dc0d
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*)(number) $dc00
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) COLS = (byte*)(number) $d800
(const word*) CORDIC_ATAN2_ANGLES_16[(const nomodify byte) CORDIC_ITERATIONS_16] = kickasm {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
@ -1178,8 +1181,23 @@ SYMBOL TABLE SSA
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*)(number) $d019
(const nomodify byte) LIGHT_BLUE = (byte) $e
(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
(const nomodify byte) NOT_FOUND = (byte) $ff
(const nomodify byte) NUM_PROCESSING = (byte) 8
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_COL = (byte) $a
(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_ID = (byte) 8
(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_PTR = (byte) 9
@ -2225,7 +2243,7 @@ Simplifying constant pointer cast (byte*) 53265
Simplifying constant pointer cast (byte*) 53273
Simplifying constant pointer cast (byte*) 53274
Simplifying constant pointer cast (byte*) 55296
Simplifying constant pointer cast (byte*) 56333
Simplifying constant pointer cast (struct MOS6526_CIA*) 56320
Simplifying constant pointer cast (void()**) 65534
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 8192
@ -3489,7 +3507,7 @@ setupRasterIrq: scope:[setupRasterIrq] from main::@10
asm { sei }
[138] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK
[139] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO
[140] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
[140] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR
to:setupRasterIrq::@1
setupRasterIrq::@1: scope:[setupRasterIrq] from setupRasterIrq
[141] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f
@ -3807,6 +3825,20 @@ irqTop::@return: scope:[irqTop] from irqTop::@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) ProcessingChar::dist
(byte) ProcessingChar::x
(byte) ProcessingChar::y
@ -4538,8 +4570,8 @@ Target platform is c64basic / MOS6502X
.const IRQ_RASTER = 1
// Color Ram
.label COLS = $d800
// CIA#1 Interrupt Status & Control Register
.label CIA1_INTERRUPT = $dc0d
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
// The vector used when the HARDWARE serves IRQ interrupts
@ -4571,6 +4603,7 @@ Target platform is c64basic / MOS6502X
.const OFFSET_STRUCT_PROCESSINGSPRITE_COL = $a
.const OFFSET_STRUCT_PROCESSINGSPRITE_STATUS = $b
.const OFFSET_STRUCT_PROCESSINGSPRITE_SCREENPTR = $c
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
// Top of the heap used by malloc()
.label HEAP_TOP = $a000
// Head of the heap. Moved backward each malloc()
@ -5529,10 +5562,10 @@ setupRasterIrq: {
// [139] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2
lda #PROCPORT_RAM_IO
sta PROCPORT
// [140] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// [140] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1_INTERRUPT
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
jmp __b1
// setupRasterIrq::@1
__b1:
@ -6808,7 +6841,7 @@ Statement [130] (byte*~) getCharToProcess::$9 ← (byte*)(void*) SCREEN_COPY#0 +
Statement [131] *((byte*~) getCharToProcess::$9 + (byte) getCharToProcess::return_x#1) ← (byte) ' ' [ SCREEN_COPY#0 SCREEN_DIST#0 getCharToProcess::return_x#1 getCharToProcess::return_y#1 getCharToProcess::return_dist#1 ] ( main:7::getCharToProcess:28 [ SCREEN_COPY#0 SCREEN_DIST#0 getCharToProcess::return_x#1 getCharToProcess::return_y#1 getCharToProcess::return_dist#1 ] { { getCharToProcess::return_x#0 = getCharToProcess::return_x#1 } { getCharToProcess::return_y#0 = getCharToProcess::return_y#1 } { getCharToProcess::return_dist#0 = getCharToProcess::return_dist#1 } } ) always clobbers reg byte a
Statement [138] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK [ ] ( main:7::setupRasterIrq:26 [ SCREEN_COPY#0 SCREEN_DIST#0 ] { } ) always clobbers reg byte a
Statement [139] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO [ ] ( main:7::setupRasterIrq:26 [ SCREEN_COPY#0 SCREEN_DIST#0 ] { } ) always clobbers reg byte a
Statement [140] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:7::setupRasterIrq:26 [ SCREEN_COPY#0 SCREEN_DIST#0 ] { } ) always clobbers reg byte a
Statement [140] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:7::setupRasterIrq:26 [ SCREEN_COPY#0 SCREEN_DIST#0 ] { } ) always clobbers reg byte a
Statement [141] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f [ ] ( main:7::setupRasterIrq:26 [ SCREEN_COPY#0 SCREEN_DIST#0 ] { } ) always clobbers reg byte a
Statement [142] *((const nomodify byte*) RASTER) ← <(const nomodify byte) RASTER_IRQ_TOP [ ] ( main:7::setupRasterIrq:26 [ SCREEN_COPY#0 SCREEN_DIST#0 ] { } ) always clobbers reg byte a
Statement [143] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:7::setupRasterIrq:26 [ SCREEN_COPY#0 SCREEN_DIST#0 ] { } ) always clobbers reg byte a
@ -7017,7 +7050,7 @@ Statement [130] (byte*~) getCharToProcess::$9 ← (byte*)(void*) SCREEN_COPY#0 +
Statement [131] *((byte*~) getCharToProcess::$9 + (byte) getCharToProcess::return_x#1) ← (byte) ' ' [ SCREEN_COPY#0 SCREEN_DIST#0 getCharToProcess::return_x#1 getCharToProcess::return_y#1 getCharToProcess::return_dist#1 ] ( main:7::getCharToProcess:28 [ SCREEN_COPY#0 SCREEN_DIST#0 getCharToProcess::return_x#1 getCharToProcess::return_y#1 getCharToProcess::return_dist#1 ] { { getCharToProcess::return_x#0 = getCharToProcess::return_x#1 } { getCharToProcess::return_y#0 = getCharToProcess::return_y#1 } { getCharToProcess::return_dist#0 = getCharToProcess::return_dist#1 } } ) always clobbers reg byte a
Statement [138] *((const nomodify byte*) PROCPORT_DDR) ← (const nomodify byte) PROCPORT_DDR_MEMORY_MASK [ ] ( main:7::setupRasterIrq:26 [ SCREEN_COPY#0 SCREEN_DIST#0 ] { } ) always clobbers reg byte a
Statement [139] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO [ ] ( main:7::setupRasterIrq:26 [ SCREEN_COPY#0 SCREEN_DIST#0 ] { } ) always clobbers reg byte a
Statement [140] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:7::setupRasterIrq:26 [ SCREEN_COPY#0 SCREEN_DIST#0 ] { } ) always clobbers reg byte a
Statement [140] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR [ ] ( main:7::setupRasterIrq:26 [ SCREEN_COPY#0 SCREEN_DIST#0 ] { } ) always clobbers reg byte a
Statement [141] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f [ ] ( main:7::setupRasterIrq:26 [ SCREEN_COPY#0 SCREEN_DIST#0 ] { } ) always clobbers reg byte a
Statement [142] *((const nomodify byte*) RASTER) ← <(const nomodify byte) RASTER_IRQ_TOP [ ] ( main:7::setupRasterIrq:26 [ SCREEN_COPY#0 SCREEN_DIST#0 ] { } ) always clobbers reg byte a
Statement [143] *((const nomodify byte*) IRQ_ENABLE) ← (const nomodify byte) IRQ_RASTER [ ] ( main:7::setupRasterIrq:26 [ SCREEN_COPY#0 SCREEN_DIST#0 ] { } ) always clobbers reg byte a
@ -7264,6 +7297,7 @@ Uplift Scope [main] 302.5: zp[2]:4 [ main::dst#2 main::dst#0 main::dst#1 ] 235.6
Uplift Scope [] 16.25: zp[2]:48 [ heap_head#5 heap_head#1 ] 0.03: zp[2]:54 [ SCREEN_DIST#0 ] 0.03: zp[2]:52 [ SCREEN_COPY#0 ]
Uplift Scope [malloc] 4.4: zp[2]:156 [ malloc::mem#0 ]
Uplift Scope [RADIX]
Uplift Scope [MOS6526_CIA]
Uplift Scope [ProcessingChar]
Uplift Scope [ProcessingSprite]
Uplift Scope [ProcessingSprite::$0]
@ -7285,6 +7319,7 @@ Limited combination testing to 100 combinations of 65536 possible.
Uplifting [] best 1263507 combination zp[2]:48 [ heap_head#5 heap_head#1 ] zp[2]:54 [ SCREEN_DIST#0 ] zp[2]:52 [ SCREEN_COPY#0 ]
Uplifting [malloc] best 1263507 combination zp[2]:156 [ malloc::mem#0 ]
Uplifting [RADIX] best 1263507 combination
Uplifting [MOS6526_CIA] best 1263507 combination
Uplifting [ProcessingChar] best 1263507 combination
Uplifting [ProcessingSprite] best 1263507 combination
Uplifting [ProcessingSprite::$0] best 1263507 combination
@ -7521,8 +7556,8 @@ ASSEMBLER BEFORE OPTIMIZATION
.const IRQ_RASTER = 1
// Color Ram
.label COLS = $d800
// CIA#1 Interrupt Status & Control Register
.label CIA1_INTERRUPT = $dc0d
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
// The vector used when the HARDWARE serves IRQ interrupts
@ -7554,6 +7589,7 @@ ASSEMBLER BEFORE OPTIMIZATION
.const OFFSET_STRUCT_PROCESSINGSPRITE_COL = $a
.const OFFSET_STRUCT_PROCESSINGSPRITE_STATUS = $b
.const OFFSET_STRUCT_PROCESSINGSPRITE_SCREENPTR = $c
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
// Top of the heap used by malloc()
.label HEAP_TOP = $a000
// Head of the heap. Moved backward each malloc()
@ -8383,10 +8419,10 @@ setupRasterIrq: {
// [139] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2
lda #PROCPORT_RAM_IO
sta PROCPORT
// [140] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// [140] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1_INTERRUPT
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
jmp __b1
// setupRasterIrq::@1
__b1:
@ -9709,23 +9745,23 @@ Removing instruction jmp __b1
Succesful ASM optimization Pass5NextJumpElimination
Removing instruction ldy #OFFSET_STRUCT_PROCESSINGSPRITE_STATUS
Succesful ASM optimization Pass5UnnecesaryLoadElimination
Fixing long branch [452] bne __b2 to beq
Fixing long branch [867] beq __b12 to bne
Fixing long branch [1210] bne __b1 to beq
Fixing long branch [230] bne __b3 to beq
Fixing long branch [236] beq __b8 to bne
Fixing long branch [497] beq __b11 to bne
Fixing long branch [767] bpl __b1 to bmi
Fixing long branch [779] bpl __b4 to bmi
Fixing long branch [1024] beq __b2 to bne
Fixing long branch [1084] bne __b4 to beq
Fixing long branch [1118] bcc __b6 to bcs
Fixing long branch [1125] bcc __b6 to bcs
Fixing long branch [1132] bcc __b6 to bcs
Fixing long branch [1139] bcc __b6 to bcs
Fixing long branch [1147] bcc __b6 to bcs
Fixing long branch [1154] bcc __b6 to bcs
Fixing long branch [1162] bcc __b6 to bcs
Fixing long branch [453] bne __b2 to beq
Fixing long branch [868] beq __b12 to bne
Fixing long branch [1211] bne __b1 to beq
Fixing long branch [231] bne __b3 to beq
Fixing long branch [237] beq __b8 to bne
Fixing long branch [498] beq __b11 to bne
Fixing long branch [768] bpl __b1 to bmi
Fixing long branch [780] bpl __b4 to bmi
Fixing long branch [1025] beq __b2 to bne
Fixing long branch [1085] bne __b4 to beq
Fixing long branch [1119] bcc __b6 to bcs
Fixing long branch [1126] bcc __b6 to bcs
Fixing long branch [1133] bcc __b6 to bcs
Fixing long branch [1140] bcc __b6 to bcs
Fixing long branch [1148] bcc __b6 to bcs
Fixing long branch [1155] bcc __b6 to bcs
Fixing long branch [1163] bcc __b6 to bcs
FINAL SYMBOL TABLE
(const struct ProcessingSprite) $2 = { x: (word) 0, y: (word) 0, vx: (word) 0, vy: (word) 0, id: (byte) 0, ptr: (byte) 0, col: (byte) 0, status: (const byte) STATUS_FREE, screenPtr: (byte*) 0 }
@ -9740,7 +9776,7 @@ FINAL SYMBOL TABLE
(const nomodify byte) BORDER_YPOS_BOTTOM = (byte) $fa
(const nomodify byte) BORDER_YPOS_TOP = (byte) $32
(const nomodify byte*) CHARGEN = (byte*) 53248
(const nomodify byte*) CIA1_INTERRUPT = (byte*) 56333
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) COLS = (byte*) 55296
(const word*) CORDIC_ATAN2_ANGLES_16[(const nomodify byte) CORDIC_ITERATIONS_16] = kickasm {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
@ -9753,8 +9789,23 @@ FINAL SYMBOL TABLE
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*) 53273
(const nomodify byte) LIGHT_BLUE = (byte) $e
(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
(const nomodify byte) NOT_FOUND = (byte) $ff
(const nomodify byte) NUM_PROCESSING = (byte) 8
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_COL = (byte) $a
(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_ID = (byte) 8
(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_PTR = (byte) 9
@ -10327,8 +10378,8 @@ Score: 1113354
.const IRQ_RASTER = 1
// Color Ram
.label COLS = $d800
// CIA#1 Interrupt Status & Control Register
.label CIA1_INTERRUPT = $dc0d
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// Value that disables all CIA interrupts when stored to the CIA Interrupt registers
.const CIA_INTERRUPT_CLEAR = $7f
// The vector used when the HARDWARE serves IRQ interrupts
@ -10360,6 +10411,7 @@ Score: 1113354
.const OFFSET_STRUCT_PROCESSINGSPRITE_COL = $a
.const OFFSET_STRUCT_PROCESSINGSPRITE_STATUS = $b
.const OFFSET_STRUCT_PROCESSINGSPRITE_SCREENPTR = $c
.const OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = $d
// Top of the heap used by malloc()
.label HEAP_TOP = $a000
// Head of the heap. Moved backward each malloc()
@ -11177,11 +11229,11 @@ setupRasterIrq: {
// [139] *((const nomodify byte*) PROCPORT) ← (const nomodify byte) PROCPORT_RAM_IO -- _deref_pbuc1=vbuc2
lda #PROCPORT_RAM_IO
sta PROCPORT
// *CIA1_INTERRUPT = CIA_INTERRUPT_CLEAR
// [140] *((const nomodify byte*) CIA1_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// CIA1->INTERRUPT = CIA_INTERRUPT_CLEAR
// [140] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT) ← (const nomodify byte) CIA_INTERRUPT_CLEAR -- _deref_pbuc1=vbuc2
// Disable CIA 1 Timer IRQ
lda #CIA_INTERRUPT_CLEAR
sta CIA1_INTERRUPT
sta CIA1+OFFSET_STRUCT_MOS6526_CIA_INTERRUPT
// setupRasterIrq::@1
// *VIC_CONTROL &=0x7f
// [141] *((const nomodify byte*) VIC_CONTROL) ← *((const nomodify byte*) VIC_CONTROL) & (byte) $7f -- _deref_pbuc1=_deref_pbuc1_band_vbuc2

View File

@ -10,7 +10,7 @@
(const nomodify byte) BORDER_YPOS_BOTTOM = (byte) $fa
(const nomodify byte) BORDER_YPOS_TOP = (byte) $32
(const nomodify byte*) CHARGEN = (byte*) 53248
(const nomodify byte*) CIA1_INTERRUPT = (byte*) 56333
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify byte) CIA_INTERRUPT_CLEAR = (byte) $7f
(const nomodify byte*) COLS = (byte*) 55296
(const word*) CORDIC_ATAN2_ANGLES_16[(const nomodify byte) CORDIC_ITERATIONS_16] = kickasm {{ .for (var i=0; i<CORDIC_ITERATIONS_16; i++)
@ -23,8 +23,23 @@
(const nomodify byte) IRQ_RASTER = (byte) 1
(const nomodify byte*) IRQ_STATUS = (byte*) 53273
(const nomodify byte) LIGHT_BLUE = (byte) $e
(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
(const nomodify byte) NOT_FOUND = (byte) $ff
(const nomodify byte) NUM_PROCESSING = (byte) 8
(const byte) OFFSET_STRUCT_MOS6526_CIA_INTERRUPT = (byte) $d
(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_COL = (byte) $a
(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_ID = (byte) 8
(const byte) OFFSET_STRUCT_PROCESSINGSPRITE_PTR = (byte) 9

View File

@ -1,3 +1,5 @@
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
CONTROL FLOW GRAPH SSA
@ -91,6 +93,20 @@ SYMBOL TABLE SSA
(const byte*) MEDUSA_SCREEN[(number) $3e8] = kickasm {{ .var fileScreen = LoadBinary("medusas.prg", BF_C64FILE)
.fill fileScreen.getSize(), fileScreen.get(i)
}}
(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
(const byte*) SCREEN = (byte*)(number) $400
(void()) main()
(byte*~) main::$2
@ -290,6 +306,20 @@ memcpy::@2: scope:[memcpy] from memcpy::@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
(void()) main()
(void*()) memcpy((void*) memcpy::destination , (void*) memcpy::source , (word) memcpy::num)
(void*) memcpy::destination
@ -497,10 +527,12 @@ Potential registers zp[2]:10 [ memcpy::src_end#0 ] : zp[2]:10 ,
REGISTER UPLIFT SCOPES
Uplift Scope [memcpy] 3,129.25: zp[2]:6 [ memcpy::src#2 memcpy::src#4 memcpy::src#1 ] 2,237.67: zp[2]:8 [ memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 ] 137.75: zp[2]:10 [ memcpy::src_end#0 ] 0: zp[2]:2 [ memcpy::source#2 ] 0: zp[2]:4 [ memcpy::destination#2 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [main]
Uplift Scope []
Uplifting [memcpy] best 919 combination zp[2]:6 [ memcpy::src#2 memcpy::src#4 memcpy::src#1 ] zp[2]:8 [ memcpy::dst#2 memcpy::dst#4 memcpy::dst#1 ] zp[2]:10 [ memcpy::src_end#0 ] zp[2]:2 [ memcpy::source#2 ] zp[2]:4 [ memcpy::destination#2 ]
Uplifting [MOS6526_CIA] best 919 combination
Uplifting [main] best 919 combination
Uplifting [] best 919 combination
Coalescing zero page register [ zp[2]:2 [ memcpy::source#2 ] ] with [ zp[2]:6 [ memcpy::src#2 memcpy::src#4 memcpy::src#1 ] ] - score: 1
@ -695,6 +727,20 @@ FINAL SYMBOL TABLE
(const byte*) MEDUSA_SCREEN[(number) $3e8] = kickasm {{ .var fileScreen = LoadBinary("medusas.prg", BF_C64FILE)
.fill fileScreen.getSize(), fileScreen.get(i)
}}
(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
(const byte*) SCREEN = (byte*) 1024
(void()) main()
(label) main::@1

View File

@ -10,6 +10,20 @@
(const byte*) MEDUSA_SCREEN[(number) $3e8] = kickasm {{ .var fileScreen = LoadBinary("medusas.prg", BF_C64FILE)
.fill fileScreen.getSize(), fileScreen.get(i)
}}
(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
(const byte*) SCREEN = (byte*) 1024
(void()) main()
(label) main::@1

View File

@ -5,14 +5,10 @@
.label RASTER = $d012
.label BORDERCOL = $d020
.label D018 = $d018
// CIA#1 Port A: keyboard matrix columns and joystick #2
.label CIA1_PORT_A = $dc00
// CIA#1 Port B: keyboard matrix rows and joystick #1.
.label CIA1_PORT_B = $dc01
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
.const KEY_SPACE = $3c
// The BASIC screen
.label BASIC_SCREEN = $400
@ -31,6 +27,8 @@
// The number of BOBs to render
.const NUM_BOBS = $19
.const SIZEOF_POINTER = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
// BOB charset ID of the next glyph to be added
.label bob_charset_next_id = $11
// Current index within the progress cursor (0-7)
@ -66,12 +64,12 @@ main: {
jsr prepareBobs
// renderBobInit()
jsr renderBobInit
// *CIA2_PORT_A_DDR = %00000011
// CIA2->PORT_A_DDR = %00000011
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = toDd00(gfx)
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = toDd00(gfx)
lda #vicSelectGfxBank1_toDd001_return
sta CIA2_PORT_A
sta CIA2
// *D018 = toD018(BOB_SCREEN, BOB_CHARSET)
lda #toD0181_return
sta D018
@ -210,12 +208,12 @@ main: {
// while(keyboard_key_pressed(KEY_SPACE))
cmp #0
bne __b8
// *CIA2_PORT_A_DDR = %00000011
// CIA2->PORT_A_DDR = %00000011
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = toDd00(gfx)
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = toDd00(gfx)
lda #vicSelectGfxBank2_toDd001_return
sta CIA2_PORT_A
sta CIA2
// *D018 = toD018(BASIC_SCREEN, BASIC_CHARSET)
lda #toD0182_return
sta D018
@ -242,11 +240,11 @@ keyboard_key_pressed: {
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
keyboard_matrix_read: {
// *CIA1_PORT_A = keyboard_matrix_row_bitmask[rowid]
// CIA1->PORT_A = keyboard_matrix_row_bitmask[rowid]
lda keyboard_matrix_row_bitmask+keyboard_key_pressed.rowidx
sta CIA1_PORT_A
// ~*CIA1_PORT_B
lda CIA1_PORT_B
sta CIA1
// ~CIA1->PORT_B
lda CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B
eor #$ff
// }
rts

View File

@ -22,13 +22,13 @@ main::@12: scope:[main] from main::@11
[9] call renderBobInit
to:main::vicSelectGfxBank1
main::vicSelectGfxBank1: scope:[main] from main::@12
[10] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[10] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
to:main::vicSelectGfxBank1_toDd001
main::vicSelectGfxBank1_toDd001: scope:[main] from main::vicSelectGfxBank1
[11] phi()
to:main::vicSelectGfxBank1_@1
main::vicSelectGfxBank1_@1: scope:[main] from main::vicSelectGfxBank1_toDd001
[12] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0
[12] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0
to:main::toD0181
main::toD0181: scope:[main] from main::vicSelectGfxBank1_@1
[13] phi()
@ -103,13 +103,13 @@ main::@16: scope:[main] from main::@8
[49] if((byte) 0!=(byte~) main::$17) goto main::@8
to:main::vicSelectGfxBank2
main::vicSelectGfxBank2: scope:[main] from main::@16
[50] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[50] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
to:main::vicSelectGfxBank2_toDd001
main::vicSelectGfxBank2_toDd001: scope:[main] from main::vicSelectGfxBank2
[51] phi()
to:main::vicSelectGfxBank2_@1
main::vicSelectGfxBank2_@1: scope:[main] from main::vicSelectGfxBank2_toDd001
[52] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0
[52] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0
to:main::toD0182
main::toD0182: scope:[main] from main::vicSelectGfxBank2_@1
[53] phi()
@ -137,8 +137,8 @@ keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_p
(byte()) keyboard_matrix_read((byte) keyboard_matrix_read::rowid)
keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_key_pressed
[62] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0)
[63] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B)
[62] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0)
[63] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B)
to:keyboard_matrix_read::@return
keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matrix_read
[64] return

View File

@ -1,4 +1,16 @@
Resolved forward reference bob_charset_next_id to (byte) bob_charset_next_id
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_B_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_B with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_B with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).TIMER_A_CONTROL with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).TIMER_B_CONTROL with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).TIMER_B_CONTROL with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).TIMER_A_CONTROL with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Inlined call call mulf8s_prepare (signed byte) mulf8s::a
Inlined call call vicSelectGfxBank (const nomodify byte*) BOB_SCREEN
@ -57,8 +69,8 @@ memset::@return: scope:[memset] from memset::@1
(byte()) keyboard_matrix_read((byte) keyboard_matrix_read::rowid)
keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_key_pressed
(byte) keyboard_matrix_read::rowid#1 ← phi( keyboard_key_pressed/(byte) keyboard_matrix_read::rowid#0 )
*((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#1)
(byte~) keyboard_matrix_read::$0 ← ~ *((const nomodify byte*) CIA1_PORT_B)
*((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#1)
(byte~) keyboard_matrix_read::$0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B)
(byte) keyboard_matrix_read::row_pressed_bits#0 ← (byte~) keyboard_matrix_read::$0
(byte) keyboard_matrix_read::return#0 ← (byte) keyboard_matrix_read::row_pressed_bits#0
to:keyboard_matrix_read::@return
@ -232,7 +244,7 @@ main::vicSelectGfxBank1: scope:[main] from main::@16
(byte*) progress_cursor#68 ← phi( main::@16/(byte*) progress_cursor#69 )
(byte**) renderBobCleanupNext#46 ← phi( main::@16/(byte**) renderBobCleanupNext#47 )
(byte*) main::vicSelectGfxBank1_gfx#1 ← phi( main::@16/(byte*) main::vicSelectGfxBank1_gfx#0 )
*((const nomodify byte*) CIA2_PORT_A_DDR) ← (number) 3
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) 3
(byte*) main::vicSelectGfxBank1_toDd001_gfx#0 ← (byte*) main::vicSelectGfxBank1_gfx#1
to:main::vicSelectGfxBank1_toDd001
main::vicSelectGfxBank1_toDd001: scope:[main] from main::vicSelectGfxBank1
@ -261,7 +273,7 @@ main::vicSelectGfxBank1_@1: scope:[main] from main::vicSelectGfxBank1_toDd001_@
(byte**) renderBobCleanupNext#40 ← phi( main::vicSelectGfxBank1_toDd001_@return/(byte**) renderBobCleanupNext#42 )
(byte) main::vicSelectGfxBank1_toDd001_return#3 ← phi( main::vicSelectGfxBank1_toDd001_@return/(byte) main::vicSelectGfxBank1_toDd001_return#1 )
(byte~) main::vicSelectGfxBank1_$0 ← (byte) main::vicSelectGfxBank1_toDd001_return#3
*((const nomodify byte*) CIA2_PORT_A) ← (byte~) main::vicSelectGfxBank1_$0
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (byte~) main::vicSelectGfxBank1_$0
to:main::@10
main::@10: scope:[main] from main::vicSelectGfxBank1_@1
(byte) bob_charset_next_id#68 ← phi( main::vicSelectGfxBank1_@1/(byte) bob_charset_next_id#70 )
@ -489,7 +501,7 @@ main::vicSelectGfxBank2: scope:[main] from main::@9
(byte) progress_idx#46 ← phi( main::@9/(byte) progress_idx#47 )
(byte*) progress_cursor#46 ← phi( main::@9/(byte*) progress_cursor#47 )
(byte*) main::vicSelectGfxBank2_gfx#1 ← phi( main::@9/(byte*) main::vicSelectGfxBank2_gfx#0 )
*((const nomodify byte*) CIA2_PORT_A_DDR) ← (number) 3
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) 3
(byte*) main::vicSelectGfxBank2_toDd001_gfx#0 ← (byte*) main::vicSelectGfxBank2_gfx#1
to:main::vicSelectGfxBank2_toDd001
main::vicSelectGfxBank2_toDd001: scope:[main] from main::vicSelectGfxBank2
@ -518,7 +530,7 @@ main::vicSelectGfxBank2_@1: scope:[main] from main::vicSelectGfxBank2_toDd001_@
(byte*) progress_cursor#39 ← phi( main::vicSelectGfxBank2_toDd001_@return/(byte*) progress_cursor#42 )
(byte) main::vicSelectGfxBank2_toDd001_return#3 ← phi( main::vicSelectGfxBank2_toDd001_@return/(byte) main::vicSelectGfxBank2_toDd001_return#1 )
(byte~) main::vicSelectGfxBank2_$0 ← (byte) main::vicSelectGfxBank2_toDd001_return#3
*((const nomodify byte*) CIA2_PORT_A) ← (byte~) main::vicSelectGfxBank2_$0
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (byte~) main::vicSelectGfxBank2_$0
to:main::@12
main::@12: scope:[main] from main::vicSelectGfxBank2_@1
(byte**) renderBobCleanupNext#30 ← phi( main::vicSelectGfxBank2_@1/(byte**) renderBobCleanupNext#33 )
@ -1155,14 +1167,29 @@ SYMBOL TABLE SSA
(const nomodify byte) BOB_SUBTABLE_SIZE = (const nomodify byte) BOB_SHIFTS_X*(const nomodify byte) BOB_SHIFTS_Y
(const byte*) BOB_TABLES[(number) 9*(number) 8*(number) 4] = { fill( 9*8*4, 0) }
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify byte*) CIA1_PORT_A = (byte*)(number) $dc00
(const nomodify byte*) CIA1_PORT_B = (byte*)(number) $dc01
(const nomodify byte*) CIA2_PORT_A = (byte*)(number) $dd00
(const nomodify byte*) CIA2_PORT_A_DDR = (byte*)(number) $dd02
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*)(number) $dc00
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*)(number) $dd00
(const nomodify byte*) D018 = (byte*)(number) $d018
(const nomodify byte) KEY_SPACE = (byte) $3c
(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
(const word*) MUL40[(number) $20] = { fill( $20, 0) }
(const nomodify byte) NUM_BOBS = (byte) $19
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A = (byte) 0
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = (byte) 2
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B = (byte) 1
(const to_nomodify byte*) PROTO_BOB[(number) 3*(number) 3*(number) 8] = kickasm {{ .var pic = LoadPicture("smiley.png", List().add($000000, $ffffff))
.for (var x=0;x<3; x++)
.for (var y=0; y<24; y++)
@ -2140,7 +2167,7 @@ Adding number conversion cast (unumber) $1ff in *((const byte*) mulf_sqr2_lo+(nu
Adding number conversion cast (unumber) $100 in *((const byte*) mulf_sqr2_hi+(number) $1ff) ← *((const byte*) mulf_sqr1_hi+(number) $100)
Adding number conversion cast (unumber) $1ff in *((const byte*) mulf_sqr2_hi+(number) $1ff) ← *((const byte*) mulf_sqr1_hi+(unumber)(number) $100)
Adding number conversion cast (unumber) 1 in (byte) mulf_init::dir#1 ← (number) 1
Adding number conversion cast (unumber) 3 in *((const nomodify byte*) CIA2_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) 3 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) $40 in (number~) main::vicSelectGfxBank1_toDd001_$1 ← (byte~) main::vicSelectGfxBank1_toDd001_$0 / (number) $40
Adding number conversion cast (unumber) main::vicSelectGfxBank1_toDd001_$1 in (number~) main::vicSelectGfxBank1_toDd001_$1 ← (byte~) main::vicSelectGfxBank1_toDd001_$0 / (unumber)(number) $40
Adding number conversion cast (unumber) 3 in (number~) main::vicSelectGfxBank1_toDd001_$2 ← (number) 3 ^ (unumber~) main::vicSelectGfxBank1_toDd001_$1
@ -2166,7 +2193,7 @@ Adding number conversion cast (snumber) $80 in (signed word) main::rowOffsetY#1
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) BORDERCOL) ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) main::$19 ← (number) 0 != (byte~) main::$15
Adding number conversion cast (unumber) 0 in (bool~) main::$18 ← (number) 0 != (byte~) main::$17
Adding number conversion cast (unumber) 3 in *((const nomodify byte*) CIA2_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) 3 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) $40 in (number~) main::vicSelectGfxBank2_toDd001_$1 ← (byte~) main::vicSelectGfxBank2_toDd001_$0 / (number) $40
Adding number conversion cast (unumber) main::vicSelectGfxBank2_toDd001_$1 in (number~) main::vicSelectGfxBank2_toDd001_$1 ← (byte~) main::vicSelectGfxBank2_toDd001_$0 / (unumber)(number) $40
Adding number conversion cast (unumber) 3 in (number~) main::vicSelectGfxBank2_toDd001_$2 ← (number) 3 ^ (unumber~) main::vicSelectGfxBank2_toDd001_$1
@ -2272,14 +2299,14 @@ Adding number conversion cast (unumber) 0 in (byte) progress_idx#9 ← (number)
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte) mulf_init::dir#1 ← (unumber)(number) 1
Inlining cast *((const nomodify byte*) CIA2_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast (byte) memset::c#0 ← (unumber)(number) 0
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast *((const nomodify byte*) BORDERCOL) ← (unumber)(number) $f
Inlining cast *((const nomodify byte*) BORDERCOL) ← (unumber)(number) 1
Inlining cast *((const nomodify byte*) BORDERCOL) ← (unumber)(number) 2
Inlining cast *((const nomodify byte*) BORDERCOL) ← (unumber)(number) 0
Inlining cast *((const nomodify byte*) CIA2_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast *((byte*) renderBobCleanup::screen#0 + (unumber)(number) 0) ← (unumber)(number) 0
Inlining cast *((byte*) renderBobCleanup::screen#0 + (unumber)(number) $28) ← (unumber)(number) 0
Inlining cast *((byte*) renderBobCleanup::screen#0 + (unumber)(number) $50) ← (unumber)(number) 0
@ -2301,10 +2328,8 @@ Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (byte*) 56320
Simplifying constant pointer cast (byte*) 56321
Simplifying constant pointer cast (byte*) 56576
Simplifying constant pointer cast (byte*) 56578
Simplifying constant pointer cast (struct MOS6526_CIA*) 56320
Simplifying constant pointer cast (struct MOS6526_CIA*) 56576
Simplifying constant pointer cast (byte*) 1024
Simplifying constant pointer cast (byte*) 4096
Simplifying constant pointer cast (byte*) 10240
@ -2942,6 +2967,9 @@ Resolved ranged next value [213] renderBobCleanup::i#1 ← ++ renderBobCleanup::
Resolved ranged comparison value [215] if(renderBobCleanup::i#1!=rangelast(0,NUM_BOBS-1)) goto renderBobCleanup::@1 to (const nomodify byte) NUM_BOBS-(byte) 1+(number) 1
Simplifying constant evaluating to zero (byte) 0*(const nomodify byte) BOB_SUBTABLE_SIZE in [190] *((byte*) renderBob::screen#0 + (byte) 0) ← *((const byte*) BOB_TABLES+(byte) 0*(const nomodify byte) BOB_SUBTABLE_SIZE + (byte) renderBob::bob_table_idx#0)
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero (byte*)CIA1 in [14] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0)
Simplifying expression containing zero (byte*)CIA2 in [77] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (byte) main::vicSelectGfxBank1_toDd001_return#0
Simplifying expression containing zero (byte*)CIA2 in [146] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (byte) main::vicSelectGfxBank2_toDd001_return#0
Simplifying expression containing zero BOB_TABLES in [190] *((byte*) renderBob::screen#0 + (byte) 0) ← *((const byte*) BOB_TABLES+(byte) 0 + (byte) renderBob::bob_table_idx#0)
Simplifying expression containing zero renderBob::screen#0 in [190] *((byte*) renderBob::screen#0 + (byte) 0) ← *((const byte*) BOB_TABLES + (byte) renderBob::bob_table_idx#0)
Simplifying expression containing zero renderBobCleanup::screen#0 in [204] *((byte*) renderBobCleanup::screen#0 + (byte) 0) ← (byte) 0
@ -2951,6 +2979,7 @@ Eliminating unused variable - keeping the phi block (byte**) renderBobCleanupNex
Eliminating unused variable - keeping the phi block (byte**) renderBobCleanupNext#11
Eliminating unused variable (byte) charsetFindOrAddGlyph::return#0 and assignment [159] (byte) charsetFindOrAddGlyph::return#0 ← (byte) charsetFindOrAddGlyph::glyph_id#11
Eliminating unused constant (const void*) memset::return#2
Eliminating unused constant (const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A
Eliminating unused constant (const byte) bob_charset_next_id#27
Eliminating unused constant (const byte*) progress_cursor#27
Eliminating unused constant (const byte) progress_idx#27
@ -3447,13 +3476,13 @@ main::@12: scope:[main] from main::@11
[9] call renderBobInit
to:main::vicSelectGfxBank1
main::vicSelectGfxBank1: scope:[main] from main::@12
[10] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[10] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
to:main::vicSelectGfxBank1_toDd001
main::vicSelectGfxBank1_toDd001: scope:[main] from main::vicSelectGfxBank1
[11] phi()
to:main::vicSelectGfxBank1_@1
main::vicSelectGfxBank1_@1: scope:[main] from main::vicSelectGfxBank1_toDd001
[12] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0
[12] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0
to:main::toD0181
main::toD0181: scope:[main] from main::vicSelectGfxBank1_@1
[13] phi()
@ -3528,13 +3557,13 @@ main::@16: scope:[main] from main::@8
[49] if((byte) 0!=(byte~) main::$17) goto main::@8
to:main::vicSelectGfxBank2
main::vicSelectGfxBank2: scope:[main] from main::@16
[50] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[50] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
to:main::vicSelectGfxBank2_toDd001
main::vicSelectGfxBank2_toDd001: scope:[main] from main::vicSelectGfxBank2
[51] phi()
to:main::vicSelectGfxBank2_@1
main::vicSelectGfxBank2_@1: scope:[main] from main::vicSelectGfxBank2_toDd001
[52] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0
[52] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0
to:main::toD0182
main::toD0182: scope:[main] from main::vicSelectGfxBank2_@1
[53] phi()
@ -3562,8 +3591,8 @@ keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_p
(byte()) keyboard_matrix_read((byte) keyboard_matrix_read::rowid)
keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_key_pressed
[62] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0)
[63] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B)
[62] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0)
[63] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B)
to:keyboard_matrix_read::@return
keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matrix_read
[64] return
@ -3932,6 +3961,20 @@ mulf_init::@3: scope:[mulf_init] from mulf_init::@2 mulf_init::@4
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) bob_charset_next_id
(byte) bob_charset_next_id#14 1051.5
(byte) bob_charset_next_id#16 9.091909185454545E8
@ -4412,14 +4455,10 @@ Target platform is c64basic / MOS6502X
.label RASTER = $d012
.label BORDERCOL = $d020
.label D018 = $d018
// CIA#1 Port A: keyboard matrix columns and joystick #2
.label CIA1_PORT_A = $dc00
// CIA#1 Port B: keyboard matrix rows and joystick #1.
.label CIA1_PORT_B = $dc01
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
.const KEY_SPACE = $3c
// The BASIC screen
.label BASIC_SCREEN = $400
@ -4438,6 +4477,8 @@ Target platform is c64basic / MOS6502X
// The number of BOBs to render
.const NUM_BOBS = $19
.const SIZEOF_POINTER = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
// BOB charset ID of the next glyph to be added
.label bob_charset_next_id = $22
// Current index within the progress cursor (0-7)
@ -4512,9 +4553,9 @@ main: {
jmp vicSelectGfxBank1
// main::vicSelectGfxBank1
vicSelectGfxBank1:
// [10] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// [10] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
lda #3
sta CIA2_PORT_A_DDR
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [11] phi from main::vicSelectGfxBank1 to main::vicSelectGfxBank1_toDd001 [phi:main::vicSelectGfxBank1->main::vicSelectGfxBank1_toDd001]
vicSelectGfxBank1_toDd001_from_vicSelectGfxBank1:
jmp vicSelectGfxBank1_toDd001
@ -4523,9 +4564,9 @@ main: {
jmp vicSelectGfxBank1___b1
// main::vicSelectGfxBank1_@1
vicSelectGfxBank1___b1:
// [12] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 -- _deref_pbuc1=vbuc2
// [12] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 -- _deref_pbuc1=vbuc2
lda #vicSelectGfxBank1_toDd001_return
sta CIA2_PORT_A
sta CIA2
// [13] phi from main::vicSelectGfxBank1_@1 to main::toD0181 [phi:main::vicSelectGfxBank1_@1->main::toD0181]
toD0181_from_vicSelectGfxBank1___b1:
jmp toD0181
@ -4773,9 +4814,9 @@ main: {
jmp vicSelectGfxBank2
// main::vicSelectGfxBank2
vicSelectGfxBank2:
// [50] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// [50] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
lda #3
sta CIA2_PORT_A_DDR
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [51] phi from main::vicSelectGfxBank2 to main::vicSelectGfxBank2_toDd001 [phi:main::vicSelectGfxBank2->main::vicSelectGfxBank2_toDd001]
vicSelectGfxBank2_toDd001_from_vicSelectGfxBank2:
jmp vicSelectGfxBank2_toDd001
@ -4784,9 +4825,9 @@ main: {
jmp vicSelectGfxBank2___b1
// main::vicSelectGfxBank2_@1
vicSelectGfxBank2___b1:
// [52] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 -- _deref_pbuc1=vbuc2
// [52] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 -- _deref_pbuc1=vbuc2
lda #vicSelectGfxBank2_toDd001_return
sta CIA2_PORT_A
sta CIA2
// [53] phi from main::vicSelectGfxBank2_@1 to main::toD0182 [phi:main::vicSelectGfxBank2_@1->main::toD0182]
toD0182_from_vicSelectGfxBank2___b1:
jmp toD0182
@ -4846,11 +4887,11 @@ keyboard_key_pressed: {
keyboard_matrix_read: {
.label return = $47
.label return_1 = $44
// [62] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) -- _deref_pbuc1=_deref_pbuc2
// [62] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) -- _deref_pbuc1=_deref_pbuc2
lda keyboard_matrix_row_bitmask+keyboard_key_pressed.rowidx
sta CIA1_PORT_A
// [63] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B) -- vbuz1=_bnot__deref_pbuc1
lda CIA1_PORT_B
sta CIA1
// [63] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) -- vbuz1=_bnot__deref_pbuc1
lda CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B
eor #$ff
sta.z return
jmp __breturn
@ -6075,8 +6116,8 @@ PROTO_BOB:
MUL40: .fill 2*$20, 0
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [10] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [12] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [10] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [12] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [14] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [17] if(*((const nomodify byte*) RASTER)<(byte) $f8) goto main::@2 [ main::origX#8 main::rowOffsetY#10 ] ( main:2 [ main::origX#8 main::rowOffsetY#10 ] { } ) always clobbers reg byte a
Statement [18] *((const nomodify byte*) BORDERCOL) ← (byte) $f [ main::origX#8 main::rowOffsetY#10 ] ( main:2 [ main::origX#8 main::rowOffsetY#10 ] { } ) always clobbers reg byte a
@ -6094,11 +6135,11 @@ Statement [35] (signed word) main::rowY#1 ← (signed word) main::y#0 + (const s
Statement [38] (signed word) main::origX#1 ← (signed word) main::origX#8 + (signed word) $100 [ main::rowOffsetY#10 main::origX#1 ] ( main:2 [ main::rowOffsetY#10 main::origX#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } } ) always clobbers reg byte a
Statement [39] (signed word) main::rowOffsetY#1 ← (signed word) main::rowOffsetY#10 + (signed word) $80 [ main::origX#1 main::rowOffsetY#1 ] ( main:2 [ main::origX#1 main::rowOffsetY#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } } ) always clobbers reg byte a
Statement [40] *((const nomodify byte*) BORDERCOL) ← (byte) 0 [ main::origX#1 main::rowOffsetY#1 ] ( main:2 [ main::origX#1 main::rowOffsetY#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } } ) always clobbers reg byte a
Statement [50] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [52] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [50] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [52] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [54] *((const nomodify byte*) D018) ← (const byte) main::toD0182_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [62] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::keyboard_key_pressed:41::keyboard_matrix_read:57 [ main::origX#1 main::rowOffsetY#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:46::keyboard_matrix_read:57 [ ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [63] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B) [ keyboard_matrix_read::return#0 ] ( main:2::keyboard_key_pressed:41::keyboard_matrix_read:57 [ main::origX#1 main::rowOffsetY#1 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:46::keyboard_matrix_read:57 [ keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [62] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::keyboard_key_pressed:41::keyboard_matrix_read:57 [ main::origX#1 main::rowOffsetY#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:46::keyboard_matrix_read:57 [ ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [63] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) [ keyboard_matrix_read::return#0 ] ( main:2::keyboard_key_pressed:41::keyboard_matrix_read:57 [ main::origX#1 main::rowOffsetY#1 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:46::keyboard_matrix_read:57 [ keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [65] (byte) renderBob::x_char_offset#0 ← (byte) renderBob::xpos#0 >> (byte) 2 [ renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 ] ( main:2::renderBob:28 [ main::origX#8 main::rowOffsetY#10 main::x#0 main::y#0 main::col#5 main::x#2 main::y#2 main::row#2 renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:62 [ renderBob::xpos#0 ]
Removing always clobbered register reg byte a as potential for zp[1]:63 [ renderBob::ypos#0 ]
@ -6212,8 +6253,8 @@ Removing always clobbered register reg byte y as potential for zp[1]:50 [ mulf_i
Removing always clobbered register reg byte y as potential for zp[1]:53 [ mulf_init::x_2#3 mulf_init::x_2#2 mulf_init::x_2#1 ]
Statement [234] *((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::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 ] { } ) always clobbers reg byte y
Statement [236] (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::mulf_init:5 [ 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 [10] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [12] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [10] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [12] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [14] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [17] if(*((const nomodify byte*) RASTER)<(byte) $f8) goto main::@2 [ main::origX#8 main::rowOffsetY#10 ] ( main:2 [ main::origX#8 main::rowOffsetY#10 ] { } ) always clobbers reg byte a
Statement [18] *((const nomodify byte*) BORDERCOL) ← (byte) $f [ main::origX#8 main::rowOffsetY#10 ] ( main:2 [ main::origX#8 main::rowOffsetY#10 ] { } ) always clobbers reg byte a
@ -6229,11 +6270,11 @@ Statement [35] (signed word) main::rowY#1 ← (signed word) main::y#0 + (const s
Statement [38] (signed word) main::origX#1 ← (signed word) main::origX#8 + (signed word) $100 [ main::rowOffsetY#10 main::origX#1 ] ( main:2 [ main::rowOffsetY#10 main::origX#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } } ) always clobbers reg byte a
Statement [39] (signed word) main::rowOffsetY#1 ← (signed word) main::rowOffsetY#10 + (signed word) $80 [ main::origX#1 main::rowOffsetY#1 ] ( main:2 [ main::origX#1 main::rowOffsetY#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } } ) always clobbers reg byte a
Statement [40] *((const nomodify byte*) BORDERCOL) ← (byte) 0 [ main::origX#1 main::rowOffsetY#1 ] ( main:2 [ main::origX#1 main::rowOffsetY#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } } ) always clobbers reg byte a
Statement [50] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [52] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [50] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [52] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [54] *((const nomodify byte*) D018) ← (const byte) main::toD0182_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [62] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::keyboard_key_pressed:41::keyboard_matrix_read:57 [ main::origX#1 main::rowOffsetY#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:46::keyboard_matrix_read:57 [ ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [63] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B) [ keyboard_matrix_read::return#0 ] ( main:2::keyboard_key_pressed:41::keyboard_matrix_read:57 [ main::origX#1 main::rowOffsetY#1 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:46::keyboard_matrix_read:57 [ keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [62] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::keyboard_key_pressed:41::keyboard_matrix_read:57 [ main::origX#1 main::rowOffsetY#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:46::keyboard_matrix_read:57 [ ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [63] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) [ keyboard_matrix_read::return#0 ] ( main:2::keyboard_key_pressed:41::keyboard_matrix_read:57 [ main::origX#1 main::rowOffsetY#1 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:46::keyboard_matrix_read:57 [ keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [65] (byte) renderBob::x_char_offset#0 ← (byte) renderBob::xpos#0 >> (byte) 2 [ renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 ] ( main:2::renderBob:28 [ main::origX#8 main::rowOffsetY#10 main::x#0 main::y#0 main::col#5 main::x#2 main::y#2 main::row#2 renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 ] { } ) always clobbers reg byte a
Statement [66] (byte) renderBob::y_char_offset#0 ← (byte) renderBob::ypos#0 >> (byte) 3 [ renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 renderBob::y_char_offset#0 ] ( main:2::renderBob:28 [ main::origX#8 main::rowOffsetY#10 main::x#0 main::y#0 main::col#5 main::x#2 main::y#2 main::row#2 renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 renderBob::y_char_offset#0 ] { } ) always clobbers reg byte a
Statement [67] (byte~) renderBob::$8 ← (byte) renderBob::y_char_offset#0 << (byte) 1 [ renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 renderBob::$8 ] ( main:2::renderBob:28 [ main::origX#8 main::rowOffsetY#10 main::x#0 main::y#0 main::col#5 main::x#2 main::y#2 main::row#2 renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 renderBob::$8 ] { } ) always clobbers reg byte a
@ -6400,6 +6441,7 @@ Uplift Scope [renderBobInit] 2,502.5: zp[1]:22 [ renderBobInit::i#2 renderBobIni
Uplift Scope [keyboard_matrix_read] 3,667.33: zp[1]:71 [ keyboard_matrix_read::return#0 ] 2,002: zp[1]:68 [ keyboard_matrix_read::return#2 ]
Uplift Scope [memset] 3,336.67: zp[2]:19 [ memset::dst#2 memset::dst#1 ]
Uplift Scope [keyboard_key_pressed] 2,002: zp[1]:69 [ keyboard_key_pressed::$2 ] 300.75: zp[1]:70 [ keyboard_key_pressed::return#0 ] 202: zp[1]:64 [ keyboard_key_pressed::return#2 ] 202: zp[1]:66 [ keyboard_key_pressed::return#3 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [RADIX]
Uplift Scope [progress_init]
Uplift Scope [progress_inc]
@ -6423,6 +6465,7 @@ Uplifting [keyboard_matrix_read] best 4043196 combination reg byte a [ keyboard_
Uplifting [memset] best 4043196 combination zp[2]:19 [ memset::dst#2 memset::dst#1 ]
Uplifting [keyboard_key_pressed] best 4043007 combination reg byte a [ keyboard_key_pressed::$2 ] reg byte a [ keyboard_key_pressed::return#0 ] reg byte a [ keyboard_key_pressed::return#2 ] reg byte a [ keyboard_key_pressed::return#3 ]
Limited combination testing to 100 combinations of 256 possible.
Uplifting [MOS6526_CIA] best 4043007 combination
Uplifting [RADIX] best 4043007 combination
Uplifting [progress_init] best 4043007 combination
Uplifting [progress_inc] best 4043007 combination
@ -6518,14 +6561,10 @@ ASSEMBLER BEFORE OPTIMIZATION
.label RASTER = $d012
.label BORDERCOL = $d020
.label D018 = $d018
// CIA#1 Port A: keyboard matrix columns and joystick #2
.label CIA1_PORT_A = $dc00
// CIA#1 Port B: keyboard matrix rows and joystick #1.
.label CIA1_PORT_B = $dc01
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
.const KEY_SPACE = $3c
// The BASIC screen
.label BASIC_SCREEN = $400
@ -6544,6 +6583,8 @@ ASSEMBLER BEFORE OPTIMIZATION
// The number of BOBs to render
.const NUM_BOBS = $19
.const SIZEOF_POINTER = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
// BOB charset ID of the next glyph to be added
.label bob_charset_next_id = $11
// Current index within the progress cursor (0-7)
@ -6615,9 +6656,9 @@ main: {
jmp vicSelectGfxBank1
// main::vicSelectGfxBank1
vicSelectGfxBank1:
// [10] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// [10] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
lda #3
sta CIA2_PORT_A_DDR
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [11] phi from main::vicSelectGfxBank1 to main::vicSelectGfxBank1_toDd001 [phi:main::vicSelectGfxBank1->main::vicSelectGfxBank1_toDd001]
vicSelectGfxBank1_toDd001_from_vicSelectGfxBank1:
jmp vicSelectGfxBank1_toDd001
@ -6626,9 +6667,9 @@ main: {
jmp vicSelectGfxBank1___b1
// main::vicSelectGfxBank1_@1
vicSelectGfxBank1___b1:
// [12] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 -- _deref_pbuc1=vbuc2
// [12] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 -- _deref_pbuc1=vbuc2
lda #vicSelectGfxBank1_toDd001_return
sta CIA2_PORT_A
sta CIA2
// [13] phi from main::vicSelectGfxBank1_@1 to main::toD0181 [phi:main::vicSelectGfxBank1_@1->main::toD0181]
toD0181_from_vicSelectGfxBank1___b1:
jmp toD0181
@ -6864,9 +6905,9 @@ main: {
jmp vicSelectGfxBank2
// main::vicSelectGfxBank2
vicSelectGfxBank2:
// [50] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// [50] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
lda #3
sta CIA2_PORT_A_DDR
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [51] phi from main::vicSelectGfxBank2 to main::vicSelectGfxBank2_toDd001 [phi:main::vicSelectGfxBank2->main::vicSelectGfxBank2_toDd001]
vicSelectGfxBank2_toDd001_from_vicSelectGfxBank2:
jmp vicSelectGfxBank2_toDd001
@ -6875,9 +6916,9 @@ main: {
jmp vicSelectGfxBank2___b1
// main::vicSelectGfxBank2_@1
vicSelectGfxBank2___b1:
// [52] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 -- _deref_pbuc1=vbuc2
// [52] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 -- _deref_pbuc1=vbuc2
lda #vicSelectGfxBank2_toDd001_return
sta CIA2_PORT_A
sta CIA2
// [53] phi from main::vicSelectGfxBank2_@1 to main::toD0182 [phi:main::vicSelectGfxBank2_@1->main::toD0182]
toD0182_from_vicSelectGfxBank2___b1:
jmp toD0182
@ -6925,11 +6966,11 @@ keyboard_key_pressed: {
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
keyboard_matrix_read: {
// [62] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) -- _deref_pbuc1=_deref_pbuc2
// [62] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) -- _deref_pbuc1=_deref_pbuc2
lda keyboard_matrix_row_bitmask+keyboard_key_pressed.rowidx
sta CIA1_PORT_A
// [63] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B) -- vbuaa=_bnot__deref_pbuc1
lda CIA1_PORT_B
sta CIA1
// [63] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) -- vbuaa=_bnot__deref_pbuc1
lda CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B
eor #$ff
jmp __breturn
// keyboard_matrix_read::@return
@ -8327,14 +8368,28 @@ FINAL SYMBOL TABLE
(const nomodify byte) BOB_SUBTABLE_SIZE = (const nomodify byte) BOB_SHIFTS_X*(const nomodify byte) BOB_SHIFTS_Y
(const byte*) BOB_TABLES[(number) 9*(number) 8*(number) 4] = { fill( 9*8*4, 0) }
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CIA1_PORT_A = (byte*) 56320
(const nomodify byte*) CIA1_PORT_B = (byte*) 56321
(const nomodify byte*) CIA2_PORT_A = (byte*) 56576
(const nomodify byte*) CIA2_PORT_A_DDR = (byte*) 56578
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify byte*) D018 = (byte*) 53272
(const nomodify byte) KEY_SPACE = (byte) $3c
(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
(const word*) MUL40[(number) $20] = { fill( $20, 0) }
(const nomodify byte) NUM_BOBS = (byte) $19
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = (byte) 2
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B = (byte) 1
(const to_nomodify byte*) PROTO_BOB[(number) 3*(number) 3*(number) 8] = kickasm {{ .var pic = LoadPicture("smiley.png", List().add($000000, $ffffff))
.for (var x=0;x<3; x++)
.for (var y=0; y<24; y++)
@ -8757,14 +8812,10 @@ Score: 3582851
.label RASTER = $d012
.label BORDERCOL = $d020
.label D018 = $d018
// CIA#1 Port A: keyboard matrix columns and joystick #2
.label CIA1_PORT_A = $dc00
// CIA#1 Port B: keyboard matrix rows and joystick #1.
.label CIA1_PORT_B = $dc01
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
.const KEY_SPACE = $3c
// The BASIC screen
.label BASIC_SCREEN = $400
@ -8783,6 +8834,8 @@ Score: 3582851
// The number of BOBs to render
.const NUM_BOBS = $19
.const SIZEOF_POINTER = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
// BOB charset ID of the next glyph to be added
.label bob_charset_next_id = $11
// Current index within the progress cursor (0-7)
@ -8837,17 +8890,17 @@ main: {
// [109] phi from main::@12 to renderBobInit [phi:main::@12->renderBobInit]
jsr renderBobInit
// main::vicSelectGfxBank1
// *CIA2_PORT_A_DDR = %00000011
// [10] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// CIA2->PORT_A_DDR = %00000011
// [10] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
lda #3
sta CIA2_PORT_A_DDR
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [11] phi from main::vicSelectGfxBank1 to main::vicSelectGfxBank1_toDd001 [phi:main::vicSelectGfxBank1->main::vicSelectGfxBank1_toDd001]
// main::vicSelectGfxBank1_toDd001
// main::vicSelectGfxBank1_@1
// *CIA2_PORT_A = toDd00(gfx)
// [12] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 -- _deref_pbuc1=vbuc2
// CIA2->PORT_A = toDd00(gfx)
// [12] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 -- _deref_pbuc1=vbuc2
lda #vicSelectGfxBank1_toDd001_return
sta CIA2_PORT_A
sta CIA2
// [13] phi from main::vicSelectGfxBank1_@1 to main::toD0181 [phi:main::vicSelectGfxBank1_@1->main::toD0181]
// main::toD0181
// main::@9
@ -9065,17 +9118,17 @@ main: {
cmp #0
bne __b8
// main::vicSelectGfxBank2
// *CIA2_PORT_A_DDR = %00000011
// [50] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// CIA2->PORT_A_DDR = %00000011
// [50] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
lda #3
sta CIA2_PORT_A_DDR
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [51] phi from main::vicSelectGfxBank2 to main::vicSelectGfxBank2_toDd001 [phi:main::vicSelectGfxBank2->main::vicSelectGfxBank2_toDd001]
// main::vicSelectGfxBank2_toDd001
// main::vicSelectGfxBank2_@1
// *CIA2_PORT_A = toDd00(gfx)
// [52] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 -- _deref_pbuc1=vbuc2
// CIA2->PORT_A = toDd00(gfx)
// [52] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 -- _deref_pbuc1=vbuc2
lda #vicSelectGfxBank2_toDd001_return
sta CIA2_PORT_A
sta CIA2
// [53] phi from main::vicSelectGfxBank2_@1 to main::toD0182 [phi:main::vicSelectGfxBank2_@1->main::toD0182]
// main::toD0182
// main::@10
@ -9117,13 +9170,13 @@ keyboard_key_pressed: {
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
keyboard_matrix_read: {
// *CIA1_PORT_A = keyboard_matrix_row_bitmask[rowid]
// [62] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) -- _deref_pbuc1=_deref_pbuc2
// CIA1->PORT_A = keyboard_matrix_row_bitmask[rowid]
// [62] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) -- _deref_pbuc1=_deref_pbuc2
lda keyboard_matrix_row_bitmask+keyboard_key_pressed.rowidx
sta CIA1_PORT_A
// ~*CIA1_PORT_B
// [63] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B) -- vbuaa=_bnot__deref_pbuc1
lda CIA1_PORT_B
sta CIA1
// ~CIA1->PORT_B
// [63] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) -- vbuaa=_bnot__deref_pbuc1
lda CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B
eor #$ff
// keyboard_matrix_read::@return
// }

View File

@ -10,14 +10,28 @@
(const nomodify byte) BOB_SUBTABLE_SIZE = (const nomodify byte) BOB_SHIFTS_X*(const nomodify byte) BOB_SHIFTS_Y
(const byte*) BOB_TABLES[(number) 9*(number) 8*(number) 4] = { fill( 9*8*4, 0) }
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CIA1_PORT_A = (byte*) 56320
(const nomodify byte*) CIA1_PORT_B = (byte*) 56321
(const nomodify byte*) CIA2_PORT_A = (byte*) 56576
(const nomodify byte*) CIA2_PORT_A_DDR = (byte*) 56578
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const nomodify byte*) D018 = (byte*) 53272
(const nomodify byte) KEY_SPACE = (byte) $3c
(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
(const word*) MUL40[(number) $20] = { fill( $20, 0) }
(const nomodify byte) NUM_BOBS = (byte) $19
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = (byte) 2
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B = (byte) 1
(const to_nomodify byte*) PROTO_BOB[(number) 3*(number) 3*(number) 8] = kickasm {{ .var pic = LoadPicture("smiley.png", List().add($000000, $ffffff))
.for (var x=0;x<3; x++)
.for (var y=0; y<24; y++)

View File

@ -5,14 +5,10 @@
.label RASTER = $d012
.label BORDERCOL = $d020
.label D018 = $d018
// CIA#1 Port A: keyboard matrix columns and joystick #2
.label CIA1_PORT_A = $dc00
// CIA#1 Port B: keyboard matrix rows and joystick #1.
.label CIA1_PORT_B = $dc01
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
.const KEY_SPACE = $3c
// The BASIC screen
.label SCREEN_BASIC = $400
@ -31,6 +27,8 @@
// The number of BOBs to render
.const NUM_BOBS = $14
.const SIZEOF_POINTER = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
.label COS = SIN+$40
// BOB charset ID of the next glyph to be added
.label bob_charset_next_id = 9
@ -62,12 +60,12 @@ main: {
jsr prepareBobs
// renderBobInit()
jsr renderBobInit
// *CIA2_PORT_A_DDR = %00000011
// CIA2->PORT_A_DDR = %00000011
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = toDd00(gfx)
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = toDd00(gfx)
lda #vicSelectGfxBank1_toDd001_return
sta CIA2_PORT_A
sta CIA2
// *D018 = toD018(BOB_SCREEN, BOB_CHARSET)
lda #toD0181_return
sta D018
@ -187,12 +185,12 @@ main: {
// while(keyboard_key_pressed(KEY_SPACE))
cmp #0
bne __b6
// *CIA2_PORT_A_DDR = %00000011
// CIA2->PORT_A_DDR = %00000011
lda #3
sta CIA2_PORT_A_DDR
// *CIA2_PORT_A = toDd00(gfx)
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// CIA2->PORT_A = toDd00(gfx)
lda #vicSelectGfxBank2_toDd001_return
sta CIA2_PORT_A
sta CIA2
// *D018 = toD018(SCREEN_BASIC, CHARSET_BASIC)
lda #toD0182_return
sta D018
@ -219,11 +217,11 @@ keyboard_key_pressed: {
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
keyboard_matrix_read: {
// *CIA1_PORT_A = keyboard_matrix_row_bitmask[rowid]
// CIA1->PORT_A = keyboard_matrix_row_bitmask[rowid]
lda keyboard_matrix_row_bitmask+keyboard_key_pressed.rowidx
sta CIA1_PORT_A
// ~*CIA1_PORT_B
lda CIA1_PORT_B
sta CIA1
// ~CIA1->PORT_B
lda CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B
eor #$ff
// }
rts

View File

@ -22,13 +22,13 @@ main::@10: scope:[main] from main::@9
[9] call renderBobInit
to:main::vicSelectGfxBank1
main::vicSelectGfxBank1: scope:[main] from main::@10
[10] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[10] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
to:main::vicSelectGfxBank1_toDd001
main::vicSelectGfxBank1_toDd001: scope:[main] from main::vicSelectGfxBank1
[11] phi()
to:main::vicSelectGfxBank1_@1
main::vicSelectGfxBank1_@1: scope:[main] from main::vicSelectGfxBank1_toDd001
[12] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0
[12] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0
to:main::toD0181
main::toD0181: scope:[main] from main::vicSelectGfxBank1_@1
[13] phi()
@ -104,13 +104,13 @@ main::@16: scope:[main] from main::@6
[54] if((byte) 0!=(byte~) main::$21) goto main::@6
to:main::vicSelectGfxBank2
main::vicSelectGfxBank2: scope:[main] from main::@16
[55] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[55] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
to:main::vicSelectGfxBank2_toDd001
main::vicSelectGfxBank2_toDd001: scope:[main] from main::vicSelectGfxBank2
[56] phi()
to:main::vicSelectGfxBank2_@1
main::vicSelectGfxBank2_@1: scope:[main] from main::vicSelectGfxBank2_toDd001
[57] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0
[57] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0
to:main::toD0182
main::toD0182: scope:[main] from main::vicSelectGfxBank2_@1
[58] phi()
@ -138,8 +138,8 @@ keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_p
(byte()) keyboard_matrix_read((byte) keyboard_matrix_read::rowid)
keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_key_pressed
[67] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0)
[68] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B)
[67] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0)
[68] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B)
to:keyboard_matrix_read::@return
keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matrix_read
[69] return

View File

@ -1,4 +1,16 @@
Resolved forward reference bob_charset_next_id to (byte) bob_charset_next_id
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_A_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_B_DDR with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B_DDR)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_B with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_A with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA1).PORT_B with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).TIMER_A_CONTROL with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).TIMER_B_CONTROL with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).TIMER_B_CONTROL with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_B_CONTROL)
Replacing struct member reference *((const nomodify struct MOS6526_CIA*) CIA2).TIMER_A_CONTROL with member unwinding reference *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_TIMER_A_CONTROL)
Inlined call (byte~) vicSelectGfxBank::$0 ← call toDd00 (byte*) vicSelectGfxBank::gfx
Inlined call call mulf8s_prepare (signed byte) mulf8s::a
Inlined call call vicSelectGfxBank (const nomodify byte*) BOB_SCREEN
@ -57,8 +69,8 @@ memset::@return: scope:[memset] from memset::@1
(byte()) keyboard_matrix_read((byte) keyboard_matrix_read::rowid)
keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_key_pressed
(byte) keyboard_matrix_read::rowid#1 ← phi( keyboard_key_pressed/(byte) keyboard_matrix_read::rowid#0 )
*((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#1)
(byte~) keyboard_matrix_read::$0 ← ~ *((const nomodify byte*) CIA1_PORT_B)
*((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#1)
(byte~) keyboard_matrix_read::$0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B)
(byte) keyboard_matrix_read::row_pressed_bits#0 ← (byte~) keyboard_matrix_read::$0
(byte) keyboard_matrix_read::return#0 ← (byte) keyboard_matrix_read::row_pressed_bits#0
to:keyboard_matrix_read::@return
@ -337,7 +349,7 @@ main::vicSelectGfxBank1: scope:[main] from main::@14
(byte*) progress_cursor#68 ← phi( main::@14/(byte*) progress_cursor#69 )
(byte**) renderBobCleanupNext#46 ← phi( main::@14/(byte**) renderBobCleanupNext#47 )
(byte*) main::vicSelectGfxBank1_gfx#1 ← phi( main::@14/(byte*) main::vicSelectGfxBank1_gfx#0 )
*((const nomodify byte*) CIA2_PORT_A_DDR) ← (number) 3
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) 3
(byte*) main::vicSelectGfxBank1_toDd001_gfx#0 ← (byte*) main::vicSelectGfxBank1_gfx#1
to:main::vicSelectGfxBank1_toDd001
main::vicSelectGfxBank1_toDd001: scope:[main] from main::vicSelectGfxBank1
@ -366,7 +378,7 @@ main::vicSelectGfxBank1_@1: scope:[main] from main::vicSelectGfxBank1_toDd001_@
(byte**) renderBobCleanupNext#40 ← phi( main::vicSelectGfxBank1_toDd001_@return/(byte**) renderBobCleanupNext#42 )
(byte) main::vicSelectGfxBank1_toDd001_return#3 ← phi( main::vicSelectGfxBank1_toDd001_@return/(byte) main::vicSelectGfxBank1_toDd001_return#1 )
(byte~) main::vicSelectGfxBank1_$0 ← (byte) main::vicSelectGfxBank1_toDd001_return#3
*((const nomodify byte*) CIA2_PORT_A) ← (byte~) main::vicSelectGfxBank1_$0
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (byte~) main::vicSelectGfxBank1_$0
to:main::@8
main::@8: scope:[main] from main::vicSelectGfxBank1_@1
(byte) bob_charset_next_id#68 ← phi( main::vicSelectGfxBank1_@1/(byte) bob_charset_next_id#70 )
@ -586,7 +598,7 @@ main::vicSelectGfxBank2: scope:[main] from main::@7
(byte) progress_idx#46 ← phi( main::@7/(byte) progress_idx#47 )
(byte*) progress_cursor#46 ← phi( main::@7/(byte*) progress_cursor#47 )
(byte*) main::vicSelectGfxBank2_gfx#1 ← phi( main::@7/(byte*) main::vicSelectGfxBank2_gfx#0 )
*((const nomodify byte*) CIA2_PORT_A_DDR) ← (number) 3
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) 3
(byte*) main::vicSelectGfxBank2_toDd001_gfx#0 ← (byte*) main::vicSelectGfxBank2_gfx#1
to:main::vicSelectGfxBank2_toDd001
main::vicSelectGfxBank2_toDd001: scope:[main] from main::vicSelectGfxBank2
@ -615,7 +627,7 @@ main::vicSelectGfxBank2_@1: scope:[main] from main::vicSelectGfxBank2_toDd001_@
(byte*) progress_cursor#39 ← phi( main::vicSelectGfxBank2_toDd001_@return/(byte*) progress_cursor#42 )
(byte) main::vicSelectGfxBank2_toDd001_return#3 ← phi( main::vicSelectGfxBank2_toDd001_@return/(byte) main::vicSelectGfxBank2_toDd001_return#1 )
(byte~) main::vicSelectGfxBank2_$0 ← (byte) main::vicSelectGfxBank2_toDd001_return#3
*((const nomodify byte*) CIA2_PORT_A) ← (byte~) main::vicSelectGfxBank2_$0
*((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (byte~) main::vicSelectGfxBank2_$0
to:main::@10
main::@10: scope:[main] from main::vicSelectGfxBank2_@1
(byte**) renderBobCleanupNext#30 ← phi( main::vicSelectGfxBank2_@1/(byte**) renderBobCleanupNext#33 )
@ -1248,15 +1260,30 @@ SYMBOL TABLE SSA
(const byte*) BOB_TABLES[(number) 9*(number) 8*(number) 4] = { fill( 9*8*4, 0) }
(const nomodify byte*) BORDERCOL = (byte*)(number) $d020
(const nomodify byte*) CHARSET_BASIC = (byte*)(number) $1000
(const nomodify byte*) CIA1_PORT_A = (byte*)(number) $dc00
(const nomodify byte*) CIA1_PORT_B = (byte*)(number) $dc01
(const nomodify byte*) CIA2_PORT_A = (byte*)(number) $dd00
(const nomodify byte*) CIA2_PORT_A_DDR = (byte*)(number) $dd02
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*)(number) $dc00
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*)(number) $dd00
(const signed byte*) COS = (const signed byte*) SIN+(number) $40
(const nomodify byte*) D018 = (byte*)(number) $d018
(const nomodify byte) KEY_SPACE = (byte) $3c
(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
(const word*) MUL40[(number) $20] = { fill( $20, 0) }
(const nomodify byte) NUM_BOBS = (byte) $14
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A = (byte) 0
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = (byte) 2
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B = (byte) 1
(const to_nomodify byte*) PROTO_BOB[(number) 3*(number) 3*(number) 8] = kickasm {{ .var pic = LoadPicture("smiley.png", List().add($000000, $ffffff))
.for (var x=0;x<3; x++)
.for (var y=0; y<24; y++)
@ -2305,7 +2332,7 @@ Adding number conversion cast (unumber) $1ff in *((const byte*) mulf_sqr2_hi+(nu
Adding number conversion cast (unumber) 1 in (byte) mulf_init::dir#1 ← (number) 1
Adding number conversion cast (snumber) 0 in (bool~) mulf8s_prepared::$1 ← *((const nomodify signed byte*) mulf8s_prepared::memA) < (number) 0
Adding number conversion cast (snumber) 0 in (bool~) mulf8s_prepared::$3 ← (signed byte) mulf8s_prepared::b#2 < (number) 0
Adding number conversion cast (unumber) 3 in *((const nomodify byte*) CIA2_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) 3 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) $40 in (number~) main::vicSelectGfxBank1_toDd001_$1 ← (byte~) main::vicSelectGfxBank1_toDd001_$0 / (number) $40
Adding number conversion cast (unumber) main::vicSelectGfxBank1_toDd001_$1 in (number~) main::vicSelectGfxBank1_toDd001_$1 ← (byte~) main::vicSelectGfxBank1_toDd001_$0 / (unumber)(number) $40
Adding number conversion cast (unumber) 3 in (number~) main::vicSelectGfxBank1_toDd001_$2 ← (number) 3 ^ (unumber~) main::vicSelectGfxBank1_toDd001_$1
@ -2339,7 +2366,7 @@ Adding number conversion cast (unumber) 3 in (byte) main::angle#1 ← (byte) mai
Adding number conversion cast (unumber) 0 in *((const nomodify byte*) BORDERCOL) ← (number) 0
Adding number conversion cast (unumber) 0 in (bool~) main::$23 ← (number) 0 != (byte~) main::$19
Adding number conversion cast (unumber) 0 in (bool~) main::$22 ← (number) 0 != (byte~) main::$21
Adding number conversion cast (unumber) 3 in *((const nomodify byte*) CIA2_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) 3 in *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (number) 3
Adding number conversion cast (unumber) $40 in (number~) main::vicSelectGfxBank2_toDd001_$1 ← (byte~) main::vicSelectGfxBank2_toDd001_$0 / (number) $40
Adding number conversion cast (unumber) main::vicSelectGfxBank2_toDd001_$1 in (number~) main::vicSelectGfxBank2_toDd001_$1 ← (byte~) main::vicSelectGfxBank2_toDd001_$0 / (unumber)(number) $40
Adding number conversion cast (unumber) 3 in (number~) main::vicSelectGfxBank2_toDd001_$2 ← (number) 3 ^ (unumber~) main::vicSelectGfxBank2_toDd001_$1
@ -2445,14 +2472,14 @@ Adding number conversion cast (unumber) 0 in (byte) progress_idx#9 ← (number)
Successful SSA optimization PassNAddNumberTypeConversions
Inlining cast (byte*) memset::dst#0 ← (byte*)(void*) memset::str#2
Inlining cast (byte) mulf_init::dir#1 ← (unumber)(number) 1
Inlining cast *((const nomodify byte*) CIA2_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast (byte) memset::c#0 ← (unumber)(number) 0
Inlining cast (word) memset::num#0 ← (unumber)(number) $3e8
Inlining cast *((const nomodify byte*) BORDERCOL) ← (unumber)(number) $f
Inlining cast *((const nomodify byte*) BORDERCOL) ← (unumber)(number) 1
Inlining cast *((const nomodify byte*) BORDERCOL) ← (unumber)(number) 2
Inlining cast *((const nomodify byte*) BORDERCOL) ← (unumber)(number) 0
Inlining cast *((const nomodify byte*) CIA2_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (unumber)(number) 3
Inlining cast *((byte*) renderBobCleanup::screen#0 + (unumber)(number) 0) ← (unumber)(number) 0
Inlining cast *((byte*) renderBobCleanup::screen#0 + (unumber)(number) $28) ← (unumber)(number) 0
Inlining cast *((byte*) renderBobCleanup::screen#0 + (unumber)(number) $50) ← (unumber)(number) 0
@ -2474,10 +2501,8 @@ Successful SSA optimization Pass2InlineCast
Simplifying constant pointer cast (byte*) 53266
Simplifying constant pointer cast (byte*) 53280
Simplifying constant pointer cast (byte*) 53272
Simplifying constant pointer cast (byte*) 56320
Simplifying constant pointer cast (byte*) 56321
Simplifying constant pointer cast (byte*) 56576
Simplifying constant pointer cast (byte*) 56578
Simplifying constant pointer cast (struct MOS6526_CIA*) 56320
Simplifying constant pointer cast (struct MOS6526_CIA*) 56576
Simplifying constant pointer cast (byte*) 253
Simplifying constant pointer cast (byte*) 254
Simplifying constant pointer cast (byte*) 255
@ -3137,6 +3162,9 @@ Resolved ranged next value [255] renderBobCleanup::i#1 ← ++ renderBobCleanup::
Resolved ranged comparison value [257] if(renderBobCleanup::i#1!=rangelast(0,NUM_BOBS-1)) goto renderBobCleanup::@1 to (const nomodify byte) NUM_BOBS-(byte) 1+(number) 1
Simplifying constant evaluating to zero (byte) 0*(const nomodify byte) BOB_SUBTABLE_SIZE in [232] *((byte*) renderBob::screen#0 + (byte) 0) ← *((const byte*) BOB_TABLES+(byte) 0*(const nomodify byte) BOB_SUBTABLE_SIZE + (byte) renderBob::bob_table_idx#0)
Successful SSA optimization PassNSimplifyConstantZero
Simplifying expression containing zero (byte*)CIA1 in [14] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask + (byte) keyboard_matrix_read::rowid#0)
Simplifying expression containing zero (byte*)CIA2 in [115] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (byte) main::vicSelectGfxBank1_toDd001_return#0
Simplifying expression containing zero (byte*)CIA2 in [188] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A) ← (byte) main::vicSelectGfxBank2_toDd001_return#0
Simplifying expression containing zero BOB_TABLES in [232] *((byte*) renderBob::screen#0 + (byte) 0) ← *((const byte*) BOB_TABLES+(byte) 0 + (byte) renderBob::bob_table_idx#0)
Simplifying expression containing zero renderBob::screen#0 in [232] *((byte*) renderBob::screen#0 + (byte) 0) ← *((const byte*) BOB_TABLES + (byte) renderBob::bob_table_idx#0)
Simplifying expression containing zero renderBobCleanup::screen#0 in [246] *((byte*) renderBobCleanup::screen#0 + (byte) 0) ← (byte) 0
@ -3146,6 +3174,7 @@ Eliminating unused variable - keeping the phi block (byte**) renderBobCleanupNex
Eliminating unused variable - keeping the phi block (byte**) renderBobCleanupNext#11
Eliminating unused variable (byte) bobCharsetFindOrAddGlyph::return#0 and assignment [199] (byte) bobCharsetFindOrAddGlyph::return#0 ← (byte) bobCharsetFindOrAddGlyph::glyph_id#11
Eliminating unused constant (const void*) memset::return#2
Eliminating unused constant (const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A
Eliminating unused constant (const byte) bob_charset_next_id#27
Eliminating unused constant (const byte*) progress_cursor#27
Eliminating unused constant (const byte) progress_idx#27
@ -3652,13 +3681,13 @@ main::@10: scope:[main] from main::@9
[9] call renderBobInit
to:main::vicSelectGfxBank1
main::vicSelectGfxBank1: scope:[main] from main::@10
[10] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[10] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
to:main::vicSelectGfxBank1_toDd001
main::vicSelectGfxBank1_toDd001: scope:[main] from main::vicSelectGfxBank1
[11] phi()
to:main::vicSelectGfxBank1_@1
main::vicSelectGfxBank1_@1: scope:[main] from main::vicSelectGfxBank1_toDd001
[12] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0
[12] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0
to:main::toD0181
main::toD0181: scope:[main] from main::vicSelectGfxBank1_@1
[13] phi()
@ -3734,13 +3763,13 @@ main::@16: scope:[main] from main::@6
[54] if((byte) 0!=(byte~) main::$21) goto main::@6
to:main::vicSelectGfxBank2
main::vicSelectGfxBank2: scope:[main] from main::@16
[55] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3
[55] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3
to:main::vicSelectGfxBank2_toDd001
main::vicSelectGfxBank2_toDd001: scope:[main] from main::vicSelectGfxBank2
[56] phi()
to:main::vicSelectGfxBank2_@1
main::vicSelectGfxBank2_@1: scope:[main] from main::vicSelectGfxBank2_toDd001
[57] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0
[57] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0
to:main::toD0182
main::toD0182: scope:[main] from main::vicSelectGfxBank2_@1
[58] phi()
@ -3768,8 +3797,8 @@ keyboard_key_pressed::@return: scope:[keyboard_key_pressed] from keyboard_key_p
(byte()) keyboard_matrix_read((byte) keyboard_matrix_read::rowid)
keyboard_matrix_read: scope:[keyboard_matrix_read] from keyboard_key_pressed
[67] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0)
[68] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B)
[67] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0)
[68] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B)
to:keyboard_matrix_read::@return
keyboard_matrix_read::@return: scope:[keyboard_matrix_read] from keyboard_matrix_read
[69] return
@ -4208,6 +4237,20 @@ mulf_init::@3: scope:[mulf_init] from mulf_init::@2 mulf_init::@4
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()) bobCharsetFindOrAddGlyph((byte*) bobCharsetFindOrAddGlyph::bob_glyph)
(byte*) bobCharsetFindOrAddGlyph::bob_glyph
(byte*) bobCharsetFindOrAddGlyph::bob_glyph#1 200002.0
@ -4764,14 +4807,10 @@ Target platform is c64basic / MOS6502X
.label RASTER = $d012
.label BORDERCOL = $d020
.label D018 = $d018
// CIA#1 Port A: keyboard matrix columns and joystick #2
.label CIA1_PORT_A = $dc00
// CIA#1 Port B: keyboard matrix rows and joystick #1.
.label CIA1_PORT_B = $dc01
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
.const KEY_SPACE = $3c
// The BASIC screen
.label SCREEN_BASIC = $400
@ -4790,6 +4829,8 @@ Target platform is c64basic / MOS6502X
// The number of BOBs to render
.const NUM_BOBS = $14
.const SIZEOF_POINTER = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
.label COS = SIN+$40
// BOB charset ID of the next glyph to be added
.label bob_charset_next_id = $1c
@ -4859,9 +4900,9 @@ main: {
jmp vicSelectGfxBank1
// main::vicSelectGfxBank1
vicSelectGfxBank1:
// [10] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// [10] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
lda #3
sta CIA2_PORT_A_DDR
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [11] phi from main::vicSelectGfxBank1 to main::vicSelectGfxBank1_toDd001 [phi:main::vicSelectGfxBank1->main::vicSelectGfxBank1_toDd001]
vicSelectGfxBank1_toDd001_from_vicSelectGfxBank1:
jmp vicSelectGfxBank1_toDd001
@ -4870,9 +4911,9 @@ main: {
jmp vicSelectGfxBank1___b1
// main::vicSelectGfxBank1_@1
vicSelectGfxBank1___b1:
// [12] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 -- _deref_pbuc1=vbuc2
// [12] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 -- _deref_pbuc1=vbuc2
lda #vicSelectGfxBank1_toDd001_return
sta CIA2_PORT_A
sta CIA2
// [13] phi from main::vicSelectGfxBank1_@1 to main::toD0181 [phi:main::vicSelectGfxBank1_@1->main::toD0181]
toD0181_from_vicSelectGfxBank1___b1:
jmp toD0181
@ -5120,9 +5161,9 @@ main: {
jmp vicSelectGfxBank2
// main::vicSelectGfxBank2
vicSelectGfxBank2:
// [55] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// [55] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
lda #3
sta CIA2_PORT_A_DDR
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [56] phi from main::vicSelectGfxBank2 to main::vicSelectGfxBank2_toDd001 [phi:main::vicSelectGfxBank2->main::vicSelectGfxBank2_toDd001]
vicSelectGfxBank2_toDd001_from_vicSelectGfxBank2:
jmp vicSelectGfxBank2_toDd001
@ -5131,9 +5172,9 @@ main: {
jmp vicSelectGfxBank2___b1
// main::vicSelectGfxBank2_@1
vicSelectGfxBank2___b1:
// [57] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 -- _deref_pbuc1=vbuc2
// [57] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 -- _deref_pbuc1=vbuc2
lda #vicSelectGfxBank2_toDd001_return
sta CIA2_PORT_A
sta CIA2
// [58] phi from main::vicSelectGfxBank2_@1 to main::toD0182 [phi:main::vicSelectGfxBank2_@1->main::toD0182]
toD0182_from_vicSelectGfxBank2___b1:
jmp toD0182
@ -5193,11 +5234,11 @@ keyboard_key_pressed: {
keyboard_matrix_read: {
.label return = $4f
.label return_1 = $4c
// [67] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) -- _deref_pbuc1=_deref_pbuc2
// [67] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) -- _deref_pbuc1=_deref_pbuc2
lda keyboard_matrix_row_bitmask+keyboard_key_pressed.rowidx
sta CIA1_PORT_A
// [68] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B) -- vbuz1=_bnot__deref_pbuc1
lda CIA1_PORT_B
sta CIA1
// [68] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) -- vbuz1=_bnot__deref_pbuc1
lda CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B
eor #$ff
sta.z return
jmp __breturn
@ -6616,8 +6657,8 @@ SIN:
MUL40: .fill 2*$20, 0
REGISTER UPLIFT POTENTIAL REGISTERS
Statement [10] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [12] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [10] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [12] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [14] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [17] if(*((const nomodify byte*) RASTER)<(byte) $f8) goto main::@2 [ main::angle#8 ] ( main:2 [ main::angle#8 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:2 [ main::angle#8 main::angle#1 ]
@ -6638,11 +6679,11 @@ Statement [37] (byte) main::a#1 ← (byte) main::a#2 + (byte) $62 [ main::angle#
Statement [38] (signed byte) main::r#1 ← (signed byte) main::r#2 + (signed byte) 3 [ main::angle#8 renderBobCleanupNext#17 main::i#2 main::r#1 main::a#1 main::x#0 main::y#0 ] ( main:2 [ main::angle#8 renderBobCleanupNext#17 main::i#2 main::r#1 main::a#1 main::x#0 main::y#0 ] { } ) always clobbers reg byte a
Statement [44] (byte) main::angle#1 ← (byte) main::angle#8 + (byte) 3 [ main::angle#1 ] ( main:2 [ main::angle#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } } ) always clobbers reg byte a
Statement [45] *((const nomodify byte*) BORDERCOL) ← (byte) 0 [ main::angle#1 ] ( main:2 [ main::angle#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } } ) always clobbers reg byte a
Statement [55] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [57] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [55] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [57] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [59] *((const nomodify byte*) D018) ← (const byte) main::toD0182_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [67] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::keyboard_key_pressed:46::keyboard_matrix_read:62 [ main::angle#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:51::keyboard_matrix_read:62 [ ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [68] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B) [ keyboard_matrix_read::return#0 ] ( main:2::keyboard_key_pressed:46::keyboard_matrix_read:62 [ main::angle#1 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:51::keyboard_matrix_read:62 [ keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [67] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::keyboard_key_pressed:46::keyboard_matrix_read:62 [ main::angle#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:51::keyboard_matrix_read:62 [ ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [68] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) [ keyboard_matrix_read::return#0 ] ( main:2::keyboard_key_pressed:46::keyboard_matrix_read:62 [ main::angle#1 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:51::keyboard_matrix_read:62 [ keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [70] (byte) renderBob::x_char_offset#0 ← (byte) renderBob::xpos#0 >> (byte) 2 [ renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 ] ( main:2::renderBob:41 [ main::angle#8 main::i#2 main::r#1 main::a#1 renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 ] { } ) always clobbers reg byte a
Removing always clobbered register reg byte a as potential for zp[1]:70 [ renderBob::xpos#0 ]
Removing always clobbered register reg byte a as potential for zp[1]:71 [ renderBob::ypos#0 ]
@ -6774,8 +6815,8 @@ Removing always clobbered register reg byte y as potential for zp[1]:44 [ mulf_i
Removing always clobbered register reg byte y as potential for zp[1]:47 [ mulf_init::x_2#3 mulf_init::x_2#2 mulf_init::x_2#1 ]
Statement [268] *((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::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 ] { } ) always clobbers reg byte y
Statement [270] (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::mulf_init:5 [ 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 [10] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [12] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [10] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [12] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [14] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [17] if(*((const nomodify byte*) RASTER)<(byte) $f8) goto main::@2 [ main::angle#8 ] ( main:2 [ main::angle#8 ] { } ) always clobbers reg byte a
Statement [18] *((const nomodify byte*) BORDERCOL) ← (byte) $f [ main::angle#8 ] ( main:2 [ main::angle#8 ] { } ) always clobbers reg byte a
@ -6797,11 +6838,11 @@ Statement [38] (signed byte) main::r#1 ← (signed byte) main::r#2 + (signed byt
Statement [43] if((byte) main::i#1!=(const nomodify byte) NUM_BOBS-(byte) 1+(byte) 1) goto main::@4 [ main::angle#8 main::r#1 main::a#1 renderBobCleanupNext#13 main::i#1 ] ( main:2 [ main::angle#8 main::r#1 main::a#1 renderBobCleanupNext#13 main::i#1 ] { } ) always clobbers reg byte a
Statement [44] (byte) main::angle#1 ← (byte) main::angle#8 + (byte) 3 [ main::angle#1 ] ( main:2 [ main::angle#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } } ) always clobbers reg byte a reg byte x
Statement [45] *((const nomodify byte*) BORDERCOL) ← (byte) 0 [ main::angle#1 ] ( main:2 [ main::angle#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } } ) always clobbers reg byte a
Statement [55] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [57] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [55] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [57] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [59] *((const nomodify byte*) D018) ← (const byte) main::toD0182_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [67] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::keyboard_key_pressed:46::keyboard_matrix_read:62 [ main::angle#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:51::keyboard_matrix_read:62 [ ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [68] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B) [ keyboard_matrix_read::return#0 ] ( main:2::keyboard_key_pressed:46::keyboard_matrix_read:62 [ main::angle#1 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:51::keyboard_matrix_read:62 [ keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [67] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::keyboard_key_pressed:46::keyboard_matrix_read:62 [ main::angle#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:51::keyboard_matrix_read:62 [ ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [68] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) [ keyboard_matrix_read::return#0 ] ( main:2::keyboard_key_pressed:46::keyboard_matrix_read:62 [ main::angle#1 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:51::keyboard_matrix_read:62 [ keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [70] (byte) renderBob::x_char_offset#0 ← (byte) renderBob::xpos#0 >> (byte) 2 [ renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 ] ( main:2::renderBob:41 [ main::angle#8 main::i#2 main::r#1 main::a#1 renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 ] { } ) always clobbers reg byte a
Statement [71] (byte) renderBob::y_char_offset#0 ← (byte) renderBob::ypos#0 >> (byte) 3 [ renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 renderBob::y_char_offset#0 ] ( main:2::renderBob:41 [ main::angle#8 main::i#2 main::r#1 main::a#1 renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 renderBob::y_char_offset#0 ] { } ) always clobbers reg byte a
Statement [72] (byte~) renderBob::$8 ← (byte) renderBob::y_char_offset#0 << (byte) 1 [ renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 renderBob::$8 ] ( main:2::renderBob:41 [ main::angle#8 main::i#2 main::r#1 main::a#1 renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 renderBob::$8 ] { } ) always clobbers reg byte a
@ -6884,8 +6925,8 @@ Statement [260] (byte~) mulf_init::$1 ← (byte) mulf_init::c#1 & (byte) 1 [ mul
Statement [266] *((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::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 ] { } ) always clobbers reg byte y
Statement [268] *((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::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 ] { } ) always clobbers reg byte y
Statement [270] (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::mulf_init:5 [ 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 [10] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [12] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [10] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [12] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [14] *((const nomodify byte*) D018) ← (const byte) main::toD0181_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [17] if(*((const nomodify byte*) RASTER)<(byte) $f8) goto main::@2 [ main::angle#8 ] ( main:2 [ main::angle#8 ] { } ) always clobbers reg byte a
Statement [18] *((const nomodify byte*) BORDERCOL) ← (byte) $f [ main::angle#8 ] ( main:2 [ main::angle#8 ] { } ) always clobbers reg byte a
@ -6906,11 +6947,11 @@ Statement [38] (signed byte) main::r#1 ← (signed byte) main::r#2 + (signed byt
Statement [43] if((byte) main::i#1!=(const nomodify byte) NUM_BOBS-(byte) 1+(byte) 1) goto main::@4 [ main::angle#8 main::r#1 main::a#1 renderBobCleanupNext#13 main::i#1 ] ( main:2 [ main::angle#8 main::r#1 main::a#1 renderBobCleanupNext#13 main::i#1 ] { } ) always clobbers reg byte a
Statement [44] (byte) main::angle#1 ← (byte) main::angle#8 + (byte) 3 [ main::angle#1 ] ( main:2 [ main::angle#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } } ) always clobbers reg byte a reg byte x
Statement [45] *((const nomodify byte*) BORDERCOL) ← (byte) 0 [ main::angle#1 ] ( main:2 [ main::angle#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } } ) always clobbers reg byte a
Statement [55] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [57] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [55] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [57] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [59] *((const nomodify byte*) D018) ← (const byte) main::toD0182_return#0 [ ] ( main:2 [ ] { } ) always clobbers reg byte a
Statement [67] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::keyboard_key_pressed:46::keyboard_matrix_read:62 [ main::angle#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:51::keyboard_matrix_read:62 [ ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [68] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B) [ keyboard_matrix_read::return#0 ] ( main:2::keyboard_key_pressed:46::keyboard_matrix_read:62 [ main::angle#1 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:51::keyboard_matrix_read:62 [ keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [67] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) [ ] ( main:2::keyboard_key_pressed:46::keyboard_matrix_read:62 [ main::angle#1 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:51::keyboard_matrix_read:62 [ ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [68] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) [ keyboard_matrix_read::return#0 ] ( main:2::keyboard_key_pressed:46::keyboard_matrix_read:62 [ main::angle#1 keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#2 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } main:2::keyboard_key_pressed:51::keyboard_matrix_read:62 [ keyboard_matrix_read::return#0 ] { { keyboard_key_pressed::return#0 = keyboard_key_pressed::return#3 } { keyboard_matrix_read::return#0 = keyboard_matrix_read::return#2 } } ) always clobbers reg byte a
Statement [70] (byte) renderBob::x_char_offset#0 ← (byte) renderBob::xpos#0 >> (byte) 2 [ renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 ] ( main:2::renderBob:41 [ main::angle#8 main::i#2 main::r#1 main::a#1 renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 ] { } ) always clobbers reg byte a
Statement [71] (byte) renderBob::y_char_offset#0 ← (byte) renderBob::ypos#0 >> (byte) 3 [ renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 renderBob::y_char_offset#0 ] ( main:2::renderBob:41 [ main::angle#8 main::i#2 main::r#1 main::a#1 renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 renderBob::y_char_offset#0 ] { } ) always clobbers reg byte a
Statement [72] (byte~) renderBob::$8 ← (byte) renderBob::y_char_offset#0 << (byte) 1 [ renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 renderBob::$8 ] ( main:2::renderBob:41 [ main::angle#8 main::i#2 main::r#1 main::a#1 renderBobCleanupNext#17 renderBob::xpos#0 renderBob::ypos#0 renderBob::x_char_offset#0 renderBob::$8 ] { } ) always clobbers reg byte a
@ -7106,6 +7147,7 @@ Uplift Scope [main] 2,002: zp[2]:58 [ main::$10 ] 2,002: zp[2]:64 [ main::$12 ]
Uplift Scope [keyboard_matrix_read] 3,667.33: zp[1]:79 [ keyboard_matrix_read::return#0 ] 2,002: zp[1]:76 [ keyboard_matrix_read::return#2 ]
Uplift Scope [memset] 3,336.67: zp[2]:13 [ memset::dst#2 memset::dst#1 ]
Uplift Scope [keyboard_key_pressed] 2,002: zp[1]:77 [ keyboard_key_pressed::$2 ] 300.75: zp[1]:78 [ keyboard_key_pressed::return#0 ] 202: zp[1]:72 [ keyboard_key_pressed::return#2 ] 202: zp[1]:74 [ keyboard_key_pressed::return#3 ]
Uplift Scope [MOS6526_CIA]
Uplift Scope [RADIX]
Uplift Scope [progress_init]
Uplift Scope [progress_inc]
@ -7134,6 +7176,7 @@ Uplifting [keyboard_matrix_read] best 3965606 combination reg byte a [ keyboard_
Uplifting [memset] best 3965606 combination zp[2]:13 [ memset::dst#2 memset::dst#1 ]
Uplifting [keyboard_key_pressed] best 3965417 combination reg byte a [ keyboard_key_pressed::$2 ] reg byte a [ keyboard_key_pressed::return#0 ] reg byte a [ keyboard_key_pressed::return#2 ] reg byte a [ keyboard_key_pressed::return#3 ]
Limited combination testing to 100 combinations of 256 possible.
Uplifting [MOS6526_CIA] best 3965417 combination
Uplifting [RADIX] best 3965417 combination
Uplifting [progress_init] best 3965417 combination
Uplifting [progress_inc] best 3965417 combination
@ -7244,14 +7287,10 @@ ASSEMBLER BEFORE OPTIMIZATION
.label RASTER = $d012
.label BORDERCOL = $d020
.label D018 = $d018
// CIA#1 Port A: keyboard matrix columns and joystick #2
.label CIA1_PORT_A = $dc00
// CIA#1 Port B: keyboard matrix rows and joystick #1.
.label CIA1_PORT_B = $dc01
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
.const KEY_SPACE = $3c
// The BASIC screen
.label SCREEN_BASIC = $400
@ -7270,6 +7309,8 @@ ASSEMBLER BEFORE OPTIMIZATION
// The number of BOBs to render
.const NUM_BOBS = $14
.const SIZEOF_POINTER = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
.label COS = SIN+$40
// BOB charset ID of the next glyph to be added
.label bob_charset_next_id = 9
@ -7337,9 +7378,9 @@ main: {
jmp vicSelectGfxBank1
// main::vicSelectGfxBank1
vicSelectGfxBank1:
// [10] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// [10] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
lda #3
sta CIA2_PORT_A_DDR
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [11] phi from main::vicSelectGfxBank1 to main::vicSelectGfxBank1_toDd001 [phi:main::vicSelectGfxBank1->main::vicSelectGfxBank1_toDd001]
vicSelectGfxBank1_toDd001_from_vicSelectGfxBank1:
jmp vicSelectGfxBank1_toDd001
@ -7348,9 +7389,9 @@ main: {
jmp vicSelectGfxBank1___b1
// main::vicSelectGfxBank1_@1
vicSelectGfxBank1___b1:
// [12] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 -- _deref_pbuc1=vbuc2
// [12] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 -- _deref_pbuc1=vbuc2
lda #vicSelectGfxBank1_toDd001_return
sta CIA2_PORT_A
sta CIA2
// [13] phi from main::vicSelectGfxBank1_@1 to main::toD0181 [phi:main::vicSelectGfxBank1_@1->main::toD0181]
toD0181_from_vicSelectGfxBank1___b1:
jmp toD0181
@ -7564,9 +7605,9 @@ main: {
jmp vicSelectGfxBank2
// main::vicSelectGfxBank2
vicSelectGfxBank2:
// [55] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// [55] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
lda #3
sta CIA2_PORT_A_DDR
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [56] phi from main::vicSelectGfxBank2 to main::vicSelectGfxBank2_toDd001 [phi:main::vicSelectGfxBank2->main::vicSelectGfxBank2_toDd001]
vicSelectGfxBank2_toDd001_from_vicSelectGfxBank2:
jmp vicSelectGfxBank2_toDd001
@ -7575,9 +7616,9 @@ main: {
jmp vicSelectGfxBank2___b1
// main::vicSelectGfxBank2_@1
vicSelectGfxBank2___b1:
// [57] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 -- _deref_pbuc1=vbuc2
// [57] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 -- _deref_pbuc1=vbuc2
lda #vicSelectGfxBank2_toDd001_return
sta CIA2_PORT_A
sta CIA2
// [58] phi from main::vicSelectGfxBank2_@1 to main::toD0182 [phi:main::vicSelectGfxBank2_@1->main::toD0182]
toD0182_from_vicSelectGfxBank2___b1:
jmp toD0182
@ -7625,11 +7666,11 @@ keyboard_key_pressed: {
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
keyboard_matrix_read: {
// [67] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) -- _deref_pbuc1=_deref_pbuc2
// [67] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) -- _deref_pbuc1=_deref_pbuc2
lda keyboard_matrix_row_bitmask+keyboard_key_pressed.rowidx
sta CIA1_PORT_A
// [68] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B) -- vbuaa=_bnot__deref_pbuc1
lda CIA1_PORT_B
sta CIA1
// [68] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) -- vbuaa=_bnot__deref_pbuc1
lda CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B
eor #$ff
jmp __breturn
// keyboard_matrix_read::@return
@ -9200,15 +9241,29 @@ FINAL SYMBOL TABLE
(const byte*) BOB_TABLES[(number) 9*(number) 8*(number) 4] = { fill( 9*8*4, 0) }
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CHARSET_BASIC = (byte*) 4096
(const nomodify byte*) CIA1_PORT_A = (byte*) 56320
(const nomodify byte*) CIA1_PORT_B = (byte*) 56321
(const nomodify byte*) CIA2_PORT_A = (byte*) 56576
(const nomodify byte*) CIA2_PORT_A_DDR = (byte*) 56578
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const signed byte*) COS = (const signed byte*) SIN+(byte) $40
(const nomodify byte*) D018 = (byte*) 53272
(const nomodify byte) KEY_SPACE = (byte) $3c
(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
(const word*) MUL40[(number) $20] = { fill( $20, 0) }
(const nomodify byte) NUM_BOBS = (byte) $14
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = (byte) 2
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B = (byte) 1
(const to_nomodify byte*) PROTO_BOB[(number) 3*(number) 3*(number) 8] = kickasm {{ .var pic = LoadPicture("smiley.png", List().add($000000, $ffffff))
.for (var x=0;x<3; x++)
.for (var y=0; y<24; y++)
@ -9681,14 +9736,10 @@ Score: 3510799
.label RASTER = $d012
.label BORDERCOL = $d020
.label D018 = $d018
// CIA#1 Port A: keyboard matrix columns and joystick #2
.label CIA1_PORT_A = $dc00
// CIA#1 Port B: keyboard matrix rows and joystick #1.
.label CIA1_PORT_B = $dc01
// CIA#2 Port A: Serial bus, RS-232, VIC memory bank
.label CIA2_PORT_A = $dd00
// CIA #2 Port A data direction register.
.label CIA2_PORT_A_DDR = $dd02
// The CIA#1: keyboard matrix, joystick #1/#2
.label CIA1 = $dc00
// The CIA#2: Serial bus, RS-232, VIC memory bank
.label CIA2 = $dd00
.const KEY_SPACE = $3c
// The BASIC screen
.label SCREEN_BASIC = $400
@ -9707,6 +9758,8 @@ Score: 3510799
// The number of BOBs to render
.const NUM_BOBS = $14
.const SIZEOF_POINTER = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = 2
.const OFFSET_STRUCT_MOS6526_CIA_PORT_B = 1
.label COS = SIN+$40
// BOB charset ID of the next glyph to be added
.label bob_charset_next_id = 9
@ -9757,17 +9810,17 @@ main: {
// [143] phi from main::@10 to renderBobInit [phi:main::@10->renderBobInit]
jsr renderBobInit
// main::vicSelectGfxBank1
// *CIA2_PORT_A_DDR = %00000011
// [10] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// CIA2->PORT_A_DDR = %00000011
// [10] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
lda #3
sta CIA2_PORT_A_DDR
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [11] phi from main::vicSelectGfxBank1 to main::vicSelectGfxBank1_toDd001 [phi:main::vicSelectGfxBank1->main::vicSelectGfxBank1_toDd001]
// main::vicSelectGfxBank1_toDd001
// main::vicSelectGfxBank1_@1
// *CIA2_PORT_A = toDd00(gfx)
// [12] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 -- _deref_pbuc1=vbuc2
// CIA2->PORT_A = toDd00(gfx)
// [12] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank1_toDd001_return#0 -- _deref_pbuc1=vbuc2
lda #vicSelectGfxBank1_toDd001_return
sta CIA2_PORT_A
sta CIA2
// [13] phi from main::vicSelectGfxBank1_@1 to main::toD0181 [phi:main::vicSelectGfxBank1_@1->main::toD0181]
// main::toD0181
// main::@7
@ -9966,17 +10019,17 @@ main: {
cmp #0
bne __b6
// main::vicSelectGfxBank2
// *CIA2_PORT_A_DDR = %00000011
// [55] *((const nomodify byte*) CIA2_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
// CIA2->PORT_A_DDR = %00000011
// [55] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR) ← (byte) 3 -- _deref_pbuc1=vbuc2
lda #3
sta CIA2_PORT_A_DDR
sta CIA2+OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR
// [56] phi from main::vicSelectGfxBank2 to main::vicSelectGfxBank2_toDd001 [phi:main::vicSelectGfxBank2->main::vicSelectGfxBank2_toDd001]
// main::vicSelectGfxBank2_toDd001
// main::vicSelectGfxBank2_@1
// *CIA2_PORT_A = toDd00(gfx)
// [57] *((const nomodify byte*) CIA2_PORT_A) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 -- _deref_pbuc1=vbuc2
// CIA2->PORT_A = toDd00(gfx)
// [57] *((byte*)(const nomodify struct MOS6526_CIA*) CIA2) ← (const byte) main::vicSelectGfxBank2_toDd001_return#0 -- _deref_pbuc1=vbuc2
lda #vicSelectGfxBank2_toDd001_return
sta CIA2_PORT_A
sta CIA2
// [58] phi from main::vicSelectGfxBank2_@1 to main::toD0182 [phi:main::vicSelectGfxBank2_@1->main::toD0182]
// main::toD0182
// main::@8
@ -10018,13 +10071,13 @@ keyboard_key_pressed: {
// Notice: If the C64 normal interrupt is still running it will occasionally interrupt right between the read & write
// leading to erroneous readings. You must disable kill the normal interrupt or sei/cli around calls to the keyboard matrix reader.
keyboard_matrix_read: {
// *CIA1_PORT_A = keyboard_matrix_row_bitmask[rowid]
// [67] *((const nomodify byte*) CIA1_PORT_A) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) -- _deref_pbuc1=_deref_pbuc2
// CIA1->PORT_A = keyboard_matrix_row_bitmask[rowid]
// [67] *((byte*)(const nomodify struct MOS6526_CIA*) CIA1) ← *((const byte*) keyboard_matrix_row_bitmask+(const byte) keyboard_key_pressed::rowidx#0) -- _deref_pbuc1=_deref_pbuc2
lda keyboard_matrix_row_bitmask+keyboard_key_pressed.rowidx
sta CIA1_PORT_A
// ~*CIA1_PORT_B
// [68] (byte) keyboard_matrix_read::return#0 ← ~ *((const nomodify byte*) CIA1_PORT_B) -- vbuaa=_bnot__deref_pbuc1
lda CIA1_PORT_B
sta CIA1
// ~CIA1->PORT_B
// [68] (byte) keyboard_matrix_read::return#0 ← ~ *((byte*)(const nomodify struct MOS6526_CIA*) CIA1+(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B) -- vbuaa=_bnot__deref_pbuc1
lda CIA1+OFFSET_STRUCT_MOS6526_CIA_PORT_B
eor #$ff
// keyboard_matrix_read::@return
// }

View File

@ -9,15 +9,29 @@
(const byte*) BOB_TABLES[(number) 9*(number) 8*(number) 4] = { fill( 9*8*4, 0) }
(const nomodify byte*) BORDERCOL = (byte*) 53280
(const nomodify byte*) CHARSET_BASIC = (byte*) 4096
(const nomodify byte*) CIA1_PORT_A = (byte*) 56320
(const nomodify byte*) CIA1_PORT_B = (byte*) 56321
(const nomodify byte*) CIA2_PORT_A = (byte*) 56576
(const nomodify byte*) CIA2_PORT_A_DDR = (byte*) 56578
(const nomodify struct MOS6526_CIA*) CIA1 = (struct MOS6526_CIA*) 56320
(const nomodify struct MOS6526_CIA*) CIA2 = (struct MOS6526_CIA*) 56576
(const signed byte*) COS = (const signed byte*) SIN+(byte) $40
(const nomodify byte*) D018 = (byte*) 53272
(const nomodify byte) KEY_SPACE = (byte) $3c
(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
(const word*) MUL40[(number) $20] = { fill( $20, 0) }
(const nomodify byte) NUM_BOBS = (byte) $14
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_A_DDR = (byte) 2
(const byte) OFFSET_STRUCT_MOS6526_CIA_PORT_B = (byte) 1
(const to_nomodify byte*) PROTO_BOB[(number) 3*(number) 3*(number) 8] = kickasm {{ .var pic = LoadPicture("smiley.png", List().add($000000, $ffffff))
.for (var x=0;x<3; x++)
.for (var y=0; y<24; y++)

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