diff --git a/src/cx16-checksum.c b/src/cx16-checksum.c new file mode 100644 index 0000000..3b201da --- /dev/null +++ b/src/cx16-checksum.c @@ -0,0 +1,153 @@ +/** + * @file cx16-checksum.c + * + * @author Sven Van de Velde from CX16 community (https://github.com/FlightControl-User) -- Creation of this program. + * + * @brief COMMANDER X16 UPDATE TOOL CHECKSUM VALIDATOR + * + * @version 3.0 + * @date 2023-10-15 + * + * @copyright Copyright (c) 2023 + * + */ + +// Ensures the proper character set is used for the COMMANDER X16. +#pragma encoding(screencode_mixed) + +// Uses all parameters to be passed using zero pages (fast). +#pragma var_model(zp) + + +#include <6502.h> +#include +#include +#include +#include +#include +#include +#include "cx16-vera.h" +#include "cx16-veralib.h" + +__mem unsigned long rom_file_checksum = 0; +__mem unsigned long rom_file_size = 0; +__mem unsigned long rom_checksum = 0; + + + + +unsigned char* rom_file(unsigned char rom_chip) { + static char* file_rom_cx16 = "ROM.BIN"; + static char* file_rom_card = "ROMn.BIN"; + if(rom_chip) { + file_rom_card[3] = '0'+rom_chip; + return file_rom_card; + } else { + return file_rom_cx16; + } + return NULL; +} + +void rom_calc_file_checksum(unsigned char rom_chip) { + + // We start for ROM from 0x0:0x7800 !!!! + bram_bank_t rom_bram_bank = 0; + bram_ptr_t rom_bram_ptr = (bram_ptr_t)0x0400; + bank_set_bram(rom_bram_bank); + + unsigned long rom_address = 0; + + unsigned int rom_row_current = 0; + unsigned char rom_release; + unsigned char rom_github[6]; + + rom_file_size = 0; + rom_file_checksum = 0; + + unsigned char* file = "ROM-R45.BIN"; + printf("Opening %s from SD card ...\n", file); + + + FILE *fp = fopen(file, "r"); + if (fp) { + + while (rom_file_size < 0x800000) { + + rom_bram_ptr = (char*)0x400; + unsigned int rom_package_read = fgets(rom_bram_ptr, 128, fp); // this will load b bytes from the rom.bin file or less if EOF is reached. + if (!rom_package_read) { + break; + } + + for(unsigned int b=0; b %s ... ", bytes, chip); display_action_text(info_text); } + +unsigned char* get_info_text_flashing(unsigned long flash_bytes) { + sprintf(info_text, "%u bytes flashed", flash_bytes); + return info_text; +} diff --git a/src/cx16-display.h b/src/cx16-display.h index 552fcff..363ac9c 100644 --- a/src/cx16-display.h +++ b/src/cx16-display.h @@ -53,3 +53,5 @@ void display_info_cx16_rom(unsigned char info_status, unsigned char* info_text); void display_action_text_flashing(unsigned long bytes, unsigned char* chip, bram_bank_t bram_bank, bram_ptr_t bram_ptr, unsigned long address); void display_action_text_flashed(unsigned long bytes, unsigned char* chip); void display_action_text_reading(unsigned char* action, unsigned char* file, unsigned long bytes, unsigned long size, bram_bank_t bram_bank, bram_ptr_t bram_ptr); + +unsigned char* get_info_text_flashing(unsigned long flash_bytes); \ No newline at end of file diff --git a/src/cx16-globals.h b/src/cx16-globals.h index 7cf4fdf..65696cc 100644 --- a/src/cx16-globals.h +++ b/src/cx16-globals.h @@ -29,7 +29,7 @@ cx16_k_screen_mode_t screen_mode; char file[32]; -char info_text[256]; +char info_text[80]; const char STATUS_NONE = 0; diff --git a/src/cx16-init.c b/src/cx16-init.c index 8d4984b..c70c058 100644 --- a/src/cx16-init.c +++ b/src/cx16-init.c @@ -27,6 +27,8 @@ #include "cx16-init.h" +#pragma code_seg(CodeIntro) + void init() { display_frame_init_64(); // ST1 | Reset canvas to 64 columns display_frame_draw(); @@ -44,4 +46,8 @@ void init() { display_info_rom(rom_chip, STATUS_NONE, NULL); } -} \ No newline at end of file +} + +#pragma code_seg(Code) +#pragma data_seg(Data) + diff --git a/src/cx16-rom.c b/src/cx16-rom.c index 5dcc401..c92120c 100644 --- a/src/cx16-rom.c +++ b/src/cx16-rom.c @@ -20,6 +20,7 @@ #include "cx16-globals.h" #include "cx16-utils.h" #include "cx16-display.h" +#include "cx16-display-text.h" #include "cx16-rom.h" // Globals @@ -513,7 +514,7 @@ unsigned long rom_verify( unsigned int progress_row_current = 0; unsigned long rom_different_bytes = 0; - display_info_rom(rom_chip, STATUS_COMPARING, "Comparing ..."); + display_info_rom(rom_chip, STATUS_COMPARING, ""); gotoxy(x, y); @@ -607,7 +608,7 @@ unsigned long rom_flash( bank_set_bram(bram_bank_sector); // Now we compare the RAM with the actual ROM contents. - display_action_progress("Flashing ... (-) equal, (+) flashed, (!) error."); + display_action_progress(TEXT_PROGRESS_FLASHING); unsigned long rom_address_sector = rom_address_from_bank(rom_bank_start); unsigned long rom_boundary = rom_address_sector + file_size; @@ -615,9 +616,8 @@ unsigned long rom_flash( unsigned int progress_row_current = 0; unsigned long rom_flash_errors = 0; - display_info_rom(rom_chip, STATUS_FLASHING, "Flashing ..."); - unsigned long flash_errors = 0; + unsigned long flash_bytes = 0; while (rom_address_sector < rom_boundary) { @@ -628,6 +628,7 @@ unsigned long rom_flash( if (equal_bytes != ROM_SECTOR) { unsigned int flash_errors_sector = 0; + unsigned int flash_bytes_sector = 0; unsigned char retries = 0; do { @@ -667,6 +668,7 @@ unsigned long rom_flash( } ram_address += ROM_PROGRESS_CELL; rom_address += ROM_PROGRESS_CELL; + flash_bytes_sector += ROM_PROGRESS_CELL; x++; // This should never exceed the 64 char boundary. } @@ -676,6 +678,7 @@ unsigned long rom_flash( } while (flash_errors_sector && retries <= 3); flash_errors += flash_errors_sector; + flash_bytes += flash_bytes_sector; } else { cputsxy(x_sector, y_sector, "--------"); @@ -701,12 +704,11 @@ unsigned long rom_flash( y_sector++; } - sprintf(info_text, "%u flash errors ...", flash_errors); - display_info_rom(rom_chip, STATUS_FLASHING, info_text); + display_info_rom(rom_chip, STATUS_FLASHING, get_info_text_flashing(flash_bytes)); } display_action_text_flashed(rom_address_sector, "ROM"); - wait_moment(32); + wait_moment(16); return flash_errors; } diff --git a/src/cx16-smc.c b/src/cx16-smc.c index a91ed75..3d4ce44 100644 --- a/src/cx16-smc.c +++ b/src/cx16-smc.c @@ -282,10 +282,10 @@ unsigned int smc_flash(unsigned int smc_bytes_total) { textcolor(WHITE); gotoxy(x, y); - unsigned int smc_bytes_flashed = 0; + unsigned int smc_flashed_bytes = 0; unsigned int smc_attempts_total = 0; - while(smc_bytes_flashed < smc_bytes_total) { + while(smc_flashed_bytes < smc_bytes_total) { unsigned char smc_attempts_flashed = 0; unsigned char smc_package_committed = 0; @@ -295,7 +295,7 @@ unsigned int smc_flash(unsigned int smc_bytes_total) { unsigned char smc_bytes_checksum = 0; unsigned int smc_package_flashed = 0; - display_action_text_flashing(8, "SMC", smc_bram_bank, smc_bram_ptr, smc_bytes_flashed); + display_action_text_flashing(8, "SMC", smc_bram_bank, smc_bram_ptr, smc_flashed_bytes); while(smc_package_flashed < SMC_PROGRESS_CELL) { unsigned char smc_byte_upload = *smc_bram_ptr; @@ -319,7 +319,7 @@ unsigned int smc_flash(unsigned int smc_bytes_total) { cputc('+'); - smc_bytes_flashed += SMC_PROGRESS_CELL; + smc_flashed_bytes += SMC_PROGRESS_CELL; smc_row_bytes += SMC_PROGRESS_CELL; smc_attempts_total += smc_attempts_flashed; @@ -330,15 +330,17 @@ unsigned int smc_flash(unsigned int smc_bytes_total) { } } if(smc_attempts_flashed >= 10) { - sprintf(info_text, "There were too many attempts trying to flash the SMC at location %04x", smc_bytes_flashed); + sprintf(info_text, "There were too many attempts trying to flash the SMC at location %04x", smc_flashed_bytes); display_action_text(info_text); return (unsigned int)0xFFFF; } - } - display_action_text_flashed(smc_bytes_flashed, "SMC"); + display_info_smc(STATUS_FLASHING, get_info_text_flashing(smc_flashed_bytes)); + } + display_action_text_flashed(smc_flashed_bytes, "SMC"); + wait_moment(16); - return smc_bytes_flashed; + return smc_flashed_bytes; } diff --git a/src/cx16-spi.c b/src/cx16-spi.c index a72b435..4ec6f12 100644 --- a/src/cx16-spi.c +++ b/src/cx16-spi.c @@ -20,7 +20,7 @@ #include "cx16-spi.h" -//#pragma code_seg(CodeVera) +#pragma code_seg(CodeVera) //#pragma data_seg(DataVera) __mem unsigned char spi_buffer[256]; diff --git a/src/cx16-spi.h b/src/cx16-spi.h index bdb0695..bff515e 100644 --- a/src/cx16-spi.h +++ b/src/cx16-spi.h @@ -15,7 +15,7 @@ * */ -//#pragma code_seg(CodeVera) +#pragma code_seg(CodeVera) //#pragma data_seg(DataVera) diff --git a/src/cx16-update.c b/src/cx16-update.c index 14d5ca8..5b6e9a3 100644 --- a/src/cx16-update.c +++ b/src/cx16-update.c @@ -40,7 +40,6 @@ #include "cx16-w25q16.h" #pragma code_seg(CodeIntro) -#pragma data_seg(DataIntro) void main_intro() { @@ -56,7 +55,7 @@ void main_intro() { } #pragma code_seg(CodeVera) -#pragma data_seg(DataVera) +//#pragma data_seg(DataVera) void main_vera_detect() { @@ -140,10 +139,10 @@ void main_vera_flash() { // Now we compare the RAM with the actual VERA contents. display_action_progress("Comparing VERA ... (.) data, (=) same, (*) different."); - display_info_vera(STATUS_COMPARING, NULL); + display_info_vera(STATUS_COMPARING, ""); // Verify VERA ... - unsigned long vera_differences = w25q16_verify(); + unsigned long vera_differences = w25q16_verify(0); if (!vera_differences) { // VFL1 | VERA and VERA.BIN equal | Display that there are no differences between the VERA and VERA.BIN. Set VERA to Flashed. | None @@ -167,12 +166,11 @@ void main_vera_flash() { __mem unsigned long vera_flashed = w25q16_flash(); if (vera_flashed) { // VFL3 | Flash VERA and all ok - sprintf(info_text, "%u bytes flashed!", vera_flashed); - display_info_vera(STATUS_FLASHED, info_text); - __mem unsigned long vera_differences = w25q16_verify(); + display_info_vera(STATUS_FLASHED, NULL); + __mem unsigned long vera_differences = w25q16_verify(1); if (vera_differences) { sprintf(info_text, "%u differences!", vera_differences); - display_info_vera(STATUS_FLASHED, info_text); + display_info_vera(STATUS_ERROR, info_text); } } else { // VFL2 | Flash VERA resulting in errors @@ -207,10 +205,14 @@ void main_vera_flash() { #endif } + spi_deselect(); wait_moment(16); + } + + #pragma code_seg(Code) #pragma data_seg(Data) @@ -539,7 +541,7 @@ init(); #ifdef __SMC_CHIP_FLASH // Flash the SMC when it has the status! - if (check_status_smc(STATUS_FLASH) && check_status_cx16_rom(STATUS_FLASH)) { + if (check_status_smc(STATUS_FLASH) && !check_status_vera(STATUS_ERROR)) { display_action_progress("Reading SMC.BIN ... (.) data, ( ) empty"); display_progress_clear(); @@ -553,7 +555,7 @@ init(); unsigned int flashed_bytes = smc_flash(smc_file_size); if(flashed_bytes) { // SFL1 | and POWER/RESET pressed - display_info_smc(STATUS_FLASHED, ""); + display_info_smc(STATUS_FLASHED, NULL); } else { if(flashed_bytes == (unsigned int)0xFFFF) { // SFL3 | errors during flash @@ -577,64 +579,66 @@ init(); #ifdef __ROM_CHIP_PROCESS #ifdef __ROM_CHIP_FLASH - // Flash the ROM chips. - // We loop first all the ROM chips and read the file contents. - // Then we verify the file contents and flash the ROM only for the differences. - // If the file contents are the same as the ROM contents, then no flashing is required. - // IMPORTANT! We start to flash the ROMs on the extension card. - // The last ROM flashed is the CX16 ROM on the CX16 board! - for(unsigned char rom_chip = 7; rom_chip != 255; rom_chip--) { - - if(check_status_rom(rom_chip, STATUS_FLASH)) { - - // IMPORTANT! We only flash the CX16 ROM chip if the SMC got flashed succesfully! - if((rom_chip == 0 && (check_status_smc(STATUS_FLASHED) || check_status_smc(STATUS_SKIP))) || (rom_chip != 0)) { - - bank_set_brom(0); - - display_progress_clear(); - - unsigned char rom_bank = rom_chip * 32; - unsigned char* file = rom_file(rom_chip); - sprintf(info_text, "Reading %s ... (.) data ( ) empty", file); - display_action_progress(info_text); - - unsigned long rom_bytes_read = rom_read(rom_chip, file, STATUS_READING, rom_bank, rom_sizes[rom_chip]); - - // If the ROM file was correctly read, verify the file ... - if(rom_bytes_read) { - - // Now we compare the RAM with the actual ROM contents. - display_action_progress("Comparing ... (.) data, (=) same, (*) different."); - display_info_rom(rom_chip, STATUS_COMPARING, ""); - - // Verify the ROM... - unsigned long rom_differences = rom_verify( - rom_chip, rom_bank, file_sizes[rom_chip]); - - if (!rom_differences) { - // RFL1 | ROM and ROM.BIN equal | Display that there are no differences between the ROM and ROM.BIN. Set ROM to Flashed. | None - display_info_rom(rom_chip, STATUS_SKIP, "No update required"); - } else { - // - // If there are differences, the ROM needs to be flashed. - sprintf(info_text, "%05x differences!", rom_differences); - display_info_rom(rom_chip, STATUS_FLASH, info_text); - - unsigned long rom_flash_errors = rom_flash( + if(!check_status_vera(STATUS_ERROR)) { + // Flash the ROM chips. + // We loop first all the ROM chips and read the file contents. + // Then we verify the file contents and flash the ROM only for the differences. + // If the file contents are the same as the ROM contents, then no flashing is required. + // IMPORTANT! We start to flash the ROMs on the extension card. + // The last ROM flashed is the CX16 ROM on the CX16 board! + for(unsigned char rom_chip = 7; rom_chip != 255; rom_chip--) { + + if(check_status_rom(rom_chip, STATUS_FLASH)) { + + // IMPORTANT! We only flash the CX16 ROM chip if the SMC got flashed succesfully! + if((rom_chip == 0 && (check_status_smc(STATUS_FLASHED) || check_status_smc(STATUS_SKIP))) || (rom_chip != 0)) { + + bank_set_brom(0); + + display_progress_clear(); + + unsigned char rom_bank = rom_chip * 32; + unsigned char* file = rom_file(rom_chip); + sprintf(info_text, "Reading %s ... (.) data ( ) empty", file); + display_action_progress(info_text); + + unsigned long rom_bytes_read = rom_read(rom_chip, file, STATUS_READING, rom_bank, rom_sizes[rom_chip]); + + // If the ROM file was correctly read, verify the file ... + if(rom_bytes_read) { + + // Now we compare the RAM with the actual ROM contents. + display_action_progress("Comparing ... (.) data, (=) same, (*) different."); + display_info_rom(rom_chip, STATUS_COMPARING, ""); + + // Verify the ROM... + unsigned long rom_differences = rom_verify( rom_chip, rom_bank, file_sizes[rom_chip]); - if(rom_flash_errors) { - // RFL2 | Flash ROM resulting in errors - sprintf(info_text, "%u flash errors!", rom_flash_errors); - display_info_rom(rom_chip, STATUS_ERROR, info_text); + + if (!rom_differences) { + // RFL1 | ROM and ROM.BIN equal | Display that there are no differences between the ROM and ROM.BIN. Set ROM to Flashed. | None + display_info_rom(rom_chip, STATUS_SKIP, "No update required"); } else { - // RFL3 | Flash ROM and all ok - display_info_rom(rom_chip, STATUS_FLASHED, NULL); + // + // If there are differences, the ROM needs to be flashed. + sprintf(info_text, "%05x differences!", rom_differences); + display_info_rom(rom_chip, STATUS_FLASH, info_text); + + unsigned long rom_flash_errors = rom_flash( + rom_chip, rom_bank, file_sizes[rom_chip]); + if(rom_flash_errors) { + // RFL2 | Flash ROM resulting in errors + sprintf(info_text, "%u flash errors!", rom_flash_errors); + display_info_rom(rom_chip, STATUS_ERROR, info_text); + } else { + // RFL3 | Flash ROM and all ok + display_info_rom(rom_chip, STATUS_FLASHED, NULL); + } } } + } else { + display_info_rom(rom_chip, STATUS_ISSUE, "SMC Update failed!"); } - } else { - display_info_rom(rom_chip, STATUS_ISSUE, "SMC Update failed!"); } } } @@ -668,9 +672,6 @@ init(); return; } - - - if((check_status_smc(STATUS_SKIP) || check_status_smc(STATUS_NONE)) && (check_status_vera(STATUS_SKIP) || check_status_vera(STATUS_NONE)) && (check_status_roms_less(STATUS_SKIP)) ) { @@ -682,7 +683,9 @@ init(); // DE2 | There is an error with one of the components vera_display_set_border_color(RED); display_action_progress("Update Failure! Your CX16 may no longer boot!"); - display_action_text("Take a photo of this screen, shut down power and retry!"); + display_action_text("Take a photo of this screen and wait at leaast 60 seconds."); + wait_moment(250); + smc_reset(); while(1); } else { if(check_status_smc(STATUS_ISSUE) || check_status_vera(STATUS_ISSUE) || check_status_roms(STATUS_ISSUE)) { @@ -700,7 +703,7 @@ init(); if(smc_bootloader == 1) smc_reset(); - display_progress_text(display_debriefing_text_smc, display_debriefing_count_smc); + display_progress_text(display_debriefing_smc_text, display_debriefing_smc_count); textcolor(PINK); display_progress_line(2, "DON'T DO ANYTHING UNTIL COUNTDOWN FINISHES!"); diff --git a/src/cx16-update.ld b/src/cx16-update.ld index cad81d7..ace911b 100644 --- a/src/cx16-update.ld +++ b/src/cx16-update.ld @@ -7,7 +7,7 @@ ] .segmentdef Basic [start=$0801] .segmentdef Code [start=%P] -.segmentdef Data [startAfter="Code"] +.segmentdef Data [startAfter="Code",max=$7800] .segmentdef CodeIntro [startAfter="Data"] .segmentdef CodeVera [startAfter="CodeIntro"] .segmentdef DataIntro [startAfter="CodeVera"] diff --git a/src/cx16-w25q16.c b/src/cx16-w25q16.c index aa475bf..a36b36a 100644 --- a/src/cx16-w25q16.c +++ b/src/cx16-w25q16.c @@ -24,8 +24,9 @@ #include "cx16-spi.h" #include "cx16-display.h" #include "cx16-utils.h" +#include "cx16-display-text.h" -//#pragma code_seg(CodeVera) +#pragma code_seg(CodeVera) //#pragma data_seg(DataVera) __mem char* const vera_file_name = "VERA.BIN"; @@ -44,6 +45,7 @@ void w25q16_detect() { spi_memory_capacity = 0x03; #endif + spi_deselect(); return; } @@ -235,7 +237,7 @@ unsigned char w25q16_preamable_SPI() { * * @return unsigned long The total different bytes identified. */ -unsigned long w25q16_verify() { +unsigned long w25q16_verify(unsigned char verify) { unsigned char x = PROGRESS_X; unsigned char y = PROGRESS_Y; @@ -247,13 +249,20 @@ unsigned long w25q16_verify() { unsigned int progress_row_current = 0; - display_info_vera(STATUS_COMPARING, "Comparing VERA ..."); + unsigned char different_char = '*'; - gotoxy(x, y); + if(verify) { + display_action_progress("Verifying VERA after VERA.BIN update ... (=) same, (!) error."); + different_char = '!'; + } else { + display_action_progress("Comparing VERA with VERA.BIN ... (.) data, (=) same, (*) different."); + } unsigned long w25q16_address = 0; unsigned long w25q16_different_bytes = 0; + gotoxy(x, y); + spi_read_flash(0UL); // Start the w26q16 flash memory read cycle from 0x0 using the spi interface while (w25q16_address < vera_file_size) { @@ -282,7 +291,7 @@ unsigned long w25q16_verify() { } if (w25q16_equal_bytes != w25q16_compare_size) { - cputc('*'); + cputc(different_char); } else { cputc('='); } @@ -323,12 +332,11 @@ unsigned char w25q16_erase() { while(vera_current_64k_block < vera_total_64k_blocks) { #ifdef __VERA_FLASH - if(!spi_wait_non_busy()) + if(!spi_wait_non_busy()) { spi_block_erase(vera_address); #else - if(1) + if(1) { #endif - { vera_address += 0x10000; vera_current_64k_block++; } else { @@ -351,12 +359,11 @@ unsigned long w25q16_flash() { bram_bank_t vera_bram_bank = 1; bram_ptr_t vera_bram_ptr = (bram_ptr_t)BRAM_LOW; - // Now we compare the RAM with the actual ROM contents. - display_action_progress("Flashing ... (-) equal, (+) flashed, (!) error."); + display_action_progress(TEXT_PROGRESS_FLASHING); unsigned int progress_row_current = 0; - display_info_vera(STATUS_FLASHING, "Flashing ..."); + unsigned long vera_flashed_bytes = 0; while (vera_address_page < vera_file_size) { @@ -397,6 +404,7 @@ unsigned long w25q16_flash() { vera_bram_ptr += VERA_PROGRESS_PAGE; vera_address += VERA_PROGRESS_PAGE; vera_address_page += VERA_PROGRESS_PAGE; + vera_flashed_bytes += VERA_PROGRESS_PAGE; } } else { // TODO: ERROR!!! @@ -420,11 +428,11 @@ unsigned long w25q16_flash() { x_sector = PROGRESS_X; y_sector++; } - + display_info_vera(STATUS_FLASHING, get_info_text_flashing(vera_flashed_bytes)); } display_action_text_flashed(vera_address_page, "VERA"); - wait_moment(32); + wait_moment(16); return vera_address_page; } diff --git a/src/cx16-w25q16.h b/src/cx16-w25q16.h index f92ba9b..63d2d1f 100644 --- a/src/cx16-w25q16.h +++ b/src/cx16-w25q16.h @@ -19,7 +19,7 @@ #include "cx16-globals.h" #pragma code_seg(CodeVera) -#pragma data_seg(DataVera) +//#pragma data_seg(DataVera) #include "cx16-spi.h" @@ -31,7 +31,7 @@ void w25q16_detect(); unsigned char w25q16_preamable_RAM(); unsigned char w25q16_preamable_SPI(); unsigned long w25q16_read(unsigned char info_status); -unsigned long w25q16_verify(); +unsigned long w25q16_verify(unsigned char verify); unsigned char w25q16_erase(); unsigned long w25q16_flash(); diff --git a/target/src/CX16-CHECKSUM.PRG b/target/src/CX16-CHECKSUM.PRG new file mode 100644 index 0000000..92a0597 Binary files /dev/null and b/target/src/CX16-CHECKSUM.PRG differ diff --git a/target/src/CX16-UPDATE.PRG b/target/src/CX16-UPDATE.PRG index 1f639c5..ff86d57 100644 Binary files a/target/src/CX16-UPDATE.PRG and b/target/src/CX16-UPDATE.PRG differ diff --git a/target/src/cx16-checksum.asm b/target/src/cx16-checksum.asm new file mode 100644 index 0000000..b840e84 --- /dev/null +++ b/target/src/cx16-checksum.asm @@ -0,0 +1,3786 @@ + // File Comments +/** + * @file cx16-checksum.c + * + * @author Sven Van de Velde from CX16 community (https://github.com/FlightControl-User) -- Creation of this program. + * + * @brief COMMANDER X16 UPDATE TOOL CHECKSUM VALIDATOR + * + * @version 3.0 + * @date 2023-10-15 + * + * @copyright Copyright (c) 2023 + * + */ + // Upstart +.cpu _65c02 + // Commander X16 PRG executable file +.file [name="cx16-checksum.prg", type="prg", segments="Program"] +.segmentdef Program [segments="Basic, Code, Data"] +.segmentdef Basic [start=$0801] +.segmentdef Code [start=$80d] +.segmentdef Data [startAfter="Code"] +.segment Basic +:BasicUpstart(__start) + + // Global Constants & labels + .const WHITE = 1 + .const BLUE = 6 + /** + * @file kernal.h + * @author your name (you@domain.com) + * @brief Most common CBM Kernal calls with it's dialects in the different CBM kernal family platforms. + * Please refer to http://sta.c64.org/cbm64krnfunc.html for the list of standard CBM C64 kernal functions. + * + * @version 1.0 + * @date 2023-03-22 + * + * @copyright Copyright (c) 2023 + * + */ + .const CBM_SETNAM = $ffbd + ///< Set the name of a file. + .const CBM_SETLFS = $ffba + ///< Set the logical file. + .const CBM_OPEN = $ffc0 + ///< Open the file for the current logical file. + .const CBM_CHKIN = $ffc6 + ///< Set the logical channel for input. + .const CBM_READST = $ffb7 + ///< Check I/O errors. + .const CBM_CHRIN = $ffcf + ///< Scan a character from the keyboard. + .const CBM_CLOSE = $ffc3 + ///< Close a logical file. + .const CBM_CLRCHN = $ffcc + ///< Load a logical file. + .const CBM_PLOT = $fff0 + .const CX16_SCREEN_MODE = $ff5f + ///< CX16 Set/Get screen mode. + .const CX16_SCREEN_SET_CHARSET = $ff62 + ///< CX16 Set character set. + .const CX16_MACPTR = $ff44 + .const VERA_INC_1 = $10 + .const VERA_DCSEL = 2 + .const VERA_ADDRSEL = 1 + .const VERA_SPRITES_ENABLE = $40 + .const VERA_LAYER1_ENABLE = $20 + .const VERA_LAYER0_ENABLE = $10 + .const VERA_LAYER_WIDTH_MASK = $30 + .const VERA_LAYER_HEIGHT_MASK = $c0 + .const OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS = 1 + .const STACK_BASE = $103 + .const SIZEOF_STRUCT___1 = $8f + .const SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER = $c + .const SIZEOF_STRUCT___2 = $90 + /// $9F20 VRAM Address (7:0) + .label VERA_ADDRX_L = $9f20 + /// $9F21 VRAM Address (15:8) + .label VERA_ADDRX_M = $9f21 + /// $9F22 VRAM Address (7:0) + /// Bit 4-7: Address Increment The following is the amount incremented per value value:increment + /// 0:0, 1:1, 2:2, 3:4, 4:8, 5:16, 6:32, 7:64, 8:128, 9:256, 10:512, 11:40, 12:80, 13:160, 14:320, 15:640 + /// Bit 3: DECR Setting the DECR bit, will decrement instead of increment by the value set by the 'Address Increment' field. + /// Bit 0: VRAM Address (16) + .label VERA_ADDRX_H = $9f22 + /// $9F23 DATA0 VRAM Data port 0 + .label VERA_DATA0 = $9f23 + /// $9F24 DATA1 VRAM Data port 1 + .label VERA_DATA1 = $9f24 + /// $9F25 CTRL Control + /// Bit 7: Reset + /// Bit 1: DCSEL + /// Bit 2: ADDRSEL + .label VERA_CTRL = $9f25 + /// $9F29 DC_VIDEO (DCSEL=0) + /// Bit 7: Current Field Read-only bit which reflects the active interlaced field in composite and RGB modes. (0: even, 1: odd) + /// Bit 6: Sprites Enable Enable output from the Sprites renderer + /// Bit 5: Layer1 Enable Enable output from the Layer1 renderer + /// Bit 4: Layer0 Enable Enable output from the Layer0 renderer + /// Bit 2: Chroma Disable Setting 'Chroma Disable' disables output of chroma in NTSC composite mode and will give a better picture on a monochrome display. (Setting this bit will also disable the chroma output on the S-video output.) + /// Bit 0-1: Output Mode 0: Video disabled, 1: VGA output, 2: NTSC composite, 3: RGB interlaced, composite sync (via VGA connector) + .label VERA_DC_VIDEO = $9f29 + /// $9F2A DC_HSCALE (DCSEL=0) Active Display H-Scale + .label VERA_DC_HSCALE = $9f2a + /// $9F2B DC_VSCALE (DCSEL=0) Active Display V-Scale + .label VERA_DC_VSCALE = $9f2b + /// $9F29 DC_HSTART (DCSEL=1) Active Display H-Start (9:2) + .label VERA_DC_HSTART = $9f29 + /// $9F2A DC_HSTOP (DCSEL=1) Active Display H-Stop (9:2) + .label VERA_DC_HSTOP = $9f2a + /// $9F2B DC_VSTART (DCSEL=1) Active Display V-Start (8:1) + .label VERA_DC_VSTART = $9f2b + /// $9F2C DC_VSTOP (DCSEL=1) Active Display V-Stop (8:1) + .label VERA_DC_VSTOP = $9f2c + /// $9F34 L1_CONFIG Layer 1 Configuration + .label VERA_L1_CONFIG = $9f34 + /// $9F35 L1_MAPBASE Layer 1 Map Base Address (16:9) + .label VERA_L1_MAPBASE = $9f35 + .label BRAM = 0 + .label BROM = 1 +.segment Code + // __start +__start: { + // __start::__init1 + // __export volatile __address(0x00) unsigned char BRAM = 0 + // [1] BRAM = 0 -- vbuz1=vbuc1 + lda #0 + sta.z BRAM + // __export volatile __address(0x01) unsigned char BROM = 4 + // [2] BROM = 4 -- vbuz1=vbuc1 + lda #4 + sta.z BROM + // [3] phi from __start::__init1 to __start::@2 [phi:__start::__init1->__start::@2] + // __start::@2 + // #pragma constructor_for(conio_x16_init, cputc, clrscr, cscroll) + // [4] call conio_x16_init + // [8] phi from __start::@2 to conio_x16_init [phi:__start::@2->conio_x16_init] + jsr conio_x16_init + // [5] phi from __start::@2 to __start::@1 [phi:__start::@2->__start::@1] + // __start::@1 + // [6] call main + jsr main + // __start::@return + // [7] return + rts +} + // conio_x16_init +/// Set initial screen values. +conio_x16_init: { + .label conio_x16_init__4 = $69 + .label conio_x16_init__5 = $65 + .label conio_x16_init__6 = $69 + .label conio_x16_init__7 = $b5 + // screenlayer1() + // [9] call screenlayer1 + jsr screenlayer1 + // [10] phi from conio_x16_init to conio_x16_init::@1 [phi:conio_x16_init->conio_x16_init::@1] + // conio_x16_init::@1 + // textcolor(CONIO_TEXTCOLOR_DEFAULT) + // [11] call textcolor + jsr textcolor + // [12] phi from conio_x16_init::@1 to conio_x16_init::@2 [phi:conio_x16_init::@1->conio_x16_init::@2] + // conio_x16_init::@2 + // bgcolor(CONIO_BACKCOLOR_DEFAULT) + // [13] call bgcolor + jsr bgcolor + // [14] phi from conio_x16_init::@2 to conio_x16_init::@3 [phi:conio_x16_init::@2->conio_x16_init::@3] + // conio_x16_init::@3 + // cursor(0) + // [15] call cursor + jsr cursor + // [16] phi from conio_x16_init::@3 to conio_x16_init::@4 [phi:conio_x16_init::@3->conio_x16_init::@4] + // conio_x16_init::@4 + // cbm_k_plot_get() + // [17] call cbm_k_plot_get + jsr cbm_k_plot_get + // [18] cbm_k_plot_get::return#2 = cbm_k_plot_get::return#0 + // conio_x16_init::@5 + // [19] conio_x16_init::$4 = cbm_k_plot_get::return#2 + // BYTE1(cbm_k_plot_get()) + // [20] conio_x16_init::$5 = byte1 conio_x16_init::$4 -- vbuz1=_byte1_vwuz2 + lda.z conio_x16_init__4+1 + sta.z conio_x16_init__5 + // __conio.cursor_x = BYTE1(cbm_k_plot_get()) + // [21] *((char *)&__conio) = conio_x16_init::$5 -- _deref_pbuc1=vbuz1 + sta __conio + // cbm_k_plot_get() + // [22] call cbm_k_plot_get + jsr cbm_k_plot_get + // [23] cbm_k_plot_get::return#3 = cbm_k_plot_get::return#0 + // conio_x16_init::@6 + // [24] conio_x16_init::$6 = cbm_k_plot_get::return#3 + // BYTE0(cbm_k_plot_get()) + // [25] conio_x16_init::$7 = byte0 conio_x16_init::$6 -- vbuz1=_byte0_vwuz2 + lda.z conio_x16_init__6 + sta.z conio_x16_init__7 + // __conio.cursor_y = BYTE0(cbm_k_plot_get()) + // [26] *((char *)&__conio+1) = conio_x16_init::$7 -- _deref_pbuc1=vbuz1 + sta __conio+1 + // gotoxy(__conio.cursor_x, __conio.cursor_y) + // [27] gotoxy::x#0 = *((char *)&__conio) -- vbuz1=_deref_pbuc1 + lda __conio + sta.z gotoxy.x + // [28] gotoxy::y#0 = *((char *)&__conio+1) -- vbuz1=_deref_pbuc1 + lda __conio+1 + sta.z gotoxy.y + // [29] call gotoxy + // [133] phi from conio_x16_init::@6 to gotoxy [phi:conio_x16_init::@6->gotoxy] + // [133] phi gotoxy::y#3 = gotoxy::y#0 [phi:conio_x16_init::@6->gotoxy#0] -- register_copy + // [133] phi gotoxy::x#3 = gotoxy::x#0 [phi:conio_x16_init::@6->gotoxy#1] -- register_copy + jsr gotoxy + // conio_x16_init::@7 + // __conio.scroll[0] = 1 + // [30] *((char *)&__conio+$f) = 1 -- _deref_pbuc1=vbuc2 + lda #1 + sta __conio+$f + // __conio.scroll[1] = 1 + // [31] *((char *)&__conio+$f+1) = 1 -- _deref_pbuc1=vbuc2 + sta __conio+$f+1 + // conio_x16_init::@return + // } + // [32] return + rts +} + // cputc +// Output one character at the current cursor position +// Moves the cursor forward. Scrolls the entire screen if needed +// void cputc(__zp($33) char c) +cputc: { + .const OFFSET_STACK_C = 0 + .label cputc__1 = $22 + .label cputc__2 = $66 + .label cputc__3 = $67 + .label c = $33 + // [33] cputc::c#0 = stackidx(char,cputc::OFFSET_STACK_C) -- vbuz1=_stackidxbyte_vbuc1 + tsx + lda STACK_BASE+OFFSET_STACK_C,x + sta.z c + // if(c=='\n') + // [34] if(cputc::c#0==' ') goto cputc::@1 -- vbuz1_eq_vbuc1_then_la1 + lda #'\n' + cmp.z c + beq __b1 + // cputc::@2 + // *VERA_CTRL &= ~VERA_ADDRSEL + // [35] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + lda #VERA_ADDRSEL^$ff + and VERA_CTRL + sta VERA_CTRL + // BYTE0(__conio.offset) + // [36] cputc::$1 = byte0 *((unsigned int *)&__conio+$13) -- vbuz1=_byte0__deref_pwuc1 + lda __conio+$13 + sta.z cputc__1 + // *VERA_ADDRX_L = BYTE0(__conio.offset) + // [37] *VERA_ADDRX_L = cputc::$1 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_L + // BYTE1(__conio.offset) + // [38] cputc::$2 = byte1 *((unsigned int *)&__conio+$13) -- vbuz1=_byte1__deref_pwuc1 + lda __conio+$13+1 + sta.z cputc__2 + // *VERA_ADDRX_M = BYTE1(__conio.offset) + // [39] *VERA_ADDRX_M = cputc::$2 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_M + // __conio.mapbase_bank | VERA_INC_1 + // [40] cputc::$3 = *((char *)&__conio+5) | VERA_INC_1 -- vbuz1=_deref_pbuc1_bor_vbuc2 + lda #VERA_INC_1 + ora __conio+5 + sta.z cputc__3 + // *VERA_ADDRX_H = __conio.mapbase_bank | VERA_INC_1 + // [41] *VERA_ADDRX_H = cputc::$3 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_H + // *VERA_DATA0 = c + // [42] *VERA_DATA0 = cputc::c#0 -- _deref_pbuc1=vbuz1 + lda.z c + sta VERA_DATA0 + // *VERA_DATA0 = __conio.color + // [43] *VERA_DATA0 = *((char *)&__conio+$d) -- _deref_pbuc1=_deref_pbuc2 + lda __conio+$d + sta VERA_DATA0 + // if(!__conio.hscroll[__conio.layer]) + // [44] if(0==((char *)&__conio+$11)[*((char *)&__conio+2)]) goto cputc::@5 -- 0_eq_pbuc1_derefidx_(_deref_pbuc2)_then_la1 + ldy __conio+2 + lda __conio+$11,y + cmp #0 + beq __b5 + // cputc::@3 + // if(__conio.cursor_x >= __conio.mapwidth) + // [45] if(*((char *)&__conio)>=*((char *)&__conio+8)) goto cputc::@6 -- _deref_pbuc1_ge__deref_pbuc2_then_la1 + lda __conio + cmp __conio+8 + bcs __b6 + // cputc::@4 + // __conio.cursor_x++; + // [46] *((char *)&__conio) = ++ *((char *)&__conio) -- _deref_pbuc1=_inc__deref_pbuc1 + inc __conio + // __conio.offset++; + // [47] *((unsigned int *)&__conio+$13) = ++ *((unsigned int *)&__conio+$13) -- _deref_pwuc1=_inc__deref_pwuc1 + inc __conio+$13 + bne !+ + inc __conio+$13+1 + !: + // [48] *((unsigned int *)&__conio+$13) = ++ *((unsigned int *)&__conio+$13) -- _deref_pwuc1=_inc__deref_pwuc1 + inc __conio+$13 + bne !+ + inc __conio+$13+1 + !: + // cputc::@return + // } + // [49] return + rts + // [50] phi from cputc::@3 to cputc::@6 [phi:cputc::@3->cputc::@6] + // cputc::@6 + __b6: + // cputln() + // [51] call cputln + jsr cputln + rts + // cputc::@5 + __b5: + // if(__conio.cursor_x >= __conio.width) + // [52] if(*((char *)&__conio)>=*((char *)&__conio+6)) goto cputc::@7 -- _deref_pbuc1_ge__deref_pbuc2_then_la1 + lda __conio + cmp __conio+6 + bcs __b7 + // cputc::@8 + // __conio.cursor_x++; + // [53] *((char *)&__conio) = ++ *((char *)&__conio) -- _deref_pbuc1=_inc__deref_pbuc1 + inc __conio + // __conio.offset++; + // [54] *((unsigned int *)&__conio+$13) = ++ *((unsigned int *)&__conio+$13) -- _deref_pwuc1=_inc__deref_pwuc1 + inc __conio+$13 + bne !+ + inc __conio+$13+1 + !: + // [55] *((unsigned int *)&__conio+$13) = ++ *((unsigned int *)&__conio+$13) -- _deref_pwuc1=_inc__deref_pwuc1 + inc __conio+$13 + bne !+ + inc __conio+$13+1 + !: + rts + // [56] phi from cputc::@5 to cputc::@7 [phi:cputc::@5->cputc::@7] + // cputc::@7 + __b7: + // cputln() + // [57] call cputln + jsr cputln + rts + // [58] phi from cputc to cputc::@1 [phi:cputc->cputc::@1] + // cputc::@1 + __b1: + // cputln() + // [59] call cputln + jsr cputln + rts +} + // main +main: { + .const vera_display_set_hstart1_start = $b + .const vera_display_set_hstop1_stop = $93 + .const vera_display_set_vstart1_start = $13 + .const vera_display_set_vstop1_stop = $db + .const bank_set_bram1_bank = 0 + .const bank_set_brom1_bank = 4 + .label cx16_k_screen_set_charset1_charset = $b9 + .label cx16_k_screen_set_charset1_offset = $b6 + // cx16_k_screen_set_mode(0) + // [60] cx16_k_screen_set_mode::mode = 0 -- vbuz1=vbuc1 + lda #0 + sta.z cx16_k_screen_set_mode.mode + // [61] call cx16_k_screen_set_mode + jsr cx16_k_screen_set_mode + // [62] phi from main to main::@2 [phi:main->main::@2] + // main::@2 + // screenlayer1() + // [63] call screenlayer1 + // Default 80 columns mode. + jsr screenlayer1 + // main::@3 + // cx16_k_screen_set_charset(3, (char *)0) + // [64] main::cx16_k_screen_set_charset1_charset = 3 -- vbuz1=vbuc1 + lda #3 + sta.z cx16_k_screen_set_charset1_charset + // [65] main::cx16_k_screen_set_charset1_offset = (char *) 0 -- pbuz1=pbuc1 + lda #<0 + sta.z cx16_k_screen_set_charset1_offset + sta.z cx16_k_screen_set_charset1_offset+1 + // main::cx16_k_screen_set_charset1 + // asm + // asm { ldacharset ldxoffset jsrCX16_SCREEN_SET_CHARSET } + lda cx16_k_screen_set_charset1_charset + ldx.z cx16_k_screen_set_charset1_offset + jsr CX16_SCREEN_SET_CHARSET + // main::vera_display_set_hstart1 + // *VERA_CTRL |= VERA_DCSEL + // [67] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + lda #VERA_DCSEL + ora VERA_CTRL + sta VERA_CTRL + // *VERA_DC_HSTART = start + // [68] *VERA_DC_HSTART = main::vera_display_set_hstart1_start#0 -- _deref_pbuc1=vbuc2 + lda #vera_display_set_hstart1_start + sta VERA_DC_HSTART + // main::vera_display_set_hstop1 + // *VERA_CTRL |= VERA_DCSEL + // [69] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + lda #VERA_DCSEL + ora VERA_CTRL + sta VERA_CTRL + // *VERA_DC_HSTOP = stop + // [70] *VERA_DC_HSTOP = main::vera_display_set_hstop1_stop#0 -- _deref_pbuc1=vbuc2 + lda #vera_display_set_hstop1_stop + sta VERA_DC_HSTOP + // main::vera_display_set_vstart1 + // *VERA_CTRL |= VERA_DCSEL + // [71] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + lda #VERA_DCSEL + ora VERA_CTRL + sta VERA_CTRL + // *VERA_DC_VSTART = start + // [72] *VERA_DC_VSTART = main::vera_display_set_vstart1_start#0 -- _deref_pbuc1=vbuc2 + lda #vera_display_set_vstart1_start + sta VERA_DC_VSTART + // main::vera_display_set_vstop1 + // *VERA_CTRL |= VERA_DCSEL + // [73] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + lda #VERA_DCSEL + ora VERA_CTRL + sta VERA_CTRL + // *VERA_DC_VSTOP = stop + // [74] *VERA_DC_VSTOP = main::vera_display_set_vstop1_stop#0 -- _deref_pbuc1=vbuc2 + lda #vera_display_set_vstop1_stop + sta VERA_DC_VSTOP + // main::vera_sprites_hide1 + // *VERA_CTRL &= ~VERA_DCSEL + // [75] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + lda #VERA_DCSEL^$ff + and VERA_CTRL + sta VERA_CTRL + // *VERA_DC_VIDEO &= ~VERA_SPRITES_ENABLE + // [76] *VERA_DC_VIDEO = *VERA_DC_VIDEO & ~VERA_SPRITES_ENABLE -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + lda #VERA_SPRITES_ENABLE^$ff + and VERA_DC_VIDEO + sta VERA_DC_VIDEO + // main::vera_layer0_hide1 + // *VERA_CTRL &= ~VERA_DCSEL + // [77] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + lda #VERA_DCSEL^$ff + and VERA_CTRL + sta VERA_CTRL + // *VERA_DC_VIDEO &= ~VERA_LAYER0_ENABLE + // [78] *VERA_DC_VIDEO = *VERA_DC_VIDEO & ~VERA_LAYER0_ENABLE -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + lda #VERA_LAYER0_ENABLE^$ff + and VERA_DC_VIDEO + sta VERA_DC_VIDEO + // main::vera_layer1_show1 + // *VERA_CTRL &= ~VERA_DCSEL + // [79] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + lda #VERA_DCSEL^$ff + and VERA_CTRL + sta VERA_CTRL + // *VERA_DC_VIDEO |= VERA_LAYER1_ENABLE + // [80] *VERA_DC_VIDEO = *VERA_DC_VIDEO | VERA_LAYER1_ENABLE -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + lda #VERA_LAYER1_ENABLE + ora VERA_DC_VIDEO + sta VERA_DC_VIDEO + // [81] phi from main::vera_layer1_show1 to main::@1 [phi:main::vera_layer1_show1->main::@1] + // main::@1 + // textcolor(WHITE) + // [82] call textcolor + // Layer 1 is the current text canvas. + jsr textcolor + // [83] phi from main::@1 to main::@4 [phi:main::@1->main::@4] + // main::@4 + // bgcolor(BLUE) + // [84] call bgcolor + // Default text color is white. + jsr bgcolor + // [85] phi from main::@4 to main::@5 [phi:main::@4->main::@5] + // main::@5 + // clrscr() + // [86] call clrscr + // With a blue background. + jsr clrscr + // [87] phi from main::@5 to main::@6 [phi:main::@5->main::@6] + // main::@6 + // printf("\n\n\n\nCommander X16 checksum calculator and validator of .BIN files.\n\n") + // [88] call printf_str + // [180] phi from main::@6 to printf_str [phi:main::@6->printf_str] + // [180] phi printf_str::putc#13 = &cputc [phi:main::@6->printf_str#0] -- pprz1=pprc1 + lda #cputc + sta.z printf_str.putc+1 + // [180] phi printf_str::s#13 = main::s [phi:main::@6->printf_str#1] -- pbuz1=pbuc1 + lda #s + sta.z printf_str.s+1 + jsr printf_str + // [89] phi from main::@6 to main::@7 [phi:main::@6->main::@7] + // main::@7 + // rom_calc_file_checksum(1) + // [90] call rom_calc_file_checksum + // [189] phi from main::@7 to rom_calc_file_checksum [phi:main::@7->rom_calc_file_checksum] + jsr rom_calc_file_checksum + // [91] phi from main::@7 to main::@8 [phi:main::@7->main::@8] + // main::@8 + // printf("ROM-R45.BIN size : %x\n", rom_file_size) + // [92] call printf_str + // [180] phi from main::@8 to printf_str [phi:main::@8->printf_str] + // [180] phi printf_str::putc#13 = &cputc [phi:main::@8->printf_str#0] -- pprz1=pprc1 + lda #cputc + sta.z printf_str.putc+1 + // [180] phi printf_str::s#13 = main::s1 [phi:main::@8->printf_str#1] -- pbuz1=pbuc1 + lda #s1 + sta.z printf_str.s+1 + jsr printf_str + // main::@9 + // printf("ROM-R45.BIN size : %x\n", rom_file_size) + // [93] printf_ulong::uvalue#0 = rom_file_size#10 -- vduz1=vdum2 + lda rom_file_size + sta.z printf_ulong.uvalue + lda rom_file_size+1 + sta.z printf_ulong.uvalue+1 + lda rom_file_size+2 + sta.z printf_ulong.uvalue+2 + lda rom_file_size+3 + sta.z printf_ulong.uvalue+3 + // [94] call printf_ulong + // [220] phi from main::@9 to printf_ulong [phi:main::@9->printf_ulong] + // [220] phi printf_ulong::uvalue#3 = printf_ulong::uvalue#0 [phi:main::@9->printf_ulong#0] -- register_copy + jsr printf_ulong + // [95] phi from main::@9 to main::@10 [phi:main::@9->main::@10] + // main::@10 + // printf("ROM-R45.BIN size : %x\n", rom_file_size) + // [96] call printf_str + // [180] phi from main::@10 to printf_str [phi:main::@10->printf_str] + // [180] phi printf_str::putc#13 = &cputc [phi:main::@10->printf_str#0] -- pprz1=pprc1 + lda #cputc + sta.z printf_str.putc+1 + // [180] phi printf_str::s#13 = main::s2 [phi:main::@10->printf_str#1] -- pbuz1=pbuc1 + lda #s2 + sta.z printf_str.s+1 + jsr printf_str + // [97] phi from main::@10 to main::@11 [phi:main::@10->main::@11] + // main::@11 + // printf("\nROM-R45.BIN checksum: %x\n", rom_file_checksum) + // [98] call printf_str + // [180] phi from main::@11 to printf_str [phi:main::@11->printf_str] + // [180] phi printf_str::putc#13 = &cputc [phi:main::@11->printf_str#0] -- pprz1=pprc1 + lda #cputc + sta.z printf_str.putc+1 + // [180] phi printf_str::s#13 = main::s3 [phi:main::@11->printf_str#1] -- pbuz1=pbuc1 + lda #s3 + sta.z printf_str.s+1 + jsr printf_str + // main::@12 + // printf("\nROM-R45.BIN checksum: %x\n", rom_file_checksum) + // [99] printf_ulong::uvalue#1 = rom_file_checksum#16 -- vduz1=vdum2 + lda rom_file_checksum + sta.z printf_ulong.uvalue + lda rom_file_checksum+1 + sta.z printf_ulong.uvalue+1 + lda rom_file_checksum+2 + sta.z printf_ulong.uvalue+2 + lda rom_file_checksum+3 + sta.z printf_ulong.uvalue+3 + // [100] call printf_ulong + // [220] phi from main::@12 to printf_ulong [phi:main::@12->printf_ulong] + // [220] phi printf_ulong::uvalue#3 = printf_ulong::uvalue#1 [phi:main::@12->printf_ulong#0] -- register_copy + jsr printf_ulong + // [101] phi from main::@12 to main::@13 [phi:main::@12->main::@13] + // main::@13 + // printf("\nROM-R45.BIN checksum: %x\n", rom_file_checksum) + // [102] call printf_str + // [180] phi from main::@13 to printf_str [phi:main::@13->printf_str] + // [180] phi printf_str::putc#13 = &cputc [phi:main::@13->printf_str#0] -- pprz1=pprc1 + lda #cputc + sta.z printf_str.putc+1 + // [180] phi printf_str::s#13 = main::s2 [phi:main::@13->printf_str#1] -- pbuz1=pbuc1 + lda #s2 + sta.z printf_str.s+1 + jsr printf_str + // [103] phi from main::@13 to main::@14 [phi:main::@13->main::@14] + // main::@14 + // rom_calc_rom_checksum() + // [104] call rom_calc_rom_checksum + // [227] phi from main::@14 to rom_calc_rom_checksum [phi:main::@14->rom_calc_rom_checksum] + jsr rom_calc_rom_checksum + // [105] phi from main::@14 to main::@15 [phi:main::@14->main::@15] + // main::@15 + // printf("ROM checksum: %x\n", rom_checksum) + // [106] call printf_str + // [180] phi from main::@15 to printf_str [phi:main::@15->printf_str] + // [180] phi printf_str::putc#13 = &cputc [phi:main::@15->printf_str#0] -- pprz1=pprc1 + lda #cputc + sta.z printf_str.putc+1 + // [180] phi printf_str::s#13 = main::s5 [phi:main::@15->printf_str#1] -- pbuz1=pbuc1 + lda #s5 + sta.z printf_str.s+1 + jsr printf_str + // main::@16 + // printf("ROM checksum: %x\n", rom_checksum) + // [107] printf_ulong::uvalue#2 = rom_checksum#1 -- vduz1=vdum2 + lda rom_checksum + sta.z printf_ulong.uvalue + lda rom_checksum+1 + sta.z printf_ulong.uvalue+1 + lda rom_checksum+2 + sta.z printf_ulong.uvalue+2 + lda rom_checksum+3 + sta.z printf_ulong.uvalue+3 + // [108] call printf_ulong + // [220] phi from main::@16 to printf_ulong [phi:main::@16->printf_ulong] + // [220] phi printf_ulong::uvalue#3 = printf_ulong::uvalue#2 [phi:main::@16->printf_ulong#0] -- register_copy + jsr printf_ulong + // [109] phi from main::@16 to main::@17 [phi:main::@16->main::@17] + // main::@17 + // printf("ROM checksum: %x\n", rom_checksum) + // [110] call printf_str + // [180] phi from main::@17 to printf_str [phi:main::@17->printf_str] + // [180] phi printf_str::putc#13 = &cputc [phi:main::@17->printf_str#0] -- pprz1=pprc1 + lda #cputc + sta.z printf_str.putc+1 + // [180] phi printf_str::s#13 = main::s2 [phi:main::@17->printf_str#1] -- pbuz1=pbuc1 + lda #s2 + sta.z printf_str.s+1 + jsr printf_str + // main::bank_set_bram1 + // BRAM = bank + // [111] BRAM = main::bank_set_bram1_bank#0 -- vbuz1=vbuc1 + lda #bank_set_bram1_bank + sta.z BRAM + // main::bank_set_brom1 + // BROM = bank + // [112] BROM = main::bank_set_brom1_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom1_bank + sta.z BROM + // main::@return + // } + // [113] return + rts + .segment Data + s: .text @"\n\n\n\nCommander X16 checksum calculator and validator of .BIN files.\n\n" + .byte 0 + s1: .text "ROM-R45.BIN size : " + .byte 0 + s2: .text @"\n" + .byte 0 + s3: .text @"\nROM-R45.BIN checksum: " + .byte 0 + s5: .text "ROM checksum: " + .byte 0 +} +.segment Code + // screenlayer1 +// Set the layer with which the conio will interact. +screenlayer1: { + // screenlayer(1, *VERA_L1_MAPBASE, *VERA_L1_CONFIG) + // [114] screenlayer::mapbase#0 = *VERA_L1_MAPBASE -- vbuz1=_deref_pbuc1 + lda VERA_L1_MAPBASE + sta.z screenlayer.mapbase + // [115] screenlayer::config#0 = *VERA_L1_CONFIG -- vbuz1=_deref_pbuc1 + lda VERA_L1_CONFIG + sta.z screenlayer.config + // [116] call screenlayer + jsr screenlayer + // screenlayer1::@return + // } + // [117] return + rts +} + // textcolor +// Set the front color for text output. The old front text color setting is returned. +// - color: a 4 bit value ( decimal between 0 and 15). +// This will only work when the VERA is in 16 color mode! +// Note that on the VERA, the transparent color has value 0. +// char textcolor(char color) +textcolor: { + .label textcolor__0 = $7c + .label textcolor__1 = $7c + // __conio.color & 0xF0 + // [118] textcolor::$0 = *((char *)&__conio+$d) & $f0 -- vbuz1=_deref_pbuc1_band_vbuc2 + lda #$f0 + and __conio+$d + sta.z textcolor__0 + // __conio.color & 0xF0 | color + // [119] textcolor::$1 = textcolor::$0 | WHITE -- vbuz1=vbuz1_bor_vbuc1 + lda #WHITE + ora.z textcolor__1 + sta.z textcolor__1 + // __conio.color = __conio.color & 0xF0 | color + // [120] *((char *)&__conio+$d) = textcolor::$1 -- _deref_pbuc1=vbuz1 + sta __conio+$d + // textcolor::@return + // } + // [121] return + rts +} + // bgcolor +// Set the back color for text output. +// - color: a 4 bit value ( decimal between 0 and 15). +// This will only work when the VERA is in 16 color mode! +// Note that on the VERA, the transparent color has value 0. +// char bgcolor(char color) +bgcolor: { + .label bgcolor__0 = $78 + .label bgcolor__2 = $78 + // __conio.color & 0x0F + // [122] bgcolor::$0 = *((char *)&__conio+$d) & $f -- vbuz1=_deref_pbuc1_band_vbuc2 + lda #$f + and __conio+$d + sta.z bgcolor__0 + // __conio.color & 0x0F | color << 4 + // [123] bgcolor::$2 = bgcolor::$0 | BLUE<<4 -- vbuz1=vbuz1_bor_vbuc1 + lda #BLUE<<4 + ora.z bgcolor__2 + sta.z bgcolor__2 + // __conio.color = __conio.color & 0x0F | color << 4 + // [124] *((char *)&__conio+$d) = bgcolor::$2 -- _deref_pbuc1=vbuz1 + sta __conio+$d + // bgcolor::@return + // } + // [125] return + rts +} + // cursor +// If onoff is 1, a cursor is displayed when waiting for keyboard input. +// If onoff is 0, the cursor is hidden when waiting for keyboard input. +// The function returns the old cursor setting. +// char cursor(char onoff) +cursor: { + .const onoff = 0 + // __conio.cursor = onoff + // [126] *((char *)&__conio+$c) = cursor::onoff#0 -- _deref_pbuc1=vbuc2 + lda #onoff + sta __conio+$c + // cursor::@return + // } + // [127] return + rts +} + // cbm_k_plot_get +/** + * @brief Get current x and y cursor position. + * @return An unsigned int where the hi byte is the x coordinate and the low byte is the y coordinate of the screen position. + */ +cbm_k_plot_get: { + .label return = $69 + // __mem unsigned char x + // [128] cbm_k_plot_get::x = 0 -- vbum1=vbuc1 + lda #0 + sta x + // __mem unsigned char y + // [129] cbm_k_plot_get::y = 0 -- vbum1=vbuc1 + sta y + // kickasm + // kickasm( uses cbm_k_plot_get::x uses cbm_k_plot_get::y uses CBM_PLOT) {{ sec jsr CBM_PLOT stx y sty x }} + sec + jsr CBM_PLOT + stx y + sty x + + // MAKEWORD(x,y) + // [131] cbm_k_plot_get::return#0 = cbm_k_plot_get::x w= cbm_k_plot_get::y -- vwuz1=vbum2_word_vbum3 + lda x + sta.z return+1 + lda y + sta.z return + // cbm_k_plot_get::@return + // } + // [132] return + rts + .segment Data + x: .byte 0 + y: .byte 0 +} +.segment Code + // gotoxy +// Set the cursor to the specified position +// void gotoxy(__zp($3c) char x, __zp($46) char y) +gotoxy: { + .label gotoxy__2 = $3c + .label gotoxy__3 = $3c + .label gotoxy__6 = $3a + .label gotoxy__7 = $3a + .label gotoxy__8 = $4a + .label gotoxy__9 = $48 + .label gotoxy__10 = $46 + .label x = $3c + .label y = $46 + .label gotoxy__14 = $3a + // (x>=__conio.width)?__conio.width:x + // [134] if(gotoxy::x#3>=*((char *)&__conio+6)) goto gotoxy::@1 -- vbuz1_ge__deref_pbuc1_then_la1 + lda.z x + cmp __conio+6 + bcs __b1 + // [136] phi from gotoxy gotoxy::@1 to gotoxy::@2 [phi:gotoxy/gotoxy::@1->gotoxy::@2] + // [136] phi gotoxy::$3 = gotoxy::x#3 [phi:gotoxy/gotoxy::@1->gotoxy::@2#0] -- register_copy + jmp __b2 + // gotoxy::@1 + __b1: + // [135] gotoxy::$2 = *((char *)&__conio+6) -- vbuz1=_deref_pbuc1 + lda __conio+6 + sta.z gotoxy__2 + // gotoxy::@2 + __b2: + // __conio.cursor_x = (x>=__conio.width)?__conio.width:x + // [137] *((char *)&__conio) = gotoxy::$3 -- _deref_pbuc1=vbuz1 + lda.z gotoxy__3 + sta __conio + // (y>=__conio.height)?__conio.height:y + // [138] if(gotoxy::y#3>=*((char *)&__conio+7)) goto gotoxy::@3 -- vbuz1_ge__deref_pbuc1_then_la1 + lda.z y + cmp __conio+7 + bcs __b3 + // gotoxy::@4 + // [139] gotoxy::$14 = gotoxy::y#3 -- vbuz1=vbuz2 + sta.z gotoxy__14 + // [140] phi from gotoxy::@3 gotoxy::@4 to gotoxy::@5 [phi:gotoxy::@3/gotoxy::@4->gotoxy::@5] + // [140] phi gotoxy::$7 = gotoxy::$6 [phi:gotoxy::@3/gotoxy::@4->gotoxy::@5#0] -- register_copy + // gotoxy::@5 + __b5: + // __conio.cursor_y = (y>=__conio.height)?__conio.height:y + // [141] *((char *)&__conio+1) = gotoxy::$7 -- _deref_pbuc1=vbuz1 + lda.z gotoxy__7 + sta __conio+1 + // __conio.cursor_x << 1 + // [142] gotoxy::$8 = *((char *)&__conio) << 1 -- vbuz1=_deref_pbuc1_rol_1 + lda __conio + asl + sta.z gotoxy__8 + // __conio.offsets[y] + __conio.cursor_x << 1 + // [143] gotoxy::$10 = gotoxy::y#3 << 1 -- vbuz1=vbuz1_rol_1 + asl.z gotoxy__10 + // [144] gotoxy::$9 = ((unsigned int *)&__conio+$15)[gotoxy::$10] + gotoxy::$8 -- vwuz1=pwuc1_derefidx_vbuz2_plus_vbuz3 + ldy.z gotoxy__10 + clc + adc __conio+$15,y + sta.z gotoxy__9 + lda __conio+$15+1,y + adc #0 + sta.z gotoxy__9+1 + // __conio.offset = __conio.offsets[y] + __conio.cursor_x << 1 + // [145] *((unsigned int *)&__conio+$13) = gotoxy::$9 -- _deref_pwuc1=vwuz1 + lda.z gotoxy__9 + sta __conio+$13 + lda.z gotoxy__9+1 + sta __conio+$13+1 + // gotoxy::@return + // } + // [146] return + rts + // gotoxy::@3 + __b3: + // (y>=__conio.height)?__conio.height:y + // [147] gotoxy::$6 = *((char *)&__conio+7) -- vbuz1=_deref_pbuc1 + lda __conio+7 + sta.z gotoxy__6 + jmp __b5 +} + // cputln +// Print a newline +cputln: { + .label cputln__2 = $5b + // __conio.cursor_x = 0 + // [148] *((char *)&__conio) = 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta __conio + // __conio.cursor_y++; + // [149] *((char *)&__conio+1) = ++ *((char *)&__conio+1) -- _deref_pbuc1=_inc__deref_pbuc1 + inc __conio+1 + // __conio.offset = __conio.offsets[__conio.cursor_y] + // [150] cputln::$2 = *((char *)&__conio+1) << 1 -- vbuz1=_deref_pbuc1_rol_1 + lda __conio+1 + asl + sta.z cputln__2 + // [151] *((unsigned int *)&__conio+$13) = ((unsigned int *)&__conio+$15)[cputln::$2] -- _deref_pwuc1=pwuc2_derefidx_vbuz1 + tay + lda __conio+$15,y + sta __conio+$13 + lda __conio+$15+1,y + sta __conio+$13+1 + // cscroll() + // [152] call cscroll + jsr cscroll + // cputln::@return + // } + // [153] return + rts +} + // cx16_k_screen_set_mode +/** + * @brief Sets the screen mode. + * + * @return cx16_k_screen_mode_error_t Contains 1 if there is an error. + */ +// char cx16_k_screen_set_mode(__zp($b8) volatile char mode) +cx16_k_screen_set_mode: { + .label mode = $b8 + .label error = $b4 + // cx16_k_screen_mode_error_t error = 0 + // [154] cx16_k_screen_set_mode::error = 0 -- vbuz1=vbuc1 + lda #0 + sta.z error + // asm + // asm { clc ldamode jsrCX16_SCREEN_MODE rolerror } + clc + lda mode + jsr CX16_SCREEN_MODE + rol error + // cx16_k_screen_set_mode::@return + // } + // [156] return + rts +} + // clrscr +// clears the screen and moves the cursor to the upper left-hand corner of the screen. +clrscr: { + .label clrscr__0 = $4f + .label clrscr__1 = $54 + .label clrscr__2 = $32 + .label line_text = $63 + .label l = $60 + .label ch = $63 + .label c = $5d + // unsigned int line_text = __conio.mapbase_offset + // [157] clrscr::line_text#0 = *((unsigned int *)&__conio+3) -- vwuz1=_deref_pwuc1 + lda __conio+3 + sta.z line_text + lda __conio+3+1 + sta.z line_text+1 + // *VERA_CTRL &= ~VERA_ADDRSEL + // [158] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + lda #VERA_ADDRSEL^$ff + and VERA_CTRL + sta VERA_CTRL + // __conio.mapbase_bank | VERA_INC_1 + // [159] clrscr::$0 = *((char *)&__conio+5) | VERA_INC_1 -- vbuz1=_deref_pbuc1_bor_vbuc2 + lda #VERA_INC_1 + ora __conio+5 + sta.z clrscr__0 + // *VERA_ADDRX_H = __conio.mapbase_bank | VERA_INC_1 + // [160] *VERA_ADDRX_H = clrscr::$0 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_H + // unsigned char l = __conio.mapheight + // [161] clrscr::l#0 = *((char *)&__conio+9) -- vbuz1=_deref_pbuc1 + lda __conio+9 + sta.z l + // [162] phi from clrscr clrscr::@3 to clrscr::@1 [phi:clrscr/clrscr::@3->clrscr::@1] + // [162] phi clrscr::l#4 = clrscr::l#0 [phi:clrscr/clrscr::@3->clrscr::@1#0] -- register_copy + // [162] phi clrscr::ch#0 = clrscr::line_text#0 [phi:clrscr/clrscr::@3->clrscr::@1#1] -- register_copy + // clrscr::@1 + __b1: + // BYTE0(ch) + // [163] clrscr::$1 = byte0 clrscr::ch#0 -- vbuz1=_byte0_vwuz2 + lda.z ch + sta.z clrscr__1 + // *VERA_ADDRX_L = BYTE0(ch) + // [164] *VERA_ADDRX_L = clrscr::$1 -- _deref_pbuc1=vbuz1 + // Set address + sta VERA_ADDRX_L + // BYTE1(ch) + // [165] clrscr::$2 = byte1 clrscr::ch#0 -- vbuz1=_byte1_vwuz2 + lda.z ch+1 + sta.z clrscr__2 + // *VERA_ADDRX_M = BYTE1(ch) + // [166] *VERA_ADDRX_M = clrscr::$2 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_M + // unsigned char c = __conio.mapwidth+1 + // [167] clrscr::c#0 = *((char *)&__conio+8) + 1 -- vbuz1=_deref_pbuc1_plus_1 + lda __conio+8 + inc + sta.z c + // [168] phi from clrscr::@1 clrscr::@2 to clrscr::@2 [phi:clrscr::@1/clrscr::@2->clrscr::@2] + // [168] phi clrscr::c#2 = clrscr::c#0 [phi:clrscr::@1/clrscr::@2->clrscr::@2#0] -- register_copy + // clrscr::@2 + __b2: + // *VERA_DATA0 = ' ' + // [169] *VERA_DATA0 = ' ' -- _deref_pbuc1=vbuc2 + lda #' ' + sta VERA_DATA0 + // *VERA_DATA0 = __conio.color + // [170] *VERA_DATA0 = *((char *)&__conio+$d) -- _deref_pbuc1=_deref_pbuc2 + lda __conio+$d + sta VERA_DATA0 + // c--; + // [171] clrscr::c#1 = -- clrscr::c#2 -- vbuz1=_dec_vbuz1 + dec.z c + // while(c) + // [172] if(0!=clrscr::c#1) goto clrscr::@2 -- 0_neq_vbuz1_then_la1 + lda.z c + bne __b2 + // clrscr::@3 + // line_text += __conio.rowskip + // [173] clrscr::line_text#1 = clrscr::ch#0 + *((unsigned int *)&__conio+$a) -- vwuz1=vwuz1_plus__deref_pwuc1 + clc + lda.z line_text + adc __conio+$a + sta.z line_text + lda.z line_text+1 + adc __conio+$a+1 + sta.z line_text+1 + // l--; + // [174] clrscr::l#1 = -- clrscr::l#4 -- vbuz1=_dec_vbuz1 + dec.z l + // while(l) + // [175] if(0!=clrscr::l#1) goto clrscr::@1 -- 0_neq_vbuz1_then_la1 + lda.z l + bne __b1 + // clrscr::@4 + // __conio.cursor_x = 0 + // [176] *((char *)&__conio) = 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta __conio + // __conio.cursor_y = 0 + // [177] *((char *)&__conio+1) = 0 -- _deref_pbuc1=vbuc2 + sta __conio+1 + // __conio.offset = __conio.mapbase_offset + // [178] *((unsigned int *)&__conio+$13) = *((unsigned int *)&__conio+3) -- _deref_pwuc1=_deref_pwuc2 + lda __conio+3 + sta __conio+$13 + lda __conio+3+1 + sta __conio+$13+1 + // clrscr::@return + // } + // [179] return + rts +} + // printf_str +/// Print a NUL-terminated string +// void printf_str(__zp($63) void (*putc)(char), __zp($59) const char *s) +printf_str: { + .label c = $39 + .label s = $59 + .label putc = $63 + // [181] phi from printf_str printf_str::@2 to printf_str::@1 [phi:printf_str/printf_str::@2->printf_str::@1] + // [181] phi printf_str::s#12 = printf_str::s#13 [phi:printf_str/printf_str::@2->printf_str::@1#0] -- register_copy + // printf_str::@1 + __b1: + // while(c=*s++) + // [182] printf_str::c#1 = *printf_str::s#12 -- vbuz1=_deref_pbuz2 + ldy #0 + lda (s),y + sta.z c + // [183] printf_str::s#0 = ++ printf_str::s#12 -- pbuz1=_inc_pbuz1 + inc.z s + bne !+ + inc.z s+1 + !: + // [184] if(0!=printf_str::c#1) goto printf_str::@2 -- 0_neq_vbuz1_then_la1 + lda.z c + bne __b2 + // printf_str::@return + // } + // [185] return + rts + // printf_str::@2 + __b2: + // putc(c) + // [186] stackpush(char) = printf_str::c#1 -- _stackpushbyte_=vbuz1 + lda.z c + pha + // [187] callexecute *printf_str::putc#13 -- call__deref_pprz1 + jsr icall1 + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + jmp __b1 + // Outside Flow + icall1: + jmp (putc) +} + // rom_calc_file_checksum +// void rom_calc_file_checksum(char rom_chip) +rom_calc_file_checksum: { + // We start for ROM from 0x0:0x7800 !!!! + .const rom_bram_bank = 0 + .label rom_bram_ptr = $400 + .label fp = $61 + .label rom_package_read = $34 + .label b = $59 + .label rom_calc_file_checksum__13 = $2a + // rom_calc_file_checksum::bank_set_bram1 + // BRAM = bank + // [190] BRAM = rom_calc_file_checksum::rom_bram_bank -- vbuz1=vbuc1 + lda #rom_bram_bank + sta.z BRAM + // [191] phi from rom_calc_file_checksum::bank_set_bram1 to rom_calc_file_checksum::@7 [phi:rom_calc_file_checksum::bank_set_bram1->rom_calc_file_checksum::@7] + // rom_calc_file_checksum::@7 + // printf("Opening %s from SD card ...\n", file) + // [192] call printf_str + // [180] phi from rom_calc_file_checksum::@7 to printf_str [phi:rom_calc_file_checksum::@7->printf_str] + // [180] phi printf_str::putc#13 = &cputc [phi:rom_calc_file_checksum::@7->printf_str#0] -- pprz1=pprc1 + lda #cputc + sta.z printf_str.putc+1 + // [180] phi printf_str::s#13 = rom_calc_file_checksum::s [phi:rom_calc_file_checksum::@7->printf_str#1] -- pbuz1=pbuc1 + lda #s + sta.z printf_str.s+1 + jsr printf_str + // [193] phi from rom_calc_file_checksum::@7 to rom_calc_file_checksum::@8 [phi:rom_calc_file_checksum::@7->rom_calc_file_checksum::@8] + // rom_calc_file_checksum::@8 + // printf("Opening %s from SD card ...\n", file) + // [194] call printf_string + // [286] phi from rom_calc_file_checksum::@8 to printf_string [phi:rom_calc_file_checksum::@8->printf_string] + jsr printf_string + // [195] phi from rom_calc_file_checksum::@8 to rom_calc_file_checksum::@9 [phi:rom_calc_file_checksum::@8->rom_calc_file_checksum::@9] + // rom_calc_file_checksum::@9 + // printf("Opening %s from SD card ...\n", file) + // [196] call printf_str + // [180] phi from rom_calc_file_checksum::@9 to printf_str [phi:rom_calc_file_checksum::@9->printf_str] + // [180] phi printf_str::putc#13 = &cputc [phi:rom_calc_file_checksum::@9->printf_str#0] -- pprz1=pprc1 + lda #cputc + sta.z printf_str.putc+1 + // [180] phi printf_str::s#13 = rom_calc_file_checksum::s1 [phi:rom_calc_file_checksum::@9->printf_str#1] -- pbuz1=pbuc1 + lda #s1 + sta.z printf_str.s+1 + jsr printf_str + // [197] phi from rom_calc_file_checksum::@9 to rom_calc_file_checksum::@10 [phi:rom_calc_file_checksum::@9->rom_calc_file_checksum::@10] + // rom_calc_file_checksum::@10 + // FILE *fp = fopen(file, "r") + // [198] call fopen + jsr fopen + // [199] fopen::return#3 = fopen::return#2 + // rom_calc_file_checksum::@11 + // [200] rom_calc_file_checksum::fp#0 = fopen::return#3 + // if (fp) + // [201] if((struct $2 *)0==rom_calc_file_checksum::fp#0) goto rom_calc_file_checksum::cbm_k_clrchn1 -- pssc1_eq_pssz1_then_la1 + lda.z fp + cmp #<0 + bne !+ + lda.z fp+1 + cmp #>0 + beq __b6 + !: + // [202] phi from rom_calc_file_checksum::@11 to rom_calc_file_checksum::@1 [phi:rom_calc_file_checksum::@11->rom_calc_file_checksum::@1] + // [202] phi rom_file_checksum#22 = 0 [phi:rom_calc_file_checksum::@11->rom_calc_file_checksum::@1#0] -- vdum1=vbuc1 + lda #0 + sta rom_file_checksum + sta rom_file_checksum+1 + sta rom_file_checksum+2 + sta rom_file_checksum+3 + // [202] phi rom_file_size#27 = 0 [phi:rom_calc_file_checksum::@11->rom_calc_file_checksum::@1#1] -- vdum1=vbuc1 + sta rom_file_size + sta rom_file_size+1 + sta rom_file_size+2 + sta rom_file_size+3 + // rom_calc_file_checksum::@1 + __b1: + // while (rom_file_size < 0x800000) + // [203] if(rom_file_size#27<$800000) goto rom_calc_file_checksum::@2 -- vdum1_lt_vduc1_then_la1 + lda rom_file_size+3 + cmp #>$800000>>$10 + bcc __b2 + bne !+ + lda rom_file_size+2 + cmp #<$800000>>$10 + bcc __b2 + bne !+ + lda rom_file_size+1 + cmp #>$800000 + bcc __b2 + bne !+ + lda rom_file_size + cmp #<$800000 + bcc __b2 + !: + // rom_calc_file_checksum::@3 + __b3: + // fclose(fp) + // [204] fclose::stream#0 = rom_calc_file_checksum::fp#0 + // [205] call fclose + jsr fclose + // [206] phi from rom_calc_file_checksum::@3 to rom_calc_file_checksum::cbm_k_clrchn1 [phi:rom_calc_file_checksum::@3->rom_calc_file_checksum::cbm_k_clrchn1] + // [206] phi rom_file_checksum#16 = rom_file_checksum#22 [phi:rom_calc_file_checksum::@3->rom_calc_file_checksum::cbm_k_clrchn1#0] -- register_copy + // [206] phi rom_file_size#10 = rom_file_size#27 [phi:rom_calc_file_checksum::@3->rom_calc_file_checksum::cbm_k_clrchn1#1] -- register_copy + jmp cbm_k_clrchn1 + // [206] phi from rom_calc_file_checksum::@11 to rom_calc_file_checksum::cbm_k_clrchn1 [phi:rom_calc_file_checksum::@11->rom_calc_file_checksum::cbm_k_clrchn1] + __b6: + // [206] phi rom_file_checksum#16 = 0 [phi:rom_calc_file_checksum::@11->rom_calc_file_checksum::cbm_k_clrchn1#0] -- vdum1=vbuc1 + lda #0 + sta rom_file_checksum + sta rom_file_checksum+1 + sta rom_file_checksum+2 + sta rom_file_checksum+3 + // [206] phi rom_file_size#10 = 0 [phi:rom_calc_file_checksum::@11->rom_calc_file_checksum::cbm_k_clrchn1#1] -- vdum1=vbuc1 + sta rom_file_size + sta rom_file_size+1 + sta rom_file_size+2 + sta rom_file_size+3 + // rom_calc_file_checksum::cbm_k_clrchn1 + cbm_k_clrchn1: + // asm + // asm { jsrCBM_CLRCHN } + jsr CBM_CLRCHN + // rom_calc_file_checksum::@return + // } + // [208] return + rts + // rom_calc_file_checksum::@2 + __b2: + // unsigned int rom_package_read = fgets(rom_bram_ptr, 128, fp) + // [209] fgets::stream#0 = rom_calc_file_checksum::fp#0 + // [210] call fgets + jsr fgets + // [211] fgets::return#5 = fgets::return#1 + // rom_calc_file_checksum::@12 + // [212] rom_calc_file_checksum::rom_package_read#0 = fgets::return#5 + // if (!rom_package_read) + // [213] if(0!=rom_calc_file_checksum::rom_package_read#0) goto rom_calc_file_checksum::@4 -- 0_neq_vwuz1_then_la1 + lda.z rom_package_read + ora.z rom_package_read+1 + bne __b7 + jmp __b3 + // [214] phi from rom_calc_file_checksum::@12 to rom_calc_file_checksum::@4 [phi:rom_calc_file_checksum::@12->rom_calc_file_checksum::@4] + __b7: + // [214] phi rom_file_checksum#15 = rom_file_checksum#22 [phi:rom_calc_file_checksum::@12->rom_calc_file_checksum::@4#0] -- register_copy + // [214] phi rom_calc_file_checksum::b#2 = 0 [phi:rom_calc_file_checksum::@12->rom_calc_file_checksum::@4#1] -- vwuz1=vwuc1 + lda #<0 + sta.z b + sta.z b+1 + // rom_calc_file_checksum::@4 + __b4: + // for(unsigned int b=0; brom_calc_file_checksum::@1] + // [202] phi rom_file_checksum#22 = rom_file_checksum#15 [phi:rom_calc_file_checksum::@6->rom_calc_file_checksum::@1#0] -- register_copy + // [202] phi rom_file_size#27 = rom_file_size#1 [phi:rom_calc_file_checksum::@6->rom_calc_file_checksum::@1#1] -- register_copy + jmp __b1 + // rom_calc_file_checksum::@5 + __b5: + // rom_file_checksum += rom_bram_ptr[b] + // [217] rom_calc_file_checksum::$13 = rom_calc_file_checksum::rom_bram_ptr#1 + rom_calc_file_checksum::b#2 -- pbuz1=pbuc1_plus_vwuz2 + lda.z b + clc + adc #rom_bram_ptr + sta.z rom_calc_file_checksum__13+1 + // [218] rom_file_checksum#1 = rom_file_checksum#15 + *rom_calc_file_checksum::$13 -- vdum1=vdum1_plus__deref_pbuz2 + ldy #0 + lda (rom_calc_file_checksum__13),y + clc + adc rom_file_checksum + sta rom_file_checksum + lda rom_file_checksum+1 + adc #0 + sta rom_file_checksum+1 + lda rom_file_checksum+2 + adc #0 + sta rom_file_checksum+2 + lda rom_file_checksum+3 + adc #0 + sta rom_file_checksum+3 + // for(unsigned int b=0; brom_calc_file_checksum::@4] + // [214] phi rom_file_checksum#15 = rom_file_checksum#1 [phi:rom_calc_file_checksum::@5->rom_calc_file_checksum::@4#0] -- register_copy + // [214] phi rom_calc_file_checksum::b#2 = rom_calc_file_checksum::b#1 [phi:rom_calc_file_checksum::@5->rom_calc_file_checksum::@4#1] -- register_copy + jmp __b4 + .segment Data + file: .text "ROM-R45.BIN" + .byte 0 + s: .text "Opening " + .byte 0 + s1: .text @" from SD card ...\n" + .byte 0 +} +.segment Code + // printf_ulong +// Print an unsigned int using a specific format +// void printf_ulong(void (*putc)(char), __zp($42) unsigned long uvalue, char format_min_length, char format_justify_left, char format_sign_always, char format_zero_padding, char format_upper_case, char format_radix) +printf_ulong: { + .label uvalue = $42 + // printf_ulong::@1 + // printf_buffer.sign = format.sign_always?'+':0 + // [221] *((char *)&printf_buffer) = 0 -- _deref_pbuc1=vbuc2 + // Handle any sign + lda #0 + sta printf_buffer + // ultoa(uvalue, printf_buffer.digits, format.radix) + // [222] ultoa::value#1 = printf_ulong::uvalue#3 + // [223] call ultoa + // Format number into buffer + // [428] phi from printf_ulong::@1 to ultoa [phi:printf_ulong::@1->ultoa] + jsr ultoa + // printf_ulong::@2 + // printf_number_buffer(putc, printf_buffer, format) + // [224] printf_number_buffer::buffer_sign#0 = *((char *)&printf_buffer) -- vbuz1=_deref_pbuc1 + lda printf_buffer + sta.z printf_number_buffer.buffer_sign + // [225] call printf_number_buffer + // Print using format + // [449] phi from printf_ulong::@2 to printf_number_buffer [phi:printf_ulong::@2->printf_number_buffer] + jsr printf_number_buffer + // printf_ulong::@return + // } + // [226] return + rts +} + // rom_calc_rom_checksum +rom_calc_rom_checksum: { + .const bank_set_brom2_bank = 4 + .label rom_addr = $42 + .label byte_brom = $63 + .label bank_brom = $60 + // rom_calc_rom_checksum::SEI1 + // asm + // asm { sei } + sei + // [229] phi from rom_calc_rom_checksum::SEI1 to rom_calc_rom_checksum::@1 [phi:rom_calc_rom_checksum::SEI1->rom_calc_rom_checksum::@1] + // [229] phi rom_calc_rom_checksum::byte_brom#3 = (char *) 49152 [phi:rom_calc_rom_checksum::SEI1->rom_calc_rom_checksum::@1#0] -- pbuz1=pbuc1 + lda #<$c000 + sta.z byte_brom + lda #>$c000 + sta.z byte_brom+1 + // [229] phi rom_checksum#1 = 0 [phi:rom_calc_rom_checksum::SEI1->rom_calc_rom_checksum::@1#1] -- vdum1=vduc1 + lda #<0 + sta rom_checksum + sta rom_checksum+1 + lda #<0>>$10 + sta rom_checksum+2 + lda #>0>>$10 + sta rom_checksum+3 + // [229] phi rom_calc_rom_checksum::bank_brom#2 = 0 [phi:rom_calc_rom_checksum::SEI1->rom_calc_rom_checksum::@1#2] -- vbuz1=vbuc1 + lda #0 + sta.z bank_brom + // [229] phi rom_calc_rom_checksum::rom_addr#2 = 0 [phi:rom_calc_rom_checksum::SEI1->rom_calc_rom_checksum::@1#3] -- vduz1=vduc1 + sta.z rom_addr + sta.z rom_addr+1 + lda #<0>>$10 + sta.z rom_addr+2 + lda #>0>>$10 + sta.z rom_addr+3 + // [229] phi from rom_calc_rom_checksum::@3 to rom_calc_rom_checksum::@1 [phi:rom_calc_rom_checksum::@3->rom_calc_rom_checksum::@1] + // [229] phi rom_calc_rom_checksum::byte_brom#3 = rom_calc_rom_checksum::byte_brom#1 [phi:rom_calc_rom_checksum::@3->rom_calc_rom_checksum::@1#0] -- register_copy + // [229] phi rom_checksum#1 = rom_checksum#0 [phi:rom_calc_rom_checksum::@3->rom_calc_rom_checksum::@1#1] -- register_copy + // [229] phi rom_calc_rom_checksum::bank_brom#2 = rom_calc_rom_checksum::bank_brom#2 [phi:rom_calc_rom_checksum::@3->rom_calc_rom_checksum::@1#2] -- register_copy + // [229] phi rom_calc_rom_checksum::rom_addr#2 = rom_calc_rom_checksum::rom_addr#1 [phi:rom_calc_rom_checksum::@3->rom_calc_rom_checksum::@1#3] -- register_copy + // rom_calc_rom_checksum::@1 + __b1: + // while(rom_addr < rom_file_size) + // [230] if(rom_calc_rom_checksum::rom_addr#2rom_calc_rom_checksum::@1] + // [229] phi rom_calc_rom_checksum::byte_brom#3 = (char *) 49152 [phi:rom_calc_rom_checksum::@2->rom_calc_rom_checksum::@1#0] -- pbuz1=pbuc1 + lda #<$c000 + sta.z byte_brom + lda #>$c000 + sta.z byte_brom+1 + // [229] phi rom_checksum#1 = rom_checksum#0 [phi:rom_calc_rom_checksum::@2->rom_calc_rom_checksum::@1#1] -- register_copy + // [229] phi rom_calc_rom_checksum::bank_brom#2 = rom_calc_rom_checksum::bank_brom#1 [phi:rom_calc_rom_checksum::@2->rom_calc_rom_checksum::@1#2] -- register_copy + // [229] phi rom_calc_rom_checksum::rom_addr#2 = rom_calc_rom_checksum::rom_addr#1 [phi:rom_calc_rom_checksum::@2->rom_calc_rom_checksum::@1#3] -- register_copy + jmp __b1 +} + // screenlayer +// --- layer management in VERA --- +// void screenlayer(char layer, __zp($7c) char mapbase, __zp($78) char config) +screenlayer: { + .label screenlayer__0 = $7d + .label screenlayer__1 = $7c + .label screenlayer__2 = $7e + .label screenlayer__5 = $78 + .label screenlayer__6 = $78 + .label screenlayer__7 = $77 + .label screenlayer__8 = $77 + .label screenlayer__9 = $72 + .label screenlayer__10 = $72 + .label screenlayer__11 = $72 + .label screenlayer__12 = $73 + .label screenlayer__13 = $73 + .label screenlayer__14 = $73 + .label screenlayer__16 = $77 + .label screenlayer__17 = $68 + .label screenlayer__18 = $72 + .label screenlayer__19 = $73 + .label mapbase = $7c + .label config = $78 + .label mapbase_offset = $69 + .label y = $65 + // __mem char vera_dc_hscale_temp = *VERA_DC_HSCALE + // [240] screenlayer::vera_dc_hscale_temp#0 = *VERA_DC_HSCALE -- vbum1=_deref_pbuc1 + lda VERA_DC_HSCALE + sta vera_dc_hscale_temp + // __mem char vera_dc_vscale_temp = *VERA_DC_VSCALE + // [241] screenlayer::vera_dc_vscale_temp#0 = *VERA_DC_VSCALE -- vbum1=_deref_pbuc1 + lda VERA_DC_VSCALE + sta vera_dc_vscale_temp + // __conio.layer = 0 + // [242] *((char *)&__conio+2) = 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta __conio+2 + // mapbase >> 7 + // [243] screenlayer::$0 = screenlayer::mapbase#0 >> 7 -- vbuz1=vbuz2_ror_7 + lda.z mapbase + rol + rol + and #1 + sta.z screenlayer__0 + // __conio.mapbase_bank = mapbase >> 7 + // [244] *((char *)&__conio+5) = screenlayer::$0 -- _deref_pbuc1=vbuz1 + sta __conio+5 + // (mapbase)<<1 + // [245] screenlayer::$1 = screenlayer::mapbase#0 << 1 -- vbuz1=vbuz1_rol_1 + asl.z screenlayer__1 + // MAKEWORD((mapbase)<<1,0) + // [246] screenlayer::$2 = screenlayer::$1 w= 0 -- vwuz1=vbuz2_word_vbuc1 + lda #0 + ldy.z screenlayer__1 + sty.z screenlayer__2+1 + sta.z screenlayer__2 + // __conio.mapbase_offset = MAKEWORD((mapbase)<<1,0) + // [247] *((unsigned int *)&__conio+3) = screenlayer::$2 -- _deref_pwuc1=vwuz1 + sta __conio+3 + tya + sta __conio+3+1 + // config & VERA_LAYER_WIDTH_MASK + // [248] screenlayer::$7 = screenlayer::config#0 & VERA_LAYER_WIDTH_MASK -- vbuz1=vbuz2_band_vbuc1 + lda #VERA_LAYER_WIDTH_MASK + and.z config + sta.z screenlayer__7 + // (config & VERA_LAYER_WIDTH_MASK) >> 4 + // [249] screenlayer::$8 = screenlayer::$7 >> 4 -- vbuz1=vbuz1_ror_4 + lda.z screenlayer__8 + lsr + lsr + lsr + lsr + sta.z screenlayer__8 + // __conio.mapwidth = VERA_LAYER_DIM[ (config & VERA_LAYER_WIDTH_MASK) >> 4] + // [250] *((char *)&__conio+8) = screenlayer::VERA_LAYER_DIM[screenlayer::$8] -- _deref_pbuc1=pbuc2_derefidx_vbuz1 + tay + lda VERA_LAYER_DIM,y + sta __conio+8 + // config & VERA_LAYER_HEIGHT_MASK + // [251] screenlayer::$5 = screenlayer::config#0 & VERA_LAYER_HEIGHT_MASK -- vbuz1=vbuz1_band_vbuc1 + lda #VERA_LAYER_HEIGHT_MASK + and.z screenlayer__5 + sta.z screenlayer__5 + // (config & VERA_LAYER_HEIGHT_MASK) >> 6 + // [252] screenlayer::$6 = screenlayer::$5 >> 6 -- vbuz1=vbuz1_ror_6 + lda.z screenlayer__6 + rol + rol + rol + and #3 + sta.z screenlayer__6 + // __conio.mapheight = VERA_LAYER_DIM[ (config & VERA_LAYER_HEIGHT_MASK) >> 6] + // [253] *((char *)&__conio+9) = screenlayer::VERA_LAYER_DIM[screenlayer::$6] -- _deref_pbuc1=pbuc2_derefidx_vbuz1 + tay + lda VERA_LAYER_DIM,y + sta __conio+9 + // __conio.rowskip = VERA_LAYER_SKIP[(config & VERA_LAYER_WIDTH_MASK)>>4] + // [254] screenlayer::$16 = screenlayer::$8 << 1 -- vbuz1=vbuz1_rol_1 + asl.z screenlayer__16 + // [255] *((unsigned int *)&__conio+$a) = screenlayer::VERA_LAYER_SKIP[screenlayer::$16] -- _deref_pwuc1=pwuc2_derefidx_vbuz1 + // __conio.rowshift = ((config & VERA_LAYER_WIDTH_MASK)>>4)+6; + ldy.z screenlayer__16 + lda VERA_LAYER_SKIP,y + sta __conio+$a + lda VERA_LAYER_SKIP+1,y + sta __conio+$a+1 + // vera_dc_hscale_temp == 0x80 + // [256] screenlayer::$9 = screenlayer::vera_dc_hscale_temp#0 == $80 -- vboz1=vbum2_eq_vbuc1 + lda vera_dc_hscale_temp + eor #$80 + beq !+ + lda #1 + !: + eor #1 + sta.z screenlayer__9 + // 40 << (char)(vera_dc_hscale_temp == 0x80) + // [257] screenlayer::$18 = (char)screenlayer::$9 + // [258] screenlayer::$10 = $28 << screenlayer::$18 -- vbuz1=vbuc1_rol_vbuz1 + lda #$28 + ldy.z screenlayer__10 + cpy #0 + beq !e+ + !: + asl + dey + bne !- + !e: + sta.z screenlayer__10 + // (40 << (char)(vera_dc_hscale_temp == 0x80))-1 + // [259] screenlayer::$11 = screenlayer::$10 - 1 -- vbuz1=vbuz1_minus_1 + dec.z screenlayer__11 + // __conio.width = (40 << (char)(vera_dc_hscale_temp == 0x80))-1 + // [260] *((char *)&__conio+6) = screenlayer::$11 -- _deref_pbuc1=vbuz1 + lda.z screenlayer__11 + sta __conio+6 + // vera_dc_vscale_temp == 0x80 + // [261] screenlayer::$12 = screenlayer::vera_dc_vscale_temp#0 == $80 -- vboz1=vbum2_eq_vbuc1 + lda vera_dc_vscale_temp + eor #$80 + beq !+ + lda #1 + !: + eor #1 + sta.z screenlayer__12 + // 30 << (char)(vera_dc_vscale_temp == 0x80) + // [262] screenlayer::$19 = (char)screenlayer::$12 + // [263] screenlayer::$13 = $1e << screenlayer::$19 -- vbuz1=vbuc1_rol_vbuz1 + lda #$1e + ldy.z screenlayer__13 + cpy #0 + beq !e+ + !: + asl + dey + bne !- + !e: + sta.z screenlayer__13 + // (30 << (char)(vera_dc_vscale_temp == 0x80))-1 + // [264] screenlayer::$14 = screenlayer::$13 - 1 -- vbuz1=vbuz1_minus_1 + dec.z screenlayer__14 + // __conio.height = (30 << (char)(vera_dc_vscale_temp == 0x80))-1 + // [265] *((char *)&__conio+7) = screenlayer::$14 -- _deref_pbuc1=vbuz1 + lda.z screenlayer__14 + sta __conio+7 + // unsigned int mapbase_offset = __conio.mapbase_offset + // [266] screenlayer::mapbase_offset#0 = *((unsigned int *)&__conio+3) -- vwuz1=_deref_pwuc1 + lda __conio+3 + sta.z mapbase_offset + lda __conio+3+1 + sta.z mapbase_offset+1 + // [267] phi from screenlayer to screenlayer::@1 [phi:screenlayer->screenlayer::@1] + // [267] phi screenlayer::mapbase_offset#2 = screenlayer::mapbase_offset#0 [phi:screenlayer->screenlayer::@1#0] -- register_copy + // [267] phi screenlayer::y#2 = 0 [phi:screenlayer->screenlayer::@1#1] -- vbuz1=vbuc1 + lda #0 + sta.z y + // screenlayer::@1 + __b1: + // for(register char y=0; y<=__conio.height; y++) + // [268] if(screenlayer::y#2<=*((char *)&__conio+7)) goto screenlayer::@2 -- vbuz1_le__deref_pbuc1_then_la1 + lda __conio+7 + cmp.z y + bcs __b2 + // screenlayer::@return + // } + // [269] return + rts + // screenlayer::@2 + __b2: + // __conio.offsets[y] = mapbase_offset + // [270] screenlayer::$17 = screenlayer::y#2 << 1 -- vbuz1=vbuz2_rol_1 + lda.z y + asl + sta.z screenlayer__17 + // [271] ((unsigned int *)&__conio+$15)[screenlayer::$17] = screenlayer::mapbase_offset#2 -- pwuc1_derefidx_vbuz1=vwuz2 + tay + lda.z mapbase_offset + sta __conio+$15,y + lda.z mapbase_offset+1 + sta __conio+$15+1,y + // mapbase_offset += __conio.rowskip + // [272] screenlayer::mapbase_offset#1 = screenlayer::mapbase_offset#2 + *((unsigned int *)&__conio+$a) -- vwuz1=vwuz1_plus__deref_pwuc1 + clc + lda.z mapbase_offset + adc __conio+$a + sta.z mapbase_offset + lda.z mapbase_offset+1 + adc __conio+$a+1 + sta.z mapbase_offset+1 + // for(register char y=0; y<=__conio.height; y++) + // [273] screenlayer::y#1 = ++ screenlayer::y#2 -- vbuz1=_inc_vbuz1 + inc.z y + // [267] phi from screenlayer::@2 to screenlayer::@1 [phi:screenlayer::@2->screenlayer::@1] + // [267] phi screenlayer::mapbase_offset#2 = screenlayer::mapbase_offset#1 [phi:screenlayer::@2->screenlayer::@1#0] -- register_copy + // [267] phi screenlayer::y#2 = screenlayer::y#1 [phi:screenlayer::@2->screenlayer::@1#1] -- register_copy + jmp __b1 + .segment Data + VERA_LAYER_DIM: .byte $1f, $3f, $7f, $ff + VERA_LAYER_SKIP: .word $40, $80, $100, $200 + vera_dc_hscale_temp: .byte 0 + vera_dc_vscale_temp: .byte 0 +} +.segment Code + // cscroll +// Scroll the entire screen if the cursor is beyond the last line +cscroll: { + // if(__conio.cursor_y>__conio.height) + // [274] if(*((char *)&__conio+1)<=*((char *)&__conio+7)) goto cscroll::@return -- _deref_pbuc1_le__deref_pbuc2_then_la1 + lda __conio+7 + cmp __conio+1 + bcs __breturn + // cscroll::@1 + // if(__conio.scroll[__conio.layer]) + // [275] if(0!=((char *)&__conio+$f)[*((char *)&__conio+2)]) goto cscroll::@4 -- 0_neq_pbuc1_derefidx_(_deref_pbuc2)_then_la1 + ldy __conio+2 + lda __conio+$f,y + cmp #0 + bne __b4 + // cscroll::@2 + // if(__conio.cursor_y>__conio.height) + // [276] if(*((char *)&__conio+1)<=*((char *)&__conio+7)) goto cscroll::@return -- _deref_pbuc1_le__deref_pbuc2_then_la1 + lda __conio+7 + cmp __conio+1 + bcs __breturn + // [277] phi from cscroll::@2 to cscroll::@3 [phi:cscroll::@2->cscroll::@3] + // cscroll::@3 + // gotoxy(0,0) + // [278] call gotoxy + // [133] phi from cscroll::@3 to gotoxy [phi:cscroll::@3->gotoxy] + // [133] phi gotoxy::y#3 = 0 [phi:cscroll::@3->gotoxy#0] -- vbuz1=vbuc1 + lda #0 + sta.z gotoxy.y + // [133] phi gotoxy::x#3 = 0 [phi:cscroll::@3->gotoxy#1] -- vbuz1=vbuc1 + sta.z gotoxy.x + jsr gotoxy + // cscroll::@return + __breturn: + // } + // [279] return + rts + // [280] phi from cscroll::@1 to cscroll::@4 [phi:cscroll::@1->cscroll::@4] + // cscroll::@4 + __b4: + // insertup(1) + // [281] call insertup + jsr insertup + // cscroll::@5 + // gotoxy( 0, __conio.height) + // [282] gotoxy::y#1 = *((char *)&__conio+7) -- vbuz1=_deref_pbuc1 + lda __conio+7 + sta.z gotoxy.y + // [283] call gotoxy + // [133] phi from cscroll::@5 to gotoxy [phi:cscroll::@5->gotoxy] + // [133] phi gotoxy::y#3 = gotoxy::y#1 [phi:cscroll::@5->gotoxy#0] -- register_copy + // [133] phi gotoxy::x#3 = 0 [phi:cscroll::@5->gotoxy#1] -- vbuz1=vbuc1 + lda #0 + sta.z gotoxy.x + jsr gotoxy + // [284] phi from cscroll::@5 to cscroll::@6 [phi:cscroll::@5->cscroll::@6] + // cscroll::@6 + // clearline() + // [285] call clearline + jsr clearline + rts +} + // printf_string +// Print a string value using a specific format +// Handles justification and min length +// void printf_string(void (*putc)(char), char *str, char format_min_length, char format_justify_left) +printf_string: { + .label putc = cputc + // [287] phi from printf_string to printf_string::@1 [phi:printf_string->printf_string::@1] + // printf_string::@1 + // printf_str(putc, str) + // [288] call printf_str + // [180] phi from printf_string::@1 to printf_str [phi:printf_string::@1->printf_str] + // [180] phi printf_str::putc#13 = printf_string::putc#0 [phi:printf_string::@1->printf_str#0] -- pprz1=pprc1 + lda #putc + sta.z printf_str.putc+1 + // [180] phi printf_str::s#13 = rom_calc_file_checksum::file [phi:printf_string::@1->printf_str#1] -- pbuz1=pbuc1 + lda #rom_calc_file_checksum.file + sta.z printf_str.s+1 + jsr printf_str + // printf_string::@return + // } + // [289] return + rts +} + // fopen +/** + * @brief Load a file to banked ram located between address 0xA000 and 0xBFFF incrementing the banks. + * + * @param channel Input channel. + * @param device Input device. + * @param secondary Secondary channel. + * @param filename Name of the file to be loaded. + * @return + * - 0x0000: Something is wrong! Kernal Error Code (https://commodore.ca/manuals/pdfs/commodore_error_messages.pdf) + * - other: OK! The last pointer between 0xA000 and 0xBFFF is returned. Note that the last pointer is indicating the first free byte. + */ +// __zp($61) struct $2 * fopen(__zp($3f) const char *path, const char *mode) +fopen: { + .label stream = $8000 + .label fopen__15 = $47 + .label fopen__16 = $2e + .label fopen__26 = $2a + .label fopen__28 = $34 + .label cbm_k_setnam1_filename = $b2 + .label cbm_k_setnam1_filename_len = $aa + .label cbm_k_setnam1_fopen__0 = $3d + .label cbm_k_readst1_status = $ab + .label cbm_k_close1_channel = $ac + .label pathpos = $60 + .label pathtoken = $63 + .label pathcmp = $71 + .label path = $3f + // Parse path + .label pathstep = $5d + .label num = $5c + .label cbm_k_readst1_return = $47 + .label return = $61 + // __logical = 0 + // [290] *((char *)&__stdio_file+$80) = 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta __stdio_file+$80 + // __device = 0 + // [291] *((char *)&__stdio_file+$84) = 0 -- _deref_pbuc1=vbuc2 + sta __stdio_file+$84 + // __channel = 0 + // [292] *((char *)&__stdio_file+$88) = 0 -- _deref_pbuc1=vbuc2 + sta __stdio_file+$88 + // [293] phi from fopen to fopen::@7 [phi:fopen->fopen::@7] + // [293] phi fopen::num#10 = 0 [phi:fopen->fopen::@7#0] -- vbuz1=vbuc1 + sta.z num + // [293] phi fopen::pathpos#10 = 0 [phi:fopen->fopen::@7#1] -- vbuz1=vbuc1 + sta.z pathpos + // [293] phi fopen::path#13 = rom_calc_file_checksum::file [phi:fopen->fopen::@7#2] -- pbuz1=pbuc1 + lda #rom_calc_file_checksum.file + sta.z path+1 + // [293] phi fopen::pathstep#10 = 0 [phi:fopen->fopen::@7#3] -- vbuz1=vbuc1 + lda #0 + sta.z pathstep + // [293] phi fopen::pathtoken#10 = rom_calc_file_checksum::file [phi:fopen->fopen::@7#4] -- pbuz1=pbuc1 + lda #rom_calc_file_checksum.file + sta.z pathtoken+1 + // Iterate while path is not \0. + // [293] phi from fopen::@21 to fopen::@7 [phi:fopen::@21->fopen::@7] + // [293] phi fopen::num#10 = fopen::num#13 [phi:fopen::@21->fopen::@7#0] -- register_copy + // [293] phi fopen::pathpos#10 = fopen::pathpos#7 [phi:fopen::@21->fopen::@7#1] -- register_copy + // [293] phi fopen::path#13 = fopen::path#10 [phi:fopen::@21->fopen::@7#2] -- register_copy + // [293] phi fopen::pathstep#10 = fopen::pathstep#11 [phi:fopen::@21->fopen::@7#3] -- register_copy + // [293] phi fopen::pathtoken#10 = fopen::pathtoken#1 [phi:fopen::@21->fopen::@7#4] -- register_copy + // fopen::@7 + __b7: + // if (*pathtoken == ',' || *pathtoken == '\0') + // [294] if(*fopen::pathtoken#10==',') goto fopen::@8 -- _deref_pbuz1_eq_vbuc1_then_la1 + lda #',' + ldy #0 + cmp (pathtoken),y + bne !__b8+ + jmp __b8 + !__b8: + // fopen::@32 + // [295] if(*fopen::pathtoken#10=='@') goto fopen::@8 -- _deref_pbuz1_eq_vbuc1_then_la1 + lda #'@' + cmp (pathtoken),y + bne !__b8+ + jmp __b8 + !__b8: + // fopen::@22 + // if (pathstep == 0) + // [296] if(fopen::pathstep#10!=0) goto fopen::@9 -- vbuz1_neq_0_then_la1 + lda.z pathstep + bne __b9 + // fopen::@23 + // __stdio_file.filename[pathpos] = *pathtoken + // [297] ((char *)&__stdio_file)[fopen::pathpos#10] = *fopen::pathtoken#10 -- pbuc1_derefidx_vbuz1=_deref_pbuz2 + lda (pathtoken),y + ldy.z pathpos + sta __stdio_file,y + // pathpos++; + // [298] fopen::pathpos#1 = ++ fopen::pathpos#10 -- vbuz1=_inc_vbuz1 + inc.z pathpos + // [299] phi from fopen::@11 fopen::@22 fopen::@23 to fopen::@9 [phi:fopen::@11/fopen::@22/fopen::@23->fopen::@9] + // [299] phi fopen::num#13 = fopen::num#15 [phi:fopen::@11/fopen::@22/fopen::@23->fopen::@9#0] -- register_copy + // [299] phi fopen::pathpos#7 = fopen::pathpos#10 [phi:fopen::@11/fopen::@22/fopen::@23->fopen::@9#1] -- register_copy + // [299] phi fopen::path#10 = fopen::path#12 [phi:fopen::@11/fopen::@22/fopen::@23->fopen::@9#2] -- register_copy + // [299] phi fopen::pathstep#11 = fopen::pathstep#1 [phi:fopen::@11/fopen::@22/fopen::@23->fopen::@9#3] -- register_copy + // fopen::@9 + __b9: + // pathtoken++; + // [300] fopen::pathtoken#1 = ++ fopen::pathtoken#10 -- pbuz1=_inc_pbuz1 + inc.z pathtoken + bne !+ + inc.z pathtoken+1 + !: + // fopen::@21 + // pathtoken - 1 + // [301] fopen::$28 = fopen::pathtoken#1 - 1 -- pbuz1=pbuz2_minus_1 + lda.z pathtoken + sec + sbc #1 + sta.z fopen__28 + lda.z pathtoken+1 + sbc #0 + sta.z fopen__28+1 + // while (*(pathtoken - 1)) + // [302] if(0!=*fopen::$28) goto fopen::@7 -- 0_neq__deref_pbuz1_then_la1 + ldy #0 + lda (fopen__28),y + cmp #0 + bne __b7 + // fopen::@25 + // __status = 0 + // [303] *((char *)&__stdio_file+$8c) = 0 -- _deref_pbuc1=vbuc2 + tya + sta __stdio_file+$8c + // if(!__logical) + // [304] if(0!=*((char *)&__stdio_file+$80)) goto fopen::@1 -- 0_neq__deref_pbuc1_then_la1 + lda __stdio_file+$80 + bne __b1 + // fopen::@26 + // __logical = __stdio_filecount+1 + // [305] *((char *)&__stdio_file+$80) = 1 -- _deref_pbuc1=vbuc2 + lda #1 + sta __stdio_file+$80 + // fopen::@1 + __b1: + // if(!__device) + // [306] if(0!=*((char *)&__stdio_file+$84)) goto fopen::@2 -- 0_neq__deref_pbuc1_then_la1 + lda __stdio_file+$84 + bne __b2 + // fopen::@4 + // __device = 8 + // [307] *((char *)&__stdio_file+$84) = 8 -- _deref_pbuc1=vbuc2 + lda #8 + sta __stdio_file+$84 + // fopen::@2 + __b2: + // if(!__channel) + // [308] if(0!=*((char *)&__stdio_file+$88)) goto fopen::@3 -- 0_neq__deref_pbuc1_then_la1 + lda __stdio_file+$88 + bne __b3 + // fopen::@5 + // __channel = __stdio_filecount+2 + // [309] *((char *)&__stdio_file+$88) = 2 -- _deref_pbuc1=vbuc2 + lda #2 + sta __stdio_file+$88 + // fopen::@3 + __b3: + // cbm_k_setnam(__filename) + // [310] fopen::cbm_k_setnam1_filename = (char *)&__stdio_file -- pbuz1=pbuc1 + lda #<__stdio_file + sta.z cbm_k_setnam1_filename + lda #>__stdio_file + sta.z cbm_k_setnam1_filename+1 + // fopen::cbm_k_setnam1 + // strlen(filename) + // [311] strlen::str#3 = fopen::cbm_k_setnam1_filename -- pbuz1=pbuz2 + lda.z cbm_k_setnam1_filename + sta.z strlen.str + lda.z cbm_k_setnam1_filename+1 + sta.z strlen.str+1 + // [312] call strlen + // [490] phi from fopen::cbm_k_setnam1 to strlen [phi:fopen::cbm_k_setnam1->strlen] + // [490] phi strlen::str#7 = strlen::str#3 [phi:fopen::cbm_k_setnam1->strlen#0] -- register_copy + jsr strlen + // strlen(filename) + // [313] strlen::return#4 = strlen::len#2 + // fopen::@30 + // [314] fopen::cbm_k_setnam1_$0 = strlen::return#4 + // char filename_len = (char)strlen(filename) + // [315] fopen::cbm_k_setnam1_filename_len = (char)fopen::cbm_k_setnam1_$0 -- vbuz1=_byte_vwuz2 + lda.z cbm_k_setnam1_fopen__0 + sta.z cbm_k_setnam1_filename_len + // asm + // asm { ldafilename_len ldxfilename ldyfilename+1 jsrCBM_SETNAM } + ldx cbm_k_setnam1_filename + ldy cbm_k_setnam1_filename+1 + jsr CBM_SETNAM + // fopen::@27 + // cbm_k_setlfs(__logical, __device, __channel) + // [317] cbm_k_setlfs::channel = *((char *)&__stdio_file+$80) -- vbuz1=_deref_pbuc1 + lda __stdio_file+$80 + sta.z cbm_k_setlfs.channel + // [318] cbm_k_setlfs::device = *((char *)&__stdio_file+$84) -- vbuz1=_deref_pbuc1 + lda __stdio_file+$84 + sta.z cbm_k_setlfs.device + // [319] cbm_k_setlfs::command = *((char *)&__stdio_file+$88) -- vbuz1=_deref_pbuc1 + lda __stdio_file+$88 + sta.z cbm_k_setlfs.command + // [320] call cbm_k_setlfs + jsr cbm_k_setlfs + // fopen::cbm_k_open1 + // asm + // asm { jsrCBM_OPEN } + jsr CBM_OPEN + // fopen::cbm_k_readst1 + // char status + // [322] fopen::cbm_k_readst1_status = 0 -- vbuz1=vbuc1 + lda #0 + sta.z cbm_k_readst1_status + // asm + // asm { jsrCBM_READST stastatus } + jsr CBM_READST + sta cbm_k_readst1_status + // return status; + // [324] fopen::cbm_k_readst1_return#0 = fopen::cbm_k_readst1_status -- vbuz1=vbuz2 + sta.z cbm_k_readst1_return + // fopen::cbm_k_readst1_@return + // } + // [325] fopen::cbm_k_readst1_return#1 = fopen::cbm_k_readst1_return#0 + // fopen::@28 + // cbm_k_readst() + // [326] fopen::$15 = fopen::cbm_k_readst1_return#1 + // __status = cbm_k_readst() + // [327] *((char *)&__stdio_file+$8c) = fopen::$15 -- _deref_pbuc1=vbuz1 + lda.z fopen__15 + sta __stdio_file+$8c + // ferror(stream) + // [328] call ferror + jsr ferror + // [329] ferror::return#0 = ferror::return#1 + // fopen::@31 + // [330] fopen::$16 = ferror::return#0 + // if (ferror(stream)) + // [331] if(0==fopen::$16) goto fopen::@return -- 0_eq_vwsz1_then_la1 + lda.z fopen__16 + ora.z fopen__16+1 + beq __b4 + // fopen::@6 + // cbm_k_close(__logical) + // [332] fopen::cbm_k_close1_channel = *((char *)&__stdio_file+$80) -- vbuz1=_deref_pbuc1 + lda __stdio_file+$80 + sta.z cbm_k_close1_channel + // fopen::cbm_k_close1 + // asm + // asm { ldachannel jsrCBM_CLOSE } + jsr CBM_CLOSE + // [334] phi from fopen::cbm_k_close1 to fopen::@return [phi:fopen::cbm_k_close1->fopen::@return] + // [334] phi fopen::return#2 = 0 [phi:fopen::cbm_k_close1->fopen::@return#0] -- pssz1=vbuc1 + lda #<0 + sta.z return + sta.z return+1 + rts + // [334] phi from fopen::@31 to fopen::@return [phi:fopen::@31->fopen::@return] + __b4: + // [334] phi fopen::return#2 = fopen::stream#0 [phi:fopen::@31->fopen::@return#0] -- pssz1=pssc1 + lda #stream + sta.z return+1 + // fopen::@return + // } + // [335] return + rts + // fopen::@8 + __b8: + // if (pathstep > 0) + // [336] if(fopen::pathstep#10>0) goto fopen::@10 -- vbuz1_gt_0_then_la1 + lda.z pathstep + bne __b10 + // fopen::@24 + // __stdio_file.filename[pathpos] = '\0' + // [337] ((char *)&__stdio_file)[fopen::pathpos#10] = '@' -- pbuc1_derefidx_vbuz1=vbuc2 + lda #'@' + ldy.z pathpos + sta __stdio_file,y + // path = pathtoken + 1 + // [338] fopen::path#0 = fopen::pathtoken#10 + 1 -- pbuz1=pbuz2_plus_1 + clc + lda.z pathtoken + adc #1 + sta.z path + lda.z pathtoken+1 + adc #0 + sta.z path+1 + // [339] phi from fopen::@15 fopen::@16 fopen::@17 fopen::@18 fopen::@24 to fopen::@11 [phi:fopen::@15/fopen::@16/fopen::@17/fopen::@18/fopen::@24->fopen::@11] + // [339] phi fopen::num#15 = fopen::num#2 [phi:fopen::@15/fopen::@16/fopen::@17/fopen::@18/fopen::@24->fopen::@11#0] -- register_copy + // [339] phi fopen::path#12 = fopen::path#15 [phi:fopen::@15/fopen::@16/fopen::@17/fopen::@18/fopen::@24->fopen::@11#1] -- register_copy + // fopen::@11 + __b11: + // pathstep++; + // [340] fopen::pathstep#1 = ++ fopen::pathstep#10 -- vbuz1=_inc_vbuz1 + inc.z pathstep + jmp __b9 + // fopen::@10 + __b10: + // char pathcmp = *path + // [341] fopen::pathcmp#0 = *fopen::path#13 -- vbuz1=_deref_pbuz2 + ldy #0 + lda (path),y + sta.z pathcmp + // case 'D': + // [342] if(fopen::pathcmp#0=='D') goto fopen::@12 -- vbuz1_eq_vbuc1_then_la1 + lda #'D' + cmp.z pathcmp + beq __b12 + // fopen::@19 + // case 'L': + // [343] if(fopen::pathcmp#0=='L') goto fopen::@12 -- vbuz1_eq_vbuc1_then_la1 + lda #'L' + cmp.z pathcmp + beq __b12 + // fopen::@20 + // case 'C': + // num = (char)atoi(path + 1); + // path = pathtoken + 1; + // [344] if(fopen::pathcmp#0=='C') goto fopen::@12 -- vbuz1_eq_vbuc1_then_la1 + lda #'C' + cmp.z pathcmp + beq __b12 + // [345] phi from fopen::@20 fopen::@29 to fopen::@13 [phi:fopen::@20/fopen::@29->fopen::@13] + // [345] phi fopen::path#15 = fopen::path#13 [phi:fopen::@20/fopen::@29->fopen::@13#0] -- register_copy + // [345] phi fopen::num#2 = fopen::num#10 [phi:fopen::@20/fopen::@29->fopen::@13#1] -- register_copy + // fopen::@13 + __b13: + // case 'L': + // __logical = num; + // break; + // [346] if(fopen::pathcmp#0=='L') goto fopen::@16 -- vbuz1_eq_vbuc1_then_la1 + lda #'L' + cmp.z pathcmp + beq __b16 + // fopen::@14 + // case 'D': + // __device = num; + // break; + // [347] if(fopen::pathcmp#0=='D') goto fopen::@17 -- vbuz1_eq_vbuc1_then_la1 + lda #'D' + cmp.z pathcmp + beq __b17 + // fopen::@15 + // case 'C': + // __channel = num; + // break; + // [348] if(fopen::pathcmp#0!='C') goto fopen::@11 -- vbuz1_neq_vbuc1_then_la1 + lda #'C' + cmp.z pathcmp + bne __b11 + // fopen::@18 + // __channel = num + // [349] *((char *)&__stdio_file+$88) = fopen::num#2 -- _deref_pbuc1=vbuz1 + lda.z num + sta __stdio_file+$88 + jmp __b11 + // fopen::@17 + __b17: + // __device = num + // [350] *((char *)&__stdio_file+$84) = fopen::num#2 -- _deref_pbuc1=vbuz1 + lda.z num + sta __stdio_file+$84 + jmp __b11 + // fopen::@16 + __b16: + // __logical = num + // [351] *((char *)&__stdio_file+$80) = fopen::num#2 -- _deref_pbuc1=vbuz1 + lda.z num + sta __stdio_file+$80 + jmp __b11 + // fopen::@12 + __b12: + // atoi(path + 1) + // [352] atoi::str#0 = fopen::path#13 + 1 -- pbuz1=pbuz1_plus_1 + inc.z atoi.str + bne !+ + inc.z atoi.str+1 + !: + // [353] call atoi + // [549] phi from fopen::@12 to atoi [phi:fopen::@12->atoi] + // [549] phi atoi::str#2 = atoi::str#0 [phi:fopen::@12->atoi#0] -- register_copy + jsr atoi + // atoi(path + 1) + // [354] atoi::return#3 = atoi::return#2 + // fopen::@29 + // [355] fopen::$26 = atoi::return#3 + // num = (char)atoi(path + 1) + // [356] fopen::num#1 = (char)fopen::$26 -- vbuz1=_byte_vwsz2 + lda.z fopen__26 + sta.z num + // path = pathtoken + 1 + // [357] fopen::path#1 = fopen::pathtoken#10 + 1 -- pbuz1=pbuz2_plus_1 + clc + lda.z pathtoken + adc #1 + sta.z path + lda.z pathtoken+1 + adc #0 + sta.z path+1 + jmp __b13 +} + // fclose +/** + * @brief Close a file. + * + * @param fp The FILE pointer. + * @return + * - 0x0000: Something is wrong! Kernal Error Code (https://commodore.ca/manuals/pdfs/commodore_error_messages.pdf) + * - other: OK! The last pointer between 0xA000 and 0xBFFF is returned. Note that the last pointer is indicating the first free byte. + */ +// int fclose(__zp($61) struct $2 *stream) +fclose: { + .label fclose__1 = $5d + .label fclose__4 = $5c + .label fclose__6 = $71 + .label cbm_k_chkin1_channel = $b1 + .label cbm_k_chkin1_status = $ad + .label cbm_k_readst1_status = $ae + .label cbm_k_close1_channel = $af + .label cbm_k_readst2_status = $b0 + .label sp = $71 + .label cbm_k_readst1_return = $5d + .label cbm_k_readst2_return = $5c + .label stream = $61 + // unsigned char sp = (unsigned char)stream + // [358] fclose::sp#0 = (char)fclose::stream#0 -- vbuz1=_byte_pssz2 + lda.z stream + sta.z sp + // cbm_k_chkin(__logical) + // [359] fclose::cbm_k_chkin1_channel = ((char *)&__stdio_file+$80)[fclose::sp#0] -- vbuz1=pbuc1_derefidx_vbuz2 + tay + lda __stdio_file+$80,y + sta.z cbm_k_chkin1_channel + // fclose::cbm_k_chkin1 + // char status + // [360] fclose::cbm_k_chkin1_status = 0 -- vbuz1=vbuc1 + lda #0 + sta.z cbm_k_chkin1_status + // asm + // asm { ldxchannel jsrCBM_CHKIN stastatus } + ldx cbm_k_chkin1_channel + jsr CBM_CHKIN + sta cbm_k_chkin1_status + // fclose::cbm_k_readst1 + // char status + // [362] fclose::cbm_k_readst1_status = 0 -- vbuz1=vbuc1 + lda #0 + sta.z cbm_k_readst1_status + // asm + // asm { jsrCBM_READST stastatus } + jsr CBM_READST + sta cbm_k_readst1_status + // return status; + // [364] fclose::cbm_k_readst1_return#0 = fclose::cbm_k_readst1_status -- vbuz1=vbuz2 + sta.z cbm_k_readst1_return + // fclose::cbm_k_readst1_@return + // } + // [365] fclose::cbm_k_readst1_return#1 = fclose::cbm_k_readst1_return#0 + // fclose::@3 + // cbm_k_readst() + // [366] fclose::$1 = fclose::cbm_k_readst1_return#1 + // __status = cbm_k_readst() + // [367] ((char *)&__stdio_file+$8c)[fclose::sp#0] = fclose::$1 -- pbuc1_derefidx_vbuz1=vbuz2 + lda.z fclose__1 + ldy.z sp + sta __stdio_file+$8c,y + // if (__status) + // [368] if(0==((char *)&__stdio_file+$8c)[fclose::sp#0]) goto fclose::@1 -- 0_eq_pbuc1_derefidx_vbuz1_then_la1 + lda __stdio_file+$8c,y + cmp #0 + beq __b1 + // fclose::@return + // } + // [369] return + rts + // fclose::@1 + __b1: + // cbm_k_close(__logical) + // [370] fclose::cbm_k_close1_channel = ((char *)&__stdio_file+$80)[fclose::sp#0] -- vbuz1=pbuc1_derefidx_vbuz2 + ldy.z sp + lda __stdio_file+$80,y + sta.z cbm_k_close1_channel + // fclose::cbm_k_close1 + // asm + // asm { ldachannel jsrCBM_CLOSE } + jsr CBM_CLOSE + // fclose::cbm_k_readst2 + // char status + // [372] fclose::cbm_k_readst2_status = 0 -- vbuz1=vbuc1 + lda #0 + sta.z cbm_k_readst2_status + // asm + // asm { jsrCBM_READST stastatus } + jsr CBM_READST + sta cbm_k_readst2_status + // return status; + // [374] fclose::cbm_k_readst2_return#0 = fclose::cbm_k_readst2_status -- vbuz1=vbuz2 + sta.z cbm_k_readst2_return + // fclose::cbm_k_readst2_@return + // } + // [375] fclose::cbm_k_readst2_return#1 = fclose::cbm_k_readst2_return#0 + // fclose::@4 + // cbm_k_readst() + // [376] fclose::$4 = fclose::cbm_k_readst2_return#1 + // __status = cbm_k_readst() + // [377] ((char *)&__stdio_file+$8c)[fclose::sp#0] = fclose::$4 -- pbuc1_derefidx_vbuz1=vbuz2 + lda.z fclose__4 + ldy.z sp + sta __stdio_file+$8c,y + // if (__status) + // [378] if(0==((char *)&__stdio_file+$8c)[fclose::sp#0]) goto fclose::@2 -- 0_eq_pbuc1_derefidx_vbuz1_then_la1 + lda __stdio_file+$8c,y + cmp #0 + beq __b2 + rts + // fclose::@2 + __b2: + // __logical = 0 + // [379] ((char *)&__stdio_file+$80)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbuz1=vbuc2 + lda #0 + ldy.z sp + sta __stdio_file+$80,y + // __device = 0 + // [380] ((char *)&__stdio_file+$84)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbuz1=vbuc2 + sta __stdio_file+$84,y + // __channel = 0 + // [381] ((char *)&__stdio_file+$88)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbuz1=vbuc2 + sta __stdio_file+$88,y + // __filename + // [382] fclose::$6 = fclose::sp#0 << 2 -- vbuz1=vbuz1_rol_2 + lda.z fclose__6 + asl + asl + sta.z fclose__6 + // *__filename = '\0' + // [383] ((char *)&__stdio_file)[fclose::$6] = '@' -- pbuc1_derefidx_vbuz1=vbuc2 + lda #'@' + ldy.z fclose__6 + sta __stdio_file,y + rts +} + // fgets +/** + * @brief Load a file to ram or (banked ram located between address 0xA000 and 0xBFFF), incrementing the banks. + * This function uses the new CX16 macptr kernal API at address $FF44. + * + * @param sptr The pointer between 0xA000 and 0xBFFF in banked ram. + * @param size The amount of bytes to be read. + * @param filename Name of the file to be loaded. + * @return ptr the pointer advanced to the point where the stream ends. + */ +// __zp($34) unsigned int fgets(__zp($3f) char *ptr, unsigned int size, __zp($61) struct $2 *stream) +fgets: { + .const size = $80 + .label fgets__1 = $5c + .label fgets__8 = $4f + .label fgets__9 = $54 + .label fgets__13 = $32 + .label cbm_k_chkin1_channel = $75 + .label cbm_k_chkin1_status = $6b + .label cbm_k_readst1_status = $6c + .label cbm_k_readst2_status = $55 + .label sp = $5d + .label cbm_k_readst1_return = $5c + .label return = $34 + .label bytes = $3d + .label cbm_k_readst2_return = $4f + .label read = $34 + .label ptr = $3f + .label remaining = $2a + .label stream = $61 + // unsigned char sp = (unsigned char)stream + // [384] fgets::sp#0 = (char)fgets::stream#0 -- vbuz1=_byte_pssz2 + lda.z stream + sta.z sp + // cbm_k_chkin(__logical) + // [385] fgets::cbm_k_chkin1_channel = ((char *)&__stdio_file+$80)[fgets::sp#0] -- vbuz1=pbuc1_derefidx_vbuz2 + tay + lda __stdio_file+$80,y + sta.z cbm_k_chkin1_channel + // fgets::cbm_k_chkin1 + // char status + // [386] fgets::cbm_k_chkin1_status = 0 -- vbuz1=vbuc1 + lda #0 + sta.z cbm_k_chkin1_status + // asm + // asm { ldxchannel jsrCBM_CHKIN stastatus } + ldx cbm_k_chkin1_channel + jsr CBM_CHKIN + sta cbm_k_chkin1_status + // fgets::cbm_k_readst1 + // char status + // [388] fgets::cbm_k_readst1_status = 0 -- vbuz1=vbuc1 + lda #0 + sta.z cbm_k_readst1_status + // asm + // asm { jsrCBM_READST stastatus } + jsr CBM_READST + sta cbm_k_readst1_status + // return status; + // [390] fgets::cbm_k_readst1_return#0 = fgets::cbm_k_readst1_status -- vbuz1=vbuz2 + sta.z cbm_k_readst1_return + // fgets::cbm_k_readst1_@return + // } + // [391] fgets::cbm_k_readst1_return#1 = fgets::cbm_k_readst1_return#0 + // fgets::@9 + // cbm_k_readst() + // [392] fgets::$1 = fgets::cbm_k_readst1_return#1 + // __status = cbm_k_readst() + // [393] ((char *)&__stdio_file+$8c)[fgets::sp#0] = fgets::$1 -- pbuc1_derefidx_vbuz1=vbuz2 + lda.z fgets__1 + ldy.z sp + sta __stdio_file+$8c,y + // if (__status) + // [394] if(0==((char *)&__stdio_file+$8c)[fgets::sp#0]) goto fgets::@1 -- 0_eq_pbuc1_derefidx_vbuz1_then_la1 + lda __stdio_file+$8c,y + cmp #0 + beq __b8 + // [395] phi from fgets::@10 fgets::@3 fgets::@9 to fgets::@return [phi:fgets::@10/fgets::@3/fgets::@9->fgets::@return] + __b1: + // [395] phi fgets::return#1 = 0 [phi:fgets::@10/fgets::@3/fgets::@9->fgets::@return#0] -- vwuz1=vbuc1 + lda #<0 + sta.z return + sta.z return+1 + // fgets::@return + // } + // [396] return + rts + // [397] phi from fgets::@13 to fgets::@1 [phi:fgets::@13->fgets::@1] + // [397] phi fgets::read#10 = fgets::read#1 [phi:fgets::@13->fgets::@1#0] -- register_copy + // [397] phi fgets::remaining#11 = fgets::remaining#1 [phi:fgets::@13->fgets::@1#1] -- register_copy + // [397] phi fgets::ptr#10 = fgets::ptr#12 [phi:fgets::@13->fgets::@1#2] -- register_copy + // [397] phi from fgets::@9 to fgets::@1 [phi:fgets::@9->fgets::@1] + __b8: + // [397] phi fgets::read#10 = 0 [phi:fgets::@9->fgets::@1#0] -- vwuz1=vwuc1 + lda #<0 + sta.z read + sta.z read+1 + // [397] phi fgets::remaining#11 = fgets::size#0 [phi:fgets::@9->fgets::@1#1] -- vwuz1=vwuc1 + lda #size + sta.z remaining+1 + // [397] phi fgets::ptr#10 = rom_calc_file_checksum::rom_bram_ptr#1 [phi:fgets::@9->fgets::@1#2] -- pbuz1=pbuc1 + lda #rom_calc_file_checksum.rom_bram_ptr + sta.z ptr+1 + // fgets::@1 + // fgets::@6 + __b6: + // if (remaining >= 512) + // [398] if(fgets::remaining#11>=$200) goto fgets::@2 -- vwuz1_ge_vwuc1_then_la1 + lda.z remaining+1 + cmp #>$200 + bcc !+ + beq !__b2+ + jmp __b2 + !__b2: + lda.z remaining + cmp #<$200 + bcc !__b2+ + jmp __b2 + !__b2: + !: + // fgets::@7 + // cx16_k_macptr(remaining, ptr) + // [399] cx16_k_macptr::bytes = fgets::remaining#11 -- vbuz1=vwuz2 + lda.z remaining + sta.z cx16_k_macptr.bytes + // [400] cx16_k_macptr::buffer = (void *)fgets::ptr#10 -- pvoz1=pvoz2 + lda.z ptr + sta.z cx16_k_macptr.buffer + lda.z ptr+1 + sta.z cx16_k_macptr.buffer+1 + // [401] call cx16_k_macptr + jsr cx16_k_macptr + // [402] cx16_k_macptr::return#4 = cx16_k_macptr::return#1 + // fgets::@12 + __b12: + // bytes = cx16_k_macptr(remaining, ptr) + // [403] fgets::bytes#3 = cx16_k_macptr::return#4 + // [404] phi from fgets::@11 fgets::@12 to fgets::cbm_k_readst2 [phi:fgets::@11/fgets::@12->fgets::cbm_k_readst2] + // [404] phi fgets::bytes#10 = fgets::bytes#2 [phi:fgets::@11/fgets::@12->fgets::cbm_k_readst2#0] -- register_copy + // fgets::cbm_k_readst2 + // char status + // [405] fgets::cbm_k_readst2_status = 0 -- vbuz1=vbuc1 + lda #0 + sta.z cbm_k_readst2_status + // asm + // asm { jsrCBM_READST stastatus } + jsr CBM_READST + sta cbm_k_readst2_status + // return status; + // [407] fgets::cbm_k_readst2_return#0 = fgets::cbm_k_readst2_status -- vbuz1=vbuz2 + sta.z cbm_k_readst2_return + // fgets::cbm_k_readst2_@return + // } + // [408] fgets::cbm_k_readst2_return#1 = fgets::cbm_k_readst2_return#0 + // fgets::@10 + // cbm_k_readst() + // [409] fgets::$8 = fgets::cbm_k_readst2_return#1 + // __status = cbm_k_readst() + // [410] ((char *)&__stdio_file+$8c)[fgets::sp#0] = fgets::$8 -- pbuc1_derefidx_vbuz1=vbuz2 + lda.z fgets__8 + ldy.z sp + sta __stdio_file+$8c,y + // __status & 0xBF + // [411] fgets::$9 = ((char *)&__stdio_file+$8c)[fgets::sp#0] & $bf -- vbuz1=pbuc1_derefidx_vbuz2_band_vbuc2 + lda #$bf + and __stdio_file+$8c,y + sta.z fgets__9 + // if (__status & 0xBF) + // [412] if(0==fgets::$9) goto fgets::@3 -- 0_eq_vbuz1_then_la1 + beq __b3 + jmp __b1 + // fgets::@3 + __b3: + // if (bytes == 0xFFFF) + // [413] if(fgets::bytes#10!=$ffff) goto fgets::@4 -- vwuz1_neq_vwuc1_then_la1 + lda.z bytes+1 + cmp #>$ffff + bne __b4 + lda.z bytes + cmp #<$ffff + bne __b4 + jmp __b1 + // fgets::@4 + __b4: + // read += bytes + // [414] fgets::read#1 = fgets::read#10 + fgets::bytes#10 -- vwuz1=vwuz1_plus_vwuz2 + clc + lda.z read + adc.z bytes + sta.z read + lda.z read+1 + adc.z bytes+1 + sta.z read+1 + // ptr += bytes + // [415] fgets::ptr#0 = fgets::ptr#10 + fgets::bytes#10 -- pbuz1=pbuz1_plus_vwuz2 + clc + lda.z ptr + adc.z bytes + sta.z ptr + lda.z ptr+1 + adc.z bytes+1 + sta.z ptr+1 + // BYTE1(ptr) + // [416] fgets::$13 = byte1 fgets::ptr#0 -- vbuz1=_byte1_pbuz2 + sta.z fgets__13 + // if (BYTE1(ptr) == 0xC0) + // [417] if(fgets::$13!=$c0) goto fgets::@5 -- vbuz1_neq_vbuc1_then_la1 + lda #$c0 + cmp.z fgets__13 + bne __b5 + // fgets::@8 + // ptr -= 0x2000 + // [418] fgets::ptr#1 = fgets::ptr#0 - $2000 -- pbuz1=pbuz1_minus_vwuc1 + lda.z ptr + sec + sbc #<$2000 + sta.z ptr + lda.z ptr+1 + sbc #>$2000 + sta.z ptr+1 + // [419] phi from fgets::@4 fgets::@8 to fgets::@5 [phi:fgets::@4/fgets::@8->fgets::@5] + // [419] phi fgets::ptr#12 = fgets::ptr#0 [phi:fgets::@4/fgets::@8->fgets::@5#0] -- register_copy + // fgets::@5 + __b5: + // remaining -= bytes + // [420] fgets::remaining#1 = fgets::remaining#11 - fgets::bytes#10 -- vwuz1=vwuz1_minus_vwuz2 + lda.z remaining + sec + sbc.z bytes + sta.z remaining + lda.z remaining+1 + sbc.z bytes+1 + sta.z remaining+1 + // while ((__status == 0) && ((size && remaining) || !size)) + // [421] if(((char *)&__stdio_file+$8c)[fgets::sp#0]==0) goto fgets::@13 -- pbuc1_derefidx_vbuz1_eq_0_then_la1 + ldy.z sp + lda __stdio_file+$8c,y + cmp #0 + beq __b13 + // [395] phi from fgets::@13 fgets::@5 to fgets::@return [phi:fgets::@13/fgets::@5->fgets::@return] + // [395] phi fgets::return#1 = fgets::read#1 [phi:fgets::@13/fgets::@5->fgets::@return#0] -- register_copy + rts + // fgets::@13 + __b13: + // while ((__status == 0) && ((size && remaining) || !size)) + // [422] if(0!=fgets::remaining#1) goto fgets::@1 -- 0_neq_vwuz1_then_la1 + lda.z remaining + ora.z remaining+1 + beq !__b6+ + jmp __b6 + !__b6: + rts + // fgets::@2 + __b2: + // cx16_k_macptr(512, ptr) + // [423] cx16_k_macptr::bytes = $200 -- vbuz1=vwuc1 + lda #<$200 + sta.z cx16_k_macptr.bytes + // [424] cx16_k_macptr::buffer = (void *)fgets::ptr#10 -- pvoz1=pvoz2 + lda.z ptr + sta.z cx16_k_macptr.buffer + lda.z ptr+1 + sta.z cx16_k_macptr.buffer+1 + // [425] call cx16_k_macptr + jsr cx16_k_macptr + // [426] cx16_k_macptr::return#3 = cx16_k_macptr::return#1 + // fgets::@11 + // bytes = cx16_k_macptr(512, ptr) + // [427] fgets::bytes#2 = cx16_k_macptr::return#3 + jmp __b12 +} + // ultoa +// Converts unsigned number value to a string representing it in RADIX format. +// If the leading digits are zero they are not included in the string. +// - value : The number to be converted to RADIX +// - buffer : receives the string representing the number and zero-termination. +// - radix : The radix to convert the number to (from the enum RADIX) +// void ultoa(__zp($42) unsigned long value, __zp($61) char *buffer, char radix) +ultoa: { + .label ultoa__10 = $54 + .label ultoa__11 = $4f + .label digit_value = $50 + .label buffer = $61 + .label digit = $60 + .label value = $42 + .label started = $5c + // [429] phi from ultoa to ultoa::@1 [phi:ultoa->ultoa::@1] + // [429] phi ultoa::buffer#11 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:ultoa->ultoa::@1#0] -- pbuz1=pbuc1 + lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + sta.z buffer+1 + // [429] phi ultoa::started#2 = 0 [phi:ultoa->ultoa::@1#1] -- vbuz1=vbuc1 + lda #0 + sta.z started + // [429] phi ultoa::value#2 = ultoa::value#1 [phi:ultoa->ultoa::@1#2] -- register_copy + // [429] phi ultoa::digit#2 = 0 [phi:ultoa->ultoa::@1#3] -- vbuz1=vbuc1 + sta.z digit + // ultoa::@1 + __b1: + // for( char digit=0; digit= digit_value) + // [438] if(0!=ultoa::started#2) goto ultoa::@5 -- 0_neq_vbuz1_then_la1 + lda.z started + bne __b5 + // ultoa::@7 + // [439] if(ultoa::value#2>=ultoa::digit_value#0) goto ultoa::@5 -- vduz1_ge_vduz2_then_la1 + lda.z value+3 + cmp.z digit_value+3 + bcc !+ + bne __b5 + lda.z value+2 + cmp.z digit_value+2 + bcc !+ + bne __b5 + lda.z value+1 + cmp.z digit_value+1 + bcc !+ + bne __b5 + lda.z value + cmp.z digit_value + bcs __b5 + !: + // [440] phi from ultoa::@7 to ultoa::@4 [phi:ultoa::@7->ultoa::@4] + // [440] phi ultoa::buffer#14 = ultoa::buffer#11 [phi:ultoa::@7->ultoa::@4#0] -- register_copy + // [440] phi ultoa::started#4 = ultoa::started#2 [phi:ultoa::@7->ultoa::@4#1] -- register_copy + // [440] phi ultoa::value#6 = ultoa::value#2 [phi:ultoa::@7->ultoa::@4#2] -- register_copy + // ultoa::@4 + __b4: + // for( char digit=0; digitultoa::@1] + // [429] phi ultoa::buffer#11 = ultoa::buffer#14 [phi:ultoa::@4->ultoa::@1#0] -- register_copy + // [429] phi ultoa::started#2 = ultoa::started#4 [phi:ultoa::@4->ultoa::@1#1] -- register_copy + // [429] phi ultoa::value#2 = ultoa::value#6 [phi:ultoa::@4->ultoa::@1#2] -- register_copy + // [429] phi ultoa::digit#2 = ultoa::digit#1 [phi:ultoa::@4->ultoa::@1#3] -- register_copy + jmp __b1 + // ultoa::@5 + __b5: + // ultoa_append(buffer++, value, digit_value) + // [442] ultoa_append::buffer#0 = ultoa::buffer#11 -- pbuz1=pbuz2 + lda.z buffer + sta.z ultoa_append.buffer + lda.z buffer+1 + sta.z ultoa_append.buffer+1 + // [443] ultoa_append::value#0 = ultoa::value#2 + // [444] ultoa_append::sub#0 = ultoa::digit_value#0 + // [445] call ultoa_append + // [570] phi from ultoa::@5 to ultoa_append [phi:ultoa::@5->ultoa_append] + jsr ultoa_append + // ultoa_append(buffer++, value, digit_value) + // [446] ultoa_append::return#0 = ultoa_append::value#2 + // ultoa::@6 + // value = ultoa_append(buffer++, value, digit_value) + // [447] ultoa::value#0 = ultoa_append::return#0 + // value = ultoa_append(buffer++, value, digit_value); + // [448] ultoa::buffer#4 = ++ ultoa::buffer#11 -- pbuz1=_inc_pbuz1 + inc.z buffer + bne !+ + inc.z buffer+1 + !: + // [440] phi from ultoa::@6 to ultoa::@4 [phi:ultoa::@6->ultoa::@4] + // [440] phi ultoa::buffer#14 = ultoa::buffer#4 [phi:ultoa::@6->ultoa::@4#0] -- register_copy + // [440] phi ultoa::started#4 = 1 [phi:ultoa::@6->ultoa::@4#1] -- vbuz1=vbuc1 + lda #1 + sta.z started + // [440] phi ultoa::value#6 = ultoa::value#0 [phi:ultoa::@6->ultoa::@4#2] -- register_copy + jmp __b4 +} + // printf_number_buffer +// Print the contents of the number buffer using a specific format. +// This handles minimum length, zero-filling, and left/right justification from the format +// void printf_number_buffer(void (*putc)(char), __zp($47) char buffer_sign, char *buffer_digits, char format_min_length, char format_justify_left, char format_sign_always, char format_zero_padding, char format_upper_case, char format_radix) +printf_number_buffer: { + .label buffer_digits = printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + .label putc = cputc + .label buffer_sign = $47 + // printf_number_buffer::@1 + // if(buffer.sign) + // [450] if(0==printf_number_buffer::buffer_sign#0) goto printf_number_buffer::@2 -- 0_eq_vbuz1_then_la1 + lda.z buffer_sign + beq __b2 + // printf_number_buffer::@3 + // putc(buffer.sign) + // [451] stackpush(char) = printf_number_buffer::buffer_sign#0 -- _stackpushbyte_=vbuz1 + pha + // [452] callexecute cputc -- call_vprc1 + jsr cputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // [454] phi from printf_number_buffer::@1 printf_number_buffer::@3 to printf_number_buffer::@2 [phi:printf_number_buffer::@1/printf_number_buffer::@3->printf_number_buffer::@2] + // printf_number_buffer::@2 + __b2: + // printf_str(putc, buffer.digits) + // [455] call printf_str + // [180] phi from printf_number_buffer::@2 to printf_str [phi:printf_number_buffer::@2->printf_str] + // [180] phi printf_str::putc#13 = printf_number_buffer::putc#0 [phi:printf_number_buffer::@2->printf_str#0] -- pprz1=pprc1 + lda #putc + sta.z printf_str.putc+1 + // [180] phi printf_str::s#13 = printf_number_buffer::buffer_digits#0 [phi:printf_number_buffer::@2->printf_str#1] -- pbuz1=pbuc1 + lda #buffer_digits + sta.z printf_str.s+1 + jsr printf_str + // printf_number_buffer::@return + // } + // [456] return + rts +} + // insertup +// Insert a new line, and scroll the upper part of the screen up. +// void insertup(char rows) +insertup: { + .label insertup__0 = $41 + .label insertup__4 = $38 + .label insertup__6 = $3b + .label insertup__7 = $38 + .label width = $41 + .label y = $33 + // __conio.width+1 + // [457] insertup::$0 = *((char *)&__conio+6) + 1 -- vbuz1=_deref_pbuc1_plus_1 + lda __conio+6 + inc + sta.z insertup__0 + // unsigned char width = (__conio.width+1) * 2 + // [458] insertup::width#0 = insertup::$0 << 1 -- vbuz1=vbuz1_rol_1 + // {asm{.byte $db}} + asl.z width + // [459] phi from insertup to insertup::@1 [phi:insertup->insertup::@1] + // [459] phi insertup::y#2 = 0 [phi:insertup->insertup::@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z y + // insertup::@1 + __b1: + // for(unsigned char y=0; y<__conio.cursor_y; y++) + // [460] if(insertup::y#2<*((char *)&__conio+1)) goto insertup::@2 -- vbuz1_lt__deref_pbuc1_then_la1 + lda.z y + cmp __conio+1 + bcc __b2 + // [461] phi from insertup::@1 to insertup::@3 [phi:insertup::@1->insertup::@3] + // insertup::@3 + // clearline() + // [462] call clearline + jsr clearline + // insertup::@return + // } + // [463] return + rts + // insertup::@2 + __b2: + // y+1 + // [464] insertup::$4 = insertup::y#2 + 1 -- vbuz1=vbuz2_plus_1 + lda.z y + inc + sta.z insertup__4 + // memcpy8_vram_vram(__conio.mapbase_bank, __conio.offsets[y], __conio.mapbase_bank, __conio.offsets[y+1], width) + // [465] insertup::$6 = insertup::y#2 << 1 -- vbuz1=vbuz2_rol_1 + lda.z y + asl + sta.z insertup__6 + // [466] insertup::$7 = insertup::$4 << 1 -- vbuz1=vbuz1_rol_1 + asl.z insertup__7 + // [467] memcpy8_vram_vram::dbank_vram#0 = *((char *)&__conio+5) -- vbuz1=_deref_pbuc1 + lda __conio+5 + sta.z memcpy8_vram_vram.dbank_vram + // [468] memcpy8_vram_vram::doffset_vram#0 = ((unsigned int *)&__conio+$15)[insertup::$6] -- vwuz1=pwuc1_derefidx_vbuz2 + ldy.z insertup__6 + lda __conio+$15,y + sta.z memcpy8_vram_vram.doffset_vram + lda __conio+$15+1,y + sta.z memcpy8_vram_vram.doffset_vram+1 + // [469] memcpy8_vram_vram::sbank_vram#0 = *((char *)&__conio+5) -- vbuz1=_deref_pbuc1 + lda __conio+5 + sta.z memcpy8_vram_vram.sbank_vram + // [470] memcpy8_vram_vram::soffset_vram#0 = ((unsigned int *)&__conio+$15)[insertup::$7] -- vwuz1=pwuc1_derefidx_vbuz2 + ldy.z insertup__7 + lda __conio+$15,y + sta.z memcpy8_vram_vram.soffset_vram + lda __conio+$15+1,y + sta.z memcpy8_vram_vram.soffset_vram+1 + // [471] memcpy8_vram_vram::num8#1 = insertup::width#0 -- vbuz1=vbuz2 + lda.z width + sta.z memcpy8_vram_vram.num8_1 + // [472] call memcpy8_vram_vram + jsr memcpy8_vram_vram + // insertup::@4 + // for(unsigned char y=0; y<__conio.cursor_y; y++) + // [473] insertup::y#1 = ++ insertup::y#2 -- vbuz1=_inc_vbuz1 + inc.z y + // [459] phi from insertup::@4 to insertup::@1 [phi:insertup::@4->insertup::@1] + // [459] phi insertup::y#2 = insertup::y#1 [phi:insertup::@4->insertup::@1#0] -- register_copy + jmp __b1 +} + // clearline +clearline: { + .label clearline__0 = $24 + .label clearline__1 = $26 + .label clearline__2 = $27 + .label clearline__3 = $25 + .label addr = $36 + .label c = $22 + // unsigned int addr = __conio.offsets[__conio.cursor_y] + // [474] clearline::$3 = *((char *)&__conio+1) << 1 -- vbuz1=_deref_pbuc1_rol_1 + lda __conio+1 + asl + sta.z clearline__3 + // [475] clearline::addr#0 = ((unsigned int *)&__conio+$15)[clearline::$3] -- vwuz1=pwuc1_derefidx_vbuz2 + tay + lda __conio+$15,y + sta.z addr + lda __conio+$15+1,y + sta.z addr+1 + // *VERA_CTRL &= ~VERA_ADDRSEL + // [476] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + lda #VERA_ADDRSEL^$ff + and VERA_CTRL + sta VERA_CTRL + // BYTE0(addr) + // [477] clearline::$0 = byte0 clearline::addr#0 -- vbuz1=_byte0_vwuz2 + lda.z addr + sta.z clearline__0 + // *VERA_ADDRX_L = BYTE0(addr) + // [478] *VERA_ADDRX_L = clearline::$0 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_L + // BYTE1(addr) + // [479] clearline::$1 = byte1 clearline::addr#0 -- vbuz1=_byte1_vwuz2 + lda.z addr+1 + sta.z clearline__1 + // *VERA_ADDRX_M = BYTE1(addr) + // [480] *VERA_ADDRX_M = clearline::$1 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_M + // __conio.mapbase_bank | VERA_INC_1 + // [481] clearline::$2 = *((char *)&__conio+5) | VERA_INC_1 -- vbuz1=_deref_pbuc1_bor_vbuc2 + lda #VERA_INC_1 + ora __conio+5 + sta.z clearline__2 + // *VERA_ADDRX_H = __conio.mapbase_bank | VERA_INC_1 + // [482] *VERA_ADDRX_H = clearline::$2 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_H + // register unsigned char c=__conio.width + // [483] clearline::c#0 = *((char *)&__conio+6) -- vbuz1=_deref_pbuc1 + lda __conio+6 + sta.z c + // [484] phi from clearline clearline::@1 to clearline::@1 [phi:clearline/clearline::@1->clearline::@1] + // [484] phi clearline::c#2 = clearline::c#0 [phi:clearline/clearline::@1->clearline::@1#0] -- register_copy + // clearline::@1 + __b1: + // *VERA_DATA0 = ' ' + // [485] *VERA_DATA0 = ' ' -- _deref_pbuc1=vbuc2 + lda #' ' + sta VERA_DATA0 + // *VERA_DATA0 = __conio.color + // [486] *VERA_DATA0 = *((char *)&__conio+$d) -- _deref_pbuc1=_deref_pbuc2 + lda __conio+$d + sta VERA_DATA0 + // c--; + // [487] clearline::c#1 = -- clearline::c#2 -- vbuz1=_dec_vbuz1 + dec.z c + // while(c) + // [488] if(0!=clearline::c#1) goto clearline::@1 -- 0_neq_vbuz1_then_la1 + lda.z c + bne __b1 + // clearline::@return + // } + // [489] return + rts +} + // strlen +// Computes the length of the string str up to but not including the terminating null character. +// __zp($3d) unsigned int strlen(__zp($2a) char *str) +strlen: { + .label len = $3d + .label str = $2a + .label return = $3d + // [491] phi from strlen to strlen::@1 [phi:strlen->strlen::@1] + // [491] phi strlen::len#2 = 0 [phi:strlen->strlen::@1#0] -- vwuz1=vwuc1 + lda #<0 + sta.z len + sta.z len+1 + // [491] phi strlen::str#5 = strlen::str#7 [phi:strlen->strlen::@1#1] -- register_copy + // strlen::@1 + __b1: + // while(*str) + // [492] if(0!=*strlen::str#5) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1 + ldy #0 + lda (str),y + cmp #0 + bne __b2 + // strlen::@return + // } + // [493] return + rts + // strlen::@2 + __b2: + // len++; + // [494] strlen::len#1 = ++ strlen::len#2 -- vwuz1=_inc_vwuz1 + inc.z len + bne !+ + inc.z len+1 + !: + // str++; + // [495] strlen::str#0 = ++ strlen::str#5 -- pbuz1=_inc_pbuz1 + inc.z str + bne !+ + inc.z str+1 + !: + // [491] phi from strlen::@2 to strlen::@1 [phi:strlen::@2->strlen::@1] + // [491] phi strlen::len#2 = strlen::len#1 [phi:strlen::@2->strlen::@1#0] -- register_copy + // [491] phi strlen::str#5 = strlen::str#0 [phi:strlen::@2->strlen::@1#1] -- register_copy + jmp __b1 +} + // cbm_k_setlfs +/** + * @brief Sets the logical file channel. + * + * @param channel the logical file number. + * @param device the device number. + * @param command the command. + */ +// void cbm_k_setlfs(__zp($a9) volatile char channel, __zp($7b) volatile char device, __zp($74) volatile char command) +cbm_k_setlfs: { + .label channel = $a9 + .label device = $7b + .label command = $74 + // asm + // asm { ldxdevice ldachannel ldycommand jsrCBM_SETLFS } + ldx device + lda channel + ldy command + jsr CBM_SETLFS + // cbm_k_setlfs::@return + // } + // [497] return + rts +} + // ferror +/** + * @brief POSIX equivalent of ferror for the CBM C language. + * This routine reads from secondary 15 the error message from the device! + * The result is an error string, including the error code, message, track, sector. + * The error string can be a maximum of 32 characters. + * + * @param stream FILE* stream. + * @return int Contains a non-zero value if there is an error. + */ +// __zp($2e) int ferror(struct $2 *stream) +ferror: { + .label ferror__6 = $32 + .label ferror__15 = $4f + .label cbm_k_setnam1_filename = $79 + .label cbm_k_setnam1_filename_len = $6d + .label cbm_k_setnam1_ferror__0 = $3d + .label cbm_k_chkin1_channel = $76 + .label cbm_k_chkin1_status = $6e + .label cbm_k_chrin1_ch = $6f + .label cbm_k_readst1_status = $5e + .label cbm_k_close1_channel = $70 + .label cbm_k_chrin2_ch = $5f + .label return = $2e + .label cbm_k_chrin1_return = $4f + .label ch = $4f + .label cbm_k_readst1_return = $32 + .label st = $32 + .label errno_len = $54 + .label cbm_k_chrin2_return = $4f + .label errno_parsed = $47 + // cbm_k_setlfs(15, 8, 15) + // [498] cbm_k_setlfs::channel = $f -- vbuz1=vbuc1 + lda #$f + sta.z cbm_k_setlfs.channel + // [499] cbm_k_setlfs::device = 8 -- vbuz1=vbuc1 + lda #8 + sta.z cbm_k_setlfs.device + // [500] cbm_k_setlfs::command = $f -- vbuz1=vbuc1 + lda #$f + sta.z cbm_k_setlfs.command + // [501] call cbm_k_setlfs + jsr cbm_k_setlfs + // ferror::@11 + // cbm_k_setnam("") + // [502] ferror::cbm_k_setnam1_filename = ferror::$18 -- pbuz1=pbuc1 + lda #ferror__18 + sta.z cbm_k_setnam1_filename+1 + // ferror::cbm_k_setnam1 + // strlen(filename) + // [503] strlen::str#4 = ferror::cbm_k_setnam1_filename -- pbuz1=pbuz2 + lda.z cbm_k_setnam1_filename + sta.z strlen.str + lda.z cbm_k_setnam1_filename+1 + sta.z strlen.str+1 + // [504] call strlen + // [490] phi from ferror::cbm_k_setnam1 to strlen [phi:ferror::cbm_k_setnam1->strlen] + // [490] phi strlen::str#7 = strlen::str#4 [phi:ferror::cbm_k_setnam1->strlen#0] -- register_copy + jsr strlen + // strlen(filename) + // [505] strlen::return#10 = strlen::len#2 + // ferror::@12 + // [506] ferror::cbm_k_setnam1_$0 = strlen::return#10 + // char filename_len = (char)strlen(filename) + // [507] ferror::cbm_k_setnam1_filename_len = (char)ferror::cbm_k_setnam1_$0 -- vbuz1=_byte_vwuz2 + lda.z cbm_k_setnam1_ferror__0 + sta.z cbm_k_setnam1_filename_len + // asm + // asm { ldafilename_len ldxfilename ldyfilename+1 jsrCBM_SETNAM } + ldx cbm_k_setnam1_filename + ldy cbm_k_setnam1_filename+1 + jsr CBM_SETNAM + // ferror::cbm_k_open1 + // asm { jsrCBM_OPEN } + jsr CBM_OPEN + // ferror::@6 + // cbm_k_chkin(15) + // [510] ferror::cbm_k_chkin1_channel = $f -- vbuz1=vbuc1 + lda #$f + sta.z cbm_k_chkin1_channel + // ferror::cbm_k_chkin1 + // char status + // [511] ferror::cbm_k_chkin1_status = 0 -- vbuz1=vbuc1 + lda #0 + sta.z cbm_k_chkin1_status + // asm + // asm { ldxchannel jsrCBM_CHKIN stastatus } + ldx cbm_k_chkin1_channel + jsr CBM_CHKIN + sta cbm_k_chkin1_status + // ferror::cbm_k_chrin1 + // char ch + // [513] ferror::cbm_k_chrin1_ch = 0 -- vbuz1=vbuc1 + lda #0 + sta.z cbm_k_chrin1_ch + // asm + // asm { jsrCBM_CHRIN stach } + jsr CBM_CHRIN + sta cbm_k_chrin1_ch + // return ch; + // [515] ferror::cbm_k_chrin1_return#0 = ferror::cbm_k_chrin1_ch -- vbuz1=vbuz2 + sta.z cbm_k_chrin1_return + // ferror::cbm_k_chrin1_@return + // } + // [516] ferror::cbm_k_chrin1_return#1 = ferror::cbm_k_chrin1_return#0 + // ferror::@7 + // char ch = cbm_k_chrin() + // [517] ferror::ch#0 = ferror::cbm_k_chrin1_return#1 + // [518] phi from ferror::@7 to ferror::cbm_k_readst1 [phi:ferror::@7->ferror::cbm_k_readst1] + // [518] phi __errno#13 = 0 [phi:ferror::@7->ferror::cbm_k_readst1#0] -- vwsm1=vwsc1 + lda #<0 + sta __errno + sta __errno+1 + // [518] phi ferror::errno_len#10 = 0 [phi:ferror::@7->ferror::cbm_k_readst1#1] -- vbuz1=vbuc1 + sta.z errno_len + // [518] phi ferror::ch#10 = ferror::ch#0 [phi:ferror::@7->ferror::cbm_k_readst1#2] -- register_copy + // [518] phi ferror::errno_parsed#2 = 0 [phi:ferror::@7->ferror::cbm_k_readst1#3] -- vbuz1=vbuc1 + sta.z errno_parsed + // ferror::cbm_k_readst1 + cbm_k_readst1: + // char status + // [519] ferror::cbm_k_readst1_status = 0 -- vbuz1=vbuc1 + lda #0 + sta.z cbm_k_readst1_status + // asm + // asm { jsrCBM_READST stastatus } + jsr CBM_READST + sta cbm_k_readst1_status + // return status; + // [521] ferror::cbm_k_readst1_return#0 = ferror::cbm_k_readst1_status -- vbuz1=vbuz2 + sta.z cbm_k_readst1_return + // ferror::cbm_k_readst1_@return + // } + // [522] ferror::cbm_k_readst1_return#1 = ferror::cbm_k_readst1_return#0 + // ferror::@8 + // cbm_k_readst() + // [523] ferror::$6 = ferror::cbm_k_readst1_return#1 + // st = cbm_k_readst() + // [524] ferror::st#1 = ferror::$6 + // while (!(st = cbm_k_readst())) + // [525] if(0==ferror::st#1) goto ferror::@1 -- 0_eq_vbuz1_then_la1 + lda.z st + beq __b1 + // ferror::@2 + // __status = st + // [526] *((char *)&__stdio_file+$8c) = ferror::st#1 -- _deref_pbuc1=vbuz1 + sta __stdio_file+$8c + // cbm_k_close(15) + // [527] ferror::cbm_k_close1_channel = $f -- vbuz1=vbuc1 + lda #$f + sta.z cbm_k_close1_channel + // ferror::cbm_k_close1 + // asm + // asm { ldachannel jsrCBM_CLOSE } + jsr CBM_CLOSE + // ferror::@9 + // return __errno; + // [529] ferror::return#1 = __errno#13 -- vwsz1=vwsm2 + lda __errno + sta.z return + lda __errno+1 + sta.z return+1 + // ferror::@return + // } + // [530] return + rts + // ferror::@1 + __b1: + // if (!errno_parsed) + // [531] if(0!=ferror::errno_parsed#2) goto ferror::@3 -- 0_neq_vbuz1_then_la1 + lda.z errno_parsed + bne __b3 + // ferror::@4 + // if (ch == ',') + // [532] if(ferror::ch#10!=',') goto ferror::@3 -- vbuz1_neq_vbuc1_then_la1 + lda #',' + cmp.z ch + bne __b3 + // ferror::@5 + // errno_parsed++; + // [533] ferror::errno_parsed#1 = ++ ferror::errno_parsed#2 -- vbuz1=_inc_vbuz1 + inc.z errno_parsed + // strncpy(temp, __errno_error, errno_len+1) + // [534] strncpy::n#0 = ferror::errno_len#10 + 1 -- vwuz1=vbuz2_plus_1 + lda.z errno_len + clc + adc #1 + sta.z strncpy.n + lda #0 + adc #0 + sta.z strncpy.n+1 + // [535] call strncpy + // [597] phi from ferror::@5 to strncpy [phi:ferror::@5->strncpy] + jsr strncpy + // [536] phi from ferror::@5 to ferror::@13 [phi:ferror::@5->ferror::@13] + // ferror::@13 + // atoi(temp) + // [537] call atoi + // [549] phi from ferror::@13 to atoi [phi:ferror::@13->atoi] + // [549] phi atoi::str#2 = ferror::temp [phi:ferror::@13->atoi#0] -- pbuz1=pbuc1 + lda #temp + sta.z atoi.str+1 + jsr atoi + // atoi(temp) + // [538] atoi::return#4 = atoi::return#2 + // ferror::@14 + // __errno = atoi(temp) + // [539] __errno#2 = atoi::return#4 -- vwsm1=vwsz2 + lda.z atoi.return + sta __errno + lda.z atoi.return+1 + sta __errno+1 + // [540] phi from ferror::@1 ferror::@14 ferror::@4 to ferror::@3 [phi:ferror::@1/ferror::@14/ferror::@4->ferror::@3] + // [540] phi __errno#61 = __errno#13 [phi:ferror::@1/ferror::@14/ferror::@4->ferror::@3#0] -- register_copy + // [540] phi ferror::errno_parsed#11 = ferror::errno_parsed#2 [phi:ferror::@1/ferror::@14/ferror::@4->ferror::@3#1] -- register_copy + // ferror::@3 + __b3: + // __errno_error[errno_len] = ch + // [541] __errno_error[ferror::errno_len#10] = ferror::ch#10 -- pbuc1_derefidx_vbuz1=vbuz2 + lda.z ch + ldy.z errno_len + sta __errno_error,y + // errno_len++; + // [542] ferror::errno_len#1 = ++ ferror::errno_len#10 -- vbuz1=_inc_vbuz1 + inc.z errno_len + // ferror::cbm_k_chrin2 + // char ch + // [543] ferror::cbm_k_chrin2_ch = 0 -- vbuz1=vbuc1 + lda #0 + sta.z cbm_k_chrin2_ch + // asm + // asm { jsrCBM_CHRIN stach } + jsr CBM_CHRIN + sta cbm_k_chrin2_ch + // return ch; + // [545] ferror::cbm_k_chrin2_return#0 = ferror::cbm_k_chrin2_ch -- vbuz1=vbuz2 + sta.z cbm_k_chrin2_return + // ferror::cbm_k_chrin2_@return + // } + // [546] ferror::cbm_k_chrin2_return#1 = ferror::cbm_k_chrin2_return#0 + // ferror::@10 + // cbm_k_chrin() + // [547] ferror::$15 = ferror::cbm_k_chrin2_return#1 + // ch = cbm_k_chrin() + // [548] ferror::ch#1 = ferror::$15 + // [518] phi from ferror::@10 to ferror::cbm_k_readst1 [phi:ferror::@10->ferror::cbm_k_readst1] + // [518] phi __errno#13 = __errno#61 [phi:ferror::@10->ferror::cbm_k_readst1#0] -- register_copy + // [518] phi ferror::errno_len#10 = ferror::errno_len#1 [phi:ferror::@10->ferror::cbm_k_readst1#1] -- register_copy + // [518] phi ferror::ch#10 = ferror::ch#1 [phi:ferror::@10->ferror::cbm_k_readst1#2] -- register_copy + // [518] phi ferror::errno_parsed#2 = ferror::errno_parsed#11 [phi:ferror::@10->ferror::cbm_k_readst1#3] -- register_copy + jmp cbm_k_readst1 + .segment Data + temp: .fill 4, 0 + ferror__18: .text "" + .byte 0 +} +.segment Code + // atoi +// Converts the string argument str to an integer. +// __zp($2a) int atoi(__zp($3f) const char *str) +atoi: { + .label atoi__6 = $2a + .label atoi__7 = $2a + .label res = $2a + // Initialize sign as positive + .label i = $32 + .label return = $2a + .label str = $3f + // Initialize result + .label negative = $39 + .label atoi__10 = $30 + .label atoi__11 = $2a + // if (str[i] == '-') + // [550] if(*atoi::str#2!='-') goto atoi::@3 -- _deref_pbuz1_neq_vbuc1_then_la1 + ldy #0 + lda (str),y + cmp #'-' + bne __b2 + // [551] phi from atoi to atoi::@2 [phi:atoi->atoi::@2] + // atoi::@2 + // [552] phi from atoi::@2 to atoi::@3 [phi:atoi::@2->atoi::@3] + // [552] phi atoi::negative#2 = 1 [phi:atoi::@2->atoi::@3#0] -- vbuz1=vbuc1 + lda #1 + sta.z negative + // [552] phi atoi::res#2 = 0 [phi:atoi::@2->atoi::@3#1] -- vwsz1=vwsc1 + tya + sta.z res + sta.z res+1 + // [552] phi atoi::i#4 = 1 [phi:atoi::@2->atoi::@3#2] -- vbuz1=vbuc1 + lda #1 + sta.z i + jmp __b3 + // Iterate through all digits and update the result + // [552] phi from atoi to atoi::@3 [phi:atoi->atoi::@3] + __b2: + // [552] phi atoi::negative#2 = 0 [phi:atoi->atoi::@3#0] -- vbuz1=vbuc1 + lda #0 + sta.z negative + // [552] phi atoi::res#2 = 0 [phi:atoi->atoi::@3#1] -- vwsz1=vwsc1 + sta.z res + sta.z res+1 + // [552] phi atoi::i#4 = 0 [phi:atoi->atoi::@3#2] -- vbuz1=vbuc1 + sta.z i + // atoi::@3 + __b3: + // for (; str[i]>='0' && str[i]<='9'; ++i) + // [553] if(atoi::str#2[atoi::i#4]<'0') goto atoi::@5 -- pbuz1_derefidx_vbuz2_lt_vbuc1_then_la1 + ldy.z i + lda (str),y + cmp #'0' + bcc __b5 + // atoi::@6 + // [554] if(atoi::str#2[atoi::i#4]<='9') goto atoi::@4 -- pbuz1_derefidx_vbuz2_le_vbuc1_then_la1 + lda (str),y + cmp #'9' + bcc __b4 + beq __b4 + // atoi::@5 + __b5: + // if(negative) + // [555] if(0!=atoi::negative#2) goto atoi::@1 -- 0_neq_vbuz1_then_la1 + // Return result with sign + lda.z negative + bne __b1 + // [557] phi from atoi::@1 atoi::@5 to atoi::@return [phi:atoi::@1/atoi::@5->atoi::@return] + // [557] phi atoi::return#2 = atoi::return#0 [phi:atoi::@1/atoi::@5->atoi::@return#0] -- register_copy + rts + // atoi::@1 + __b1: + // return -res; + // [556] atoi::return#0 = - atoi::res#2 -- vwsz1=_neg_vwsz1 + lda #0 + sec + sbc.z return + sta.z return + lda #0 + sbc.z return+1 + sta.z return+1 + // atoi::@return + // } + // [558] return + rts + // atoi::@4 + __b4: + // res * 10 + // [559] atoi::$10 = atoi::res#2 << 2 -- vwsz1=vwsz2_rol_2 + lda.z res + asl + sta.z atoi__10 + lda.z res+1 + rol + sta.z atoi__10+1 + asl.z atoi__10 + rol.z atoi__10+1 + // [560] atoi::$11 = atoi::$10 + atoi::res#2 -- vwsz1=vwsz2_plus_vwsz1 + clc + lda.z atoi__11 + adc.z atoi__10 + sta.z atoi__11 + lda.z atoi__11+1 + adc.z atoi__10+1 + sta.z atoi__11+1 + // [561] atoi::$6 = atoi::$11 << 1 -- vwsz1=vwsz1_rol_1 + asl.z atoi__6 + rol.z atoi__6+1 + // res * 10 + str[i] + // [562] atoi::$7 = atoi::$6 + atoi::str#2[atoi::i#4] -- vwsz1=vwsz1_plus_pbuz2_derefidx_vbuz3 + ldy.z i + lda.z atoi__7 + clc + adc (str),y + sta.z atoi__7 + bcc !+ + inc.z atoi__7+1 + !: + // res = res * 10 + str[i] - '0' + // [563] atoi::res#1 = atoi::$7 - '0' -- vwsz1=vwsz1_minus_vbuc1 + lda.z res + sec + sbc #'0' + sta.z res + bcs !+ + dec.z res+1 + !: + // for (; str[i]>='0' && str[i]<='9'; ++i) + // [564] atoi::i#2 = ++ atoi::i#4 -- vbuz1=_inc_vbuz1 + inc.z i + // [552] phi from atoi::@4 to atoi::@3 [phi:atoi::@4->atoi::@3] + // [552] phi atoi::negative#2 = atoi::negative#2 [phi:atoi::@4->atoi::@3#0] -- register_copy + // [552] phi atoi::res#2 = atoi::res#1 [phi:atoi::@4->atoi::@3#1] -- register_copy + // [552] phi atoi::i#4 = atoi::i#2 [phi:atoi::@4->atoi::@3#2] -- register_copy + jmp __b3 +} + // cx16_k_macptr +/** + * @brief Read a number of bytes from the sdcard using kernal macptr call. + * BRAM bank needs to be set properly before the load between adressed A000 and BFFF. + * + * @return x the size of bytes read + * @return y the size of bytes read + * @return if carry is set there is an error + */ +// __zp($3d) unsigned int cx16_k_macptr(__zp($58) volatile char bytes, __zp($56) void * volatile buffer) +cx16_k_macptr: { + .label bytes = $58 + .label buffer = $56 + .label bytes_read = $4b + .label return = $3d + // unsigned int bytes_read + // [565] cx16_k_macptr::bytes_read = 0 -- vwuz1=vwuc1 + lda #<0 + sta.z bytes_read + sta.z bytes_read+1 + // asm + // asm { ldabytes ldxbuffer ldybuffer+1 clc jsrCX16_MACPTR stxbytes_read stybytes_read+1 bcc!+ lda#$FF stabytes_read stabytes_read+1 !: } + lda bytes + ldx buffer + ldy buffer+1 + clc + jsr CX16_MACPTR + stx bytes_read + sty bytes_read+1 + bcc !+ + lda #$ff + sta bytes_read + sta bytes_read+1 + !: + // return bytes_read; + // [567] cx16_k_macptr::return#0 = cx16_k_macptr::bytes_read -- vwuz1=vwuz2 + lda.z bytes_read + sta.z return + lda.z bytes_read+1 + sta.z return+1 + // cx16_k_macptr::@return + // } + // [568] cx16_k_macptr::return#1 = cx16_k_macptr::return#0 + // [569] return + rts +} + // ultoa_append +// Used to convert a single digit of an unsigned number value to a string representation +// Counts a single digit up from '0' as long as the value is larger than sub. +// Each time the digit is increased sub is subtracted from value. +// - buffer : pointer to the char that receives the digit +// - value : The value where the digit will be derived from +// - sub : the value of a '1' in the digit. Subtracted continually while the digit is increased. +// (For decimal the subs used are 10000, 1000, 100, 10, 1) +// returns : the value reduced by sub * digit so that it is less than sub. +// __zp($42) unsigned long ultoa_append(__zp($34) char *buffer, __zp($42) unsigned long value, __zp($50) unsigned long sub) +ultoa_append: { + .label buffer = $34 + .label value = $42 + .label sub = $50 + .label return = $42 + .label digit = $47 + // [571] phi from ultoa_append to ultoa_append::@1 [phi:ultoa_append->ultoa_append::@1] + // [571] phi ultoa_append::digit#2 = 0 [phi:ultoa_append->ultoa_append::@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z digit + // [571] phi ultoa_append::value#2 = ultoa_append::value#0 [phi:ultoa_append->ultoa_append::@1#1] -- register_copy + // ultoa_append::@1 + __b1: + // while (value >= sub) + // [572] if(ultoa_append::value#2>=ultoa_append::sub#0) goto ultoa_append::@2 -- vduz1_ge_vduz2_then_la1 + lda.z value+3 + cmp.z sub+3 + bcc !+ + bne __b2 + lda.z value+2 + cmp.z sub+2 + bcc !+ + bne __b2 + lda.z value+1 + cmp.z sub+1 + bcc !+ + bne __b2 + lda.z value + cmp.z sub + bcs __b2 + !: + // ultoa_append::@3 + // *buffer = DIGITS[digit] + // [573] *ultoa_append::buffer#0 = DIGITS[ultoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbuz2 + ldy.z digit + lda DIGITS,y + ldy #0 + sta (buffer),y + // ultoa_append::@return + // } + // [574] return + rts + // ultoa_append::@2 + __b2: + // digit++; + // [575] ultoa_append::digit#1 = ++ ultoa_append::digit#2 -- vbuz1=_inc_vbuz1 + inc.z digit + // value -= sub + // [576] ultoa_append::value#1 = ultoa_append::value#2 - ultoa_append::sub#0 -- vduz1=vduz1_minus_vduz2 + lda.z value + sec + sbc.z sub + sta.z value + lda.z value+1 + sbc.z sub+1 + sta.z value+1 + lda.z value+2 + sbc.z sub+2 + sta.z value+2 + lda.z value+3 + sbc.z sub+3 + sta.z value+3 + // [571] phi from ultoa_append::@2 to ultoa_append::@1 [phi:ultoa_append::@2->ultoa_append::@1] + // [571] phi ultoa_append::digit#2 = ultoa_append::digit#1 [phi:ultoa_append::@2->ultoa_append::@1#0] -- register_copy + // [571] phi ultoa_append::value#2 = ultoa_append::value#1 [phi:ultoa_append::@2->ultoa_append::@1#1] -- register_copy + jmp __b1 +} + // memcpy8_vram_vram +/** + * @brief Copy a block of memory in VRAM from a source to a target destination. + * This function is designed to copy maximum 255 bytes of memory in one step. + * If more than 255 bytes need to be copied, use the memcpy_vram_vram function. + * + * @see memcpy_vram_vram + * + * @param dbank_vram Bank of the destination location in vram. + * @param doffset_vram Offset of the destination location in vram. + * @param sbank_vram Bank of the source location in vram. + * @param soffset_vram Offset of the source location in vram. + * @param num16 Specified the amount of bytes to be copied. + */ +// void memcpy8_vram_vram(__zp($25) char dbank_vram, __zp($36) unsigned int doffset_vram, __zp($24) char sbank_vram, __zp($2c) unsigned int soffset_vram, __zp($23) char num8) +memcpy8_vram_vram: { + .label memcpy8_vram_vram__0 = $26 + .label memcpy8_vram_vram__1 = $27 + .label memcpy8_vram_vram__2 = $24 + .label memcpy8_vram_vram__3 = $28 + .label memcpy8_vram_vram__4 = $29 + .label memcpy8_vram_vram__5 = $25 + .label num8 = $23 + .label dbank_vram = $25 + .label doffset_vram = $36 + .label sbank_vram = $24 + .label soffset_vram = $2c + .label num8_1 = $22 + // *VERA_CTRL &= ~VERA_ADDRSEL + // [577] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + lda #VERA_ADDRSEL^$ff + and VERA_CTRL + sta VERA_CTRL + // BYTE0(soffset_vram) + // [578] memcpy8_vram_vram::$0 = byte0 memcpy8_vram_vram::soffset_vram#0 -- vbuz1=_byte0_vwuz2 + lda.z soffset_vram + sta.z memcpy8_vram_vram__0 + // *VERA_ADDRX_L = BYTE0(soffset_vram) + // [579] *VERA_ADDRX_L = memcpy8_vram_vram::$0 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_L + // BYTE1(soffset_vram) + // [580] memcpy8_vram_vram::$1 = byte1 memcpy8_vram_vram::soffset_vram#0 -- vbuz1=_byte1_vwuz2 + lda.z soffset_vram+1 + sta.z memcpy8_vram_vram__1 + // *VERA_ADDRX_M = BYTE1(soffset_vram) + // [581] *VERA_ADDRX_M = memcpy8_vram_vram::$1 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_M + // sbank_vram | VERA_INC_1 + // [582] memcpy8_vram_vram::$2 = memcpy8_vram_vram::sbank_vram#0 | VERA_INC_1 -- vbuz1=vbuz1_bor_vbuc1 + lda #VERA_INC_1 + ora.z memcpy8_vram_vram__2 + sta.z memcpy8_vram_vram__2 + // *VERA_ADDRX_H = sbank_vram | VERA_INC_1 + // [583] *VERA_ADDRX_H = memcpy8_vram_vram::$2 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_H + // *VERA_CTRL |= VERA_ADDRSEL + // [584] *VERA_CTRL = *VERA_CTRL | VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + lda #VERA_ADDRSEL + ora VERA_CTRL + sta VERA_CTRL + // BYTE0(doffset_vram) + // [585] memcpy8_vram_vram::$3 = byte0 memcpy8_vram_vram::doffset_vram#0 -- vbuz1=_byte0_vwuz2 + lda.z doffset_vram + sta.z memcpy8_vram_vram__3 + // *VERA_ADDRX_L = BYTE0(doffset_vram) + // [586] *VERA_ADDRX_L = memcpy8_vram_vram::$3 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_L + // BYTE1(doffset_vram) + // [587] memcpy8_vram_vram::$4 = byte1 memcpy8_vram_vram::doffset_vram#0 -- vbuz1=_byte1_vwuz2 + lda.z doffset_vram+1 + sta.z memcpy8_vram_vram__4 + // *VERA_ADDRX_M = BYTE1(doffset_vram) + // [588] *VERA_ADDRX_M = memcpy8_vram_vram::$4 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_M + // dbank_vram | VERA_INC_1 + // [589] memcpy8_vram_vram::$5 = memcpy8_vram_vram::dbank_vram#0 | VERA_INC_1 -- vbuz1=vbuz1_bor_vbuc1 + lda #VERA_INC_1 + ora.z memcpy8_vram_vram__5 + sta.z memcpy8_vram_vram__5 + // *VERA_ADDRX_H = dbank_vram | VERA_INC_1 + // [590] *VERA_ADDRX_H = memcpy8_vram_vram::$5 -- _deref_pbuc1=vbuz1 + sta VERA_ADDRX_H + // [591] phi from memcpy8_vram_vram memcpy8_vram_vram::@2 to memcpy8_vram_vram::@1 [phi:memcpy8_vram_vram/memcpy8_vram_vram::@2->memcpy8_vram_vram::@1] + __b1: + // [591] phi memcpy8_vram_vram::num8#2 = memcpy8_vram_vram::num8#1 [phi:memcpy8_vram_vram/memcpy8_vram_vram::@2->memcpy8_vram_vram::@1#0] -- register_copy + // the size is only a byte, this is the fastest loop! + // memcpy8_vram_vram::@1 + // while (num8--) + // [592] memcpy8_vram_vram::num8#0 = -- memcpy8_vram_vram::num8#2 -- vbuz1=_dec_vbuz2 + ldy.z num8_1 + dey + sty.z num8 + // [593] if(0!=memcpy8_vram_vram::num8#2) goto memcpy8_vram_vram::@2 -- 0_neq_vbuz1_then_la1 + lda.z num8_1 + bne __b2 + // memcpy8_vram_vram::@return + // } + // [594] return + rts + // memcpy8_vram_vram::@2 + __b2: + // *VERA_DATA1 = *VERA_DATA0 + // [595] *VERA_DATA1 = *VERA_DATA0 -- _deref_pbuc1=_deref_pbuc2 + lda VERA_DATA0 + sta VERA_DATA1 + // [596] memcpy8_vram_vram::num8#6 = memcpy8_vram_vram::num8#0 -- vbuz1=vbuz2 + lda.z num8 + sta.z num8_1 + jmp __b1 +} + // strncpy +/// Copies up to n characters from the string pointed to, by src to dst. +/// In a case where the length of src is less than that of n, the remainder of dst will be padded with null bytes. +/// @param dst ? This is the pointer to the destination array where the content is to be copied. +/// @param src ? This is the string to be copied. +/// @param n ? The number of characters to be copied from source. +/// @return The destination +// char * strncpy(__zp($30) char *dst, __zp($2e) const char *src, __zp($4d) unsigned int n) +strncpy: { + .label c = $39 + .label dst = $30 + .label i = $34 + .label src = $2e + .label n = $4d + // [598] phi from strncpy to strncpy::@1 [phi:strncpy->strncpy::@1] + // [598] phi strncpy::dst#2 = ferror::temp [phi:strncpy->strncpy::@1#0] -- pbuz1=pbuc1 + lda #ferror.temp + sta.z dst+1 + // [598] phi strncpy::src#2 = __errno_error [phi:strncpy->strncpy::@1#1] -- pbuz1=pbuc1 + lda #<__errno_error + sta.z src + lda #>__errno_error + sta.z src+1 + // [598] phi strncpy::i#2 = 0 [phi:strncpy->strncpy::@1#2] -- vwuz1=vwuc1 + lda #<0 + sta.z i + sta.z i+1 + // strncpy::@1 + __b1: + // for(size_t i = 0;istrncpy::@3] + // [604] phi strncpy::src#6 = strncpy::src#2 [phi:strncpy::@2/strncpy::@4->strncpy::@3#0] -- register_copy + // strncpy::@3 + __b3: + // *dst++ = c + // [605] *strncpy::dst#2 = strncpy::c#0 -- _deref_pbuz1=vbuz2 + lda.z c + ldy #0 + sta (dst),y + // *dst++ = c; + // [606] strncpy::dst#0 = ++ strncpy::dst#2 -- pbuz1=_inc_pbuz1 + inc.z dst + bne !+ + inc.z dst+1 + !: + // for(size_t i = 0;istrncpy::@1] + // [598] phi strncpy::dst#2 = strncpy::dst#0 [phi:strncpy::@3->strncpy::@1#0] -- register_copy + // [598] phi strncpy::src#2 = strncpy::src#6 [phi:strncpy::@3->strncpy::@1#1] -- register_copy + // [598] phi strncpy::i#2 = strncpy::i#1 [phi:strncpy::@3->strncpy::@1#2] -- register_copy + jmp __b1 +} + // File Data +.segment Data + /** + * @file errno.c + * @author Sven Van de Velde (sven.van.de.velde@telenet.be) + * @brief Contains the POSIX implementation of errno, which contains the last error detected. + * @version 0.1 + * @date 2023-03-18 + * + * @copyright Copyright (c) 2023 + * + */ + __errno_error: .fill $20, 0 + // The digits used for numbers + DIGITS: .text "0123456789abcdef" + // Values of hexadecimal digits + RADIX_HEXADECIMAL_VALUES_LONG: .dword $10000000, $1000000, $100000, $10000, $1000, $100, $10 + isr_vsync: .word $314 + __conio: .fill SIZEOF_STRUCT___1, 0 + // Buffer used for stringified number being printed + printf_buffer: .fill SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER, 0 + __stdio_file: .fill SIZEOF_STRUCT___2, 0 + __errno: .word 0 + rom_file_checksum: .dword 0 + rom_file_size: .dword 0 + rom_checksum: .dword 0 diff --git a/target/src/cx16-checksum.klog b/target/src/cx16-checksum.klog new file mode 100644 index 0000000..6c1bc8c --- /dev/null +++ b/target/src/cx16-checksum.klog @@ -0,0 +1,23 @@ +Output dir: C:\Users\svenv\OneDrive\Documents\GitHub\x16-flash\target\src +parsing +flex pass 1 +flex pass 2 +flex pass 3 +Output pass +Writing prg file: cx16-checksum.prg + +Memory Map +---------- +Program-segment: + +Basic-segment: + $0801-$080c Basic + +Code-segment: + $080d-$150f Code + +Data-segment: + $1510-$1760 Data + +Writing Vice symbol file: cx16-checksum.vs +Writing Symbol file: cx16-checksum.sym diff --git a/target/src/cx16-update.asm b/target/src/cx16-update.asm index 4ec573f..491b935 100644 --- a/target/src/cx16-update.asm +++ b/target/src/cx16-update.asm @@ -26,7 +26,7 @@ ] .segmentdef Basic [start=$0801] .segmentdef Code [start=$80d] -.segmentdef Data [startAfter="Code"] +.segmentdef Data [startAfter="Code",max=$7800] .segmentdef CodeIntro [startAfter="Data"] .segmentdef CodeVera [startAfter="CodeIntro"] .segmentdef DataIntro [startAfter="CodeVera"] @@ -44,8 +44,6 @@ // Some addressing constants. // These pre-processor directives allow to disable specific ROM flashing functions (for emulator development purposes). // Normally they should be all activated. - // #define __VERA_CHIP_PROCESS - // #define __VERA_FLASH // To print the graphics on the vera. .const PROGRESS_X = 2 .const PROGRESS_Y = $20 @@ -126,6 +124,7 @@ .const STATUS_FLASHED = 8 .const STATUS_ISSUE = 9 .const STATUS_ERROR = $a + .const STATUS_WAITING = $b .const ROM_PROGRESS_CELL = $200 // A progress frame cell represents about 512 bytes for a ROM update. .const ROM_PROGRESS_ROW = $8000 @@ -133,12 +132,19 @@ .const SMC_PROGRESS_CELL = 8 // A progress frame cell represents about 8 bytes for a SMC update. .const SMC_PROGRESS_ROW = $200 + // A progress frame row represents about 512 bytes for a SMC update. + .const VERA_PROGRESS_CELL = $80 + // A progress frame cell represents about 128 bytes for a VERA compare. + .const VERA_PROGRESS_PAGE = $100 + // A progress frame cell represents about 256 bytes for a VERA flash. + .const VERA_PROGRESS_ROW = $2000 .const display_intro_briefing_count = $f .const display_intro_colors_count = $10 + .const display_jp1_spi_vera_count = $10 .const display_no_valid_smc_bootloader_count = 9 .const display_smc_rom_issue_count = 8 .const display_smc_unsupported_rom_count = 7 - .const display_debriefing_count_smc = $e + .const display_debriefing_smc_count = $e .const display_debriefing_count_rom = 6 /** * @file cx16-smc.h @@ -157,11 +163,9 @@ * */ .const SMC_CHIP_SIZE = $2000 + .const vera_size = $20000 .const OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS = 1 .const STACK_BASE = $103 - .const spi_manufacturer = 0 - .const spi_memory_type = 0 - .const spi_memory_capacity = 0 .const SIZEOF_STRUCT___1 = $8f .const SIZEOF_STRUCT_PRINTF_BUFFER_NUMBER = $c .const SIZEOF_STRUCT___2 = $48 @@ -210,11 +214,13 @@ .label VERA_L1_CONFIG = $9f34 /// $9F35 L1_MAPBASE Layer 1 Map Base Address (16:9) .label VERA_L1_MAPBASE = $9f35 + .label vera_reg_SPIData = $9f3e + .label vera_reg_SPICtrl = $9f3f .label BRAM = 0 .label BROM = 1 /// Current position in the buffer being filled ( initially *s passed to snprintf() /// Used to hold state while printing - .label __snprintf_buffer = $cf + .label __snprintf_buffer = $c0 .segment Code // __start __start: { @@ -251,13 +257,13 @@ __start: { /// Print a character into snprintf buffer /// Used by snprintf() /// @param c The character to print -// void snputc(__mem() char c) +// void snputc(__register(X) char c) snputc: { .const OFFSET_STACK_C = 0 - // [9] snputc::c#0 = stackidx(char,snputc::OFFSET_STACK_C) -- vbum1=_stackidxbyte_vbuc1 + // [9] snputc::c#0 = stackidx(char,snputc::OFFSET_STACK_C) -- vbuxx=_stackidxbyte_vbuc1 tsx lda STACK_BASE+OFFSET_STACK_C,x - sta c + tax // ++__snprintf_size; // [10] __snprintf_size = ++ __snprintf_size -- vwum1=_inc_vwum1 inc __snprintf_size @@ -289,9 +295,8 @@ snputc: { cmp __snprintf_capacity bne __b2 // [15] phi from snputc::@1 to snputc::@2 [phi:snputc::@1->snputc::@2] - // [15] phi snputc::c#2 = 0 [phi:snputc::@1->snputc::@2#0] -- vbum1=vbuc1 - lda #0 - sta c + // [15] phi snputc::c#2 = 0 [phi:snputc::@1->snputc::@2#0] -- vbuxx=vbuc1 + ldx #0 // [14] phi from snputc::@1 to snputc::@3 [phi:snputc::@1->snputc::@3] // snputc::@3 // [15] phi from snputc::@3 to snputc::@2 [phi:snputc::@3->snputc::@2] @@ -299,9 +304,9 @@ snputc: { // snputc::@2 __b2: // *(__snprintf_buffer++) = c - // [16] *__snprintf_buffer = snputc::c#2 -- _deref_pbuz1=vbum2 + // [16] *__snprintf_buffer = snputc::c#2 -- _deref_pbuz1=vbuxx // Append char - lda c + txa ldy #0 sta (__snprintf_buffer),y // *(__snprintf_buffer++) = c; @@ -311,14 +316,10 @@ snputc: { inc.z __snprintf_buffer+1 !: rts - .segment Data - c: .byte 0 } -.segment Code // conio_x16_init /// Set initial screen values. conio_x16_init: { - .label conio_x16_init__5 = $e2 // screenlayer1() // [19] call screenlayer1 jsr screenlayer1 @@ -326,19 +327,17 @@ conio_x16_init: { // conio_x16_init::@1 // textcolor(CONIO_TEXTCOLOR_DEFAULT) // [21] call textcolor - // [760] phi from conio_x16_init::@1 to textcolor [phi:conio_x16_init::@1->textcolor] - // [760] phi textcolor::color#23 = WHITE [phi:conio_x16_init::@1->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color + // [787] phi from conio_x16_init::@1 to textcolor [phi:conio_x16_init::@1->textcolor] + // [787] phi textcolor::color#23 = WHITE [phi:conio_x16_init::@1->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor // [22] phi from conio_x16_init::@1 to conio_x16_init::@2 [phi:conio_x16_init::@1->conio_x16_init::@2] // conio_x16_init::@2 // bgcolor(CONIO_BACKCOLOR_DEFAULT) // [23] call bgcolor - // [765] phi from conio_x16_init::@2 to bgcolor [phi:conio_x16_init::@2->bgcolor] - // [765] phi bgcolor::color#15 = BLUE [phi:conio_x16_init::@2->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color + // [792] phi from conio_x16_init::@2 to bgcolor [phi:conio_x16_init::@2->bgcolor] + // [792] phi bgcolor::color#15 = BLUE [phi:conio_x16_init::@2->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // [24] phi from conio_x16_init::@2 to conio_x16_init::@3 [phi:conio_x16_init::@2->conio_x16_init::@3] // conio_x16_init::@3 @@ -358,10 +357,9 @@ conio_x16_init: { lda cbm_k_plot_get.return+1 sta conio_x16_init__4+1 // BYTE1(cbm_k_plot_get()) - // [30] conio_x16_init::$5 = byte1 conio_x16_init::$4 -- vbuz1=_byte1_vwum2 - sta.z conio_x16_init__5 + // [30] conio_x16_init::$5 = byte1 conio_x16_init::$4 -- vbuaa=_byte1_vwum1 // __conio.cursor_x = BYTE1(cbm_k_plot_get()) - // [31] *((char *)&__conio) = conio_x16_init::$5 -- _deref_pbuc1=vbuz1 + // [31] *((char *)&__conio) = conio_x16_init::$5 -- _deref_pbuc1=vbuaa sta __conio // cbm_k_plot_get() // [32] call cbm_k_plot_get @@ -374,23 +372,20 @@ conio_x16_init: { lda cbm_k_plot_get.return+1 sta conio_x16_init__6+1 // BYTE0(cbm_k_plot_get()) - // [35] conio_x16_init::$7 = byte0 conio_x16_init::$6 -- vbum1=_byte0_vwum2 + // [35] conio_x16_init::$7 = byte0 conio_x16_init::$6 -- vbuaa=_byte0_vwum1 lda conio_x16_init__6 - sta conio_x16_init__7 // __conio.cursor_y = BYTE0(cbm_k_plot_get()) - // [36] *((char *)&__conio+1) = conio_x16_init::$7 -- _deref_pbuc1=vbum1 + // [36] *((char *)&__conio+1) = conio_x16_init::$7 -- _deref_pbuc1=vbuaa sta __conio+1 // gotoxy(__conio.cursor_x, __conio.cursor_y) - // [37] gotoxy::x#2 = *((char *)&__conio) -- vbum1=_deref_pbuc1 - lda __conio - sta gotoxy.x + // [37] gotoxy::x#2 = *((char *)&__conio) -- vbuyy=_deref_pbuc1 + ldy __conio // [38] gotoxy::y#2 = *((char *)&__conio+1) -- vbum1=_deref_pbuc1 - lda __conio+1 sta gotoxy.y // [39] call gotoxy - // [778] phi from conio_x16_init::@6 to gotoxy [phi:conio_x16_init::@6->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#2 [phi:conio_x16_init::@6->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = gotoxy::x#2 [phi:conio_x16_init::@6->gotoxy#1] -- register_copy + // [805] phi from conio_x16_init::@6 to gotoxy [phi:conio_x16_init::@6->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#2 [phi:conio_x16_init::@6->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = gotoxy::x#2 [phi:conio_x16_init::@6->gotoxy#1] -- register_copy jsr gotoxy // conio_x16_init::@7 // __conio.scroll[0] = 1 @@ -406,27 +401,22 @@ conio_x16_init: { rts .segment Data conio_x16_init__4: .word 0 - conio_x16_init__6: .word 0 - conio_x16_init__7: .byte 0 + .label conio_x16_init__6 = conio_x16_init__4 } .segment Code // cputc // Output one character at the current cursor position // Moves the cursor forward. Scrolls the entire screen if needed -// void cputc(__mem() char c) +// void cputc(__register(X) char c) cputc: { .const OFFSET_STACK_C = 0 - .label cputc__1 = $22 - .label cputc__2 = $68 - .label cputc__3 = $69 - // [43] cputc::c#0 = stackidx(char,cputc::OFFSET_STACK_C) -- vbum1=_stackidxbyte_vbuc1 + // [43] cputc::c#0 = stackidx(char,cputc::OFFSET_STACK_C) -- vbuxx=_stackidxbyte_vbuc1 tsx lda STACK_BASE+OFFSET_STACK_C,x - sta c + tax // if(c=='\n') - // [44] if(cputc::c#0==' ') goto cputc::@1 -- vbum1_eq_vbuc1_then_la1 - lda #'\n' - cmp c + // [44] if(cputc::c#0==' ') goto cputc::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #'\n' beq __b1 // cputc::@2 // *VERA_CTRL &= ~VERA_ADDRSEL @@ -435,31 +425,27 @@ cputc: { and VERA_CTRL sta VERA_CTRL // BYTE0(__conio.offset) - // [46] cputc::$1 = byte0 *((unsigned int *)&__conio+$13) -- vbuz1=_byte0__deref_pwuc1 + // [46] cputc::$1 = byte0 *((unsigned int *)&__conio+$13) -- vbuaa=_byte0__deref_pwuc1 lda __conio+$13 - sta.z cputc__1 // *VERA_ADDRX_L = BYTE0(__conio.offset) - // [47] *VERA_ADDRX_L = cputc::$1 -- _deref_pbuc1=vbuz1 + // [47] *VERA_ADDRX_L = cputc::$1 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_L // BYTE1(__conio.offset) - // [48] cputc::$2 = byte1 *((unsigned int *)&__conio+$13) -- vbuz1=_byte1__deref_pwuc1 + // [48] cputc::$2 = byte1 *((unsigned int *)&__conio+$13) -- vbuaa=_byte1__deref_pwuc1 lda __conio+$13+1 - sta.z cputc__2 // *VERA_ADDRX_M = BYTE1(__conio.offset) - // [49] *VERA_ADDRX_M = cputc::$2 -- _deref_pbuc1=vbuz1 + // [49] *VERA_ADDRX_M = cputc::$2 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_M // __conio.mapbase_bank | VERA_INC_1 - // [50] cputc::$3 = *((char *)&__conio+5) | VERA_INC_1 -- vbuz1=_deref_pbuc1_bor_vbuc2 + // [50] cputc::$3 = *((char *)&__conio+5) | VERA_INC_1 -- vbuaa=_deref_pbuc1_bor_vbuc2 lda #VERA_INC_1 ora __conio+5 - sta.z cputc__3 // *VERA_ADDRX_H = __conio.mapbase_bank | VERA_INC_1 - // [51] *VERA_ADDRX_H = cputc::$3 -- _deref_pbuc1=vbuz1 + // [51] *VERA_ADDRX_H = cputc::$3 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_H // *VERA_DATA0 = c - // [52] *VERA_DATA0 = cputc::c#0 -- _deref_pbuc1=vbum1 - lda c - sta VERA_DATA0 + // [52] *VERA_DATA0 = cputc::c#0 -- _deref_pbuc1=vbuxx + stx VERA_DATA0 // *VERA_DATA0 = __conio.color // [53] *VERA_DATA0 = *((char *)&__conio+$d) -- _deref_pbuc1=_deref_pbuc2 lda __conio+$d @@ -539,67 +525,28 @@ cputc: { // [69] call cputln jsr cputln rts - .segment Data - c: .byte 0 } -.segment Code // main main: { .const bank_set_brom1_bank = 0 .const bank_set_brom2_bank = 4 - .const bank_set_brom4_bank = 0 + .const bank_set_brom4_bank = 4 .const bank_set_brom5_bank = 0 - .const bank_set_brom6_bank = 4 - .label main__74 = $e7 - .label main__96 = $ec - .label main__98 = $bf - .label main__100 = $e0 - .label main__125 = $cc - .label main__191 = $ba - .label check_status_smc1_main__0 = $f6 - .label check_status_smc2_main__0 = $cb - .label check_status_cx16_rom4_check_status_rom1_main__0 = $df - .label check_status_vera2_main__0 = $f7 - .label check_status_vera3_main__0 = $fb - .label check_status_smc10_main__0 = $e1 - .label check_status_cx16_rom6_check_status_rom1_main__0 = $ca - .label check_status_cx16_rom7_check_status_rom1_main__0 = $d1 - .label check_status_smc12_main__0 = $a9 - .label check_status_smc13_main__0 = $ac - .label check_status_smc14_main__0 = $ae - .label check_status_smc15_main__0 = $ad - .label check_status_vera5_main__0 = $fa - .label check_status_smc16_main__0 = $de - .label check_status_vera7_main__0 = $ef - .label check_status_smc17_main__0 = $be - .label check_status_vera8_main__0 = $bd - .label check_status_smc1_return = $f6 - .label check_status_smc2_return = $cb - .label rom_file_github_id = $c1 - .label rom_file_release_id = $ec - .label ch = $c0 - .label ch2 = $6a - .label ch1 = $c9 - .label check_status_cx16_rom4_check_status_rom1_return = $df - .label ch3 = $cd - .label check_status_vera2_return = $f7 - .label check_status_vera3_return = $fb - .label check_status_smc10_return = $e1 - .label check_status_cx16_rom6_check_status_rom1_return = $ca - .label check_status_cx16_rom7_check_status_rom1_return = $d1 - .label check_status_smc12_return = $a9 - .label check_status_smc13_return = $ac - .label rom_differences = $c3 - .label check_status_smc14_return = $ae - .label check_status_smc15_return = $ad - .label check_status_vera5_return = $fa - .label check_status_smc16_return = $de - .label check_status_vera7_return = $ef - .label check_status_smc17_return = $be - .label check_status_vera8_return = $bd - .label main__360 = $bf - .label main__361 = $bf - .label main__362 = $bf + .const bank_set_brom6_bank = 0 + .const bank_set_brom7_bank = 4 + .const bank_set_brom8_bank = 0 + .const bank_set_brom9_bank = 0 + .const bank_set_brom10_bank = 4 + .label main__198 = $78 + .label rom_file_github_id = $7e + .label rom_file_release_id = $bd + .label check_status_cx16_rom4_check_status_rom1_return = $da + .label check_status_smc8_return = $dd + .label check_status_vera1_return = $f2 + .label check_status_vera2_return = $fa + .label check_status_smc14_return = $f5 + .label check_status_smc15_return = $f3 + .label check_status_vera8_return = $b9 // init() // [71] call init // Get the current screen mode ... @@ -619,21 +566,21 @@ main: { } } */ - // [799] phi from main to init [phi:main->init] + // [826] phi from main to init [phi:main->init] jsr init - // [72] phi from main to main::@93 [phi:main->main::@93] - // main::@93 + // [72] phi from main to main::@100 [phi:main->main::@100] + // main::@100 // main_intro() // [73] call main_intro - // [835] phi from main::@93 to main_intro [phi:main::@93->main_intro] + // [862] phi from main::@100 to main_intro [phi:main::@100->main_intro] jsr main_intro - // [74] phi from main::@93 to main::@94 [phi:main::@93->main::@94] - // main::@94 + // [74] phi from main::@100 to main::@101 [phi:main::@100->main::@101] + // main::@101 // smc_detect() // [75] call smc_detect jsr smc_detect // [76] smc_detect::return#2 = smc_detect::return#0 - // main::@95 + // main::@102 // smc_bootloader = smc_detect() // [77] smc_bootloader#0 = smc_detect::return#2 -- vwum1=vwuz2 lda.z smc_detect.return @@ -642,25 +589,25 @@ main: { sta smc_bootloader+1 // strcpy(smc_version_text, "0.0.0") // [78] call strcpy - // [863] phi from main::@95 to strcpy [phi:main::@95->strcpy] - // [863] phi strcpy::dst#0 = smc_version_text [phi:main::@95->strcpy#0] -- pbuz1=pbuc1 + // [890] phi from main::@102 to strcpy [phi:main::@102->strcpy] + // [890] phi strcpy::dst#0 = smc_version_text [phi:main::@102->strcpy#0] -- pbuz1=pbuc1 lda #smc_version_text sta.z strcpy.dst+1 - // [863] phi strcpy::src#0 = main::source [phi:main::@95->strcpy#1] -- pbuz1=pbuc1 + // [890] phi strcpy::src#0 = main::source [phi:main::@102->strcpy#1] -- pbuz1=pbuc1 lda #source sta.z strcpy.src+1 jsr strcpy - // [79] phi from main::@95 to main::@96 [phi:main::@95->main::@96] - // main::@96 + // [79] phi from main::@102 to main::@103 [phi:main::@102->main::@103] + // main::@103 // display_chip_smc() // [80] call display_chip_smc - // [871] phi from main::@96 to display_chip_smc [phi:main::@96->display_chip_smc] + // [898] phi from main::@103 to display_chip_smc [phi:main::@103->display_chip_smc] jsr display_chip_smc - // main::@97 + // main::@104 // if(smc_bootloader == 0x0100) // [81] if(smc_bootloader#0==$100) goto main::@1 -- vwum1_eq_vwuc1_then_la1 lda smc_bootloader @@ -672,32 +619,32 @@ main: { jmp __b1 !__b1: !: - // main::@4 + // main::@6 // if(smc_bootloader == 0x0200) - // [82] if(smc_bootloader#0==$200) goto main::@17 -- vwum1_eq_vwuc1_then_la1 + // [82] if(smc_bootloader#0==$200) goto main::@19 -- vwum1_eq_vwuc1_then_la1 lda smc_bootloader cmp #<$200 bne !+ lda smc_bootloader+1 cmp #>$200 - bne !__b17+ - jmp __b17 - !__b17: + bne !__b19+ + jmp __b19 + !__b19: !: - // main::@5 + // main::@7 // if(smc_bootloader > 0x2) - // [83] if(smc_bootloader#0>=2+1) goto main::@18 -- vwum1_ge_vbuc1_then_la1 + // [83] if(smc_bootloader#0>=2+1) goto main::@20 -- vwum1_ge_vbuc1_then_la1 lda smc_bootloader+1 - beq !__b18+ - jmp __b18 - !__b18: + beq !__b20+ + jmp __b20 + !__b20: lda smc_bootloader cmp #2+1 - bcc !__b18+ - jmp __b18 - !__b18: + bcc !__b20+ + jmp __b20 + !__b20: !: - // main::@6 + // main::@8 // cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_VERSION) // [84] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 lda #$42 @@ -708,7 +655,7 @@ main: { // [86] call cx16_k_i2c_read_byte jsr cx16_k_i2c_read_byte // [87] cx16_k_i2c_read_byte::return#14 = cx16_k_i2c_read_byte::return#1 - // main::@104 + // main::@111 // smc_release = cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_VERSION) // [88] smc_release#0 = cx16_k_i2c_read_byte::return#14 -- vbum1=vwum2 lda cx16_k_i2c_read_byte.return @@ -723,7 +670,7 @@ main: { // [91] call cx16_k_i2c_read_byte jsr cx16_k_i2c_read_byte // [92] cx16_k_i2c_read_byte::return#15 = cx16_k_i2c_read_byte::return#1 - // main::@105 + // main::@112 // smc_major = cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_MAJOR) // [93] smc_major#0 = cx16_k_i2c_read_byte::return#15 -- vbum1=vwum2 lda cx16_k_i2c_read_byte.return @@ -738,93 +685,97 @@ main: { // [96] call cx16_k_i2c_read_byte jsr cx16_k_i2c_read_byte // [97] cx16_k_i2c_read_byte::return#16 = cx16_k_i2c_read_byte::return#1 - // main::@106 + // main::@113 // smc_minor = cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_MINOR) // [98] smc_minor#0 = cx16_k_i2c_read_byte::return#16 -- vbum1=vwum2 lda cx16_k_i2c_read_byte.return sta smc_minor // smc_get_version_text(smc_version_text, smc_release, smc_major, smc_minor) - // [99] smc_get_version_text::release#0 = smc_release#0 -- vbum1=vbum2 - lda smc_release - sta smc_get_version_text.release - // [100] smc_get_version_text::major#0 = smc_major#0 -- vbuz1=vbum2 + // [99] smc_get_version_text::release#0 = smc_release#0 -- vbuyy=vbum1 + ldy smc_release + // [100] smc_get_version_text::major#0 = smc_major#0 -- vbum1=vbum2 lda smc_major - sta.z smc_get_version_text.major - // [101] smc_get_version_text::minor#0 = smc_minor#0 -- vbum1=vbum2 + sta smc_get_version_text.major + // [101] smc_get_version_text::minor#0 = smc_minor#0 -- vbuz1=vbum2 lda smc_minor - sta smc_get_version_text.minor + sta.z smc_get_version_text.minor // [102] call smc_get_version_text - // [881] phi from main::@106 to smc_get_version_text [phi:main::@106->smc_get_version_text] - // [881] phi smc_get_version_text::minor#2 = smc_get_version_text::minor#0 [phi:main::@106->smc_get_version_text#0] -- register_copy - // [881] phi smc_get_version_text::major#2 = smc_get_version_text::major#0 [phi:main::@106->smc_get_version_text#1] -- register_copy - // [881] phi smc_get_version_text::release#2 = smc_get_version_text::release#0 [phi:main::@106->smc_get_version_text#2] -- register_copy - // [881] phi smc_get_version_text::version_string#2 = smc_version_text [phi:main::@106->smc_get_version_text#3] -- pbuz1=pbuc1 + // [908] phi from main::@113 to smc_get_version_text [phi:main::@113->smc_get_version_text] + // [908] phi smc_get_version_text::minor#2 = smc_get_version_text::minor#0 [phi:main::@113->smc_get_version_text#0] -- register_copy + // [908] phi smc_get_version_text::major#2 = smc_get_version_text::major#0 [phi:main::@113->smc_get_version_text#1] -- register_copy + // [908] phi smc_get_version_text::release#2 = smc_get_version_text::release#0 [phi:main::@113->smc_get_version_text#2] -- register_copy + // [908] phi smc_get_version_text::version_string#2 = smc_version_text [phi:main::@113->smc_get_version_text#3] -- pbuz1=pbuc1 lda #smc_version_text sta.z smc_get_version_text.version_string+1 jsr smc_get_version_text - // main::@107 - // [103] smc_bootloader#457 = smc_bootloader#0 -- vwum1=vwum2 + // main::@114 + // [103] smc_bootloader#580 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_DETECTED, NULL) // [104] call display_info_smc - // [898] phi from main::@107 to display_info_smc [phi:main::@107->display_info_smc] - // [898] phi display_info_smc::info_text#21 = 0 [phi:main::@107->display_info_smc#0] -- pbuz1=vbuc1 + // [925] phi from main::@114 to display_info_smc [phi:main::@114->display_info_smc] + // [925] phi display_info_smc::info_text#24 = 0 [phi:main::@114->display_info_smc#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_smc.info_text sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#457 [phi:main::@107->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_DETECTED [phi:main::@107->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#580 [phi:main::@114->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_DETECTED [phi:main::@114->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_DETECTED - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - // [105] phi from main::@107 to main::SEI1 [phi:main::@107->main::SEI1] - // [105] phi smc_minor#391 = smc_minor#0 [phi:main::@107->main::SEI1#0] -- register_copy - // [105] phi smc_major#392 = smc_major#0 [phi:main::@107->main::SEI1#1] -- register_copy - // [105] phi smc_release#393 = smc_release#0 [phi:main::@107->main::SEI1#2] -- register_copy + // [105] phi from main::@114 to main::@2 [phi:main::@114->main::@2] + // [105] phi smc_minor#418 = smc_minor#0 [phi:main::@114->main::@2#0] -- register_copy + // [105] phi smc_major#419 = smc_major#0 [phi:main::@114->main::@2#1] -- register_copy + // [105] phi smc_release#420 = smc_release#0 [phi:main::@114->main::@2#2] -- register_copy + // main::@2 + __b2: + // main_vera_detect() + // [106] call main_vera_detect + // [961] phi from main::@2 to main_vera_detect [phi:main::@2->main_vera_detect] + jsr main_vera_detect // main::SEI1 - SEI1: // asm // asm { sei } sei // main::bank_set_brom1 // BROM = bank - // [107] BROM = main::bank_set_brom1_bank#0 -- vbuz1=vbuc1 + // [108] BROM = main::bank_set_brom1_bank#0 -- vbuz1=vbuc1 lda #bank_set_brom1_bank sta.z BROM - // [108] phi from main::bank_set_brom1 to main::@66 [phi:main::bank_set_brom1->main::@66] - // main::@66 + // [109] phi from main::bank_set_brom1 to main::@69 [phi:main::bank_set_brom1->main::@69] + // main::@69 // rom_detect() - // [109] call rom_detect + // [110] call rom_detect // Detecting ROM chips - // [934] phi from main::@66 to rom_detect [phi:main::@66->rom_detect] + // [968] phi from main::@69 to rom_detect [phi:main::@69->rom_detect] jsr rom_detect - // [110] phi from main::@66 to main::@108 [phi:main::@66->main::@108] - // main::@108 + // [111] phi from main::@69 to main::@115 [phi:main::@69->main::@115] + // main::@115 // display_chip_rom() - // [111] call display_chip_rom - // [984] phi from main::@108 to display_chip_rom [phi:main::@108->display_chip_rom] + // [112] call display_chip_rom + // [1018] phi from main::@115 to display_chip_rom [phi:main::@115->display_chip_rom] jsr display_chip_rom - // [112] phi from main::@108 to main::@19 [phi:main::@108->main::@19] - // [112] phi main::rom_chip#10 = 0 [phi:main::@108->main::@19#0] -- vbum1=vbuc1 + // [113] phi from main::@115 to main::@21 [phi:main::@115->main::@21] + // [113] phi main::rom_chip#10 = 0 [phi:main::@115->main::@21#0] -- vbum1=vbuc1 lda #0 sta rom_chip - // main::@19 - __b19: + // main::@21 + __b21: // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [113] if(main::rom_chip#10<8) goto main::@20 -- vbum1_lt_vbuc1_then_la1 + // [114] if(main::rom_chip#10<8) goto main::@22 -- vbum1_lt_vbuc1_then_la1 lda rom_chip cmp #8 - bcs !__b20+ - jmp __b20 - !__b20: + bcs !__b22+ + jmp __b22 + !__b22: // main::bank_set_brom2 // BROM = bank - // [114] BROM = main::bank_set_brom2_bank#0 -- vbuz1=vbuc1 + // [115] BROM = main::bank_set_brom2_bank#0 -- vbuz1=vbuc1 lda #bank_set_brom2_bank sta.z BROM // main::CLI1 @@ -833,1454 +784,1549 @@ main: { cli // main::check_status_smc1 // status_smc == status - // [116] main::check_status_smc1_$0 = status_smc#122 == STATUS_DETECTED -- vboz1=vbum2_eq_vbuc1 + // [117] main::check_status_smc1_$0 = status_smc#147 == STATUS_DETECTED -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_DETECTED beq !+ lda #1 !: eor #1 - sta.z check_status_smc1_main__0 // return (unsigned char)(status_smc == status); - // [117] main::check_status_smc1_return#0 = (char)main::check_status_smc1_$0 + // [118] main::check_status_smc1_return#0 = (char)main::check_status_smc1_$0 -- vbuyy=vbuaa + tay // main::check_status_smc2 // status_smc == status - // [118] main::check_status_smc2_$0 = status_smc#122 == STATUS_ISSUE -- vboz1=vbum2_eq_vbuc1 + // [119] main::check_status_smc2_$0 = status_smc#147 == STATUS_ISSUE -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_ISSUE beq !+ lda #1 !: eor #1 - sta.z check_status_smc2_main__0 // return (unsigned char)(status_smc == status); - // [119] main::check_status_smc2_return#0 = (char)main::check_status_smc2_$0 - // main::@67 + // [120] main::check_status_smc2_return#0 = (char)main::check_status_smc2_$0 -- vbuxx=vbuaa + tax + // main::@70 // if(check_status_smc(STATUS_DETECTED) || check_status_smc(STATUS_ISSUE) ) - // [120] if(0!=main::check_status_smc1_return#0) goto main::@23 -- 0_neq_vbuz1_then_la1 - lda.z check_status_smc1_return - beq !__b23+ - jmp __b23 - !__b23: - // main::@236 - // [121] if(0!=main::check_status_smc2_return#0) goto main::@23 -- 0_neq_vbuz1_then_la1 - lda.z check_status_smc2_return - beq !__b23+ - jmp __b23 - !__b23: - // [122] phi from main::@236 to main::SEI2 [phi:main::@236->main::SEI2] - // [122] phi smc_file_minor#316 = 0 [phi:main::@236->main::SEI2#0] -- vbum1=vbuc1 + // [121] if(0!=main::check_status_smc1_return#0) goto main::@25 -- 0_neq_vbuyy_then_la1 + cpy #0 + beq !__b25+ + jmp __b25 + !__b25: + // main::@246 + // [122] if(0!=main::check_status_smc2_return#0) goto main::@25 -- 0_neq_vbuxx_then_la1 + cpx #0 + beq !__b25+ + jmp __b25 + !__b25: + // [123] phi from main::@246 to main::@3 [phi:main::@246->main::@3] + // [123] phi smc_file_minor#310 = 0 [phi:main::@246->main::@3#0] -- vbum1=vbuc1 lda #0 sta smc_file_minor - // [122] phi smc_file_major#316 = 0 [phi:main::@236->main::SEI2#1] -- vbum1=vbuc1 + // [123] phi smc_file_major#310 = 0 [phi:main::@246->main::@3#1] -- vbum1=vbuc1 sta smc_file_major - // [122] phi smc_file_release#316 = 0 [phi:main::@236->main::SEI2#2] -- vbum1=vbuc1 + // [123] phi smc_file_release#310 = 0 [phi:main::@246->main::@3#2] -- vbum1=vbuc1 sta smc_file_release - // [122] phi __stdio_filecount#259 = 0 [phi:main::@236->main::SEI2#3] -- vbum1=vbuc1 + // [123] phi __stdio_filecount#109 = 0 [phi:main::@246->main::@3#3] -- vbum1=vbuc1 sta __stdio_filecount - // [122] phi __errno#245 = 0 [phi:main::@236->main::SEI2#4] -- vwsm1=vwsc1 + // [123] phi __errno#113 = 0 [phi:main::@246->main::@3#4] -- vwsm1=vwsc1 sta __errno sta __errno+1 + // main::@3 + __b3: + // main::bank_set_brom4 + // BROM = bank + // [124] BROM = main::bank_set_brom4_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom4_bank + sta.z BROM + // main::CLI2 + // asm + // asm { cli } + cli + // [126] phi from main::CLI2 to main::@72 [phi:main::CLI2->main::@72] + // main::@72 + // display_progress_clear() + // [127] call display_progress_clear + // [1037] phi from main::@72 to display_progress_clear [phi:main::@72->display_progress_clear] + jsr display_progress_clear + // [128] phi from main::@72 to main::@120 [phi:main::@72->main::@120] + // main::@120 + // main_vera_check() + // [129] call main_vera_check + // [1052] phi from main::@120 to main_vera_check [phi:main::@120->main_vera_check] + jsr main_vera_check // main::SEI2 - SEI2: // asm // asm { sei } sei - // [124] phi from main::SEI2 to main::@28 [phi:main::SEI2->main::@28] - // [124] phi __stdio_filecount#114 = __stdio_filecount#259 [phi:main::SEI2->main::@28#0] -- register_copy - // [124] phi __errno#100 = __errno#245 [phi:main::SEI2->main::@28#1] -- register_copy - // [124] phi main::rom_chip1#10 = 0 [phi:main::SEI2->main::@28#2] -- vbum1=vbuc1 + // main::bank_set_brom5 + // BROM = bank + // [131] BROM = main::bank_set_brom5_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom5_bank + sta.z BROM + // main::SEI3 + // asm + // asm { sei } + sei + // [133] phi from main::SEI3 to main::@30 [phi:main::SEI3->main::@30] + // [133] phi __stdio_filecount#111 = __stdio_filecount#12 [phi:main::SEI3->main::@30#0] -- register_copy + // [133] phi __errno#115 = __errno#123 [phi:main::SEI3->main::@30#1] -- register_copy + // [133] phi main::rom_chip1#10 = 0 [phi:main::SEI3->main::@30#2] -- vbum1=vbuc1 lda #0 sta rom_chip1 // We loop all the possible ROM chip slots on the board and on the extension card, // and we check the file contents. // Any error identified gets reported and this chip will not be flashed. // In case of ROM0.BIN in error, no flashing will be done! - // main::@28 - __b28: + // main::@30 + __b30: // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [125] if(main::rom_chip1#10<8) goto main::bank_set_brom4 -- vbum1_lt_vbuc1_then_la1 + // [134] if(main::rom_chip1#10<8) goto main::bank_set_brom6 -- vbum1_lt_vbuc1_then_la1 lda rom_chip1 cmp #8 - bcs !bank_set_brom4+ - jmp bank_set_brom4 - !bank_set_brom4: + bcs !bank_set_brom6+ + jmp bank_set_brom6 + !bank_set_brom6: // main::check_status_smc3 // status_smc == status - // [126] main::check_status_smc3_$0 = status_smc#122 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [135] main::check_status_smc3_$0 = status_smc#147 == STATUS_FLASH -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_smc3_main__0 // return (unsigned char)(status_smc == status); - // [127] main::check_status_smc3_return#0 = (char)main::check_status_smc3_$0 - // [128] phi from main::check_status_smc3 to main::check_status_cx16_rom1 [phi:main::check_status_smc3->main::check_status_cx16_rom1] + // [136] main::check_status_smc3_return#0 = (char)main::check_status_smc3_$0 -- vbuyy=vbuaa + tay + // [137] phi from main::check_status_smc3 to main::check_status_cx16_rom1 [phi:main::check_status_smc3->main::check_status_cx16_rom1] // main::check_status_cx16_rom1 // main::check_status_cx16_rom1_check_status_rom1 // status_rom[rom_chip] == status - // [129] main::check_status_cx16_rom1_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vbom1=_deref_pbuc1_eq_vbuc2 + // [138] main::check_status_cx16_rom1_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vboaa=_deref_pbuc1_eq_vbuc2 lda status_rom eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_cx16_rom1_check_status_rom1_main__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [130] main::check_status_cx16_rom1_check_status_rom1_return#0 = (char)main::check_status_cx16_rom1_check_status_rom1_$0 - // main::@70 + // [139] main::check_status_cx16_rom1_check_status_rom1_return#0 = (char)main::check_status_cx16_rom1_check_status_rom1_$0 -- vbuxx=vbuaa + tax + // main::@74 // if(!check_status_smc(STATUS_FLASH) && check_status_cx16_rom(STATUS_FLASH)) - // [131] if(0!=main::check_status_smc3_return#0) goto main::check_status_smc4 -- 0_neq_vbum1_then_la1 - lda check_status_smc3_return + // [140] if(0!=main::check_status_smc3_return#0) goto main::check_status_smc4 -- 0_neq_vbuyy_then_la1 + cpy #0 bne check_status_smc4 - // main::@237 - // [132] if(0!=main::check_status_cx16_rom1_check_status_rom1_return#0) goto main::@35 -- 0_neq_vbum1_then_la1 - lda check_status_cx16_rom1_check_status_rom1_return - beq !__b35+ - jmp __b35 - !__b35: + // main::@247 + // [141] if(0!=main::check_status_cx16_rom1_check_status_rom1_return#0) goto main::@37 -- 0_neq_vbuxx_then_la1 + cpx #0 + beq !__b37+ + jmp __b37 + !__b37: // main::check_status_smc4 check_status_smc4: // status_smc == status - // [133] main::check_status_smc4_$0 = status_smc#122 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [142] main::check_status_smc4_$0 = status_smc#147 == STATUS_FLASH -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_smc4_main__0 // return (unsigned char)(status_smc == status); - // [134] main::check_status_smc4_return#0 = (char)main::check_status_smc4_$0 - // [135] phi from main::check_status_smc4 to main::check_status_cx16_rom2 [phi:main::check_status_smc4->main::check_status_cx16_rom2] + // [143] main::check_status_smc4_return#0 = (char)main::check_status_smc4_$0 -- vbuyy=vbuaa + tay + // [144] phi from main::check_status_smc4 to main::check_status_cx16_rom2 [phi:main::check_status_smc4->main::check_status_cx16_rom2] // main::check_status_cx16_rom2 // main::check_status_cx16_rom2_check_status_rom1 // status_rom[rom_chip] == status - // [136] main::check_status_cx16_rom2_check_status_rom1_$0 = *status_rom == STATUS_NONE -- vbom1=_deref_pbuc1_eq_vbuc2 + // [145] main::check_status_cx16_rom2_check_status_rom1_$0 = *status_rom == STATUS_NONE -- vboaa=_deref_pbuc1_eq_vbuc2 lda status_rom eor #STATUS_NONE beq !+ lda #1 !: eor #1 - sta check_status_cx16_rom2_check_status_rom1_main__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [137] main::check_status_cx16_rom2_check_status_rom1_return#0 = (char)main::check_status_cx16_rom2_check_status_rom1_$0 - // main::@71 + // [146] main::check_status_cx16_rom2_check_status_rom1_return#0 = (char)main::check_status_cx16_rom2_check_status_rom1_$0 -- vbuxx=vbuaa + tax + // main::@75 // if(check_status_smc(STATUS_FLASH) && check_status_cx16_rom(STATUS_NONE)) - // [138] if(0==main::check_status_smc4_return#0) goto main::check_status_smc5 -- 0_eq_vbum1_then_la1 + // [147] if(0==main::check_status_smc4_return#0) goto main::check_status_smc5 -- 0_eq_vbuyy_then_la1 // VA3 | SMC.BIN and CX16 ROM not Detected - lda check_status_smc4_return + cpy #0 beq check_status_smc5 - // main::@238 - // [139] if(0!=main::check_status_cx16_rom2_check_status_rom1_return#0) goto main::@2 -- 0_neq_vbum1_then_la1 - lda check_status_cx16_rom2_check_status_rom1_return - beq !__b2+ - jmp __b2 - !__b2: + // main::@248 + // [148] if(0!=main::check_status_cx16_rom2_check_status_rom1_return#0) goto main::@4 -- 0_neq_vbuxx_then_la1 + cpx #0 + beq !__b4+ + jmp __b4 + !__b4: // main::check_status_smc5 check_status_smc5: // status_smc == status - // [140] main::check_status_smc5_$0 = status_smc#122 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [149] main::check_status_smc5_$0 = status_smc#147 == STATUS_FLASH -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_smc5_main__0 // return (unsigned char)(status_smc == status); - // [141] main::check_status_smc5_return#0 = (char)main::check_status_smc5_$0 - // [142] phi from main::check_status_smc5 to main::check_status_cx16_rom3 [phi:main::check_status_smc5->main::check_status_cx16_rom3] + // [150] main::check_status_smc5_return#0 = (char)main::check_status_smc5_$0 -- vbuyy=vbuaa + tay + // [151] phi from main::check_status_smc5 to main::check_status_cx16_rom3 [phi:main::check_status_smc5->main::check_status_cx16_rom3] // main::check_status_cx16_rom3 // main::check_status_cx16_rom3_check_status_rom1 // status_rom[rom_chip] == status - // [143] main::check_status_cx16_rom3_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vbom1=_deref_pbuc1_eq_vbuc2 + // [152] main::check_status_cx16_rom3_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vboaa=_deref_pbuc1_eq_vbuc2 lda status_rom eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_cx16_rom3_check_status_rom1_main__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [144] main::check_status_cx16_rom3_check_status_rom1_return#0 = (char)main::check_status_cx16_rom3_check_status_rom1_$0 - // main::@72 + // [153] main::check_status_cx16_rom3_check_status_rom1_return#0 = (char)main::check_status_cx16_rom3_check_status_rom1_$0 -- vbuxx=vbuaa + tax + // main::@76 // if(check_status_smc(STATUS_FLASH) && !check_status_cx16_rom(STATUS_FLASH)) - // [145] if(0==main::check_status_smc5_return#0) goto main::check_status_smc6 -- 0_eq_vbum1_then_la1 - lda check_status_smc5_return + // [154] if(0==main::check_status_smc5_return#0) goto main::check_status_smc6 -- 0_eq_vbuyy_then_la1 + cpy #0 beq check_status_smc6 - // main::@239 - // [146] if(0==main::check_status_cx16_rom3_check_status_rom1_return#0) goto main::@7 -- 0_eq_vbum1_then_la1 - lda check_status_cx16_rom3_check_status_rom1_return - bne !__b7+ - jmp __b7 - !__b7: + // main::@249 + // [155] if(0==main::check_status_cx16_rom3_check_status_rom1_return#0) goto main::@9 -- 0_eq_vbuxx_then_la1 + cpx #0 + bne !__b9+ + jmp __b9 + !__b9: // main::check_status_smc6 check_status_smc6: // status_smc == status - // [147] main::check_status_smc6_$0 = status_smc#122 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [156] main::check_status_smc6_$0 = status_smc#147 == STATUS_FLASH -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_smc6_main__0 // return (unsigned char)(status_smc == status); - // [148] main::check_status_smc6_return#0 = (char)main::check_status_smc6_$0 - // [149] phi from main::check_status_smc6 to main::check_status_cx16_rom4 [phi:main::check_status_smc6->main::check_status_cx16_rom4] + // [157] main::check_status_smc6_return#0 = (char)main::check_status_smc6_$0 -- vbum1=vbuaa + sta check_status_smc6_return + // [158] phi from main::check_status_smc6 to main::check_status_cx16_rom4 [phi:main::check_status_smc6->main::check_status_cx16_rom4] // main::check_status_cx16_rom4 // main::check_status_cx16_rom4_check_status_rom1 // status_rom[rom_chip] == status - // [150] main::check_status_cx16_rom4_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vboz1=_deref_pbuc1_eq_vbuc2 + // [159] main::check_status_cx16_rom4_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vboaa=_deref_pbuc1_eq_vbuc2 lda status_rom eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta.z check_status_cx16_rom4_check_status_rom1_main__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [151] main::check_status_cx16_rom4_check_status_rom1_return#0 = (char)main::check_status_cx16_rom4_check_status_rom1_$0 - // main::@73 + // [160] main::check_status_cx16_rom4_check_status_rom1_return#0 = (char)main::check_status_cx16_rom4_check_status_rom1_$0 -- vbuz1=vbuaa + sta.z check_status_cx16_rom4_check_status_rom1_return + // main::@77 // smc_supported_rom(rom_file_release[0]) - // [152] smc_supported_rom::rom_release#0 = *rom_file_release -- vbuz1=_deref_pbuc1 + // [161] smc_supported_rom::rom_release#0 = *rom_file_release -- vbuaa=_deref_pbuc1 lda rom_file_release - sta.z smc_supported_rom.rom_release - // [153] call smc_supported_rom - // [1003] phi from main::@73 to smc_supported_rom [phi:main::@73->smc_supported_rom] + // [162] call smc_supported_rom + // [1074] phi from main::@77 to smc_supported_rom [phi:main::@77->smc_supported_rom] jsr smc_supported_rom // smc_supported_rom(rom_file_release[0]) - // [154] smc_supported_rom::return#3 = smc_supported_rom::return#2 - // main::@158 - // [155] main::$28 = smc_supported_rom::return#3 + // [163] smc_supported_rom::return#3 = smc_supported_rom::return#2 + // main::@166 + // [164] main::$35 = smc_supported_rom::return#3 -- vbuxx=vbuaa + tax // if(check_status_smc(STATUS_FLASH) && check_status_cx16_rom(STATUS_FLASH) && !smc_supported_rom(rom_file_release[0])) - // [156] if(0==main::check_status_smc6_return#0) goto main::check_status_smc7 -- 0_eq_vbum1_then_la1 + // [165] if(0==main::check_status_smc6_return#0) goto main::check_status_smc7 -- 0_eq_vbum1_then_la1 lda check_status_smc6_return beq check_status_smc7 - // main::@241 - // [157] if(0==main::check_status_cx16_rom4_check_status_rom1_return#0) goto main::check_status_smc7 -- 0_eq_vbuz1_then_la1 + // main::@251 + // [166] if(0==main::check_status_cx16_rom4_check_status_rom1_return#0) goto main::check_status_smc7 -- 0_eq_vbuz1_then_la1 lda.z check_status_cx16_rom4_check_status_rom1_return beq check_status_smc7 - // main::@240 - // [158] if(0==main::$28) goto main::@10 -- 0_eq_vbum1_then_la1 - lda main__28 - bne !__b10+ - jmp __b10 - !__b10: + // main::@250 + // [167] if(0==main::$35) goto main::@12 -- 0_eq_vbuxx_then_la1 + cpx #0 + bne !__b12+ + jmp __b12 + !__b12: // main::check_status_smc7 check_status_smc7: // status_smc == status - // [159] main::check_status_smc7_$0 = status_smc#122 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [168] main::check_status_smc7_$0 = status_smc#147 == STATUS_FLASH -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_smc7_main__0 // return (unsigned char)(status_smc == status); - // [160] main::check_status_smc7_return#0 = (char)main::check_status_smc7_$0 - // main::@74 + // [169] main::check_status_smc7_return#0 = (char)main::check_status_smc7_$0 + // main::@78 // if(check_status_smc(STATUS_FLASH) && smc_release == smc_file_release && smc_major == smc_file_major && smc_minor == smc_file_minor) - // [161] if(0==main::check_status_smc7_return#0) goto main::check_status_cx16_rom5 -- 0_eq_vbum1_then_la1 - lda check_status_smc7_return + // [170] if(0==main::check_status_smc7_return#0) goto main::check_status_cx16_rom5 -- 0_eq_vbuaa_then_la1 + cmp #0 beq check_status_cx16_rom5 - // main::@244 - // [162] if(smc_release#393==smc_file_release#316) goto main::@243 -- vbum1_eq_vbum2_then_la1 + // main::@254 + // [171] if(smc_release#420==smc_file_release#310) goto main::@253 -- vbum1_eq_vbum2_then_la1 lda smc_release cmp smc_file_release - bne !__b243+ - jmp __b243 - !__b243: - // [163] phi from main::@166 main::@242 main::@243 main::@244 main::@74 to main::check_status_cx16_rom5 [phi:main::@166/main::@242/main::@243/main::@244/main::@74->main::check_status_cx16_rom5] + bne !__b253+ + jmp __b253 + !__b253: + // [172] phi from main::@174 main::@252 main::@253 main::@254 main::@78 to main::check_status_cx16_rom5 [phi:main::@174/main::@252/main::@253/main::@254/main::@78->main::check_status_cx16_rom5] // main::check_status_cx16_rom5 check_status_cx16_rom5: // main::check_status_cx16_rom5_check_status_rom1 // status_rom[rom_chip] == status - // [164] main::check_status_cx16_rom5_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vbom1=_deref_pbuc1_eq_vbuc2 + // [173] main::check_status_cx16_rom5_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vboaa=_deref_pbuc1_eq_vbuc2 lda status_rom eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_cx16_rom5_check_status_rom1_main__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [165] main::check_status_cx16_rom5_check_status_rom1_return#0 = (char)main::check_status_cx16_rom5_check_status_rom1_$0 - // [166] phi from main::check_status_cx16_rom5_check_status_rom1 to main::@75 [phi:main::check_status_cx16_rom5_check_status_rom1->main::@75] - // main::@75 + // [174] main::check_status_cx16_rom5_check_status_rom1_return#0 = (char)main::check_status_cx16_rom5_check_status_rom1_$0 -- vbuxx=vbuaa + tax + // [175] phi from main::check_status_cx16_rom5_check_status_rom1 to main::@79 [phi:main::check_status_cx16_rom5_check_status_rom1->main::@79] + // main::@79 // strncmp(&rom_github[0], &rom_file_github[0], 7) - // [167] call strncmp - // [1010] phi from main::@75 to strncmp [phi:main::@75->strncmp] + // [176] call strncmp + // [1081] phi from main::@79 to strncmp [phi:main::@79->strncmp] jsr strncmp // strncmp(&rom_github[0], &rom_file_github[0], 7) - // [168] strncmp::return#3 = strncmp::return#2 - // main::@164 - // [169] main::$43 = strncmp::return#3 -- vwsm1=vwsm2 + // [177] strncmp::return#3 = strncmp::return#2 + // main::@172 + // [178] main::$50 = strncmp::return#3 -- vwsm1=vwsm2 lda strncmp.return - sta main__43 + sta main__50 lda strncmp.return+1 - sta main__43+1 + sta main__50+1 // if(check_status_cx16_rom(STATUS_FLASH) && rom_release[0] == rom_file_release[0] && strncmp(&rom_github[0], &rom_file_github[0], 7) == 0) - // [170] if(0==main::check_status_cx16_rom5_check_status_rom1_return#0) goto main::check_status_smc8 -- 0_eq_vbum1_then_la1 - lda check_status_cx16_rom5_check_status_rom1_return + // [179] if(0==main::check_status_cx16_rom5_check_status_rom1_return#0) goto main::check_status_smc8 -- 0_eq_vbuxx_then_la1 + cpx #0 beq check_status_smc8 - // main::@246 - // [171] if(*rom_release!=*rom_file_release) goto main::check_status_smc8 -- _deref_pbuc1_neq__deref_pbuc2_then_la1 + // main::@256 + // [180] if(*rom_release!=*rom_file_release) goto main::check_status_smc8 -- _deref_pbuc1_neq__deref_pbuc2_then_la1 lda rom_release cmp rom_file_release bne check_status_smc8 - // main::@245 - // [172] if(main::$43==0) goto main::@13 -- vwsm1_eq_0_then_la1 - lda main__43 - ora main__43+1 - bne !__b13+ - jmp __b13 - !__b13: + // main::@255 + // [181] if(main::$50==0) goto main::@15 -- vwsm1_eq_0_then_la1 + lda main__50 + ora main__50+1 + bne !__b15+ + jmp __b15 + !__b15: // main::check_status_smc8 check_status_smc8: // status_smc == status - // [173] main::check_status_smc8_$0 = status_smc#122 == STATUS_ISSUE -- vbom1=vbum2_eq_vbuc1 + // [182] main::check_status_smc8_$0 = status_smc#147 == STATUS_ISSUE -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_ISSUE beq !+ lda #1 !: eor #1 - sta check_status_smc8_main__0 // return (unsigned char)(status_smc == status); - // [174] main::check_status_smc8_return#0 = (char)main::check_status_smc8_$0 + // [183] main::check_status_smc8_return#0 = (char)main::check_status_smc8_$0 -- vbuz1=vbuaa + sta.z check_status_smc8_return // main::check_status_vera1 // status_vera == status - // [175] main::check_status_vera1_$0 = status_vera#103 == STATUS_ISSUE -- vbom1=vbum2_eq_vbuc1 + // [184] main::check_status_vera1_$0 = status_vera#115 == STATUS_ISSUE -- vboaa=vbum1_eq_vbuc1 lda status_vera eor #STATUS_ISSUE beq !+ lda #1 !: eor #1 - sta check_status_vera1_main__0 // return (unsigned char)(status_vera == status); - // [176] main::check_status_vera1_return#0 = (char)main::check_status_vera1_$0 - // [177] phi from main::check_status_vera1 to main::@76 [phi:main::check_status_vera1->main::@76] - // main::@76 + // [185] main::check_status_vera1_return#0 = (char)main::check_status_vera1_$0 -- vbuz1=vbuaa + sta.z check_status_vera1_return + // [186] phi from main::check_status_vera1 to main::@80 [phi:main::check_status_vera1->main::@80] + // main::@80 // check_status_roms(STATUS_ISSUE) - // [178] call check_status_roms - // [1022] phi from main::@76 to check_status_roms [phi:main::@76->check_status_roms] - // [1022] phi check_status_roms::status#6 = STATUS_ISSUE [phi:main::@76->check_status_roms#0] -- vbum1=vbuc1 - lda #STATUS_ISSUE - sta check_status_roms.status + // [187] call check_status_roms + // [1093] phi from main::@80 to check_status_roms [phi:main::@80->check_status_roms] + // [1093] phi check_status_roms::status#6 = STATUS_ISSUE [phi:main::@80->check_status_roms#0] -- vbuxx=vbuc1 + ldx #STATUS_ISSUE jsr check_status_roms // check_status_roms(STATUS_ISSUE) - // [179] check_status_roms::return#3 = check_status_roms::return#2 - // main::@167 - // [180] main::$52 = check_status_roms::return#3 -- vbum1=vbum2 - lda check_status_roms.return - sta main__52 + // [188] check_status_roms::return#3 = check_status_roms::return#2 + // main::@175 + // [189] main::$59 = check_status_roms::return#3 -- vbum1=vbuaa + sta main__59 // main::check_status_smc9 // status_smc == status - // [181] main::check_status_smc9_$0 = status_smc#122 == STATUS_ERROR -- vbom1=vbum2_eq_vbuc1 + // [190] main::check_status_smc9_$0 = status_smc#147 == STATUS_ERROR -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_ERROR beq !+ lda #1 !: eor #1 - sta check_status_smc9_main__0 // return (unsigned char)(status_smc == status); - // [182] main::check_status_smc9_return#0 = (char)main::check_status_smc9_$0 + // [191] main::check_status_smc9_return#0 = (char)main::check_status_smc9_$0 -- vbum1=vbuaa + sta check_status_smc9_return // main::check_status_vera2 // status_vera == status - // [183] main::check_status_vera2_$0 = status_vera#103 == STATUS_ERROR -- vboz1=vbum2_eq_vbuc1 + // [192] main::check_status_vera2_$0 = status_vera#115 == STATUS_ERROR -- vboaa=vbum1_eq_vbuc1 lda status_vera eor #STATUS_ERROR beq !+ lda #1 !: eor #1 - sta.z check_status_vera2_main__0 // return (unsigned char)(status_vera == status); - // [184] main::check_status_vera2_return#0 = (char)main::check_status_vera2_$0 - // [185] phi from main::check_status_vera2 to main::@77 [phi:main::check_status_vera2->main::@77] - // main::@77 + // [193] main::check_status_vera2_return#0 = (char)main::check_status_vera2_$0 -- vbuz1=vbuaa + sta.z check_status_vera2_return + // [194] phi from main::check_status_vera2 to main::@81 [phi:main::check_status_vera2->main::@81] + // main::@81 // check_status_roms(STATUS_ERROR) - // [186] call check_status_roms - // [1022] phi from main::@77 to check_status_roms [phi:main::@77->check_status_roms] - // [1022] phi check_status_roms::status#6 = STATUS_ERROR [phi:main::@77->check_status_roms#0] -- vbum1=vbuc1 - lda #STATUS_ERROR - sta check_status_roms.status + // [195] call check_status_roms + // [1093] phi from main::@81 to check_status_roms [phi:main::@81->check_status_roms] + // [1093] phi check_status_roms::status#6 = STATUS_ERROR [phi:main::@81->check_status_roms#0] -- vbuxx=vbuc1 + ldx #STATUS_ERROR jsr check_status_roms // check_status_roms(STATUS_ERROR) - // [187] check_status_roms::return#4 = check_status_roms::return#2 - // main::@168 - // [188] main::$61 = check_status_roms::return#4 + // [196] check_status_roms::return#4 = check_status_roms::return#2 + // main::@176 + // [197] main::$68 = check_status_roms::return#4 -- vbuxx=vbuaa + tax // if(!check_status_smc(STATUS_ISSUE) && !check_status_vera(STATUS_ISSUE) && !check_status_roms(STATUS_ISSUE) && // !check_status_smc(STATUS_ERROR) && !check_status_vera(STATUS_ERROR) && !check_status_roms(STATUS_ERROR)) - // [189] if(0!=main::check_status_smc8_return#0) goto main::check_status_vera3 -- 0_neq_vbum1_then_la1 - lda check_status_smc8_return + // [198] if(0!=main::check_status_smc8_return#0) goto main::check_status_vera3 -- 0_neq_vbuz1_then_la1 + lda.z check_status_smc8_return bne check_status_vera3 - // main::@251 - // [190] if(0==main::check_status_vera1_return#0) goto main::@250 -- 0_eq_vbum1_then_la1 - lda check_status_vera1_return - bne !__b250+ - jmp __b250 - !__b250: + // main::@261 + // [199] if(0==main::check_status_vera1_return#0) goto main::@260 -- 0_eq_vbuz1_then_la1 + lda.z check_status_vera1_return + bne !__b260+ + jmp __b260 + !__b260: // main::check_status_vera3 check_status_vera3: // status_vera == status - // [191] main::check_status_vera3_$0 = status_vera#103 == STATUS_ERROR -- vboz1=vbum2_eq_vbuc1 + // [200] main::check_status_vera3_$0 = status_vera#115 == STATUS_ERROR -- vboaa=vbum1_eq_vbuc1 lda status_vera eor #STATUS_ERROR beq !+ lda #1 !: eor #1 - sta.z check_status_vera3_main__0 // return (unsigned char)(status_vera == status); - // [192] main::check_status_vera3_return#0 = (char)main::check_status_vera3_$0 - // main::@78 + // [201] main::check_status_vera3_return#0 = (char)main::check_status_vera3_$0 + // main::@82 // if(check_status_vera(STATUS_ERROR)) - // [193] if(0==main::check_status_vera3_return#0) goto main::check_status_smc14 -- 0_eq_vbuz1_then_la1 - lda.z check_status_vera3_return + // [202] if(0==main::check_status_vera3_return#0) goto main::check_status_smc14 -- 0_eq_vbuaa_then_la1 + cmp #0 bne !check_status_smc14+ jmp check_status_smc14 !check_status_smc14: - // main::bank_set_brom6 + // main::bank_set_brom10 // BROM = bank - // [194] BROM = main::bank_set_brom6_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom6_bank + // [203] BROM = main::bank_set_brom10_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom10_bank sta.z BROM - // main::CLI2 + // main::CLI4 // asm // asm { cli } cli // main::vera_display_set_border_color1 // *VERA_CTRL &= ~VERA_DCSEL - // [196] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [205] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_DCSEL^$ff and VERA_CTRL sta VERA_CTRL // *VERA_DC_BORDER = color - // [197] *VERA_DC_BORDER = RED -- _deref_pbuc1=vbuc2 + // [206] *VERA_DC_BORDER = RED -- _deref_pbuc1=vbuc2 lda #RED sta VERA_DC_BORDER - // [198] phi from main::vera_display_set_border_color1 to main::@85 [phi:main::vera_display_set_border_color1->main::@85] - // main::@85 + // [207] phi from main::vera_display_set_border_color1 to main::@92 [phi:main::vera_display_set_border_color1->main::@92] + // main::@92 // textcolor(WHITE) - // [199] call textcolor - // [760] phi from main::@85 to textcolor [phi:main::@85->textcolor] - // [760] phi textcolor::color#23 = WHITE [phi:main::@85->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color + // [208] call textcolor + // [787] phi from main::@92 to textcolor [phi:main::@92->textcolor] + // [787] phi textcolor::color#23 = WHITE [phi:main::@92->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor - // [200] phi from main::@85 to main::@203 [phi:main::@85->main::@203] - // main::@203 + // [209] phi from main::@92 to main::@211 [phi:main::@92->main::@211] + // main::@211 // bgcolor(BLUE) - // [201] call bgcolor - // [765] phi from main::@203 to bgcolor [phi:main::@203->bgcolor] - // [765] phi bgcolor::color#15 = BLUE [phi:main::@203->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color + // [210] call bgcolor + // [792] phi from main::@211 to bgcolor [phi:main::@211->bgcolor] + // [792] phi bgcolor::color#15 = BLUE [phi:main::@211->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor - // [202] phi from main::@203 to main::@204 [phi:main::@203->main::@204] - // main::@204 + // [211] phi from main::@211 to main::@212 [phi:main::@211->main::@212] + // main::@212 // clrscr() - // [203] call clrscr + // [212] call clrscr jsr clrscr - // [204] phi from main::@204 to main::@205 [phi:main::@204->main::@205] - // main::@205 + // [213] phi from main::@212 to main::@213 [phi:main::@212->main::@213] + // main::@213 // printf("There was a severe error updating your VERA!") - // [205] call printf_str - // [1054] phi from main::@205 to printf_str [phi:main::@205->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:main::@205->printf_str#0] -- pprz1=pprc1 + // [214] call printf_str + // [1125] phi from main::@213 to printf_str [phi:main::@213->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:main::@213->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s13 [phi:main::@205->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s13 [phi:main::@213->printf_str#1] -- pbuz1=pbuc1 lda #s13 sta.z printf_str.s+1 jsr printf_str - // [206] phi from main::@205 to main::@206 [phi:main::@205->main::@206] - // main::@206 + // [215] phi from main::@213 to main::@214 [phi:main::@213->main::@214] + // main::@214 // printf("You are back at the READY prompt without resetting your CX16.\n\n") - // [207] call printf_str - // [1054] phi from main::@206 to printf_str [phi:main::@206->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:main::@206->printf_str#0] -- pprz1=pprc1 + // [216] call printf_str + // [1125] phi from main::@214 to printf_str [phi:main::@214->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:main::@214->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s14 [phi:main::@206->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s14 [phi:main::@214->printf_str#1] -- pbuz1=pbuc1 lda #s14 sta.z printf_str.s+1 jsr printf_str - // [208] phi from main::@206 to main::@207 [phi:main::@206->main::@207] - // main::@207 + // [217] phi from main::@214 to main::@215 [phi:main::@214->main::@215] + // main::@215 // printf("Please don't reset or shut down your VERA until you've\n") - // [209] call printf_str - // [1054] phi from main::@207 to printf_str [phi:main::@207->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:main::@207->printf_str#0] -- pprz1=pprc1 + // [218] call printf_str + // [1125] phi from main::@215 to printf_str [phi:main::@215->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:main::@215->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s15 [phi:main::@207->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s15 [phi:main::@215->printf_str#1] -- pbuz1=pbuc1 lda #s15 sta.z printf_str.s+1 jsr printf_str - // [210] phi from main::@207 to main::@208 [phi:main::@207->main::@208] - // main::@208 + // [219] phi from main::@215 to main::@216 [phi:main::@215->main::@216] + // main::@216 // printf("managed to either reflash your VERA with the previous firmware ") - // [211] call printf_str - // [1054] phi from main::@208 to printf_str [phi:main::@208->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:main::@208->printf_str#0] -- pprz1=pprc1 + // [220] call printf_str + // [1125] phi from main::@216 to printf_str [phi:main::@216->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:main::@216->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s16 [phi:main::@208->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s16 [phi:main::@216->printf_str#1] -- pbuz1=pbuc1 lda #s16 sta.z printf_str.s+1 jsr printf_str - // [212] phi from main::@208 to main::@209 [phi:main::@208->main::@209] - // main::@209 + // [221] phi from main::@216 to main::@217 [phi:main::@216->main::@217] + // main::@217 // printf("or have update successs retrying!\n\n") - // [213] call printf_str - // [1054] phi from main::@209 to printf_str [phi:main::@209->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:main::@209->printf_str#0] -- pprz1=pprc1 + // [222] call printf_str + // [1125] phi from main::@217 to printf_str [phi:main::@217->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:main::@217->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s17 [phi:main::@209->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s17 [phi:main::@217->printf_str#1] -- pbuz1=pbuc1 lda #s17 sta.z printf_str.s+1 jsr printf_str - // [214] phi from main::@209 to main::@210 [phi:main::@209->main::@210] - // main::@210 + // [223] phi from main::@217 to main::@218 [phi:main::@217->main::@218] + // main::@218 // printf("PLEASE REMOVE THE JP1 JUMPER OR YOUR SDCARD WON'T WORK!\n") - // [215] call printf_str - // [1054] phi from main::@210 to printf_str [phi:main::@210->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:main::@210->printf_str#0] -- pprz1=pprc1 + // [224] call printf_str + // [1125] phi from main::@218 to printf_str [phi:main::@218->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:main::@218->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s18 [phi:main::@210->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s18 [phi:main::@218->printf_str#1] -- pbuz1=pbuc1 lda #s18 sta.z printf_str.s+1 jsr printf_str - // [216] phi from main::@210 to main::@211 [phi:main::@210->main::@211] - // main::@211 + // [225] phi from main::@218 to main::@219 [phi:main::@218->main::@219] + // main::@219 // wait_moment(32) - // [217] call wait_moment - // [1063] phi from main::@211 to wait_moment [phi:main::@211->wait_moment] - // [1063] phi wait_moment::w#7 = $20 [phi:main::@211->wait_moment#0] -- vbum1=vbuc1 + // [226] call wait_moment + // [1134] phi from main::@219 to wait_moment [phi:main::@219->wait_moment] + // [1134] phi wait_moment::w#17 = $20 [phi:main::@219->wait_moment#0] -- vbuz1=vbuc1 lda #$20 - sta wait_moment.w + sta.z wait_moment.w jsr wait_moment - // [218] phi from main::@211 to main::@212 [phi:main::@211->main::@212] - // main::@212 + // [227] phi from main::@219 to main::@220 [phi:main::@219->main::@220] + // main::@220 // system_reset() - // [219] call system_reset - // [1071] phi from main::@212 to system_reset [phi:main::@212->system_reset] + // [228] call system_reset + // [1142] phi from main::@220 to system_reset [phi:main::@220->system_reset] jsr system_reset // main::@return // } - // [220] return + // [229] return rts // main::check_status_smc14 check_status_smc14: // status_smc == status - // [221] main::check_status_smc14_$0 = status_smc#122 == STATUS_SKIP -- vboz1=vbum2_eq_vbuc1 + // [230] main::check_status_smc14_$0 = status_smc#147 == STATUS_SKIP -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_SKIP beq !+ lda #1 !: eor #1 - sta.z check_status_smc14_main__0 // return (unsigned char)(status_smc == status); - // [222] main::check_status_smc14_return#0 = (char)main::check_status_smc14_$0 + // [231] main::check_status_smc14_return#0 = (char)main::check_status_smc14_$0 -- vbuz1=vbuaa + sta.z check_status_smc14_return // main::check_status_smc15 // status_smc == status - // [223] main::check_status_smc15_$0 = status_smc#122 == STATUS_NONE -- vboz1=vbum2_eq_vbuc1 + // [232] main::check_status_smc15_$0 = status_smc#147 == STATUS_NONE -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_NONE beq !+ lda #1 !: eor #1 - sta.z check_status_smc15_main__0 // return (unsigned char)(status_smc == status); - // [224] main::check_status_smc15_return#0 = (char)main::check_status_smc15_$0 - // main::check_status_vera5 + // [233] main::check_status_smc15_return#0 = (char)main::check_status_smc15_$0 -- vbuz1=vbuaa + sta.z check_status_smc15_return + // main::check_status_vera8 // status_vera == status - // [225] main::check_status_vera5_$0 = status_vera#103 == STATUS_SKIP -- vboz1=vbum2_eq_vbuc1 + // [234] main::check_status_vera8_$0 = status_vera#115 == STATUS_SKIP -- vboaa=vbum1_eq_vbuc1 lda status_vera eor #STATUS_SKIP beq !+ lda #1 !: eor #1 - sta.z check_status_vera5_main__0 // return (unsigned char)(status_vera == status); - // [226] main::check_status_vera5_return#0 = (char)main::check_status_vera5_$0 - // main::check_status_vera6 + // [235] main::check_status_vera8_return#0 = (char)main::check_status_vera8_$0 -- vbuz1=vbuaa + sta.z check_status_vera8_return + // main::check_status_vera9 // status_vera == status - // [227] main::check_status_vera6_$0 = status_vera#103 == STATUS_NONE -- vbom1=vbum2_eq_vbuc1 + // [236] main::check_status_vera9_$0 = status_vera#115 == STATUS_NONE -- vboaa=vbum1_eq_vbuc1 lda status_vera eor #STATUS_NONE beq !+ lda #1 !: eor #1 - sta check_status_vera6_main__0 // return (unsigned char)(status_vera == status); - // [228] main::check_status_vera6_return#0 = (char)main::check_status_vera6_$0 - // [229] phi from main::check_status_vera6 to main::@84 [phi:main::check_status_vera6->main::@84] - // main::@84 + // [237] main::check_status_vera9_return#0 = (char)main::check_status_vera9_$0 -- vbuyy=vbuaa + tay + // [238] phi from main::check_status_vera9 to main::@91 [phi:main::check_status_vera9->main::@91] + // main::@91 // check_status_roms_less(STATUS_SKIP) - // [230] call check_status_roms_less - // [1076] phi from main::@84 to check_status_roms_less [phi:main::@84->check_status_roms_less] + // [239] call check_status_roms_less + // [1147] phi from main::@91 to check_status_roms_less [phi:main::@91->check_status_roms_less] jsr check_status_roms_less // check_status_roms_less(STATUS_SKIP) - // [231] check_status_roms_less::return#3 = check_status_roms_less::return#2 - // main::@202 - // [232] main::$74 = check_status_roms_less::return#3 + // [240] check_status_roms_less::return#3 = check_status_roms_less::return#2 + // main::@210 + // [241] main::$81 = check_status_roms_less::return#3 -- vbuxx=vbuaa + tax // if((check_status_smc(STATUS_SKIP) || check_status_smc(STATUS_NONE)) && // (check_status_vera(STATUS_SKIP) || check_status_vera(STATUS_NONE)) && // (check_status_roms_less(STATUS_SKIP)) ) - // [233] if(0!=main::check_status_smc14_return#0) goto main::@259 -- 0_neq_vbuz1_then_la1 + // [242] if(0!=main::check_status_smc14_return#0) goto main::@269 -- 0_neq_vbuz1_then_la1 lda.z check_status_smc14_return - beq !__b259+ - jmp __b259 - !__b259: - // main::@260 - // [234] if(0!=main::check_status_smc15_return#0) goto main::@259 -- 0_neq_vbuz1_then_la1 + beq !__b269+ + jmp __b269 + !__b269: + // main::@270 + // [243] if(0!=main::check_status_smc15_return#0) goto main::@269 -- 0_neq_vbuz1_then_la1 lda.z check_status_smc15_return - beq !__b259+ - jmp __b259 - !__b259: + beq !__b269+ + jmp __b269 + !__b269: // main::check_status_smc16 check_status_smc16: // status_smc == status - // [235] main::check_status_smc16_$0 = status_smc#122 == STATUS_ERROR -- vboz1=vbum2_eq_vbuc1 + // [244] main::check_status_smc16_$0 = status_smc#147 == STATUS_ERROR -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_ERROR beq !+ lda #1 !: eor #1 - sta.z check_status_smc16_main__0 // return (unsigned char)(status_smc == status); - // [236] main::check_status_smc16_return#0 = (char)main::check_status_smc16_$0 - // main::check_status_vera7 + // [245] main::check_status_smc16_return#0 = (char)main::check_status_smc16_$0 -- vbum1=vbuaa + sta check_status_smc16_return + // main::check_status_vera10 // status_vera == status - // [237] main::check_status_vera7_$0 = status_vera#103 == STATUS_ERROR -- vboz1=vbum2_eq_vbuc1 + // [246] main::check_status_vera10_$0 = status_vera#115 == STATUS_ERROR -- vboaa=vbum1_eq_vbuc1 lda status_vera eor #STATUS_ERROR beq !+ lda #1 !: eor #1 - sta.z check_status_vera7_main__0 // return (unsigned char)(status_vera == status); - // [238] main::check_status_vera7_return#0 = (char)main::check_status_vera7_$0 - // [239] phi from main::check_status_vera7 to main::@87 [phi:main::check_status_vera7->main::@87] - // main::@87 + // [247] main::check_status_vera10_return#0 = (char)main::check_status_vera10_$0 -- vbum1=vbuaa + sta check_status_vera10_return + // [248] phi from main::check_status_vera10 to main::@94 [phi:main::check_status_vera10->main::@94] + // main::@94 // check_status_roms(STATUS_ERROR) - // [240] call check_status_roms - // [1022] phi from main::@87 to check_status_roms [phi:main::@87->check_status_roms] - // [1022] phi check_status_roms::status#6 = STATUS_ERROR [phi:main::@87->check_status_roms#0] -- vbum1=vbuc1 - lda #STATUS_ERROR - sta check_status_roms.status + // [249] call check_status_roms + // [1093] phi from main::@94 to check_status_roms [phi:main::@94->check_status_roms] + // [1093] phi check_status_roms::status#6 = STATUS_ERROR [phi:main::@94->check_status_roms#0] -- vbuxx=vbuc1 + ldx #STATUS_ERROR jsr check_status_roms // check_status_roms(STATUS_ERROR) - // [241] check_status_roms::return#10 = check_status_roms::return#2 - // main::@213 - // [242] main::$262 = check_status_roms::return#10 + // [250] check_status_roms::return#10 = check_status_roms::return#2 + // main::@221 + // [251] main::$281 = check_status_roms::return#10 -- vbuxx=vbuaa + tax // if(check_status_smc(STATUS_ERROR) || check_status_vera(STATUS_ERROR) || check_status_roms(STATUS_ERROR)) - // [243] if(0!=main::check_status_smc16_return#0) goto main::vera_display_set_border_color3 -- 0_neq_vbuz1_then_la1 - lda.z check_status_smc16_return + // [252] if(0!=main::check_status_smc16_return#0) goto main::vera_display_set_border_color3 -- 0_neq_vbum1_then_la1 + lda check_status_smc16_return beq !vera_display_set_border_color3+ jmp vera_display_set_border_color3 !vera_display_set_border_color3: - // main::@262 - // [244] if(0!=main::check_status_vera7_return#0) goto main::vera_display_set_border_color3 -- 0_neq_vbuz1_then_la1 - lda.z check_status_vera7_return + // main::@272 + // [253] if(0!=main::check_status_vera10_return#0) goto main::vera_display_set_border_color3 -- 0_neq_vbum1_then_la1 + lda check_status_vera10_return beq !vera_display_set_border_color3+ jmp vera_display_set_border_color3 !vera_display_set_border_color3: - // main::@261 - // [245] if(0!=main::$262) goto main::vera_display_set_border_color3 -- 0_neq_vbum1_then_la1 - lda main__262 + // main::@271 + // [254] if(0!=main::$281) goto main::vera_display_set_border_color3 -- 0_neq_vbuxx_then_la1 + cpx #0 beq !vera_display_set_border_color3+ jmp vera_display_set_border_color3 !vera_display_set_border_color3: // main::check_status_smc17 // status_smc == status - // [246] main::check_status_smc17_$0 = status_smc#122 == STATUS_ISSUE -- vboz1=vbum2_eq_vbuc1 + // [255] main::check_status_smc17_$0 = status_smc#147 == STATUS_ISSUE -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_ISSUE beq !+ lda #1 !: eor #1 - sta.z check_status_smc17_main__0 // return (unsigned char)(status_smc == status); - // [247] main::check_status_smc17_return#0 = (char)main::check_status_smc17_$0 - // main::check_status_vera8 + // [256] main::check_status_smc17_return#0 = (char)main::check_status_smc17_$0 -- vbum1=vbuaa + sta check_status_smc17_return + // main::check_status_vera11 // status_vera == status - // [248] main::check_status_vera8_$0 = status_vera#103 == STATUS_ISSUE -- vboz1=vbum2_eq_vbuc1 + // [257] main::check_status_vera11_$0 = status_vera#115 == STATUS_ISSUE -- vboaa=vbum1_eq_vbuc1 lda status_vera eor #STATUS_ISSUE beq !+ lda #1 !: eor #1 - sta.z check_status_vera8_main__0 // return (unsigned char)(status_vera == status); - // [249] main::check_status_vera8_return#0 = (char)main::check_status_vera8_$0 - // [250] phi from main::check_status_vera8 to main::@89 [phi:main::check_status_vera8->main::@89] - // main::@89 + // [258] main::check_status_vera11_return#0 = (char)main::check_status_vera11_$0 -- vbum1=vbuaa + sta check_status_vera11_return + // [259] phi from main::check_status_vera11 to main::@96 [phi:main::check_status_vera11->main::@96] + // main::@96 // check_status_roms(STATUS_ISSUE) - // [251] call check_status_roms - // [1022] phi from main::@89 to check_status_roms [phi:main::@89->check_status_roms] - // [1022] phi check_status_roms::status#6 = STATUS_ISSUE [phi:main::@89->check_status_roms#0] -- vbum1=vbuc1 - lda #STATUS_ISSUE - sta check_status_roms.status + // [260] call check_status_roms + // [1093] phi from main::@96 to check_status_roms [phi:main::@96->check_status_roms] + // [1093] phi check_status_roms::status#6 = STATUS_ISSUE [phi:main::@96->check_status_roms#0] -- vbuxx=vbuc1 + ldx #STATUS_ISSUE jsr check_status_roms // check_status_roms(STATUS_ISSUE) - // [252] check_status_roms::return#11 = check_status_roms::return#2 - // main::@215 - // [253] main::$267 = check_status_roms::return#11 + // [261] check_status_roms::return#11 = check_status_roms::return#2 + // main::@225 + // [262] main::$286 = check_status_roms::return#11 -- vbuxx=vbuaa + tax // if(check_status_smc(STATUS_ISSUE) || check_status_vera(STATUS_ISSUE) || check_status_roms(STATUS_ISSUE)) - // [254] if(0!=main::check_status_smc17_return#0) goto main::vera_display_set_border_color4 -- 0_neq_vbuz1_then_la1 - lda.z check_status_smc17_return + // [263] if(0!=main::check_status_smc17_return#0) goto main::vera_display_set_border_color4 -- 0_neq_vbum1_then_la1 + lda check_status_smc17_return beq !vera_display_set_border_color4+ jmp vera_display_set_border_color4 !vera_display_set_border_color4: - // main::@264 - // [255] if(0!=main::check_status_vera8_return#0) goto main::vera_display_set_border_color4 -- 0_neq_vbuz1_then_la1 - lda.z check_status_vera8_return + // main::@274 + // [264] if(0!=main::check_status_vera11_return#0) goto main::vera_display_set_border_color4 -- 0_neq_vbum1_then_la1 + lda check_status_vera11_return beq !vera_display_set_border_color4+ jmp vera_display_set_border_color4 !vera_display_set_border_color4: - // main::@263 - // [256] if(0!=main::$267) goto main::vera_display_set_border_color4 -- 0_neq_vbum1_then_la1 - lda main__267 + // main::@273 + // [265] if(0!=main::$286) goto main::vera_display_set_border_color4 -- 0_neq_vbuxx_then_la1 + cpx #0 beq !vera_display_set_border_color4+ jmp vera_display_set_border_color4 !vera_display_set_border_color4: // main::vera_display_set_border_color5 // *VERA_CTRL &= ~VERA_DCSEL - // [257] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [266] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_DCSEL^$ff and VERA_CTRL sta VERA_CTRL // *VERA_DC_BORDER = color - // [258] *VERA_DC_BORDER = GREEN -- _deref_pbuc1=vbuc2 + // [267] *VERA_DC_BORDER = GREEN -- _deref_pbuc1=vbuc2 lda #GREEN sta VERA_DC_BORDER - // [259] phi from main::vera_display_set_border_color5 to main::@91 [phi:main::vera_display_set_border_color5->main::@91] - // main::@91 + // [268] phi from main::vera_display_set_border_color5 to main::@98 [phi:main::vera_display_set_border_color5->main::@98] + // main::@98 // display_action_progress("Your CX16 update is a success!") - // [260] call display_action_progress - // [1084] phi from main::@91 to display_action_progress [phi:main::@91->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = main::info_text44 [phi:main::@91->display_action_progress#0] -- pbuz1=pbuc1 - lda #display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main::info_text43 [phi:main::@98->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text44 + lda #>info_text43 sta.z display_action_progress.info_text+1 jsr display_action_progress // main::check_status_smc18 // status_smc == status - // [261] main::check_status_smc18_$0 = status_smc#122 == STATUS_FLASHED -- vbom1=vbum2_eq_vbuc1 + // [270] main::check_status_smc18_$0 = status_smc#147 == STATUS_FLASHED -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_FLASHED beq !+ lda #1 !: eor #1 - sta check_status_smc18_main__0 // return (unsigned char)(status_smc == status); - // [262] main::check_status_smc18_return#0 = (char)main::check_status_smc18_$0 - // main::@92 + // [271] main::check_status_smc18_return#0 = (char)main::check_status_smc18_$0 + // main::@99 // if(check_status_smc(STATUS_FLASHED)) - // [263] if(0!=main::check_status_smc18_return#0) goto main::@55 -- 0_neq_vbum1_then_la1 - lda check_status_smc18_return - beq !__b55+ - jmp __b55 - !__b55: - // [264] phi from main::@92 to main::@16 [phi:main::@92->main::@16] - // main::@16 + // [272] if(0!=main::check_status_smc18_return#0) goto main::@58 -- 0_neq_vbuaa_then_la1 + cmp #0 + beq !__b58+ + jmp __b58 + !__b58: + // [273] phi from main::@99 to main::@18 [phi:main::@99->main::@18] + // main::@18 // display_progress_text(display_debriefing_text_rom, display_debriefing_count_rom) - // [265] call display_progress_text - // [1098] phi from main::@16 to display_progress_text [phi:main::@16->display_progress_text] - // [1098] phi display_progress_text::text#12 = display_debriefing_text_rom [phi:main::@16->display_progress_text#0] -- qbuz1=qbuc1 + // [274] call display_progress_text + // [1169] phi from main::@18 to display_progress_text [phi:main::@18->display_progress_text] + // [1169] phi display_progress_text::text#13 = display_debriefing_text_rom [phi:main::@18->display_progress_text#0] -- qbuz1=qbuc1 lda #display_debriefing_text_rom sta.z display_progress_text.text+1 - // [1098] phi display_progress_text::lines#11 = display_debriefing_count_rom [phi:main::@16->display_progress_text#1] -- vbum1=vbuc1 + // [1169] phi display_progress_text::lines#12 = display_debriefing_count_rom [phi:main::@18->display_progress_text#1] -- vbuz1=vbuc1 lda #display_debriefing_count_rom - sta display_progress_text.lines + sta.z display_progress_text.lines jsr display_progress_text - // [266] phi from main::@16 main::@86 main::@90 to main::@3 [phi:main::@16/main::@86/main::@90->main::@3] - // main::@3 - __b3: + // [275] phi from main::@18 main::@93 main::@97 to main::@5 [phi:main::@18/main::@93/main::@97->main::@5] + // main::@5 + __b5: // textcolor(PINK) - // [267] call textcolor + // [276] call textcolor // DE6 | Wait until reset - // [760] phi from main::@3 to textcolor [phi:main::@3->textcolor] - // [760] phi textcolor::color#23 = PINK [phi:main::@3->textcolor#0] -- vbum1=vbuc1 - lda #PINK - sta textcolor.color + // [787] phi from main::@5 to textcolor [phi:main::@5->textcolor] + // [787] phi textcolor::color#23 = PINK [phi:main::@5->textcolor#0] -- vbuxx=vbuc1 + ldx #PINK jsr textcolor - // [268] phi from main::@3 to main::@228 [phi:main::@3->main::@228] - // main::@228 + // [277] phi from main::@5 to main::@238 [phi:main::@5->main::@238] + // main::@238 // display_progress_line(2, "DON'T DO ANYTHING UNTIL COUNTDOWN FINISHES!") - // [269] call display_progress_line - // [1108] phi from main::@228 to display_progress_line [phi:main::@228->display_progress_line] - // [1108] phi display_progress_line::text#3 = main::text [phi:main::@228->display_progress_line#0] -- pbuz1=pbuc1 + // [278] call display_progress_line + // [1179] phi from main::@238 to display_progress_line [phi:main::@238->display_progress_line] + // [1179] phi display_progress_line::text#3 = main::text [phi:main::@238->display_progress_line#0] -- pbuz1=pbuc1 lda #text sta.z display_progress_line.text+1 - // [1108] phi display_progress_line::line#3 = 2 [phi:main::@228->display_progress_line#1] -- vbuz1=vbuc1 - lda #2 - sta.z display_progress_line.line + // [1179] phi display_progress_line::line#3 = 2 [phi:main::@238->display_progress_line#1] -- vbuxx=vbuc1 + ldx #2 jsr display_progress_line - // [270] phi from main::@228 to main::@229 [phi:main::@228->main::@229] - // main::@229 + // [279] phi from main::@238 to main::@239 [phi:main::@238->main::@239] + // main::@239 // textcolor(WHITE) - // [271] call textcolor - // [760] phi from main::@229 to textcolor [phi:main::@229->textcolor] - // [760] phi textcolor::color#23 = WHITE [phi:main::@229->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color + // [280] call textcolor + // [787] phi from main::@239 to textcolor [phi:main::@239->textcolor] + // [787] phi textcolor::color#23 = WHITE [phi:main::@239->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor - // [272] phi from main::@229 to main::@63 [phi:main::@229->main::@63] - // [272] phi main::w1#2 = $78 [phi:main::@229->main::@63#0] -- vbum1=vbuc1 + // [281] phi from main::@239 to main::@66 [phi:main::@239->main::@66] + // [281] phi main::w1#2 = $78 [phi:main::@239->main::@66#0] -- vbum1=vbuc1 lda #$78 sta w1 - // main::@63 - __b63: + // main::@66 + __b66: // for (unsigned char w=120; w>0; w--) - // [273] if(main::w1#2>0) goto main::@64 -- vbum1_gt_0_then_la1 + // [282] if(main::w1#2>0) goto main::@67 -- vbum1_gt_0_then_la1 lda w1 - bne __b64 - // [274] phi from main::@63 to main::@65 [phi:main::@63->main::@65] - // main::@65 + bne __b67 + // [283] phi from main::@66 to main::@68 [phi:main::@66->main::@68] + // main::@68 // system_reset() - // [275] call system_reset - // [1071] phi from main::@65 to system_reset [phi:main::@65->system_reset] + // [284] call system_reset + // [1142] phi from main::@68 to system_reset [phi:main::@68->system_reset] jsr system_reset rts - // [276] phi from main::@63 to main::@64 [phi:main::@63->main::@64] - // main::@64 - __b64: + // [285] phi from main::@66 to main::@67 [phi:main::@66->main::@67] + // main::@67 + __b67: // wait_moment(1) - // [277] call wait_moment - // [1063] phi from main::@64 to wait_moment [phi:main::@64->wait_moment] - // [1063] phi wait_moment::w#7 = 1 [phi:main::@64->wait_moment#0] -- vbum1=vbuc1 + // [286] call wait_moment + // [1134] phi from main::@67 to wait_moment [phi:main::@67->wait_moment] + // [1134] phi wait_moment::w#17 = 1 [phi:main::@67->wait_moment#0] -- vbuz1=vbuc1 lda #1 - sta wait_moment.w + sta.z wait_moment.w jsr wait_moment - // [278] phi from main::@64 to main::@230 [phi:main::@64->main::@230] - // main::@230 + // [287] phi from main::@67 to main::@240 [phi:main::@67->main::@240] + // main::@240 // sprintf(info_text, "(%u) Your CX16 will reset after countdown ...", w) - // [279] call snprintf_init - // [1113] phi from main::@230 to snprintf_init [phi:main::@230->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:main::@230->snprintf_init#0] -- pbuz1=pbuc1 + // [288] call snprintf_init + // [1184] phi from main::@240 to snprintf_init [phi:main::@240->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:main::@240->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [280] phi from main::@230 to main::@231 [phi:main::@230->main::@231] - // main::@231 + // [289] phi from main::@240 to main::@241 [phi:main::@240->main::@241] + // main::@241 // sprintf(info_text, "(%u) Your CX16 will reset after countdown ...", w) - // [281] call printf_str - // [1054] phi from main::@231 to printf_str [phi:main::@231->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@231->printf_str#0] -- pprz1=pprc1 + // [290] call printf_str + // [1125] phi from main::@241 to printf_str [phi:main::@241->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@241->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s22 [phi:main::@231->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s22 [phi:main::@241->printf_str#1] -- pbuz1=pbuc1 lda #s22 sta.z printf_str.s+1 jsr printf_str - // main::@232 + // main::@242 // sprintf(info_text, "(%u) Your CX16 will reset after countdown ...", w) - // [282] printf_uchar::uvalue#16 = main::w1#2 -- vbum1=vbum2 - lda w1 - sta printf_uchar.uvalue - // [283] call printf_uchar - // [1118] phi from main::@232 to printf_uchar [phi:main::@232->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 0 [phi:main::@232->printf_uchar#0] -- vbum1=vbuc1 + // [291] printf_uchar::uvalue#14 = main::w1#2 -- vbuxx=vbum1 + ldx w1 + // [292] call printf_uchar + // [1189] phi from main::@242 to printf_uchar [phi:main::@242->printf_uchar] + // [1189] phi printf_uchar::format_zero_padding#15 = 0 [phi:main::@242->printf_uchar#0] -- vbum1=vbuc1 lda #0 sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 0 [phi:main::@232->printf_uchar#1] -- vbum1=vbuc1 + // [1189] phi printf_uchar::format_min_length#15 = 0 [phi:main::@242->printf_uchar#1] -- vbum1=vbuc1 sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &snputc [phi:main::@232->printf_uchar#2] -- pprz1=pprc1 + // [1189] phi printf_uchar::putc#15 = &snputc [phi:main::@242->printf_uchar#2] -- pprz1=pprc1 lda #snputc sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = DECIMAL [phi:main::@232->printf_uchar#3] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = printf_uchar::uvalue#16 [phi:main::@232->printf_uchar#4] -- register_copy + // [1189] phi printf_uchar::format_radix#15 = DECIMAL [phi:main::@242->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL + // [1189] phi printf_uchar::uvalue#15 = printf_uchar::uvalue#14 [phi:main::@242->printf_uchar#4] -- register_copy jsr printf_uchar - // [284] phi from main::@232 to main::@233 [phi:main::@232->main::@233] - // main::@233 + // [293] phi from main::@242 to main::@243 [phi:main::@242->main::@243] + // main::@243 // sprintf(info_text, "(%u) Your CX16 will reset after countdown ...", w) - // [285] call printf_str - // [1054] phi from main::@233 to printf_str [phi:main::@233->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@233->printf_str#0] -- pprz1=pprc1 + // [294] call printf_str + // [1125] phi from main::@243 to printf_str [phi:main::@243->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@243->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s23 [phi:main::@233->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s23 [phi:main::@243->printf_str#1] -- pbuz1=pbuc1 lda #s23 sta.z printf_str.s+1 jsr printf_str - // main::@234 + // main::@244 // sprintf(info_text, "(%u) Your CX16 will reset after countdown ...", w) - // [286] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [295] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [287] callexecute snputc -- call_vprc1 + // [296] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [289] call display_action_text - // [1129] phi from main::@234 to display_action_text [phi:main::@234->display_action_text] - // [1129] phi display_action_text::info_text#17 = info_text [phi:main::@234->display_action_text#0] -- pbuz1=pbuc1 + // [298] call display_action_text + // [1200] phi from main::@244 to display_action_text [phi:main::@244->display_action_text] + // [1200] phi display_action_text::info_text#25 = info_text [phi:main::@244->display_action_text#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_action_text.info_text lda #>@info_text sta.z display_action_text.info_text+1 jsr display_action_text - // main::@235 + // main::@245 // for (unsigned char w=120; w>0; w--) - // [290] main::w1#1 = -- main::w1#2 -- vbum1=_dec_vbum1 + // [299] main::w1#1 = -- main::w1#2 -- vbum1=_dec_vbum1 dec w1 - // [272] phi from main::@235 to main::@63 [phi:main::@235->main::@63] - // [272] phi main::w1#2 = main::w1#1 [phi:main::@235->main::@63#0] -- register_copy - jmp __b63 - // main::@55 - __b55: + // [281] phi from main::@245 to main::@66 [phi:main::@245->main::@66] + // [281] phi main::w1#2 = main::w1#1 [phi:main::@245->main::@66#0] -- register_copy + jmp __b66 + // main::@58 + __b58: // if(smc_bootloader == 1) - // [291] if(smc_bootloader#0!=1) goto main::@56 -- vwum1_neq_vbuc1_then_la1 + // [300] if(smc_bootloader#0!=1) goto main::@59 -- vwum1_neq_vbuc1_then_la1 lda smc_bootloader+1 - bne __b56 + bne __b59 lda smc_bootloader cmp #1 - bne __b56 - // [292] phi from main::@55 to main::@61 [phi:main::@55->main::@61] - // main::@61 + bne __b59 + // [301] phi from main::@58 to main::@64 [phi:main::@58->main::@64] + // main::@64 // smc_reset() - // [293] call smc_reset - // [1143] phi from main::@61 to smc_reset [phi:main::@61->smc_reset] + // [302] call smc_reset + // [1214] phi from main::@64 to smc_reset [phi:main::@64->smc_reset] jsr smc_reset - // [294] phi from main::@55 main::@61 to main::@56 [phi:main::@55/main::@61->main::@56] - // main::@56 - __b56: - // display_progress_text(display_debriefing_text_smc, display_debriefing_count_smc) - // [295] call display_progress_text - // [1098] phi from main::@56 to display_progress_text [phi:main::@56->display_progress_text] - // [1098] phi display_progress_text::text#12 = display_debriefing_text_smc [phi:main::@56->display_progress_text#0] -- qbuz1=qbuc1 - lda #main::@59] + // main::@59 + __b59: + // display_progress_text(display_debriefing_smc_text, display_debriefing_smc_count) + // [304] call display_progress_text + // [1169] phi from main::@59 to display_progress_text [phi:main::@59->display_progress_text] + // [1169] phi display_progress_text::text#13 = display_debriefing_smc_text [phi:main::@59->display_progress_text#0] -- qbuz1=qbuc1 + lda #display_debriefing_text_smc + lda #>display_debriefing_smc_text sta.z display_progress_text.text+1 - // [1098] phi display_progress_text::lines#11 = display_debriefing_count_smc [phi:main::@56->display_progress_text#1] -- vbum1=vbuc1 - lda #display_debriefing_count_smc - sta display_progress_text.lines + // [1169] phi display_progress_text::lines#12 = display_debriefing_smc_count [phi:main::@59->display_progress_text#1] -- vbuz1=vbuc1 + lda #display_debriefing_smc_count + sta.z display_progress_text.lines jsr display_progress_text - // [296] phi from main::@56 to main::@216 [phi:main::@56->main::@216] - // main::@216 + // [305] phi from main::@59 to main::@226 [phi:main::@59->main::@226] + // main::@226 // textcolor(PINK) - // [297] call textcolor - // [760] phi from main::@216 to textcolor [phi:main::@216->textcolor] - // [760] phi textcolor::color#23 = PINK [phi:main::@216->textcolor#0] -- vbum1=vbuc1 - lda #PINK - sta textcolor.color + // [306] call textcolor + // [787] phi from main::@226 to textcolor [phi:main::@226->textcolor] + // [787] phi textcolor::color#23 = PINK [phi:main::@226->textcolor#0] -- vbuxx=vbuc1 + ldx #PINK jsr textcolor - // [298] phi from main::@216 to main::@217 [phi:main::@216->main::@217] - // main::@217 + // [307] phi from main::@226 to main::@227 [phi:main::@226->main::@227] + // main::@227 // display_progress_line(2, "DON'T DO ANYTHING UNTIL COUNTDOWN FINISHES!") - // [299] call display_progress_line - // [1108] phi from main::@217 to display_progress_line [phi:main::@217->display_progress_line] - // [1108] phi display_progress_line::text#3 = main::text [phi:main::@217->display_progress_line#0] -- pbuz1=pbuc1 + // [308] call display_progress_line + // [1179] phi from main::@227 to display_progress_line [phi:main::@227->display_progress_line] + // [1179] phi display_progress_line::text#3 = main::text [phi:main::@227->display_progress_line#0] -- pbuz1=pbuc1 lda #text sta.z display_progress_line.text+1 - // [1108] phi display_progress_line::line#3 = 2 [phi:main::@217->display_progress_line#1] -- vbuz1=vbuc1 - lda #2 - sta.z display_progress_line.line + // [1179] phi display_progress_line::line#3 = 2 [phi:main::@227->display_progress_line#1] -- vbuxx=vbuc1 + ldx #2 jsr display_progress_line - // [300] phi from main::@217 to main::@218 [phi:main::@217->main::@218] - // main::@218 + // [309] phi from main::@227 to main::@228 [phi:main::@227->main::@228] + // main::@228 // textcolor(WHITE) - // [301] call textcolor - // [760] phi from main::@218 to textcolor [phi:main::@218->textcolor] - // [760] phi textcolor::color#23 = WHITE [phi:main::@218->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color + // [310] call textcolor + // [787] phi from main::@228 to textcolor [phi:main::@228->textcolor] + // [787] phi textcolor::color#23 = WHITE [phi:main::@228->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor - // [302] phi from main::@218 to main::@57 [phi:main::@218->main::@57] - // [302] phi main::w#2 = $78 [phi:main::@218->main::@57#0] -- vbum1=vbuc1 + // [311] phi from main::@228 to main::@60 [phi:main::@228->main::@60] + // [311] phi main::w#2 = $78 [phi:main::@228->main::@60#0] -- vbum1=vbuc1 lda #$78 sta w - // main::@57 - __b57: + // main::@60 + __b60: // for (unsigned char w=120; w>0; w--) - // [303] if(main::w#2>0) goto main::@58 -- vbum1_gt_0_then_la1 + // [312] if(main::w#2>0) goto main::@61 -- vbum1_gt_0_then_la1 lda w - bne __b58 - // [304] phi from main::@57 to main::@59 [phi:main::@57->main::@59] - // main::@59 + bne __b61 + // [313] phi from main::@60 to main::@62 [phi:main::@60->main::@62] + // main::@62 // sprintf(info_text, "Please disconnect your CX16 from power source ...") - // [305] call snprintf_init - // [1113] phi from main::@59 to snprintf_init [phi:main::@59->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:main::@59->snprintf_init#0] -- pbuz1=pbuc1 + // [314] call snprintf_init + // [1184] phi from main::@62 to snprintf_init [phi:main::@62->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:main::@62->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [306] phi from main::@59 to main::@225 [phi:main::@59->main::@225] - // main::@225 + // [315] phi from main::@62 to main::@235 [phi:main::@62->main::@235] + // main::@235 // sprintf(info_text, "Please disconnect your CX16 from power source ...") - // [307] call printf_str - // [1054] phi from main::@225 to printf_str [phi:main::@225->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@225->printf_str#0] -- pprz1=pprc1 + // [316] call printf_str + // [1125] phi from main::@235 to printf_str [phi:main::@235->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@235->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s21 [phi:main::@225->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s21 [phi:main::@235->printf_str#1] -- pbuz1=pbuc1 lda #s21 sta.z printf_str.s+1 jsr printf_str - // main::@226 + // main::@236 // sprintf(info_text, "Please disconnect your CX16 from power source ...") - // [308] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [317] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [309] callexecute snputc -- call_vprc1 + // [318] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [311] call display_action_text - // [1129] phi from main::@226 to display_action_text [phi:main::@226->display_action_text] - // [1129] phi display_action_text::info_text#17 = info_text [phi:main::@226->display_action_text#0] -- pbuz1=pbuc1 + // [320] call display_action_text + // [1200] phi from main::@236 to display_action_text [phi:main::@236->display_action_text] + // [1200] phi display_action_text::info_text#25 = info_text [phi:main::@236->display_action_text#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_action_text.info_text lda #>@info_text sta.z display_action_text.info_text+1 jsr display_action_text - // [312] phi from main::@226 to main::@227 [phi:main::@226->main::@227] - // main::@227 + // [321] phi from main::@236 to main::@237 [phi:main::@236->main::@237] + // main::@237 // smc_reset() - // [313] call smc_reset + // [322] call smc_reset // DE5 | The components correctly updated, SMC bootloader 2 // When bootloader 1, the CX16 won't shut down automatically and will hang! The user will see the above bootloader 1 action. // When bootloader 2, the CX16 will shut down automatically. The user will never see the bootloader 1 action. - // [1143] phi from main::@227 to smc_reset [phi:main::@227->smc_reset] + // [1214] phi from main::@237 to smc_reset [phi:main::@237->smc_reset] jsr smc_reset - // [314] phi from main::@227 main::@60 to main::@60 [phi:main::@227/main::@60->main::@60] - __b4: + // [323] phi from main::@237 main::@63 to main::@63 [phi:main::@237/main::@63->main::@63] + __b6: // This call will reboot the SMC, which will reset the CX16 if bootloader R2. - // main::@60 - jmp __b4 - // [315] phi from main::@57 to main::@58 [phi:main::@57->main::@58] - // main::@58 - __b58: + // main::@63 + jmp __b6 + // [324] phi from main::@60 to main::@61 [phi:main::@60->main::@61] + // main::@61 + __b61: // wait_moment(1) - // [316] call wait_moment - // [1063] phi from main::@58 to wait_moment [phi:main::@58->wait_moment] - // [1063] phi wait_moment::w#7 = 1 [phi:main::@58->wait_moment#0] -- vbum1=vbuc1 + // [325] call wait_moment + // [1134] phi from main::@61 to wait_moment [phi:main::@61->wait_moment] + // [1134] phi wait_moment::w#17 = 1 [phi:main::@61->wait_moment#0] -- vbuz1=vbuc1 lda #1 - sta wait_moment.w + sta.z wait_moment.w jsr wait_moment - // [317] phi from main::@58 to main::@219 [phi:main::@58->main::@219] - // main::@219 + // [326] phi from main::@61 to main::@229 [phi:main::@61->main::@229] + // main::@229 // sprintf(info_text, "[%03u] Please read carefully the below ...", w) - // [318] call snprintf_init - // [1113] phi from main::@219 to snprintf_init [phi:main::@219->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:main::@219->snprintf_init#0] -- pbuz1=pbuc1 + // [327] call snprintf_init + // [1184] phi from main::@229 to snprintf_init [phi:main::@229->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:main::@229->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [319] phi from main::@219 to main::@220 [phi:main::@219->main::@220] - // main::@220 + // [328] phi from main::@229 to main::@230 [phi:main::@229->main::@230] + // main::@230 // sprintf(info_text, "[%03u] Please read carefully the below ...", w) - // [320] call printf_str - // [1054] phi from main::@220 to printf_str [phi:main::@220->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@220->printf_str#0] -- pprz1=pprc1 + // [329] call printf_str + // [1125] phi from main::@230 to printf_str [phi:main::@230->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@230->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s1 [phi:main::@220->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s1 [phi:main::@230->printf_str#1] -- pbuz1=pbuc1 lda #<@s1 sta.z printf_str.s lda #>@s1 sta.z printf_str.s+1 jsr printf_str - // main::@221 + // main::@231 // sprintf(info_text, "[%03u] Please read carefully the below ...", w) - // [321] printf_uchar::uvalue#15 = main::w#2 -- vbum1=vbum2 - lda w - sta printf_uchar.uvalue - // [322] call printf_uchar - // [1118] phi from main::@221 to printf_uchar [phi:main::@221->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 1 [phi:main::@221->printf_uchar#0] -- vbum1=vbuc1 + // [330] printf_uchar::uvalue#13 = main::w#2 -- vbuxx=vbum1 + ldx w + // [331] call printf_uchar + // [1189] phi from main::@231 to printf_uchar [phi:main::@231->printf_uchar] + // [1189] phi printf_uchar::format_zero_padding#15 = 1 [phi:main::@231->printf_uchar#0] -- vbum1=vbuc1 lda #1 sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 3 [phi:main::@221->printf_uchar#1] -- vbum1=vbuc1 + // [1189] phi printf_uchar::format_min_length#15 = 3 [phi:main::@231->printf_uchar#1] -- vbum1=vbuc1 lda #3 sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &snputc [phi:main::@221->printf_uchar#2] -- pprz1=pprc1 + // [1189] phi printf_uchar::putc#15 = &snputc [phi:main::@231->printf_uchar#2] -- pprz1=pprc1 lda #snputc sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = DECIMAL [phi:main::@221->printf_uchar#3] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = printf_uchar::uvalue#15 [phi:main::@221->printf_uchar#4] -- register_copy + // [1189] phi printf_uchar::format_radix#15 = DECIMAL [phi:main::@231->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL + // [1189] phi printf_uchar::uvalue#15 = printf_uchar::uvalue#13 [phi:main::@231->printf_uchar#4] -- register_copy jsr printf_uchar - // [323] phi from main::@221 to main::@222 [phi:main::@221->main::@222] - // main::@222 + // [332] phi from main::@231 to main::@232 [phi:main::@231->main::@232] + // main::@232 // sprintf(info_text, "[%03u] Please read carefully the below ...", w) - // [324] call printf_str - // [1054] phi from main::@222 to printf_str [phi:main::@222->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@222->printf_str#0] -- pprz1=pprc1 + // [333] call printf_str + // [1125] phi from main::@232 to printf_str [phi:main::@232->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@232->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s20 [phi:main::@222->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s20 [phi:main::@232->printf_str#1] -- pbuz1=pbuc1 lda #s20 sta.z printf_str.s+1 jsr printf_str - // main::@223 + // main::@233 // sprintf(info_text, "[%03u] Please read carefully the below ...", w) - // [325] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [334] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [326] callexecute snputc -- call_vprc1 + // [335] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [328] call display_action_text - // [1129] phi from main::@223 to display_action_text [phi:main::@223->display_action_text] - // [1129] phi display_action_text::info_text#17 = info_text [phi:main::@223->display_action_text#0] -- pbuz1=pbuc1 + // [337] call display_action_text + // [1200] phi from main::@233 to display_action_text [phi:main::@233->display_action_text] + // [1200] phi display_action_text::info_text#25 = info_text [phi:main::@233->display_action_text#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_action_text.info_text lda #>@info_text sta.z display_action_text.info_text+1 jsr display_action_text - // main::@224 + // main::@234 // for (unsigned char w=120; w>0; w--) - // [329] main::w#1 = -- main::w#2 -- vbum1=_dec_vbum1 + // [338] main::w#1 = -- main::w#2 -- vbum1=_dec_vbum1 dec w - // [302] phi from main::@224 to main::@57 [phi:main::@224->main::@57] - // [302] phi main::w#2 = main::w#1 [phi:main::@224->main::@57#0] -- register_copy - jmp __b57 + // [311] phi from main::@234 to main::@60 [phi:main::@234->main::@60] + // [311] phi main::w#2 = main::w#1 [phi:main::@234->main::@60#0] -- register_copy + jmp __b60 // main::vera_display_set_border_color4 vera_display_set_border_color4: // *VERA_CTRL &= ~VERA_DCSEL - // [330] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [339] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_DCSEL^$ff and VERA_CTRL sta VERA_CTRL // *VERA_DC_BORDER = color - // [331] *VERA_DC_BORDER = YELLOW -- _deref_pbuc1=vbuc2 + // [340] *VERA_DC_BORDER = YELLOW -- _deref_pbuc1=vbuc2 lda #YELLOW sta VERA_DC_BORDER - // [332] phi from main::vera_display_set_border_color4 to main::@90 [phi:main::vera_display_set_border_color4->main::@90] - // main::@90 + // [341] phi from main::vera_display_set_border_color4 to main::@97 [phi:main::vera_display_set_border_color4->main::@97] + // main::@97 // display_action_progress("Update issues, your CX16 is not updated!") - // [333] call display_action_progress - // [1084] phi from main::@90 to display_action_progress [phi:main::@90->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = main::info_text43 [phi:main::@90->display_action_progress#0] -- pbuz1=pbuc1 - lda #display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main::info_text42 [phi:main::@97->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text43 + lda #>info_text42 sta.z display_action_progress.info_text+1 jsr display_action_progress - jmp __b3 + jmp __b5 // main::vera_display_set_border_color3 vera_display_set_border_color3: // *VERA_CTRL &= ~VERA_DCSEL - // [334] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [343] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_DCSEL^$ff and VERA_CTRL sta VERA_CTRL // *VERA_DC_BORDER = color - // [335] *VERA_DC_BORDER = RED -- _deref_pbuc1=vbuc2 + // [344] *VERA_DC_BORDER = RED -- _deref_pbuc1=vbuc2 lda #RED sta VERA_DC_BORDER - // [336] phi from main::vera_display_set_border_color3 to main::@88 [phi:main::vera_display_set_border_color3->main::@88] - // main::@88 + // [345] phi from main::vera_display_set_border_color3 to main::@95 [phi:main::vera_display_set_border_color3->main::@95] + // main::@95 // display_action_progress("Update Failure! Your CX16 may no longer boot!") - // [337] call display_action_progress - // [1084] phi from main::@88 to display_action_progress [phi:main::@88->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = main::info_text41 [phi:main::@88->display_action_progress#0] -- pbuz1=pbuc1 - lda #display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main::info_text40 [phi:main::@95->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text41 + lda #>info_text40 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [338] phi from main::@88 to main::@214 [phi:main::@88->main::@214] - // main::@214 - // display_action_text("Take a photo of this screen, shut down power and retry!") - // [339] call display_action_text - // [1129] phi from main::@214 to display_action_text [phi:main::@214->display_action_text] - // [1129] phi display_action_text::info_text#17 = main::info_text42 [phi:main::@214->display_action_text#0] -- pbuz1=pbuc1 - lda #main::@222] + // main::@222 + // display_action_text("Take a photo of this screen and wait at leaast 60 seconds.") + // [348] call display_action_text + // [1200] phi from main::@222 to display_action_text [phi:main::@222->display_action_text] + // [1200] phi display_action_text::info_text#25 = main::info_text41 [phi:main::@222->display_action_text#0] -- pbuz1=pbuc1 + lda #info_text42 + lda #>info_text41 sta.z display_action_text.info_text+1 jsr display_action_text - // [340] phi from main::@214 main::@62 to main::@62 [phi:main::@214/main::@62->main::@62] - // main::@62 - __b62: - jmp __b62 - // main::@259 - __b259: + // [349] phi from main::@222 to main::@223 [phi:main::@222->main::@223] + // main::@223 + // wait_moment(250) + // [350] call wait_moment + // [1134] phi from main::@223 to wait_moment [phi:main::@223->wait_moment] + // [1134] phi wait_moment::w#17 = $fa [phi:main::@223->wait_moment#0] -- vbuz1=vbuc1 + lda #$fa + sta.z wait_moment.w + jsr wait_moment + // [351] phi from main::@223 to main::@224 [phi:main::@223->main::@224] + // main::@224 + // smc_reset() + // [352] call smc_reset + // [1214] phi from main::@224 to smc_reset [phi:main::@224->smc_reset] + jsr smc_reset + // [353] phi from main::@224 main::@65 to main::@65 [phi:main::@224/main::@65->main::@65] + // main::@65 + __b65: + jmp __b65 + // main::@269 + __b269: // if((check_status_smc(STATUS_SKIP) || check_status_smc(STATUS_NONE)) && // (check_status_vera(STATUS_SKIP) || check_status_vera(STATUS_NONE)) && // (check_status_roms_less(STATUS_SKIP)) ) - // [341] if(0!=main::check_status_vera5_return#0) goto main::@258 -- 0_neq_vbuz1_then_la1 - lda.z check_status_vera5_return - bne __b258 - // main::@266 - // [342] if(0==main::check_status_vera6_return#0) goto main::check_status_smc16 -- 0_eq_vbum1_then_la1 - lda check_status_vera6_return + // [354] if(0!=main::check_status_vera8_return#0) goto main::@268 -- 0_neq_vbuz1_then_la1 + lda.z check_status_vera8_return + bne __b268 + // main::@276 + // [355] if(0==main::check_status_vera9_return#0) goto main::check_status_smc16 -- 0_eq_vbuyy_then_la1 + cpy #0 bne !check_status_smc16+ jmp check_status_smc16 !check_status_smc16: - // main::@258 - __b258: - // [343] if(0!=main::$74) goto main::vera_display_set_border_color2 -- 0_neq_vbuz1_then_la1 - lda.z main__74 + // main::@268 + __b268: + // [356] if(0!=main::$81) goto main::vera_display_set_border_color2 -- 0_neq_vbuxx_then_la1 + cpx #0 bne vera_display_set_border_color2 jmp check_status_smc16 // main::vera_display_set_border_color2 vera_display_set_border_color2: // *VERA_CTRL &= ~VERA_DCSEL - // [344] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [357] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_DCSEL^$ff and VERA_CTRL sta VERA_CTRL // *VERA_DC_BORDER = color - // [345] *VERA_DC_BORDER = BLACK -- _deref_pbuc1=vbuc2 + // [358] *VERA_DC_BORDER = BLACK -- _deref_pbuc1=vbuc2 lda #BLACK sta VERA_DC_BORDER - // [346] phi from main::vera_display_set_border_color2 to main::@86 [phi:main::vera_display_set_border_color2->main::@86] - // main::@86 + // [359] phi from main::vera_display_set_border_color2 to main::@93 [phi:main::vera_display_set_border_color2->main::@93] + // main::@93 // display_action_progress("No CX16 component has been updated with new firmware!") - // [347] call display_action_progress - // [1084] phi from main::@86 to display_action_progress [phi:main::@86->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = main::info_text40 [phi:main::@86->display_action_progress#0] -- pbuz1=pbuc1 - lda #display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main::info_text39 [phi:main::@93->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text40 + lda #>info_text39 sta.z display_action_progress.info_text+1 jsr display_action_progress - jmp __b3 - // main::@250 - __b250: + jmp __b5 + // main::@260 + __b260: // if(!check_status_smc(STATUS_ISSUE) && !check_status_vera(STATUS_ISSUE) && !check_status_roms(STATUS_ISSUE) && // !check_status_smc(STATUS_ERROR) && !check_status_vera(STATUS_ERROR) && !check_status_roms(STATUS_ERROR)) - // [348] if(0!=main::$52) goto main::check_status_vera3 -- 0_neq_vbum1_then_la1 - lda main__52 + // [361] if(0!=main::$59) goto main::check_status_vera3 -- 0_neq_vbum1_then_la1 + lda main__59 beq !check_status_vera3+ jmp check_status_vera3 !check_status_vera3: - // main::@249 - // [349] if(0==main::check_status_smc9_return#0) goto main::@248 -- 0_eq_vbum1_then_la1 + // main::@259 + // [362] if(0==main::check_status_smc9_return#0) goto main::@258 -- 0_eq_vbum1_then_la1 lda check_status_smc9_return - beq __b248 + beq __b258 jmp check_status_vera3 - // main::@248 - __b248: - // [350] if(0!=main::check_status_vera2_return#0) goto main::check_status_vera3 -- 0_neq_vbuz1_then_la1 + // main::@258 + __b258: + // [363] if(0!=main::check_status_vera2_return#0) goto main::check_status_vera3 -- 0_neq_vbuz1_then_la1 lda.z check_status_vera2_return beq !check_status_vera3+ jmp check_status_vera3 !check_status_vera3: - // main::@247 - // [351] if(0==main::$61) goto main::check_status_vera4 -- 0_eq_vbum1_then_la1 - lda main__61 + // main::@257 + // [364] if(0==main::$68) goto main::check_status_vera4 -- 0_eq_vbuxx_then_la1 + cpx #0 beq check_status_vera4 jmp check_status_vera3 // main::check_status_vera4 check_status_vera4: // status_vera == status - // [352] main::check_status_vera4_$0 = status_vera#103 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [365] main::check_status_vera4_$0 = status_vera#115 == STATUS_FLASH -- vboaa=vbum1_eq_vbuc1 lda status_vera eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_vera4_main__0 // return (unsigned char)(status_vera == status); - // [353] main::check_status_vera4_return#0 = (char)main::check_status_vera4_$0 + // [366] main::check_status_vera4_return#0 = (char)main::check_status_vera4_$0 -- vbum1=vbuaa + sta check_status_vera4_return // main::check_status_smc10 // status_smc == status - // [354] main::check_status_smc10_$0 = status_smc#122 == STATUS_FLASH -- vboz1=vbum2_eq_vbuc1 + // [367] main::check_status_smc10_$0 = status_smc#147 == STATUS_FLASH -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta.z check_status_smc10_main__0 // return (unsigned char)(status_smc == status); - // [355] main::check_status_smc10_return#0 = (char)main::check_status_smc10_$0 - // [356] phi from main::check_status_smc10 to main::check_status_cx16_rom6 [phi:main::check_status_smc10->main::check_status_cx16_rom6] + // [368] main::check_status_smc10_return#0 = (char)main::check_status_smc10_$0 -- vbum1=vbuaa + sta check_status_smc10_return + // [369] phi from main::check_status_smc10 to main::check_status_cx16_rom6 [phi:main::check_status_smc10->main::check_status_cx16_rom6] // main::check_status_cx16_rom6 // main::check_status_cx16_rom6_check_status_rom1 // status_rom[rom_chip] == status - // [357] main::check_status_cx16_rom6_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vboz1=_deref_pbuc1_eq_vbuc2 + // [370] main::check_status_cx16_rom6_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vboaa=_deref_pbuc1_eq_vbuc2 lda status_rom eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta.z check_status_cx16_rom6_check_status_rom1_main__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [358] main::check_status_cx16_rom6_check_status_rom1_return#0 = (char)main::check_status_cx16_rom6_check_status_rom1_$0 - // [359] phi from main::check_status_cx16_rom6_check_status_rom1 to main::@79 [phi:main::check_status_cx16_rom6_check_status_rom1->main::@79] - // main::@79 + // [371] main::check_status_cx16_rom6_check_status_rom1_return#0 = (char)main::check_status_cx16_rom6_check_status_rom1_$0 -- vbuyy=vbuaa + tay + // [372] phi from main::check_status_cx16_rom6_check_status_rom1 to main::@83 [phi:main::check_status_cx16_rom6_check_status_rom1->main::@83] + // main::@83 // check_status_card_roms(STATUS_FLASH) - // [360] call check_status_card_roms - // [1152] phi from main::@79 to check_status_card_roms [phi:main::@79->check_status_card_roms] + // [373] call check_status_card_roms + // [1223] phi from main::@83 to check_status_card_roms [phi:main::@83->check_status_card_roms] jsr check_status_card_roms // check_status_card_roms(STATUS_FLASH) - // [361] check_status_card_roms::return#3 = check_status_card_roms::return#2 - // main::@171 - // [362] main::$186 = check_status_card_roms::return#3 + // [374] check_status_card_roms::return#3 = check_status_card_roms::return#2 + // main::@179 + // [375] main::$193 = check_status_card_roms::return#3 -- vbuxx=vbuaa + tax // if(check_status_vera(STATUS_FLASH) || check_status_smc(STATUS_FLASH) || check_status_cx16_rom(STATUS_FLASH) || check_status_card_roms(STATUS_FLASH)) - // [363] if(0!=main::check_status_vera4_return#0) goto main::@14 -- 0_neq_vbum1_then_la1 + // [376] if(0!=main::check_status_vera4_return#0) goto main::@16 -- 0_neq_vbum1_then_la1 lda check_status_vera4_return - beq !__b14+ - jmp __b14 - !__b14: - // main::@254 - // [364] if(0!=main::check_status_smc10_return#0) goto main::@14 -- 0_neq_vbuz1_then_la1 - lda.z check_status_smc10_return - beq !__b14+ - jmp __b14 - !__b14: - // main::@253 - // [365] if(0!=main::check_status_cx16_rom6_check_status_rom1_return#0) goto main::@14 -- 0_neq_vbuz1_then_la1 - lda.z check_status_cx16_rom6_check_status_rom1_return - beq !__b14+ - jmp __b14 - !__b14: - // main::@252 - // [366] if(0!=main::$186) goto main::@14 -- 0_neq_vbum1_then_la1 - lda main__186 - beq !__b14+ - jmp __b14 - !__b14: + beq !__b16+ + jmp __b16 + !__b16: + // main::@264 + // [377] if(0!=main::check_status_smc10_return#0) goto main::@16 -- 0_neq_vbum1_then_la1 + lda check_status_smc10_return + beq !__b16+ + jmp __b16 + !__b16: + // main::@263 + // [378] if(0!=main::check_status_cx16_rom6_check_status_rom1_return#0) goto main::@16 -- 0_neq_vbuyy_then_la1 + cpy #0 + beq !__b16+ + jmp __b16 + !__b16: + // main::@262 + // [379] if(0!=main::$193) goto main::@16 -- 0_neq_vbuxx_then_la1 + cpx #0 + beq !__b16+ + jmp __b16 + !__b16: + // main::bank_set_brom7 + bank_set_brom7: + // BROM = bank + // [380] BROM = main::bank_set_brom7_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom7_bank + sta.z BROM + // main::CLI3 + // asm + // asm { cli } + cli + // main::check_status_vera5 + // status_vera == status + // [382] main::check_status_vera5_$0 = status_vera#115 == STATUS_FLASH -- vboaa=vbum1_eq_vbuc1 + lda status_vera + eor #STATUS_FLASH + beq !+ + lda #1 + !: + eor #1 + // return (unsigned char)(status_vera == status); + // [383] main::check_status_vera5_return#0 = (char)main::check_status_vera5_$0 + // main::@84 + // if(check_status_vera(STATUS_FLASH)) + // [384] if(0==main::check_status_vera5_return#0) goto main::SEI4 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq SEI4 + // [385] phi from main::@84 to main::@53 [phi:main::@84->main::@53] + // main::@53 + // main_vera_flash() + // [386] call main_vera_flash + // [1232] phi from main::@53 to main_vera_flash [phi:main::@53->main_vera_flash] + jsr main_vera_flash + // [387] phi from main::@53 main::@84 to main::SEI4 [phi:main::@53/main::@84->main::SEI4] + // [387] phi __stdio_filecount#113 = __stdio_filecount#12 [phi:main::@53/main::@84->main::SEI4#0] -- register_copy + // [387] phi __errno#117 = __errno#123 [phi:main::@53/main::@84->main::SEI4#1] -- register_copy + // main::SEI4 + SEI4: + // asm + // asm { sei } + sei + // main::bank_set_brom8 + // BROM = bank + // [389] BROM = main::bank_set_brom8_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom8_bank + sta.z BROM + // [390] phi from main::bank_set_brom8 to main::@85 [phi:main::bank_set_brom8->main::@85] + // main::@85 + // display_progress_clear() + // [391] call display_progress_clear + // [1037] phi from main::@85 to display_progress_clear [phi:main::@85->display_progress_clear] + jsr display_progress_clear // main::check_status_smc11 - check_status_smc11: // status_smc == status - // [367] main::check_status_smc11_$0 = status_smc#122 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [392] main::check_status_smc11_$0 = status_smc#147 == STATUS_FLASH -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_smc11_main__0 // return (unsigned char)(status_smc == status); - // [368] main::check_status_smc11_return#0 = (char)main::check_status_smc11_$0 - // [369] phi from main::check_status_smc11 to main::check_status_cx16_rom7 [phi:main::check_status_smc11->main::check_status_cx16_rom7] - // main::check_status_cx16_rom7 - // main::check_status_cx16_rom7_check_status_rom1 - // status_rom[rom_chip] == status - // [370] main::check_status_cx16_rom7_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vboz1=_deref_pbuc1_eq_vbuc2 - lda status_rom - eor #STATUS_FLASH + // [393] main::check_status_smc11_return#0 = (char)main::check_status_smc11_$0 -- vbuyy=vbuaa + tay + // main::check_status_vera6 + // status_vera == status + // [394] main::check_status_vera6_$0 = status_vera#115 == STATUS_ERROR -- vboaa=vbum1_eq_vbuc1 + lda status_vera + eor #STATUS_ERROR beq !+ lda #1 !: eor #1 - sta.z check_status_cx16_rom7_check_status_rom1_main__0 - // return (unsigned char)(status_rom[rom_chip] == status); - // [371] main::check_status_cx16_rom7_check_status_rom1_return#0 = (char)main::check_status_cx16_rom7_check_status_rom1_$0 - // main::@80 - // if (check_status_smc(STATUS_FLASH) && check_status_cx16_rom(STATUS_FLASH)) - // [372] if(0==main::check_status_smc11_return#0) goto main::SEI3 -- 0_eq_vbum1_then_la1 - lda check_status_smc11_return - beq SEI3 - // main::@255 - // [373] if(0!=main::check_status_cx16_rom7_check_status_rom1_return#0) goto main::@51 -- 0_neq_vbuz1_then_la1 - lda.z check_status_cx16_rom7_check_status_rom1_return - beq !__b51+ - jmp __b51 - !__b51: - // [374] phi from main::@255 to main::SEI3 [phi:main::@255->main::SEI3] - // [374] phi from main::@179 main::@40 main::@41 main::@54 main::@80 to main::SEI3 [phi:main::@179/main::@40/main::@41/main::@54/main::@80->main::SEI3] - // [374] phi __stdio_filecount#416 = __stdio_filecount#27 [phi:main::@179/main::@40/main::@41/main::@54/main::@80->main::SEI3#0] -- register_copy - // [374] phi __errno#424 = __errno#18 [phi:main::@179/main::@40/main::@41/main::@54/main::@80->main::SEI3#1] -- register_copy - // main::SEI3 - SEI3: + // return (unsigned char)(status_vera == status); + // [395] main::check_status_vera6_return#0 = (char)main::check_status_vera6_$0 -- vbuxx=vbuaa + tax + // main::@86 + // if (check_status_smc(STATUS_FLASH) && !check_status_vera(STATUS_ERROR)) + // [396] if(0==main::check_status_smc11_return#0) goto main::SEI5 -- 0_eq_vbuyy_then_la1 + cpy #0 + beq SEI5 + // main::@265 + // [397] if(0==main::check_status_vera6_return#0) goto main::@54 -- 0_eq_vbuxx_then_la1 + cpx #0 + bne !__b54+ + jmp __b54 + !__b54: + // [398] phi from main::@265 to main::SEI5 [phi:main::@265->main::SEI5] + // [398] phi from main::@187 main::@42 main::@43 main::@57 main::@86 to main::SEI5 [phi:main::@187/main::@42/main::@43/main::@57/main::@86->main::SEI5] + // [398] phi __stdio_filecount#566 = __stdio_filecount#36 [phi:main::@187/main::@42/main::@43/main::@57/main::@86->main::SEI5#0] -- register_copy + // [398] phi __errno#573 = __errno#123 [phi:main::@187/main::@42/main::@43/main::@57/main::@86->main::SEI5#1] -- register_copy + // main::SEI5 + SEI5: // asm // asm { sei } sei - // [376] phi from main::SEI3 to main::@42 [phi:main::SEI3->main::@42] - // [376] phi __stdio_filecount#116 = __stdio_filecount#416 [phi:main::SEI3->main::@42#0] -- register_copy - // [376] phi __errno#102 = __errno#424 [phi:main::SEI3->main::@42#1] -- register_copy - // [376] phi main::rom_chip3#10 = 7 [phi:main::SEI3->main::@42#2] -- vbum1=vbuc1 + // main::check_status_vera7 + // status_vera == status + // [400] main::check_status_vera7_$0 = status_vera#115 == STATUS_ERROR -- vboaa=vbum1_eq_vbuc1 + lda status_vera + eor #STATUS_ERROR + beq !+ + lda #1 + !: + eor #1 + // return (unsigned char)(status_vera == status); + // [401] main::check_status_vera7_return#0 = (char)main::check_status_vera7_$0 + // main::@87 + // if(!check_status_vera(STATUS_ERROR)) + // [402] if(0!=main::check_status_vera7_return#0) goto main::@44 -- 0_neq_vbuaa_then_la1 + cmp #0 + bne __b44 + // [403] phi from main::@87 to main::@45 [phi:main::@87->main::@45] + // [403] phi __stdio_filecount#114 = __stdio_filecount#566 [phi:main::@87->main::@45#0] -- register_copy + // [403] phi __errno#118 = __errno#573 [phi:main::@87->main::@45#1] -- register_copy + // [403] phi main::rom_chip3#10 = 7 [phi:main::@87->main::@45#2] -- vbum1=vbuc1 lda #7 sta rom_chip3 // Flash the ROM chips. @@ -2289,24 +2335,25 @@ main: { // If the file contents are the same as the ROM contents, then no flashing is required. // IMPORTANT! We start to flash the ROMs on the extension card. // The last ROM flashed is the CX16 ROM on the CX16 board! - // main::@42 - __b42: + // main::@45 + __b45: // for(unsigned char rom_chip = 7; rom_chip != 255; rom_chip--) - // [377] if(main::rom_chip3#10!=$ff) goto main::check_status_rom1 -- vbum1_neq_vbuc1_then_la1 + // [404] if(main::rom_chip3#10!=$ff) goto main::check_status_rom1 -- vbum1_neq_vbuc1_then_la1 lda #$ff cmp rom_chip3 bne check_status_rom1 - // [378] phi from main::@42 to main::@43 [phi:main::@42->main::@43] - // main::@43 + // [405] phi from main::@45 main::@87 to main::@44 [phi:main::@45/main::@87->main::@44] + // main::@44 + __b44: // display_progress_clear() - // [379] call display_progress_clear - // [1161] phi from main::@43 to display_progress_clear [phi:main::@43->display_progress_clear] + // [406] call display_progress_clear + // [1037] phi from main::@44 to display_progress_clear [phi:main::@44->display_progress_clear] jsr display_progress_clear jmp check_status_vera3 // main::check_status_rom1 check_status_rom1: // status_rom[rom_chip] == status - // [380] main::check_status_rom1_$0 = status_rom[main::rom_chip3#10] == STATUS_FLASH -- vbom1=pbuc1_derefidx_vbum2_eq_vbuc2 + // [407] main::check_status_rom1_$0 = status_rom[main::rom_chip3#10] == STATUS_FLASH -- vboaa=pbuc1_derefidx_vbum1_eq_vbuc2 lda #STATUS_FLASH ldy rom_chip3 eor status_rom,y @@ -2314,95 +2361,94 @@ main: { lda #1 !: eor #1 - sta check_status_rom1_main__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [381] main::check_status_rom1_return#0 = (char)main::check_status_rom1_$0 - // main::@81 + // [408] main::check_status_rom1_return#0 = (char)main::check_status_rom1_$0 + // main::@88 // if(check_status_rom(rom_chip, STATUS_FLASH)) - // [382] if(0==main::check_status_rom1_return#0) goto main::@44 -- 0_eq_vbum1_then_la1 - lda check_status_rom1_return - beq __b44 + // [409] if(0==main::check_status_rom1_return#0) goto main::@46 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b46 // main::check_status_smc12 // status_smc == status - // [383] main::check_status_smc12_$0 = status_smc#122 == STATUS_FLASHED -- vboz1=vbum2_eq_vbuc1 + // [410] main::check_status_smc12_$0 = status_smc#147 == STATUS_FLASHED -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_FLASHED beq !+ lda #1 !: eor #1 - sta.z check_status_smc12_main__0 // return (unsigned char)(status_smc == status); - // [384] main::check_status_smc12_return#0 = (char)main::check_status_smc12_$0 + // [411] main::check_status_smc12_return#0 = (char)main::check_status_smc12_$0 -- vbuyy=vbuaa + tay // main::check_status_smc13 // status_smc == status - // [385] main::check_status_smc13_$0 = status_smc#122 == STATUS_SKIP -- vboz1=vbum2_eq_vbuc1 + // [412] main::check_status_smc13_$0 = status_smc#147 == STATUS_SKIP -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_SKIP beq !+ lda #1 !: eor #1 - sta.z check_status_smc13_main__0 // return (unsigned char)(status_smc == status); - // [386] main::check_status_smc13_return#0 = (char)main::check_status_smc13_$0 - // main::@82 + // [413] main::check_status_smc13_return#0 = (char)main::check_status_smc13_$0 -- vbuxx=vbuaa + tax + // main::@89 // if((rom_chip == 0 && (check_status_smc(STATUS_FLASHED) || check_status_smc(STATUS_SKIP))) || (rom_chip != 0)) - // [387] if(main::rom_chip3#10==0) goto main::@257 -- vbum1_eq_0_then_la1 + // [414] if(main::rom_chip3#10==0) goto main::@267 -- vbum1_eq_0_then_la1 // IMPORTANT! We only flash the CX16 ROM chip if the SMC got flashed succesfully! lda rom_chip3 - bne !__b257+ - jmp __b257 - !__b257: - // main::@256 - __b256: - // [388] if(main::rom_chip3#10!=0) goto main::bank_set_brom5 -- vbum1_neq_0_then_la1 + bne !__b267+ + jmp __b267 + !__b267: + // main::@266 + __b266: + // [415] if(main::rom_chip3#10!=0) goto main::bank_set_brom9 -- vbum1_neq_0_then_la1 lda rom_chip3 - bne bank_set_brom5 - // main::@50 + bne bank_set_brom9 + // main::@52 // display_info_rom(rom_chip, STATUS_ISSUE, "SMC Update failed!") - // [389] display_info_rom::rom_chip#10 = main::rom_chip3#10 -- vbum1=vbum2 + // [416] display_info_rom::rom_chip#10 = main::rom_chip3#10 -- vbum1=vbum2 sta display_info_rom.rom_chip - // [390] call display_info_rom - // [1176] phi from main::@50 to display_info_rom [phi:main::@50->display_info_rom] - // [1176] phi display_info_rom::info_text#16 = main::info_text36 [phi:main::@50->display_info_rom#0] -- pbuz1=pbuc1 - lda #display_info_rom] + // [1368] phi display_info_rom::info_text#16 = main::info_text35 [phi:main::@52->display_info_rom#0] -- pbuz1=pbuc1 + lda #info_text36 + lda #>info_text35 sta.z display_info_rom.info_text+1 - // [1176] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#10 [phi:main::@50->display_info_rom#1] -- register_copy - // [1176] phi display_info_rom::info_status#16 = STATUS_ISSUE [phi:main::@50->display_info_rom#2] -- vbuz1=vbuc1 + // [1368] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#10 [phi:main::@52->display_info_rom#1] -- register_copy + // [1368] phi display_info_rom::info_status#16 = STATUS_ISSUE [phi:main::@52->display_info_rom#2] -- vbum1=vbuc1 lda #STATUS_ISSUE - sta.z display_info_rom.info_status + sta display_info_rom.info_status jsr display_info_rom - // [391] phi from main::@190 main::@201 main::@45 main::@49 main::@50 main::@81 to main::@44 [phi:main::@190/main::@201/main::@45/main::@49/main::@50/main::@81->main::@44] - // [391] phi __stdio_filecount#417 = __stdio_filecount#30 [phi:main::@190/main::@201/main::@45/main::@49/main::@50/main::@81->main::@44#0] -- register_copy - // [391] phi __errno#425 = __errno#18 [phi:main::@190/main::@201/main::@45/main::@49/main::@50/main::@81->main::@44#1] -- register_copy - // main::@44 - __b44: + // [418] phi from main::@198 main::@209 main::@47 main::@51 main::@52 main::@88 to main::@46 [phi:main::@198/main::@209/main::@47/main::@51/main::@52/main::@88->main::@46] + // [418] phi __stdio_filecount#565 = __stdio_filecount#39 [phi:main::@198/main::@209/main::@47/main::@51/main::@52/main::@88->main::@46#0] -- register_copy + // [418] phi __errno#572 = __errno#123 [phi:main::@198/main::@209/main::@47/main::@51/main::@52/main::@88->main::@46#1] -- register_copy + // main::@46 + __b46: // for(unsigned char rom_chip = 7; rom_chip != 255; rom_chip--) - // [392] main::rom_chip3#1 = -- main::rom_chip3#10 -- vbum1=_dec_vbum1 + // [419] main::rom_chip3#1 = -- main::rom_chip3#10 -- vbum1=_dec_vbum1 dec rom_chip3 - // [376] phi from main::@44 to main::@42 [phi:main::@44->main::@42] - // [376] phi __stdio_filecount#116 = __stdio_filecount#417 [phi:main::@44->main::@42#0] -- register_copy - // [376] phi __errno#102 = __errno#425 [phi:main::@44->main::@42#1] -- register_copy - // [376] phi main::rom_chip3#10 = main::rom_chip3#1 [phi:main::@44->main::@42#2] -- register_copy - jmp __b42 - // main::bank_set_brom5 - bank_set_brom5: + // [403] phi from main::@46 to main::@45 [phi:main::@46->main::@45] + // [403] phi __stdio_filecount#114 = __stdio_filecount#565 [phi:main::@46->main::@45#0] -- register_copy + // [403] phi __errno#118 = __errno#572 [phi:main::@46->main::@45#1] -- register_copy + // [403] phi main::rom_chip3#10 = main::rom_chip3#1 [phi:main::@46->main::@45#2] -- register_copy + jmp __b45 + // main::bank_set_brom9 + bank_set_brom9: // BROM = bank - // [393] BROM = main::bank_set_brom5_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom5_bank + // [420] BROM = main::bank_set_brom9_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom9_bank sta.z BROM - // [394] phi from main::bank_set_brom5 to main::@83 [phi:main::bank_set_brom5->main::@83] - // main::@83 + // [421] phi from main::bank_set_brom9 to main::@90 [phi:main::bank_set_brom9->main::@90] + // main::@90 // display_progress_clear() - // [395] call display_progress_clear - // [1161] phi from main::@83 to display_progress_clear [phi:main::@83->display_progress_clear] + // [422] call display_progress_clear + // [1037] phi from main::@90 to display_progress_clear [phi:main::@90->display_progress_clear] jsr display_progress_clear - // main::@183 + // main::@191 // unsigned char rom_bank = rom_chip * 32 - // [396] main::rom_bank1#0 = main::rom_chip3#10 << 5 -- vbum1=vbum2_rol_5 + // [423] main::rom_bank1#0 = main::rom_chip3#10 << 5 -- vbum1=vbum2_rol_5 lda rom_chip3 asl asl @@ -2411,117 +2457,116 @@ main: { asl sta rom_bank1 // unsigned char* file = rom_file(rom_chip) - // [397] rom_file::rom_chip#1 = main::rom_chip3#10 -- vbuz1=vbum2 + // [424] rom_file::rom_chip#1 = main::rom_chip3#10 -- vbuaa=vbum1 lda rom_chip3 - sta.z rom_file.rom_chip - // [398] call rom_file - // [1221] phi from main::@183 to rom_file [phi:main::@183->rom_file] - // [1221] phi rom_file::rom_chip#2 = rom_file::rom_chip#1 [phi:main::@183->rom_file#0] -- register_copy + // [425] call rom_file + // [1413] phi from main::@191 to rom_file [phi:main::@191->rom_file] + // [1413] phi rom_file::rom_chip#2 = rom_file::rom_chip#1 [phi:main::@191->rom_file#0] -- register_copy jsr rom_file // unsigned char* file = rom_file(rom_chip) - // [399] rom_file::return#5 = rom_file::return#2 - // main::@184 - // [400] main::file1#0 = rom_file::return#5 + // [426] rom_file::return#5 = rom_file::return#2 + // main::@192 + // [427] main::file1#0 = rom_file::return#5 // sprintf(info_text, "Reading %s ... (.) data ( ) empty", file) - // [401] call snprintf_init - // [1113] phi from main::@184 to snprintf_init [phi:main::@184->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:main::@184->snprintf_init#0] -- pbuz1=pbuc1 + // [428] call snprintf_init + // [1184] phi from main::@192 to snprintf_init [phi:main::@192->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:main::@192->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [402] phi from main::@184 to main::@185 [phi:main::@184->main::@185] - // main::@185 + // [429] phi from main::@192 to main::@193 [phi:main::@192->main::@193] + // main::@193 // sprintf(info_text, "Reading %s ... (.) data ( ) empty", file) - // [403] call printf_str - // [1054] phi from main::@185 to printf_str [phi:main::@185->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@185->printf_str#0] -- pprz1=pprc1 + // [430] call printf_str + // [1125] phi from main::@193 to printf_str [phi:main::@193->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@193->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s9 [phi:main::@185->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s9 [phi:main::@193->printf_str#1] -- pbuz1=pbuc1 lda #s9 sta.z printf_str.s+1 jsr printf_str - // main::@186 + // main::@194 // sprintf(info_text, "Reading %s ... (.) data ( ) empty", file) - // [404] printf_string::str#24 = main::file1#0 -- pbuz1=pbum2 + // [431] printf_string::str#25 = main::file1#0 -- pbuz1=pbum2 lda file1 sta.z printf_string.str lda file1+1 sta.z printf_string.str+1 - // [405] call printf_string - // [1227] phi from main::@186 to printf_string [phi:main::@186->printf_string] - // [1227] phi printf_string::putc#25 = &snputc [phi:main::@186->printf_string#0] -- pprz1=pprc1 + // [432] call printf_string + // [1419] phi from main::@194 to printf_string [phi:main::@194->printf_string] + // [1419] phi printf_string::putc#26 = &snputc [phi:main::@194->printf_string#0] -- pprz1=pprc1 lda #snputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#24 [phi:main::@186->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 0 [phi:main::@186->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#25 [phi:main::@194->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 0 [phi:main::@194->printf_string#2] -- vbum1=vbuc1 lda #0 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 0 [phi:main::@186->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 0 [phi:main::@194->printf_string#3] -- vbum1=vbuc1 sta printf_string.format_min_length jsr printf_string - // [406] phi from main::@186 to main::@187 [phi:main::@186->main::@187] - // main::@187 + // [433] phi from main::@194 to main::@195 [phi:main::@194->main::@195] + // main::@195 // sprintf(info_text, "Reading %s ... (.) data ( ) empty", file) - // [407] call printf_str - // [1054] phi from main::@187 to printf_str [phi:main::@187->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@187->printf_str#0] -- pprz1=pprc1 + // [434] call printf_str + // [1125] phi from main::@195 to printf_str [phi:main::@195->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@195->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s10 [phi:main::@187->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s10 [phi:main::@195->printf_str#1] -- pbuz1=pbuc1 lda #s10 sta.z printf_str.s+1 jsr printf_str - // main::@188 + // main::@196 // sprintf(info_text, "Reading %s ... (.) data ( ) empty", file) - // [408] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [435] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [409] callexecute snputc -- call_vprc1 + // [436] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_progress(info_text) - // [411] call display_action_progress - // [1084] phi from main::@188 to display_action_progress [phi:main::@188->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = info_text [phi:main::@188->display_action_progress#0] -- pbuz1=pbuc1 + // [438] call display_action_progress + // [1155] phi from main::@196 to display_action_progress [phi:main::@196->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = info_text [phi:main::@196->display_action_progress#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_action_progress.info_text lda #>@info_text sta.z display_action_progress.info_text+1 jsr display_action_progress - // main::@189 + // main::@197 // unsigned long rom_bytes_read = rom_read(rom_chip, file, STATUS_READING, rom_bank, rom_sizes[rom_chip]) - // [412] main::$305 = main::rom_chip3#10 << 2 -- vbum1=vbum2_rol_2 + // [439] main::$326 = main::rom_chip3#10 << 2 -- vbum1=vbum2_rol_2 lda rom_chip3 asl asl - sta main__305 - // [413] rom_read::rom_chip#1 = main::rom_chip3#10 -- vbuz1=vbum2 + sta main__326 + // [440] rom_read::rom_chip#1 = main::rom_chip3#10 -- vbum1=vbum2 lda rom_chip3 - sta.z rom_read.rom_chip - // [414] rom_read::file#1 = main::file1#0 -- pbuz1=pbum2 + sta rom_read.rom_chip + // [441] rom_read::file#1 = main::file1#0 -- pbuz1=pbum2 lda file1 sta.z rom_read.file lda file1+1 sta.z rom_read.file+1 - // [415] rom_read::brom_bank_start#2 = main::rom_bank1#0 -- vbuz1=vbum2 + // [442] rom_read::brom_bank_start#2 = main::rom_bank1#0 -- vbuz1=vbum2 lda rom_bank1 sta.z rom_read.brom_bank_start - // [416] rom_read::rom_size#1 = rom_sizes[main::$305] -- vduz1=pduc1_derefidx_vbum2 - ldy main__305 + // [443] rom_read::rom_size#1 = rom_sizes[main::$326] -- vduz1=pduc1_derefidx_vbum2 + ldy main__326 lda rom_sizes,y sta.z rom_read.rom_size lda rom_sizes+1,y @@ -2530,71 +2575,70 @@ main: { sta.z rom_read.rom_size+2 lda rom_sizes+3,y sta.z rom_read.rom_size+3 - // [417] call rom_read - // [1252] phi from main::@189 to rom_read [phi:main::@189->rom_read] - // [1252] phi rom_read::rom_chip#20 = rom_read::rom_chip#1 [phi:main::@189->rom_read#0] -- register_copy - // [1252] phi rom_read::rom_size#12 = rom_read::rom_size#1 [phi:main::@189->rom_read#1] -- register_copy - // [1252] phi __errno#114 = __errno#102 [phi:main::@189->rom_read#2] -- register_copy - // [1252] phi __stdio_filecount#108 = __stdio_filecount#116 [phi:main::@189->rom_read#3] -- register_copy - // [1252] phi rom_read::file#10 = rom_read::file#1 [phi:main::@189->rom_read#4] -- register_copy - // [1252] phi rom_read::brom_bank_start#10 = rom_read::brom_bank_start#2 [phi:main::@189->rom_read#5] -- register_copy - // [1252] phi rom_read::info_status#11 = STATUS_READING [phi:main::@189->rom_read#6] -- vbuz1=vbuc1 + // [444] call rom_read + // [1444] phi from main::@197 to rom_read [phi:main::@197->rom_read] + // [1444] phi rom_read::rom_chip#20 = rom_read::rom_chip#1 [phi:main::@197->rom_read#0] -- register_copy + // [1444] phi rom_read::rom_size#12 = rom_read::rom_size#1 [phi:main::@197->rom_read#1] -- register_copy + // [1444] phi __errno#103 = __errno#118 [phi:main::@197->rom_read#2] -- register_copy + // [1444] phi __stdio_filecount#126 = __stdio_filecount#114 [phi:main::@197->rom_read#3] -- register_copy + // [1444] phi rom_read::file#10 = rom_read::file#1 [phi:main::@197->rom_read#4] -- register_copy + // [1444] phi rom_read::brom_bank_start#10 = rom_read::brom_bank_start#2 [phi:main::@197->rom_read#5] -- register_copy + // [1444] phi rom_read::info_status#11 = STATUS_READING [phi:main::@197->rom_read#6] -- vbuz1=vbuc1 lda #STATUS_READING sta.z rom_read.info_status jsr rom_read // unsigned long rom_bytes_read = rom_read(rom_chip, file, STATUS_READING, rom_bank, rom_sizes[rom_chip]) - // [418] rom_read::return#3 = rom_read::return#0 - // main::@190 - // [419] main::rom_bytes_read1#0 = rom_read::return#3 + // [445] rom_read::return#3 = rom_read::return#0 + // main::@198 + // [446] main::rom_bytes_read1#0 = rom_read::return#3 // if(rom_bytes_read) - // [420] if(0==main::rom_bytes_read1#0) goto main::@44 -- 0_eq_vdum1_then_la1 + // [447] if(0==main::rom_bytes_read1#0) goto main::@46 -- 0_eq_vdum1_then_la1 lda rom_bytes_read1 ora rom_bytes_read1+1 ora rom_bytes_read1+2 ora rom_bytes_read1+3 - bne !__b44+ - jmp __b44 - !__b44: - // [421] phi from main::@190 to main::@47 [phi:main::@190->main::@47] - // main::@47 + bne !__b46+ + jmp __b46 + !__b46: + // [448] phi from main::@198 to main::@49 [phi:main::@198->main::@49] + // main::@49 // display_action_progress("Comparing ... (.) data, (=) same, (*) different.") - // [422] call display_action_progress + // [449] call display_action_progress // Now we compare the RAM with the actual ROM contents. - // [1084] phi from main::@47 to display_action_progress [phi:main::@47->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = main::info_text37 [phi:main::@47->display_action_progress#0] -- pbuz1=pbuc1 - lda #display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main::info_text36 [phi:main::@49->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text37 + lda #>info_text36 sta.z display_action_progress.info_text+1 jsr display_action_progress - // main::@191 + // main::@199 // display_info_rom(rom_chip, STATUS_COMPARING, "") - // [423] display_info_rom::rom_chip#11 = main::rom_chip3#10 -- vbum1=vbum2 + // [450] display_info_rom::rom_chip#11 = main::rom_chip3#10 -- vbum1=vbum2 lda rom_chip3 sta display_info_rom.rom_chip - // [424] call display_info_rom - // [1176] phi from main::@191 to display_info_rom [phi:main::@191->display_info_rom] - // [1176] phi display_info_rom::info_text#16 = info_text8 [phi:main::@191->display_info_rom#0] -- pbuz1=pbuc1 - lda #display_info_rom] + // [1368] phi display_info_rom::info_text#16 = str [phi:main::@199->display_info_rom#0] -- pbuz1=pbuc1 + lda #info_text8 + lda #>str sta.z display_info_rom.info_text+1 - // [1176] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#11 [phi:main::@191->display_info_rom#1] -- register_copy - // [1176] phi display_info_rom::info_status#16 = STATUS_COMPARING [phi:main::@191->display_info_rom#2] -- vbuz1=vbuc1 + // [1368] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#11 [phi:main::@199->display_info_rom#1] -- register_copy + // [1368] phi display_info_rom::info_status#16 = STATUS_COMPARING [phi:main::@199->display_info_rom#2] -- vbum1=vbuc1 lda #STATUS_COMPARING - sta.z display_info_rom.info_status + sta display_info_rom.info_status jsr display_info_rom - // main::@192 + // main::@200 // unsigned long rom_differences = rom_verify( - // rom_chip, rom_bank, file_sizes[rom_chip]) - // [425] rom_verify::rom_chip#0 = main::rom_chip3#10 -- vbum1=vbum2 + // rom_chip, rom_bank, file_sizes[rom_chip]) + // [452] rom_verify::rom_chip#0 = main::rom_chip3#10 -- vbum1=vbum2 lda rom_chip3 sta rom_verify.rom_chip - // [426] rom_verify::rom_bank_start#0 = main::rom_bank1#0 -- vbum1=vbum2 - lda rom_bank1 - sta rom_verify.rom_bank_start - // [427] rom_verify::file_size#0 = file_sizes[main::$305] -- vdum1=pduc1_derefidx_vbum2 - ldy main__305 + // [453] rom_verify::rom_bank_start#0 = main::rom_bank1#0 -- vbuxx=vbum1 + ldx rom_bank1 + // [454] rom_verify::file_size#0 = file_sizes[main::$326] -- vdum1=pduc1_derefidx_vbum2 + ldy main__326 lda file_sizes,y sta rom_verify.file_size lda file_sizes+1,y @@ -2603,135 +2647,134 @@ main: { sta rom_verify.file_size+2 lda file_sizes+3,y sta rom_verify.file_size+3 - // [428] call rom_verify + // [455] call rom_verify // Verify the ROM... - // [1332] phi from main::@192 to rom_verify [phi:main::@192->rom_verify] + // [1524] phi from main::@200 to rom_verify [phi:main::@200->rom_verify] jsr rom_verify // unsigned long rom_differences = rom_verify( - // rom_chip, rom_bank, file_sizes[rom_chip]) - // [429] rom_verify::return#2 = rom_verify::rom_different_bytes#11 - // main::@193 - // [430] main::rom_differences#0 = rom_verify::return#2 -- vduz1=vduz2 + // rom_chip, rom_bank, file_sizes[rom_chip]) + // [456] rom_verify::return#2 = rom_verify::rom_different_bytes#11 + // main::@201 + // [457] main::rom_differences#0 = rom_verify::return#2 -- vdum1=vduz2 lda.z rom_verify.return - sta.z rom_differences + sta rom_differences lda.z rom_verify.return+1 - sta.z rom_differences+1 + sta rom_differences+1 lda.z rom_verify.return+2 - sta.z rom_differences+2 + sta rom_differences+2 lda.z rom_verify.return+3 - sta.z rom_differences+3 + sta rom_differences+3 // if (!rom_differences) - // [431] if(0==main::rom_differences#0) goto main::@45 -- 0_eq_vduz1_then_la1 - lda.z rom_differences - ora.z rom_differences+1 - ora.z rom_differences+2 - ora.z rom_differences+3 - bne !__b45+ - jmp __b45 - !__b45: - // [432] phi from main::@193 to main::@48 [phi:main::@193->main::@48] - // main::@48 + // [458] if(0==main::rom_differences#0) goto main::@47 -- 0_eq_vdum1_then_la1 + lda rom_differences + ora rom_differences+1 + ora rom_differences+2 + ora rom_differences+3 + bne !__b47+ + jmp __b47 + !__b47: + // [459] phi from main::@201 to main::@50 [phi:main::@201->main::@50] + // main::@50 // sprintf(info_text, "%05x differences!", rom_differences) - // [433] call snprintf_init - // [1113] phi from main::@48 to snprintf_init [phi:main::@48->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:main::@48->snprintf_init#0] -- pbuz1=pbuc1 + // [460] call snprintf_init + // [1184] phi from main::@50 to snprintf_init [phi:main::@50->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:main::@50->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // main::@194 + // main::@202 // sprintf(info_text, "%05x differences!", rom_differences) - // [434] printf_ulong::uvalue#8 = main::rom_differences#0 -- vdum1=vduz2 - lda.z rom_differences + // [461] printf_ulong::uvalue#12 = main::rom_differences#0 -- vdum1=vdum2 + lda rom_differences sta printf_ulong.uvalue - lda.z rom_differences+1 + lda rom_differences+1 sta printf_ulong.uvalue+1 - lda.z rom_differences+2 + lda rom_differences+2 sta printf_ulong.uvalue+2 - lda.z rom_differences+3 + lda rom_differences+3 sta printf_ulong.uvalue+3 - // [435] call printf_ulong - // [1396] phi from main::@194 to printf_ulong [phi:main::@194->printf_ulong] - // [1396] phi printf_ulong::format_zero_padding#10 = 1 [phi:main::@194->printf_ulong#0] -- vbum1=vbuc1 + // [462] call printf_ulong + // [1588] phi from main::@202 to printf_ulong [phi:main::@202->printf_ulong] + // [1588] phi printf_ulong::format_zero_padding#14 = 1 [phi:main::@202->printf_ulong#0] -- vbum1=vbuc1 lda #1 sta printf_ulong.format_zero_padding - // [1396] phi printf_ulong::format_min_length#10 = 5 [phi:main::@194->printf_ulong#1] -- vbum1=vbuc1 + // [1588] phi printf_ulong::format_min_length#14 = 5 [phi:main::@202->printf_ulong#1] -- vbum1=vbuc1 lda #5 sta printf_ulong.format_min_length - // [1396] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:main::@194->printf_ulong#2] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_ulong.format_radix - // [1396] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#8 [phi:main::@194->printf_ulong#3] -- register_copy + // [1588] phi printf_ulong::format_radix#14 = HEXADECIMAL [phi:main::@202->printf_ulong#2] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1588] phi printf_ulong::uvalue#14 = printf_ulong::uvalue#12 [phi:main::@202->printf_ulong#3] -- register_copy jsr printf_ulong - // [436] phi from main::@194 to main::@195 [phi:main::@194->main::@195] - // main::@195 + // [463] phi from main::@202 to main::@203 [phi:main::@202->main::@203] + // main::@203 // sprintf(info_text, "%05x differences!", rom_differences) - // [437] call printf_str - // [1054] phi from main::@195 to printf_str [phi:main::@195->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@195->printf_str#0] -- pprz1=pprc1 + // [464] call printf_str + // [1125] phi from main::@203 to printf_str [phi:main::@203->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@203->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s11 [phi:main::@195->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s11 [phi:main::@203->printf_str#1] -- pbuz1=pbuc1 lda #s11 sta.z printf_str.s+1 jsr printf_str - // main::@196 + // main::@204 // sprintf(info_text, "%05x differences!", rom_differences) - // [438] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [465] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [439] callexecute snputc -- call_vprc1 + // [466] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_info_rom(rom_chip, STATUS_FLASH, info_text) - // [441] display_info_rom::rom_chip#13 = main::rom_chip3#10 -- vbum1=vbum2 + // [468] display_info_rom::rom_chip#13 = main::rom_chip3#10 -- vbum1=vbum2 lda rom_chip3 sta display_info_rom.rom_chip - // [442] call display_info_rom - // [1176] phi from main::@196 to display_info_rom [phi:main::@196->display_info_rom] - // [1176] phi display_info_rom::info_text#16 = info_text [phi:main::@196->display_info_rom#0] -- pbuz1=pbuc1 + // [469] call display_info_rom + // [1368] phi from main::@204 to display_info_rom [phi:main::@204->display_info_rom] + // [1368] phi display_info_rom::info_text#16 = info_text [phi:main::@204->display_info_rom#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_info_rom.info_text lda #>@info_text sta.z display_info_rom.info_text+1 - // [1176] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#13 [phi:main::@196->display_info_rom#1] -- register_copy - // [1176] phi display_info_rom::info_status#16 = STATUS_FLASH [phi:main::@196->display_info_rom#2] -- vbuz1=vbuc1 + // [1368] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#13 [phi:main::@204->display_info_rom#1] -- register_copy + // [1368] phi display_info_rom::info_status#16 = STATUS_FLASH [phi:main::@204->display_info_rom#2] -- vbum1=vbuc1 lda #STATUS_FLASH - sta.z display_info_rom.info_status + sta display_info_rom.info_status jsr display_info_rom - // main::@197 + // main::@205 // unsigned long rom_flash_errors = rom_flash( - // rom_chip, rom_bank, file_sizes[rom_chip]) - // [443] rom_flash::rom_chip#0 = main::rom_chip3#10 -- vbum1=vbum2 + // rom_chip, rom_bank, file_sizes[rom_chip]) + // [470] rom_flash::rom_chip#0 = main::rom_chip3#10 -- vbum1=vbum2 lda rom_chip3 sta rom_flash.rom_chip - // [444] rom_flash::rom_bank_start#0 = main::rom_bank1#0 -- vbum1=vbum2 + // [471] rom_flash::rom_bank_start#0 = main::rom_bank1#0 -- vbum1=vbum2 lda rom_bank1 sta rom_flash.rom_bank_start - // [445] rom_flash::file_size#0 = file_sizes[main::$305] -- vdum1=pduc1_derefidx_vbum2 - ldy main__305 + // [472] rom_flash::file_size#0 = file_sizes[main::$326] -- vduz1=pduc1_derefidx_vbum2 + ldy main__326 lda file_sizes,y - sta rom_flash.file_size + sta.z rom_flash.file_size lda file_sizes+1,y - sta rom_flash.file_size+1 + sta.z rom_flash.file_size+1 lda file_sizes+2,y - sta rom_flash.file_size+2 + sta.z rom_flash.file_size+2 lda file_sizes+3,y - sta rom_flash.file_size+3 - // [446] call rom_flash - // [1406] phi from main::@197 to rom_flash [phi:main::@197->rom_flash] + sta.z rom_flash.file_size+3 + // [473] call rom_flash + // [1598] phi from main::@205 to rom_flash [phi:main::@205->rom_flash] jsr rom_flash // unsigned long rom_flash_errors = rom_flash( - // rom_chip, rom_bank, file_sizes[rom_chip]) - // [447] rom_flash::return#2 = rom_flash::flash_errors#12 - // main::@198 - // [448] main::rom_flash_errors#0 = rom_flash::return#2 -- vdum1=vduz2 + // rom_chip, rom_bank, file_sizes[rom_chip]) + // [474] rom_flash::return#2 = rom_flash::flash_errors#2 + // main::@206 + // [475] main::rom_flash_errors#0 = rom_flash::return#2 -- vdum1=vduz2 lda.z rom_flash.return sta rom_flash_errors lda.z rom_flash.return+1 @@ -2741,45 +2784,45 @@ main: { lda.z rom_flash.return+3 sta rom_flash_errors+3 // if(rom_flash_errors) - // [449] if(0!=main::rom_flash_errors#0) goto main::@46 -- 0_neq_vdum1_then_la1 + // [476] if(0!=main::rom_flash_errors#0) goto main::@48 -- 0_neq_vdum1_then_la1 lda rom_flash_errors ora rom_flash_errors+1 ora rom_flash_errors+2 ora rom_flash_errors+3 - bne __b46 - // main::@49 + bne __b48 + // main::@51 // display_info_rom(rom_chip, STATUS_FLASHED, NULL) - // [450] display_info_rom::rom_chip#15 = main::rom_chip3#10 -- vbum1=vbum2 + // [477] display_info_rom::rom_chip#15 = main::rom_chip3#10 -- vbum1=vbum2 lda rom_chip3 sta display_info_rom.rom_chip - // [451] call display_info_rom + // [478] call display_info_rom // RFL3 | Flash ROM and all ok - // [1176] phi from main::@49 to display_info_rom [phi:main::@49->display_info_rom] - // [1176] phi display_info_rom::info_text#16 = 0 [phi:main::@49->display_info_rom#0] -- pbuz1=vbuc1 + // [1368] phi from main::@51 to display_info_rom [phi:main::@51->display_info_rom] + // [1368] phi display_info_rom::info_text#16 = 0 [phi:main::@51->display_info_rom#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_rom.info_text sta.z display_info_rom.info_text+1 - // [1176] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#15 [phi:main::@49->display_info_rom#1] -- register_copy - // [1176] phi display_info_rom::info_status#16 = STATUS_FLASHED [phi:main::@49->display_info_rom#2] -- vbuz1=vbuc1 + // [1368] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#15 [phi:main::@51->display_info_rom#1] -- register_copy + // [1368] phi display_info_rom::info_status#16 = STATUS_FLASHED [phi:main::@51->display_info_rom#2] -- vbum1=vbuc1 lda #STATUS_FLASHED - sta.z display_info_rom.info_status + sta display_info_rom.info_status jsr display_info_rom - jmp __b44 - // [452] phi from main::@198 to main::@46 [phi:main::@198->main::@46] - // main::@46 - __b46: + jmp __b46 + // [479] phi from main::@206 to main::@48 [phi:main::@206->main::@48] + // main::@48 + __b48: // sprintf(info_text, "%u flash errors!", rom_flash_errors) - // [453] call snprintf_init - // [1113] phi from main::@46 to snprintf_init [phi:main::@46->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:main::@46->snprintf_init#0] -- pbuz1=pbuc1 + // [480] call snprintf_init + // [1184] phi from main::@48 to snprintf_init [phi:main::@48->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:main::@48->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // main::@199 + // main::@207 // sprintf(info_text, "%u flash errors!", rom_flash_errors) - // [454] printf_ulong::uvalue#9 = main::rom_flash_errors#0 -- vdum1=vdum2 + // [481] printf_ulong::uvalue#13 = main::rom_flash_errors#0 -- vdum1=vdum2 lda rom_flash_errors sta printf_ulong.uvalue lda rom_flash_errors+1 @@ -2788,968 +2831,948 @@ main: { sta printf_ulong.uvalue+2 lda rom_flash_errors+3 sta printf_ulong.uvalue+3 - // [455] call printf_ulong - // [1396] phi from main::@199 to printf_ulong [phi:main::@199->printf_ulong] - // [1396] phi printf_ulong::format_zero_padding#10 = 0 [phi:main::@199->printf_ulong#0] -- vbum1=vbuc1 + // [482] call printf_ulong + // [1588] phi from main::@207 to printf_ulong [phi:main::@207->printf_ulong] + // [1588] phi printf_ulong::format_zero_padding#14 = 0 [phi:main::@207->printf_ulong#0] -- vbum1=vbuc1 lda #0 sta printf_ulong.format_zero_padding - // [1396] phi printf_ulong::format_min_length#10 = 0 [phi:main::@199->printf_ulong#1] -- vbum1=vbuc1 + // [1588] phi printf_ulong::format_min_length#14 = 0 [phi:main::@207->printf_ulong#1] -- vbum1=vbuc1 sta printf_ulong.format_min_length - // [1396] phi printf_ulong::format_radix#10 = DECIMAL [phi:main::@199->printf_ulong#2] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_ulong.format_radix - // [1396] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#9 [phi:main::@199->printf_ulong#3] -- register_copy + // [1588] phi printf_ulong::format_radix#14 = DECIMAL [phi:main::@207->printf_ulong#2] -- vbuxx=vbuc1 + ldx #DECIMAL + // [1588] phi printf_ulong::uvalue#14 = printf_ulong::uvalue#13 [phi:main::@207->printf_ulong#3] -- register_copy jsr printf_ulong - // [456] phi from main::@199 to main::@200 [phi:main::@199->main::@200] - // main::@200 + // [483] phi from main::@207 to main::@208 [phi:main::@207->main::@208] + // main::@208 // sprintf(info_text, "%u flash errors!", rom_flash_errors) - // [457] call printf_str - // [1054] phi from main::@200 to printf_str [phi:main::@200->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@200->printf_str#0] -- pprz1=pprc1 + // [484] call printf_str + // [1125] phi from main::@208 to printf_str [phi:main::@208->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@208->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s12 [phi:main::@200->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s12 [phi:main::@208->printf_str#1] -- pbuz1=pbuc1 lda #s12 sta.z printf_str.s+1 jsr printf_str - // main::@201 + // main::@209 // sprintf(info_text, "%u flash errors!", rom_flash_errors) - // [458] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [485] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [459] callexecute snputc -- call_vprc1 + // [486] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_info_rom(rom_chip, STATUS_ERROR, info_text) - // [461] display_info_rom::rom_chip#14 = main::rom_chip3#10 -- vbum1=vbum2 + // [488] display_info_rom::rom_chip#14 = main::rom_chip3#10 -- vbum1=vbum2 lda rom_chip3 sta display_info_rom.rom_chip - // [462] call display_info_rom - // [1176] phi from main::@201 to display_info_rom [phi:main::@201->display_info_rom] - // [1176] phi display_info_rom::info_text#16 = info_text [phi:main::@201->display_info_rom#0] -- pbuz1=pbuc1 + // [489] call display_info_rom + // [1368] phi from main::@209 to display_info_rom [phi:main::@209->display_info_rom] + // [1368] phi display_info_rom::info_text#16 = info_text [phi:main::@209->display_info_rom#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_info_rom.info_text lda #>@info_text sta.z display_info_rom.info_text+1 - // [1176] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#14 [phi:main::@201->display_info_rom#1] -- register_copy - // [1176] phi display_info_rom::info_status#16 = STATUS_ERROR [phi:main::@201->display_info_rom#2] -- vbuz1=vbuc1 + // [1368] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#14 [phi:main::@209->display_info_rom#1] -- register_copy + // [1368] phi display_info_rom::info_status#16 = STATUS_ERROR [phi:main::@209->display_info_rom#2] -- vbum1=vbuc1 lda #STATUS_ERROR - sta.z display_info_rom.info_status + sta display_info_rom.info_status jsr display_info_rom - jmp __b44 - // main::@45 - __b45: + jmp __b46 + // main::@47 + __b47: // display_info_rom(rom_chip, STATUS_SKIP, "No update required") - // [463] display_info_rom::rom_chip#12 = main::rom_chip3#10 -- vbum1=vbum2 + // [490] display_info_rom::rom_chip#12 = main::rom_chip3#10 -- vbum1=vbum2 lda rom_chip3 sta display_info_rom.rom_chip - // [464] call display_info_rom + // [491] call display_info_rom // RFL1 | ROM and ROM.BIN equal | Display that there are no differences between the ROM and ROM.BIN. Set ROM to Flashed. | None - // [1176] phi from main::@45 to display_info_rom [phi:main::@45->display_info_rom] - // [1176] phi display_info_rom::info_text#16 = main::info_text39 [phi:main::@45->display_info_rom#0] -- pbuz1=pbuc1 - lda #display_info_rom] + // [1368] phi display_info_rom::info_text#16 = info_text6 [phi:main::@47->display_info_rom#0] -- pbuz1=pbuc1 + lda #<@info_text6 sta.z display_info_rom.info_text - lda #>info_text39 + lda #>@info_text6 sta.z display_info_rom.info_text+1 - // [1176] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#12 [phi:main::@45->display_info_rom#1] -- register_copy - // [1176] phi display_info_rom::info_status#16 = STATUS_SKIP [phi:main::@45->display_info_rom#2] -- vbuz1=vbuc1 + // [1368] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#12 [phi:main::@47->display_info_rom#1] -- register_copy + // [1368] phi display_info_rom::info_status#16 = STATUS_SKIP [phi:main::@47->display_info_rom#2] -- vbum1=vbuc1 lda #STATUS_SKIP - sta.z display_info_rom.info_status + sta display_info_rom.info_status jsr display_info_rom - jmp __b44 - // main::@257 - __b257: + jmp __b46 + // main::@267 + __b267: // if((rom_chip == 0 && (check_status_smc(STATUS_FLASHED) || check_status_smc(STATUS_SKIP))) || (rom_chip != 0)) - // [465] if(0!=main::check_status_smc12_return#0) goto main::bank_set_brom5 -- 0_neq_vbuz1_then_la1 - lda.z check_status_smc12_return - beq !bank_set_brom5+ - jmp bank_set_brom5 - !bank_set_brom5: - // main::@265 - // [466] if(0!=main::check_status_smc13_return#0) goto main::bank_set_brom5 -- 0_neq_vbuz1_then_la1 - lda.z check_status_smc13_return - beq !bank_set_brom5+ - jmp bank_set_brom5 - !bank_set_brom5: - jmp __b256 - // [467] phi from main::@255 to main::@51 [phi:main::@255->main::@51] - // main::@51 - __b51: + // [492] if(0!=main::check_status_smc12_return#0) goto main::bank_set_brom9 -- 0_neq_vbuyy_then_la1 + cpy #0 + beq !bank_set_brom9+ + jmp bank_set_brom9 + !bank_set_brom9: + // main::@275 + // [493] if(0!=main::check_status_smc13_return#0) goto main::bank_set_brom9 -- 0_neq_vbuxx_then_la1 + cpx #0 + beq !bank_set_brom9+ + jmp bank_set_brom9 + !bank_set_brom9: + jmp __b266 + // [494] phi from main::@265 to main::@54 [phi:main::@265->main::@54] + // main::@54 + __b54: // display_action_progress("Reading SMC.BIN ... (.) data, ( ) empty") - // [468] call display_action_progress - // [1084] phi from main::@51 to display_action_progress [phi:main::@51->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = main::info_text30 [phi:main::@51->display_action_progress#0] -- pbuz1=pbuc1 + // [495] call display_action_progress + // [1155] phi from main::@54 to display_action_progress [phi:main::@54->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main::info_text30 [phi:main::@54->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text30 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [469] phi from main::@51 to main::@177 [phi:main::@51->main::@177] - // main::@177 + // [496] phi from main::@54 to main::@185 [phi:main::@54->main::@185] + // main::@185 // display_progress_clear() - // [470] call display_progress_clear - // [1161] phi from main::@177 to display_progress_clear [phi:main::@177->display_progress_clear] + // [497] call display_progress_clear + // [1037] phi from main::@185 to display_progress_clear [phi:main::@185->display_progress_clear] jsr display_progress_clear - // [471] phi from main::@177 to main::@178 [phi:main::@177->main::@178] - // main::@178 + // [498] phi from main::@185 to main::@186 [phi:main::@185->main::@186] + // main::@186 // smc_read(STATUS_READING) - // [472] call smc_read - // [1505] phi from main::@178 to smc_read [phi:main::@178->smc_read] - // [1505] phi __errno#109 = __errno#100 [phi:main::@178->smc_read#0] -- register_copy - // [1505] phi __stdio_filecount#104 = __stdio_filecount#114 [phi:main::@178->smc_read#1] -- register_copy - // [1505] phi smc_read::info_status#10 = STATUS_READING [phi:main::@178->smc_read#2] -- vbuz1=vbuc1 + // [499] call smc_read + // [1691] phi from main::@186 to smc_read [phi:main::@186->smc_read] + // [1691] phi __errno#100 = __errno#117 [phi:main::@186->smc_read#0] -- register_copy + // [1691] phi __stdio_filecount#123 = __stdio_filecount#113 [phi:main::@186->smc_read#1] -- register_copy + // [1691] phi smc_read::info_status#10 = STATUS_READING [phi:main::@186->smc_read#2] -- vbum1=vbuc1 lda #STATUS_READING - sta.z smc_read.info_status + sta smc_read.info_status jsr smc_read // smc_read(STATUS_READING) - // [473] smc_read::return#3 = smc_read::return#0 - // main::@179 + // [500] smc_read::return#3 = smc_read::return#0 + // main::@187 // smc_file_size = smc_read(STATUS_READING) - // [474] smc_file_size#1 = smc_read::return#3 -- vwum1=vwuz2 + // [501] smc_file_size#1 = smc_read::return#3 -- vwum1=vwuz2 lda.z smc_read.return sta smc_file_size_1 lda.z smc_read.return+1 sta smc_file_size_1+1 // if(smc_file_size) - // [475] if(0==smc_file_size#1) goto main::SEI3 -- 0_eq_vwum1_then_la1 + // [502] if(0==smc_file_size#1) goto main::SEI5 -- 0_eq_vwum1_then_la1 lda smc_file_size_1 ora smc_file_size_1+1 - bne !SEI3+ - jmp SEI3 - !SEI3: - // [476] phi from main::@179 to main::@52 [phi:main::@179->main::@52] - // main::@52 + bne !SEI5+ + jmp SEI5 + !SEI5: + // [503] phi from main::@187 to main::@55 [phi:main::@187->main::@55] + // main::@55 // display_action_text("Press both POWER/RESET buttons on the CX16 board!") - // [477] call display_action_text + // [504] call display_action_text // Flash the SMC chip. - // [1129] phi from main::@52 to display_action_text [phi:main::@52->display_action_text] - // [1129] phi display_action_text::info_text#17 = main::info_text31 [phi:main::@52->display_action_text#0] -- pbuz1=pbuc1 + // [1200] phi from main::@55 to display_action_text [phi:main::@55->display_action_text] + // [1200] phi display_action_text::info_text#25 = main::info_text31 [phi:main::@55->display_action_text#0] -- pbuz1=pbuc1 lda #info_text31 sta.z display_action_text.info_text+1 jsr display_action_text - // main::@180 - // [478] smc_bootloader#467 = smc_bootloader#0 -- vwum1=vwum2 + // main::@188 + // [505] smc_bootloader#590 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_FLASHING, "Press POWER/RESET!") - // [479] call display_info_smc - // [898] phi from main::@180 to display_info_smc [phi:main::@180->display_info_smc] - // [898] phi display_info_smc::info_text#21 = main::info_text32 [phi:main::@180->display_info_smc#0] -- pbuz1=pbuc1 + // [506] call display_info_smc + // [925] phi from main::@188 to display_info_smc [phi:main::@188->display_info_smc] + // [925] phi display_info_smc::info_text#24 = main::info_text32 [phi:main::@188->display_info_smc#0] -- pbuz1=pbuc1 lda #info_text32 sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#467 [phi:main::@180->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_FLASHING [phi:main::@180->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#590 [phi:main::@188->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_FLASHING [phi:main::@188->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_FLASHING - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - // main::@181 + // main::@189 // unsigned int flashed_bytes = smc_flash(smc_file_size) - // [480] smc_flash::smc_bytes_total#0 = smc_file_size#1 -- vwum1=vwum2 + // [507] smc_flash::smc_bytes_total#0 = smc_file_size#1 -- vwum1=vwum2 lda smc_file_size_1 sta smc_flash.smc_bytes_total lda smc_file_size_1+1 sta smc_flash.smc_bytes_total+1 - // [481] call smc_flash - // [1555] phi from main::@181 to smc_flash [phi:main::@181->smc_flash] + // [508] call smc_flash + // [1741] phi from main::@189 to smc_flash [phi:main::@189->smc_flash] jsr smc_flash // unsigned int flashed_bytes = smc_flash(smc_file_size) - // [482] smc_flash::return#5 = smc_flash::return#1 - // main::@182 - // [483] main::flashed_bytes#0 = smc_flash::return#5 + // [509] smc_flash::return#5 = smc_flash::return#1 + // main::@190 + // [510] main::flashed_bytes#0 = smc_flash::return#5 // if(flashed_bytes) - // [484] if(0!=main::flashed_bytes#0) goto main::@40 -- 0_neq_vwum1_then_la1 + // [511] if(0!=main::flashed_bytes#0) goto main::@42 -- 0_neq_vwum1_then_la1 lda flashed_bytes ora flashed_bytes+1 - bne __b40 - // main::@53 + bne __b42 + // main::@56 // if(flashed_bytes == (unsigned int)0xFFFF) - // [485] if(main::flashed_bytes#0==$ffff) goto main::@41 -- vwum1_eq_vwuc1_then_la1 + // [512] if(main::flashed_bytes#0==$ffff) goto main::@43 -- vwum1_eq_vwuc1_then_la1 lda flashed_bytes cmp #<$ffff bne !+ lda flashed_bytes+1 cmp #>$ffff - beq __b41 + beq __b43 !: - // main::@54 - // [486] smc_bootloader#474 = smc_bootloader#0 -- vwum1=vwum2 + // main::@57 + // [513] smc_bootloader#597 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_ISSUE, "POWER/RESET not pressed!") - // [487] call display_info_smc + // [514] call display_info_smc // SFL2 | no action on POWER/RESET press request - // [898] phi from main::@54 to display_info_smc [phi:main::@54->display_info_smc] - // [898] phi display_info_smc::info_text#21 = main::info_text35 [phi:main::@54->display_info_smc#0] -- pbuz1=pbuc1 - lda #display_info_smc] + // [925] phi display_info_smc::info_text#24 = main::info_text34 [phi:main::@57->display_info_smc#0] -- pbuz1=pbuc1 + lda #info_text35 + lda #>info_text34 sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#474 [phi:main::@54->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_ISSUE [phi:main::@54->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#597 [phi:main::@57->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_ISSUE [phi:main::@57->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_ISSUE - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - jmp SEI3 - // main::@41 - __b41: - // [488] smc_bootloader#473 = smc_bootloader#0 -- vwum1=vwum2 + jmp SEI5 + // main::@43 + __b43: + // [515] smc_bootloader#596 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_ERROR, "SMC has errors!") - // [489] call display_info_smc + // [516] call display_info_smc // SFL3 | errors during flash - // [898] phi from main::@41 to display_info_smc [phi:main::@41->display_info_smc] - // [898] phi display_info_smc::info_text#21 = main::info_text34 [phi:main::@41->display_info_smc#0] -- pbuz1=pbuc1 - lda #display_info_smc] + // [925] phi display_info_smc::info_text#24 = main::info_text33 [phi:main::@43->display_info_smc#0] -- pbuz1=pbuc1 + lda #info_text34 + lda #>info_text33 sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#473 [phi:main::@41->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_ERROR [phi:main::@41->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#596 [phi:main::@43->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_ERROR [phi:main::@43->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_ERROR - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - jmp SEI3 - // main::@40 - __b40: - // [490] smc_bootloader#472 = smc_bootloader#0 -- vwum1=vwum2 + jmp SEI5 + // main::@42 + __b42: + // [517] smc_bootloader#595 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 - // display_info_smc(STATUS_FLASHED, "") - // [491] call display_info_smc + // display_info_smc(STATUS_FLASHED, NULL) + // [518] call display_info_smc // SFL1 | and POWER/RESET pressed - // [898] phi from main::@40 to display_info_smc [phi:main::@40->display_info_smc] - // [898] phi display_info_smc::info_text#21 = info_text8 [phi:main::@40->display_info_smc#0] -- pbuz1=pbuc1 - lda #display_info_smc] + // [925] phi display_info_smc::info_text#24 = 0 [phi:main::@42->display_info_smc#0] -- pbuz1=vbuc1 + lda #<0 sta.z display_info_smc.info_text - lda #>info_text8 sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#472 [phi:main::@40->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_FLASHED [phi:main::@40->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#595 [phi:main::@42->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_FLASHED [phi:main::@42->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_FLASHED - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - jmp SEI3 - // [492] phi from main::@171 main::@252 main::@253 main::@254 to main::@14 [phi:main::@171/main::@252/main::@253/main::@254->main::@14] - // main::@14 - __b14: + jmp SEI5 + // [519] phi from main::@179 main::@262 main::@263 main::@264 to main::@16 [phi:main::@179/main::@262/main::@263/main::@264->main::@16] + // main::@16 + __b16: // display_action_progress("Chipsets have been detected and update files validated!") - // [493] call display_action_progress - // [1084] phi from main::@14 to display_action_progress [phi:main::@14->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = main::info_text24 [phi:main::@14->display_action_progress#0] -- pbuz1=pbuc1 + // [520] call display_action_progress + // [1155] phi from main::@16 to display_action_progress [phi:main::@16->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main::info_text24 [phi:main::@16->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text24 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [494] phi from main::@14 to main::@172 [phi:main::@14->main::@172] - // main::@172 + // [521] phi from main::@16 to main::@180 [phi:main::@16->main::@180] + // main::@180 // unsigned char ch = util_wait_key("Continue with update of highlighted chipsets? [Y/N]", "nyNY") - // [495] call util_wait_key - // [1704] phi from main::@172 to util_wait_key [phi:main::@172->util_wait_key] - // [1704] phi util_wait_key::filter#16 = main::filter4 [phi:main::@172->util_wait_key#0] -- pbuz1=pbuc1 + // [522] call util_wait_key + // [1896] phi from main::@180 to util_wait_key [phi:main::@180->util_wait_key] + // [1896] phi util_wait_key::filter#16 = main::filter4 [phi:main::@180->util_wait_key#0] -- pbuz1=pbuc1 lda #filter4 sta.z util_wait_key.filter+1 - // [1704] phi util_wait_key::info_text#6 = main::info_text25 [phi:main::@172->util_wait_key#1] -- pbuz1=pbuc1 + // [1896] phi util_wait_key::info_text#6 = main::info_text25 [phi:main::@180->util_wait_key#1] -- pbuz1=pbuc1 lda #info_text25 sta.z util_wait_key.info_text+1 jsr util_wait_key // unsigned char ch = util_wait_key("Continue with update of highlighted chipsets? [Y/N]", "nyNY") - // [496] util_wait_key::return#13 = util_wait_key::ch#4 -- vbum1=vwum2 + // [523] util_wait_key::return#13 = util_wait_key::ch#4 -- vbuaa=vwum1 lda util_wait_key.ch - sta util_wait_key.return_4 - // main::@173 - // [497] main::ch4#0 = util_wait_key::return#13 + // main::@181 + // [524] main::ch4#0 = util_wait_key::return#13 // strchr("nN", ch) - // [498] strchr::c#1 = main::ch4#0 -- vbum1=vbum2 - lda ch4 + // [525] strchr::c#1 = main::ch4#0 -- vbum1=vbuaa sta strchr.c - // [499] call strchr - // [1729] phi from main::@173 to strchr [phi:main::@173->strchr] - // [1729] phi strchr::c#4 = strchr::c#1 [phi:main::@173->strchr#0] -- register_copy - // [1729] phi strchr::str#2 = (const void *)main::$330 [phi:main::@173->strchr#1] -- pvoz1=pvoc1 - lda #strchr] + // [1921] phi strchr::c#4 = strchr::c#1 [phi:main::@181->strchr#0] -- register_copy + // [1921] phi strchr::str#2 = (const void *)main::$354 [phi:main::@181->strchr#1] -- pvoz1=pvoc1 + lda #main__330 + lda #>main__354 sta.z strchr.str+1 jsr strchr // strchr("nN", ch) - // [500] strchr::return#4 = strchr::return#2 - // main::@174 - // [501] main::$191 = strchr::return#4 + // [527] strchr::return#4 = strchr::return#2 + // main::@182 + // [528] main::$198 = strchr::return#4 // if(strchr("nN", ch)) - // [502] if((void *)0==main::$191) goto main::check_status_smc11 -- pvoc1_eq_pvoz1_then_la1 - lda.z main__191 + // [529] if((void *)0==main::$198) goto main::bank_set_brom7 -- pvoc1_eq_pvoz1_then_la1 + lda.z main__198 cmp #<0 bne !+ - lda.z main__191+1 + lda.z main__198+1 cmp #>0 - bne !check_status_smc11+ - jmp check_status_smc11 - !check_status_smc11: + bne !bank_set_brom7+ + jmp bank_set_brom7 + !bank_set_brom7: !: - // main::@15 - // [503] smc_bootloader#468 = smc_bootloader#0 -- vwum1=vwum2 + // main::@17 + // [530] smc_bootloader#591 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_SKIP, "Cancelled") - // [504] call display_info_smc + // [531] call display_info_smc // We cancel all updates, the updates are skipped. - // [898] phi from main::@15 to display_info_smc [phi:main::@15->display_info_smc] - // [898] phi display_info_smc::info_text#21 = main::info_text26 [phi:main::@15->display_info_smc#0] -- pbuz1=pbuc1 + // [925] phi from main::@17 to display_info_smc [phi:main::@17->display_info_smc] + // [925] phi display_info_smc::info_text#24 = main::info_text26 [phi:main::@17->display_info_smc#0] -- pbuz1=pbuc1 lda #info_text26 sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#468 [phi:main::@15->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_SKIP [phi:main::@15->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#591 [phi:main::@17->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_SKIP [phi:main::@17->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_SKIP - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - // [505] phi from main::@15 to main::@175 [phi:main::@15->main::@175] - // main::@175 + // [532] phi from main::@17 to main::@183 [phi:main::@17->main::@183] + // main::@183 // display_info_vera(STATUS_SKIP, "Cancelled") - // [506] call display_info_vera - // [1738] phi from main::@175 to display_info_vera [phi:main::@175->display_info_vera] - // [1738] phi display_info_vera::info_text#10 = main::info_text26 [phi:main::@175->display_info_vera#0] -- pbuz1=pbuc1 + // [533] call display_info_vera + // [1930] phi from main::@183 to display_info_vera [phi:main::@183->display_info_vera] + // [1930] phi display_info_vera::info_text#15 = main::info_text26 [phi:main::@183->display_info_vera#0] -- pbuz1=pbuc1 lda #info_text26 sta.z display_info_vera.info_text+1 - // [1738] phi display_info_vera::info_status#2 = STATUS_SKIP [phi:main::@175->display_info_vera#1] -- vbum1=vbuc1 + // [1930] phi display_info_vera::info_status#15 = STATUS_SKIP [phi:main::@183->display_info_vera#1] -- vbum1=vbuc1 lda #STATUS_SKIP sta display_info_vera.info_status jsr display_info_vera - // [507] phi from main::@175 to main::@37 [phi:main::@175->main::@37] - // [507] phi main::rom_chip2#2 = 0 [phi:main::@175->main::@37#0] -- vbum1=vbuc1 + // [534] phi from main::@183 to main::@39 [phi:main::@183->main::@39] + // [534] phi main::rom_chip2#2 = 0 [phi:main::@183->main::@39#0] -- vbum1=vbuc1 lda #0 sta rom_chip2 - // main::@37 - __b37: + // main::@39 + __b39: // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [508] if(main::rom_chip2#2<8) goto main::@38 -- vbum1_lt_vbuc1_then_la1 + // [535] if(main::rom_chip2#2<8) goto main::@40 -- vbum1_lt_vbuc1_then_la1 lda rom_chip2 cmp #8 - bcc __b38 - // [509] phi from main::@37 to main::@39 [phi:main::@37->main::@39] - // main::@39 + bcc __b40 + // [536] phi from main::@39 to main::@41 [phi:main::@39->main::@41] + // main::@41 // display_action_text("You have selected not to cancel the update ... ") - // [510] call display_action_text - // [1129] phi from main::@39 to display_action_text [phi:main::@39->display_action_text] - // [1129] phi display_action_text::info_text#17 = main::info_text29 [phi:main::@39->display_action_text#0] -- pbuz1=pbuc1 + // [537] call display_action_text + // [1200] phi from main::@41 to display_action_text [phi:main::@41->display_action_text] + // [1200] phi display_action_text::info_text#25 = main::info_text29 [phi:main::@41->display_action_text#0] -- pbuz1=pbuc1 lda #info_text29 sta.z display_action_text.info_text+1 jsr display_action_text - jmp check_status_smc11 - // main::@38 - __b38: + jmp bank_set_brom7 + // main::@40 + __b40: // display_info_rom(rom_chip, STATUS_SKIP, "Cancelled") - // [511] display_info_rom::rom_chip#9 = main::rom_chip2#2 -- vbum1=vbum2 + // [538] display_info_rom::rom_chip#9 = main::rom_chip2#2 -- vbum1=vbum2 lda rom_chip2 sta display_info_rom.rom_chip - // [512] call display_info_rom - // [1176] phi from main::@38 to display_info_rom [phi:main::@38->display_info_rom] - // [1176] phi display_info_rom::info_text#16 = main::info_text26 [phi:main::@38->display_info_rom#0] -- pbuz1=pbuc1 + // [539] call display_info_rom + // [1368] phi from main::@40 to display_info_rom [phi:main::@40->display_info_rom] + // [1368] phi display_info_rom::info_text#16 = main::info_text26 [phi:main::@40->display_info_rom#0] -- pbuz1=pbuc1 lda #info_text26 sta.z display_info_rom.info_text+1 - // [1176] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#9 [phi:main::@38->display_info_rom#1] -- register_copy - // [1176] phi display_info_rom::info_status#16 = STATUS_SKIP [phi:main::@38->display_info_rom#2] -- vbuz1=vbuc1 + // [1368] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#9 [phi:main::@40->display_info_rom#1] -- register_copy + // [1368] phi display_info_rom::info_status#16 = STATUS_SKIP [phi:main::@40->display_info_rom#2] -- vbum1=vbuc1 lda #STATUS_SKIP - sta.z display_info_rom.info_status + sta display_info_rom.info_status jsr display_info_rom - // main::@176 + // main::@184 // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [513] main::rom_chip2#1 = ++ main::rom_chip2#2 -- vbum1=_inc_vbum1 + // [540] main::rom_chip2#1 = ++ main::rom_chip2#2 -- vbum1=_inc_vbum1 inc rom_chip2 - // [507] phi from main::@176 to main::@37 [phi:main::@176->main::@37] - // [507] phi main::rom_chip2#2 = main::rom_chip2#1 [phi:main::@176->main::@37#0] -- register_copy - jmp __b37 - // [514] phi from main::@245 to main::@13 [phi:main::@245->main::@13] - // main::@13 - __b13: - // display_action_progress("The CX16 main ROM and ROM.BIN versions are equal, no flash required!") - // [515] call display_action_progress - // [1084] phi from main::@13 to display_action_progress [phi:main::@13->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = main::info_text23 [phi:main::@13->display_action_progress#0] -- pbuz1=pbuc1 + // [534] phi from main::@184 to main::@39 [phi:main::@184->main::@39] + // [534] phi main::rom_chip2#2 = main::rom_chip2#1 [phi:main::@184->main::@39#0] -- register_copy + jmp __b39 + // [541] phi from main::@255 to main::@15 [phi:main::@255->main::@15] + // main::@15 + __b15: + // display_action_progress("The CX16 ROM and ROM.BIN versions are equal, no flash required!") + // [542] call display_action_progress + // [1155] phi from main::@15 to display_action_progress [phi:main::@15->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main::info_text23 [phi:main::@15->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text23 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [516] phi from main::@13 to main::@169 [phi:main::@13->main::@169] - // main::@169 + // [543] phi from main::@15 to main::@177 [phi:main::@15->main::@177] + // main::@177 // util_wait_space() - // [517] call util_wait_space - // [1778] phi from main::@169 to util_wait_space [phi:main::@169->util_wait_space] + // [544] call util_wait_space + // [1958] phi from main::@177 to util_wait_space [phi:main::@177->util_wait_space] jsr util_wait_space - // [518] phi from main::@169 to main::@170 [phi:main::@169->main::@170] - // main::@170 + // [545] phi from main::@177 to main::@178 [phi:main::@177->main::@178] + // main::@178 // display_info_cx16_rom(STATUS_SKIP, NULL) - // [519] call display_info_cx16_rom - // [1781] phi from main::@170 to display_info_cx16_rom [phi:main::@170->display_info_cx16_rom] - // [1781] phi display_info_cx16_rom::info_text#8 = 0 [phi:main::@170->display_info_cx16_rom#0] -- pbuz1=vbuc1 + // [546] call display_info_cx16_rom + // [1961] phi from main::@178 to display_info_cx16_rom [phi:main::@178->display_info_cx16_rom] + // [1961] phi display_info_cx16_rom::info_text#8 = 0 [phi:main::@178->display_info_cx16_rom#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_cx16_rom.info_text sta.z display_info_cx16_rom.info_text+1 - // [1781] phi display_info_cx16_rom::info_status#8 = STATUS_SKIP [phi:main::@170->display_info_cx16_rom#1] -- vbuz1=vbuc1 - lda #STATUS_SKIP - sta.z display_info_cx16_rom.info_status + // [1961] phi display_info_cx16_rom::info_status#8 = STATUS_SKIP [phi:main::@178->display_info_cx16_rom#1] -- vbuxx=vbuc1 + ldx #STATUS_SKIP jsr display_info_cx16_rom jmp check_status_smc8 - // main::@243 - __b243: + // main::@253 + __b253: // if(check_status_smc(STATUS_FLASH) && smc_release == smc_file_release && smc_major == smc_file_major && smc_minor == smc_file_minor) - // [520] if(smc_major#392!=smc_file_major#316) goto main::check_status_cx16_rom5 -- vbum1_neq_vbum2_then_la1 + // [547] if(smc_major#419!=smc_file_major#310) goto main::check_status_cx16_rom5 -- vbum1_neq_vbum2_then_la1 lda smc_major cmp smc_file_major beq !check_status_cx16_rom5+ jmp check_status_cx16_rom5 !check_status_cx16_rom5: - // main::@242 - // [521] if(smc_minor#391==smc_file_minor#316) goto main::@12 -- vbum1_eq_vbum2_then_la1 + // main::@252 + // [548] if(smc_minor#418==smc_file_minor#310) goto main::@14 -- vbum1_eq_vbum2_then_la1 lda smc_minor cmp smc_file_minor - beq __b12 + beq __b14 jmp check_status_cx16_rom5 - // [522] phi from main::@242 to main::@12 [phi:main::@242->main::@12] - // main::@12 - __b12: - // display_action_progress("The SMC chip and SMC.BIN versions are equal, no flash required!") - // [523] call display_action_progress - // [1084] phi from main::@12 to display_action_progress [phi:main::@12->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = main::info_text22 [phi:main::@12->display_action_progress#0] -- pbuz1=pbuc1 + // [549] phi from main::@252 to main::@14 [phi:main::@252->main::@14] + // main::@14 + __b14: + // display_action_progress("The CX16 SMC and SMC.BIN versions are equal, no flash required!") + // [550] call display_action_progress + // [1155] phi from main::@14 to display_action_progress [phi:main::@14->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main::info_text22 [phi:main::@14->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text22 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [524] phi from main::@12 to main::@165 [phi:main::@12->main::@165] - // main::@165 + // [551] phi from main::@14 to main::@173 [phi:main::@14->main::@173] + // main::@173 // util_wait_space() - // [525] call util_wait_space - // [1778] phi from main::@165 to util_wait_space [phi:main::@165->util_wait_space] + // [552] call util_wait_space + // [1958] phi from main::@173 to util_wait_space [phi:main::@173->util_wait_space] jsr util_wait_space - // main::@166 - // [526] smc_bootloader#466 = smc_bootloader#0 -- vwum1=vwum2 + // main::@174 + // [553] smc_bootloader#589 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_SKIP, NULL) - // [527] call display_info_smc - // [898] phi from main::@166 to display_info_smc [phi:main::@166->display_info_smc] - // [898] phi display_info_smc::info_text#21 = 0 [phi:main::@166->display_info_smc#0] -- pbuz1=vbuc1 + // [554] call display_info_smc + // [925] phi from main::@174 to display_info_smc [phi:main::@174->display_info_smc] + // [925] phi display_info_smc::info_text#24 = 0 [phi:main::@174->display_info_smc#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_smc.info_text sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#466 [phi:main::@166->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_SKIP [phi:main::@166->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#589 [phi:main::@174->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_SKIP [phi:main::@174->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_SKIP - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc jmp check_status_cx16_rom5 - // [528] phi from main::@240 to main::@10 [phi:main::@240->main::@10] - // main::@10 - __b10: + // [555] phi from main::@250 to main::@12 [phi:main::@250->main::@12] + // main::@12 + __b12: // display_action_progress("Compatibility between ROM.BIN and SMC.BIN can't be assured!") - // [529] call display_action_progress - // [1084] phi from main::@10 to display_action_progress [phi:main::@10->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = main::info_text20 [phi:main::@10->display_action_progress#0] -- pbuz1=pbuc1 + // [556] call display_action_progress + // [1155] phi from main::@12 to display_action_progress [phi:main::@12->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main::info_text20 [phi:main::@12->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text20 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [530] phi from main::@10 to main::@160 [phi:main::@10->main::@160] - // main::@160 + // [557] phi from main::@12 to main::@168 [phi:main::@12->main::@168] + // main::@168 // display_progress_text(display_smc_unsupported_rom_text, display_smc_unsupported_rom_count) - // [531] call display_progress_text - // [1098] phi from main::@160 to display_progress_text [phi:main::@160->display_progress_text] - // [1098] phi display_progress_text::text#12 = display_smc_unsupported_rom_text [phi:main::@160->display_progress_text#0] -- qbuz1=qbuc1 + // [558] call display_progress_text + // [1169] phi from main::@168 to display_progress_text [phi:main::@168->display_progress_text] + // [1169] phi display_progress_text::text#13 = display_smc_unsupported_rom_text [phi:main::@168->display_progress_text#0] -- qbuz1=qbuc1 lda #display_smc_unsupported_rom_text sta.z display_progress_text.text+1 - // [1098] phi display_progress_text::lines#11 = display_smc_unsupported_rom_count [phi:main::@160->display_progress_text#1] -- vbum1=vbuc1 + // [1169] phi display_progress_text::lines#12 = display_smc_unsupported_rom_count [phi:main::@168->display_progress_text#1] -- vbuz1=vbuc1 lda #display_smc_unsupported_rom_count - sta display_progress_text.lines + sta.z display_progress_text.lines jsr display_progress_text - // [532] phi from main::@160 to main::@161 [phi:main::@160->main::@161] - // main::@161 + // [559] phi from main::@168 to main::@169 [phi:main::@168->main::@169] + // main::@169 // unsigned char ch = util_wait_key("Proceed with the update? [Y/N]", "YN") - // [533] call util_wait_key - // [1704] phi from main::@161 to util_wait_key [phi:main::@161->util_wait_key] - // [1704] phi util_wait_key::filter#16 = main::filter [phi:main::@161->util_wait_key#0] -- pbuz1=pbuc1 + // [560] call util_wait_key + // [1896] phi from main::@169 to util_wait_key [phi:main::@169->util_wait_key] + // [1896] phi util_wait_key::filter#16 = main::filter [phi:main::@169->util_wait_key#0] -- pbuz1=pbuc1 lda #filter sta.z util_wait_key.filter+1 - // [1704] phi util_wait_key::info_text#6 = main::info_text7 [phi:main::@161->util_wait_key#1] -- pbuz1=pbuc1 + // [1896] phi util_wait_key::info_text#6 = main::info_text7 [phi:main::@169->util_wait_key#1] -- pbuz1=pbuc1 lda #info_text7 sta.z util_wait_key.info_text+1 jsr util_wait_key // unsigned char ch = util_wait_key("Proceed with the update? [Y/N]", "YN") - // [534] util_wait_key::return#12 = util_wait_key::ch#4 -- vbuz1=vwum2 + // [561] util_wait_key::return#12 = util_wait_key::ch#4 -- vbuaa=vwum1 lda util_wait_key.ch - sta.z util_wait_key.return_3 - // main::@162 - // [535] main::ch3#0 = util_wait_key::return#12 + // main::@170 + // [562] main::ch3#0 = util_wait_key::return#12 // if(ch == 'N') - // [536] if(main::ch3#0!='N') goto main::check_status_smc7 -- vbuz1_neq_vbuc1_then_la1 - lda #'N' - cmp.z ch3 + // [563] if(main::ch3#0!='N') goto main::check_status_smc7 -- vbuaa_neq_vbuc1_then_la1 + cmp #'N' beq !check_status_smc7+ jmp check_status_smc7 !check_status_smc7: - // main::@11 - // [537] smc_bootloader#462 = smc_bootloader#0 -- vwum1=vwum2 + // main::@13 + // [564] smc_bootloader#587 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_ISSUE, NULL) - // [538] call display_info_smc + // [565] call display_info_smc // Cancel flash - // [898] phi from main::@11 to display_info_smc [phi:main::@11->display_info_smc] - // [898] phi display_info_smc::info_text#21 = 0 [phi:main::@11->display_info_smc#0] -- pbuz1=vbuc1 + // [925] phi from main::@13 to display_info_smc [phi:main::@13->display_info_smc] + // [925] phi display_info_smc::info_text#24 = 0 [phi:main::@13->display_info_smc#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_smc.info_text sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#462 [phi:main::@11->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_ISSUE [phi:main::@11->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#587 [phi:main::@13->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_ISSUE [phi:main::@13->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_ISSUE - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - // [539] phi from main::@11 to main::@163 [phi:main::@11->main::@163] - // main::@163 + // [566] phi from main::@13 to main::@171 [phi:main::@13->main::@171] + // main::@171 // display_info_cx16_rom(STATUS_ISSUE, NULL) - // [540] call display_info_cx16_rom - // [1781] phi from main::@163 to display_info_cx16_rom [phi:main::@163->display_info_cx16_rom] - // [1781] phi display_info_cx16_rom::info_text#8 = 0 [phi:main::@163->display_info_cx16_rom#0] -- pbuz1=vbuc1 + // [567] call display_info_cx16_rom + // [1961] phi from main::@171 to display_info_cx16_rom [phi:main::@171->display_info_cx16_rom] + // [1961] phi display_info_cx16_rom::info_text#8 = 0 [phi:main::@171->display_info_cx16_rom#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_cx16_rom.info_text sta.z display_info_cx16_rom.info_text+1 - // [1781] phi display_info_cx16_rom::info_status#8 = STATUS_ISSUE [phi:main::@163->display_info_cx16_rom#1] -- vbuz1=vbuc1 - lda #STATUS_ISSUE - sta.z display_info_cx16_rom.info_status + // [1961] phi display_info_cx16_rom::info_status#8 = STATUS_ISSUE [phi:main::@171->display_info_cx16_rom#1] -- vbuxx=vbuc1 + ldx #STATUS_ISSUE jsr display_info_cx16_rom jmp check_status_smc7 - // [541] phi from main::@239 to main::@7 [phi:main::@239->main::@7] - // main::@7 - __b7: - // display_action_progress("Issue with the CX16 main ROM, check the issue ...") - // [542] call display_action_progress - // [1084] phi from main::@7 to display_action_progress [phi:main::@7->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = main::info_text13 [phi:main::@7->display_action_progress#0] -- pbuz1=pbuc1 + // [568] phi from main::@249 to main::@9 [phi:main::@249->main::@9] + // main::@9 + __b9: + // display_action_progress("Issue with the CX16 ROM, check the issue ...") + // [569] call display_action_progress + // [1155] phi from main::@9 to display_action_progress [phi:main::@9->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main::info_text13 [phi:main::@9->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text13 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [543] phi from main::@7 to main::@152 [phi:main::@7->main::@152] - // main::@152 + // [570] phi from main::@9 to main::@160 [phi:main::@9->main::@160] + // main::@160 // display_progress_text(display_smc_rom_issue_text, display_smc_rom_issue_count) - // [544] call display_progress_text - // [1098] phi from main::@152 to display_progress_text [phi:main::@152->display_progress_text] - // [1098] phi display_progress_text::text#12 = display_smc_rom_issue_text [phi:main::@152->display_progress_text#0] -- qbuz1=qbuc1 + // [571] call display_progress_text + // [1169] phi from main::@160 to display_progress_text [phi:main::@160->display_progress_text] + // [1169] phi display_progress_text::text#13 = display_smc_rom_issue_text [phi:main::@160->display_progress_text#0] -- qbuz1=qbuc1 lda #display_smc_rom_issue_text sta.z display_progress_text.text+1 - // [1098] phi display_progress_text::lines#11 = display_smc_rom_issue_count [phi:main::@152->display_progress_text#1] -- vbum1=vbuc1 + // [1169] phi display_progress_text::lines#12 = display_smc_rom_issue_count [phi:main::@160->display_progress_text#1] -- vbuz1=vbuc1 lda #display_smc_rom_issue_count - sta display_progress_text.lines + sta.z display_progress_text.lines jsr display_progress_text - // main::@153 - // [545] smc_bootloader#465 = smc_bootloader#0 -- vwum1=vwum2 + // main::@161 + // [572] smc_bootloader#588 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_SKIP, "Issue with main CX16 ROM!") - // [546] call display_info_smc - // [898] phi from main::@153 to display_info_smc [phi:main::@153->display_info_smc] - // [898] phi display_info_smc::info_text#21 = main::info_text14 [phi:main::@153->display_info_smc#0] -- pbuz1=pbuc1 + // [573] call display_info_smc + // [925] phi from main::@161 to display_info_smc [phi:main::@161->display_info_smc] + // [925] phi display_info_smc::info_text#24 = main::info_text14 [phi:main::@161->display_info_smc#0] -- pbuz1=pbuc1 lda #info_text14 sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#465 [phi:main::@153->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_SKIP [phi:main::@153->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#588 [phi:main::@161->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_SKIP [phi:main::@161->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_SKIP - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - // [547] phi from main::@153 to main::@154 [phi:main::@153->main::@154] - // main::@154 + // [574] phi from main::@161 to main::@162 [phi:main::@161->main::@162] + // main::@162 // display_info_cx16_rom(STATUS_ISSUE, NULL) - // [548] call display_info_cx16_rom - // [1781] phi from main::@154 to display_info_cx16_rom [phi:main::@154->display_info_cx16_rom] - // [1781] phi display_info_cx16_rom::info_text#8 = 0 [phi:main::@154->display_info_cx16_rom#0] -- pbuz1=vbuc1 + // [575] call display_info_cx16_rom + // [1961] phi from main::@162 to display_info_cx16_rom [phi:main::@162->display_info_cx16_rom] + // [1961] phi display_info_cx16_rom::info_text#8 = 0 [phi:main::@162->display_info_cx16_rom#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_cx16_rom.info_text sta.z display_info_cx16_rom.info_text+1 - // [1781] phi display_info_cx16_rom::info_status#8 = STATUS_ISSUE [phi:main::@154->display_info_cx16_rom#1] -- vbuz1=vbuc1 - lda #STATUS_ISSUE - sta.z display_info_cx16_rom.info_status + // [1961] phi display_info_cx16_rom::info_status#8 = STATUS_ISSUE [phi:main::@162->display_info_cx16_rom#1] -- vbuxx=vbuc1 + ldx #STATUS_ISSUE jsr display_info_cx16_rom - // [549] phi from main::@154 to main::@155 [phi:main::@154->main::@155] - // main::@155 + // [576] phi from main::@162 to main::@163 [phi:main::@162->main::@163] + // main::@163 // unsigned char ch = util_wait_key("Proceed with the update? [Y/N]", "YN") - // [550] call util_wait_key - // [1704] phi from main::@155 to util_wait_key [phi:main::@155->util_wait_key] - // [1704] phi util_wait_key::filter#16 = main::filter [phi:main::@155->util_wait_key#0] -- pbuz1=pbuc1 + // [577] call util_wait_key + // [1896] phi from main::@163 to util_wait_key [phi:main::@163->util_wait_key] + // [1896] phi util_wait_key::filter#16 = main::filter [phi:main::@163->util_wait_key#0] -- pbuz1=pbuc1 lda #filter sta.z util_wait_key.filter+1 - // [1704] phi util_wait_key::info_text#6 = main::info_text7 [phi:main::@155->util_wait_key#1] -- pbuz1=pbuc1 + // [1896] phi util_wait_key::info_text#6 = main::info_text7 [phi:main::@163->util_wait_key#1] -- pbuz1=pbuc1 lda #info_text7 sta.z util_wait_key.info_text+1 jsr util_wait_key // unsigned char ch = util_wait_key("Proceed with the update? [Y/N]", "YN") - // [551] util_wait_key::return#11 = util_wait_key::ch#4 -- vbuz1=vwum2 + // [578] util_wait_key::return#11 = util_wait_key::ch#4 -- vbuaa=vwum1 lda util_wait_key.ch - sta.z util_wait_key.return_2 - // main::@156 - // [552] main::ch1#0 = util_wait_key::return#11 + // main::@164 + // [579] main::ch1#0 = util_wait_key::return#11 // if(ch == 'Y') - // [553] if(main::ch1#0!='Y') goto main::check_status_smc6 -- vbuz1_neq_vbuc1_then_la1 - lda #'Y' - cmp.z ch1 + // [580] if(main::ch1#0!='Y') goto main::check_status_smc6 -- vbuaa_neq_vbuc1_then_la1 + cmp #'Y' beq !check_status_smc6+ jmp check_status_smc6 !check_status_smc6: - // main::@8 - // [554] smc_bootloader#458 = smc_bootloader#0 -- vwum1=vwum2 + // main::@10 + // [581] smc_bootloader#582 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_FLASH, "") - // [555] call display_info_smc - // [898] phi from main::@8 to display_info_smc [phi:main::@8->display_info_smc] - // [898] phi display_info_smc::info_text#21 = info_text8 [phi:main::@8->display_info_smc#0] -- pbuz1=pbuc1 - lda #display_info_smc] + // [925] phi display_info_smc::info_text#24 = str [phi:main::@10->display_info_smc#0] -- pbuz1=pbuc1 + lda #info_text8 + lda #>str sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#458 [phi:main::@8->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_FLASH [phi:main::@8->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#582 [phi:main::@10->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_FLASH [phi:main::@10->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_FLASH - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - // [556] phi from main::@8 to main::@157 [phi:main::@8->main::@157] - // main::@157 + // [583] phi from main::@10 to main::@165 [phi:main::@10->main::@165] + // main::@165 // display_info_cx16_rom(STATUS_SKIP, "") - // [557] call display_info_cx16_rom - // [1781] phi from main::@157 to display_info_cx16_rom [phi:main::@157->display_info_cx16_rom] - // [1781] phi display_info_cx16_rom::info_text#8 = info_text8 [phi:main::@157->display_info_cx16_rom#0] -- pbuz1=pbuc1 - lda #display_info_cx16_rom] + // [1961] phi display_info_cx16_rom::info_text#8 = str [phi:main::@165->display_info_cx16_rom#0] -- pbuz1=pbuc1 + lda #info_text8 + lda #>str sta.z display_info_cx16_rom.info_text+1 - // [1781] phi display_info_cx16_rom::info_status#8 = STATUS_SKIP [phi:main::@157->display_info_cx16_rom#1] -- vbuz1=vbuc1 - lda #STATUS_SKIP - sta.z display_info_cx16_rom.info_status + // [1961] phi display_info_cx16_rom::info_status#8 = STATUS_SKIP [phi:main::@165->display_info_cx16_rom#1] -- vbuxx=vbuc1 + ldx #STATUS_SKIP jsr display_info_cx16_rom jmp check_status_smc6 - // [558] phi from main::@238 to main::@2 [phi:main::@238->main::@2] - // main::@2 - __b2: - // display_action_progress("Issue with the CX16 main ROM: not detected ...") - // [559] call display_action_progress - // [1084] phi from main::@2 to display_action_progress [phi:main::@2->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = main::info_text9 [phi:main::@2->display_action_progress#0] -- pbuz1=pbuc1 + // [585] phi from main::@248 to main::@4 [phi:main::@248->main::@4] + // main::@4 + __b4: + // display_action_progress("Issue with the CX16 ROM: not detected! ...") + // [586] call display_action_progress + // [1155] phi from main::@4 to display_action_progress [phi:main::@4->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main::info_text9 [phi:main::@4->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text9 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [560] phi from main::@2 to main::@147 [phi:main::@2->main::@147] - // main::@147 + // [587] phi from main::@4 to main::@155 [phi:main::@4->main::@155] + // main::@155 // display_progress_text(display_smc_rom_issue_text, display_smc_rom_issue_count) - // [561] call display_progress_text - // [1098] phi from main::@147 to display_progress_text [phi:main::@147->display_progress_text] - // [1098] phi display_progress_text::text#12 = display_smc_rom_issue_text [phi:main::@147->display_progress_text#0] -- qbuz1=qbuc1 + // [588] call display_progress_text + // [1169] phi from main::@155 to display_progress_text [phi:main::@155->display_progress_text] + // [1169] phi display_progress_text::text#13 = display_smc_rom_issue_text [phi:main::@155->display_progress_text#0] -- qbuz1=qbuc1 lda #display_smc_rom_issue_text sta.z display_progress_text.text+1 - // [1098] phi display_progress_text::lines#11 = display_smc_rom_issue_count [phi:main::@147->display_progress_text#1] -- vbum1=vbuc1 + // [1169] phi display_progress_text::lines#12 = display_smc_rom_issue_count [phi:main::@155->display_progress_text#1] -- vbuz1=vbuc1 lda #display_smc_rom_issue_count - sta display_progress_text.lines + sta.z display_progress_text.lines jsr display_progress_text - // main::@148 - // [562] smc_bootloader#464 = smc_bootloader#0 -- vwum1=vwum2 + // main::@156 + // [589] smc_bootloader#586 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 - // display_info_smc(STATUS_SKIP, "Issue with CX16 main ROM!") - // [563] call display_info_smc - // [898] phi from main::@148 to display_info_smc [phi:main::@148->display_info_smc] - // [898] phi display_info_smc::info_text#21 = main::info_text10 [phi:main::@148->display_info_smc#0] -- pbuz1=pbuc1 + // display_info_smc(STATUS_SKIP, "Issue with CX16 ROM!") + // [590] call display_info_smc + // [925] phi from main::@156 to display_info_smc [phi:main::@156->display_info_smc] + // [925] phi display_info_smc::info_text#24 = main::info_text10 [phi:main::@156->display_info_smc#0] -- pbuz1=pbuc1 lda #info_text10 sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#464 [phi:main::@148->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_SKIP [phi:main::@148->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#586 [phi:main::@156->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_SKIP [phi:main::@156->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_SKIP - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - // [564] phi from main::@148 to main::@149 [phi:main::@148->main::@149] - // main::@149 + // [591] phi from main::@156 to main::@157 [phi:main::@156->main::@157] + // main::@157 // display_info_cx16_rom(STATUS_ISSUE, "Are J1 jumper pins closed?") - // [565] call display_info_cx16_rom - // [1781] phi from main::@149 to display_info_cx16_rom [phi:main::@149->display_info_cx16_rom] - // [1781] phi display_info_cx16_rom::info_text#8 = main::info_text11 [phi:main::@149->display_info_cx16_rom#0] -- pbuz1=pbuc1 + // [592] call display_info_cx16_rom + // [1961] phi from main::@157 to display_info_cx16_rom [phi:main::@157->display_info_cx16_rom] + // [1961] phi display_info_cx16_rom::info_text#8 = main::info_text11 [phi:main::@157->display_info_cx16_rom#0] -- pbuz1=pbuc1 lda #info_text11 sta.z display_info_cx16_rom.info_text+1 - // [1781] phi display_info_cx16_rom::info_status#8 = STATUS_ISSUE [phi:main::@149->display_info_cx16_rom#1] -- vbuz1=vbuc1 - lda #STATUS_ISSUE - sta.z display_info_cx16_rom.info_status + // [1961] phi display_info_cx16_rom::info_status#8 = STATUS_ISSUE [phi:main::@157->display_info_cx16_rom#1] -- vbuxx=vbuc1 + ldx #STATUS_ISSUE jsr display_info_cx16_rom - // [566] phi from main::@149 to main::@150 [phi:main::@149->main::@150] - // main::@150 + // [593] phi from main::@157 to main::@158 [phi:main::@157->main::@158] + // main::@158 // unsigned char ch = util_wait_key("Proceed with the update? [Y/N]", "YN") - // [567] call util_wait_key - // [1704] phi from main::@150 to util_wait_key [phi:main::@150->util_wait_key] - // [1704] phi util_wait_key::filter#16 = main::filter [phi:main::@150->util_wait_key#0] -- pbuz1=pbuc1 + // [594] call util_wait_key + // [1896] phi from main::@158 to util_wait_key [phi:main::@158->util_wait_key] + // [1896] phi util_wait_key::filter#16 = main::filter [phi:main::@158->util_wait_key#0] -- pbuz1=pbuc1 lda #filter sta.z util_wait_key.filter+1 - // [1704] phi util_wait_key::info_text#6 = main::info_text7 [phi:main::@150->util_wait_key#1] -- pbuz1=pbuc1 + // [1896] phi util_wait_key::info_text#6 = main::info_text7 [phi:main::@158->util_wait_key#1] -- pbuz1=pbuc1 lda #info_text7 sta.z util_wait_key.info_text+1 jsr util_wait_key // unsigned char ch = util_wait_key("Proceed with the update? [Y/N]", "YN") - // [568] util_wait_key::return#10 = util_wait_key::ch#4 -- vbuz1=vwum2 + // [595] util_wait_key::return#10 = util_wait_key::ch#4 -- vbuaa=vwum1 lda util_wait_key.ch - sta.z util_wait_key.return_1 - // main::@151 - // [569] main::ch2#0 = util_wait_key::return#10 + // main::@159 + // [596] main::ch2#0 = util_wait_key::return#10 // if(ch == 'Y') - // [570] if(main::ch2#0!='Y') goto main::check_status_smc6 -- vbuz1_neq_vbuc1_then_la1 - lda #'Y' - cmp.z ch2 + // [597] if(main::ch2#0!='Y') goto main::check_status_smc6 -- vbuaa_neq_vbuc1_then_la1 + cmp #'Y' beq !check_status_smc6+ jmp check_status_smc6 !check_status_smc6: - // main::@9 - // [571] smc_bootloader#460 = smc_bootloader#0 -- vwum1=vwum2 + // main::@11 + // [598] smc_bootloader#583 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_FLASH, "") - // [572] call display_info_smc - // [898] phi from main::@9 to display_info_smc [phi:main::@9->display_info_smc] - // [898] phi display_info_smc::info_text#21 = info_text8 [phi:main::@9->display_info_smc#0] -- pbuz1=pbuc1 - lda #display_info_smc] + // [925] phi display_info_smc::info_text#24 = str [phi:main::@11->display_info_smc#0] -- pbuz1=pbuc1 + lda #info_text8 + lda #>str sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#460 [phi:main::@9->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_FLASH [phi:main::@9->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#583 [phi:main::@11->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_FLASH [phi:main::@11->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_FLASH - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - // [573] phi from main::@9 to main::@159 [phi:main::@9->main::@159] - // main::@159 + // [600] phi from main::@11 to main::@167 [phi:main::@11->main::@167] + // main::@167 // display_info_cx16_rom(STATUS_SKIP, "") - // [574] call display_info_cx16_rom - // [1781] phi from main::@159 to display_info_cx16_rom [phi:main::@159->display_info_cx16_rom] - // [1781] phi display_info_cx16_rom::info_text#8 = info_text8 [phi:main::@159->display_info_cx16_rom#0] -- pbuz1=pbuc1 - lda #display_info_cx16_rom] + // [1961] phi display_info_cx16_rom::info_text#8 = str [phi:main::@167->display_info_cx16_rom#0] -- pbuz1=pbuc1 + lda #info_text8 + lda #>str sta.z display_info_cx16_rom.info_text+1 - // [1781] phi display_info_cx16_rom::info_status#8 = STATUS_SKIP [phi:main::@159->display_info_cx16_rom#1] -- vbuz1=vbuc1 - lda #STATUS_SKIP - sta.z display_info_cx16_rom.info_status + // [1961] phi display_info_cx16_rom::info_status#8 = STATUS_SKIP [phi:main::@167->display_info_cx16_rom#1] -- vbuxx=vbuc1 + ldx #STATUS_SKIP jsr display_info_cx16_rom jmp check_status_smc6 - // [575] phi from main::@237 to main::@35 [phi:main::@237->main::@35] - // main::@35 - __b35: + // [602] phi from main::@247 to main::@37 [phi:main::@247->main::@37] + // main::@37 + __b37: // display_action_progress("Issue with the CX16 SMC, check the issue ...") - // [576] call display_action_progress - // [1084] phi from main::@35 to display_action_progress [phi:main::@35->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = main::info_text5 [phi:main::@35->display_action_progress#0] -- pbuz1=pbuc1 + // [603] call display_action_progress + // [1155] phi from main::@37 to display_action_progress [phi:main::@37->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main::info_text5 [phi:main::@37->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text5 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [577] phi from main::@35 to main::@141 [phi:main::@35->main::@141] - // main::@141 + // [604] phi from main::@37 to main::@149 [phi:main::@37->main::@149] + // main::@149 // display_progress_text(display_smc_rom_issue_text, display_smc_rom_issue_count) - // [578] call display_progress_text - // [1098] phi from main::@141 to display_progress_text [phi:main::@141->display_progress_text] - // [1098] phi display_progress_text::text#12 = display_smc_rom_issue_text [phi:main::@141->display_progress_text#0] -- qbuz1=qbuc1 + // [605] call display_progress_text + // [1169] phi from main::@149 to display_progress_text [phi:main::@149->display_progress_text] + // [1169] phi display_progress_text::text#13 = display_smc_rom_issue_text [phi:main::@149->display_progress_text#0] -- qbuz1=qbuc1 lda #display_smc_rom_issue_text sta.z display_progress_text.text+1 - // [1098] phi display_progress_text::lines#11 = display_smc_rom_issue_count [phi:main::@141->display_progress_text#1] -- vbum1=vbuc1 + // [1169] phi display_progress_text::lines#12 = display_smc_rom_issue_count [phi:main::@149->display_progress_text#1] -- vbuz1=vbuc1 lda #display_smc_rom_issue_count - sta display_progress_text.lines + sta.z display_progress_text.lines jsr display_progress_text - // [579] phi from main::@141 to main::@142 [phi:main::@141->main::@142] - // main::@142 + // [606] phi from main::@149 to main::@150 [phi:main::@149->main::@150] + // main::@150 // display_info_cx16_rom(STATUS_SKIP, "Issue with SMC!") - // [580] call display_info_cx16_rom - // [1781] phi from main::@142 to display_info_cx16_rom [phi:main::@142->display_info_cx16_rom] - // [1781] phi display_info_cx16_rom::info_text#8 = main::info_text6 [phi:main::@142->display_info_cx16_rom#0] -- pbuz1=pbuc1 + // [607] call display_info_cx16_rom + // [1961] phi from main::@150 to display_info_cx16_rom [phi:main::@150->display_info_cx16_rom] + // [1961] phi display_info_cx16_rom::info_text#8 = main::info_text6 [phi:main::@150->display_info_cx16_rom#0] -- pbuz1=pbuc1 lda #info_text6 sta.z display_info_cx16_rom.info_text+1 - // [1781] phi display_info_cx16_rom::info_status#8 = STATUS_SKIP [phi:main::@142->display_info_cx16_rom#1] -- vbuz1=vbuc1 - lda #STATUS_SKIP - sta.z display_info_cx16_rom.info_status + // [1961] phi display_info_cx16_rom::info_status#8 = STATUS_SKIP [phi:main::@150->display_info_cx16_rom#1] -- vbuxx=vbuc1 + ldx #STATUS_SKIP jsr display_info_cx16_rom - // main::@143 - // [581] smc_bootloader#461 = smc_bootloader#0 -- vwum1=vwum2 + // main::@151 + // [608] smc_bootloader#584 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_ISSUE, NULL) - // [582] call display_info_smc - // [898] phi from main::@143 to display_info_smc [phi:main::@143->display_info_smc] - // [898] phi display_info_smc::info_text#21 = 0 [phi:main::@143->display_info_smc#0] -- pbuz1=vbuc1 + // [609] call display_info_smc + // [925] phi from main::@151 to display_info_smc [phi:main::@151->display_info_smc] + // [925] phi display_info_smc::info_text#24 = 0 [phi:main::@151->display_info_smc#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_smc.info_text sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#461 [phi:main::@143->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_ISSUE [phi:main::@143->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#584 [phi:main::@151->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_ISSUE [phi:main::@151->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_ISSUE - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - // [583] phi from main::@143 to main::@144 [phi:main::@143->main::@144] - // main::@144 + // [610] phi from main::@151 to main::@152 [phi:main::@151->main::@152] + // main::@152 // unsigned char ch = util_wait_key("Proceed with the update? [Y/N]", "YN") - // [584] call util_wait_key - // [1704] phi from main::@144 to util_wait_key [phi:main::@144->util_wait_key] - // [1704] phi util_wait_key::filter#16 = main::filter [phi:main::@144->util_wait_key#0] -- pbuz1=pbuc1 + // [611] call util_wait_key + // [1896] phi from main::@152 to util_wait_key [phi:main::@152->util_wait_key] + // [1896] phi util_wait_key::filter#16 = main::filter [phi:main::@152->util_wait_key#0] -- pbuz1=pbuc1 lda #filter sta.z util_wait_key.filter+1 - // [1704] phi util_wait_key::info_text#6 = main::info_text7 [phi:main::@144->util_wait_key#1] -- pbuz1=pbuc1 + // [1896] phi util_wait_key::info_text#6 = main::info_text7 [phi:main::@152->util_wait_key#1] -- pbuz1=pbuc1 lda #info_text7 sta.z util_wait_key.info_text+1 jsr util_wait_key // unsigned char ch = util_wait_key("Proceed with the update? [Y/N]", "YN") - // [585] util_wait_key::return#3 = util_wait_key::ch#4 -- vbuz1=vwum2 + // [612] util_wait_key::return#3 = util_wait_key::ch#4 -- vbuaa=vwum1 lda util_wait_key.ch - sta.z util_wait_key.return - // main::@145 - // [586] main::ch#0 = util_wait_key::return#3 + // main::@153 + // [613] main::ch#0 = util_wait_key::return#3 // if(ch == 'Y') - // [587] if(main::ch#0!='Y') goto main::check_status_smc4 -- vbuz1_neq_vbuc1_then_la1 - lda #'Y' - cmp.z ch + // [614] if(main::ch#0!='Y') goto main::check_status_smc4 -- vbuaa_neq_vbuc1_then_la1 + cmp #'Y' beq !check_status_smc4+ jmp check_status_smc4 !check_status_smc4: - // [588] phi from main::@145 to main::@36 [phi:main::@145->main::@36] - // main::@36 + // [615] phi from main::@153 to main::@38 [phi:main::@153->main::@38] + // main::@38 // display_info_cx16_rom(STATUS_FLASH, "") - // [589] call display_info_cx16_rom - // [1781] phi from main::@36 to display_info_cx16_rom [phi:main::@36->display_info_cx16_rom] - // [1781] phi display_info_cx16_rom::info_text#8 = info_text8 [phi:main::@36->display_info_cx16_rom#0] -- pbuz1=pbuc1 - lda #display_info_cx16_rom] + // [1961] phi display_info_cx16_rom::info_text#8 = str [phi:main::@38->display_info_cx16_rom#0] -- pbuz1=pbuc1 + lda #info_text8 + lda #>str sta.z display_info_cx16_rom.info_text+1 - // [1781] phi display_info_cx16_rom::info_status#8 = STATUS_FLASH [phi:main::@36->display_info_cx16_rom#1] -- vbuz1=vbuc1 - lda #STATUS_FLASH - sta.z display_info_cx16_rom.info_status + // [1961] phi display_info_cx16_rom::info_status#8 = STATUS_FLASH [phi:main::@38->display_info_cx16_rom#1] -- vbuxx=vbuc1 + ldx #STATUS_FLASH jsr display_info_cx16_rom - // main::@146 - // [590] smc_bootloader#463 = smc_bootloader#0 -- vwum1=vwum2 + // main::@154 + // [617] smc_bootloader#585 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_SKIP, NULL) - // [591] call display_info_smc - // [898] phi from main::@146 to display_info_smc [phi:main::@146->display_info_smc] - // [898] phi display_info_smc::info_text#21 = 0 [phi:main::@146->display_info_smc#0] -- pbuz1=vbuc1 + // [618] call display_info_smc + // [925] phi from main::@154 to display_info_smc [phi:main::@154->display_info_smc] + // [925] phi display_info_smc::info_text#24 = 0 [phi:main::@154->display_info_smc#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_smc.info_text sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#463 [phi:main::@146->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_SKIP [phi:main::@146->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#585 [phi:main::@154->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_SKIP [phi:main::@154->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_SKIP - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc jmp check_status_smc4 - // main::bank_set_brom4 - bank_set_brom4: + // main::bank_set_brom6 + bank_set_brom6: // BROM = bank - // [592] BROM = main::bank_set_brom4_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom4_bank + // [619] BROM = main::bank_set_brom6_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom6_bank sta.z BROM - // main::@69 + // main::@73 // if(rom_device_ids[rom_chip] != UNKNOWN) - // [593] if(rom_device_ids[main::rom_chip1#10]==$55) goto main::@29 -- pbuc1_derefidx_vbum1_eq_vbuc2_then_la1 + // [620] if(rom_device_ids[main::rom_chip1#10]==$55) goto main::@31 -- pbuc1_derefidx_vbum1_eq_vbuc2_then_la1 ldy rom_chip1 lda rom_device_ids,y cmp #$55 - bne !__b29+ - jmp __b29 - !__b29: - // [594] phi from main::@69 to main::@32 [phi:main::@69->main::@32] - // main::@32 + bne !__b31+ + jmp __b31 + !__b31: + // [621] phi from main::@73 to main::@34 [phi:main::@73->main::@34] + // main::@34 // display_progress_clear() - // [595] call display_progress_clear - // [1161] phi from main::@32 to display_progress_clear [phi:main::@32->display_progress_clear] + // [622] call display_progress_clear + // [1037] phi from main::@34 to display_progress_clear [phi:main::@34->display_progress_clear] jsr display_progress_clear - // main::@119 + // main::@127 // unsigned char rom_bank = rom_chip * 32 - // [596] main::rom_bank#0 = main::rom_chip1#10 << 5 -- vbum1=vbum2_rol_5 + // [623] main::rom_bank#0 = main::rom_chip1#10 << 5 -- vbum1=vbum2_rol_5 lda rom_chip1 asl asl @@ -3758,121 +3781,120 @@ main: { asl sta rom_bank // unsigned char* file = rom_file(rom_chip) - // [597] rom_file::rom_chip#0 = main::rom_chip1#10 -- vbuz1=vbum2 + // [624] rom_file::rom_chip#0 = main::rom_chip1#10 -- vbuaa=vbum1 lda rom_chip1 - sta.z rom_file.rom_chip - // [598] call rom_file - // [1221] phi from main::@119 to rom_file [phi:main::@119->rom_file] - // [1221] phi rom_file::rom_chip#2 = rom_file::rom_chip#0 [phi:main::@119->rom_file#0] -- register_copy + // [625] call rom_file + // [1413] phi from main::@127 to rom_file [phi:main::@127->rom_file] + // [1413] phi rom_file::rom_chip#2 = rom_file::rom_chip#0 [phi:main::@127->rom_file#0] -- register_copy jsr rom_file // unsigned char* file = rom_file(rom_chip) - // [599] rom_file::return#4 = rom_file::return#2 - // main::@120 - // [600] main::file#0 = rom_file::return#4 -- pbum1=pbum2 + // [626] rom_file::return#4 = rom_file::return#2 + // main::@128 + // [627] main::file#0 = rom_file::return#4 -- pbum1=pbum2 lda rom_file.return sta file lda rom_file.return+1 sta file+1 // sprintf(info_text, "Checking %s ...", file) - // [601] call snprintf_init - // [1113] phi from main::@120 to snprintf_init [phi:main::@120->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:main::@120->snprintf_init#0] -- pbuz1=pbuc1 + // [628] call snprintf_init + // [1184] phi from main::@128 to snprintf_init [phi:main::@128->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:main::@128->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [602] phi from main::@120 to main::@121 [phi:main::@120->main::@121] - // main::@121 + // [629] phi from main::@128 to main::@129 [phi:main::@128->main::@129] + // main::@129 // sprintf(info_text, "Checking %s ...", file) - // [603] call printf_str - // [1054] phi from main::@121 to printf_str [phi:main::@121->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@121->printf_str#0] -- pprz1=pprc1 + // [630] call printf_str + // [1125] phi from main::@129 to printf_str [phi:main::@129->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@129->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s3 [phi:main::@121->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s3 [phi:main::@129->printf_str#1] -- pbuz1=pbuc1 lda #s3 sta.z printf_str.s+1 jsr printf_str - // main::@122 + // main::@130 // sprintf(info_text, "Checking %s ...", file) - // [604] printf_string::str#19 = main::file#0 -- pbuz1=pbum2 + // [631] printf_string::str#20 = main::file#0 -- pbuz1=pbum2 lda file sta.z printf_string.str lda file+1 sta.z printf_string.str+1 - // [605] call printf_string - // [1227] phi from main::@122 to printf_string [phi:main::@122->printf_string] - // [1227] phi printf_string::putc#25 = &snputc [phi:main::@122->printf_string#0] -- pprz1=pprc1 + // [632] call printf_string + // [1419] phi from main::@130 to printf_string [phi:main::@130->printf_string] + // [1419] phi printf_string::putc#26 = &snputc [phi:main::@130->printf_string#0] -- pprz1=pprc1 lda #snputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#19 [phi:main::@122->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 0 [phi:main::@122->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#20 [phi:main::@130->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 0 [phi:main::@130->printf_string#2] -- vbum1=vbuc1 lda #0 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 0 [phi:main::@122->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 0 [phi:main::@130->printf_string#3] -- vbum1=vbuc1 sta printf_string.format_min_length jsr printf_string - // [606] phi from main::@122 to main::@123 [phi:main::@122->main::@123] - // main::@123 + // [633] phi from main::@130 to main::@131 [phi:main::@130->main::@131] + // main::@131 // sprintf(info_text, "Checking %s ...", file) - // [607] call printf_str - // [1054] phi from main::@123 to printf_str [phi:main::@123->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@123->printf_str#0] -- pprz1=pprc1 + // [634] call printf_str + // [1125] phi from main::@131 to printf_str [phi:main::@131->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@131->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s4 [phi:main::@123->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s4 [phi:main::@131->printf_str#1] -- pbuz1=pbuc1 lda #s4 sta.z printf_str.s+1 jsr printf_str - // main::@124 + // main::@132 // sprintf(info_text, "Checking %s ...", file) - // [608] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [635] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [609] callexecute snputc -- call_vprc1 + // [636] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_progress(info_text) - // [611] call display_action_progress - // [1084] phi from main::@124 to display_action_progress [phi:main::@124->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = info_text [phi:main::@124->display_action_progress#0] -- pbuz1=pbuc1 + // [638] call display_action_progress + // [1155] phi from main::@132 to display_action_progress [phi:main::@132->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = info_text [phi:main::@132->display_action_progress#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_action_progress.info_text lda #>@info_text sta.z display_action_progress.info_text+1 jsr display_action_progress - // main::@125 + // main::@133 // unsigned long rom_bytes_read = rom_read(rom_chip, file, STATUS_CHECKING, rom_bank, rom_sizes[rom_chip]) - // [612] main::$303 = main::rom_chip1#10 << 2 -- vbum1=vbum2_rol_2 + // [639] main::$324 = main::rom_chip1#10 << 2 -- vbum1=vbum2_rol_2 lda rom_chip1 asl asl - sta main__303 - // [613] rom_read::rom_chip#0 = main::rom_chip1#10 -- vbuz1=vbum2 + sta main__324 + // [640] rom_read::rom_chip#0 = main::rom_chip1#10 -- vbum1=vbum2 lda rom_chip1 - sta.z rom_read.rom_chip - // [614] rom_read::file#0 = main::file#0 -- pbuz1=pbum2 + sta rom_read.rom_chip + // [641] rom_read::file#0 = main::file#0 -- pbuz1=pbum2 lda file sta.z rom_read.file lda file+1 sta.z rom_read.file+1 - // [615] rom_read::brom_bank_start#1 = main::rom_bank#0 -- vbuz1=vbum2 + // [642] rom_read::brom_bank_start#1 = main::rom_bank#0 -- vbuz1=vbum2 lda rom_bank sta.z rom_read.brom_bank_start - // [616] rom_read::rom_size#0 = rom_sizes[main::$303] -- vduz1=pduc1_derefidx_vbum2 - ldy main__303 + // [643] rom_read::rom_size#0 = rom_sizes[main::$324] -- vduz1=pduc1_derefidx_vbum2 + ldy main__324 lda rom_sizes,y sta.z rom_read.rom_size lda rom_sizes+1,y @@ -3881,36 +3903,36 @@ main: { sta.z rom_read.rom_size+2 lda rom_sizes+3,y sta.z rom_read.rom_size+3 - // [617] call rom_read + // [644] call rom_read // Read the ROM(n).BIN file. - // [1252] phi from main::@125 to rom_read [phi:main::@125->rom_read] - // [1252] phi rom_read::rom_chip#20 = rom_read::rom_chip#0 [phi:main::@125->rom_read#0] -- register_copy - // [1252] phi rom_read::rom_size#12 = rom_read::rom_size#0 [phi:main::@125->rom_read#1] -- register_copy - // [1252] phi __errno#114 = __errno#100 [phi:main::@125->rom_read#2] -- register_copy - // [1252] phi __stdio_filecount#108 = __stdio_filecount#114 [phi:main::@125->rom_read#3] -- register_copy - // [1252] phi rom_read::file#10 = rom_read::file#0 [phi:main::@125->rom_read#4] -- register_copy - // [1252] phi rom_read::brom_bank_start#10 = rom_read::brom_bank_start#1 [phi:main::@125->rom_read#5] -- register_copy - // [1252] phi rom_read::info_status#11 = STATUS_CHECKING [phi:main::@125->rom_read#6] -- vbuz1=vbuc1 + // [1444] phi from main::@133 to rom_read [phi:main::@133->rom_read] + // [1444] phi rom_read::rom_chip#20 = rom_read::rom_chip#0 [phi:main::@133->rom_read#0] -- register_copy + // [1444] phi rom_read::rom_size#12 = rom_read::rom_size#0 [phi:main::@133->rom_read#1] -- register_copy + // [1444] phi __errno#103 = __errno#115 [phi:main::@133->rom_read#2] -- register_copy + // [1444] phi __stdio_filecount#126 = __stdio_filecount#111 [phi:main::@133->rom_read#3] -- register_copy + // [1444] phi rom_read::file#10 = rom_read::file#0 [phi:main::@133->rom_read#4] -- register_copy + // [1444] phi rom_read::brom_bank_start#10 = rom_read::brom_bank_start#1 [phi:main::@133->rom_read#5] -- register_copy + // [1444] phi rom_read::info_status#11 = STATUS_CHECKING [phi:main::@133->rom_read#6] -- vbuz1=vbuc1 lda #STATUS_CHECKING sta.z rom_read.info_status jsr rom_read // unsigned long rom_bytes_read = rom_read(rom_chip, file, STATUS_CHECKING, rom_bank, rom_sizes[rom_chip]) - // [618] rom_read::return#2 = rom_read::return#0 - // main::@126 - // [619] main::rom_bytes_read#0 = rom_read::return#2 + // [645] rom_read::return#2 = rom_read::return#0 + // main::@134 + // [646] main::rom_bytes_read#0 = rom_read::return#2 // if (!rom_bytes_read) - // [620] if(0==main::rom_bytes_read#0) goto main::@30 -- 0_eq_vdum1_then_la1 + // [647] if(0==main::rom_bytes_read#0) goto main::@32 -- 0_eq_vdum1_then_la1 // In case no file was found, set the status to none and skip to the next, else, mention the amount of bytes read. lda rom_bytes_read ora rom_bytes_read+1 ora rom_bytes_read+2 ora rom_bytes_read+3 - bne !__b30+ - jmp __b30 - !__b30: - // main::@33 + bne !__b32+ + jmp __b32 + !__b32: + // main::@35 // unsigned long rom_file_modulo = rom_bytes_read % 0x4000 - // [621] main::rom_file_modulo#0 = main::rom_bytes_read#0 & $4000-1 -- vdum1=vdum2_band_vduc1 + // [648] main::rom_file_modulo#0 = main::rom_bytes_read#0 & $4000-1 -- vdum1=vdum2_band_vduc1 lda rom_bytes_read and #<$4000-1 sta rom_file_modulo @@ -3924,20 +3946,20 @@ main: { and #>$4000-1>>$10 sta rom_file_modulo+3 // if(rom_file_modulo) - // [622] if(0!=main::rom_file_modulo#0) goto main::@31 -- 0_neq_vdum1_then_la1 + // [649] if(0!=main::rom_file_modulo#0) goto main::@33 -- 0_neq_vdum1_then_la1 lda rom_file_modulo ora rom_file_modulo+1 ora rom_file_modulo+2 ora rom_file_modulo+3 - beq !__b31+ - jmp __b31 - !__b31: - // main::@34 + beq !__b33+ + jmp __b33 + !__b33: + // main::@36 // file_sizes[rom_chip] = rom_bytes_read - // [623] file_sizes[main::$303] = main::rom_bytes_read#0 -- pduc1_derefidx_vbum1=vdum2 + // [650] file_sizes[main::$324] = main::rom_bytes_read#0 -- pduc1_derefidx_vbum1=vdum2 // RF5 | ROM.BIN all ok | Display the ROM.BIN release version and github commit id (if any) and set ROM to Flash | Flash // We know the file size, so we indicate it in the status panel. - ldy main__303 + ldy main__324 lda rom_bytes_read sta file_sizes,y lda rom_bytes_read+1 @@ -3947,14 +3969,13 @@ main: { lda rom_bytes_read+3 sta file_sizes+3,y // 8*rom_chip - // [624] main::$125 = main::rom_chip1#10 << 3 -- vbuz1=vbum2_rol_3 + // [651] main::$132 = main::rom_chip1#10 << 3 -- vbuaa=vbum1_rol_3 lda rom_chip1 asl asl asl - sta.z main__125 // unsigned char* rom_file_github_id = &rom_file_github[8*rom_chip] - // [625] main::rom_file_github_id#0 = rom_file_github + main::$125 -- pbuz1=pbuc1_plus_vbuz2 + // [652] main::rom_file_github_id#0 = rom_file_github + main::$132 -- pbuz1=pbuc1_plus_vbuaa // Fill the version data ... clc adc #rom_get_release] - // [1786] phi rom_get_release::release#3 = rom_get_release::release#2 [phi:main::@34->rom_get_release#0] -- register_copy + ldx rom_file_release,y + // [654] call rom_get_release + // [1966] phi from main::@36 to rom_get_release [phi:main::@36->rom_get_release] + // [1966] phi rom_get_release::release#3 = rom_get_release::release#2 [phi:main::@36->rom_get_release#0] -- register_copy jsr rom_get_release // unsigned char rom_file_release_id = rom_get_release(rom_file_release[rom_chip]) - // [628] rom_get_release::return#3 = rom_get_release::return#0 - // main::@134 - // [629] main::rom_file_release_id#0 = rom_get_release::return#3 + // [655] rom_get_release::return#3 = rom_get_release::return#0 + // main::@142 + // [656] main::rom_file_release_id#0 = rom_get_release::return#3 -- vbuz1=vbuxx + stx.z rom_file_release_id // unsigned char rom_file_prefix_id = rom_get_prefix(rom_file_release[rom_chip]) - // [630] rom_get_prefix::release#1 = rom_file_release[main::rom_chip1#10] -- vbum1=pbuc1_derefidx_vbum2 + // [657] rom_get_prefix::release#1 = rom_file_release[main::rom_chip1#10] -- vbuaa=pbuc1_derefidx_vbum1 ldy rom_chip1 lda rom_file_release,y - sta rom_get_prefix.release - // [631] call rom_get_prefix - // [1793] phi from main::@134 to rom_get_prefix [phi:main::@134->rom_get_prefix] - // [1793] phi rom_get_prefix::release#2 = rom_get_prefix::release#1 [phi:main::@134->rom_get_prefix#0] -- register_copy + // [658] call rom_get_prefix + // [1973] phi from main::@142 to rom_get_prefix [phi:main::@142->rom_get_prefix] + // [1973] phi rom_get_prefix::release#2 = rom_get_prefix::release#1 [phi:main::@142->rom_get_prefix#0] -- register_copy jsr rom_get_prefix // unsigned char rom_file_prefix_id = rom_get_prefix(rom_file_release[rom_chip]) - // [632] rom_get_prefix::return#3 = rom_get_prefix::return#0 - // main::@135 - // [633] main::rom_file_prefix_id#0 = rom_get_prefix::return#3 + // [659] rom_get_prefix::return#3 = rom_get_prefix::return#0 -- vbuaa=vbuxx + txa + // main::@143 + // [660] main::rom_file_prefix_id#0 = rom_get_prefix::return#3 // rom_get_version_text(rom_file_release_text, rom_file_prefix_id, rom_file_release_id, rom_file_github_id) - // [634] rom_get_version_text::prefix#1 = main::rom_file_prefix_id#0 - // [635] rom_get_version_text::release#1 = main::rom_file_release_id#0 - // [636] rom_get_version_text::github#1 = main::rom_file_github_id#0 - // [637] call rom_get_version_text - // [1802] phi from main::@135 to rom_get_version_text [phi:main::@135->rom_get_version_text] - // [1802] phi rom_get_version_text::github#2 = rom_get_version_text::github#1 [phi:main::@135->rom_get_version_text#0] -- register_copy - // [1802] phi rom_get_version_text::release#2 = rom_get_version_text::release#1 [phi:main::@135->rom_get_version_text#1] -- register_copy - // [1802] phi rom_get_version_text::prefix#2 = rom_get_version_text::prefix#1 [phi:main::@135->rom_get_version_text#2] -- register_copy - // [1802] phi rom_get_version_text::release_info#2 = main::rom_file_release_text [phi:main::@135->rom_get_version_text#3] -- pbuz1=pbuc1 + // [661] rom_get_version_text::prefix#1 = main::rom_file_prefix_id#0 -- vbuxx=vbuaa + tax + // [662] rom_get_version_text::release#1 = main::rom_file_release_id#0 + // [663] rom_get_version_text::github#1 = main::rom_file_github_id#0 + // [664] call rom_get_version_text + // [1982] phi from main::@143 to rom_get_version_text [phi:main::@143->rom_get_version_text] + // [1982] phi rom_get_version_text::github#2 = rom_get_version_text::github#1 [phi:main::@143->rom_get_version_text#0] -- register_copy + // [1982] phi rom_get_version_text::release#2 = rom_get_version_text::release#1 [phi:main::@143->rom_get_version_text#1] -- register_copy + // [1982] phi rom_get_version_text::prefix#2 = rom_get_version_text::prefix#1 [phi:main::@143->rom_get_version_text#2] -- register_copy + // [1982] phi rom_get_version_text::release_info#2 = main::rom_file_release_text [phi:main::@143->rom_get_version_text#3] -- pbuz1=pbuc1 lda #rom_file_release_text sta.z rom_get_version_text.release_info+1 jsr rom_get_version_text - // [638] phi from main::@135 to main::@136 [phi:main::@135->main::@136] - // main::@136 + // [665] phi from main::@143 to main::@144 [phi:main::@143->main::@144] + // main::@144 // sprintf(info_text, "%s:%s", file, rom_file_release_text) - // [639] call snprintf_init - // [1113] phi from main::@136 to snprintf_init [phi:main::@136->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:main::@136->snprintf_init#0] -- pbuz1=pbuc1 + // [666] call snprintf_init + // [1184] phi from main::@144 to snprintf_init [phi:main::@144->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:main::@144->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // main::@137 + // main::@145 // sprintf(info_text, "%s:%s", file, rom_file_release_text) - // [640] printf_string::str#22 = main::file#0 -- pbuz1=pbum2 + // [667] printf_string::str#23 = main::file#0 -- pbuz1=pbum2 lda file sta.z printf_string.str lda file+1 sta.z printf_string.str+1 - // [641] call printf_string - // [1227] phi from main::@137 to printf_string [phi:main::@137->printf_string] - // [1227] phi printf_string::putc#25 = &snputc [phi:main::@137->printf_string#0] -- pprz1=pprc1 + // [668] call printf_string + // [1419] phi from main::@145 to printf_string [phi:main::@145->printf_string] + // [1419] phi printf_string::putc#26 = &snputc [phi:main::@145->printf_string#0] -- pprz1=pprc1 lda #snputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#22 [phi:main::@137->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 0 [phi:main::@137->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#23 [phi:main::@145->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 0 [phi:main::@145->printf_string#2] -- vbum1=vbuc1 lda #0 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 0 [phi:main::@137->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 0 [phi:main::@145->printf_string#3] -- vbum1=vbuc1 sta printf_string.format_min_length jsr printf_string - // [642] phi from main::@137 to main::@138 [phi:main::@137->main::@138] - // main::@138 + // [669] phi from main::@145 to main::@146 [phi:main::@145->main::@146] + // main::@146 // sprintf(info_text, "%s:%s", file, rom_file_release_text) - // [643] call printf_str - // [1054] phi from main::@138 to printf_str [phi:main::@138->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@138->printf_str#0] -- pprz1=pprc1 + // [670] call printf_str + // [1125] phi from main::@146 to printf_str [phi:main::@146->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@146->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s2 [phi:main::@138->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s2 [phi:main::@146->printf_str#1] -- pbuz1=pbuc1 lda #<@s2 sta.z printf_str.s lda #>@s2 sta.z printf_str.s+1 jsr printf_str - // [644] phi from main::@138 to main::@139 [phi:main::@138->main::@139] - // main::@139 + // [671] phi from main::@146 to main::@147 [phi:main::@146->main::@147] + // main::@147 // sprintf(info_text, "%s:%s", file, rom_file_release_text) - // [645] call printf_string - // [1227] phi from main::@139 to printf_string [phi:main::@139->printf_string] - // [1227] phi printf_string::putc#25 = &snputc [phi:main::@139->printf_string#0] -- pprz1=pprc1 + // [672] call printf_string + // [1419] phi from main::@147 to printf_string [phi:main::@147->printf_string] + // [1419] phi printf_string::putc#26 = &snputc [phi:main::@147->printf_string#0] -- pprz1=pprc1 lda #snputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = main::rom_file_release_text [phi:main::@139->printf_string#1] -- pbuz1=pbuc1 + // [1419] phi printf_string::str#26 = main::rom_file_release_text [phi:main::@147->printf_string#1] -- pbuz1=pbuc1 lda #rom_file_release_text sta.z printf_string.str+1 - // [1227] phi printf_string::format_justify_left#25 = 0 [phi:main::@139->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::format_justify_left#26 = 0 [phi:main::@147->printf_string#2] -- vbum1=vbuc1 lda #0 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 0 [phi:main::@139->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 0 [phi:main::@147->printf_string#3] -- vbum1=vbuc1 sta printf_string.format_min_length jsr printf_string - // main::@140 + // main::@148 // sprintf(info_text, "%s:%s", file, rom_file_release_text) - // [646] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [673] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [647] callexecute snputc -- call_vprc1 + // [674] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_info_rom(rom_chip, STATUS_FLASH, info_text) - // [649] display_info_rom::rom_chip#8 = main::rom_chip1#10 -- vbum1=vbum2 + // [676] display_info_rom::rom_chip#8 = main::rom_chip1#10 -- vbum1=vbum2 lda rom_chip1 sta display_info_rom.rom_chip - // [650] call display_info_rom - // [1176] phi from main::@140 to display_info_rom [phi:main::@140->display_info_rom] - // [1176] phi display_info_rom::info_text#16 = info_text [phi:main::@140->display_info_rom#0] -- pbuz1=pbuc1 + // [677] call display_info_rom + // [1368] phi from main::@148 to display_info_rom [phi:main::@148->display_info_rom] + // [1368] phi display_info_rom::info_text#16 = info_text [phi:main::@148->display_info_rom#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_info_rom.info_text lda #>@info_text sta.z display_info_rom.info_text+1 - // [1176] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#8 [phi:main::@140->display_info_rom#1] -- register_copy - // [1176] phi display_info_rom::info_status#16 = STATUS_FLASH [phi:main::@140->display_info_rom#2] -- vbuz1=vbuc1 + // [1368] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#8 [phi:main::@148->display_info_rom#1] -- register_copy + // [1368] phi display_info_rom::info_status#16 = STATUS_FLASH [phi:main::@148->display_info_rom#2] -- vbum1=vbuc1 lda #STATUS_FLASH - sta.z display_info_rom.info_status + sta display_info_rom.info_status jsr display_info_rom - // [651] phi from main::@129 main::@133 main::@140 main::@69 to main::@29 [phi:main::@129/main::@133/main::@140/main::@69->main::@29] - // [651] phi __stdio_filecount#258 = __stdio_filecount#30 [phi:main::@129/main::@133/main::@140/main::@69->main::@29#0] -- register_copy - // [651] phi __errno#244 = __errno#18 [phi:main::@129/main::@133/main::@140/main::@69->main::@29#1] -- register_copy - // main::@29 - __b29: - // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [652] main::rom_chip1#1 = ++ main::rom_chip1#10 -- vbum1=_inc_vbum1 - inc rom_chip1 - // [124] phi from main::@29 to main::@28 [phi:main::@29->main::@28] - // [124] phi __stdio_filecount#114 = __stdio_filecount#258 [phi:main::@29->main::@28#0] -- register_copy - // [124] phi __errno#100 = __errno#244 [phi:main::@29->main::@28#1] -- register_copy - // [124] phi main::rom_chip1#10 = main::rom_chip1#1 [phi:main::@29->main::@28#2] -- register_copy - jmp __b28 - // [653] phi from main::@33 to main::@31 [phi:main::@33->main::@31] + // [678] phi from main::@137 main::@141 main::@148 main::@73 to main::@31 [phi:main::@137/main::@141/main::@148/main::@73->main::@31] + // [678] phi __stdio_filecount#412 = __stdio_filecount#39 [phi:main::@137/main::@141/main::@148/main::@73->main::@31#0] -- register_copy + // [678] phi __errno#397 = __errno#123 [phi:main::@137/main::@141/main::@148/main::@73->main::@31#1] -- register_copy // main::@31 __b31: + // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) + // [679] main::rom_chip1#1 = ++ main::rom_chip1#10 -- vbum1=_inc_vbum1 + inc rom_chip1 + // [133] phi from main::@31 to main::@30 [phi:main::@31->main::@30] + // [133] phi __stdio_filecount#111 = __stdio_filecount#412 [phi:main::@31->main::@30#0] -- register_copy + // [133] phi __errno#115 = __errno#397 [phi:main::@31->main::@30#1] -- register_copy + // [133] phi main::rom_chip1#10 = main::rom_chip1#1 [phi:main::@31->main::@30#2] -- register_copy + jmp __b30 + // [680] phi from main::@35 to main::@33 [phi:main::@35->main::@33] + // main::@33 + __b33: // sprintf(info_text, "File %s size error!", file) - // [654] call snprintf_init - // [1113] phi from main::@31 to snprintf_init [phi:main::@31->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:main::@31->snprintf_init#0] -- pbuz1=pbuc1 + // [681] call snprintf_init + // [1184] phi from main::@33 to snprintf_init [phi:main::@33->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:main::@33->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [655] phi from main::@31 to main::@130 [phi:main::@31->main::@130] - // main::@130 + // [682] phi from main::@33 to main::@138 [phi:main::@33->main::@138] + // main::@138 // sprintf(info_text, "File %s size error!", file) - // [656] call printf_str - // [1054] phi from main::@130 to printf_str [phi:main::@130->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@130->printf_str#0] -- pprz1=pprc1 + // [683] call printf_str + // [1125] phi from main::@138 to printf_str [phi:main::@138->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@138->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s6 [phi:main::@130->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s6 [phi:main::@138->printf_str#1] -- pbuz1=pbuc1 lda #s6 sta.z printf_str.s+1 jsr printf_str - // main::@131 + // main::@139 // sprintf(info_text, "File %s size error!", file) - // [657] printf_string::str#21 = main::file#0 -- pbuz1=pbum2 + // [684] printf_string::str#22 = main::file#0 -- pbuz1=pbum2 lda file sta.z printf_string.str lda file+1 sta.z printf_string.str+1 - // [658] call printf_string - // [1227] phi from main::@131 to printf_string [phi:main::@131->printf_string] - // [1227] phi printf_string::putc#25 = &snputc [phi:main::@131->printf_string#0] -- pprz1=pprc1 + // [685] call printf_string + // [1419] phi from main::@139 to printf_string [phi:main::@139->printf_string] + // [1419] phi printf_string::putc#26 = &snputc [phi:main::@139->printf_string#0] -- pprz1=pprc1 lda #snputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#21 [phi:main::@131->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 0 [phi:main::@131->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#22 [phi:main::@139->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 0 [phi:main::@139->printf_string#2] -- vbum1=vbuc1 lda #0 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 0 [phi:main::@131->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 0 [phi:main::@139->printf_string#3] -- vbum1=vbuc1 sta printf_string.format_min_length jsr printf_string - // [659] phi from main::@131 to main::@132 [phi:main::@131->main::@132] - // main::@132 + // [686] phi from main::@139 to main::@140 [phi:main::@139->main::@140] + // main::@140 // sprintf(info_text, "File %s size error!", file) - // [660] call printf_str - // [1054] phi from main::@132 to printf_str [phi:main::@132->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@132->printf_str#0] -- pprz1=pprc1 + // [687] call printf_str + // [1125] phi from main::@140 to printf_str [phi:main::@140->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@140->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s7 [phi:main::@132->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s7 [phi:main::@140->printf_str#1] -- pbuz1=pbuc1 lda #s7 sta.z printf_str.s+1 jsr printf_str - // main::@133 + // main::@141 // sprintf(info_text, "File %s size error!", file) - // [661] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [688] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [662] callexecute snputc -- call_vprc1 + // [689] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_info_rom(rom_chip, STATUS_ISSUE, info_text) - // [664] display_info_rom::rom_chip#7 = main::rom_chip1#10 -- vbum1=vbum2 + // [691] display_info_rom::rom_chip#7 = main::rom_chip1#10 -- vbum1=vbum2 lda rom_chip1 sta display_info_rom.rom_chip - // [665] call display_info_rom - // [1176] phi from main::@133 to display_info_rom [phi:main::@133->display_info_rom] - // [1176] phi display_info_rom::info_text#16 = info_text [phi:main::@133->display_info_rom#0] -- pbuz1=pbuc1 + // [692] call display_info_rom + // [1368] phi from main::@141 to display_info_rom [phi:main::@141->display_info_rom] + // [1368] phi display_info_rom::info_text#16 = info_text [phi:main::@141->display_info_rom#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_info_rom.info_text lda #>@info_text sta.z display_info_rom.info_text+1 - // [1176] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#7 [phi:main::@133->display_info_rom#1] -- register_copy - // [1176] phi display_info_rom::info_status#16 = STATUS_ISSUE [phi:main::@133->display_info_rom#2] -- vbuz1=vbuc1 + // [1368] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#7 [phi:main::@141->display_info_rom#1] -- register_copy + // [1368] phi display_info_rom::info_status#16 = STATUS_ISSUE [phi:main::@141->display_info_rom#2] -- vbum1=vbuc1 lda #STATUS_ISSUE - sta.z display_info_rom.info_status + sta display_info_rom.info_status jsr display_info_rom - jmp __b29 - // [666] phi from main::@126 to main::@30 [phi:main::@126->main::@30] - // main::@30 - __b30: + jmp __b31 + // [693] phi from main::@134 to main::@32 [phi:main::@134->main::@32] + // main::@32 + __b32: // sprintf(info_text, "No %s", file) - // [667] call snprintf_init - // [1113] phi from main::@30 to snprintf_init [phi:main::@30->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:main::@30->snprintf_init#0] -- pbuz1=pbuc1 + // [694] call snprintf_init + // [1184] phi from main::@32 to snprintf_init [phi:main::@32->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:main::@32->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [668] phi from main::@30 to main::@127 [phi:main::@30->main::@127] - // main::@127 + // [695] phi from main::@32 to main::@135 [phi:main::@32->main::@135] + // main::@135 // sprintf(info_text, "No %s", file) - // [669] call printf_str - // [1054] phi from main::@127 to printf_str [phi:main::@127->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@127->printf_str#0] -- pprz1=pprc1 + // [696] call printf_str + // [1125] phi from main::@135 to printf_str [phi:main::@135->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@135->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s5 [phi:main::@127->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s5 [phi:main::@135->printf_str#1] -- pbuz1=pbuc1 lda #s5 sta.z printf_str.s+1 jsr printf_str - // main::@128 + // main::@136 // sprintf(info_text, "No %s", file) - // [670] printf_string::str#20 = main::file#0 -- pbuz1=pbum2 + // [697] printf_string::str#21 = main::file#0 -- pbuz1=pbum2 lda file sta.z printf_string.str lda file+1 sta.z printf_string.str+1 - // [671] call printf_string - // [1227] phi from main::@128 to printf_string [phi:main::@128->printf_string] - // [1227] phi printf_string::putc#25 = &snputc [phi:main::@128->printf_string#0] -- pprz1=pprc1 + // [698] call printf_string + // [1419] phi from main::@136 to printf_string [phi:main::@136->printf_string] + // [1419] phi printf_string::putc#26 = &snputc [phi:main::@136->printf_string#0] -- pprz1=pprc1 lda #snputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#20 [phi:main::@128->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 0 [phi:main::@128->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#21 [phi:main::@136->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 0 [phi:main::@136->printf_string#2] -- vbum1=vbuc1 lda #0 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 0 [phi:main::@128->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 0 [phi:main::@136->printf_string#3] -- vbum1=vbuc1 sta printf_string.format_min_length jsr printf_string - // main::@129 + // main::@137 // sprintf(info_text, "No %s", file) - // [672] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [699] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [673] callexecute snputc -- call_vprc1 + // [700] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_info_rom(rom_chip, STATUS_SKIP, info_text) - // [675] display_info_rom::rom_chip#6 = main::rom_chip1#10 -- vbum1=vbum2 + // [702] display_info_rom::rom_chip#6 = main::rom_chip1#10 -- vbum1=vbum2 lda rom_chip1 sta display_info_rom.rom_chip - // [676] call display_info_rom - // [1176] phi from main::@129 to display_info_rom [phi:main::@129->display_info_rom] - // [1176] phi display_info_rom::info_text#16 = info_text [phi:main::@129->display_info_rom#0] -- pbuz1=pbuc1 + // [703] call display_info_rom + // [1368] phi from main::@137 to display_info_rom [phi:main::@137->display_info_rom] + // [1368] phi display_info_rom::info_text#16 = info_text [phi:main::@137->display_info_rom#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_info_rom.info_text lda #>@info_text sta.z display_info_rom.info_text+1 - // [1176] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#6 [phi:main::@129->display_info_rom#1] -- register_copy - // [1176] phi display_info_rom::info_status#16 = STATUS_SKIP [phi:main::@129->display_info_rom#2] -- vbuz1=vbuc1 + // [1368] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#6 [phi:main::@137->display_info_rom#1] -- register_copy + // [1368] phi display_info_rom::info_status#16 = STATUS_SKIP [phi:main::@137->display_info_rom#2] -- vbum1=vbuc1 lda #STATUS_SKIP - sta.z display_info_rom.info_status + sta display_info_rom.info_status jsr display_info_rom - jmp __b29 - // [677] phi from main::@236 main::@67 to main::@23 [phi:main::@236/main::@67->main::@23] - // main::@23 - __b23: + jmp __b31 + // [704] phi from main::@246 main::@70 to main::@25 [phi:main::@246/main::@70->main::@25] + // main::@25 + __b25: // display_action_progress("Checking SMC.BIN ...") - // [678] call display_action_progress - // [1084] phi from main::@23 to display_action_progress [phi:main::@23->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = main::info_text2 [phi:main::@23->display_action_progress#0] -- pbuz1=pbuc1 + // [705] call display_action_progress + // [1155] phi from main::@25 to display_action_progress [phi:main::@25->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main::info_text2 [phi:main::@25->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text2 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [679] phi from main::@23 to main::@113 [phi:main::@23->main::@113] - // main::@113 + // [706] phi from main::@25 to main::@121 [phi:main::@25->main::@121] + // main::@121 // smc_read(STATUS_CHECKING) - // [680] call smc_read - // [1505] phi from main::@113 to smc_read [phi:main::@113->smc_read] - // [1505] phi __errno#109 = 0 [phi:main::@113->smc_read#0] -- vwsm1=vwsc1 + // [707] call smc_read + // [1691] phi from main::@121 to smc_read [phi:main::@121->smc_read] + // [1691] phi __errno#100 = 0 [phi:main::@121->smc_read#0] -- vwsm1=vwsc1 lda #<0 sta __errno sta __errno+1 - // [1505] phi __stdio_filecount#104 = 0 [phi:main::@113->smc_read#1] -- vbum1=vbuc1 + // [1691] phi __stdio_filecount#123 = 0 [phi:main::@121->smc_read#1] -- vbum1=vbuc1 sta __stdio_filecount - // [1505] phi smc_read::info_status#10 = STATUS_CHECKING [phi:main::@113->smc_read#2] -- vbuz1=vbuc1 + // [1691] phi smc_read::info_status#10 = STATUS_CHECKING [phi:main::@121->smc_read#2] -- vbum1=vbuc1 lda #STATUS_CHECKING - sta.z smc_read.info_status + sta smc_read.info_status jsr smc_read // smc_read(STATUS_CHECKING) - // [681] smc_read::return#2 = smc_read::return#0 - // main::@114 + // [708] smc_read::return#2 = smc_read::return#0 + // main::@122 // smc_file_size = smc_read(STATUS_CHECKING) - // [682] smc_file_size#0 = smc_read::return#2 -- vwum1=vwuz2 + // [709] smc_file_size#0 = smc_read::return#2 -- vwum1=vwuz2 lda.z smc_read.return sta smc_file_size lda.z smc_read.return+1 sta smc_file_size+1 // if (!smc_file_size) - // [683] if(0==smc_file_size#0) goto main::@26 -- 0_eq_vwum1_then_la1 + // [710] if(0==smc_file_size#0) goto main::@28 -- 0_eq_vwum1_then_la1 lda smc_file_size ora smc_file_size+1 - bne !__b26+ - jmp __b26 - !__b26: - // main::@24 + bne !__b28+ + jmp __b28 + !__b28: + // main::@26 // if(smc_file_size > 0x1E00) - // [684] if(smc_file_size#0>$1e00) goto main::@27 -- vwum1_gt_vwuc1_then_la1 + // [711] if(smc_file_size#0>$1e00) goto main::@29 -- vwum1_gt_vwuc1_then_la1 lda #>$1e00 cmp smc_file_size+1 - bcs !__b27+ - jmp __b27 - !__b27: + bcs !__b29+ + jmp __b29 + !__b29: bne !+ lda #<$1e00 cmp smc_file_size - bcs !__b27+ - jmp __b27 - !__b27: + bcs !__b29+ + jmp __b29 + !__b29: !: - // main::@25 + // main::@27 // smc_file_release = smc_file_header[0] - // [685] smc_file_release#0 = *smc_file_header -- vbum1=_deref_pbuc1 + // [712] smc_file_release#0 = *smc_file_header -- vbum1=_deref_pbuc1 // SF4 | SMC.BIN and all ok | Display the SMC.BIN file version and set SMC to Flash. | Flash // The first 3 bytes of the smc file header is the version of the SMC file. lda smc_file_header sta smc_file_release // smc_file_major = smc_file_header[1] - // [686] smc_file_major#0 = *(smc_file_header+1) -- vbum1=_deref_pbuc1 + // [713] smc_file_major#0 = *(smc_file_header+1) -- vbum1=_deref_pbuc1 lda smc_file_header+1 sta smc_file_major // smc_file_minor = smc_file_header[2] - // [687] smc_file_minor#0 = *(smc_file_header+2) -- vbum1=_deref_pbuc1 + // [714] smc_file_minor#0 = *(smc_file_header+2) -- vbum1=_deref_pbuc1 lda smc_file_header+2 sta smc_file_minor // smc_get_version_text(smc_file_version_text, smc_file_release, smc_file_major, smc_file_minor) - // [688] smc_get_version_text::release#1 = smc_file_release#0 -- vbum1=vbum2 - lda smc_file_release - sta smc_get_version_text.release - // [689] smc_get_version_text::major#1 = smc_file_major#0 -- vbuz1=vbum2 + // [715] smc_get_version_text::release#1 = smc_file_release#0 -- vbuyy=vbum1 + ldy smc_file_release + // [716] smc_get_version_text::major#1 = smc_file_major#0 -- vbum1=vbum2 lda smc_file_major - sta.z smc_get_version_text.major - // [690] smc_get_version_text::minor#1 = smc_file_minor#0 -- vbum1=vbum2 + sta smc_get_version_text.major + // [717] smc_get_version_text::minor#1 = smc_file_minor#0 -- vbuz1=vbum2 lda smc_file_minor - sta smc_get_version_text.minor - // [691] call smc_get_version_text - // [881] phi from main::@25 to smc_get_version_text [phi:main::@25->smc_get_version_text] - // [881] phi smc_get_version_text::minor#2 = smc_get_version_text::minor#1 [phi:main::@25->smc_get_version_text#0] -- register_copy - // [881] phi smc_get_version_text::major#2 = smc_get_version_text::major#1 [phi:main::@25->smc_get_version_text#1] -- register_copy - // [881] phi smc_get_version_text::release#2 = smc_get_version_text::release#1 [phi:main::@25->smc_get_version_text#2] -- register_copy - // [881] phi smc_get_version_text::version_string#2 = main::smc_file_version_text [phi:main::@25->smc_get_version_text#3] -- pbuz1=pbuc1 + sta.z smc_get_version_text.minor + // [718] call smc_get_version_text + // [908] phi from main::@27 to smc_get_version_text [phi:main::@27->smc_get_version_text] + // [908] phi smc_get_version_text::minor#2 = smc_get_version_text::minor#1 [phi:main::@27->smc_get_version_text#0] -- register_copy + // [908] phi smc_get_version_text::major#2 = smc_get_version_text::major#1 [phi:main::@27->smc_get_version_text#1] -- register_copy + // [908] phi smc_get_version_text::release#2 = smc_get_version_text::release#1 [phi:main::@27->smc_get_version_text#2] -- register_copy + // [908] phi smc_get_version_text::version_string#2 = main::smc_file_version_text [phi:main::@27->smc_get_version_text#3] -- pbuz1=pbuc1 lda #smc_file_version_text sta.z smc_get_version_text.version_string+1 jsr smc_get_version_text - // [692] phi from main::@25 to main::@115 [phi:main::@25->main::@115] - // main::@115 + // [719] phi from main::@27 to main::@123 [phi:main::@27->main::@123] + // main::@123 // sprintf(info_text, "SMC.BIN:%s", smc_file_version_text) - // [693] call snprintf_init - // [1113] phi from main::@115 to snprintf_init [phi:main::@115->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:main::@115->snprintf_init#0] -- pbuz1=pbuc1 + // [720] call snprintf_init + // [1184] phi from main::@123 to snprintf_init [phi:main::@123->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:main::@123->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [694] phi from main::@115 to main::@116 [phi:main::@115->main::@116] - // main::@116 + // [721] phi from main::@123 to main::@124 [phi:main::@123->main::@124] + // main::@124 // sprintf(info_text, "SMC.BIN:%s", smc_file_version_text) - // [695] call printf_str - // [1054] phi from main::@116 to printf_str [phi:main::@116->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@116->printf_str#0] -- pprz1=pprc1 + // [722] call printf_str + // [1125] phi from main::@124 to printf_str [phi:main::@124->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@124->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s2 [phi:main::@116->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s2 [phi:main::@124->printf_str#1] -- pbuz1=pbuc1 lda #s2 sta.z printf_str.s+1 jsr printf_str - // [696] phi from main::@116 to main::@117 [phi:main::@116->main::@117] - // main::@117 + // [723] phi from main::@124 to main::@125 [phi:main::@124->main::@125] + // main::@125 // sprintf(info_text, "SMC.BIN:%s", smc_file_version_text) - // [697] call printf_string - // [1227] phi from main::@117 to printf_string [phi:main::@117->printf_string] - // [1227] phi printf_string::putc#25 = &snputc [phi:main::@117->printf_string#0] -- pprz1=pprc1 + // [724] call printf_string + // [1419] phi from main::@125 to printf_string [phi:main::@125->printf_string] + // [1419] phi printf_string::putc#26 = &snputc [phi:main::@125->printf_string#0] -- pprz1=pprc1 lda #snputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = main::smc_file_version_text [phi:main::@117->printf_string#1] -- pbuz1=pbuc1 + // [1419] phi printf_string::str#26 = main::smc_file_version_text [phi:main::@125->printf_string#1] -- pbuz1=pbuc1 lda #smc_file_version_text sta.z printf_string.str+1 - // [1227] phi printf_string::format_justify_left#25 = 0 [phi:main::@117->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::format_justify_left#26 = 0 [phi:main::@125->printf_string#2] -- vbum1=vbuc1 lda #0 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 0 [phi:main::@117->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 0 [phi:main::@125->printf_string#3] -- vbum1=vbuc1 sta printf_string.format_min_length jsr printf_string - // main::@118 + // main::@126 // sprintf(info_text, "SMC.BIN:%s", smc_file_version_text) - // [698] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [725] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [699] callexecute snputc -- call_vprc1 + // [726] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla - // [701] smc_bootloader#459 = smc_bootloader#0 -- vwum1=vwum2 + // [728] smc_bootloader#581 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_FLASH, info_text) - // [702] call display_info_smc + // [729] call display_info_smc // All ok, display file version. - // [898] phi from main::@118 to display_info_smc [phi:main::@118->display_info_smc] - // [898] phi display_info_smc::info_text#21 = info_text [phi:main::@118->display_info_smc#0] -- pbuz1=pbuc1 + // [925] phi from main::@126 to display_info_smc [phi:main::@126->display_info_smc] + // [925] phi display_info_smc::info_text#24 = info_text [phi:main::@126->display_info_smc#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_info_smc.info_text lda #>@info_text sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#459 [phi:main::@118->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_FLASH [phi:main::@118->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#581 [phi:main::@126->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_FLASH [phi:main::@126->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_FLASH - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - // [122] phi from main::@118 to main::SEI2 [phi:main::@118->main::SEI2] - // [122] phi smc_file_minor#316 = smc_file_minor#0 [phi:main::@118->main::SEI2#0] -- register_copy - // [122] phi smc_file_major#316 = smc_file_major#0 [phi:main::@118->main::SEI2#1] -- register_copy - // [122] phi smc_file_release#316 = smc_file_release#0 [phi:main::@118->main::SEI2#2] -- register_copy - // [122] phi __stdio_filecount#259 = __stdio_filecount#27 [phi:main::@118->main::SEI2#3] -- register_copy - // [122] phi __errno#245 = __errno#18 [phi:main::@118->main::SEI2#4] -- register_copy - jmp SEI2 - // main::@27 - __b27: - // [703] smc_bootloader#471 = smc_bootloader#0 -- vwum1=vwum2 + // [123] phi from main::@126 to main::@3 [phi:main::@126->main::@3] + // [123] phi smc_file_minor#310 = smc_file_minor#0 [phi:main::@126->main::@3#0] -- register_copy + // [123] phi smc_file_major#310 = smc_file_major#0 [phi:main::@126->main::@3#1] -- register_copy + // [123] phi smc_file_release#310 = smc_file_release#0 [phi:main::@126->main::@3#2] -- register_copy + // [123] phi __stdio_filecount#109 = __stdio_filecount#36 [phi:main::@126->main::@3#3] -- register_copy + // [123] phi __errno#113 = __errno#123 [phi:main::@126->main::@3#4] -- register_copy + jmp __b3 + // main::@29 + __b29: + // [730] smc_bootloader#594 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_ISSUE, "SMC.BIN too large!") - // [704] call display_info_smc + // [731] call display_info_smc // SF3 | size SMC.BIN is > 0x1E00 | Display SMC.BIN file size issue and don't flash. Ask the user to place a correct SMC.BIN file onto the SDcard. | Issue - // [898] phi from main::@27 to display_info_smc [phi:main::@27->display_info_smc] - // [898] phi display_info_smc::info_text#21 = main::info_text4 [phi:main::@27->display_info_smc#0] -- pbuz1=pbuc1 + // [925] phi from main::@29 to display_info_smc [phi:main::@29->display_info_smc] + // [925] phi display_info_smc::info_text#24 = main::info_text4 [phi:main::@29->display_info_smc#0] -- pbuz1=pbuc1 lda #info_text4 sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#471 [phi:main::@27->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_ISSUE [phi:main::@27->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#594 [phi:main::@29->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_ISSUE [phi:main::@29->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_ISSUE - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - // [122] phi from main::@26 main::@27 to main::SEI2 [phi:main::@26/main::@27->main::SEI2] - __b5: - // [122] phi smc_file_minor#316 = 0 [phi:main::@26/main::@27->main::SEI2#0] -- vbum1=vbuc1 + // [123] phi from main::@28 main::@29 to main::@3 [phi:main::@28/main::@29->main::@3] + __b7: + // [123] phi smc_file_minor#310 = 0 [phi:main::@28/main::@29->main::@3#0] -- vbum1=vbuc1 lda #0 sta smc_file_minor - // [122] phi smc_file_major#316 = 0 [phi:main::@26/main::@27->main::SEI2#1] -- vbum1=vbuc1 + // [123] phi smc_file_major#310 = 0 [phi:main::@28/main::@29->main::@3#1] -- vbum1=vbuc1 sta smc_file_major - // [122] phi smc_file_release#316 = 0 [phi:main::@26/main::@27->main::SEI2#2] -- vbum1=vbuc1 + // [123] phi smc_file_release#310 = 0 [phi:main::@28/main::@29->main::@3#2] -- vbum1=vbuc1 sta smc_file_release - // [122] phi __stdio_filecount#259 = __stdio_filecount#27 [phi:main::@26/main::@27->main::SEI2#3] -- register_copy - // [122] phi __errno#245 = __errno#18 [phi:main::@26/main::@27->main::SEI2#4] -- register_copy - jmp SEI2 - // main::@26 - __b26: - // [705] smc_bootloader#470 = smc_bootloader#0 -- vwum1=vwum2 + // [123] phi __stdio_filecount#109 = __stdio_filecount#36 [phi:main::@28/main::@29->main::@3#3] -- register_copy + // [123] phi __errno#113 = __errno#123 [phi:main::@28/main::@29->main::@3#4] -- register_copy + jmp __b3 + // main::@28 + __b28: + // [732] smc_bootloader#593 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_SKIP, "No SMC.BIN!") - // [706] call display_info_smc + // [733] call display_info_smc // SF1 | no SMC.BIN | Ask user to place an SMC.BIN file onto the SDcard and don't flash. | Issue // SF2 | size SMC.BIN is 0 | Ask user to place an SMC.BIN file onto the SDcard and don't flash. | Issue - // [898] phi from main::@26 to display_info_smc [phi:main::@26->display_info_smc] - // [898] phi display_info_smc::info_text#21 = main::info_text3 [phi:main::@26->display_info_smc#0] -- pbuz1=pbuc1 + // [925] phi from main::@28 to display_info_smc [phi:main::@28->display_info_smc] + // [925] phi display_info_smc::info_text#24 = main::info_text3 [phi:main::@28->display_info_smc#0] -- pbuz1=pbuc1 lda #info_text3 sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#470 [phi:main::@26->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_SKIP [phi:main::@26->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#593 [phi:main::@28->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_SKIP [phi:main::@28->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_SKIP - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - jmp __b5 - // main::@20 - __b20: + jmp __b7 + // main::@22 + __b22: // if(rom_device_ids[rom_chip] != UNKNOWN) - // [707] if(rom_device_ids[main::rom_chip#10]!=$55) goto main::@21 -- pbuc1_derefidx_vbum1_neq_vbuc2_then_la1 + // [734] if(rom_device_ids[main::rom_chip#10]!=$55) goto main::@23 -- pbuc1_derefidx_vbum1_neq_vbuc2_then_la1 lda #$55 ldy rom_chip cmp rom_device_ids,y - bne __b21 - // main::@22 - __b22: + bne __b23 + // main::@24 + __b24: // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [708] main::rom_chip#1 = ++ main::rom_chip#10 -- vbum1=_inc_vbum1 + // [735] main::rom_chip#1 = ++ main::rom_chip#10 -- vbum1=_inc_vbum1 inc rom_chip - // [112] phi from main::@22 to main::@19 [phi:main::@22->main::@19] - // [112] phi main::rom_chip#10 = main::rom_chip#1 [phi:main::@22->main::@19#0] -- register_copy - jmp __b19 - // main::@21 - __b21: + // [113] phi from main::@24 to main::@21 [phi:main::@24->main::@21] + // [113] phi main::rom_chip#10 = main::rom_chip#1 [phi:main::@24->main::@21#0] -- register_copy + jmp __b21 + // main::@23 + __b23: // bank_set_brom(rom_chip*32) - // [709] main::bank_set_brom3_bank#0 = main::rom_chip#10 << 5 -- vbum1=vbum2_rol_5 + // [736] main::bank_set_brom3_bank#0 = main::rom_chip#10 << 5 -- vbuaa=vbum1_rol_5 lda rom_chip asl asl asl asl asl - sta bank_set_brom3_bank // main::bank_set_brom3 // BROM = bank - // [710] BROM = main::bank_set_brom3_bank#0 -- vbuz1=vbum2 + // [737] BROM = main::bank_set_brom3_bank#0 -- vbuz1=vbuaa sta.z BROM - // main::@68 + // main::@71 // rom_chip*8 - // [711] main::$100 = main::rom_chip#10 << 3 -- vbuz1=vbum2_rol_3 + // [738] main::$107 = main::rom_chip#10 << 3 -- vbum1=vbum2_rol_3 lda rom_chip asl asl asl - sta.z main__100 + sta main__107 // rom_get_github_commit_id(&rom_github[rom_chip*8], (char*)0xC000) - // [712] rom_get_github_commit_id::commit_id#1 = rom_github + main::$100 -- pbuz1=pbuc1_plus_vbuz2 + // [739] rom_get_github_commit_id::commit_id#1 = rom_github + main::$107 -- pbuz1=pbuc1_plus_vbum2 clc adc #rom_github adc #0 sta.z rom_get_github_commit_id.commit_id+1 - // [713] call rom_get_github_commit_id - // [1818] phi from main::@68 to rom_get_github_commit_id [phi:main::@68->rom_get_github_commit_id] - // [1818] phi rom_get_github_commit_id::commit_id#6 = rom_get_github_commit_id::commit_id#1 [phi:main::@68->rom_get_github_commit_id#0] -- register_copy - // [1818] phi rom_get_github_commit_id::from#6 = (char *) 49152 [phi:main::@68->rom_get_github_commit_id#1] -- pbuz1=pbuc1 + // [740] call rom_get_github_commit_id + // [1998] phi from main::@71 to rom_get_github_commit_id [phi:main::@71->rom_get_github_commit_id] + // [1998] phi rom_get_github_commit_id::commit_id#6 = rom_get_github_commit_id::commit_id#1 [phi:main::@71->rom_get_github_commit_id#0] -- register_copy + // [1998] phi rom_get_github_commit_id::from#6 = (char *) 49152 [phi:main::@71->rom_get_github_commit_id#1] -- pbuz1=pbuc1 lda #<$c000 sta.z rom_get_github_commit_id.from lda #>$c000 sta.z rom_get_github_commit_id.from+1 jsr rom_get_github_commit_id - // main::@109 + // main::@116 // rom_get_release(*((char*)0xFF80)) - // [714] rom_get_release::release#1 = *((char *) 65408) -- vbuz1=_deref_pbuc1 - lda $ff80 - sta.z rom_get_release.release - // [715] call rom_get_release - // [1786] phi from main::@109 to rom_get_release [phi:main::@109->rom_get_release] - // [1786] phi rom_get_release::release#3 = rom_get_release::release#1 [phi:main::@109->rom_get_release#0] -- register_copy + // [741] rom_get_release::release#1 = *((char *) 65408) -- vbuxx=_deref_pbuc1 + ldx $ff80 + // [742] call rom_get_release + // [1966] phi from main::@116 to rom_get_release [phi:main::@116->rom_get_release] + // [1966] phi rom_get_release::release#3 = rom_get_release::release#1 [phi:main::@116->rom_get_release#0] -- register_copy jsr rom_get_release // rom_get_release(*((char*)0xFF80)) - // [716] rom_get_release::return#2 = rom_get_release::return#0 - // main::@110 - // [717] main::$96 = rom_get_release::return#2 + // [743] rom_get_release::return#2 = rom_get_release::return#0 + // main::@117 + // [744] main::$103 = rom_get_release::return#2 -- vbuaa=vbuxx + txa // rom_release[rom_chip] = rom_get_release(*((char*)0xFF80)) - // [718] rom_release[main::rom_chip#10] = main::$96 -- pbuc1_derefidx_vbum1=vbuz2 - lda.z main__96 + // [745] rom_release[main::rom_chip#10] = main::$103 -- pbuc1_derefidx_vbum1=vbuaa ldy rom_chip sta rom_release,y // rom_get_prefix(*((char*)0xFF80)) - // [719] rom_get_prefix::release#0 = *((char *) 65408) -- vbum1=_deref_pbuc1 + // [746] rom_get_prefix::release#0 = *((char *) 65408) -- vbuaa=_deref_pbuc1 lda $ff80 - sta rom_get_prefix.release - // [720] call rom_get_prefix - // [1793] phi from main::@110 to rom_get_prefix [phi:main::@110->rom_get_prefix] - // [1793] phi rom_get_prefix::release#2 = rom_get_prefix::release#0 [phi:main::@110->rom_get_prefix#0] -- register_copy + // [747] call rom_get_prefix + // [1973] phi from main::@117 to rom_get_prefix [phi:main::@117->rom_get_prefix] + // [1973] phi rom_get_prefix::release#2 = rom_get_prefix::release#0 [phi:main::@117->rom_get_prefix#0] -- register_copy jsr rom_get_prefix // rom_get_prefix(*((char*)0xFF80)) - // [721] rom_get_prefix::return#2 = rom_get_prefix::return#0 - // main::@111 - // [722] main::$97 = rom_get_prefix::return#2 + // [748] rom_get_prefix::return#2 = rom_get_prefix::return#0 + // main::@118 + // [749] main::$104 = rom_get_prefix::return#2 -- vbuaa=vbuxx + txa // rom_prefix[rom_chip] = rom_get_prefix(*((char*)0xFF80)) - // [723] rom_prefix[main::rom_chip#10] = main::$97 -- pbuc1_derefidx_vbum1=vbum2 - lda main__97 + // [750] rom_prefix[main::rom_chip#10] = main::$104 -- pbuc1_derefidx_vbum1=vbuaa ldy rom_chip sta rom_prefix,y // rom_chip*13 - // [724] main::$360 = main::rom_chip#10 << 1 -- vbuz1=vbum2_rol_1 + // [751] main::$383 = main::rom_chip#10 << 1 -- vbuaa=vbum1_rol_1 tya asl - sta.z main__360 - // [725] main::$361 = main::$360 + main::rom_chip#10 -- vbuz1=vbuz1_plus_vbum2 - tya + // [752] main::$384 = main::$383 + main::rom_chip#10 -- vbuaa=vbuaa_plus_vbum1 clc - adc.z main__361 - sta.z main__361 - // [726] main::$362 = main::$361 << 2 -- vbuz1=vbuz1_rol_2 - lda.z main__362 + adc rom_chip + // [753] main::$385 = main::$384 << 2 -- vbuaa=vbuaa_rol_2 asl asl - sta.z main__362 - // [727] main::$98 = main::$362 + main::rom_chip#10 -- vbuz1=vbuz1_plus_vbum2 - tya + // [754] main::$105 = main::$385 + main::rom_chip#10 -- vbuaa=vbuaa_plus_vbum1 clc - adc.z main__98 - sta.z main__98 + adc rom_chip // rom_get_version_text(&rom_release_text[rom_chip*13], rom_prefix[rom_chip], rom_release[rom_chip], &rom_github[rom_chip*8]) - // [728] rom_get_version_text::release_info#0 = rom_release_text + main::$98 -- pbuz1=pbuc1_plus_vbuz2 + // [755] rom_get_version_text::release_info#0 = rom_release_text + main::$105 -- pbuz1=pbuc1_plus_vbuaa clc adc #rom_release_text adc #0 sta.z rom_get_version_text.release_info+1 - // [729] rom_get_version_text::github#0 = rom_github + main::$100 -- pbuz1=pbuc1_plus_vbuz2 - lda.z main__100 + // [756] rom_get_version_text::github#0 = rom_github + main::$107 -- pbuz1=pbuc1_plus_vbum2 + lda main__107 clc adc #rom_github adc #0 sta.z rom_get_version_text.github+1 - // [730] rom_get_version_text::prefix#0 = rom_prefix[main::rom_chip#10] -- vbum1=pbuc1_derefidx_vbum2 - lda rom_prefix,y - sta rom_get_version_text.prefix - // [731] rom_get_version_text::release#0 = rom_release[main::rom_chip#10] -- vbuz1=pbuc1_derefidx_vbum2 + // [757] rom_get_version_text::prefix#0 = rom_prefix[main::rom_chip#10] -- vbuxx=pbuc1_derefidx_vbum1 + ldx rom_prefix,y + // [758] rom_get_version_text::release#0 = rom_release[main::rom_chip#10] -- vbuz1=pbuc1_derefidx_vbum2 lda rom_release,y sta.z rom_get_version_text.release - // [732] call rom_get_version_text - // [1802] phi from main::@111 to rom_get_version_text [phi:main::@111->rom_get_version_text] - // [1802] phi rom_get_version_text::github#2 = rom_get_version_text::github#0 [phi:main::@111->rom_get_version_text#0] -- register_copy - // [1802] phi rom_get_version_text::release#2 = rom_get_version_text::release#0 [phi:main::@111->rom_get_version_text#1] -- register_copy - // [1802] phi rom_get_version_text::prefix#2 = rom_get_version_text::prefix#0 [phi:main::@111->rom_get_version_text#2] -- register_copy - // [1802] phi rom_get_version_text::release_info#2 = rom_get_version_text::release_info#0 [phi:main::@111->rom_get_version_text#3] -- register_copy + // [759] call rom_get_version_text + // [1982] phi from main::@118 to rom_get_version_text [phi:main::@118->rom_get_version_text] + // [1982] phi rom_get_version_text::github#2 = rom_get_version_text::github#0 [phi:main::@118->rom_get_version_text#0] -- register_copy + // [1982] phi rom_get_version_text::release#2 = rom_get_version_text::release#0 [phi:main::@118->rom_get_version_text#1] -- register_copy + // [1982] phi rom_get_version_text::prefix#2 = rom_get_version_text::prefix#0 [phi:main::@118->rom_get_version_text#2] -- register_copy + // [1982] phi rom_get_version_text::release_info#2 = rom_get_version_text::release_info#0 [phi:main::@118->rom_get_version_text#3] -- register_copy jsr rom_get_version_text - // main::@112 + // main::@119 // display_info_rom(rom_chip, STATUS_DETECTED, NULL) - // [733] display_info_rom::rom_chip#5 = main::rom_chip#10 -- vbum1=vbum2 + // [760] display_info_rom::rom_chip#5 = main::rom_chip#10 -- vbum1=vbum2 lda rom_chip sta display_info_rom.rom_chip - // [734] call display_info_rom - // [1176] phi from main::@112 to display_info_rom [phi:main::@112->display_info_rom] - // [1176] phi display_info_rom::info_text#16 = 0 [phi:main::@112->display_info_rom#0] -- pbuz1=vbuc1 + // [761] call display_info_rom + // [1368] phi from main::@119 to display_info_rom [phi:main::@119->display_info_rom] + // [1368] phi display_info_rom::info_text#16 = 0 [phi:main::@119->display_info_rom#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_rom.info_text sta.z display_info_rom.info_text+1 - // [1176] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#5 [phi:main::@112->display_info_rom#1] -- register_copy - // [1176] phi display_info_rom::info_status#16 = STATUS_DETECTED [phi:main::@112->display_info_rom#2] -- vbuz1=vbuc1 + // [1368] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#5 [phi:main::@119->display_info_rom#1] -- register_copy + // [1368] phi display_info_rom::info_status#16 = STATUS_DETECTED [phi:main::@119->display_info_rom#2] -- vbum1=vbuc1 lda #STATUS_DETECTED - sta.z display_info_rom.info_status + sta display_info_rom.info_status jsr display_info_rom - jmp __b22 - // [735] phi from main::@5 to main::@18 [phi:main::@5->main::@18] - // main::@18 - __b18: + jmp __b24 + // [762] phi from main::@7 to main::@20 [phi:main::@7->main::@20] + // main::@20 + __b20: // sprintf(info_text, "Bootloader v%02x invalid! !", smc_bootloader) - // [736] call snprintf_init - // [1113] phi from main::@18 to snprintf_init [phi:main::@18->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:main::@18->snprintf_init#0] -- pbuz1=pbuc1 + // [763] call snprintf_init + // [1184] phi from main::@20 to snprintf_init [phi:main::@20->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:main::@20->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [737] phi from main::@18 to main::@99 [phi:main::@18->main::@99] - // main::@99 + // [764] phi from main::@20 to main::@106 [phi:main::@20->main::@106] + // main::@106 // sprintf(info_text, "Bootloader v%02x invalid! !", smc_bootloader) - // [738] call printf_str - // [1054] phi from main::@99 to printf_str [phi:main::@99->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@99->printf_str#0] -- pprz1=pprc1 + // [765] call printf_str + // [1125] phi from main::@106 to printf_str [phi:main::@106->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@106->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s [phi:main::@99->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s [phi:main::@106->printf_str#1] -- pbuz1=pbuc1 lda #s sta.z printf_str.s+1 jsr printf_str - // main::@100 + // main::@107 // sprintf(info_text, "Bootloader v%02x invalid! !", smc_bootloader) - // [739] printf_uint::uvalue#6 = smc_bootloader#0 -- vwum1=vwum2 + // [766] printf_uint::uvalue#7 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta printf_uint.uvalue lda smc_bootloader+1 sta printf_uint.uvalue+1 - // [740] call printf_uint - // [1835] phi from main::@100 to printf_uint [phi:main::@100->printf_uint] - // [1835] phi printf_uint::format_zero_padding#10 = 1 [phi:main::@100->printf_uint#0] -- vbum1=vbuc1 + // [767] call printf_uint + // [2015] phi from main::@107 to printf_uint [phi:main::@107->printf_uint] + // [2015] phi printf_uint::format_zero_padding#10 = 1 [phi:main::@107->printf_uint#0] -- vbum1=vbuc1 lda #1 sta printf_uint.format_zero_padding - // [1835] phi printf_uint::format_min_length#10 = 2 [phi:main::@100->printf_uint#1] -- vbum1=vbuc1 + // [2015] phi printf_uint::format_min_length#10 = 2 [phi:main::@107->printf_uint#1] -- vbum1=vbuc1 lda #2 sta printf_uint.format_min_length - // [1835] phi printf_uint::putc#10 = &snputc [phi:main::@100->printf_uint#2] -- pprz1=pprc1 + // [2015] phi printf_uint::putc#10 = &snputc [phi:main::@107->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1835] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:main::@100->printf_uint#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uint.format_radix - // [1835] phi printf_uint::uvalue#10 = printf_uint::uvalue#6 [phi:main::@100->printf_uint#4] -- register_copy + // [2015] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:main::@107->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [2015] phi printf_uint::uvalue#10 = printf_uint::uvalue#7 [phi:main::@107->printf_uint#4] -- register_copy jsr printf_uint - // [741] phi from main::@100 to main::@101 [phi:main::@100->main::@101] - // main::@101 + // [768] phi from main::@107 to main::@108 [phi:main::@107->main::@108] + // main::@108 // sprintf(info_text, "Bootloader v%02x invalid! !", smc_bootloader) - // [742] call printf_str - // [1054] phi from main::@101 to printf_str [phi:main::@101->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:main::@101->printf_str#0] -- pprz1=pprc1 + // [769] call printf_str + // [1125] phi from main::@108 to printf_str [phi:main::@108->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main::@108->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = main::s1 [phi:main::@101->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = main::s1 [phi:main::@108->printf_str#1] -- pbuz1=pbuc1 lda #s1 sta.z printf_str.s+1 jsr printf_str - // main::@102 + // main::@109 // sprintf(info_text, "Bootloader v%02x invalid! !", smc_bootloader) - // [743] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [770] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [744] callexecute snputc -- call_vprc1 + // [771] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla - // [746] smc_bootloader#456 = smc_bootloader#0 -- vwum1=vwum2 + // [773] smc_bootloader#579 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_ISSUE, info_text) - // [747] call display_info_smc - // [898] phi from main::@102 to display_info_smc [phi:main::@102->display_info_smc] - // [898] phi display_info_smc::info_text#21 = info_text [phi:main::@102->display_info_smc#0] -- pbuz1=pbuc1 + // [774] call display_info_smc + // [925] phi from main::@109 to display_info_smc [phi:main::@109->display_info_smc] + // [925] phi display_info_smc::info_text#24 = info_text [phi:main::@109->display_info_smc#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_info_smc.info_text lda #>@info_text sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#456 [phi:main::@102->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_ISSUE [phi:main::@102->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#579 [phi:main::@109->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_ISSUE [phi:main::@109->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_ISSUE - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - // [748] phi from main::@102 to main::@103 [phi:main::@102->main::@103] - // main::@103 + // [775] phi from main::@109 to main::@110 [phi:main::@109->main::@110] + // main::@110 // display_progress_text(display_no_valid_smc_bootloader_text, display_no_valid_smc_bootloader_count) - // [749] call display_progress_text + // [776] call display_progress_text // Bootloader is not supported by this utility, but is not error. - // [1098] phi from main::@103 to display_progress_text [phi:main::@103->display_progress_text] - // [1098] phi display_progress_text::text#12 = display_no_valid_smc_bootloader_text [phi:main::@103->display_progress_text#0] -- qbuz1=qbuc1 + // [1169] phi from main::@110 to display_progress_text [phi:main::@110->display_progress_text] + // [1169] phi display_progress_text::text#13 = display_no_valid_smc_bootloader_text [phi:main::@110->display_progress_text#0] -- qbuz1=qbuc1 lda #display_no_valid_smc_bootloader_text sta.z display_progress_text.text+1 - // [1098] phi display_progress_text::lines#11 = display_no_valid_smc_bootloader_count [phi:main::@103->display_progress_text#1] -- vbum1=vbuc1 + // [1169] phi display_progress_text::lines#12 = display_no_valid_smc_bootloader_count [phi:main::@110->display_progress_text#1] -- vbuz1=vbuc1 lda #display_no_valid_smc_bootloader_count - sta display_progress_text.lines + sta.z display_progress_text.lines jsr display_progress_text - // [105] phi from main::@103 main::@17 main::@98 to main::SEI1 [phi:main::@103/main::@17/main::@98->main::SEI1] - __b6: - // [105] phi smc_minor#391 = 0 [phi:main::@103/main::@17/main::@98->main::SEI1#0] -- vbum1=vbuc1 + // [105] phi from main::@105 main::@110 main::@19 to main::@2 [phi:main::@105/main::@110/main::@19->main::@2] + __b8: + // [105] phi smc_minor#418 = 0 [phi:main::@105/main::@110/main::@19->main::@2#0] -- vbum1=vbuc1 lda #0 sta smc_minor - // [105] phi smc_major#392 = 0 [phi:main::@103/main::@17/main::@98->main::SEI1#1] -- vbum1=vbuc1 + // [105] phi smc_major#419 = 0 [phi:main::@105/main::@110/main::@19->main::@2#1] -- vbum1=vbuc1 sta smc_major - // [105] phi smc_release#393 = 0 [phi:main::@103/main::@17/main::@98->main::SEI1#2] -- vbum1=vbuc1 + // [105] phi smc_release#420 = 0 [phi:main::@105/main::@110/main::@19->main::@2#2] -- vbum1=vbuc1 sta smc_release - jmp SEI1 - // main::@17 - __b17: - // [750] smc_bootloader#469 = smc_bootloader#0 -- vwum1=vwum2 + jmp __b2 + // main::@19 + __b19: + // [777] smc_bootloader#592 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_ERROR, "SMC Unreachable!") - // [751] call display_info_smc + // [778] call display_info_smc // SD2 | SMC chip not detected | Display that the SMC chip is not detected and set SMC to Error. | Error - // [898] phi from main::@17 to display_info_smc [phi:main::@17->display_info_smc] - // [898] phi display_info_smc::info_text#21 = main::info_text1 [phi:main::@17->display_info_smc#0] -- pbuz1=pbuc1 + // [925] phi from main::@19 to display_info_smc [phi:main::@19->display_info_smc] + // [925] phi display_info_smc::info_text#24 = main::info_text1 [phi:main::@19->display_info_smc#0] -- pbuz1=pbuc1 lda #info_text1 sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#469 [phi:main::@17->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_ERROR [phi:main::@17->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#592 [phi:main::@19->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_ERROR [phi:main::@19->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_ERROR - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - jmp __b6 + jmp __b8 // main::@1 __b1: - // [752] smc_bootloader#455 = smc_bootloader#0 -- vwum1=vwum2 + // [779] smc_bootloader#578 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 sta smc_bootloader_1+1 // display_info_smc(STATUS_ISSUE, "No Bootloader!") - // [753] call display_info_smc + // [780] call display_info_smc // SD1 | No Bootloader | Display that there is no bootloader and set SMC to Issue. | Issue - // [898] phi from main::@1 to display_info_smc [phi:main::@1->display_info_smc] - // [898] phi display_info_smc::info_text#21 = main::info_text [phi:main::@1->display_info_smc#0] -- pbuz1=pbuc1 + // [925] phi from main::@1 to display_info_smc [phi:main::@1->display_info_smc] + // [925] phi display_info_smc::info_text#24 = main::info_text [phi:main::@1->display_info_smc#0] -- pbuz1=pbuc1 lda #info_text sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = smc_bootloader#455 [phi:main::@1->display_info_smc#1] -- register_copy - // [898] phi display_info_smc::info_status#21 = STATUS_ISSUE [phi:main::@1->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi smc_bootloader#14 = smc_bootloader#578 [phi:main::@1->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_ISSUE [phi:main::@1->display_info_smc#2] -- vbuz1=vbuc1 lda #STATUS_ISSUE - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - // [754] phi from main::@1 to main::@98 [phi:main::@1->main::@98] - // main::@98 + // [781] phi from main::@1 to main::@105 [phi:main::@1->main::@105] + // main::@105 // display_progress_text(display_no_valid_smc_bootloader_text, display_no_valid_smc_bootloader_count) - // [755] call display_progress_text + // [782] call display_progress_text // If the CX16 board does not have a bootloader, display info how to flash bootloader. - // [1098] phi from main::@98 to display_progress_text [phi:main::@98->display_progress_text] - // [1098] phi display_progress_text::text#12 = display_no_valid_smc_bootloader_text [phi:main::@98->display_progress_text#0] -- qbuz1=qbuc1 + // [1169] phi from main::@105 to display_progress_text [phi:main::@105->display_progress_text] + // [1169] phi display_progress_text::text#13 = display_no_valid_smc_bootloader_text [phi:main::@105->display_progress_text#0] -- qbuz1=qbuc1 lda #display_no_valid_smc_bootloader_text sta.z display_progress_text.text+1 - // [1098] phi display_progress_text::lines#11 = display_no_valid_smc_bootloader_count [phi:main::@98->display_progress_text#1] -- vbum1=vbuc1 + // [1169] phi display_progress_text::lines#12 = display_no_valid_smc_bootloader_count [phi:main::@105->display_progress_text#1] -- vbuz1=vbuc1 lda #display_no_valid_smc_bootloader_count - sta display_progress_text.lines + sta.z display_progress_text.lines jsr display_progress_text - jmp __b6 + jmp __b8 .segment Data smc_file_version_text: .fill $d, 0 rom_file_release_text: .fill $d, 0 @@ -4883,21 +4892,21 @@ main: { .byte 0 filter: .text "YN" .byte 0 - info_text9: .text "Issue with the CX16 main ROM: not detected ..." + info_text9: .text "Issue with the CX16 ROM: not detected! ..." .byte 0 - info_text10: .text "Issue with CX16 main ROM!" + info_text10: .text "Issue with CX16 ROM!" .byte 0 info_text11: .text "Are J1 jumper pins closed?" .byte 0 - info_text13: .text "Issue with the CX16 main ROM, check the issue ..." + info_text13: .text "Issue with the CX16 ROM, check the issue ..." .byte 0 info_text14: .text "Issue with main CX16 ROM!" .byte 0 info_text20: .text "Compatibility between ROM.BIN and SMC.BIN can't be assured!" .byte 0 - info_text22: .text "The SMC chip and SMC.BIN versions are equal, no flash required!" + info_text22: .text "The CX16 SMC and SMC.BIN versions are equal, no flash required!" .byte 0 - info_text23: .text "The CX16 main ROM and ROM.BIN versions are equal, no flash required!" + info_text23: .text "The CX16 ROM and ROM.BIN versions are equal, no flash required!" .byte 0 info_text24: .text "Chipsets have been detected and update files validated!" .byte 0 @@ -4905,7 +4914,7 @@ main: { .byte 0 filter4: .text "nyNY" .byte 0 - main__330: .text "nN" + main__354: .text "nN" .byte 0 info_text26: .text "Cancelled" .byte 0 @@ -4917,21 +4926,17 @@ main: { .byte 0 info_text32: .text "Press POWER/RESET!" .byte 0 - info_text34: .text "SMC has errors!" + info_text33: .text "SMC has errors!" .byte 0 - info_text35: .text "POWER/RESET not pressed!" + info_text34: .text "POWER/RESET not pressed!" .byte 0 s9: .text "Reading " .byte 0 s10: .text " ... (.) data ( ) empty" .byte 0 - info_text36: .text "SMC Update failed!" - .byte 0 - info_text37: .text "Comparing ... (.) data, (=) same, (*) different." + info_text35: .text "SMC Update failed!" .byte 0 - info_text39: .text "No update required" - .byte 0 - s11: .text " differences!" + info_text36: .text "Comparing ... (.) data, (=) same, (*) different." .byte 0 s12: .text " flash errors!" .byte 0 @@ -4947,15 +4952,15 @@ main: { .byte 0 s18: .text @"PLEASE REMOVE THE JP1 JUMPER OR YOUR SDCARD WON'T WORK!\n" .byte 0 - info_text40: .text "No CX16 component has been updated with new firmware!" + info_text39: .text "No CX16 component has been updated with new firmware!" .byte 0 - info_text41: .text "Update Failure! Your CX16 may no longer boot!" + info_text40: .text "Update Failure! Your CX16 may no longer boot!" .byte 0 - info_text42: .text "Take a photo of this screen, shut down power and retry!" + info_text41: .text "Take a photo of this screen and wait at leaast 60 seconds." .byte 0 - info_text43: .text "Update issues, your CX16 is not updated!" + info_text42: .text "Update issues, your CX16 is not updated!" .byte 0 - info_text44: .text "Your CX16 update is a success!" + info_text43: .text "Your CX16 update is a success!" .byte 0 text: .text "DON'T DO ANYTHING UNTIL COUNTDOWN FINISHES!" .byte 0 @@ -4967,66 +4972,33 @@ main: { .byte 0 s23: .text ") Your CX16 will reset after countdown ..." .byte 0 - .label main__28 = smc_supported_rom.return - main__43: .word 0 - main__52: .byte 0 - .label main__61 = check_status_roms.return - .label main__97 = rom_get_prefix.return - .label main__186 = check_status_card_roms.return - .label main__262 = check_status_roms.return - .label main__267 = check_status_roms.return - main__303: .byte 0 - main__305: .byte 0 - check_status_smc3_main__0: .byte 0 - check_status_cx16_rom1_check_status_rom1_main__0: .byte 0 - check_status_smc4_main__0: .byte 0 - check_status_cx16_rom2_check_status_rom1_main__0: .byte 0 - check_status_smc5_main__0: .byte 0 - check_status_cx16_rom3_check_status_rom1_main__0: .byte 0 - check_status_smc6_main__0: .byte 0 - check_status_smc7_main__0: .byte 0 - check_status_cx16_rom5_check_status_rom1_main__0: .byte 0 - check_status_smc8_main__0: .byte 0 - check_status_vera1_main__0: .byte 0 - check_status_smc9_main__0: .byte 0 - check_status_vera4_main__0: .byte 0 - check_status_smc11_main__0: .byte 0 - check_status_rom1_main__0: .byte 0 - check_status_vera6_main__0: .byte 0 - check_status_smc18_main__0: .byte 0 - bank_set_brom3_bank: .byte 0 + main__50: .word 0 + main__59: .byte 0 + main__107: .byte 0 + main__324: .byte 0 + main__326: .byte 0 rom_chip: .byte 0 - .label check_status_smc3_return = check_status_smc3_main__0 - .label check_status_cx16_rom1_check_status_rom1_return = check_status_cx16_rom1_check_status_rom1_main__0 rom_chip1: .byte 0 rom_bank: .byte 0 file: .word 0 .label rom_bytes_read = rom_read.return rom_file_modulo: .dword 0 - .label rom_file_prefix_id = rom_get_prefix.return - .label check_status_smc4_return = check_status_smc4_main__0 - .label check_status_cx16_rom2_check_status_rom1_return = check_status_cx16_rom2_check_status_rom1_main__0 - .label check_status_smc5_return = check_status_smc5_main__0 - .label check_status_cx16_rom3_check_status_rom1_return = check_status_cx16_rom3_check_status_rom1_main__0 - .label check_status_smc6_return = check_status_smc6_main__0 - .label check_status_smc7_return = check_status_smc7_main__0 - .label check_status_cx16_rom5_check_status_rom1_return = check_status_cx16_rom5_check_status_rom1_main__0 - .label check_status_smc8_return = check_status_smc8_main__0 - .label check_status_vera1_return = check_status_vera1_main__0 - .label check_status_smc9_return = check_status_smc9_main__0 - .label check_status_vera4_return = check_status_vera4_main__0 - .label check_status_smc11_return = check_status_smc11_main__0 - .label ch4 = util_wait_key.return_4 + check_status_smc6_return: .byte 0 + check_status_smc9_return: .byte 0 + check_status_vera4_return: .byte 0 + check_status_smc10_return: .byte 0 rom_chip2: .byte 0 .label flashed_bytes = smc_flash.return - .label check_status_rom1_return = check_status_rom1_main__0 rom_chip3: .byte 0 rom_bank1: .byte 0 .label file1 = rom_file.return .label rom_bytes_read1 = rom_read.return + rom_differences: .dword 0 rom_flash_errors: .dword 0 - .label check_status_vera6_return = check_status_vera6_main__0 - .label check_status_smc18_return = check_status_smc18_main__0 + check_status_smc16_return: .byte 0 + check_status_vera10_return: .byte 0 + check_status_smc17_return: .byte 0 + check_status_vera11_return: .byte 0 w: .byte 0 w1: .byte 0 } @@ -5035,17 +5007,16 @@ main: { // Set the layer with which the conio will interact. screenlayer1: { // screenlayer(1, *VERA_L1_MAPBASE, *VERA_L1_CONFIG) - // [756] screenlayer::mapbase#0 = *VERA_L1_MAPBASE -- vbum1=_deref_pbuc1 - lda VERA_L1_MAPBASE - sta screenlayer.mapbase - // [757] screenlayer::config#0 = *VERA_L1_CONFIG -- vbum1=_deref_pbuc1 + // [783] screenlayer::mapbase#0 = *VERA_L1_MAPBASE -- vbuxx=_deref_pbuc1 + ldx VERA_L1_MAPBASE + // [784] screenlayer::config#0 = *VERA_L1_CONFIG -- vbum1=_deref_pbuc1 lda VERA_L1_CONFIG sta screenlayer.config - // [758] call screenlayer + // [785] call screenlayer jsr screenlayer // screenlayer1::@return // } - // [759] return + // [786] return rts } // textcolor @@ -5053,70 +5024,55 @@ screenlayer1: { // - color: a 4 bit value ( decimal between 0 and 15). // This will only work when the VERA is in 16 color mode! // Note that on the VERA, the transparent color has value 0. -// char textcolor(__mem() char color) +// char textcolor(__register(X) char color) textcolor: { - .label textcolor__0 = $b6 - .label textcolor__1 = $b6 // __conio.color & 0xF0 - // [761] textcolor::$0 = *((char *)&__conio+$d) & $f0 -- vbuz1=_deref_pbuc1_band_vbuc2 + // [788] textcolor::$0 = *((char *)&__conio+$d) & $f0 -- vbuaa=_deref_pbuc1_band_vbuc2 lda #$f0 and __conio+$d - sta.z textcolor__0 // __conio.color & 0xF0 | color - // [762] textcolor::$1 = textcolor::$0 | textcolor::color#23 -- vbuz1=vbuz1_bor_vbum2 - lda color - ora.z textcolor__1 - sta.z textcolor__1 + // [789] textcolor::$1 = textcolor::$0 | textcolor::color#23 -- vbuaa=vbuaa_bor_vbuxx + stx.z $ff + ora.z $ff // __conio.color = __conio.color & 0xF0 | color - // [763] *((char *)&__conio+$d) = textcolor::$1 -- _deref_pbuc1=vbuz1 + // [790] *((char *)&__conio+$d) = textcolor::$1 -- _deref_pbuc1=vbuaa sta __conio+$d // textcolor::@return // } - // [764] return + // [791] return rts - .segment Data - color: .byte 0 } -.segment Code // bgcolor // Set the back color for text output. // - color: a 4 bit value ( decimal between 0 and 15). // This will only work when the VERA is in 16 color mode! // Note that on the VERA, the transparent color has value 0. -// char bgcolor(__mem() char color) +// char bgcolor(__register(X) char color) bgcolor: { - .label bgcolor__0 = $b6 - .label bgcolor__1 = $b7 - .label bgcolor__2 = $b6 + .label bgcolor__0 = $72 // __conio.color & 0x0F - // [766] bgcolor::$0 = *((char *)&__conio+$d) & $f -- vbuz1=_deref_pbuc1_band_vbuc2 + // [793] bgcolor::$0 = *((char *)&__conio+$d) & $f -- vbuz1=_deref_pbuc1_band_vbuc2 lda #$f and __conio+$d sta.z bgcolor__0 // color << 4 - // [767] bgcolor::$1 = bgcolor::color#15 << 4 -- vbuz1=vbum2_rol_4 - lda color + // [794] bgcolor::$1 = bgcolor::color#15 << 4 -- vbuaa=vbuxx_rol_4 + txa asl asl asl asl - sta.z bgcolor__1 // __conio.color & 0x0F | color << 4 - // [768] bgcolor::$2 = bgcolor::$0 | bgcolor::$1 -- vbuz1=vbuz1_bor_vbuz2 - lda.z bgcolor__2 - ora.z bgcolor__1 - sta.z bgcolor__2 + // [795] bgcolor::$2 = bgcolor::$0 | bgcolor::$1 -- vbuaa=vbuz1_bor_vbuaa + ora.z bgcolor__0 // __conio.color = __conio.color & 0x0F | color << 4 - // [769] *((char *)&__conio+$d) = bgcolor::$2 -- _deref_pbuc1=vbuz1 + // [796] *((char *)&__conio+$d) = bgcolor::$2 -- _deref_pbuc1=vbuaa sta __conio+$d // bgcolor::@return // } - // [770] return + // [797] return rts - .segment Data - color: .byte 0 } -.segment Code // cursor // If onoff is 1, a cursor is displayed when waiting for keyboard input. // If onoff is 0, the cursor is hidden when waiting for keyboard input. @@ -5125,12 +5081,12 @@ bgcolor: { cursor: { .const onoff = 0 // __conio.cursor = onoff - // [771] *((char *)&__conio+$c) = cursor::onoff#0 -- _deref_pbuc1=vbuc2 + // [798] *((char *)&__conio+$c) = cursor::onoff#0 -- _deref_pbuc1=vbuc2 lda #onoff sta __conio+$c // cursor::@return // } - // [772] return + // [799] return rts } // cbm_k_plot_get @@ -5140,11 +5096,11 @@ cursor: { */ cbm_k_plot_get: { // __mem unsigned char x - // [773] cbm_k_plot_get::x = 0 -- vbum1=vbuc1 + // [800] cbm_k_plot_get::x = 0 -- vbum1=vbuc1 lda #0 sta x // __mem unsigned char y - // [774] cbm_k_plot_get::y = 0 -- vbum1=vbuc1 + // [801] cbm_k_plot_get::y = 0 -- vbum1=vbuc1 sta y // kickasm // kickasm( uses cbm_k_plot_get::x uses cbm_k_plot_get::y uses CBM_PLOT) {{ sec jsr CBM_PLOT stx y sty x }} @@ -5154,84 +5110,72 @@ cbm_k_plot_get: { sty x // MAKEWORD(x,y) - // [776] cbm_k_plot_get::return#0 = cbm_k_plot_get::x w= cbm_k_plot_get::y -- vwum1=vbum2_word_vbum3 + // [803] cbm_k_plot_get::return#0 = cbm_k_plot_get::x w= cbm_k_plot_get::y -- vwum1=vbum2_word_vbum3 lda x sta return+1 lda y sta return // cbm_k_plot_get::@return // } - // [777] return + // [804] return rts .segment Data x: .byte 0 y: .byte 0 - return: .word 0 + .label return = screenlayer.mapbase_offset } .segment Code // gotoxy // Set the cursor to the specified position -// void gotoxy(__mem() char x, __mem() char y) +// void gotoxy(__register(Y) char x, __mem() char y) gotoxy: { - .label gotoxy__2 = $30 - .label gotoxy__3 = $30 - .label gotoxy__6 = $2f - .label gotoxy__7 = $2f - .label gotoxy__8 = $37 - .label gotoxy__9 = $34 - .label gotoxy__10 = $33 - .label gotoxy__14 = $2f + .label gotoxy__8 = $29 + .label gotoxy__9 = $27 // (x>=__conio.width)?__conio.width:x - // [779] if(gotoxy::x#33>=*((char *)&__conio+6)) goto gotoxy::@1 -- vbum1_ge__deref_pbuc1_then_la1 - lda x - cmp __conio+6 + // [806] if(gotoxy::x#37>=*((char *)&__conio+6)) goto gotoxy::@1 -- vbuyy_ge__deref_pbuc1_then_la1 + cpy __conio+6 bcs __b1 - // [781] phi from gotoxy to gotoxy::@2 [phi:gotoxy->gotoxy::@2] - // [781] phi gotoxy::$3 = gotoxy::x#33 [phi:gotoxy->gotoxy::@2#0] -- vbuz1=vbum2 - sta.z gotoxy__3 + // [808] phi from gotoxy to gotoxy::@2 [phi:gotoxy->gotoxy::@2] + // [808] phi gotoxy::$3 = gotoxy::x#37 [phi:gotoxy->gotoxy::@2#0] -- vbuaa=vbuyy + tya jmp __b2 // gotoxy::@1 __b1: - // [780] gotoxy::$2 = *((char *)&__conio+6) -- vbuz1=_deref_pbuc1 + // [807] gotoxy::$2 = *((char *)&__conio+6) -- vbuaa=_deref_pbuc1 lda __conio+6 - sta.z gotoxy__2 - // [781] phi from gotoxy::@1 to gotoxy::@2 [phi:gotoxy::@1->gotoxy::@2] - // [781] phi gotoxy::$3 = gotoxy::$2 [phi:gotoxy::@1->gotoxy::@2#0] -- register_copy + // [808] phi from gotoxy::@1 to gotoxy::@2 [phi:gotoxy::@1->gotoxy::@2] + // [808] phi gotoxy::$3 = gotoxy::$2 [phi:gotoxy::@1->gotoxy::@2#0] -- register_copy // gotoxy::@2 __b2: // __conio.cursor_x = (x>=__conio.width)?__conio.width:x - // [782] *((char *)&__conio) = gotoxy::$3 -- _deref_pbuc1=vbuz1 - lda.z gotoxy__3 + // [809] *((char *)&__conio) = gotoxy::$3 -- _deref_pbuc1=vbuaa sta __conio // (y>=__conio.height)?__conio.height:y - // [783] if(gotoxy::y#33>=*((char *)&__conio+7)) goto gotoxy::@3 -- vbum1_ge__deref_pbuc1_then_la1 + // [810] if(gotoxy::y#37>=*((char *)&__conio+7)) goto gotoxy::@3 -- vbum1_ge__deref_pbuc1_then_la1 lda y cmp __conio+7 bcs __b3 // gotoxy::@4 - // [784] gotoxy::$14 = gotoxy::y#33 -- vbuz1=vbum2 - sta.z gotoxy__14 - // [785] phi from gotoxy::@3 gotoxy::@4 to gotoxy::@5 [phi:gotoxy::@3/gotoxy::@4->gotoxy::@5] - // [785] phi gotoxy::$7 = gotoxy::$6 [phi:gotoxy::@3/gotoxy::@4->gotoxy::@5#0] -- register_copy + // [811] gotoxy::$14 = gotoxy::y#37 -- vbuaa=vbum1 + // [812] phi from gotoxy::@3 gotoxy::@4 to gotoxy::@5 [phi:gotoxy::@3/gotoxy::@4->gotoxy::@5] + // [812] phi gotoxy::$7 = gotoxy::$6 [phi:gotoxy::@3/gotoxy::@4->gotoxy::@5#0] -- register_copy // gotoxy::@5 __b5: // __conio.cursor_y = (y>=__conio.height)?__conio.height:y - // [786] *((char *)&__conio+1) = gotoxy::$7 -- _deref_pbuc1=vbuz1 - lda.z gotoxy__7 + // [813] *((char *)&__conio+1) = gotoxy::$7 -- _deref_pbuc1=vbuaa sta __conio+1 // __conio.cursor_x << 1 - // [787] gotoxy::$8 = *((char *)&__conio) << 1 -- vbuz1=_deref_pbuc1_rol_1 + // [814] gotoxy::$8 = *((char *)&__conio) << 1 -- vbuz1=_deref_pbuc1_rol_1 lda __conio asl sta.z gotoxy__8 // __conio.offsets[y] + __conio.cursor_x << 1 - // [788] gotoxy::$10 = gotoxy::y#33 << 1 -- vbuz1=vbum2_rol_1 + // [815] gotoxy::$10 = gotoxy::y#37 << 1 -- vbuaa=vbum1_rol_1 lda y asl - sta.z gotoxy__10 - // [789] gotoxy::$9 = ((unsigned int *)&__conio+$15)[gotoxy::$10] + gotoxy::$8 -- vwuz1=pwuc1_derefidx_vbuz2_plus_vbuz3 + // [816] gotoxy::$9 = ((unsigned int *)&__conio+$15)[gotoxy::$10] + gotoxy::$8 -- vwuz1=pwuc1_derefidx_vbuaa_plus_vbuz2 + tay lda.z gotoxy__8 - ldy.z gotoxy__10 clc adc __conio+$15,y sta.z gotoxy__9 @@ -5239,226 +5183,209 @@ gotoxy: { adc #0 sta.z gotoxy__9+1 // __conio.offset = __conio.offsets[y] + __conio.cursor_x << 1 - // [790] *((unsigned int *)&__conio+$13) = gotoxy::$9 -- _deref_pwuc1=vwuz1 + // [817] *((unsigned int *)&__conio+$13) = gotoxy::$9 -- _deref_pwuc1=vwuz1 lda.z gotoxy__9 sta __conio+$13 lda.z gotoxy__9+1 sta __conio+$13+1 // gotoxy::@return // } - // [791] return + // [818] return rts // gotoxy::@3 __b3: // (y>=__conio.height)?__conio.height:y - // [792] gotoxy::$6 = *((char *)&__conio+7) -- vbuz1=_deref_pbuc1 + // [819] gotoxy::$6 = *((char *)&__conio+7) -- vbuaa=_deref_pbuc1 lda __conio+7 - sta.z gotoxy__6 jmp __b5 .segment Data - x: .byte 0 y: .byte 0 } .segment Code // cputln // Print a newline cputln: { - .label cputln__2 = $50 // __conio.cursor_x = 0 - // [793] *((char *)&__conio) = 0 -- _deref_pbuc1=vbuc2 + // [820] *((char *)&__conio) = 0 -- _deref_pbuc1=vbuc2 lda #0 sta __conio // __conio.cursor_y++; - // [794] *((char *)&__conio+1) = ++ *((char *)&__conio+1) -- _deref_pbuc1=_inc__deref_pbuc1 + // [821] *((char *)&__conio+1) = ++ *((char *)&__conio+1) -- _deref_pbuc1=_inc__deref_pbuc1 inc __conio+1 // __conio.offset = __conio.offsets[__conio.cursor_y] - // [795] cputln::$2 = *((char *)&__conio+1) << 1 -- vbuz1=_deref_pbuc1_rol_1 + // [822] cputln::$2 = *((char *)&__conio+1) << 1 -- vbuaa=_deref_pbuc1_rol_1 lda __conio+1 asl - sta.z cputln__2 - // [796] *((unsigned int *)&__conio+$13) = ((unsigned int *)&__conio+$15)[cputln::$2] -- _deref_pwuc1=pwuc2_derefidx_vbuz1 + // [823] *((unsigned int *)&__conio+$13) = ((unsigned int *)&__conio+$15)[cputln::$2] -- _deref_pwuc1=pwuc2_derefidx_vbuaa tay lda __conio+$15,y sta __conio+$13 lda __conio+$15+1,y sta __conio+$13+1 // cscroll() - // [797] call cscroll + // [824] call cscroll jsr cscroll // cputln::@return // } - // [798] return + // [825] return rts } +.segment CodeIntro // init init: { - .label init__12 = $4d - .label init__16 = $4d - .label init__17 = $4d - .label init__18 = $4d + .label rom_chip = $7d // display_frame_init_64() - // [800] call display_frame_init_64 + // [827] call display_frame_init_64 jsr display_frame_init_64 - // [801] phi from init to init::@4 [phi:init->init::@4] + // [828] phi from init to init::@4 [phi:init->init::@4] // init::@4 // display_frame_draw() - // [802] call display_frame_draw + // [829] call display_frame_draw // ST1 | Reset canvas to 64 columns - // [1920] phi from init::@4 to display_frame_draw [phi:init::@4->display_frame_draw] + // [2100] phi from init::@4 to display_frame_draw [phi:init::@4->display_frame_draw] jsr display_frame_draw - // [803] phi from init::@4 to init::@5 [phi:init::@4->init::@5] + // [830] phi from init::@4 to init::@5 [phi:init::@4->init::@5] // init::@5 // display_frame_title("Commander X16 Update Utility (v2.2.1) ") - // [804] call display_frame_title - // [1961] phi from init::@5 to display_frame_title [phi:init::@5->display_frame_title] + // [831] call display_frame_title + // [2141] phi from init::@5 to display_frame_title [phi:init::@5->display_frame_title] jsr display_frame_title - // [805] phi from init::@5 to init::display_info_title1 [phi:init::@5->init::display_info_title1] + // [832] phi from init::@5 to init::display_info_title1 [phi:init::@5->init::display_info_title1] // init::display_info_title1 // cputsxy(INFO_X-2, INFO_Y-2, "# Chip Status Type Curr. Release Update Info") - // [806] call cputsxy - // [1966] phi from init::display_info_title1 to cputsxy [phi:init::display_info_title1->cputsxy] - // [1966] phi cputsxy::s#4 = init::s [phi:init::display_info_title1->cputsxy#0] -- pbuz1=pbuc1 + // [833] call cputsxy + // [2146] phi from init::display_info_title1 to cputsxy [phi:init::display_info_title1->cputsxy] + // [2146] phi cputsxy::s#4 = init::s [phi:init::display_info_title1->cputsxy#0] -- pbuz1=pbuc1 lda #s sta.z cputsxy.s+1 - // [1966] phi cputsxy::y#4 = $11-2 [phi:init::display_info_title1->cputsxy#1] -- vbum1=vbuc1 - lda #$11-2 - sta cputsxy.y - // [1966] phi cputsxy::x#4 = 4-2 [phi:init::display_info_title1->cputsxy#2] -- vbum1=vbuc1 - lda #4-2 - sta cputsxy.x + // [2146] phi cputsxy::y#4 = $11-2 [phi:init::display_info_title1->cputsxy#1] -- vbuxx=vbuc1 + ldx #$11-2 + // [2146] phi cputsxy::x#4 = 4-2 [phi:init::display_info_title1->cputsxy#2] -- vbuyy=vbuc1 + ldy #4-2 jsr cputsxy - // [807] phi from init::display_info_title1 to init::@6 [phi:init::display_info_title1->init::@6] + // [834] phi from init::display_info_title1 to init::@6 [phi:init::display_info_title1->init::@6] // init::@6 // cputsxy(INFO_X-2, INFO_Y-1, "- ---- --------- ------ ------------- --------------------------") - // [808] call cputsxy - // [1966] phi from init::@6 to cputsxy [phi:init::@6->cputsxy] - // [1966] phi cputsxy::s#4 = init::s1 [phi:init::@6->cputsxy#0] -- pbuz1=pbuc1 + // [835] call cputsxy + // [2146] phi from init::@6 to cputsxy [phi:init::@6->cputsxy] + // [2146] phi cputsxy::s#4 = init::s1 [phi:init::@6->cputsxy#0] -- pbuz1=pbuc1 lda #s1 sta.z cputsxy.s+1 - // [1966] phi cputsxy::y#4 = $11-1 [phi:init::@6->cputsxy#1] -- vbum1=vbuc1 - lda #$11-1 - sta cputsxy.y - // [1966] phi cputsxy::x#4 = 4-2 [phi:init::@6->cputsxy#2] -- vbum1=vbuc1 - lda #4-2 - sta cputsxy.x + // [2146] phi cputsxy::y#4 = $11-1 [phi:init::@6->cputsxy#1] -- vbuxx=vbuc1 + ldx #$11-1 + // [2146] phi cputsxy::x#4 = 4-2 [phi:init::@6->cputsxy#2] -- vbuyy=vbuc1 + ldy #4-2 jsr cputsxy - // [809] phi from init::@6 to init::@3 [phi:init::@6->init::@3] + // [836] phi from init::@6 to init::@3 [phi:init::@6->init::@3] // init::@3 // display_action_progress("Introduction, please read carefully the below!") - // [810] call display_action_progress - // [1084] phi from init::@3 to display_action_progress [phi:init::@3->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = init::info_text [phi:init::@3->display_action_progress#0] -- pbuz1=pbuc1 + // [837] call display_action_progress + // [1155] phi from init::@3 to display_action_progress [phi:init::@3->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = init::info_text [phi:init::@3->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text sta.z display_action_progress.info_text+1 jsr display_action_progress - // [811] phi from init::@3 to init::@7 [phi:init::@3->init::@7] + // [838] phi from init::@3 to init::@7 [phi:init::@3->init::@7] // init::@7 // display_progress_clear() - // [812] call display_progress_clear - // [1161] phi from init::@7 to display_progress_clear [phi:init::@7->display_progress_clear] + // [839] call display_progress_clear + // [1037] phi from init::@7 to display_progress_clear [phi:init::@7->display_progress_clear] jsr display_progress_clear - // [813] phi from init::@7 to init::@8 [phi:init::@7->init::@8] + // [840] phi from init::@7 to init::@8 [phi:init::@7->init::@8] // init::@8 // display_chip_smc() - // [814] call display_chip_smc - // [871] phi from init::@8 to display_chip_smc [phi:init::@8->display_chip_smc] + // [841] call display_chip_smc + // [898] phi from init::@8 to display_chip_smc [phi:init::@8->display_chip_smc] jsr display_chip_smc - // [815] phi from init::@8 to init::@9 [phi:init::@8->init::@9] + // [842] phi from init::@8 to init::@9 [phi:init::@8->init::@9] // init::@9 // display_chip_vera() - // [816] call display_chip_vera - // [1973] phi from init::@9 to display_chip_vera [phi:init::@9->display_chip_vera] + // [843] call display_chip_vera + // [2153] phi from init::@9 to display_chip_vera [phi:init::@9->display_chip_vera] jsr display_chip_vera - // [817] phi from init::@9 to init::@10 [phi:init::@9->init::@10] + // [844] phi from init::@9 to init::@10 [phi:init::@9->init::@10] // init::@10 // display_chip_rom() - // [818] call display_chip_rom - // [984] phi from init::@10 to display_chip_rom [phi:init::@10->display_chip_rom] + // [845] call display_chip_rom + // [1018] phi from init::@10 to display_chip_rom [phi:init::@10->display_chip_rom] jsr display_chip_rom - // [819] phi from init::@10 to init::@11 [phi:init::@10->init::@11] + // [846] phi from init::@10 to init::@11 [phi:init::@10->init::@11] // init::@11 // display_info_smc(STATUS_COLOR_NONE, NULL) - // [820] call display_info_smc - // [898] phi from init::@11 to display_info_smc [phi:init::@11->display_info_smc] - // [898] phi display_info_smc::info_text#21 = 0 [phi:init::@11->display_info_smc#0] -- pbuz1=vbuc1 + // [847] call display_info_smc + // [925] phi from init::@11 to display_info_smc [phi:init::@11->display_info_smc] + // [925] phi display_info_smc::info_text#24 = 0 [phi:init::@11->display_info_smc#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_smc.info_text sta.z display_info_smc.info_text+1 - // [898] phi smc_bootloader#14 = 0 [phi:init::@11->display_info_smc#1] -- vwum1=vwuc1 + // [925] phi smc_bootloader#14 = 0 [phi:init::@11->display_info_smc#1] -- vwum1=vwuc1 sta smc_bootloader_1 sta smc_bootloader_1+1 - // [898] phi display_info_smc::info_status#21 = BLACK [phi:init::@11->display_info_smc#2] -- vbum1=vbuc1 + // [925] phi display_info_smc::info_status#24 = BLACK [phi:init::@11->display_info_smc#2] -- vbuz1=vbuc1 lda #BLACK - sta display_info_smc.info_status + sta.z display_info_smc.info_status jsr display_info_smc - // [821] phi from init::@11 to init::@12 [phi:init::@11->init::@12] + // [848] phi from init::@11 to init::@12 [phi:init::@11->init::@12] // init::@12 // display_info_vera(STATUS_NONE, NULL) - // [822] call display_info_vera - // [1738] phi from init::@12 to display_info_vera [phi:init::@12->display_info_vera] - // [1738] phi display_info_vera::info_text#10 = 0 [phi:init::@12->display_info_vera#0] -- pbuz1=vbuc1 + // [849] call display_info_vera + // [1930] phi from init::@12 to display_info_vera [phi:init::@12->display_info_vera] + // [1930] phi display_info_vera::info_text#15 = 0 [phi:init::@12->display_info_vera#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_vera.info_text sta.z display_info_vera.info_text+1 - // [1738] phi display_info_vera::info_status#2 = STATUS_NONE [phi:init::@12->display_info_vera#1] -- vbum1=vbuc1 + // [1930] phi display_info_vera::info_status#15 = STATUS_NONE [phi:init::@12->display_info_vera#1] -- vbum1=vbuc1 lda #STATUS_NONE sta display_info_vera.info_status jsr display_info_vera - // [823] phi from init::@12 to init::@1 [phi:init::@12->init::@1] - // [823] phi init::rom_chip#2 = 0 [phi:init::@12->init::@1#0] -- vbum1=vbuc1 + // [850] phi from init::@12 to init::@1 [phi:init::@12->init::@1] + // [850] phi init::rom_chip#2 = 0 [phi:init::@12->init::@1#0] -- vbuz1=vbuc1 lda #0 - sta rom_chip + sta.z rom_chip // init::@1 __b1: // for(unsigned char rom_chip=0; rom_chip<8; rom_chip++) - // [824] if(init::rom_chip#2<8) goto init::@2 -- vbum1_lt_vbuc1_then_la1 - lda rom_chip + // [851] if(init::rom_chip#2<8) goto init::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z rom_chip cmp #8 bcc __b2 // init::@return // } - // [825] return + // [852] return rts // init::@2 __b2: // rom_chip*13 - // [826] init::$16 = init::rom_chip#2 << 1 -- vbuz1=vbum2_rol_1 - lda rom_chip + // [853] init::$16 = init::rom_chip#2 << 1 -- vbuaa=vbuz1_rol_1 + lda.z rom_chip asl - sta.z init__16 - // [827] init::$17 = init::$16 + init::rom_chip#2 -- vbuz1=vbuz1_plus_vbum2 - lda rom_chip + // [854] init::$17 = init::$16 + init::rom_chip#2 -- vbuaa=vbuaa_plus_vbuz1 clc - adc.z init__17 - sta.z init__17 - // [828] init::$18 = init::$17 << 2 -- vbuz1=vbuz1_rol_2 - lda.z init__18 + adc.z rom_chip + // [855] init::$18 = init::$17 << 2 -- vbuaa=vbuaa_rol_2 asl asl - sta.z init__18 - // [829] init::$12 = init::$18 + init::rom_chip#2 -- vbuz1=vbuz1_plus_vbum2 - lda rom_chip + // [856] init::$12 = init::$18 + init::rom_chip#2 -- vbuaa=vbuaa_plus_vbuz1 clc - adc.z init__12 - sta.z init__12 + adc.z rom_chip // strcpy(&rom_release_text[rom_chip*13], " " ) - // [830] strcpy::destination#0 = rom_release_text + init::$12 -- pbuz1=pbuc1_plus_vbuz2 + // [857] strcpy::destination#0 = rom_release_text + init::$12 -- pbuz1=pbuc1_plus_vbuaa clc adc #rom_release_text adc #0 sta.z strcpy.destination+1 - // [831] call strcpy - // [863] phi from init::@2 to strcpy [phi:init::@2->strcpy] - // [863] phi strcpy::dst#0 = strcpy::destination#0 [phi:init::@2->strcpy#0] -- register_copy - // [863] phi strcpy::src#0 = init::source [phi:init::@2->strcpy#1] -- pbuz1=pbuc1 + // [858] call strcpy + // [890] phi from init::@2 to strcpy [phi:init::@2->strcpy] + // [890] phi strcpy::dst#0 = strcpy::destination#0 [phi:init::@2->strcpy#0] -- register_copy + // [890] phi strcpy::src#0 = init::source [phi:init::@2->strcpy#1] -- pbuz1=pbuc1 lda #source @@ -5466,26 +5393,26 @@ init: { jsr strcpy // init::@13 // display_info_rom(rom_chip, STATUS_NONE, NULL) - // [832] display_info_rom::rom_chip#0 = init::rom_chip#2 -- vbum1=vbum2 - lda rom_chip + // [859] display_info_rom::rom_chip#0 = init::rom_chip#2 -- vbum1=vbuz2 + lda.z rom_chip sta display_info_rom.rom_chip - // [833] call display_info_rom - // [1176] phi from init::@13 to display_info_rom [phi:init::@13->display_info_rom] - // [1176] phi display_info_rom::info_text#16 = 0 [phi:init::@13->display_info_rom#0] -- pbuz1=vbuc1 + // [860] call display_info_rom + // [1368] phi from init::@13 to display_info_rom [phi:init::@13->display_info_rom] + // [1368] phi display_info_rom::info_text#16 = 0 [phi:init::@13->display_info_rom#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_rom.info_text sta.z display_info_rom.info_text+1 - // [1176] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#0 [phi:init::@13->display_info_rom#1] -- register_copy - // [1176] phi display_info_rom::info_status#16 = STATUS_NONE [phi:init::@13->display_info_rom#2] -- vbuz1=vbuc1 + // [1368] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#0 [phi:init::@13->display_info_rom#1] -- register_copy + // [1368] phi display_info_rom::info_status#16 = STATUS_NONE [phi:init::@13->display_info_rom#2] -- vbum1=vbuc1 lda #STATUS_NONE - sta.z display_info_rom.info_status + sta display_info_rom.info_status jsr display_info_rom // init::@14 // for(unsigned char rom_chip=0; rom_chip<8; rom_chip++) - // [834] init::rom_chip#1 = ++ init::rom_chip#2 -- vbum1=_inc_vbum1 - inc rom_chip - // [823] phi from init::@14 to init::@1 [phi:init::@14->init::@1] - // [823] phi init::rom_chip#2 = init::rom_chip#1 [phi:init::@14->init::@1#0] -- register_copy + // [861] init::rom_chip#1 = ++ init::rom_chip#2 -- vbuz1=_inc_vbuz1 + inc.z rom_chip + // [850] phi from init::@14 to init::@1 [phi:init::@14->init::@1] + // [850] phi init::rom_chip#2 = init::rom_chip#1 [phi:init::@14->init::@1#0] -- register_copy jmp __b1 .segment Data title_text: .text "Commander X16 Update Utility (v2.2.1) " @@ -5498,99 +5425,96 @@ init: { .byte 0 source: .text " " .byte 0 - .label rom_chip = check_status_roms_less.rom_chip } .segment CodeIntro // main_intro main_intro: { // display_progress_text(display_into_briefing_text, display_intro_briefing_count) - // [836] call display_progress_text - // [1098] phi from main_intro to display_progress_text [phi:main_intro->display_progress_text] - // [1098] phi display_progress_text::text#12 = display_into_briefing_text [phi:main_intro->display_progress_text#0] -- qbuz1=qbuc1 + // [863] call display_progress_text + // [1169] phi from main_intro to display_progress_text [phi:main_intro->display_progress_text] + // [1169] phi display_progress_text::text#13 = display_into_briefing_text [phi:main_intro->display_progress_text#0] -- qbuz1=qbuc1 lda #display_into_briefing_text sta.z display_progress_text.text+1 - // [1098] phi display_progress_text::lines#11 = display_intro_briefing_count [phi:main_intro->display_progress_text#1] -- vbum1=vbuc1 + // [1169] phi display_progress_text::lines#12 = display_intro_briefing_count [phi:main_intro->display_progress_text#1] -- vbuz1=vbuc1 lda #display_intro_briefing_count - sta display_progress_text.lines + sta.z display_progress_text.lines jsr display_progress_text - // [837] phi from main_intro to main_intro::@4 [phi:main_intro->main_intro::@4] + // [864] phi from main_intro to main_intro::@4 [phi:main_intro->main_intro::@4] // main_intro::@4 // util_wait_space() - // [838] call util_wait_space - // [1778] phi from main_intro::@4 to util_wait_space [phi:main_intro::@4->util_wait_space] + // [865] call util_wait_space + // [1958] phi from main_intro::@4 to util_wait_space [phi:main_intro::@4->util_wait_space] jsr util_wait_space - // [839] phi from main_intro::@4 to main_intro::@5 [phi:main_intro::@4->main_intro::@5] + // [866] phi from main_intro::@4 to main_intro::@5 [phi:main_intro::@4->main_intro::@5] // main_intro::@5 // display_progress_text(display_into_colors_text, display_intro_colors_count) - // [840] call display_progress_text - // [1098] phi from main_intro::@5 to display_progress_text [phi:main_intro::@5->display_progress_text] - // [1098] phi display_progress_text::text#12 = display_into_colors_text [phi:main_intro::@5->display_progress_text#0] -- qbuz1=qbuc1 + // [867] call display_progress_text + // [1169] phi from main_intro::@5 to display_progress_text [phi:main_intro::@5->display_progress_text] + // [1169] phi display_progress_text::text#13 = display_into_colors_text [phi:main_intro::@5->display_progress_text#0] -- qbuz1=qbuc1 lda #display_into_colors_text sta.z display_progress_text.text+1 - // [1098] phi display_progress_text::lines#11 = display_intro_colors_count [phi:main_intro::@5->display_progress_text#1] -- vbum1=vbuc1 + // [1169] phi display_progress_text::lines#12 = display_intro_colors_count [phi:main_intro::@5->display_progress_text#1] -- vbuz1=vbuc1 lda #display_intro_colors_count - sta display_progress_text.lines + sta.z display_progress_text.lines jsr display_progress_text - // [841] phi from main_intro::@5 to main_intro::@1 [phi:main_intro::@5->main_intro::@1] - // [841] phi main_intro::intro_status#2 = 0 [phi:main_intro::@5->main_intro::@1#0] -- vbum1=vbuc1 + // [868] phi from main_intro::@5 to main_intro::@1 [phi:main_intro::@5->main_intro::@1] + // [868] phi main_intro::intro_status#2 = 0 [phi:main_intro::@5->main_intro::@1#0] -- vbum1=vbuc1 lda #0 sta intro_status // main_intro::@1 __b1: // for(unsigned char intro_status=0; intro_status<11; intro_status++) - // [842] if(main_intro::intro_status#2<$b) goto main_intro::@2 -- vbum1_lt_vbuc1_then_la1 + // [869] if(main_intro::intro_status#2<$b) goto main_intro::@2 -- vbum1_lt_vbuc1_then_la1 lda intro_status cmp #$b bcc __b2 - // [843] phi from main_intro::@1 to main_intro::@3 [phi:main_intro::@1->main_intro::@3] + // [870] phi from main_intro::@1 to main_intro::@3 [phi:main_intro::@1->main_intro::@3] // main_intro::@3 // util_wait_space() - // [844] call util_wait_space - // [1778] phi from main_intro::@3 to util_wait_space [phi:main_intro::@3->util_wait_space] + // [871] call util_wait_space + // [1958] phi from main_intro::@3 to util_wait_space [phi:main_intro::@3->util_wait_space] jsr util_wait_space - // [845] phi from main_intro::@3 to main_intro::@7 [phi:main_intro::@3->main_intro::@7] + // [872] phi from main_intro::@3 to main_intro::@7 [phi:main_intro::@3->main_intro::@7] // main_intro::@7 // display_progress_clear() - // [846] call display_progress_clear - // [1161] phi from main_intro::@7 to display_progress_clear [phi:main_intro::@7->display_progress_clear] + // [873] call display_progress_clear + // [1037] phi from main_intro::@7 to display_progress_clear [phi:main_intro::@7->display_progress_clear] jsr display_progress_clear // main_intro::@return // } - // [847] return + // [874] return rts // main_intro::@2 __b2: // display_info_led(PROGRESS_X + 3, PROGRESS_Y + 3 + intro_status, status_color[intro_status], BLUE) - // [848] display_info_led::y#3 = PROGRESS_Y+3 + main_intro::intro_status#2 -- vbuz1=vbuc1_plus_vbum2 + // [875] display_info_led::y#3 = PROGRESS_Y+3 + main_intro::intro_status#2 -- vbuz1=vbuc1_plus_vbum2 lda #PROGRESS_Y+3 clc adc intro_status sta.z display_info_led.y - // [849] display_info_led::tc#3 = status_color[main_intro::intro_status#2] -- vbuz1=pbuc1_derefidx_vbum2 + // [876] display_info_led::tc#3 = status_color[main_intro::intro_status#2] -- vbuxx=pbuc1_derefidx_vbum1 ldy intro_status - lda status_color,y - sta.z display_info_led.tc - // [850] call display_info_led - // [1978] phi from main_intro::@2 to display_info_led [phi:main_intro::@2->display_info_led] - // [1978] phi display_info_led::y#4 = display_info_led::y#3 [phi:main_intro::@2->display_info_led#0] -- register_copy - // [1978] phi display_info_led::x#4 = PROGRESS_X+3 [phi:main_intro::@2->display_info_led#1] -- vbuz1=vbuc1 - lda #PROGRESS_X+3 - sta.z display_info_led.x - // [1978] phi display_info_led::tc#4 = display_info_led::tc#3 [phi:main_intro::@2->display_info_led#2] -- register_copy + ldx status_color,y + // [877] call display_info_led + // [2158] phi from main_intro::@2 to display_info_led [phi:main_intro::@2->display_info_led] + // [2158] phi display_info_led::y#4 = display_info_led::y#3 [phi:main_intro::@2->display_info_led#0] -- register_copy + // [2158] phi display_info_led::x#4 = PROGRESS_X+3 [phi:main_intro::@2->display_info_led#1] -- vbuyy=vbuc1 + ldy #PROGRESS_X+3 + // [2158] phi display_info_led::tc#4 = display_info_led::tc#3 [phi:main_intro::@2->display_info_led#2] -- register_copy jsr display_info_led // main_intro::@6 // for(unsigned char intro_status=0; intro_status<11; intro_status++) - // [851] main_intro::intro_status#1 = ++ main_intro::intro_status#2 -- vbum1=_inc_vbum1 + // [878] main_intro::intro_status#1 = ++ main_intro::intro_status#2 -- vbum1=_inc_vbum1 inc intro_status - // [841] phi from main_intro::@6 to main_intro::@1 [phi:main_intro::@6->main_intro::@1] - // [841] phi main_intro::intro_status#2 = main_intro::intro_status#1 [phi:main_intro::@6->main_intro::@1#0] -- register_copy + // [868] phi from main_intro::@6 to main_intro::@1 [phi:main_intro::@6->main_intro::@1] + // [868] phi main_intro::intro_status#2 = main_intro::intro_status#1 [phi:main_intro::@6->main_intro::@1#0] -- register_copy jmp __b1 - .segment DataIntro - intro_status: .byte 0 + .segment Data + .label intro_status = smc_get_version_text.major } .segment Code // smc_detect @@ -5602,35 +5526,34 @@ main_intro: { * @return unsigned int 0x0200 if there is a technical error reading or detecting the SMC chip. */ smc_detect: { - .label smc_detect__1 = $4d // When the bootloader is not present, 0xFF is returned. - .label smc_bootloader_version = $c7 - .label return = $c7 + .label smc_bootloader_version = $ad + .label return = $ad // cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_OFFSET) - // [852] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 + // [879] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 lda #$42 sta cx16_k_i2c_read_byte.device - // [853] cx16_k_i2c_read_byte::offset = $8e -- vbum1=vbuc1 + // [880] cx16_k_i2c_read_byte::offset = $8e -- vbum1=vbuc1 lda #$8e sta cx16_k_i2c_read_byte.offset - // [854] call cx16_k_i2c_read_byte + // [881] call cx16_k_i2c_read_byte jsr cx16_k_i2c_read_byte - // [855] cx16_k_i2c_read_byte::return#10 = cx16_k_i2c_read_byte::return#1 + // [882] cx16_k_i2c_read_byte::return#10 = cx16_k_i2c_read_byte::return#1 // smc_detect::@3 // smc_bootloader_version = cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_OFFSET) - // [856] smc_detect::smc_bootloader_version#1 = cx16_k_i2c_read_byte::return#10 -- vwuz1=vwum2 + // [883] smc_detect::smc_bootloader_version#1 = cx16_k_i2c_read_byte::return#10 -- vwuz1=vwum2 lda cx16_k_i2c_read_byte.return sta.z smc_bootloader_version lda cx16_k_i2c_read_byte.return+1 sta.z smc_bootloader_version+1 // BYTE1(smc_bootloader_version) - // [857] smc_detect::$1 = byte1 smc_detect::smc_bootloader_version#1 -- vbuz1=_byte1_vwuz2 - sta.z smc_detect__1 + // [884] smc_detect::$1 = byte1 smc_detect::smc_bootloader_version#1 -- vbuaa=_byte1_vwuz1 // if(!BYTE1(smc_bootloader_version)) - // [858] if(0==smc_detect::$1) goto smc_detect::@1 -- 0_eq_vbuz1_then_la1 + // [885] if(0==smc_detect::$1) goto smc_detect::@1 -- 0_eq_vbuaa_then_la1 + cmp #0 beq __b1 - // [861] phi from smc_detect::@3 to smc_detect::@2 [phi:smc_detect::@3->smc_detect::@2] - // [861] phi smc_detect::return#0 = $200 [phi:smc_detect::@3->smc_detect::@2#0] -- vwuz1=vwuc1 + // [888] phi from smc_detect::@3 to smc_detect::@2 [phi:smc_detect::@3->smc_detect::@2] + // [888] phi smc_detect::return#0 = $200 [phi:smc_detect::@3->smc_detect::@2#0] -- vwuz1=vwuc1 lda #<$200 sta.z return lda #>$200 @@ -5639,72 +5562,72 @@ smc_detect: { // smc_detect::@1 __b1: // if(smc_bootloader_version == 0xFF) - // [859] if(smc_detect::smc_bootloader_version#1!=$ff) goto smc_detect::@4 -- vwuz1_neq_vbuc1_then_la1 + // [886] if(smc_detect::smc_bootloader_version#1!=$ff) goto smc_detect::@4 -- vwuz1_neq_vbuc1_then_la1 lda.z smc_bootloader_version+1 bne __b2 lda.z smc_bootloader_version cmp #$ff bne __b2 - // [861] phi from smc_detect::@1 to smc_detect::@2 [phi:smc_detect::@1->smc_detect::@2] - // [861] phi smc_detect::return#0 = $100 [phi:smc_detect::@1->smc_detect::@2#0] -- vwuz1=vwuc1 + // [888] phi from smc_detect::@1 to smc_detect::@2 [phi:smc_detect::@1->smc_detect::@2] + // [888] phi smc_detect::return#0 = $100 [phi:smc_detect::@1->smc_detect::@2#0] -- vwuz1=vwuc1 lda #<$100 sta.z return lda #>$100 sta.z return+1 rts - // [860] phi from smc_detect::@1 to smc_detect::@4 [phi:smc_detect::@1->smc_detect::@4] + // [887] phi from smc_detect::@1 to smc_detect::@4 [phi:smc_detect::@1->smc_detect::@4] // smc_detect::@4 - // [861] phi from smc_detect::@4 to smc_detect::@2 [phi:smc_detect::@4->smc_detect::@2] - // [861] phi smc_detect::return#0 = smc_detect::smc_bootloader_version#1 [phi:smc_detect::@4->smc_detect::@2#0] -- register_copy + // [888] phi from smc_detect::@4 to smc_detect::@2 [phi:smc_detect::@4->smc_detect::@2] + // [888] phi smc_detect::return#0 = smc_detect::smc_bootloader_version#1 [phi:smc_detect::@4->smc_detect::@2#0] -- register_copy // smc_detect::@2 __b2: // smc_detect::@return // } - // [862] return + // [889] return rts } // strcpy // Copies the C string pointed by source into the array pointed by destination, including the terminating null character (and stopping at that point). -// char * strcpy(__zp($b8) char *destination, char *source) +// char * strcpy(__zp($76) char *destination, char *source) strcpy: { - .label src = $c7 - .label dst = $b8 - .label destination = $b8 - // [864] phi from strcpy strcpy::@2 to strcpy::@1 [phi:strcpy/strcpy::@2->strcpy::@1] - // [864] phi strcpy::dst#2 = strcpy::dst#0 [phi:strcpy/strcpy::@2->strcpy::@1#0] -- register_copy - // [864] phi strcpy::src#2 = strcpy::src#0 [phi:strcpy/strcpy::@2->strcpy::@1#1] -- register_copy + .label src = $ad + .label dst = $76 + .label destination = $76 + // [891] phi from strcpy strcpy::@2 to strcpy::@1 [phi:strcpy/strcpy::@2->strcpy::@1] + // [891] phi strcpy::dst#2 = strcpy::dst#0 [phi:strcpy/strcpy::@2->strcpy::@1#0] -- register_copy + // [891] phi strcpy::src#2 = strcpy::src#0 [phi:strcpy/strcpy::@2->strcpy::@1#1] -- register_copy // strcpy::@1 __b1: // while(*src) - // [865] if(0!=*strcpy::src#2) goto strcpy::@2 -- 0_neq__deref_pbuz1_then_la1 + // [892] if(0!=*strcpy::src#2) goto strcpy::@2 -- 0_neq__deref_pbuz1_then_la1 ldy #0 lda (src),y cmp #0 bne __b2 // strcpy::@3 // *dst = 0 - // [866] *strcpy::dst#2 = 0 -- _deref_pbuz1=vbuc1 + // [893] *strcpy::dst#2 = 0 -- _deref_pbuz1=vbuc1 tya tay sta (dst),y // strcpy::@return // } - // [867] return + // [894] return rts // strcpy::@2 __b2: // *dst++ = *src++ - // [868] *strcpy::dst#2 = *strcpy::src#2 -- _deref_pbuz1=_deref_pbuz2 + // [895] *strcpy::dst#2 = *strcpy::src#2 -- _deref_pbuz1=_deref_pbuz2 ldy #0 lda (src),y sta (dst),y // *dst++ = *src++; - // [869] strcpy::dst#1 = ++ strcpy::dst#2 -- pbuz1=_inc_pbuz1 + // [896] strcpy::dst#1 = ++ strcpy::dst#2 -- pbuz1=_inc_pbuz1 inc.z dst bne !+ inc.z dst+1 !: - // [870] strcpy::src#1 = ++ strcpy::src#2 -- pbuz1=_inc_pbuz1 + // [897] strcpy::src#1 = ++ strcpy::src#2 -- pbuz1=_inc_pbuz1 inc.z src bne !+ inc.z src+1 @@ -5714,32 +5637,32 @@ strcpy: { // display_chip_smc display_chip_smc: { // display_smc_led(GREY) - // [872] call display_smc_led - // [1989] phi from display_chip_smc to display_smc_led [phi:display_chip_smc->display_smc_led] - // [1989] phi display_smc_led::c#2 = GREY [phi:display_chip_smc->display_smc_led#0] -- vbuz1=vbuc1 + // [899] call display_smc_led + // [2169] phi from display_chip_smc to display_smc_led [phi:display_chip_smc->display_smc_led] + // [2169] phi display_smc_led::c#2 = GREY [phi:display_chip_smc->display_smc_led#0] -- vbuz1=vbuc1 lda #GREY sta.z display_smc_led.c jsr display_smc_led - // [873] phi from display_chip_smc to display_chip_smc::@1 [phi:display_chip_smc->display_chip_smc::@1] + // [900] phi from display_chip_smc to display_chip_smc::@1 [phi:display_chip_smc->display_chip_smc::@1] // display_chip_smc::@1 // display_print_chip(CHIP_SMC_X, CHIP_SMC_Y+2, CHIP_SMC_W, "SMC ") - // [874] call display_print_chip - // [1995] phi from display_chip_smc::@1 to display_print_chip [phi:display_chip_smc::@1->display_print_chip] - // [1995] phi display_print_chip::text#11 = display_chip_smc::text [phi:display_chip_smc::@1->display_print_chip#0] -- pbuz1=pbuc1 + // [901] call display_print_chip + // [2175] phi from display_chip_smc::@1 to display_print_chip [phi:display_chip_smc::@1->display_print_chip] + // [2175] phi display_print_chip::text#11 = display_chip_smc::text [phi:display_chip_smc::@1->display_print_chip#0] -- pbuz1=pbuc1 lda #text sta.z display_print_chip.text_2+1 - // [1995] phi display_print_chip::w#10 = 5 [phi:display_chip_smc::@1->display_print_chip#1] -- vbum1=vbuc1 + // [2175] phi display_print_chip::w#10 = 5 [phi:display_chip_smc::@1->display_print_chip#1] -- vbum1=vbuc1 lda #5 sta display_print_chip.w - // [1995] phi display_print_chip::x#10 = 1 [phi:display_chip_smc::@1->display_print_chip#2] -- vbuz1=vbuc1 + // [2175] phi display_print_chip::x#10 = 1 [phi:display_chip_smc::@1->display_print_chip#2] -- vbuz1=vbuc1 lda #1 sta.z display_print_chip.x jsr display_print_chip // display_chip_smc::@return // } - // [875] return + // [902] return rts .segment Data text: .text "SMC " @@ -5760,7 +5683,7 @@ display_chip_smc: { // __mem() unsigned int cx16_k_i2c_read_byte(__mem() volatile char device, __mem() volatile char offset) cx16_k_i2c_read_byte: { // unsigned int result - // [876] cx16_k_i2c_read_byte::result = 0 -- vwum1=vwuc1 + // [903] cx16_k_i2c_read_byte::result = 0 -- vwum1=vwuc1 lda #<0 sta result sta result+1 @@ -5773,20 +5696,20 @@ cx16_k_i2c_read_byte: { sta result rol result+1 // return result; - // [878] cx16_k_i2c_read_byte::return#0 = cx16_k_i2c_read_byte::result -- vwum1=vwum2 + // [905] cx16_k_i2c_read_byte::return#0 = cx16_k_i2c_read_byte::result -- vwum1=vwum2 sta return lda result+1 sta return+1 // cx16_k_i2c_read_byte::@return // } - // [879] cx16_k_i2c_read_byte::return#1 = cx16_k_i2c_read_byte::return#0 - // [880] return + // [906] cx16_k_i2c_read_byte::return#1 = cx16_k_i2c_read_byte::return#0 + // [907] return rts .segment Data device: .byte 0 offset: .byte 0 result: .word 0 - return: .word 0 + .label return = strncmp.n } .segment Code // smc_get_version_text @@ -5795,49 +5718,48 @@ cx16_k_i2c_read_byte: { * * @param version_string The string containing the SMC version filled upon return. */ -// unsigned long smc_get_version_text(__zp($b8) char *version_string, __mem() char release, __zp($e7) char major, __mem() char minor) +// unsigned long smc_get_version_text(__zp($76) char *version_string, __register(Y) char release, __mem() char major, __zp($d3) char minor) smc_get_version_text: { - .label major = $e7 - .label version_string = $b8 + .label minor = $d3 + .label version_string = $76 // sprintf(version_string, "%u.%u.%u", release, major, minor) - // [882] snprintf_init::s#3 = smc_get_version_text::version_string#2 - // [883] call snprintf_init - // [1113] phi from smc_get_version_text to snprintf_init [phi:smc_get_version_text->snprintf_init] - // [1113] phi snprintf_init::s#25 = snprintf_init::s#3 [phi:smc_get_version_text->snprintf_init#0] -- register_copy + // [909] snprintf_init::s#4 = smc_get_version_text::version_string#2 + // [910] call snprintf_init + // [1184] phi from smc_get_version_text to snprintf_init [phi:smc_get_version_text->snprintf_init] + // [1184] phi snprintf_init::s#30 = snprintf_init::s#4 [phi:smc_get_version_text->snprintf_init#0] -- register_copy jsr snprintf_init // smc_get_version_text::@1 // sprintf(version_string, "%u.%u.%u", release, major, minor) - // [884] printf_uchar::uvalue#6 = smc_get_version_text::release#2 -- vbum1=vbum2 - lda release - sta printf_uchar.uvalue - // [885] call printf_uchar - // [1118] phi from smc_get_version_text::@1 to printf_uchar [phi:smc_get_version_text::@1->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 0 [phi:smc_get_version_text::@1->printf_uchar#0] -- vbum1=vbuc1 + // [911] printf_uchar::uvalue#3 = smc_get_version_text::release#2 -- vbuxx=vbuyy + tya + tax + // [912] call printf_uchar + // [1189] phi from smc_get_version_text::@1 to printf_uchar [phi:smc_get_version_text::@1->printf_uchar] + // [1189] phi printf_uchar::format_zero_padding#15 = 0 [phi:smc_get_version_text::@1->printf_uchar#0] -- vbum1=vbuc1 lda #0 sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 0 [phi:smc_get_version_text::@1->printf_uchar#1] -- vbum1=vbuc1 + // [1189] phi printf_uchar::format_min_length#15 = 0 [phi:smc_get_version_text::@1->printf_uchar#1] -- vbum1=vbuc1 sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &snputc [phi:smc_get_version_text::@1->printf_uchar#2] -- pprz1=pprc1 + // [1189] phi printf_uchar::putc#15 = &snputc [phi:smc_get_version_text::@1->printf_uchar#2] -- pprz1=pprc1 lda #snputc sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = DECIMAL [phi:smc_get_version_text::@1->printf_uchar#3] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = printf_uchar::uvalue#6 [phi:smc_get_version_text::@1->printf_uchar#4] -- register_copy + // [1189] phi printf_uchar::format_radix#15 = DECIMAL [phi:smc_get_version_text::@1->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL + // [1189] phi printf_uchar::uvalue#15 = printf_uchar::uvalue#3 [phi:smc_get_version_text::@1->printf_uchar#4] -- register_copy jsr printf_uchar - // [886] phi from smc_get_version_text::@1 to smc_get_version_text::@2 [phi:smc_get_version_text::@1->smc_get_version_text::@2] + // [913] phi from smc_get_version_text::@1 to smc_get_version_text::@2 [phi:smc_get_version_text::@1->smc_get_version_text::@2] // smc_get_version_text::@2 // sprintf(version_string, "%u.%u.%u", release, major, minor) - // [887] call printf_str - // [1054] phi from smc_get_version_text::@2 to printf_str [phi:smc_get_version_text::@2->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:smc_get_version_text::@2->printf_str#0] -- pprz1=pprc1 + // [914] call printf_str + // [1125] phi from smc_get_version_text::@2 to printf_str [phi:smc_get_version_text::@2->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:smc_get_version_text::@2->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = smc_get_version_text::s [phi:smc_get_version_text::@2->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = smc_get_version_text::s [phi:smc_get_version_text::@2->printf_str#1] -- pbuz1=pbuc1 lda #s @@ -5845,37 +5767,35 @@ smc_get_version_text: { jsr printf_str // smc_get_version_text::@3 // sprintf(version_string, "%u.%u.%u", release, major, minor) - // [888] printf_uchar::uvalue#7 = smc_get_version_text::major#2 -- vbum1=vbuz2 - lda.z major - sta printf_uchar.uvalue - // [889] call printf_uchar - // [1118] phi from smc_get_version_text::@3 to printf_uchar [phi:smc_get_version_text::@3->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 0 [phi:smc_get_version_text::@3->printf_uchar#0] -- vbum1=vbuc1 + // [915] printf_uchar::uvalue#4 = smc_get_version_text::major#2 -- vbuxx=vbum1 + ldx major + // [916] call printf_uchar + // [1189] phi from smc_get_version_text::@3 to printf_uchar [phi:smc_get_version_text::@3->printf_uchar] + // [1189] phi printf_uchar::format_zero_padding#15 = 0 [phi:smc_get_version_text::@3->printf_uchar#0] -- vbum1=vbuc1 lda #0 sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 0 [phi:smc_get_version_text::@3->printf_uchar#1] -- vbum1=vbuc1 + // [1189] phi printf_uchar::format_min_length#15 = 0 [phi:smc_get_version_text::@3->printf_uchar#1] -- vbum1=vbuc1 sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &snputc [phi:smc_get_version_text::@3->printf_uchar#2] -- pprz1=pprc1 + // [1189] phi printf_uchar::putc#15 = &snputc [phi:smc_get_version_text::@3->printf_uchar#2] -- pprz1=pprc1 lda #snputc sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = DECIMAL [phi:smc_get_version_text::@3->printf_uchar#3] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = printf_uchar::uvalue#7 [phi:smc_get_version_text::@3->printf_uchar#4] -- register_copy + // [1189] phi printf_uchar::format_radix#15 = DECIMAL [phi:smc_get_version_text::@3->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL + // [1189] phi printf_uchar::uvalue#15 = printf_uchar::uvalue#4 [phi:smc_get_version_text::@3->printf_uchar#4] -- register_copy jsr printf_uchar - // [890] phi from smc_get_version_text::@3 to smc_get_version_text::@4 [phi:smc_get_version_text::@3->smc_get_version_text::@4] + // [917] phi from smc_get_version_text::@3 to smc_get_version_text::@4 [phi:smc_get_version_text::@3->smc_get_version_text::@4] // smc_get_version_text::@4 // sprintf(version_string, "%u.%u.%u", release, major, minor) - // [891] call printf_str - // [1054] phi from smc_get_version_text::@4 to printf_str [phi:smc_get_version_text::@4->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:smc_get_version_text::@4->printf_str#0] -- pprz1=pprc1 + // [918] call printf_str + // [1125] phi from smc_get_version_text::@4 to printf_str [phi:smc_get_version_text::@4->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:smc_get_version_text::@4->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = smc_get_version_text::s [phi:smc_get_version_text::@4->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = smc_get_version_text::s [phi:smc_get_version_text::@4->printf_str#1] -- pbuz1=pbuc1 lda #s @@ -5883,44 +5803,41 @@ smc_get_version_text: { jsr printf_str // smc_get_version_text::@5 // sprintf(version_string, "%u.%u.%u", release, major, minor) - // [892] printf_uchar::uvalue#8 = smc_get_version_text::minor#2 -- vbum1=vbum2 - lda minor - sta printf_uchar.uvalue - // [893] call printf_uchar - // [1118] phi from smc_get_version_text::@5 to printf_uchar [phi:smc_get_version_text::@5->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 0 [phi:smc_get_version_text::@5->printf_uchar#0] -- vbum1=vbuc1 + // [919] printf_uchar::uvalue#5 = smc_get_version_text::minor#2 -- vbuxx=vbuz1 + ldx.z minor + // [920] call printf_uchar + // [1189] phi from smc_get_version_text::@5 to printf_uchar [phi:smc_get_version_text::@5->printf_uchar] + // [1189] phi printf_uchar::format_zero_padding#15 = 0 [phi:smc_get_version_text::@5->printf_uchar#0] -- vbum1=vbuc1 lda #0 sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 0 [phi:smc_get_version_text::@5->printf_uchar#1] -- vbum1=vbuc1 + // [1189] phi printf_uchar::format_min_length#15 = 0 [phi:smc_get_version_text::@5->printf_uchar#1] -- vbum1=vbuc1 sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &snputc [phi:smc_get_version_text::@5->printf_uchar#2] -- pprz1=pprc1 + // [1189] phi printf_uchar::putc#15 = &snputc [phi:smc_get_version_text::@5->printf_uchar#2] -- pprz1=pprc1 lda #snputc sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = DECIMAL [phi:smc_get_version_text::@5->printf_uchar#3] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = printf_uchar::uvalue#8 [phi:smc_get_version_text::@5->printf_uchar#4] -- register_copy + // [1189] phi printf_uchar::format_radix#15 = DECIMAL [phi:smc_get_version_text::@5->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL + // [1189] phi printf_uchar::uvalue#15 = printf_uchar::uvalue#5 [phi:smc_get_version_text::@5->printf_uchar#4] -- register_copy jsr printf_uchar // smc_get_version_text::@6 // sprintf(version_string, "%u.%u.%u", release, major, minor) - // [894] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [921] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [895] callexecute snputc -- call_vprc1 + // [922] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // smc_get_version_text::@return // } - // [897] return + // [924] return rts .segment Data s: .text "." .byte 0 - .label release = check_status_roms_less.rom_chip - .label minor = smc_supported_rom.return + major: .byte 0 } .segment Code // display_info_smc @@ -5931,62 +5848,59 @@ smc_get_version_text: { * * @remark The smc_booloader is a global variable. */ -// void display_info_smc(__mem() char info_status, __zp($c7) char *info_text) +// void display_info_smc(__zp($71) char info_status, __zp($ad) char *info_text) display_info_smc: { - .label y = $ce - .label info_text = $c7 + .label info_status = $71 + .label info_text = $ad // unsigned char x = wherex() - // [899] call wherex + // [926] call wherex jsr wherex - // [900] wherex::return#10 = wherex::return#0 + // [927] wherex::return#10 = wherex::return#0 // display_info_smc::@3 - // [901] display_info_smc::x#0 = wherex::return#10 -- vbum1=vbum2 - lda wherex.return + // [928] display_info_smc::x#0 = wherex::return#10 -- vbum1=vbuaa sta x // unsigned char y = wherey() - // [902] call wherey + // [929] call wherey jsr wherey - // [903] wherey::return#10 = wherey::return#0 + // [930] wherey::return#10 = wherey::return#0 // display_info_smc::@4 - // [904] display_info_smc::y#0 = wherey::return#10 -- vbuz1=vbum2 - lda wherey.return - sta.z y + // [931] display_info_smc::y#0 = wherey::return#10 -- vbum1=vbuaa + sta y // status_smc = info_status - // [905] status_smc#122 = display_info_smc::info_status#21 -- vbum1=vbum2 - lda info_status + // [932] status_smc#147 = display_info_smc::info_status#24 -- vbum1=vbuz2 + lda.z info_status sta status_smc // display_smc_led(status_color[info_status]) - // [906] display_smc_led::c#1 = status_color[display_info_smc::info_status#21] -- vbuz1=pbuc1_derefidx_vbum2 - ldy info_status + // [933] display_smc_led::c#1 = status_color[display_info_smc::info_status#24] -- vbuz1=pbuc1_derefidx_vbuz2 + ldy.z info_status lda status_color,y sta.z display_smc_led.c - // [907] call display_smc_led - // [1989] phi from display_info_smc::@4 to display_smc_led [phi:display_info_smc::@4->display_smc_led] - // [1989] phi display_smc_led::c#2 = display_smc_led::c#1 [phi:display_info_smc::@4->display_smc_led#0] -- register_copy + // [934] call display_smc_led + // [2169] phi from display_info_smc::@4 to display_smc_led [phi:display_info_smc::@4->display_smc_led] + // [2169] phi display_smc_led::c#2 = display_smc_led::c#1 [phi:display_info_smc::@4->display_smc_led#0] -- register_copy jsr display_smc_led - // [908] phi from display_info_smc::@4 to display_info_smc::@5 [phi:display_info_smc::@4->display_info_smc::@5] + // [935] phi from display_info_smc::@4 to display_info_smc::@5 [phi:display_info_smc::@4->display_info_smc::@5] // display_info_smc::@5 // gotoxy(INFO_X, INFO_Y) - // [909] call gotoxy - // [778] phi from display_info_smc::@5 to gotoxy [phi:display_info_smc::@5->gotoxy] - // [778] phi gotoxy::y#33 = $11 [phi:display_info_smc::@5->gotoxy#0] -- vbum1=vbuc1 + // [936] call gotoxy + // [805] phi from display_info_smc::@5 to gotoxy [phi:display_info_smc::@5->gotoxy] + // [805] phi gotoxy::y#37 = $11 [phi:display_info_smc::@5->gotoxy#0] -- vbum1=vbuc1 lda #$11 sta gotoxy.y - // [778] phi gotoxy::x#33 = 4 [phi:display_info_smc::@5->gotoxy#1] -- vbum1=vbuc1 - lda #4 - sta gotoxy.x + // [805] phi gotoxy::x#37 = 4 [phi:display_info_smc::@5->gotoxy#1] -- vbuyy=vbuc1 + ldy #4 jsr gotoxy - // [910] phi from display_info_smc::@5 to display_info_smc::@6 [phi:display_info_smc::@5->display_info_smc::@6] + // [937] phi from display_info_smc::@5 to display_info_smc::@6 [phi:display_info_smc::@5->display_info_smc::@6] // display_info_smc::@6 // printf("SMC %-9s ATTiny %-8s BL:%u ", status_text[info_status], smc_version_text, smc_bootloader) - // [911] call printf_str - // [1054] phi from display_info_smc::@6 to printf_str [phi:display_info_smc::@6->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:display_info_smc::@6->printf_str#0] -- pprz1=pprc1 + // [938] call printf_str + // [1125] phi from display_info_smc::@6 to printf_str [phi:display_info_smc::@6->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:display_info_smc::@6->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = display_info_smc::s [phi:display_info_smc::@6->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = display_info_smc::s [phi:display_info_smc::@6->printf_str#1] -- pbuz1=pbuc1 lda #s @@ -5994,78 +5908,79 @@ display_info_smc: { jsr printf_str // display_info_smc::@7 // printf("SMC %-9s ATTiny %-8s BL:%u ", status_text[info_status], smc_version_text, smc_bootloader) - // [912] display_info_smc::$9 = display_info_smc::info_status#21 << 1 -- vbum1=vbum1_rol_1 - asl display_info_smc__9 - // [913] printf_string::str#3 = status_text[display_info_smc::$9] -- pbuz1=qbuc1_derefidx_vbum2 - ldy display_info_smc__9 + // [939] display_info_smc::$9 = display_info_smc::info_status#24 << 1 -- vbuaa=vbuz1_rol_1 + lda.z info_status + asl + // [940] printf_string::str#3 = status_text[display_info_smc::$9] -- pbuz1=qbuc1_derefidx_vbuaa + tay lda status_text,y sta.z printf_string.str lda status_text+1,y sta.z printf_string.str+1 - // [914] call printf_string - // [1227] phi from display_info_smc::@7 to printf_string [phi:display_info_smc::@7->printf_string] - // [1227] phi printf_string::putc#25 = &cputc [phi:display_info_smc::@7->printf_string#0] -- pprz1=pprc1 + // [941] call printf_string + // [1419] phi from display_info_smc::@7 to printf_string [phi:display_info_smc::@7->printf_string] + // [1419] phi printf_string::putc#26 = &cputc [phi:display_info_smc::@7->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#3 [phi:display_info_smc::@7->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 1 [phi:display_info_smc::@7->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#3 [phi:display_info_smc::@7->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 1 [phi:display_info_smc::@7->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 9 [phi:display_info_smc::@7->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 9 [phi:display_info_smc::@7->printf_string#3] -- vbum1=vbuc1 lda #9 sta printf_string.format_min_length jsr printf_string - // [915] phi from display_info_smc::@7 to display_info_smc::@8 [phi:display_info_smc::@7->display_info_smc::@8] + // [942] phi from display_info_smc::@7 to display_info_smc::@8 [phi:display_info_smc::@7->display_info_smc::@8] // display_info_smc::@8 // printf("SMC %-9s ATTiny %-8s BL:%u ", status_text[info_status], smc_version_text, smc_bootloader) - // [916] call printf_str - // [1054] phi from display_info_smc::@8 to printf_str [phi:display_info_smc::@8->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:display_info_smc::@8->printf_str#0] -- pprz1=pprc1 + // [943] call printf_str + // [1125] phi from display_info_smc::@8 to printf_str [phi:display_info_smc::@8->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:display_info_smc::@8->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = display_info_smc::s1 [phi:display_info_smc::@8->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = display_info_smc::s1 [phi:display_info_smc::@8->printf_str#1] -- pbuz1=pbuc1 lda #s1 sta.z printf_str.s+1 jsr printf_str - // [917] phi from display_info_smc::@8 to display_info_smc::@9 [phi:display_info_smc::@8->display_info_smc::@9] + // [944] phi from display_info_smc::@8 to display_info_smc::@9 [phi:display_info_smc::@8->display_info_smc::@9] // display_info_smc::@9 // printf("SMC %-9s ATTiny %-8s BL:%u ", status_text[info_status], smc_version_text, smc_bootloader) - // [918] call printf_string - // [1227] phi from display_info_smc::@9 to printf_string [phi:display_info_smc::@9->printf_string] - // [1227] phi printf_string::putc#25 = &cputc [phi:display_info_smc::@9->printf_string#0] -- pprz1=pprc1 + // [945] call printf_string + // [1419] phi from display_info_smc::@9 to printf_string [phi:display_info_smc::@9->printf_string] + // [1419] phi printf_string::putc#26 = &cputc [phi:display_info_smc::@9->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = smc_version_text [phi:display_info_smc::@9->printf_string#1] -- pbuz1=pbuc1 + // [1419] phi printf_string::str#26 = smc_version_text [phi:display_info_smc::@9->printf_string#1] -- pbuz1=pbuc1 lda #smc_version_text sta.z printf_string.str+1 - // [1227] phi printf_string::format_justify_left#25 = 1 [phi:display_info_smc::@9->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::format_justify_left#26 = 1 [phi:display_info_smc::@9->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 8 [phi:display_info_smc::@9->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 8 [phi:display_info_smc::@9->printf_string#3] -- vbum1=vbuc1 lda #8 sta printf_string.format_min_length jsr printf_string - // [919] phi from display_info_smc::@9 to display_info_smc::@10 [phi:display_info_smc::@9->display_info_smc::@10] + // [946] phi from display_info_smc::@9 to display_info_smc::@10 [phi:display_info_smc::@9->display_info_smc::@10] // display_info_smc::@10 // printf("SMC %-9s ATTiny %-8s BL:%u ", status_text[info_status], smc_version_text, smc_bootloader) - // [920] call printf_str - // [1054] phi from display_info_smc::@10 to printf_str [phi:display_info_smc::@10->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:display_info_smc::@10->printf_str#0] -- pprz1=pprc1 + // [947] call printf_str + // [1125] phi from display_info_smc::@10 to printf_str [phi:display_info_smc::@10->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:display_info_smc::@10->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = display_info_smc::s2 [phi:display_info_smc::@10->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = display_info_smc::s2 [phi:display_info_smc::@10->printf_str#1] -- pbuz1=pbuc1 lda #s2 @@ -6073,39 +5988,38 @@ display_info_smc: { jsr printf_str // display_info_smc::@11 // printf("SMC %-9s ATTiny %-8s BL:%u ", status_text[info_status], smc_version_text, smc_bootloader) - // [921] printf_uint::uvalue#0 = smc_bootloader#14 -- vwum1=vwum2 + // [948] printf_uint::uvalue#0 = smc_bootloader#14 -- vwum1=vwum2 lda smc_bootloader_1 sta printf_uint.uvalue lda smc_bootloader_1+1 sta printf_uint.uvalue+1 - // [922] call printf_uint - // [1835] phi from display_info_smc::@11 to printf_uint [phi:display_info_smc::@11->printf_uint] - // [1835] phi printf_uint::format_zero_padding#10 = 0 [phi:display_info_smc::@11->printf_uint#0] -- vbum1=vbuc1 + // [949] call printf_uint + // [2015] phi from display_info_smc::@11 to printf_uint [phi:display_info_smc::@11->printf_uint] + // [2015] phi printf_uint::format_zero_padding#10 = 0 [phi:display_info_smc::@11->printf_uint#0] -- vbum1=vbuc1 lda #0 sta printf_uint.format_zero_padding - // [1835] phi printf_uint::format_min_length#10 = 0 [phi:display_info_smc::@11->printf_uint#1] -- vbum1=vbuc1 + // [2015] phi printf_uint::format_min_length#10 = 0 [phi:display_info_smc::@11->printf_uint#1] -- vbum1=vbuc1 sta printf_uint.format_min_length - // [1835] phi printf_uint::putc#10 = &cputc [phi:display_info_smc::@11->printf_uint#2] -- pprz1=pprc1 + // [2015] phi printf_uint::putc#10 = &cputc [phi:display_info_smc::@11->printf_uint#2] -- pprz1=pprc1 lda #cputc sta.z printf_uint.putc+1 - // [1835] phi printf_uint::format_radix#10 = DECIMAL [phi:display_info_smc::@11->printf_uint#3] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_uint.format_radix - // [1835] phi printf_uint::uvalue#10 = printf_uint::uvalue#0 [phi:display_info_smc::@11->printf_uint#4] -- register_copy + // [2015] phi printf_uint::format_radix#10 = DECIMAL [phi:display_info_smc::@11->printf_uint#3] -- vbuxx=vbuc1 + ldx #DECIMAL + // [2015] phi printf_uint::uvalue#10 = printf_uint::uvalue#0 [phi:display_info_smc::@11->printf_uint#4] -- register_copy jsr printf_uint - // [923] phi from display_info_smc::@11 to display_info_smc::@12 [phi:display_info_smc::@11->display_info_smc::@12] + // [950] phi from display_info_smc::@11 to display_info_smc::@12 [phi:display_info_smc::@11->display_info_smc::@12] // display_info_smc::@12 // printf("SMC %-9s ATTiny %-8s BL:%u ", status_text[info_status], smc_version_text, smc_bootloader) - // [924] call printf_str - // [1054] phi from display_info_smc::@12 to printf_str [phi:display_info_smc::@12->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:display_info_smc::@12->printf_str#0] -- pprz1=pprc1 + // [951] call printf_str + // [1125] phi from display_info_smc::@12 to printf_str [phi:display_info_smc::@12->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:display_info_smc::@12->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s [phi:display_info_smc::@12->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s [phi:display_info_smc::@12->printf_str#1] -- pbuz1=pbuc1 lda #<@s sta.z printf_str.s lda #>@s @@ -6113,7 +6027,7 @@ display_info_smc: { jsr printf_str // display_info_smc::@13 // if(info_text) - // [925] if((char *)0==display_info_smc::info_text#21) goto display_info_smc::@1 -- pbuc1_eq_pbuz1_then_la1 + // [952] if((char *)0==display_info_smc::info_text#24) goto display_info_smc::@1 -- pbuc1_eq_pbuz1_then_la1 lda.z info_text cmp #<0 bne !+ @@ -6121,57 +6035,55 @@ display_info_smc: { cmp #>0 beq __b1 !: - // [926] phi from display_info_smc::@13 to display_info_smc::@2 [phi:display_info_smc::@13->display_info_smc::@2] + // [953] phi from display_info_smc::@13 to display_info_smc::@2 [phi:display_info_smc::@13->display_info_smc::@2] // display_info_smc::@2 // gotoxy(INFO_X+64-28, INFO_Y) - // [927] call gotoxy - // [778] phi from display_info_smc::@2 to gotoxy [phi:display_info_smc::@2->gotoxy] - // [778] phi gotoxy::y#33 = $11 [phi:display_info_smc::@2->gotoxy#0] -- vbum1=vbuc1 + // [954] call gotoxy + // [805] phi from display_info_smc::@2 to gotoxy [phi:display_info_smc::@2->gotoxy] + // [805] phi gotoxy::y#37 = $11 [phi:display_info_smc::@2->gotoxy#0] -- vbum1=vbuc1 lda #$11 sta gotoxy.y - // [778] phi gotoxy::x#33 = 4+$40-$1c [phi:display_info_smc::@2->gotoxy#1] -- vbum1=vbuc1 - lda #4+$40-$1c - sta gotoxy.x + // [805] phi gotoxy::x#37 = 4+$40-$1c [phi:display_info_smc::@2->gotoxy#1] -- vbuyy=vbuc1 + ldy #4+$40-$1c jsr gotoxy // display_info_smc::@14 // printf("%-25s", info_text) - // [928] printf_string::str#5 = display_info_smc::info_text#21 -- pbuz1=pbuz2 + // [955] printf_string::str#5 = display_info_smc::info_text#24 -- pbuz1=pbuz2 lda.z info_text sta.z printf_string.str lda.z info_text+1 sta.z printf_string.str+1 - // [929] call printf_string - // [1227] phi from display_info_smc::@14 to printf_string [phi:display_info_smc::@14->printf_string] - // [1227] phi printf_string::putc#25 = &cputc [phi:display_info_smc::@14->printf_string#0] -- pprz1=pprc1 + // [956] call printf_string + // [1419] phi from display_info_smc::@14 to printf_string [phi:display_info_smc::@14->printf_string] + // [1419] phi printf_string::putc#26 = &cputc [phi:display_info_smc::@14->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#5 [phi:display_info_smc::@14->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 1 [phi:display_info_smc::@14->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#5 [phi:display_info_smc::@14->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 1 [phi:display_info_smc::@14->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = $19 [phi:display_info_smc::@14->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = $19 [phi:display_info_smc::@14->printf_string#3] -- vbum1=vbuc1 lda #$19 sta printf_string.format_min_length jsr printf_string // display_info_smc::@1 __b1: // gotoxy(x, y) - // [930] gotoxy::x#14 = display_info_smc::x#0 -- vbum1=vbum2 - lda x - sta gotoxy.x - // [931] gotoxy::y#14 = display_info_smc::y#0 -- vbum1=vbuz2 - lda.z y + // [957] gotoxy::x#14 = display_info_smc::x#0 -- vbuyy=vbum1 + ldy x + // [958] gotoxy::y#14 = display_info_smc::y#0 -- vbum1=vbum2 + lda y sta gotoxy.y - // [932] call gotoxy - // [778] phi from display_info_smc::@1 to gotoxy [phi:display_info_smc::@1->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#14 [phi:display_info_smc::@1->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = gotoxy::x#14 [phi:display_info_smc::@1->gotoxy#1] -- register_copy + // [959] call gotoxy + // [805] phi from display_info_smc::@1 to gotoxy [phi:display_info_smc::@1->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#14 [phi:display_info_smc::@1->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = gotoxy::x#14 [phi:display_info_smc::@1->gotoxy#1] -- register_copy jsr gotoxy // display_info_smc::@return // } - // [933] return + // [960] return rts .segment Data s: .text "SMC " @@ -6180,216 +6092,233 @@ display_info_smc: { .byte 0 s2: .text " BL:" .byte 0 - .label display_info_smc__9 = main.check_status_smc18_main__0 - .label x = fclose.fclose__1 - .label info_status = main.check_status_smc18_main__0 + x: .byte 0 + y: .byte 0 +} +.segment CodeVera + // main_vera_detect +//#pragma data_seg(DataVera) +main_vera_detect: { + // w25q16_detect() + // [962] call w25q16_detect + // [2223] phi from main_vera_detect to w25q16_detect [phi:main_vera_detect->w25q16_detect] + jsr w25q16_detect + // [963] phi from main_vera_detect to main_vera_detect::@1 [phi:main_vera_detect->main_vera_detect::@1] + // main_vera_detect::@1 + // display_chip_vera() + // [964] call display_chip_vera + // [2153] phi from main_vera_detect::@1 to display_chip_vera [phi:main_vera_detect::@1->display_chip_vera] + jsr display_chip_vera + // [965] phi from main_vera_detect::@1 to main_vera_detect::@2 [phi:main_vera_detect::@1->main_vera_detect::@2] + // main_vera_detect::@2 + // display_info_vera(STATUS_DETECTED, NULL) + // [966] call display_info_vera + // [1930] phi from main_vera_detect::@2 to display_info_vera [phi:main_vera_detect::@2->display_info_vera] + // [1930] phi display_info_vera::info_text#15 = 0 [phi:main_vera_detect::@2->display_info_vera#0] -- pbuz1=vbuc1 + lda #<0 + sta.z display_info_vera.info_text + sta.z display_info_vera.info_text+1 + // [1930] phi display_info_vera::info_status#15 = STATUS_DETECTED [phi:main_vera_detect::@2->display_info_vera#1] -- vbum1=vbuc1 + lda #STATUS_DETECTED + sta display_info_vera.info_status + jsr display_info_vera + // main_vera_detect::@return + // } + // [967] return + rts } .segment Code // rom_detect rom_detect: { .const bank_set_brom1_bank = 4 - .label rom_detect__9 = $ce - .label rom_detect__14 = $77 - .label rom_detect__15 = $dc - .label rom_detect__18 = $29 - .label rom_detect__21 = $dd - .label rom_detect__24 = $ed - .label rom_detect_address = $c3 - // [935] phi from rom_detect to rom_detect::@1 [phi:rom_detect->rom_detect::@1] - // [935] phi rom_detect::rom_chip#10 = 0 [phi:rom_detect->rom_detect::@1#0] -- vbum1=vbuc1 + // [969] phi from rom_detect to rom_detect::@1 [phi:rom_detect->rom_detect::@1] + // [969] phi rom_detect::rom_chip#10 = 0 [phi:rom_detect->rom_detect::@1#0] -- vbum1=vbuc1 lda #0 sta rom_chip - // [935] phi rom_detect::rom_detect_address#10 = 0 [phi:rom_detect->rom_detect::@1#1] -- vduz1=vduc1 - sta.z rom_detect_address - sta.z rom_detect_address+1 + // [969] phi rom_detect::rom_detect_address#10 = 0 [phi:rom_detect->rom_detect::@1#1] -- vdum1=vduc1 + sta rom_detect_address + sta rom_detect_address+1 lda #<0>>$10 - sta.z rom_detect_address+2 + sta rom_detect_address+2 lda #>0>>$10 - sta.z rom_detect_address+3 + sta rom_detect_address+3 // Ensure the ROM is set to BASIC. // bank_set_brom(4); // rom_detect::@1 __b1: // for (unsigned long rom_detect_address = 0; rom_detect_address < 8 * 0x80000; rom_detect_address += 0x80000) - // [936] if(rom_detect::rom_detect_address#10<8*$80000) goto rom_detect::@2 -- vduz1_lt_vduc1_then_la1 - lda.z rom_detect_address+3 + // [970] if(rom_detect::rom_detect_address#10<8*$80000) goto rom_detect::@2 -- vdum1_lt_vduc1_then_la1 + lda rom_detect_address+3 cmp #>8*$80000>>$10 bcc __b2 bne !+ - lda.z rom_detect_address+2 + lda rom_detect_address+2 cmp #<8*$80000>>$10 bcc __b2 bne !+ - lda.z rom_detect_address+1 + lda rom_detect_address+1 cmp #>8*$80000 bcc __b2 bne !+ - lda.z rom_detect_address + lda rom_detect_address cmp #<8*$80000 bcc __b2 !: // rom_detect::@return // } - // [937] return + // [971] return rts // rom_detect::@2 __b2: // rom_manufacturer_ids[rom_chip] = 0 - // [938] rom_manufacturer_ids[rom_detect::rom_chip#10] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + // [972] rom_manufacturer_ids[rom_detect::rom_chip#10] = 0 -- pbuc1_derefidx_vbum1=vbuc2 lda #0 ldy rom_chip sta rom_manufacturer_ids,y // rom_device_ids[rom_chip] = 0 - // [939] rom_device_ids[rom_detect::rom_chip#10] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + // [973] rom_device_ids[rom_detect::rom_chip#10] = 0 -- pbuc1_derefidx_vbum1=vbuc2 sta rom_device_ids,y // rom_unlock(rom_detect_address + 0x05555, 0x90) - // [940] rom_unlock::address#2 = rom_detect::rom_detect_address#10 + $5555 -- vduz1=vduz2_plus_vwuc1 + // [974] rom_unlock::address#2 = rom_detect::rom_detect_address#10 + $5555 -- vduz1=vdum2_plus_vwuc1 clc - lda.z rom_detect_address + lda rom_detect_address adc #<$5555 sta.z rom_unlock.address - lda.z rom_detect_address+1 + lda rom_detect_address+1 adc #>$5555 sta.z rom_unlock.address+1 - lda.z rom_detect_address+2 + lda rom_detect_address+2 adc #0 sta.z rom_unlock.address+2 - lda.z rom_detect_address+3 + lda rom_detect_address+3 adc #0 sta.z rom_unlock.address+3 - // [941] call rom_unlock - // [2043] phi from rom_detect::@2 to rom_unlock [phi:rom_detect::@2->rom_unlock] - // [2043] phi rom_unlock::unlock_code#5 = $90 [phi:rom_detect::@2->rom_unlock#0] -- vbuz1=vbuc1 + // [975] call rom_unlock + // [2228] phi from rom_detect::@2 to rom_unlock [phi:rom_detect::@2->rom_unlock] + // [2228] phi rom_unlock::unlock_code#5 = $90 [phi:rom_detect::@2->rom_unlock#0] -- vbuz1=vbuc1 lda #$90 sta.z rom_unlock.unlock_code - // [2043] phi rom_unlock::address#5 = rom_unlock::address#2 [phi:rom_detect::@2->rom_unlock#1] -- register_copy + // [2228] phi rom_unlock::address#5 = rom_unlock::address#2 [phi:rom_detect::@2->rom_unlock#1] -- register_copy jsr rom_unlock // rom_detect::@12 // rom_read_byte(rom_detect_address) - // [942] rom_read_byte::address#0 = rom_detect::rom_detect_address#10 -- vdum1=vduz2 - lda.z rom_detect_address + // [976] rom_read_byte::address#0 = rom_detect::rom_detect_address#10 -- vdum1=vdum2 + lda rom_detect_address sta rom_read_byte.address - lda.z rom_detect_address+1 + lda rom_detect_address+1 sta rom_read_byte.address+1 - lda.z rom_detect_address+2 + lda rom_detect_address+2 sta rom_read_byte.address+2 - lda.z rom_detect_address+3 + lda rom_detect_address+3 sta rom_read_byte.address+3 - // [943] call rom_read_byte - // [2053] phi from rom_detect::@12 to rom_read_byte [phi:rom_detect::@12->rom_read_byte] - // [2053] phi rom_read_byte::address#2 = rom_read_byte::address#0 [phi:rom_detect::@12->rom_read_byte#0] -- register_copy + // [977] call rom_read_byte + // [2238] phi from rom_detect::@12 to rom_read_byte [phi:rom_detect::@12->rom_read_byte] + // [2238] phi rom_read_byte::address#2 = rom_read_byte::address#0 [phi:rom_detect::@12->rom_read_byte#0] -- register_copy jsr rom_read_byte // rom_read_byte(rom_detect_address) - // [944] rom_read_byte::return#2 = rom_read_byte::return#0 + // [978] rom_read_byte::return#2 = rom_read_byte::return#0 // rom_detect::@13 - // [945] rom_detect::$3 = rom_read_byte::return#2 + // [979] rom_detect::$3 = rom_read_byte::return#2 // rom_manufacturer_ids[rom_chip] = rom_read_byte(rom_detect_address) - // [946] rom_manufacturer_ids[rom_detect::rom_chip#10] = rom_detect::$3 -- pbuc1_derefidx_vbum1=vbum2 - lda rom_detect__3 + // [980] rom_manufacturer_ids[rom_detect::rom_chip#10] = rom_detect::$3 -- pbuc1_derefidx_vbum1=vbuaa ldy rom_chip sta rom_manufacturer_ids,y // rom_read_byte(rom_detect_address + 1) - // [947] rom_read_byte::address#1 = rom_detect::rom_detect_address#10 + 1 -- vdum1=vduz2_plus_1 - lda.z rom_detect_address + // [981] rom_read_byte::address#1 = rom_detect::rom_detect_address#10 + 1 -- vdum1=vdum2_plus_1 + lda rom_detect_address clc adc #1 sta rom_read_byte.address - lda.z rom_detect_address+1 + lda rom_detect_address+1 adc #0 sta rom_read_byte.address+1 - lda.z rom_detect_address+2 + lda rom_detect_address+2 adc #0 sta rom_read_byte.address+2 - lda.z rom_detect_address+3 + lda rom_detect_address+3 adc #0 sta rom_read_byte.address+3 - // [948] call rom_read_byte - // [2053] phi from rom_detect::@13 to rom_read_byte [phi:rom_detect::@13->rom_read_byte] - // [2053] phi rom_read_byte::address#2 = rom_read_byte::address#1 [phi:rom_detect::@13->rom_read_byte#0] -- register_copy + // [982] call rom_read_byte + // [2238] phi from rom_detect::@13 to rom_read_byte [phi:rom_detect::@13->rom_read_byte] + // [2238] phi rom_read_byte::address#2 = rom_read_byte::address#1 [phi:rom_detect::@13->rom_read_byte#0] -- register_copy jsr rom_read_byte // rom_read_byte(rom_detect_address + 1) - // [949] rom_read_byte::return#3 = rom_read_byte::return#0 + // [983] rom_read_byte::return#3 = rom_read_byte::return#0 // rom_detect::@14 - // [950] rom_detect::$5 = rom_read_byte::return#3 + // [984] rom_detect::$5 = rom_read_byte::return#3 // rom_device_ids[rom_chip] = rom_read_byte(rom_detect_address + 1) - // [951] rom_device_ids[rom_detect::rom_chip#10] = rom_detect::$5 -- pbuc1_derefidx_vbum1=vbum2 - lda rom_detect__5 + // [985] rom_device_ids[rom_detect::rom_chip#10] = rom_detect::$5 -- pbuc1_derefidx_vbum1=vbuaa ldy rom_chip sta rom_device_ids,y // rom_unlock(rom_detect_address + 0x05555, 0xF0) - // [952] rom_unlock::address#3 = rom_detect::rom_detect_address#10 + $5555 -- vduz1=vduz2_plus_vwuc1 + // [986] rom_unlock::address#3 = rom_detect::rom_detect_address#10 + $5555 -- vduz1=vdum2_plus_vwuc1 clc - lda.z rom_detect_address + lda rom_detect_address adc #<$5555 sta.z rom_unlock.address - lda.z rom_detect_address+1 + lda rom_detect_address+1 adc #>$5555 sta.z rom_unlock.address+1 - lda.z rom_detect_address+2 + lda rom_detect_address+2 adc #0 sta.z rom_unlock.address+2 - lda.z rom_detect_address+3 + lda rom_detect_address+3 adc #0 sta.z rom_unlock.address+3 - // [953] call rom_unlock - // [2043] phi from rom_detect::@14 to rom_unlock [phi:rom_detect::@14->rom_unlock] - // [2043] phi rom_unlock::unlock_code#5 = $f0 [phi:rom_detect::@14->rom_unlock#0] -- vbuz1=vbuc1 + // [987] call rom_unlock + // [2228] phi from rom_detect::@14 to rom_unlock [phi:rom_detect::@14->rom_unlock] + // [2228] phi rom_unlock::unlock_code#5 = $f0 [phi:rom_detect::@14->rom_unlock#0] -- vbuz1=vbuc1 lda #$f0 sta.z rom_unlock.unlock_code - // [2043] phi rom_unlock::address#5 = rom_unlock::address#3 [phi:rom_detect::@14->rom_unlock#1] -- register_copy + // [2228] phi rom_unlock::address#5 = rom_unlock::address#3 [phi:rom_detect::@14->rom_unlock#1] -- register_copy jsr rom_unlock // rom_detect::bank_set_brom1 // BROM = bank - // [954] BROM = rom_detect::bank_set_brom1_bank#0 -- vbuz1=vbuc1 + // [988] BROM = rom_detect::bank_set_brom1_bank#0 -- vbuz1=vbuc1 lda #bank_set_brom1_bank sta.z BROM // rom_detect::@11 // rom_chip*3 - // [955] rom_detect::$14 = rom_detect::rom_chip#10 << 1 -- vbuz1=vbum2_rol_1 + // [989] rom_detect::$14 = rom_detect::rom_chip#10 << 1 -- vbum1=vbum2_rol_1 lda rom_chip asl - sta.z rom_detect__14 - // [956] rom_detect::$9 = rom_detect::$14 + rom_detect::rom_chip#10 -- vbuz1=vbuz2_plus_vbum3 - lda rom_chip + sta rom_detect__14 + // [990] rom_detect::$9 = rom_detect::$14 + rom_detect::rom_chip#10 -- vbuaa=vbum1_plus_vbum2 clc - adc.z rom_detect__14 - sta.z rom_detect__9 + adc rom_chip // gotoxy(rom_chip*3+40, 1) - // [957] gotoxy::x#26 = rom_detect::$9 + $28 -- vbum1=vbuz2_plus_vbuc1 - lda #$28 + // [991] gotoxy::x#26 = rom_detect::$9 + $28 -- vbuyy=vbuaa_plus_vbuc1 clc - adc.z rom_detect__9 - sta gotoxy.x - // [958] call gotoxy - // [778] phi from rom_detect::@11 to gotoxy [phi:rom_detect::@11->gotoxy] - // [778] phi gotoxy::y#33 = 1 [phi:rom_detect::@11->gotoxy#0] -- vbum1=vbuc1 + adc #$28 + tay + // [992] call gotoxy + // [805] phi from rom_detect::@11 to gotoxy [phi:rom_detect::@11->gotoxy] + // [805] phi gotoxy::y#37 = 1 [phi:rom_detect::@11->gotoxy#0] -- vbum1=vbuc1 lda #1 sta gotoxy.y - // [778] phi gotoxy::x#33 = gotoxy::x#26 [phi:rom_detect::@11->gotoxy#1] -- register_copy + // [805] phi gotoxy::x#37 = gotoxy::x#26 [phi:rom_detect::@11->gotoxy#1] -- register_copy jsr gotoxy // rom_detect::@15 // printf("%02x", rom_device_ids[rom_chip]) - // [959] printf_uchar::uvalue#13 = rom_device_ids[rom_detect::rom_chip#10] -- vbum1=pbuc1_derefidx_vbum2 + // [993] printf_uchar::uvalue#10 = rom_device_ids[rom_detect::rom_chip#10] -- vbuxx=pbuc1_derefidx_vbum1 ldy rom_chip - lda rom_device_ids,y - sta printf_uchar.uvalue - // [960] call printf_uchar - // [1118] phi from rom_detect::@15 to printf_uchar [phi:rom_detect::@15->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 1 [phi:rom_detect::@15->printf_uchar#0] -- vbum1=vbuc1 + ldx rom_device_ids,y + // [994] call printf_uchar + // [1189] phi from rom_detect::@15 to printf_uchar [phi:rom_detect::@15->printf_uchar] + // [1189] phi printf_uchar::format_zero_padding#15 = 1 [phi:rom_detect::@15->printf_uchar#0] -- vbum1=vbuc1 lda #1 sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 2 [phi:rom_detect::@15->printf_uchar#1] -- vbum1=vbuc1 + // [1189] phi printf_uchar::format_min_length#15 = 2 [phi:rom_detect::@15->printf_uchar#1] -- vbum1=vbuc1 lda #2 sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &cputc [phi:rom_detect::@15->printf_uchar#2] -- pprz1=pprc1 + // [1189] phi printf_uchar::putc#15 = &cputc [phi:rom_detect::@15->printf_uchar#2] -- pprz1=pprc1 lda #cputc sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = HEXADECIMAL [phi:rom_detect::@15->printf_uchar#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = printf_uchar::uvalue#13 [phi:rom_detect::@15->printf_uchar#4] -- register_copy + // [1189] phi printf_uchar::format_radix#15 = HEXADECIMAL [phi:rom_detect::@15->printf_uchar#3] -- vbuyy=vbuc1 + ldy #HEXADECIMAL + // [1189] phi printf_uchar::uvalue#15 = printf_uchar::uvalue#10 [phi:rom_detect::@15->printf_uchar#4] -- register_copy jsr printf_uchar // rom_detect::@16 // case SST39SF010A: @@ -6397,7 +6326,7 @@ rom_detect: { // rom_size_strings[rom_chip] = "128"; // rom_sizes[rom_chip] = 128 * 1024; // break; - // [961] if(rom_device_ids[rom_detect::rom_chip#10]==$b5) goto rom_detect::@3 -- pbuc1_derefidx_vbum1_eq_vbuc2_then_la1 + // [995] if(rom_device_ids[rom_detect::rom_chip#10]==$b5) goto rom_detect::@3 -- pbuc1_derefidx_vbum1_eq_vbuc2_then_la1 ldy rom_chip lda rom_device_ids,y cmp #$b5 @@ -6410,7 +6339,7 @@ rom_detect: { // rom_size_strings[rom_chip] = "256"; // rom_sizes[rom_chip] = 256 * 1024; // break; - // [962] if(rom_device_ids[rom_detect::rom_chip#10]==$b6) goto rom_detect::@4 -- pbuc1_derefidx_vbum1_eq_vbuc2_then_la1 + // [996] if(rom_device_ids[rom_detect::rom_chip#10]==$b6) goto rom_detect::@4 -- pbuc1_derefidx_vbum1_eq_vbuc2_then_la1 lda rom_device_ids,y cmp #$b6 bne !__b4+ @@ -6422,35 +6351,35 @@ rom_detect: { // rom_size_strings[rom_chip] = "512"; // rom_sizes[rom_chip] = 512 * 1024; // break; - // [963] if(rom_device_ids[rom_detect::rom_chip#10]==$b7) goto rom_detect::@5 -- pbuc1_derefidx_vbum1_eq_vbuc2_then_la1 + // [997] if(rom_device_ids[rom_detect::rom_chip#10]==$b7) goto rom_detect::@5 -- pbuc1_derefidx_vbum1_eq_vbuc2_then_la1 lda rom_device_ids,y cmp #$b7 beq __b5 // rom_detect::@6 // rom_manufacturer_ids[rom_chip] = 0 - // [964] rom_manufacturer_ids[rom_detect::rom_chip#10] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + // [998] rom_manufacturer_ids[rom_detect::rom_chip#10] = 0 -- pbuc1_derefidx_vbum1=vbuc2 lda #0 sta rom_manufacturer_ids,y // rom_device_names[rom_chip] = "----" - // [965] rom_device_names[rom_detect::$14] = rom_detect::$31 -- qbuc1_derefidx_vbuz1=pbuc2 - ldy.z rom_detect__14 + // [999] rom_device_names[rom_detect::$14] = rom_detect::$31 -- qbuc1_derefidx_vbum1=pbuc2 + ldy rom_detect__14 lda #rom_detect__31 sta rom_device_names+1,y // rom_size_strings[rom_chip] = "000" - // [966] rom_size_strings[rom_detect::$14] = rom_detect::$32 -- qbuc1_derefidx_vbuz1=pbuc2 + // [1000] rom_size_strings[rom_detect::$14] = rom_detect::$32 -- qbuc1_derefidx_vbum1=pbuc2 lda #rom_detect__32 sta rom_size_strings+1,y // rom_sizes[rom_chip] = 0 - // [967] rom_detect::$24 = rom_detect::rom_chip#10 << 2 -- vbuz1=vbum2_rol_2 + // [1001] rom_detect::$24 = rom_detect::rom_chip#10 << 2 -- vbum1=vbum2_rol_2 lda rom_chip asl asl - sta.z rom_detect__24 - // [968] rom_sizes[rom_detect::$24] = 0 -- pduc1_derefidx_vbuz1=vbuc2 + sta rom_detect__24 + // [1002] rom_sizes[rom_detect::$24] = 0 -- pduc1_derefidx_vbum1=vbuc2 tay lda #0 sta rom_sizes,y @@ -6458,57 +6387,56 @@ rom_detect: { sta rom_sizes+2,y sta rom_sizes+3,y // rom_device_ids[rom_chip] = UNKNOWN - // [969] rom_device_ids[rom_detect::rom_chip#10] = $55 -- pbuc1_derefidx_vbum1=vbuc2 + // [1003] rom_device_ids[rom_detect::rom_chip#10] = $55 -- pbuc1_derefidx_vbum1=vbuc2 lda #$55 ldy rom_chip sta rom_device_ids,y // rom_detect::@7 __b7: // rom_chip++; - // [970] rom_detect::rom_chip#1 = ++ rom_detect::rom_chip#10 -- vbum1=_inc_vbum1 + // [1004] rom_detect::rom_chip#1 = ++ rom_detect::rom_chip#10 -- vbum1=_inc_vbum1 inc rom_chip // rom_detect::@8 // rom_detect_address += 0x80000 - // [971] rom_detect::rom_detect_address#1 = rom_detect::rom_detect_address#10 + $80000 -- vduz1=vduz1_plus_vduc1 + // [1005] rom_detect::rom_detect_address#1 = rom_detect::rom_detect_address#10 + $80000 -- vdum1=vdum1_plus_vduc1 clc - lda.z rom_detect_address + lda rom_detect_address adc #<$80000 - sta.z rom_detect_address - lda.z rom_detect_address+1 + sta rom_detect_address + lda rom_detect_address+1 adc #>$80000 - sta.z rom_detect_address+1 - lda.z rom_detect_address+2 + sta rom_detect_address+1 + lda rom_detect_address+2 adc #<$80000>>$10 - sta.z rom_detect_address+2 - lda.z rom_detect_address+3 + sta rom_detect_address+2 + lda rom_detect_address+3 adc #>$80000>>$10 - sta.z rom_detect_address+3 - // [935] phi from rom_detect::@8 to rom_detect::@1 [phi:rom_detect::@8->rom_detect::@1] - // [935] phi rom_detect::rom_chip#10 = rom_detect::rom_chip#1 [phi:rom_detect::@8->rom_detect::@1#0] -- register_copy - // [935] phi rom_detect::rom_detect_address#10 = rom_detect::rom_detect_address#1 [phi:rom_detect::@8->rom_detect::@1#1] -- register_copy + sta rom_detect_address+3 + // [969] phi from rom_detect::@8 to rom_detect::@1 [phi:rom_detect::@8->rom_detect::@1] + // [969] phi rom_detect::rom_chip#10 = rom_detect::rom_chip#1 [phi:rom_detect::@8->rom_detect::@1#0] -- register_copy + // [969] phi rom_detect::rom_detect_address#10 = rom_detect::rom_detect_address#1 [phi:rom_detect::@8->rom_detect::@1#1] -- register_copy jmp __b1 // rom_detect::@5 __b5: // rom_device_names[rom_chip] = "f040" - // [972] rom_device_names[rom_detect::$14] = rom_detect::$29 -- qbuc1_derefidx_vbuz1=pbuc2 - ldy.z rom_detect__14 + // [1006] rom_device_names[rom_detect::$14] = rom_detect::$29 -- qbuc1_derefidx_vbum1=pbuc2 + ldy rom_detect__14 lda #rom_detect__29 sta rom_device_names+1,y // rom_size_strings[rom_chip] = "512" - // [973] rom_size_strings[rom_detect::$14] = rom_detect::$30 -- qbuc1_derefidx_vbuz1=pbuc2 + // [1007] rom_size_strings[rom_detect::$14] = rom_detect::$30 -- qbuc1_derefidx_vbum1=pbuc2 lda #rom_detect__30 sta rom_size_strings+1,y // rom_sizes[rom_chip] = 512 * 1024 - // [974] rom_detect::$21 = rom_detect::rom_chip#10 << 2 -- vbuz1=vbum2_rol_2 + // [1008] rom_detect::$21 = rom_detect::rom_chip#10 << 2 -- vbuaa=vbum1_rol_2 lda rom_chip asl asl - sta.z rom_detect__21 - // [975] rom_sizes[rom_detect::$21] = (unsigned long)$200*$400 -- pduc1_derefidx_vbuz1=vduc2 + // [1009] rom_sizes[rom_detect::$21] = (unsigned long)$200*$400 -- pduc1_derefidx_vbuaa=vduc2 tay lda #<$200*$400 sta rom_sizes,y @@ -6522,25 +6450,24 @@ rom_detect: { // rom_detect::@4 __b4: // rom_device_names[rom_chip] = "f020a" - // [976] rom_device_names[rom_detect::$14] = rom_detect::$27 -- qbuc1_derefidx_vbuz1=pbuc2 - ldy.z rom_detect__14 + // [1010] rom_device_names[rom_detect::$14] = rom_detect::$27 -- qbuc1_derefidx_vbum1=pbuc2 + ldy rom_detect__14 lda #rom_detect__27 sta rom_device_names+1,y // rom_size_strings[rom_chip] = "256" - // [977] rom_size_strings[rom_detect::$14] = rom_detect::$28 -- qbuc1_derefidx_vbuz1=pbuc2 + // [1011] rom_size_strings[rom_detect::$14] = rom_detect::$28 -- qbuc1_derefidx_vbum1=pbuc2 lda #rom_detect__28 sta rom_size_strings+1,y // rom_sizes[rom_chip] = 256 * 1024 - // [978] rom_detect::$18 = rom_detect::rom_chip#10 << 2 -- vbuz1=vbum2_rol_2 + // [1012] rom_detect::$18 = rom_detect::rom_chip#10 << 2 -- vbuaa=vbum1_rol_2 lda rom_chip asl asl - sta.z rom_detect__18 - // [979] rom_sizes[rom_detect::$18] = (unsigned long)$100*$400 -- pduc1_derefidx_vbuz1=vduc2 + // [1013] rom_sizes[rom_detect::$18] = (unsigned long)$100*$400 -- pduc1_derefidx_vbuaa=vduc2 tay lda #<$100*$400 sta rom_sizes,y @@ -6554,25 +6481,24 @@ rom_detect: { // rom_detect::@3 __b3: // rom_device_names[rom_chip] = "f010a" - // [980] rom_device_names[rom_detect::$14] = rom_detect::$25 -- qbuc1_derefidx_vbuz1=pbuc2 - ldy.z rom_detect__14 + // [1014] rom_device_names[rom_detect::$14] = rom_detect::$25 -- qbuc1_derefidx_vbum1=pbuc2 + ldy rom_detect__14 lda #rom_detect__25 sta rom_device_names+1,y // rom_size_strings[rom_chip] = "128" - // [981] rom_size_strings[rom_detect::$14] = rom_detect::$26 -- qbuc1_derefidx_vbuz1=pbuc2 + // [1015] rom_size_strings[rom_detect::$14] = rom_detect::$26 -- qbuc1_derefidx_vbum1=pbuc2 lda #rom_detect__26 sta rom_size_strings+1,y // rom_sizes[rom_chip] = 128 * 1024 - // [982] rom_detect::$15 = rom_detect::rom_chip#10 << 2 -- vbuz1=vbum2_rol_2 + // [1016] rom_detect::$15 = rom_detect::rom_chip#10 << 2 -- vbuaa=vbum1_rol_2 lda rom_chip asl asl - sta.z rom_detect__15 - // [983] rom_sizes[rom_detect::$15] = (unsigned long)$80*$400 -- pduc1_derefidx_vbuz1=vduc2 + // [1017] rom_sizes[rom_detect::$15] = (unsigned long)$80*$400 -- pduc1_derefidx_vbuaa=vduc2 tay lda #<$80*$400 sta rom_sizes,y @@ -6600,9 +6526,10 @@ rom_detect: { .byte 0 rom_detect__32: .text "000" .byte 0 - .label rom_detect__3 = fclose.fclose__1 - .label rom_detect__5 = fclose.fclose__1 - .label rom_chip = main.check_status_vera4_main__0 + rom_detect__14: .byte 0 + rom_detect__24: .byte 0 + .label rom_chip = main_vera_flash.spi_ensure_detect + .label rom_detect_address = main.rom_differences } .segment Code // display_chip_rom @@ -6611,37 +6538,33 @@ rom_detect: { * */ display_chip_rom: { - .label display_chip_rom__4 = $77 - .label display_chip_rom__6 = $cc - .label display_chip_rom__11 = $ed - .label display_chip_rom__12 = $ed - // [985] phi from display_chip_rom to display_chip_rom::@1 [phi:display_chip_rom->display_chip_rom::@1] - // [985] phi display_chip_rom::r#2 = 0 [phi:display_chip_rom->display_chip_rom::@1#0] -- vbum1=vbuc1 + // [1019] phi from display_chip_rom to display_chip_rom::@1 [phi:display_chip_rom->display_chip_rom::@1] + // [1019] phi display_chip_rom::r#2 = 0 [phi:display_chip_rom->display_chip_rom::@1#0] -- vbum1=vbuc1 lda #0 sta r // display_chip_rom::@1 __b1: // for (unsigned char r = 0; r < 8; r++) - // [986] if(display_chip_rom::r#2<8) goto display_chip_rom::@2 -- vbum1_lt_vbuc1_then_la1 + // [1020] if(display_chip_rom::r#2<8) goto display_chip_rom::@2 -- vbum1_lt_vbuc1_then_la1 lda r cmp #8 bcc __b2 // display_chip_rom::@return // } - // [987] return + // [1021] return rts - // [988] phi from display_chip_rom::@1 to display_chip_rom::@2 [phi:display_chip_rom::@1->display_chip_rom::@2] + // [1022] phi from display_chip_rom::@1 to display_chip_rom::@2 [phi:display_chip_rom::@1->display_chip_rom::@2] // display_chip_rom::@2 __b2: // strcpy(rom, "ROM ") - // [989] call strcpy - // [863] phi from display_chip_rom::@2 to strcpy [phi:display_chip_rom::@2->strcpy] - // [863] phi strcpy::dst#0 = display_chip_rom::rom [phi:display_chip_rom::@2->strcpy#0] -- pbuz1=pbuc1 + // [1023] call strcpy + // [890] phi from display_chip_rom::@2 to strcpy [phi:display_chip_rom::@2->strcpy] + // [890] phi strcpy::dst#0 = display_chip_rom::rom [phi:display_chip_rom::@2->strcpy#0] -- pbuz1=pbuc1 lda #rom sta.z strcpy.dst+1 - // [863] phi strcpy::src#0 = display_chip_rom::source [phi:display_chip_rom::@2->strcpy#1] -- pbuz1=pbuc1 + // [890] phi strcpy::src#0 = display_chip_rom::source [phi:display_chip_rom::@2->strcpy#1] -- pbuz1=pbuc1 lda #source @@ -6649,170 +6572,410 @@ display_chip_rom: { jsr strcpy // display_chip_rom::@5 // strcat(rom, rom_size_strings[r]) - // [990] display_chip_rom::$11 = display_chip_rom::r#2 << 1 -- vbuz1=vbum2_rol_1 + // [1024] display_chip_rom::$11 = display_chip_rom::r#2 << 1 -- vbum1=vbum2_rol_1 lda r asl - sta.z display_chip_rom__11 - // [991] strcat::source#0 = rom_size_strings[display_chip_rom::$11] -- pbuz1=qbuc1_derefidx_vbuz2 + sta display_chip_rom__11 + // [1025] strcat::source#0 = rom_size_strings[display_chip_rom::$11] -- pbuz1=qbuc1_derefidx_vbum2 tay lda rom_size_strings,y sta.z strcat.source lda rom_size_strings+1,y sta.z strcat.source+1 - // [992] call strcat - // [2065] phi from display_chip_rom::@5 to strcat [phi:display_chip_rom::@5->strcat] + // [1026] call strcat + // [2250] phi from display_chip_rom::@5 to strcat [phi:display_chip_rom::@5->strcat] jsr strcat // display_chip_rom::@6 // if(r) - // [993] if(0==display_chip_rom::r#2) goto display_chip_rom::@3 -- 0_eq_vbum1_then_la1 + // [1027] if(0==display_chip_rom::r#2) goto display_chip_rom::@3 -- 0_eq_vbum1_then_la1 lda r beq __b3 // display_chip_rom::@4 // r+'0' - // [994] display_chip_rom::$4 = display_chip_rom::r#2 + '0' -- vbuz1=vbum2_plus_vbuc1 + // [1028] display_chip_rom::$4 = display_chip_rom::r#2 + '0' -- vbuaa=vbum1_plus_vbuc1 lda #'0' clc adc r - sta.z display_chip_rom__4 // *(rom+3) = r+'0' - // [995] *(display_chip_rom::rom+3) = display_chip_rom::$4 -- _deref_pbuc1=vbuz1 + // [1029] *(display_chip_rom::rom+3) = display_chip_rom::$4 -- _deref_pbuc1=vbuaa sta rom+3 // display_chip_rom::@3 __b3: // display_rom_led(r, GREY) - // [996] display_rom_led::chip#0 = display_chip_rom::r#2 -- vbuz1=vbum2 + // [1030] display_rom_led::chip#0 = display_chip_rom::r#2 -- vbuz1=vbum2 lda r sta.z display_rom_led.chip - // [997] call display_rom_led - // [2077] phi from display_chip_rom::@3 to display_rom_led [phi:display_chip_rom::@3->display_rom_led] - // [2077] phi display_rom_led::c#2 = GREY [phi:display_chip_rom::@3->display_rom_led#0] -- vbuz1=vbuc1 + // [1031] call display_rom_led + // [2262] phi from display_chip_rom::@3 to display_rom_led [phi:display_chip_rom::@3->display_rom_led] + // [2262] phi display_rom_led::c#2 = GREY [phi:display_chip_rom::@3->display_rom_led#0] -- vbuz1=vbuc1 lda #GREY sta.z display_rom_led.c - // [2077] phi display_rom_led::chip#2 = display_rom_led::chip#0 [phi:display_chip_rom::@3->display_rom_led#1] -- register_copy + // [2262] phi display_rom_led::chip#2 = display_rom_led::chip#0 [phi:display_chip_rom::@3->display_rom_led#1] -- register_copy jsr display_rom_led // display_chip_rom::@7 // r*6 - // [998] display_chip_rom::$12 = display_chip_rom::$11 + display_chip_rom::r#2 -- vbuz1=vbuz1_plus_vbum2 - lda r + // [1032] display_chip_rom::$12 = display_chip_rom::$11 + display_chip_rom::r#2 -- vbuaa=vbum1_plus_vbum2 + lda display_chip_rom__11 clc - adc.z display_chip_rom__12 - sta.z display_chip_rom__12 - // [999] display_chip_rom::$6 = display_chip_rom::$12 << 1 -- vbuz1=vbuz2_rol_1 + adc r + // [1033] display_chip_rom::$6 = display_chip_rom::$12 << 1 -- vbuaa=vbuaa_rol_1 asl - sta.z display_chip_rom__6 // display_print_chip(CHIP_ROM_X+r*6, CHIP_ROM_Y+2, CHIP_ROM_W, rom) - // [1000] display_print_chip::x#2 = $14 + display_chip_rom::$6 -- vbuz1=vbuc1_plus_vbuz1 - lda #$14 + // [1034] display_print_chip::x#2 = $14 + display_chip_rom::$6 -- vbuz1=vbuc1_plus_vbuaa clc - adc.z display_print_chip.x + adc #$14 sta.z display_print_chip.x - // [1001] call display_print_chip - // [1995] phi from display_chip_rom::@7 to display_print_chip [phi:display_chip_rom::@7->display_print_chip] - // [1995] phi display_print_chip::text#11 = display_chip_rom::rom [phi:display_chip_rom::@7->display_print_chip#0] -- pbuz1=pbuc1 + // [1035] call display_print_chip + // [2175] phi from display_chip_rom::@7 to display_print_chip [phi:display_chip_rom::@7->display_print_chip] + // [2175] phi display_print_chip::text#11 = display_chip_rom::rom [phi:display_chip_rom::@7->display_print_chip#0] -- pbuz1=pbuc1 lda #rom sta.z display_print_chip.text_2+1 - // [1995] phi display_print_chip::w#10 = 3 [phi:display_chip_rom::@7->display_print_chip#1] -- vbum1=vbuc1 + // [2175] phi display_print_chip::w#10 = 3 [phi:display_chip_rom::@7->display_print_chip#1] -- vbum1=vbuc1 lda #3 sta display_print_chip.w - // [1995] phi display_print_chip::x#10 = display_print_chip::x#2 [phi:display_chip_rom::@7->display_print_chip#2] -- register_copy + // [2175] phi display_print_chip::x#10 = display_print_chip::x#2 [phi:display_chip_rom::@7->display_print_chip#2] -- register_copy jsr display_print_chip // display_chip_rom::@8 // for (unsigned char r = 0; r < 8; r++) - // [1002] display_chip_rom::r#1 = ++ display_chip_rom::r#2 -- vbum1=_inc_vbum1 + // [1036] display_chip_rom::r#1 = ++ display_chip_rom::r#2 -- vbum1=_inc_vbum1 inc r - // [985] phi from display_chip_rom::@8 to display_chip_rom::@1 [phi:display_chip_rom::@8->display_chip_rom::@1] - // [985] phi display_chip_rom::r#2 = display_chip_rom::r#1 [phi:display_chip_rom::@8->display_chip_rom::@1#0] -- register_copy + // [1019] phi from display_chip_rom::@8 to display_chip_rom::@1 [phi:display_chip_rom::@8->display_chip_rom::@1] + // [1019] phi display_chip_rom::r#2 = display_chip_rom::r#1 [phi:display_chip_rom::@8->display_chip_rom::@1#0] -- register_copy jmp __b1 .segment Data rom: .fill $10, 0 source: .text "ROM " .byte 0 - .label r = check_status_roms.return + .label r = main_vera_flash.spi_ensure_detect_1 + display_chip_rom__11: .byte 0 } .segment Code - // smc_supported_rom + // display_progress_clear /** - * @brief Search in the smc file header for supported ROM.BIN releases. - * The first 3 bytes of the smc file header contain the SMC.BIN version, major and minor numbers. - * - * @param rom_release The ROM release to search for. - * @return unsigned char true if found. + * @brief Clean the progress area for the flashing. */ -// __mem() char smc_supported_rom(__zp($38) char rom_release) -smc_supported_rom: { - .label i = $e7 - .label rom_release = $38 - // [1004] phi from smc_supported_rom to smc_supported_rom::@1 [phi:smc_supported_rom->smc_supported_rom::@1] - // [1004] phi smc_supported_rom::i#2 = $1f [phi:smc_supported_rom->smc_supported_rom::@1#0] -- vbuz1=vbuc1 - lda #$1f - sta.z i - // smc_supported_rom::@1 +display_progress_clear: { + .const h = PROGRESS_Y+PROGRESS_H + .label x = $bd + .label i = $b4 + .label y = $d3 + // textcolor(WHITE) + // [1038] call textcolor + // [787] phi from display_progress_clear to textcolor [phi:display_progress_clear->textcolor] + // [787] phi textcolor::color#23 = WHITE [phi:display_progress_clear->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE + jsr textcolor + // [1039] phi from display_progress_clear to display_progress_clear::@5 [phi:display_progress_clear->display_progress_clear::@5] + // display_progress_clear::@5 + // bgcolor(BLUE) + // [1040] call bgcolor + // [792] phi from display_progress_clear::@5 to bgcolor [phi:display_progress_clear::@5->bgcolor] + // [792] phi bgcolor::color#15 = BLUE [phi:display_progress_clear::@5->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE + jsr bgcolor + // [1041] phi from display_progress_clear::@5 to display_progress_clear::@1 [phi:display_progress_clear::@5->display_progress_clear::@1] + // [1041] phi display_progress_clear::y#2 = PROGRESS_Y [phi:display_progress_clear::@5->display_progress_clear::@1#0] -- vbuz1=vbuc1 + lda #PROGRESS_Y + sta.z y + // display_progress_clear::@1 __b1: - // for(unsigned char i=31; i>3; i--) - // [1005] if(smc_supported_rom::i#2>=3+1) goto smc_supported_rom::@2 -- vbuz1_ge_vbuc1_then_la1 - lda.z i - cmp #3+1 - bcs __b2 - // [1007] phi from smc_supported_rom::@1 to smc_supported_rom::@return [phi:smc_supported_rom::@1->smc_supported_rom::@return] - // [1007] phi smc_supported_rom::return#2 = 0 [phi:smc_supported_rom::@1->smc_supported_rom::@return#0] -- vbum1=vbuc1 - lda #0 - sta return - rts - // smc_supported_rom::@2 - __b2: - // if(smc_file_header[i] == rom_release) - // [1006] if(smc_file_header[smc_supported_rom::i#2]!=smc_supported_rom::rom_release#0) goto smc_supported_rom::@3 -- pbuc1_derefidx_vbuz1_neq_vbuz2_then_la1 - lda.z rom_release - ldy.z i - cmp smc_file_header,y - bne __b3 - // [1007] phi from smc_supported_rom::@2 to smc_supported_rom::@return [phi:smc_supported_rom::@2->smc_supported_rom::@return] - // [1007] phi smc_supported_rom::return#2 = 1 [phi:smc_supported_rom::@2->smc_supported_rom::@return#0] -- vbum1=vbuc1 - lda #1 - sta return - // smc_supported_rom::@return + // while (y < h) + // [1042] if(display_progress_clear::y#23; i--) - // [1009] smc_supported_rom::i#1 = -- smc_supported_rom::i#2 -- vbuz1=_dec_vbuz1 - dec.z i - // [1004] phi from smc_supported_rom::@3 to smc_supported_rom::@1 [phi:smc_supported_rom::@3->smc_supported_rom::@1] - // [1004] phi smc_supported_rom::i#2 = smc_supported_rom::i#1 [phi:smc_supported_rom::@3->smc_supported_rom::@1#0] -- register_copy + // [1044] phi from display_progress_clear::@1 to display_progress_clear::@2 [phi:display_progress_clear::@1->display_progress_clear::@2] + __b4: + // [1044] phi display_progress_clear::x#2 = PROGRESS_X [phi:display_progress_clear::@1->display_progress_clear::@2#0] -- vbuz1=vbuc1 + lda #PROGRESS_X + sta.z x + // [1044] phi display_progress_clear::i#2 = 0 [phi:display_progress_clear::@1->display_progress_clear::@2#1] -- vbuz1=vbuc1 + lda #0 + sta.z i + // display_progress_clear::@2 + __b2: + // for(unsigned char i = 0; i < w; i++) + // [1045] if(display_progress_clear::i#2display_progress_clear::@1] + // [1041] phi display_progress_clear::y#2 = display_progress_clear::y#1 [phi:display_progress_clear::@4->display_progress_clear::@1#0] -- register_copy jmp __b1 - .segment Data - return: .byte 0 + // display_progress_clear::@3 + __b3: + // cputcxy(x, y, ' ') + // [1047] cputcxy::x#12 = display_progress_clear::x#2 -- vbuyy=vbuz1 + ldy.z x + // [1048] cputcxy::y#12 = display_progress_clear::y#2 -- vbuaa=vbuz1 + lda.z y + // [1049] call cputcxy + // [2273] phi from display_progress_clear::@3 to cputcxy [phi:display_progress_clear::@3->cputcxy] + // [2273] phi cputcxy::c#17 = ' ' [phi:display_progress_clear::@3->cputcxy#0] -- vbuxx=vbuc1 + ldx #' ' + // [2273] phi cputcxy::y#17 = cputcxy::y#12 [phi:display_progress_clear::@3->cputcxy#1] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#12 [phi:display_progress_clear::@3->cputcxy#2] -- register_copy + jsr cputcxy + // display_progress_clear::@6 + // x++; + // [1050] display_progress_clear::x#1 = ++ display_progress_clear::x#2 -- vbuz1=_inc_vbuz1 + inc.z x + // for(unsigned char i = 0; i < w; i++) + // [1051] display_progress_clear::i#1 = ++ display_progress_clear::i#2 -- vbuz1=_inc_vbuz1 + inc.z i + // [1044] phi from display_progress_clear::@6 to display_progress_clear::@2 [phi:display_progress_clear::@6->display_progress_clear::@2] + // [1044] phi display_progress_clear::x#2 = display_progress_clear::x#1 [phi:display_progress_clear::@6->display_progress_clear::@2#0] -- register_copy + // [1044] phi display_progress_clear::i#2 = display_progress_clear::i#1 [phi:display_progress_clear::@6->display_progress_clear::@2#1] -- register_copy + jmp __b2 } -.segment Code - // strncmp -/// Compares at most the first n bytes of str1 and str2. -/// @param str1 This is the first string to be compared. -/// @param str2 This is the second string to be compared. -/// @param The maximum number of characters to be compared. -/// @return if Return value < 0 then it indicates str1 is less than str2. -/// if Return value > 0 then it indicates str2 is less than str1. -/// if Return value = 0 then it indicates str1 is equal to str2. -// __mem() int strncmp(const char *str1, const char *str2, __mem() unsigned int n) -strncmp: { - .label strncmp__0 = $dd - .label s1 = $c7 - .label s2 = $aa - // [1011] phi from strncmp to strncmp::@1 [phi:strncmp->strncmp::@1] - // [1011] phi strncmp::n#2 = 7 [phi:strncmp->strncmp::@1#0] -- vwum1=vbuc1 - lda #<7 - sta n - lda #>7 +.segment CodeVera + // main_vera_check +main_vera_check: { + .label vera_bytes_read = $a9 + // display_action_progress("Checking VERA.BIN ...") + // [1053] call display_action_progress + // [1155] phi from main_vera_check to display_action_progress [phi:main_vera_check->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main_vera_check::info_text [phi:main_vera_check->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text + sta.z display_action_progress.info_text+1 + jsr display_action_progress + // [1054] phi from main_vera_check to main_vera_check::@4 [phi:main_vera_check->main_vera_check::@4] + // main_vera_check::@4 + // unsigned long vera_bytes_read = w25q16_read(STATUS_CHECKING) + // [1055] call w25q16_read + // Read the VERA.BIN file. + // [2281] phi from main_vera_check::@4 to w25q16_read [phi:main_vera_check::@4->w25q16_read] + // [2281] phi __errno#105 = __errno#113 [phi:main_vera_check::@4->w25q16_read#0] -- register_copy + // [2281] phi __stdio_filecount#100 = __stdio_filecount#109 [phi:main_vera_check::@4->w25q16_read#1] -- register_copy + // [2281] phi w25q16_read::info_status#12 = STATUS_CHECKING [phi:main_vera_check::@4->w25q16_read#2] -- vbum1=vbuc1 + lda #STATUS_CHECKING + sta w25q16_read.info_status + jsr w25q16_read + // unsigned long vera_bytes_read = w25q16_read(STATUS_CHECKING) + // [1056] w25q16_read::return#2 = w25q16_read::return#0 + // main_vera_check::@5 + // [1057] main_vera_check::vera_bytes_read#0 = w25q16_read::return#2 + // wait_moment(10) + // [1058] call wait_moment + // [1134] phi from main_vera_check::@5 to wait_moment [phi:main_vera_check::@5->wait_moment] + // [1134] phi wait_moment::w#17 = $a [phi:main_vera_check::@5->wait_moment#0] -- vbuz1=vbuc1 + lda #$a + sta.z wait_moment.w + jsr wait_moment + // main_vera_check::@6 + // if (!vera_bytes_read) + // [1059] if(0==main_vera_check::vera_bytes_read#0) goto main_vera_check::@1 -- 0_eq_vduz1_then_la1 + // In case no file was found, set the status to none and skip to the next, else, mention the amount of bytes read. + lda.z vera_bytes_read + ora.z vera_bytes_read+1 + ora.z vera_bytes_read+2 + ora.z vera_bytes_read+3 + beq __b1 + // main_vera_check::@3 + // vera_file_size = vera_bytes_read + // [1060] vera_file_size#0 = main_vera_check::vera_bytes_read#0 -- vdum1=vduz2 + // VF5 | VERA.BIN all ok | Display the VERA.BIN release version and github commit id (if any) and set VERA to Flash | Flash + // We know the file size, so we indicate it in the status panel. + lda.z vera_bytes_read + sta vera_file_size + lda.z vera_bytes_read+1 + sta vera_file_size+1 + lda.z vera_bytes_read+2 + sta vera_file_size+2 + lda.z vera_bytes_read+3 + sta vera_file_size+3 + // sprintf(info_text, "VERA.BIN:%s", "") + // [1061] call snprintf_init + // [1184] phi from main_vera_check::@3 to snprintf_init [phi:main_vera_check::@3->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:main_vera_check::@3->snprintf_init#0] -- pbuz1=pbuc1 + lda #<@info_text + sta.z snprintf_init.s + lda #>@info_text + sta.z snprintf_init.s+1 + jsr snprintf_init + // [1062] phi from main_vera_check::@3 to main_vera_check::@7 [phi:main_vera_check::@3->main_vera_check::@7] + // main_vera_check::@7 + // sprintf(info_text, "VERA.BIN:%s", "") + // [1063] call printf_str + // [1125] phi from main_vera_check::@7 to printf_str [phi:main_vera_check::@7->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main_vera_check::@7->printf_str#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_str.putc+1 + // [1125] phi printf_str::s#79 = main_vera_check::s [phi:main_vera_check::@7->printf_str#1] -- pbuz1=pbuc1 + lda #s + sta.z printf_str.s+1 + jsr printf_str + // [1064] phi from main_vera_check::@7 to main_vera_check::@8 [phi:main_vera_check::@7->main_vera_check::@8] + // main_vera_check::@8 + // sprintf(info_text, "VERA.BIN:%s", "") + // [1065] call printf_string + // [1419] phi from main_vera_check::@8 to printf_string [phi:main_vera_check::@8->printf_string] + // [1419] phi printf_string::putc#26 = &snputc [phi:main_vera_check::@8->printf_string#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_string.putc+1 + // [1419] phi printf_string::str#26 = str [phi:main_vera_check::@8->printf_string#1] -- pbuz1=pbuc1 + lda #str + sta.z printf_string.str+1 + // [1419] phi printf_string::format_justify_left#26 = 0 [phi:main_vera_check::@8->printf_string#2] -- vbum1=vbuc1 + lda #0 + sta printf_string.format_justify_left + // [1419] phi printf_string::format_min_length#26 = 0 [phi:main_vera_check::@8->printf_string#3] -- vbum1=vbuc1 + sta printf_string.format_min_length + jsr printf_string + // main_vera_check::@9 + // sprintf(info_text, "VERA.BIN:%s", "") + // [1066] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + lda #0 + pha + // [1067] callexecute snputc -- call_vprc1 + jsr snputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // display_info_vera(STATUS_FLASH, info_text) + // [1069] call display_info_vera + // [1930] phi from main_vera_check::@9 to display_info_vera [phi:main_vera_check::@9->display_info_vera] + // [1930] phi display_info_vera::info_text#15 = info_text [phi:main_vera_check::@9->display_info_vera#0] -- pbuz1=pbuc1 + lda #<@info_text + sta.z display_info_vera.info_text + lda #>@info_text + sta.z display_info_vera.info_text+1 + // [1930] phi display_info_vera::info_status#15 = STATUS_FLASH [phi:main_vera_check::@9->display_info_vera#1] -- vbum1=vbuc1 + lda #STATUS_FLASH + sta display_info_vera.info_status + jsr display_info_vera + // [1070] phi from main_vera_check::@9 to main_vera_check::@2 [phi:main_vera_check::@9->main_vera_check::@2] + // [1070] phi vera_file_size#1 = vera_file_size#0 [phi:main_vera_check::@9->main_vera_check::@2#0] -- register_copy + // main_vera_check::@2 + // main_vera_check::@return + // } + // [1071] return + rts + // [1072] phi from main_vera_check::@6 to main_vera_check::@1 [phi:main_vera_check::@6->main_vera_check::@1] + // main_vera_check::@1 + __b1: + // display_info_vera(STATUS_SKIP, "No VERA.BIN") + // [1073] call display_info_vera + // VF1 | no VERA.BIN | Ask the user to place the VERA.BIN file onto the SDcard. Set VERA to Issue. | Issue + // VF2 | VERA.BIN size 0 | Ask the user to place a correct VERA.BIN file onto the SDcard. Set VERA to Issue. | Issue + // TODO: VF4 | ROM.BIN size over 0x20000 | Ask the user to place a correct VERA.BIN file onto the SDcard. Set VERA to Issue. | Issue + // [1930] phi from main_vera_check::@1 to display_info_vera [phi:main_vera_check::@1->display_info_vera] + // [1930] phi display_info_vera::info_text#15 = main_vera_check::info_text1 [phi:main_vera_check::@1->display_info_vera#0] -- pbuz1=pbuc1 + lda #info_text1 + sta.z display_info_vera.info_text+1 + // [1930] phi display_info_vera::info_status#15 = STATUS_SKIP [phi:main_vera_check::@1->display_info_vera#1] -- vbum1=vbuc1 + lda #STATUS_SKIP + sta display_info_vera.info_status + jsr display_info_vera + // [1070] phi from main_vera_check::@1 to main_vera_check::@2 [phi:main_vera_check::@1->main_vera_check::@2] + // [1070] phi vera_file_size#1 = 0 [phi:main_vera_check::@1->main_vera_check::@2#0] -- vdum1=vduc1 + lda #<0 + sta vera_file_size + sta vera_file_size+1 + lda #<0>>$10 + sta vera_file_size+2 + lda #>0>>$10 + sta vera_file_size+3 + rts + .segment Data + info_text: .text "Checking VERA.BIN ..." + .byte 0 + info_text1: .text "No VERA.BIN" + .byte 0 + s: .text "VERA.BIN:" + .byte 0 +} +.segment Code + // smc_supported_rom +/** + * @brief Search in the smc file header for supported ROM.BIN releases. + * The first 3 bytes of the smc file header contain the SMC.BIN version, major and minor numbers. + * + * @param rom_release The ROM release to search for. + * @return unsigned char true if found. + */ +// __register(A) char smc_supported_rom(__register(A) char rom_release) +smc_supported_rom: { + // [1075] phi from smc_supported_rom to smc_supported_rom::@1 [phi:smc_supported_rom->smc_supported_rom::@1] + // [1075] phi smc_supported_rom::i#2 = $1f [phi:smc_supported_rom->smc_supported_rom::@1#0] -- vbuyy=vbuc1 + ldy #$1f + // smc_supported_rom::@1 + __b1: + // for(unsigned char i=31; i>3; i--) + // [1076] if(smc_supported_rom::i#2>=3+1) goto smc_supported_rom::@2 -- vbuyy_ge_vbuc1_then_la1 + cpy #3+1 + bcs __b2 + // [1078] phi from smc_supported_rom::@1 to smc_supported_rom::@return [phi:smc_supported_rom::@1->smc_supported_rom::@return] + // [1078] phi smc_supported_rom::return#2 = 0 [phi:smc_supported_rom::@1->smc_supported_rom::@return#0] -- vbuaa=vbuc1 + lda #0 + rts + // smc_supported_rom::@2 + __b2: + // if(smc_file_header[i] == rom_release) + // [1077] if(smc_file_header[smc_supported_rom::i#2]!=smc_supported_rom::rom_release#0) goto smc_supported_rom::@3 -- pbuc1_derefidx_vbuyy_neq_vbuaa_then_la1 + cmp smc_file_header,y + bne __b3 + // [1078] phi from smc_supported_rom::@2 to smc_supported_rom::@return [phi:smc_supported_rom::@2->smc_supported_rom::@return] + // [1078] phi smc_supported_rom::return#2 = 1 [phi:smc_supported_rom::@2->smc_supported_rom::@return#0] -- vbuaa=vbuc1 + lda #1 + // smc_supported_rom::@return + // } + // [1079] return + rts + // smc_supported_rom::@3 + __b3: + // for(unsigned char i=31; i>3; i--) + // [1080] smc_supported_rom::i#1 = -- smc_supported_rom::i#2 -- vbuyy=_dec_vbuyy + dey + // [1075] phi from smc_supported_rom::@3 to smc_supported_rom::@1 [phi:smc_supported_rom::@3->smc_supported_rom::@1] + // [1075] phi smc_supported_rom::i#2 = smc_supported_rom::i#1 [phi:smc_supported_rom::@3->smc_supported_rom::@1#0] -- register_copy + jmp __b1 +} + // strncmp +/// Compares at most the first n bytes of str1 and str2. +/// @param str1 This is the first string to be compared. +/// @param str2 This is the second string to be compared. +/// @param The maximum number of characters to be compared. +/// @return if Return value < 0 then it indicates str1 is less than str2. +/// if Return value > 0 then it indicates str2 is less than str1. +/// if Return value = 0 then it indicates str1 is equal to str2. +// __mem() int strncmp(const char *str1, const char *str2, __mem() unsigned int n) +strncmp: { + .label s1 = $ad + .label s2 = $67 + // [1082] phi from strncmp to strncmp::@1 [phi:strncmp->strncmp::@1] + // [1082] phi strncmp::n#2 = 7 [phi:strncmp->strncmp::@1#0] -- vwum1=vbuc1 + lda #<7 + sta n + lda #>7 sta n+1 - // [1011] phi strncmp::s2#2 = rom_file_github [phi:strncmp->strncmp::@1#1] -- pbuz1=pbuc1 + // [1082] phi strncmp::s2#2 = rom_file_github [phi:strncmp->strncmp::@1#1] -- pbuz1=pbuc1 lda #rom_file_github sta.z s2+1 - // [1011] phi strncmp::s1#2 = rom_github [phi:strncmp->strncmp::@1#2] -- pbuz1=pbuc1 + // [1082] phi strncmp::s1#2 = rom_github [phi:strncmp->strncmp::@1#2] -- pbuz1=pbuc1 lda #rom_github @@ -6820,80 +6983,79 @@ strncmp: { // strncmp::@1 __b1: // while(*s1==*s2) - // [1012] if(*strncmp::s1#2==*strncmp::s2#2) goto strncmp::@2 -- _deref_pbuz1_eq__deref_pbuz2_then_la1 + // [1083] if(*strncmp::s1#2==*strncmp::s2#2) goto strncmp::@2 -- _deref_pbuz1_eq__deref_pbuz2_then_la1 ldy #0 lda (s1),y cmp (s2),y beq __b2 // strncmp::@3 // *s1-*s2 - // [1013] strncmp::$0 = *strncmp::s1#2 - *strncmp::s2#2 -- vbuz1=_deref_pbuz2_minus__deref_pbuz3 + // [1084] strncmp::$0 = *strncmp::s1#2 - *strncmp::s2#2 -- vbuaa=_deref_pbuz1_minus__deref_pbuz2 lda (s1),y sec sbc (s2),y - sta.z strncmp__0 // return (int)(signed char)(*s1-*s2); - // [1014] strncmp::return#0 = (int)(signed char)strncmp::$0 -- vwsm1=_sword_vbsz2 + // [1085] strncmp::return#0 = (int)(signed char)strncmp::$0 -- vwsm1=_sword_vbsaa sta return ora #$7f bmi !+ tya !: sta return+1 - // [1015] phi from strncmp::@3 to strncmp::@return [phi:strncmp::@3->strncmp::@return] - // [1015] phi strncmp::return#2 = strncmp::return#0 [phi:strncmp::@3->strncmp::@return#0] -- register_copy + // [1086] phi from strncmp::@3 to strncmp::@return [phi:strncmp::@3->strncmp::@return] + // [1086] phi strncmp::return#2 = strncmp::return#0 [phi:strncmp::@3->strncmp::@return#0] -- register_copy rts - // [1015] phi from strncmp::@2 strncmp::@5 to strncmp::@return [phi:strncmp::@2/strncmp::@5->strncmp::@return] + // [1086] phi from strncmp::@2 strncmp::@5 to strncmp::@return [phi:strncmp::@2/strncmp::@5->strncmp::@return] __b3: - // [1015] phi strncmp::return#2 = 0 [phi:strncmp::@2/strncmp::@5->strncmp::@return#0] -- vwsm1=vbsc1 + // [1086] phi strncmp::return#2 = 0 [phi:strncmp::@2/strncmp::@5->strncmp::@return#0] -- vwsm1=vbsc1 lda #<0 sta return sta return+1 // strncmp::@return // } - // [1016] return + // [1087] return rts // strncmp::@2 __b2: // n--; - // [1017] strncmp::n#0 = -- strncmp::n#2 -- vwum1=_dec_vwum1 + // [1088] strncmp::n#0 = -- strncmp::n#2 -- vwum1=_dec_vwum1 lda n bne !+ dec n+1 !: dec n // if(*s1==0 || n==0) - // [1018] if(*strncmp::s1#2==0) goto strncmp::@return -- _deref_pbuz1_eq_0_then_la1 + // [1089] if(*strncmp::s1#2==0) goto strncmp::@return -- _deref_pbuz1_eq_0_then_la1 ldy #0 lda (s1),y cmp #0 beq __b3 // strncmp::@5 - // [1019] if(strncmp::n#0==0) goto strncmp::@return -- vwum1_eq_0_then_la1 + // [1090] if(strncmp::n#0==0) goto strncmp::@return -- vwum1_eq_0_then_la1 lda n ora n+1 beq __b3 // strncmp::@4 // s1++; - // [1020] strncmp::s1#1 = ++ strncmp::s1#2 -- pbuz1=_inc_pbuz1 + // [1091] strncmp::s1#1 = ++ strncmp::s1#2 -- pbuz1=_inc_pbuz1 inc.z s1 bne !+ inc.z s1+1 !: // s2++; - // [1021] strncmp::s2#1 = ++ strncmp::s2#2 -- pbuz1=_inc_pbuz1 + // [1092] strncmp::s2#1 = ++ strncmp::s2#2 -- pbuz1=_inc_pbuz1 inc.z s2 bne !+ inc.z s2+1 !: - // [1011] phi from strncmp::@4 to strncmp::@1 [phi:strncmp::@4->strncmp::@1] - // [1011] phi strncmp::n#2 = strncmp::n#0 [phi:strncmp::@4->strncmp::@1#0] -- register_copy - // [1011] phi strncmp::s2#2 = strncmp::s2#1 [phi:strncmp::@4->strncmp::@1#1] -- register_copy - // [1011] phi strncmp::s1#2 = strncmp::s1#1 [phi:strncmp::@4->strncmp::@1#2] -- register_copy + // [1082] phi from strncmp::@4 to strncmp::@1 [phi:strncmp::@4->strncmp::@1] + // [1082] phi strncmp::n#2 = strncmp::n#0 [phi:strncmp::@4->strncmp::@1#0] -- register_copy + // [1082] phi strncmp::s2#2 = strncmp::s2#1 [phi:strncmp::@4->strncmp::@1#1] -- register_copy + // [1082] phi strncmp::s1#2 = strncmp::s1#1 [phi:strncmp::@4->strncmp::@1#2] -- register_copy jmp __b1 .segment Data n: .word 0 - return: .word 0 + .label return = n } .segment Code // check_status_roms @@ -6903,143 +7065,122 @@ strncmp: { * @param status The status to be checked. * @return unsigned char true if one chip is equal to the status. */ -// __mem() char check_status_roms(__mem() char status) +// __register(A) char check_status_roms(__register(X) char status) check_status_roms: { - .label check_status_rom1_check_status_roms__0 = $29 - .label check_status_rom1_return = $29 - // [1023] phi from check_status_roms to check_status_roms::@1 [phi:check_status_roms->check_status_roms::@1] - // [1023] phi check_status_roms::rom_chip#2 = 0 [phi:check_status_roms->check_status_roms::@1#0] -- vbum1=vbuc1 - lda #0 - sta rom_chip + // [1094] phi from check_status_roms to check_status_roms::@1 [phi:check_status_roms->check_status_roms::@1] + // [1094] phi check_status_roms::rom_chip#2 = 0 [phi:check_status_roms->check_status_roms::@1#0] -- vbuyy=vbuc1 + ldy #0 // check_status_roms::@1 __b1: // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [1024] if(check_status_roms::rom_chip#2<8) goto check_status_roms::check_status_rom1 -- vbum1_lt_vbuc1_then_la1 - lda rom_chip - cmp #8 + // [1095] if(check_status_roms::rom_chip#2<8) goto check_status_roms::check_status_rom1 -- vbuyy_lt_vbuc1_then_la1 + cpy #8 bcc check_status_rom1 - // [1025] phi from check_status_roms::@1 to check_status_roms::@return [phi:check_status_roms::@1->check_status_roms::@return] - // [1025] phi check_status_roms::return#2 = 0 [phi:check_status_roms::@1->check_status_roms::@return#0] -- vbum1=vbuc1 + // [1096] phi from check_status_roms::@1 to check_status_roms::@return [phi:check_status_roms::@1->check_status_roms::@return] + // [1096] phi check_status_roms::return#2 = 0 [phi:check_status_roms::@1->check_status_roms::@return#0] -- vbuaa=vbuc1 lda #0 - sta return // check_status_roms::@return // } - // [1026] return + // [1097] return rts // check_status_roms::check_status_rom1 check_status_rom1: // status_rom[rom_chip] == status - // [1027] check_status_roms::check_status_rom1_$0 = status_rom[check_status_roms::rom_chip#2] == check_status_roms::status#6 -- vboz1=pbuc1_derefidx_vbum2_eq_vbum3 - lda status - ldy rom_chip + // [1098] check_status_roms::check_status_rom1_$0 = status_rom[check_status_roms::rom_chip#2] == check_status_roms::status#6 -- vboaa=pbuc1_derefidx_vbuyy_eq_vbuxx + txa eor status_rom,y beq !+ lda #1 !: eor #1 - sta.z check_status_rom1_check_status_roms__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [1028] check_status_roms::check_status_rom1_return#0 = (char)check_status_roms::check_status_rom1_$0 + // [1099] check_status_roms::check_status_rom1_return#0 = (char)check_status_roms::check_status_rom1_$0 // check_status_roms::@3 // if(check_status_rom(rom_chip, status)) - // [1029] if(0==check_status_roms::check_status_rom1_return#0) goto check_status_roms::@2 -- 0_eq_vbuz1_then_la1 - lda.z check_status_rom1_return + // [1100] if(0==check_status_roms::check_status_rom1_return#0) goto check_status_roms::@2 -- 0_eq_vbuaa_then_la1 + cmp #0 beq __b2 - // [1025] phi from check_status_roms::@3 to check_status_roms::@return [phi:check_status_roms::@3->check_status_roms::@return] - // [1025] phi check_status_roms::return#2 = 1 [phi:check_status_roms::@3->check_status_roms::@return#0] -- vbum1=vbuc1 + // [1096] phi from check_status_roms::@3 to check_status_roms::@return [phi:check_status_roms::@3->check_status_roms::@return] + // [1096] phi check_status_roms::return#2 = 1 [phi:check_status_roms::@3->check_status_roms::@return#0] -- vbuaa=vbuc1 lda #1 - sta return rts // check_status_roms::@2 __b2: // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [1030] check_status_roms::rom_chip#1 = ++ check_status_roms::rom_chip#2 -- vbum1=_inc_vbum1 - inc rom_chip - // [1023] phi from check_status_roms::@2 to check_status_roms::@1 [phi:check_status_roms::@2->check_status_roms::@1] - // [1023] phi check_status_roms::rom_chip#2 = check_status_roms::rom_chip#1 [phi:check_status_roms::@2->check_status_roms::@1#0] -- register_copy + // [1101] check_status_roms::rom_chip#1 = ++ check_status_roms::rom_chip#2 -- vbuyy=_inc_vbuyy + iny + // [1094] phi from check_status_roms::@2 to check_status_roms::@1 [phi:check_status_roms::@2->check_status_roms::@1] + // [1094] phi check_status_roms::rom_chip#2 = check_status_roms::rom_chip#1 [phi:check_status_roms::@2->check_status_roms::@1#0] -- register_copy jmp __b1 - .segment Data - .label rom_chip = main.check_status_vera4_main__0 - return: .byte 0 - .label status = main.check_status_smc18_main__0 } -.segment Code // clrscr // clears the screen and moves the cursor to the upper left-hand corner of the screen. clrscr: { - .label clrscr__0 = $dc - .label clrscr__1 = $38 - .label clrscr__2 = $45 // unsigned int line_text = __conio.mapbase_offset - // [1031] clrscr::line_text#0 = *((unsigned int *)&__conio+3) -- vwum1=_deref_pwuc1 + // [1102] clrscr::line_text#0 = *((unsigned int *)&__conio+3) -- vwum1=_deref_pwuc1 lda __conio+3 sta line_text lda __conio+3+1 sta line_text+1 // *VERA_CTRL &= ~VERA_ADDRSEL - // [1032] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [1103] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_ADDRSEL^$ff and VERA_CTRL sta VERA_CTRL // __conio.mapbase_bank | VERA_INC_1 - // [1033] clrscr::$0 = *((char *)&__conio+5) | VERA_INC_1 -- vbuz1=_deref_pbuc1_bor_vbuc2 + // [1104] clrscr::$0 = *((char *)&__conio+5) | VERA_INC_1 -- vbuaa=_deref_pbuc1_bor_vbuc2 lda #VERA_INC_1 ora __conio+5 - sta.z clrscr__0 // *VERA_ADDRX_H = __conio.mapbase_bank | VERA_INC_1 - // [1034] *VERA_ADDRX_H = clrscr::$0 -- _deref_pbuc1=vbuz1 + // [1105] *VERA_ADDRX_H = clrscr::$0 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_H // unsigned char l = __conio.mapheight - // [1035] clrscr::l#0 = *((char *)&__conio+9) -- vbum1=_deref_pbuc1 - lda __conio+9 - sta l - // [1036] phi from clrscr clrscr::@3 to clrscr::@1 [phi:clrscr/clrscr::@3->clrscr::@1] - // [1036] phi clrscr::l#4 = clrscr::l#0 [phi:clrscr/clrscr::@3->clrscr::@1#0] -- register_copy - // [1036] phi clrscr::ch#0 = clrscr::line_text#0 [phi:clrscr/clrscr::@3->clrscr::@1#1] -- register_copy + // [1106] clrscr::l#0 = *((char *)&__conio+9) -- vbuxx=_deref_pbuc1 + ldx __conio+9 + // [1107] phi from clrscr clrscr::@3 to clrscr::@1 [phi:clrscr/clrscr::@3->clrscr::@1] + // [1107] phi clrscr::l#4 = clrscr::l#0 [phi:clrscr/clrscr::@3->clrscr::@1#0] -- register_copy + // [1107] phi clrscr::ch#0 = clrscr::line_text#0 [phi:clrscr/clrscr::@3->clrscr::@1#1] -- register_copy // clrscr::@1 __b1: // BYTE0(ch) - // [1037] clrscr::$1 = byte0 clrscr::ch#0 -- vbuz1=_byte0_vwum2 + // [1108] clrscr::$1 = byte0 clrscr::ch#0 -- vbuaa=_byte0_vwum1 lda ch - sta.z clrscr__1 // *VERA_ADDRX_L = BYTE0(ch) - // [1038] *VERA_ADDRX_L = clrscr::$1 -- _deref_pbuc1=vbuz1 + // [1109] *VERA_ADDRX_L = clrscr::$1 -- _deref_pbuc1=vbuaa // Set address sta VERA_ADDRX_L // BYTE1(ch) - // [1039] clrscr::$2 = byte1 clrscr::ch#0 -- vbuz1=_byte1_vwum2 + // [1110] clrscr::$2 = byte1 clrscr::ch#0 -- vbuaa=_byte1_vwum1 lda ch+1 - sta.z clrscr__2 // *VERA_ADDRX_M = BYTE1(ch) - // [1040] *VERA_ADDRX_M = clrscr::$2 -- _deref_pbuc1=vbuz1 + // [1111] *VERA_ADDRX_M = clrscr::$2 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_M // unsigned char c = __conio.mapwidth+1 - // [1041] clrscr::c#0 = *((char *)&__conio+8) + 1 -- vbum1=_deref_pbuc1_plus_1 - lda __conio+8 - inc - sta c - // [1042] phi from clrscr::@1 clrscr::@2 to clrscr::@2 [phi:clrscr::@1/clrscr::@2->clrscr::@2] - // [1042] phi clrscr::c#2 = clrscr::c#0 [phi:clrscr::@1/clrscr::@2->clrscr::@2#0] -- register_copy + // [1112] clrscr::c#0 = *((char *)&__conio+8) + 1 -- vbuyy=_deref_pbuc1_plus_1 + ldy __conio+8 + iny + // [1113] phi from clrscr::@1 clrscr::@2 to clrscr::@2 [phi:clrscr::@1/clrscr::@2->clrscr::@2] + // [1113] phi clrscr::c#2 = clrscr::c#0 [phi:clrscr::@1/clrscr::@2->clrscr::@2#0] -- register_copy // clrscr::@2 __b2: // *VERA_DATA0 = ' ' - // [1043] *VERA_DATA0 = ' ' -- _deref_pbuc1=vbuc2 + // [1114] *VERA_DATA0 = ' ' -- _deref_pbuc1=vbuc2 lda #' ' sta VERA_DATA0 // *VERA_DATA0 = __conio.color - // [1044] *VERA_DATA0 = *((char *)&__conio+$d) -- _deref_pbuc1=_deref_pbuc2 + // [1115] *VERA_DATA0 = *((char *)&__conio+$d) -- _deref_pbuc1=_deref_pbuc2 lda __conio+$d sta VERA_DATA0 // c--; - // [1045] clrscr::c#1 = -- clrscr::c#2 -- vbum1=_dec_vbum1 - dec c + // [1116] clrscr::c#1 = -- clrscr::c#2 -- vbuyy=_dec_vbuyy + dey // while(c) - // [1046] if(0!=clrscr::c#1) goto clrscr::@2 -- 0_neq_vbum1_then_la1 - lda c + // [1117] if(0!=clrscr::c#1) goto clrscr::@2 -- 0_neq_vbuyy_then_la1 + cpy #0 bne __b2 // clrscr::@3 // line_text += __conio.rowskip - // [1047] clrscr::line_text#1 = clrscr::ch#0 + *((unsigned int *)&__conio+$a) -- vwum1=vwum1_plus__deref_pwuc1 + // [1118] clrscr::line_text#1 = clrscr::ch#0 + *((unsigned int *)&__conio+$a) -- vwum1=vwum1_plus__deref_pwuc1 clc lda line_text adc __conio+$a @@ -7048,109 +7189,103 @@ clrscr: { adc __conio+$a+1 sta line_text+1 // l--; - // [1048] clrscr::l#1 = -- clrscr::l#4 -- vbum1=_dec_vbum1 - dec l + // [1119] clrscr::l#1 = -- clrscr::l#4 -- vbuxx=_dec_vbuxx + dex // while(l) - // [1049] if(0!=clrscr::l#1) goto clrscr::@1 -- 0_neq_vbum1_then_la1 - lda l + // [1120] if(0!=clrscr::l#1) goto clrscr::@1 -- 0_neq_vbuxx_then_la1 + cpx #0 bne __b1 // clrscr::@4 // __conio.cursor_x = 0 - // [1050] *((char *)&__conio) = 0 -- _deref_pbuc1=vbuc2 + // [1121] *((char *)&__conio) = 0 -- _deref_pbuc1=vbuc2 lda #0 sta __conio // __conio.cursor_y = 0 - // [1051] *((char *)&__conio+1) = 0 -- _deref_pbuc1=vbuc2 + // [1122] *((char *)&__conio+1) = 0 -- _deref_pbuc1=vbuc2 sta __conio+1 // __conio.offset = __conio.mapbase_offset - // [1052] *((unsigned int *)&__conio+$13) = *((unsigned int *)&__conio+3) -- _deref_pwuc1=_deref_pwuc2 + // [1123] *((unsigned int *)&__conio+$13) = *((unsigned int *)&__conio+3) -- _deref_pwuc1=_deref_pwuc2 lda __conio+3 sta __conio+$13 lda __conio+3+1 sta __conio+$13+1 // clrscr::@return // } - // [1053] return + // [1124] return rts .segment Data - .label line_text = ch - l: .byte 0 - ch: .word 0 - c: .byte 0 + .label line_text = strncmp.n + .label ch = strncmp.n } .segment Code // printf_str /// Print a NUL-terminated string -// void printf_str(__zp($aa) void (*putc)(char), __zp($60) const char *s) +// void printf_str(__zp($67) void (*putc)(char), __zp($48) const char *s) printf_str: { - .label s = $60 - .label putc = $aa - // [1055] phi from printf_str printf_str::@2 to printf_str::@1 [phi:printf_str/printf_str::@2->printf_str::@1] - // [1055] phi printf_str::s#74 = printf_str::s#75 [phi:printf_str/printf_str::@2->printf_str::@1#0] -- register_copy + .label s = $48 + .label putc = $67 + // [1126] phi from printf_str printf_str::@2 to printf_str::@1 [phi:printf_str/printf_str::@2->printf_str::@1] + // [1126] phi printf_str::s#78 = printf_str::s#79 [phi:printf_str/printf_str::@2->printf_str::@1#0] -- register_copy // printf_str::@1 __b1: // while(c=*s++) - // [1056] printf_str::c#1 = *printf_str::s#74 -- vbum1=_deref_pbuz2 + // [1127] printf_str::c#1 = *printf_str::s#78 -- vbuaa=_deref_pbuz1 ldy #0 lda (s),y - sta c - // [1057] printf_str::s#0 = ++ printf_str::s#74 -- pbuz1=_inc_pbuz1 + // [1128] printf_str::s#0 = ++ printf_str::s#78 -- pbuz1=_inc_pbuz1 inc.z s bne !+ inc.z s+1 !: - // [1058] if(0!=printf_str::c#1) goto printf_str::@2 -- 0_neq_vbum1_then_la1 - lda c + // [1129] if(0!=printf_str::c#1) goto printf_str::@2 -- 0_neq_vbuaa_then_la1 + cmp #0 bne __b2 // printf_str::@return // } - // [1059] return + // [1130] return rts // printf_str::@2 __b2: // putc(c) - // [1060] stackpush(char) = printf_str::c#1 -- _stackpushbyte_=vbum1 - lda c + // [1131] stackpush(char) = printf_str::c#1 -- _stackpushbyte_=vbuaa pha - // [1061] callexecute *printf_str::putc#75 -- call__deref_pprz1 - jsr icall14 + // [1132] callexecute *printf_str::putc#79 -- call__deref_pprz1 + jsr icall15 // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla jmp __b1 // Outside Flow - icall14: + icall15: jmp (putc) - .segment Data - c: .byte 0 } -.segment Code // wait_moment /** * @brief * */ -// void wait_moment(__mem() char w) +// void wait_moment(__zp($7d) char w) wait_moment: { - .label i = $60 - .label j = $e7 - // [1064] phi from wait_moment to wait_moment::@1 [phi:wait_moment->wait_moment::@1] - // [1064] phi wait_moment::j#2 = 0 [phi:wait_moment->wait_moment::@1#0] -- vbuz1=vbuc1 + .label i = $48 + .label j = $71 + .label w = $7d + // [1135] phi from wait_moment to wait_moment::@1 [phi:wait_moment->wait_moment::@1] + // [1135] phi wait_moment::j#2 = 0 [phi:wait_moment->wait_moment::@1#0] -- vbuz1=vbuc1 lda #0 sta.z j // wait_moment::@1 __b1: // for(unsigned char j=0; jwait_moment::@2] + // [1138] phi from wait_moment::@1 to wait_moment::@2 [phi:wait_moment::@1->wait_moment::@2] __b4: - // [1067] phi wait_moment::i#2 = $ffff [phi:wait_moment::@1->wait_moment::@2#0] -- vwuz1=vwuc1 + // [1138] phi wait_moment::i#2 = $ffff [phi:wait_moment::@1->wait_moment::@2#0] -- vwuz1=vwuc1 lda #<$ffff sta.z i lda #>$ffff @@ -7158,7 +7293,7 @@ wait_moment: { // wait_moment::@2 __b2: // for(unsigned int i=65535; i>0; i--) - // [1068] if(wait_moment::i#2>0) goto wait_moment::@3 -- vwuz1_gt_0_then_la1 + // [1139] if(wait_moment::i#2>0) goto wait_moment::@3 -- vwuz1_gt_0_then_la1 lda.z i+1 bne __b3 lda.z i @@ -7166,27 +7301,24 @@ wait_moment: { !: // wait_moment::@4 // for(unsigned char j=0; jwait_moment::@1] - // [1064] phi wait_moment::j#2 = wait_moment::j#1 [phi:wait_moment::@4->wait_moment::@1#0] -- register_copy + // [1135] phi from wait_moment::@4 to wait_moment::@1 [phi:wait_moment::@4->wait_moment::@1] + // [1135] phi wait_moment::j#2 = wait_moment::j#1 [phi:wait_moment::@4->wait_moment::@1#0] -- register_copy jmp __b1 // wait_moment::@3 __b3: // for(unsigned int i=65535; i>0; i--) - // [1070] wait_moment::i#1 = -- wait_moment::i#2 -- vwuz1=_dec_vwuz1 + // [1141] wait_moment::i#1 = -- wait_moment::i#2 -- vwuz1=_dec_vwuz1 lda.z i bne !+ dec.z i+1 !: dec.z i - // [1067] phi from wait_moment::@3 to wait_moment::@2 [phi:wait_moment::@3->wait_moment::@2] - // [1067] phi wait_moment::i#2 = wait_moment::i#1 [phi:wait_moment::@3->wait_moment::@2#0] -- register_copy + // [1138] phi from wait_moment::@3 to wait_moment::@2 [phi:wait_moment::@3->wait_moment::@2] + // [1138] phi wait_moment::i#2 = wait_moment::i#1 [phi:wait_moment::@3->wait_moment::@2#0] -- register_copy jmp __b2 - .segment Data - .label w = check_status_roms_less.rom_chip } -.segment Code // system_reset /** * @brief @@ -7197,19 +7329,19 @@ system_reset: { .const bank_set_brom1_bank = 0 // system_reset::bank_set_bram1 // BRAM = bank - // [1072] BRAM = system_reset::bank_set_bram1_bank#0 -- vbuz1=vbuc1 + // [1143] BRAM = system_reset::bank_set_bram1_bank#0 -- vbuz1=vbuc1 lda #bank_set_bram1_bank sta.z BRAM // system_reset::bank_set_brom1 // BROM = bank - // [1073] BROM = system_reset::bank_set_brom1_bank#0 -- vbuz1=vbuc1 + // [1144] BROM = system_reset::bank_set_brom1_bank#0 -- vbuz1=vbuc1 lda #bank_set_brom1_bank sta.z BROM // system_reset::@2 // asm // asm { jmp($FFFC) } jmp ($fffc) - // [1075] phi from system_reset::@1 system_reset::@2 to system_reset::@1 [phi:system_reset::@1/system_reset::@2->system_reset::@1] + // [1146] phi from system_reset::@1 system_reset::@2 to system_reset::@1 [phi:system_reset::@1/system_reset::@2->system_reset::@1] // system_reset::@1 __b1: jmp __b1 @@ -7221,132 +7353,118 @@ system_reset: { * @param status The status to be checked. * @return unsigned char true if all chips are equal to the status. */ -// __zp($e7) char check_status_roms_less(char status) +// __register(A) char check_status_roms_less(char status) check_status_roms_less: { - .label check_status_roms_less__1 = $38 - .label return = $e7 - // [1077] phi from check_status_roms_less to check_status_roms_less::@1 [phi:check_status_roms_less->check_status_roms_less::@1] - // [1077] phi check_status_roms_less::rom_chip#2 = 0 [phi:check_status_roms_less->check_status_roms_less::@1#0] -- vbum1=vbuc1 - lda #0 - sta rom_chip + // [1148] phi from check_status_roms_less to check_status_roms_less::@1 [phi:check_status_roms_less->check_status_roms_less::@1] + // [1148] phi check_status_roms_less::rom_chip#2 = 0 [phi:check_status_roms_less->check_status_roms_less::@1#0] -- vbuxx=vbuc1 + ldx #0 // check_status_roms_less::@1 __b1: // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [1078] if(check_status_roms_less::rom_chip#2<8) goto check_status_roms_less::@2 -- vbum1_lt_vbuc1_then_la1 - lda rom_chip - cmp #8 + // [1149] if(check_status_roms_less::rom_chip#2<8) goto check_status_roms_less::@2 -- vbuxx_lt_vbuc1_then_la1 + cpx #8 bcc __b2 - // [1081] phi from check_status_roms_less::@1 to check_status_roms_less::@return [phi:check_status_roms_less::@1->check_status_roms_less::@return] - // [1081] phi check_status_roms_less::return#2 = 1 [phi:check_status_roms_less::@1->check_status_roms_less::@return#0] -- vbuz1=vbuc1 + // [1152] phi from check_status_roms_less::@1 to check_status_roms_less::@return [phi:check_status_roms_less::@1->check_status_roms_less::@return] + // [1152] phi check_status_roms_less::return#2 = 1 [phi:check_status_roms_less::@1->check_status_roms_less::@return#0] -- vbuaa=vbuc1 lda #1 - sta.z return rts // check_status_roms_less::@2 __b2: // status_rom[rom_chip] > status - // [1079] check_status_roms_less::$1 = status_rom[check_status_roms_less::rom_chip#2] > STATUS_SKIP -- vboz1=pbuc1_derefidx_vbum2_gt_vbuc2 - ldy rom_chip - lda status_rom,y + // [1150] check_status_roms_less::$1 = status_rom[check_status_roms_less::rom_chip#2] > STATUS_SKIP -- vboaa=pbuc1_derefidx_vbuxx_gt_vbuc2 + lda status_rom,x cmp #STATUS_SKIP lda #0 rol - sta.z check_status_roms_less__1 // if((unsigned char)(status_rom[rom_chip] > status)) - // [1080] if(0==(char)check_status_roms_less::$1) goto check_status_roms_less::@3 -- 0_eq_vbuz1_then_la1 + // [1151] if(0==(char)check_status_roms_less::$1) goto check_status_roms_less::@3 -- 0_eq_vbuaa_then_la1 + cmp #0 beq __b3 - // [1081] phi from check_status_roms_less::@2 to check_status_roms_less::@return [phi:check_status_roms_less::@2->check_status_roms_less::@return] - // [1081] phi check_status_roms_less::return#2 = 0 [phi:check_status_roms_less::@2->check_status_roms_less::@return#0] -- vbuz1=vbuc1 + // [1152] phi from check_status_roms_less::@2 to check_status_roms_less::@return [phi:check_status_roms_less::@2->check_status_roms_less::@return] + // [1152] phi check_status_roms_less::return#2 = 0 [phi:check_status_roms_less::@2->check_status_roms_less::@return#0] -- vbuaa=vbuc1 lda #0 - sta.z return // check_status_roms_less::@return // } - // [1082] return + // [1153] return rts // check_status_roms_less::@3 __b3: // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [1083] check_status_roms_less::rom_chip#1 = ++ check_status_roms_less::rom_chip#2 -- vbum1=_inc_vbum1 - inc rom_chip - // [1077] phi from check_status_roms_less::@3 to check_status_roms_less::@1 [phi:check_status_roms_less::@3->check_status_roms_less::@1] - // [1077] phi check_status_roms_less::rom_chip#2 = check_status_roms_less::rom_chip#1 [phi:check_status_roms_less::@3->check_status_roms_less::@1#0] -- register_copy + // [1154] check_status_roms_less::rom_chip#1 = ++ check_status_roms_less::rom_chip#2 -- vbuxx=_inc_vbuxx + inx + // [1148] phi from check_status_roms_less::@3 to check_status_roms_less::@1 [phi:check_status_roms_less::@3->check_status_roms_less::@1] + // [1148] phi check_status_roms_less::rom_chip#2 = check_status_roms_less::rom_chip#1 [phi:check_status_roms_less::@3->check_status_roms_less::@1#0] -- register_copy jmp __b1 - .segment Data - rom_chip: .byte 0 } -.segment Code // display_action_progress /** * @brief Print the progress at the action frame, which is the first line. * * @param info_text The progress text to be displayed. */ -// void display_action_progress(__zp($60) char *info_text) +// void display_action_progress(__zp($48) char *info_text) display_action_progress: { - .label x = $45 - .label info_text = $60 + .label info_text = $48 // unsigned char x = wherex() - // [1085] call wherex + // [1156] call wherex jsr wherex - // [1086] wherex::return#2 = wherex::return#0 + // [1157] wherex::return#2 = wherex::return#0 // display_action_progress::@1 - // [1087] display_action_progress::x#0 = wherex::return#2 -- vbuz1=vbum2 - lda wherex.return - sta.z x + // [1158] display_action_progress::x#0 = wherex::return#2 -- vbum1=vbuaa + sta x // unsigned char y = wherey() - // [1088] call wherey + // [1159] call wherey jsr wherey - // [1089] wherey::return#2 = wherey::return#0 + // [1160] wherey::return#2 = wherey::return#0 // display_action_progress::@2 - // [1090] display_action_progress::y#0 = wherey::return#2 -- vbum1=vbum2 - lda wherey.return + // [1161] display_action_progress::y#0 = wherey::return#2 -- vbum1=vbuaa sta y // gotoxy(2, PROGRESS_Y-4) - // [1091] call gotoxy - // [778] phi from display_action_progress::@2 to gotoxy [phi:display_action_progress::@2->gotoxy] - // [778] phi gotoxy::y#33 = PROGRESS_Y-4 [phi:display_action_progress::@2->gotoxy#0] -- vbum1=vbuc1 + // [1162] call gotoxy + // [805] phi from display_action_progress::@2 to gotoxy [phi:display_action_progress::@2->gotoxy] + // [805] phi gotoxy::y#37 = PROGRESS_Y-4 [phi:display_action_progress::@2->gotoxy#0] -- vbum1=vbuc1 lda #PROGRESS_Y-4 sta gotoxy.y - // [778] phi gotoxy::x#33 = 2 [phi:display_action_progress::@2->gotoxy#1] -- vbum1=vbuc1 - lda #2 - sta gotoxy.x + // [805] phi gotoxy::x#37 = 2 [phi:display_action_progress::@2->gotoxy#1] -- vbuyy=vbuc1 + ldy #2 jsr gotoxy // display_action_progress::@3 // printf("%-65s", info_text) - // [1092] printf_string::str#1 = display_action_progress::info_text#20 - // [1093] call printf_string - // [1227] phi from display_action_progress::@3 to printf_string [phi:display_action_progress::@3->printf_string] - // [1227] phi printf_string::putc#25 = &cputc [phi:display_action_progress::@3->printf_string#0] -- pprz1=pprc1 + // [1163] printf_string::str#1 = display_action_progress::info_text#30 + // [1164] call printf_string + // [1419] phi from display_action_progress::@3 to printf_string [phi:display_action_progress::@3->printf_string] + // [1419] phi printf_string::putc#26 = &cputc [phi:display_action_progress::@3->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#1 [phi:display_action_progress::@3->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 1 [phi:display_action_progress::@3->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#1 [phi:display_action_progress::@3->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 1 [phi:display_action_progress::@3->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = $41 [phi:display_action_progress::@3->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = $41 [phi:display_action_progress::@3->printf_string#3] -- vbum1=vbuc1 lda #$41 sta printf_string.format_min_length jsr printf_string // display_action_progress::@4 // gotoxy(x, y) - // [1094] gotoxy::x#10 = display_action_progress::x#0 -- vbum1=vbuz2 - lda.z x - sta gotoxy.x - // [1095] gotoxy::y#10 = display_action_progress::y#0 -- vbum1=vbum2 + // [1165] gotoxy::x#10 = display_action_progress::x#0 -- vbuyy=vbum1 + ldy x + // [1166] gotoxy::y#10 = display_action_progress::y#0 -- vbum1=vbum2 lda y sta gotoxy.y - // [1096] call gotoxy - // [778] phi from display_action_progress::@4 to gotoxy [phi:display_action_progress::@4->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#10 [phi:display_action_progress::@4->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = gotoxy::x#10 [phi:display_action_progress::@4->gotoxy#1] -- register_copy + // [1167] call gotoxy + // [805] phi from display_action_progress::@4 to gotoxy [phi:display_action_progress::@4->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#10 [phi:display_action_progress::@4->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = gotoxy::x#10 [phi:display_action_progress::@4->gotoxy#1] -- register_copy jsr gotoxy // display_action_progress::@return // } - // [1097] return + // [1168] return rts .segment Data - .label y = fopen.fopen__4 + x: .byte 0 + y: .byte 0 } .segment Code // display_progress_text @@ -7356,63 +7474,58 @@ display_action_progress: { * @param text A pointer to an array of strings to be displayed (char**). * @param lines The amount of lines to be displayed, starting from the top of the progress frame. */ -// void display_progress_text(__zp($3d) char **text, __mem() char lines) +// void display_progress_text(__zp($3a) char **text, __zp($50) char lines) display_progress_text: { - .label text = $3d + .label l = $af + .label lines = $50 + .label text = $3a // display_progress_clear() - // [1099] call display_progress_clear - // [1161] phi from display_progress_text to display_progress_clear [phi:display_progress_text->display_progress_clear] + // [1170] call display_progress_clear + // [1037] phi from display_progress_text to display_progress_clear [phi:display_progress_text->display_progress_clear] jsr display_progress_clear - // [1100] phi from display_progress_text to display_progress_text::@1 [phi:display_progress_text->display_progress_text::@1] - // [1100] phi display_progress_text::l#2 = 0 [phi:display_progress_text->display_progress_text::@1#0] -- vbum1=vbuc1 + // [1171] phi from display_progress_text to display_progress_text::@1 [phi:display_progress_text->display_progress_text::@1] + // [1171] phi display_progress_text::l#2 = 0 [phi:display_progress_text->display_progress_text::@1#0] -- vbuz1=vbuc1 lda #0 - sta l + sta.z l // display_progress_text::@1 __b1: // for(unsigned char l=0; ldisplay_progress_line] - // [1108] phi display_progress_line::text#3 = display_progress_line::text#0 [phi:display_progress_text::@2->display_progress_line#0] -- register_copy - // [1108] phi display_progress_line::line#3 = display_progress_line::line#0 [phi:display_progress_text::@2->display_progress_line#1] -- register_copy + // [1177] call display_progress_line + // [1179] phi from display_progress_text::@2 to display_progress_line [phi:display_progress_text::@2->display_progress_line] + // [1179] phi display_progress_line::text#3 = display_progress_line::text#0 [phi:display_progress_text::@2->display_progress_line#0] -- register_copy + // [1179] phi display_progress_line::line#3 = display_progress_line::line#0 [phi:display_progress_text::@2->display_progress_line#1] -- register_copy jsr display_progress_line // display_progress_text::@3 // for(unsigned char l=0; ldisplay_progress_text::@1] - // [1100] phi display_progress_text::l#2 = display_progress_text::l#1 [phi:display_progress_text::@3->display_progress_text::@1#0] -- register_copy + // [1178] display_progress_text::l#1 = ++ display_progress_text::l#2 -- vbuz1=_inc_vbuz1 + inc.z l + // [1171] phi from display_progress_text::@3 to display_progress_text::@1 [phi:display_progress_text::@3->display_progress_text::@1] + // [1171] phi display_progress_text::l#2 = display_progress_text::l#1 [phi:display_progress_text::@3->display_progress_text::@1#0] -- register_copy jmp __b1 - .segment Data - .label display_progress_text__3 = fopen.fopen__4 - .label l = check_status_card_roms.return - .label lines = main.check_status_smc11_main__0 } -.segment Code // display_progress_line /** * @brief Print one line of text in the progress frame at a line position. @@ -7420,97 +7533,94 @@ display_progress_text: { * @param line The start line, counting from 0. * @param text The text to be displayed. */ -// void display_progress_line(__zp($e1) char line, __zp($b8) char *text) +// void display_progress_line(__register(X) char line, __zp($76) char *text) display_progress_line: { - .label line = $e1 - .label text = $b8 + .label text = $76 // cputsxy(PROGRESS_X, PROGRESS_Y+line, text) - // [1109] cputsxy::y#2 = PROGRESS_Y + display_progress_line::line#3 -- vbum1=vbuc1_plus_vbuz2 - lda #PROGRESS_Y + // [1180] cputsxy::y#2 = PROGRESS_Y + display_progress_line::line#3 -- vbuxx=vbuc1_plus_vbuxx + txa clc - adc.z line - sta cputsxy.y - // [1110] cputsxy::s#2 = display_progress_line::text#3 - // [1111] call cputsxy - // [1966] phi from display_progress_line to cputsxy [phi:display_progress_line->cputsxy] - // [1966] phi cputsxy::s#4 = cputsxy::s#2 [phi:display_progress_line->cputsxy#0] -- register_copy - // [1966] phi cputsxy::y#4 = cputsxy::y#2 [phi:display_progress_line->cputsxy#1] -- register_copy - // [1966] phi cputsxy::x#4 = PROGRESS_X [phi:display_progress_line->cputsxy#2] -- vbum1=vbuc1 - lda #PROGRESS_X - sta cputsxy.x + adc #PROGRESS_Y + tax + // [1181] cputsxy::s#2 = display_progress_line::text#3 + // [1182] call cputsxy + // [2146] phi from display_progress_line to cputsxy [phi:display_progress_line->cputsxy] + // [2146] phi cputsxy::s#4 = cputsxy::s#2 [phi:display_progress_line->cputsxy#0] -- register_copy + // [2146] phi cputsxy::y#4 = cputsxy::y#2 [phi:display_progress_line->cputsxy#1] -- register_copy + // [2146] phi cputsxy::x#4 = PROGRESS_X [phi:display_progress_line->cputsxy#2] -- vbuyy=vbuc1 + ldy #PROGRESS_X jsr cputsxy // display_progress_line::@return // } - // [1112] return + // [1183] return rts } // snprintf_init /// Initialize the snprintf() state -// void snprintf_init(__zp($b8) char *s, unsigned int n) +// void snprintf_init(__zp($76) char *s, unsigned int n) snprintf_init: { - .label s = $b8 + .label s = $76 // __snprintf_capacity = n - // [1114] __snprintf_capacity = $ffff -- vwum1=vwuc1 + // [1185] __snprintf_capacity = $ffff -- vwum1=vwuc1 lda #<$ffff sta __snprintf_capacity lda #>$ffff sta __snprintf_capacity+1 // __snprintf_size = 0 - // [1115] __snprintf_size = 0 -- vwum1=vbuc1 + // [1186] __snprintf_size = 0 -- vwum1=vbuc1 lda #<0 sta __snprintf_size sta __snprintf_size+1 // __snprintf_buffer = s - // [1116] __snprintf_buffer = snprintf_init::s#25 -- pbuz1=pbuz2 + // [1187] __snprintf_buffer = snprintf_init::s#30 -- pbuz1=pbuz2 lda.z s sta.z __snprintf_buffer lda.z s+1 sta.z __snprintf_buffer+1 // snprintf_init::@return // } - // [1117] return + // [1188] return rts } // printf_uchar // Print an unsigned char using a specific format -// void printf_uchar(__zp($aa) void (*putc)(char), __mem() char uvalue, __mem() char format_min_length, char format_justify_left, char format_sign_always, __mem() char format_zero_padding, char format_upper_case, __mem() char format_radix) +// void printf_uchar(__zp($67) void (*putc)(char), __register(X) char uvalue, __mem() char format_min_length, char format_justify_left, char format_sign_always, __mem() char format_zero_padding, char format_upper_case, __register(Y) char format_radix) printf_uchar: { - .label putc = $aa + .label putc = $67 // printf_uchar::@1 // printf_buffer.sign = format.sign_always?'+':0 - // [1119] *((char *)&printf_buffer) = 0 -- _deref_pbuc1=vbuc2 + // [1190] *((char *)&printf_buffer) = 0 -- _deref_pbuc1=vbuc2 // Handle any sign lda #0 sta printf_buffer // uctoa(uvalue, printf_buffer.digits, format.radix) - // [1120] uctoa::value#1 = printf_uchar::uvalue#17 - // [1121] uctoa::radix#0 = printf_uchar::format_radix#17 - // [1122] call uctoa + // [1191] uctoa::value#1 = printf_uchar::uvalue#15 + // [1192] uctoa::radix#0 = printf_uchar::format_radix#15 + // [1193] call uctoa // Format number into buffer jsr uctoa // printf_uchar::@2 // printf_number_buffer(putc, printf_buffer, format) - // [1123] printf_number_buffer::putc#2 = printf_uchar::putc#17 - // [1124] printf_number_buffer::buffer_sign#2 = *((char *)&printf_buffer) -- vbum1=_deref_pbuc1 + // [1194] printf_number_buffer::putc#2 = printf_uchar::putc#15 + // [1195] printf_number_buffer::buffer_sign#2 = *((char *)&printf_buffer) -- vbum1=_deref_pbuc1 lda printf_buffer sta printf_number_buffer.buffer_sign - // [1125] printf_number_buffer::format_min_length#2 = printf_uchar::format_min_length#17 - // [1126] printf_number_buffer::format_zero_padding#2 = printf_uchar::format_zero_padding#17 - // [1127] call printf_number_buffer + // [1196] printf_number_buffer::format_min_length#2 = printf_uchar::format_min_length#15 -- vbuxx=vbum1 + ldx format_min_length + // [1197] printf_number_buffer::format_zero_padding#2 = printf_uchar::format_zero_padding#15 + // [1198] call printf_number_buffer // Print using format - // [2116] phi from printf_uchar::@2 to printf_number_buffer [phi:printf_uchar::@2->printf_number_buffer] - // [2116] phi printf_number_buffer::putc#10 = printf_number_buffer::putc#2 [phi:printf_uchar::@2->printf_number_buffer#0] -- register_copy - // [2116] phi printf_number_buffer::buffer_sign#10 = printf_number_buffer::buffer_sign#2 [phi:printf_uchar::@2->printf_number_buffer#1] -- register_copy - // [2116] phi printf_number_buffer::format_zero_padding#10 = printf_number_buffer::format_zero_padding#2 [phi:printf_uchar::@2->printf_number_buffer#2] -- register_copy - // [2116] phi printf_number_buffer::format_min_length#3 = printf_number_buffer::format_min_length#2 [phi:printf_uchar::@2->printf_number_buffer#3] -- register_copy + // [2362] phi from printf_uchar::@2 to printf_number_buffer [phi:printf_uchar::@2->printf_number_buffer] + // [2362] phi printf_number_buffer::putc#10 = printf_number_buffer::putc#2 [phi:printf_uchar::@2->printf_number_buffer#0] -- register_copy + // [2362] phi printf_number_buffer::buffer_sign#10 = printf_number_buffer::buffer_sign#2 [phi:printf_uchar::@2->printf_number_buffer#1] -- register_copy + // [2362] phi printf_number_buffer::format_zero_padding#10 = printf_number_buffer::format_zero_padding#2 [phi:printf_uchar::@2->printf_number_buffer#2] -- register_copy + // [2362] phi printf_number_buffer::format_min_length#3 = printf_number_buffer::format_min_length#2 [phi:printf_uchar::@2->printf_number_buffer#3] -- register_copy jsr printf_number_buffer // printf_uchar::@return // } - // [1128] return + // [1199] return rts .segment Data - uvalue: .byte 0 - format_radix: .byte 0 format_min_length: .byte 0 format_zero_padding: .byte 0 } @@ -7521,75 +7631,71 @@ printf_uchar: { * * @param info_text The info text to be displayed. */ -// void display_action_text(__zp($c1) char *info_text) +// void display_action_text(__zp($7e) char *info_text) display_action_text: { - .label info_text = $c1 - .label x = $bc + .label info_text = $7e + .label x = $7a .label y = $75 // unsigned char x = wherex() - // [1130] call wherex + // [1201] call wherex jsr wherex - // [1131] wherex::return#3 = wherex::return#0 + // [1202] wherex::return#3 = wherex::return#0 // display_action_text::@1 - // [1132] display_action_text::x#0 = wherex::return#3 -- vbuz1=vbum2 - lda wherex.return + // [1203] display_action_text::x#0 = wherex::return#3 -- vbuz1=vbuaa sta.z x // unsigned char y = wherey() - // [1133] call wherey + // [1204] call wherey jsr wherey - // [1134] wherey::return#3 = wherey::return#0 + // [1205] wherey::return#3 = wherey::return#0 // display_action_text::@2 - // [1135] display_action_text::y#0 = wherey::return#3 -- vbuz1=vbum2 - lda wherey.return + // [1206] display_action_text::y#0 = wherey::return#3 -- vbuz1=vbuaa sta.z y // gotoxy(2, PROGRESS_Y-3) - // [1136] call gotoxy - // [778] phi from display_action_text::@2 to gotoxy [phi:display_action_text::@2->gotoxy] - // [778] phi gotoxy::y#33 = PROGRESS_Y-3 [phi:display_action_text::@2->gotoxy#0] -- vbum1=vbuc1 + // [1207] call gotoxy + // [805] phi from display_action_text::@2 to gotoxy [phi:display_action_text::@2->gotoxy] + // [805] phi gotoxy::y#37 = PROGRESS_Y-3 [phi:display_action_text::@2->gotoxy#0] -- vbum1=vbuc1 lda #PROGRESS_Y-3 sta gotoxy.y - // [778] phi gotoxy::x#33 = 2 [phi:display_action_text::@2->gotoxy#1] -- vbum1=vbuc1 - lda #2 - sta gotoxy.x + // [805] phi gotoxy::x#37 = 2 [phi:display_action_text::@2->gotoxy#1] -- vbuyy=vbuc1 + ldy #2 jsr gotoxy // display_action_text::@3 // printf("%-65s", info_text) - // [1137] printf_string::str#2 = display_action_text::info_text#17 -- pbuz1=pbuz2 + // [1208] printf_string::str#2 = display_action_text::info_text#25 -- pbuz1=pbuz2 lda.z info_text sta.z printf_string.str lda.z info_text+1 sta.z printf_string.str+1 - // [1138] call printf_string - // [1227] phi from display_action_text::@3 to printf_string [phi:display_action_text::@3->printf_string] - // [1227] phi printf_string::putc#25 = &cputc [phi:display_action_text::@3->printf_string#0] -- pprz1=pprc1 + // [1209] call printf_string + // [1419] phi from display_action_text::@3 to printf_string [phi:display_action_text::@3->printf_string] + // [1419] phi printf_string::putc#26 = &cputc [phi:display_action_text::@3->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#2 [phi:display_action_text::@3->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 1 [phi:display_action_text::@3->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#2 [phi:display_action_text::@3->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 1 [phi:display_action_text::@3->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = $41 [phi:display_action_text::@3->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = $41 [phi:display_action_text::@3->printf_string#3] -- vbum1=vbuc1 lda #$41 sta printf_string.format_min_length jsr printf_string // display_action_text::@4 // gotoxy(x, y) - // [1139] gotoxy::x#12 = display_action_text::x#0 -- vbum1=vbuz2 - lda.z x - sta gotoxy.x - // [1140] gotoxy::y#12 = display_action_text::y#0 -- vbum1=vbuz2 + // [1210] gotoxy::x#12 = display_action_text::x#0 -- vbuyy=vbuz1 + ldy.z x + // [1211] gotoxy::y#12 = display_action_text::y#0 -- vbum1=vbuz2 lda.z y sta gotoxy.y - // [1141] call gotoxy - // [778] phi from display_action_text::@4 to gotoxy [phi:display_action_text::@4->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#12 [phi:display_action_text::@4->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = gotoxy::x#12 [phi:display_action_text::@4->gotoxy#1] -- register_copy + // [1212] call gotoxy + // [805] phi from display_action_text::@4 to gotoxy [phi:display_action_text::@4->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#12 [phi:display_action_text::@4->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = gotoxy::x#12 [phi:display_action_text::@4->gotoxy#1] -- register_copy jsr gotoxy // display_action_text::@return // } - // [1142] return + // [1213] return rts } // smc_reset @@ -7605,28 +7711,28 @@ smc_reset: { .const bank_set_brom1_bank = 0 // smc_reset::bank_set_bram1 // BRAM = bank - // [1144] BRAM = smc_reset::bank_set_bram1_bank#0 -- vbuz1=vbuc1 + // [1215] BRAM = smc_reset::bank_set_bram1_bank#0 -- vbuz1=vbuc1 lda #bank_set_bram1_bank sta.z BRAM // smc_reset::bank_set_brom1 // BROM = bank - // [1145] BROM = smc_reset::bank_set_brom1_bank#0 -- vbuz1=vbuc1 + // [1216] BROM = smc_reset::bank_set_brom1_bank#0 -- vbuz1=vbuc1 lda #bank_set_brom1_bank sta.z BROM // smc_reset::@1 // cx16_k_i2c_write_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_REBOOT, 0) - // [1146] smc_reset::cx16_k_i2c_write_byte1_device = $42 -- vbum1=vbuc1 + // [1217] smc_reset::cx16_k_i2c_write_byte1_device = $42 -- vbum1=vbuc1 lda #$42 sta cx16_k_i2c_write_byte1_device - // [1147] smc_reset::cx16_k_i2c_write_byte1_offset = $82 -- vbum1=vbuc1 + // [1218] smc_reset::cx16_k_i2c_write_byte1_offset = $82 -- vbum1=vbuc1 lda #$82 sta cx16_k_i2c_write_byte1_offset - // [1148] smc_reset::cx16_k_i2c_write_byte1_value = 0 -- vbum1=vbuc1 + // [1219] smc_reset::cx16_k_i2c_write_byte1_value = 0 -- vbum1=vbuc1 lda #0 sta cx16_k_i2c_write_byte1_value // smc_reset::cx16_k_i2c_write_byte1 // unsigned char result - // [1149] smc_reset::cx16_k_i2c_write_byte1_result = 0 -- vbum1=vbuc1 + // [1220] smc_reset::cx16_k_i2c_write_byte1_result = 0 -- vbum1=vbuc1 sta cx16_k_i2c_write_byte1_result // asm // asm { ldxdevice ldyoffset ldavalue stzresult jsrCX16_I2C_WRITE_BYTE rolresult } @@ -7638,7 +7744,7 @@ smc_reset: { rol cx16_k_i2c_write_byte1_result // smc_reset::@return // } - // [1151] return + // [1222] return rts .segment Data cx16_k_i2c_write_byte1_device: .byte 0 @@ -7654,157 +7760,844 @@ smc_reset: { * @param status The status to be checked. * @return unsigned char true if one chip is equal to the status. */ -// __mem() char check_status_card_roms(char status) +// __register(A) char check_status_card_roms(char status) check_status_card_roms: { - .label check_status_rom1_check_status_card_roms__0 = $bc - .label check_status_rom1_return = $bc - // [1153] phi from check_status_card_roms to check_status_card_roms::@1 [phi:check_status_card_roms->check_status_card_roms::@1] - // [1153] phi check_status_card_roms::rom_chip#2 = 1 [phi:check_status_card_roms->check_status_card_roms::@1#0] -- vbum1=vbuc1 - lda #1 - sta rom_chip + // [1224] phi from check_status_card_roms to check_status_card_roms::@1 [phi:check_status_card_roms->check_status_card_roms::@1] + // [1224] phi check_status_card_roms::rom_chip#2 = 1 [phi:check_status_card_roms->check_status_card_roms::@1#0] -- vbuxx=vbuc1 + ldx #1 // check_status_card_roms::@1 __b1: // for(unsigned char rom_chip = 1; rom_chip < 8; rom_chip++) - // [1154] if(check_status_card_roms::rom_chip#2<8) goto check_status_card_roms::check_status_rom1 -- vbum1_lt_vbuc1_then_la1 - lda rom_chip - cmp #8 + // [1225] if(check_status_card_roms::rom_chip#2<8) goto check_status_card_roms::check_status_rom1 -- vbuxx_lt_vbuc1_then_la1 + cpx #8 bcc check_status_rom1 - // [1155] phi from check_status_card_roms::@1 to check_status_card_roms::@return [phi:check_status_card_roms::@1->check_status_card_roms::@return] - // [1155] phi check_status_card_roms::return#2 = 0 [phi:check_status_card_roms::@1->check_status_card_roms::@return#0] -- vbum1=vbuc1 + // [1226] phi from check_status_card_roms::@1 to check_status_card_roms::@return [phi:check_status_card_roms::@1->check_status_card_roms::@return] + // [1226] phi check_status_card_roms::return#2 = 0 [phi:check_status_card_roms::@1->check_status_card_roms::@return#0] -- vbuaa=vbuc1 lda #0 - sta return // check_status_card_roms::@return // } - // [1156] return + // [1227] return rts // check_status_card_roms::check_status_rom1 check_status_rom1: // status_rom[rom_chip] == status - // [1157] check_status_card_roms::check_status_rom1_$0 = status_rom[check_status_card_roms::rom_chip#2] == STATUS_FLASH -- vboz1=pbuc1_derefidx_vbum2_eq_vbuc2 + // [1228] check_status_card_roms::check_status_rom1_$0 = status_rom[check_status_card_roms::rom_chip#2] == STATUS_FLASH -- vboaa=pbuc1_derefidx_vbuxx_eq_vbuc2 lda #STATUS_FLASH - ldy rom_chip - eor status_rom,y + eor status_rom,x beq !+ lda #1 !: eor #1 - sta.z check_status_rom1_check_status_card_roms__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [1158] check_status_card_roms::check_status_rom1_return#0 = (char)check_status_card_roms::check_status_rom1_$0 + // [1229] check_status_card_roms::check_status_rom1_return#0 = (char)check_status_card_roms::check_status_rom1_$0 // check_status_card_roms::@3 // if(check_status_rom(rom_chip, status)) - // [1159] if(0==check_status_card_roms::check_status_rom1_return#0) goto check_status_card_roms::@2 -- 0_eq_vbuz1_then_la1 - lda.z check_status_rom1_return + // [1230] if(0==check_status_card_roms::check_status_rom1_return#0) goto check_status_card_roms::@2 -- 0_eq_vbuaa_then_la1 + cmp #0 beq __b2 - // [1155] phi from check_status_card_roms::@3 to check_status_card_roms::@return [phi:check_status_card_roms::@3->check_status_card_roms::@return] - // [1155] phi check_status_card_roms::return#2 = 1 [phi:check_status_card_roms::@3->check_status_card_roms::@return#0] -- vbum1=vbuc1 + // [1226] phi from check_status_card_roms::@3 to check_status_card_roms::@return [phi:check_status_card_roms::@3->check_status_card_roms::@return] + // [1226] phi check_status_card_roms::return#2 = 1 [phi:check_status_card_roms::@3->check_status_card_roms::@return#0] -- vbuaa=vbuc1 lda #1 - sta return rts // check_status_card_roms::@2 __b2: // for(unsigned char rom_chip = 1; rom_chip < 8; rom_chip++) - // [1160] check_status_card_roms::rom_chip#1 = ++ check_status_card_roms::rom_chip#2 -- vbum1=_inc_vbum1 - inc rom_chip - // [1153] phi from check_status_card_roms::@2 to check_status_card_roms::@1 [phi:check_status_card_roms::@2->check_status_card_roms::@1] - // [1153] phi check_status_card_roms::rom_chip#2 = check_status_card_roms::rom_chip#1 [phi:check_status_card_roms::@2->check_status_card_roms::@1#0] -- register_copy + // [1231] check_status_card_roms::rom_chip#1 = ++ check_status_card_roms::rom_chip#2 -- vbuxx=_inc_vbuxx + inx + // [1224] phi from check_status_card_roms::@2 to check_status_card_roms::@1 [phi:check_status_card_roms::@2->check_status_card_roms::@1] + // [1224] phi check_status_card_roms::rom_chip#2 = check_status_card_roms::rom_chip#1 [phi:check_status_card_roms::@2->check_status_card_roms::@1#0] -- register_copy jmp __b1 - .segment Data - .label rom_chip = main.check_status_smc11_main__0 - return: .byte 0 } -.segment Code - // display_progress_clear -/** - * @brief Clean the progress area for the flashing. - */ -display_progress_clear: { - .const h = PROGRESS_Y+PROGRESS_H - .label x = $d1 - .label i = $ca - .label y = $e1 - // textcolor(WHITE) - // [1162] call textcolor - // [760] phi from display_progress_clear to textcolor [phi:display_progress_clear->textcolor] - // [760] phi textcolor::color#23 = WHITE [phi:display_progress_clear->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color - jsr textcolor - // [1163] phi from display_progress_clear to display_progress_clear::@5 [phi:display_progress_clear->display_progress_clear::@5] - // display_progress_clear::@5 - // bgcolor(BLUE) - // [1164] call bgcolor - // [765] phi from display_progress_clear::@5 to bgcolor [phi:display_progress_clear::@5->bgcolor] - // [765] phi bgcolor::color#15 = BLUE [phi:display_progress_clear::@5->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color - jsr bgcolor - // [1165] phi from display_progress_clear::@5 to display_progress_clear::@1 [phi:display_progress_clear::@5->display_progress_clear::@1] - // [1165] phi display_progress_clear::y#2 = PROGRESS_Y [phi:display_progress_clear::@5->display_progress_clear::@1#0] -- vbuz1=vbuc1 - lda #PROGRESS_Y - sta.z y - // display_progress_clear::@1 - __b1: - // while (y < h) - // [1166] if(display_progress_clear::y#2display_progress_clear::@2] - __b4: - // [1168] phi display_progress_clear::x#2 = PROGRESS_X [phi:display_progress_clear::@1->display_progress_clear::@2#0] -- vbuz1=vbuc1 - lda #PROGRESS_X - sta.z x - // [1168] phi display_progress_clear::i#2 = 0 [phi:display_progress_clear::@1->display_progress_clear::@2#1] -- vbuz1=vbuc1 +.segment CodeVera + // main_vera_flash +main_vera_flash: { + .label vera_bytes_read = $a9 + // display_progress_text(display_jp1_spi_vera_text, display_jp1_spi_vera_count) + // [1233] call display_progress_text + // [1169] phi from main_vera_flash to display_progress_text [phi:main_vera_flash->display_progress_text] + // [1169] phi display_progress_text::text#13 = display_jp1_spi_vera_text [phi:main_vera_flash->display_progress_text#0] -- qbuz1=qbuc1 + lda #display_jp1_spi_vera_text + sta.z display_progress_text.text+1 + // [1169] phi display_progress_text::lines#12 = display_jp1_spi_vera_count [phi:main_vera_flash->display_progress_text#1] -- vbuz1=vbuc1 + lda #display_jp1_spi_vera_count + sta.z display_progress_text.lines + jsr display_progress_text + // [1234] phi from main_vera_flash to main_vera_flash::@20 [phi:main_vera_flash->main_vera_flash::@20] + // main_vera_flash::@20 + // util_wait_space() + // [1235] call util_wait_space + // [1958] phi from main_vera_flash::@20 to util_wait_space [phi:main_vera_flash::@20->util_wait_space] + jsr util_wait_space + // [1236] phi from main_vera_flash::@20 to main_vera_flash::@21 [phi:main_vera_flash::@20->main_vera_flash::@21] + // main_vera_flash::@21 + // display_progress_clear() + // [1237] call display_progress_clear + // [1037] phi from main_vera_flash::@21 to display_progress_clear [phi:main_vera_flash::@21->display_progress_clear] + jsr display_progress_clear + // [1238] phi from main_vera_flash::@21 to main_vera_flash::@22 [phi:main_vera_flash::@21->main_vera_flash::@22] + // main_vera_flash::@22 + // sprintf(info_text, "Reading VERA.BIN ... (.) data ( ) empty") + // [1239] call snprintf_init + // [1184] phi from main_vera_flash::@22 to snprintf_init [phi:main_vera_flash::@22->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:main_vera_flash::@22->snprintf_init#0] -- pbuz1=pbuc1 + lda #<@info_text + sta.z snprintf_init.s + lda #>@info_text + sta.z snprintf_init.s+1 + jsr snprintf_init + // [1240] phi from main_vera_flash::@22 to main_vera_flash::@23 [phi:main_vera_flash::@22->main_vera_flash::@23] + // main_vera_flash::@23 + // sprintf(info_text, "Reading VERA.BIN ... (.) data ( ) empty") + // [1241] call printf_str + // [1125] phi from main_vera_flash::@23 to printf_str [phi:main_vera_flash::@23->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main_vera_flash::@23->printf_str#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_str.putc+1 + // [1125] phi printf_str::s#79 = main_vera_flash::s [phi:main_vera_flash::@23->printf_str#1] -- pbuz1=pbuc1 + lda #s + sta.z printf_str.s+1 + jsr printf_str + // main_vera_flash::@24 + // sprintf(info_text, "Reading VERA.BIN ... (.) data ( ) empty") + // [1242] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 - sta.z i - // display_progress_clear::@2 - __b2: - // for(unsigned char i = 0; i < w; i++) - // [1169] if(display_progress_clear::i#2display_progress_clear::@1] - // [1165] phi display_progress_clear::y#2 = display_progress_clear::y#1 [phi:display_progress_clear::@4->display_progress_clear::@1#0] -- register_copy + pha + // [1243] callexecute snputc -- call_vprc1 + jsr snputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // display_action_progress(info_text) + // [1245] call display_action_progress + // [1155] phi from main_vera_flash::@24 to display_action_progress [phi:main_vera_flash::@24->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = info_text [phi:main_vera_flash::@24->display_action_progress#0] -- pbuz1=pbuc1 + lda #<@info_text + sta.z display_action_progress.info_text + lda #>@info_text + sta.z display_action_progress.info_text+1 + jsr display_action_progress + // [1246] phi from main_vera_flash::@24 to main_vera_flash::@25 [phi:main_vera_flash::@24->main_vera_flash::@25] + // main_vera_flash::@25 + // unsigned long vera_bytes_read = w25q16_read(STATUS_READING) + // [1247] call w25q16_read + // [2281] phi from main_vera_flash::@25 to w25q16_read [phi:main_vera_flash::@25->w25q16_read] + // [2281] phi __errno#105 = __errno#115 [phi:main_vera_flash::@25->w25q16_read#0] -- register_copy + // [2281] phi __stdio_filecount#100 = __stdio_filecount#111 [phi:main_vera_flash::@25->w25q16_read#1] -- register_copy + // [2281] phi w25q16_read::info_status#12 = STATUS_READING [phi:main_vera_flash::@25->w25q16_read#2] -- vbum1=vbuc1 + lda #STATUS_READING + sta w25q16_read.info_status + jsr w25q16_read + // unsigned long vera_bytes_read = w25q16_read(STATUS_READING) + // [1248] w25q16_read::return#3 = w25q16_read::return#0 + // main_vera_flash::@26 + // [1249] main_vera_flash::vera_bytes_read#0 = w25q16_read::return#3 + // if(vera_bytes_read) + // [1250] if(0==main_vera_flash::vera_bytes_read#0) goto main_vera_flash::@1 -- 0_eq_vduz1_then_la1 + lda.z vera_bytes_read + ora.z vera_bytes_read+1 + ora.z vera_bytes_read+2 + ora.z vera_bytes_read+3 + bne !__b1+ jmp __b1 - // display_progress_clear::@3 - __b3: - // cputcxy(x, y, ' ') - // [1171] cputcxy::x#12 = display_progress_clear::x#2 -- vbum1=vbuz2 - lda.z x - sta cputcxy.x - // [1172] cputcxy::y#12 = display_progress_clear::y#2 -- vbum1=vbuz2 - lda.z y - sta cputcxy.y - // [1173] call cputcxy - // [2147] phi from display_progress_clear::@3 to cputcxy [phi:display_progress_clear::@3->cputcxy] - // [2147] phi cputcxy::c#15 = ' ' [phi:display_progress_clear::@3->cputcxy#0] -- vbum1=vbuc1 - lda #' ' - sta cputcxy.c - // [2147] phi cputcxy::y#15 = cputcxy::y#12 [phi:display_progress_clear::@3->cputcxy#1] -- register_copy - // [2147] phi cputcxy::x#15 = cputcxy::x#12 [phi:display_progress_clear::@3->cputcxy#2] -- register_copy - jsr cputcxy - // display_progress_clear::@6 - // x++; - // [1174] display_progress_clear::x#1 = ++ display_progress_clear::x#2 -- vbuz1=_inc_vbuz1 - inc.z x - // for(unsigned char i = 0; i < w; i++) - // [1175] display_progress_clear::i#1 = ++ display_progress_clear::i#2 -- vbuz1=_inc_vbuz1 - inc.z i - // [1168] phi from display_progress_clear::@6 to display_progress_clear::@2 [phi:display_progress_clear::@6->display_progress_clear::@2] - // [1168] phi display_progress_clear::x#2 = display_progress_clear::x#1 [phi:display_progress_clear::@6->display_progress_clear::@2#0] -- register_copy - // [1168] phi display_progress_clear::i#2 = display_progress_clear::i#1 [phi:display_progress_clear::@6->display_progress_clear::@2#1] -- register_copy + !__b1: + // [1251] phi from main_vera_flash::@26 to main_vera_flash::@2 [phi:main_vera_flash::@26->main_vera_flash::@2] + // main_vera_flash::@2 + // display_action_progress("VERA SPI activation ...") + // [1252] call display_action_progress + // Now we loop until jumper JP1 has been placed! + // [1155] phi from main_vera_flash::@2 to display_action_progress [phi:main_vera_flash::@2->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main_vera_flash::info_text [phi:main_vera_flash::@2->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text + sta.z display_action_progress.info_text+1 + jsr display_action_progress + // [1253] phi from main_vera_flash::@2 to main_vera_flash::@28 [phi:main_vera_flash::@2->main_vera_flash::@28] + // main_vera_flash::@28 + // display_action_text("Please close the jumper JP1 on the VERA board!") + // [1254] call display_action_text + // [1200] phi from main_vera_flash::@28 to display_action_text [phi:main_vera_flash::@28->display_action_text] + // [1200] phi display_action_text::info_text#25 = main_vera_flash::info_text1 [phi:main_vera_flash::@28->display_action_text#0] -- pbuz1=pbuc1 + lda #info_text1 + sta.z display_action_text.info_text+1 + jsr display_action_text + // [1255] phi from main_vera_flash::@28 main_vera_flash::@7 to main_vera_flash::@3 [phi:main_vera_flash::@28/main_vera_flash::@7->main_vera_flash::@3] + __b2: + // [1255] phi main_vera_flash::spi_ensure_detect#11 = 0 [phi:main_vera_flash::@28/main_vera_flash::@7->main_vera_flash::@3#0] -- vbum1=vbuc1 + lda #0 + sta spi_ensure_detect + // main_vera_flash::@3 + __b3: + // while(spi_ensure_detect < 16) + // [1256] if(main_vera_flash::spi_ensure_detect#11<$10) goto main_vera_flash::@4 -- vbum1_lt_vbuc1_then_la1 + lda spi_ensure_detect + cmp #$10 + bcs !__b4+ + jmp __b4 + !__b4: + // [1257] phi from main_vera_flash::@3 to main_vera_flash::@5 [phi:main_vera_flash::@3->main_vera_flash::@5] + // main_vera_flash::@5 + // display_action_text("The jumper JP1 has been closed on the VERA!") + // [1258] call display_action_text + // [1200] phi from main_vera_flash::@5 to display_action_text [phi:main_vera_flash::@5->display_action_text] + // [1200] phi display_action_text::info_text#25 = main_vera_flash::info_text2 [phi:main_vera_flash::@5->display_action_text#0] -- pbuz1=pbuc1 + lda #info_text2 + sta.z display_action_text.info_text+1 + jsr display_action_text + // [1259] phi from main_vera_flash::@5 to main_vera_flash::@31 [phi:main_vera_flash::@5->main_vera_flash::@31] + // main_vera_flash::@31 + // display_action_progress("Comparing VERA ... (.) data, (=) same, (*) different.") + // [1260] call display_action_progress + // Now we compare the RAM with the actual VERA contents. + // [1155] phi from main_vera_flash::@31 to display_action_progress [phi:main_vera_flash::@31->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main_vera_flash::info_text3 [phi:main_vera_flash::@31->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text3 + sta.z display_action_progress.info_text+1 + jsr display_action_progress + // [1261] phi from main_vera_flash::@31 to main_vera_flash::@32 [phi:main_vera_flash::@31->main_vera_flash::@32] + // main_vera_flash::@32 + // display_info_vera(STATUS_COMPARING, "") + // [1262] call display_info_vera + // [1930] phi from main_vera_flash::@32 to display_info_vera [phi:main_vera_flash::@32->display_info_vera] + // [1930] phi display_info_vera::info_text#15 = str [phi:main_vera_flash::@32->display_info_vera#0] -- pbuz1=pbuc1 + lda #str + sta.z display_info_vera.info_text+1 + // [1930] phi display_info_vera::info_status#15 = STATUS_COMPARING [phi:main_vera_flash::@32->display_info_vera#1] -- vbum1=vbuc1 + lda #STATUS_COMPARING + sta display_info_vera.info_status + jsr display_info_vera + // [1263] phi from main_vera_flash::@32 to main_vera_flash::@33 [phi:main_vera_flash::@32->main_vera_flash::@33] + // main_vera_flash::@33 + // unsigned long vera_differences = w25q16_verify(0) + // [1264] call w25q16_verify + // Verify VERA ... + // [2393] phi from main_vera_flash::@33 to w25q16_verify [phi:main_vera_flash::@33->w25q16_verify] + // [2393] phi w25q16_verify::verify#2 = 0 [phi:main_vera_flash::@33->w25q16_verify#0] -- vbuxx=vbuc1 + ldx #0 + jsr w25q16_verify + // unsigned long vera_differences = w25q16_verify(0) + // [1265] w25q16_verify::return#2 = w25q16_verify::w25q16_different_bytes#2 + // main_vera_flash::@34 + // [1266] main_vera_flash::vera_differences#0 = w25q16_verify::return#2 -- vdum1=vdum2 + lda w25q16_verify.return + sta vera_differences + lda w25q16_verify.return+1 + sta vera_differences+1 + lda w25q16_verify.return+2 + sta vera_differences+2 + lda w25q16_verify.return+3 + sta vera_differences+3 + // if (!vera_differences) + // [1267] if(0==main_vera_flash::vera_differences#0) goto main_vera_flash::@10 -- 0_eq_vdum1_then_la1 + lda vera_differences + ora vera_differences+1 + ora vera_differences+2 + ora vera_differences+3 + bne !__b10+ + jmp __b10 + !__b10: + // [1268] phi from main_vera_flash::@34 to main_vera_flash::@8 [phi:main_vera_flash::@34->main_vera_flash::@8] + // main_vera_flash::@8 + // sprintf(info_text, "%u differences!", vera_differences) + // [1269] call snprintf_init + // [1184] phi from main_vera_flash::@8 to snprintf_init [phi:main_vera_flash::@8->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:main_vera_flash::@8->snprintf_init#0] -- pbuz1=pbuc1 + lda #<@info_text + sta.z snprintf_init.s + lda #>@info_text + sta.z snprintf_init.s+1 + jsr snprintf_init + // main_vera_flash::@35 + // sprintf(info_text, "%u differences!", vera_differences) + // [1270] printf_ulong::uvalue#10 = main_vera_flash::vera_differences#0 -- vdum1=vdum2 + lda vera_differences + sta printf_ulong.uvalue + lda vera_differences+1 + sta printf_ulong.uvalue+1 + lda vera_differences+2 + sta printf_ulong.uvalue+2 + lda vera_differences+3 + sta printf_ulong.uvalue+3 + // [1271] call printf_ulong + // [1588] phi from main_vera_flash::@35 to printf_ulong [phi:main_vera_flash::@35->printf_ulong] + // [1588] phi printf_ulong::format_zero_padding#14 = 0 [phi:main_vera_flash::@35->printf_ulong#0] -- vbum1=vbuc1 + lda #0 + sta printf_ulong.format_zero_padding + // [1588] phi printf_ulong::format_min_length#14 = 0 [phi:main_vera_flash::@35->printf_ulong#1] -- vbum1=vbuc1 + sta printf_ulong.format_min_length + // [1588] phi printf_ulong::format_radix#14 = DECIMAL [phi:main_vera_flash::@35->printf_ulong#2] -- vbuxx=vbuc1 + ldx #DECIMAL + // [1588] phi printf_ulong::uvalue#14 = printf_ulong::uvalue#10 [phi:main_vera_flash::@35->printf_ulong#3] -- register_copy + jsr printf_ulong + // [1272] phi from main_vera_flash::@35 to main_vera_flash::@36 [phi:main_vera_flash::@35->main_vera_flash::@36] + // main_vera_flash::@36 + // sprintf(info_text, "%u differences!", vera_differences) + // [1273] call printf_str + // [1125] phi from main_vera_flash::@36 to printf_str [phi:main_vera_flash::@36->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main_vera_flash::@36->printf_str#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_str.putc+1 + // [1125] phi printf_str::s#79 = s11 [phi:main_vera_flash::@36->printf_str#1] -- pbuz1=pbuc1 + lda #s11 + sta.z printf_str.s+1 + jsr printf_str + // main_vera_flash::@37 + // sprintf(info_text, "%u differences!", vera_differences) + // [1274] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + lda #0 + pha + // [1275] callexecute snputc -- call_vprc1 + jsr snputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // display_info_vera(STATUS_FLASH, info_text) + // [1277] call display_info_vera + // [1930] phi from main_vera_flash::@37 to display_info_vera [phi:main_vera_flash::@37->display_info_vera] + // [1930] phi display_info_vera::info_text#15 = info_text [phi:main_vera_flash::@37->display_info_vera#0] -- pbuz1=pbuc1 + lda #<@info_text + sta.z display_info_vera.info_text + lda #>@info_text + sta.z display_info_vera.info_text+1 + // [1930] phi display_info_vera::info_status#15 = STATUS_FLASH [phi:main_vera_flash::@37->display_info_vera#1] -- vbum1=vbuc1 + lda #STATUS_FLASH + sta display_info_vera.info_status + jsr display_info_vera + // [1278] phi from main_vera_flash::@37 to main_vera_flash::@38 [phi:main_vera_flash::@37->main_vera_flash::@38] + // main_vera_flash::@38 + // unsigned char vera_erase_error = w25q16_erase() + // [1279] call w25q16_erase + jsr w25q16_erase + // [1280] w25q16_erase::return#3 = w25q16_erase::return#2 + // main_vera_flash::@39 + // [1281] main_vera_flash::vera_erase_error#0 = w25q16_erase::return#3 + // if(vera_erase_error) + // [1282] if(0==main_vera_flash::vera_erase_error#0) goto main_vera_flash::@11 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b11 + // [1283] phi from main_vera_flash::@39 to main_vera_flash::@9 [phi:main_vera_flash::@39->main_vera_flash::@9] + // main_vera_flash::@9 + // display_action_progress("There was an error cleaning your VERA flash memory!") + // [1284] call display_action_progress + // [1155] phi from main_vera_flash::@9 to display_action_progress [phi:main_vera_flash::@9->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main_vera_flash::info_text7 [phi:main_vera_flash::@9->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text7 + sta.z display_action_progress.info_text+1 + jsr display_action_progress + // [1285] phi from main_vera_flash::@9 to main_vera_flash::@41 [phi:main_vera_flash::@9->main_vera_flash::@41] + // main_vera_flash::@41 + // display_action_text("DO NOT RESET or REBOOT YOUR CX16 AND WAIT!") + // [1286] call display_action_text + // [1200] phi from main_vera_flash::@41 to display_action_text [phi:main_vera_flash::@41->display_action_text] + // [1200] phi display_action_text::info_text#25 = main_vera_flash::info_text8 [phi:main_vera_flash::@41->display_action_text#0] -- pbuz1=pbuc1 + lda #info_text8 + sta.z display_action_text.info_text+1 + jsr display_action_text + // [1287] phi from main_vera_flash::@41 to main_vera_flash::@42 [phi:main_vera_flash::@41->main_vera_flash::@42] + // main_vera_flash::@42 + // display_info_vera(STATUS_ERROR, "ERASE ERROR!") + // [1288] call display_info_vera + // [1930] phi from main_vera_flash::@42 to display_info_vera [phi:main_vera_flash::@42->display_info_vera] + // [1930] phi display_info_vera::info_text#15 = main_vera_flash::info_text9 [phi:main_vera_flash::@42->display_info_vera#0] -- pbuz1=pbuc1 + lda #info_text9 + sta.z display_info_vera.info_text+1 + // [1930] phi display_info_vera::info_status#15 = STATUS_ERROR [phi:main_vera_flash::@42->display_info_vera#1] -- vbum1=vbuc1 + lda #STATUS_ERROR + sta display_info_vera.info_status + jsr display_info_vera + // main_vera_flash::@43 + // [1289] smc_bootloader#598 = smc_bootloader#0 -- vwum1=vwum2 + lda smc_bootloader + sta smc_bootloader_1 + lda smc_bootloader+1 + sta smc_bootloader_1+1 + // display_info_smc(STATUS_ERROR, NULL) + // [1290] call display_info_smc + // [925] phi from main_vera_flash::@43 to display_info_smc [phi:main_vera_flash::@43->display_info_smc] + // [925] phi display_info_smc::info_text#24 = 0 [phi:main_vera_flash::@43->display_info_smc#0] -- pbuz1=vbuc1 + lda #<0 + sta.z display_info_smc.info_text + sta.z display_info_smc.info_text+1 + // [925] phi smc_bootloader#14 = smc_bootloader#598 [phi:main_vera_flash::@43->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_ERROR [phi:main_vera_flash::@43->display_info_smc#2] -- vbuz1=vbuc1 + lda #STATUS_ERROR + sta.z display_info_smc.info_status + jsr display_info_smc + // [1291] phi from main_vera_flash::@43 to main_vera_flash::@44 [phi:main_vera_flash::@43->main_vera_flash::@44] + // main_vera_flash::@44 + // display_info_roms(STATUS_ERROR, NULL) + // [1292] call display_info_roms + // [2483] phi from main_vera_flash::@44 to display_info_roms [phi:main_vera_flash::@44->display_info_roms] + jsr display_info_roms + // [1293] phi from main_vera_flash::@44 to main_vera_flash::@45 [phi:main_vera_flash::@44->main_vera_flash::@45] + // main_vera_flash::@45 + // wait_moment(32) + // [1294] call wait_moment + // [1134] phi from main_vera_flash::@45 to wait_moment [phi:main_vera_flash::@45->wait_moment] + // [1134] phi wait_moment::w#17 = $20 [phi:main_vera_flash::@45->wait_moment#0] -- vbuz1=vbuc1 + lda #$20 + sta.z wait_moment.w + jsr wait_moment + // [1295] phi from main_vera_flash::@45 to main_vera_flash::@46 [phi:main_vera_flash::@45->main_vera_flash::@46] + // main_vera_flash::@46 + // spi_deselect() + // [1296] call spi_deselect + jsr spi_deselect + // main_vera_flash::@return + // } + // [1297] return + rts + // [1298] phi from main_vera_flash::@39 to main_vera_flash::@11 [phi:main_vera_flash::@39->main_vera_flash::@11] + // main_vera_flash::@11 + __b11: + // __mem unsigned long vera_flashed = w25q16_flash() + // [1299] call w25q16_flash + // [2493] phi from main_vera_flash::@11 to w25q16_flash [phi:main_vera_flash::@11->w25q16_flash] + jsr w25q16_flash + // __mem unsigned long vera_flashed = w25q16_flash() + // [1300] w25q16_flash::return#3 = w25q16_flash::return#2 + // main_vera_flash::@40 + // [1301] main_vera_flash::vera_flashed#0 = w25q16_flash::return#3 -- vdum1=vduz2 + lda.z w25q16_flash.return + sta vera_flashed + lda.z w25q16_flash.return+1 + sta vera_flashed+1 + lda.z w25q16_flash.return+2 + sta vera_flashed+2 + lda.z w25q16_flash.return+3 + sta vera_flashed+3 + // if (vera_flashed) + // [1302] if(0!=main_vera_flash::vera_flashed#0) goto main_vera_flash::@12 -- 0_neq_vdum1_then_la1 + lda vera_flashed + ora vera_flashed+1 + ora vera_flashed+2 + ora vera_flashed+3 + bne __b12 + // [1303] phi from main_vera_flash::@40 to main_vera_flash::@13 [phi:main_vera_flash::@40->main_vera_flash::@13] + // main_vera_flash::@13 + // display_info_vera(STATUS_ERROR, info_text) + // [1304] call display_info_vera + // VFL2 | Flash VERA resulting in errors + // [1930] phi from main_vera_flash::@13 to display_info_vera [phi:main_vera_flash::@13->display_info_vera] + // [1930] phi display_info_vera::info_text#15 = info_text [phi:main_vera_flash::@13->display_info_vera#0] -- pbuz1=pbuc1 + lda #<@info_text + sta.z display_info_vera.info_text + lda #>@info_text + sta.z display_info_vera.info_text+1 + // [1930] phi display_info_vera::info_status#15 = STATUS_ERROR [phi:main_vera_flash::@13->display_info_vera#1] -- vbum1=vbuc1 + lda #STATUS_ERROR + sta display_info_vera.info_status + jsr display_info_vera + // [1305] phi from main_vera_flash::@13 to main_vera_flash::@49 [phi:main_vera_flash::@13->main_vera_flash::@49] + // main_vera_flash::@49 + // display_action_progress("There was an error updating your VERA flash memory!") + // [1306] call display_action_progress + // [1155] phi from main_vera_flash::@49 to display_action_progress [phi:main_vera_flash::@49->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main_vera_flash::info_text10 [phi:main_vera_flash::@49->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text10 + sta.z display_action_progress.info_text+1 + jsr display_action_progress + // [1307] phi from main_vera_flash::@49 to main_vera_flash::@50 [phi:main_vera_flash::@49->main_vera_flash::@50] + // main_vera_flash::@50 + // display_action_text("DO NOT RESET or REBOOT YOUR CX16 AND WAIT!") + // [1308] call display_action_text + // [1200] phi from main_vera_flash::@50 to display_action_text [phi:main_vera_flash::@50->display_action_text] + // [1200] phi display_action_text::info_text#25 = main_vera_flash::info_text8 [phi:main_vera_flash::@50->display_action_text#0] -- pbuz1=pbuc1 + lda #info_text8 + sta.z display_action_text.info_text+1 + jsr display_action_text + // [1309] phi from main_vera_flash::@50 to main_vera_flash::@51 [phi:main_vera_flash::@50->main_vera_flash::@51] + // main_vera_flash::@51 + // display_info_vera(STATUS_ERROR, "FLASH ERROR!") + // [1310] call display_info_vera + // [1930] phi from main_vera_flash::@51 to display_info_vera [phi:main_vera_flash::@51->display_info_vera] + // [1930] phi display_info_vera::info_text#15 = main_vera_flash::info_text12 [phi:main_vera_flash::@51->display_info_vera#0] -- pbuz1=pbuc1 + lda #info_text12 + sta.z display_info_vera.info_text+1 + // [1930] phi display_info_vera::info_status#15 = STATUS_ERROR [phi:main_vera_flash::@51->display_info_vera#1] -- vbum1=vbuc1 + lda #STATUS_ERROR + sta display_info_vera.info_status + jsr display_info_vera + // main_vera_flash::@52 + // [1311] smc_bootloader#599 = smc_bootloader#0 -- vwum1=vwum2 + lda smc_bootloader + sta smc_bootloader_1 + lda smc_bootloader+1 + sta smc_bootloader_1+1 + // display_info_smc(STATUS_ERROR, NULL) + // [1312] call display_info_smc + // [925] phi from main_vera_flash::@52 to display_info_smc [phi:main_vera_flash::@52->display_info_smc] + // [925] phi display_info_smc::info_text#24 = 0 [phi:main_vera_flash::@52->display_info_smc#0] -- pbuz1=vbuc1 + lda #<0 + sta.z display_info_smc.info_text + sta.z display_info_smc.info_text+1 + // [925] phi smc_bootloader#14 = smc_bootloader#599 [phi:main_vera_flash::@52->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_ERROR [phi:main_vera_flash::@52->display_info_smc#2] -- vbuz1=vbuc1 + lda #STATUS_ERROR + sta.z display_info_smc.info_status + jsr display_info_smc + // [1313] phi from main_vera_flash::@52 to main_vera_flash::@53 [phi:main_vera_flash::@52->main_vera_flash::@53] + // main_vera_flash::@53 + // display_info_roms(STATUS_ERROR, NULL) + // [1314] call display_info_roms + // [2483] phi from main_vera_flash::@53 to display_info_roms [phi:main_vera_flash::@53->display_info_roms] + jsr display_info_roms + // [1315] phi from main_vera_flash::@53 to main_vera_flash::@54 [phi:main_vera_flash::@53->main_vera_flash::@54] + // main_vera_flash::@54 + // wait_moment(32) + // [1316] call wait_moment + // [1134] phi from main_vera_flash::@54 to wait_moment [phi:main_vera_flash::@54->wait_moment] + // [1134] phi wait_moment::w#17 = $20 [phi:main_vera_flash::@54->wait_moment#0] -- vbuz1=vbuc1 + lda #$20 + sta.z wait_moment.w + jsr wait_moment + // [1317] phi from main_vera_flash::@54 to main_vera_flash::@55 [phi:main_vera_flash::@54->main_vera_flash::@55] + // main_vera_flash::@55 + // spi_deselect() + // [1318] call spi_deselect + jsr spi_deselect + rts + // [1319] phi from main_vera_flash::@40 to main_vera_flash::@12 [phi:main_vera_flash::@40->main_vera_flash::@12] + // main_vera_flash::@12 + __b12: + // display_info_vera(STATUS_FLASHED, NULL) + // [1320] call display_info_vera + // VFL3 | Flash VERA and all ok + // [1930] phi from main_vera_flash::@12 to display_info_vera [phi:main_vera_flash::@12->display_info_vera] + // [1930] phi display_info_vera::info_text#15 = 0 [phi:main_vera_flash::@12->display_info_vera#0] -- pbuz1=vbuc1 + lda #<0 + sta.z display_info_vera.info_text + sta.z display_info_vera.info_text+1 + // [1930] phi display_info_vera::info_status#15 = STATUS_FLASHED [phi:main_vera_flash::@12->display_info_vera#1] -- vbum1=vbuc1 + lda #STATUS_FLASHED + sta display_info_vera.info_status + jsr display_info_vera + // [1321] phi from main_vera_flash::@12 to main_vera_flash::@47 [phi:main_vera_flash::@12->main_vera_flash::@47] + // main_vera_flash::@47 + // __mem unsigned long vera_differences = w25q16_verify(1) + // [1322] call w25q16_verify + // [2393] phi from main_vera_flash::@47 to w25q16_verify [phi:main_vera_flash::@47->w25q16_verify] + // [2393] phi w25q16_verify::verify#2 = 1 [phi:main_vera_flash::@47->w25q16_verify#0] -- vbuxx=vbuc1 + ldx #1 + jsr w25q16_verify + // __mem unsigned long vera_differences = w25q16_verify(1) + // [1323] w25q16_verify::return#3 = w25q16_verify::w25q16_different_bytes#2 + // main_vera_flash::@48 + // [1324] main_vera_flash::vera_differences1#0 = w25q16_verify::return#3 -- vdum1=vdum2 + lda w25q16_verify.return + sta vera_differences1 + lda w25q16_verify.return+1 + sta vera_differences1+1 + lda w25q16_verify.return+2 + sta vera_differences1+2 + lda w25q16_verify.return+3 + sta vera_differences1+3 + // if (vera_differences) + // [1325] if(0==main_vera_flash::vera_differences1#0) goto main_vera_flash::@15 -- 0_eq_vdum1_then_la1 + lda vera_differences1 + ora vera_differences1+1 + ora vera_differences1+2 + ora vera_differences1+3 + beq __b15 + // [1326] phi from main_vera_flash::@48 to main_vera_flash::@14 [phi:main_vera_flash::@48->main_vera_flash::@14] + // main_vera_flash::@14 + // sprintf(info_text, "%u differences!", vera_differences) + // [1327] call snprintf_init + // [1184] phi from main_vera_flash::@14 to snprintf_init [phi:main_vera_flash::@14->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:main_vera_flash::@14->snprintf_init#0] -- pbuz1=pbuc1 + lda #<@info_text + sta.z snprintf_init.s + lda #>@info_text + sta.z snprintf_init.s+1 + jsr snprintf_init + // main_vera_flash::@56 + // sprintf(info_text, "%u differences!", vera_differences) + // [1328] printf_ulong::uvalue#11 = main_vera_flash::vera_differences1#0 + // [1329] call printf_ulong + // [1588] phi from main_vera_flash::@56 to printf_ulong [phi:main_vera_flash::@56->printf_ulong] + // [1588] phi printf_ulong::format_zero_padding#14 = 0 [phi:main_vera_flash::@56->printf_ulong#0] -- vbum1=vbuc1 + lda #0 + sta printf_ulong.format_zero_padding + // [1588] phi printf_ulong::format_min_length#14 = 0 [phi:main_vera_flash::@56->printf_ulong#1] -- vbum1=vbuc1 + sta printf_ulong.format_min_length + // [1588] phi printf_ulong::format_radix#14 = DECIMAL [phi:main_vera_flash::@56->printf_ulong#2] -- vbuxx=vbuc1 + ldx #DECIMAL + // [1588] phi printf_ulong::uvalue#14 = printf_ulong::uvalue#11 [phi:main_vera_flash::@56->printf_ulong#3] -- register_copy + jsr printf_ulong + // [1330] phi from main_vera_flash::@56 to main_vera_flash::@57 [phi:main_vera_flash::@56->main_vera_flash::@57] + // main_vera_flash::@57 + // sprintf(info_text, "%u differences!", vera_differences) + // [1331] call printf_str + // [1125] phi from main_vera_flash::@57 to printf_str [phi:main_vera_flash::@57->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:main_vera_flash::@57->printf_str#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_str.putc+1 + // [1125] phi printf_str::s#79 = s11 [phi:main_vera_flash::@57->printf_str#1] -- pbuz1=pbuc1 + lda #s11 + sta.z printf_str.s+1 + jsr printf_str + // main_vera_flash::@58 + // sprintf(info_text, "%u differences!", vera_differences) + // [1332] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + lda #0 + pha + // [1333] callexecute snputc -- call_vprc1 + jsr snputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // display_info_vera(STATUS_ERROR, info_text) + // [1335] call display_info_vera + // [1930] phi from main_vera_flash::@58 to display_info_vera [phi:main_vera_flash::@58->display_info_vera] + // [1930] phi display_info_vera::info_text#15 = info_text [phi:main_vera_flash::@58->display_info_vera#0] -- pbuz1=pbuc1 + lda #<@info_text + sta.z display_info_vera.info_text + lda #>@info_text + sta.z display_info_vera.info_text+1 + // [1930] phi display_info_vera::info_status#15 = STATUS_ERROR [phi:main_vera_flash::@58->display_info_vera#1] -- vbum1=vbuc1 + lda #STATUS_ERROR + sta display_info_vera.info_status + jsr display_info_vera + // [1336] phi from main_vera_flash::@10 main_vera_flash::@48 main_vera_flash::@58 to main_vera_flash::@15 [phi:main_vera_flash::@10/main_vera_flash::@48/main_vera_flash::@58->main_vera_flash::@15] + // main_vera_flash::@15 + __b15: + // display_action_progress("VERA SPI de-activation ...") + // [1337] call display_action_progress + // Now we loop until jumper JP1 is open again! + // [1155] phi from main_vera_flash::@15 to display_action_progress [phi:main_vera_flash::@15->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = main_vera_flash::info_text13 [phi:main_vera_flash::@15->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text13 + sta.z display_action_progress.info_text+1 + jsr display_action_progress + // [1338] phi from main_vera_flash::@15 to main_vera_flash::@59 [phi:main_vera_flash::@15->main_vera_flash::@59] + // main_vera_flash::@59 + // display_action_text("Please OPEN the jumper JP1 on the VERA board!") + // [1339] call display_action_text + // [1200] phi from main_vera_flash::@59 to display_action_text [phi:main_vera_flash::@59->display_action_text] + // [1200] phi display_action_text::info_text#25 = main_vera_flash::info_text14 [phi:main_vera_flash::@59->display_action_text#0] -- pbuz1=pbuc1 + lda #info_text14 + sta.z display_action_text.info_text+1 + jsr display_action_text + // [1340] phi from main_vera_flash::@59 main_vera_flash::@61 main_vera_flash::@64 main_vera_flash::@65 to main_vera_flash::@16 [phi:main_vera_flash::@59/main_vera_flash::@61/main_vera_flash::@64/main_vera_flash::@65->main_vera_flash::@16] + __b5: + // [1340] phi main_vera_flash::spi_ensure_detect#12 = 0 [phi:main_vera_flash::@59/main_vera_flash::@61/main_vera_flash::@64/main_vera_flash::@65->main_vera_flash::@16#0] -- vbum1=vbuc1 + lda #0 + sta spi_ensure_detect_1 + // main_vera_flash::@16 + __b16: + // while(spi_ensure_detect < 16) + // [1341] if(main_vera_flash::spi_ensure_detect#12<$10) goto main_vera_flash::@17 -- vbum1_lt_vbuc1_then_la1 + lda spi_ensure_detect_1 + cmp #$10 + bcc __b17 + // [1342] phi from main_vera_flash::@16 to main_vera_flash::@18 [phi:main_vera_flash::@16->main_vera_flash::@18] + // main_vera_flash::@18 + // display_action_text("The jumper JP1 has been opened on the VERA!") + // [1343] call display_action_text + // [1200] phi from main_vera_flash::@18 to display_action_text [phi:main_vera_flash::@18->display_action_text] + // [1200] phi display_action_text::info_text#25 = main_vera_flash::info_text15 [phi:main_vera_flash::@18->display_action_text#0] -- pbuz1=pbuc1 + lda #info_text15 + sta.z display_action_text.info_text+1 + jsr display_action_text + // [1344] phi from main_vera_flash::@18 main_vera_flash::@26 to main_vera_flash::@1 [phi:main_vera_flash::@18/main_vera_flash::@26->main_vera_flash::@1] + // main_vera_flash::@1 + __b1: + // spi_deselect() + // [1345] call spi_deselect + jsr spi_deselect + // [1346] phi from main_vera_flash::@1 to main_vera_flash::@27 [phi:main_vera_flash::@1->main_vera_flash::@27] + // main_vera_flash::@27 + // wait_moment(16) + // [1347] call wait_moment + // [1134] phi from main_vera_flash::@27 to wait_moment [phi:main_vera_flash::@27->wait_moment] + // [1134] phi wait_moment::w#17 = $10 [phi:main_vera_flash::@27->wait_moment#0] -- vbuz1=vbuc1 + lda #$10 + sta.z wait_moment.w + jsr wait_moment + rts + // [1348] phi from main_vera_flash::@16 to main_vera_flash::@17 [phi:main_vera_flash::@16->main_vera_flash::@17] + // main_vera_flash::@17 + __b17: + // w25q16_detect() + // [1349] call w25q16_detect + // [2223] phi from main_vera_flash::@17 to w25q16_detect [phi:main_vera_flash::@17->w25q16_detect] + jsr w25q16_detect + // [1350] phi from main_vera_flash::@17 to main_vera_flash::@60 [phi:main_vera_flash::@17->main_vera_flash::@60] + // main_vera_flash::@60 + // wait_moment(1) + // [1351] call wait_moment + // [1134] phi from main_vera_flash::@60 to wait_moment [phi:main_vera_flash::@60->wait_moment] + // [1134] phi wait_moment::w#17 = 1 [phi:main_vera_flash::@60->wait_moment#0] -- vbuz1=vbuc1 + lda #1 + sta.z wait_moment.w + jsr wait_moment + // main_vera_flash::@61 + // if(spi_manufacturer != 0xEF && spi_memory_type != 0x40 && spi_memory_capacity != 0x15) + // [1352] if(spi_manufacturer#0==$ef) goto main_vera_flash::@16 -- vbuxx_eq_vbuc1_then_la1 + cpx #$ef + beq __b5 + // main_vera_flash::@65 + // [1353] if(spi_memory_type#0==$40) goto main_vera_flash::@16 -- vbuyy_eq_vbuc1_then_la1 + cpy #$40 + beq __b5 + // main_vera_flash::@64 + // [1354] if(spi_memory_capacity#0!=$15) goto main_vera_flash::@19 -- vbum1_neq_vbuc1_then_la1 + lda #$15 + cmp spi_memory_capacity + bne __b19 + jmp __b5 + // main_vera_flash::@19 + __b19: + // spi_ensure_detect++; + // [1355] main_vera_flash::spi_ensure_detect#4 = ++ main_vera_flash::spi_ensure_detect#12 -- vbum1=_inc_vbum1 + inc spi_ensure_detect_1 + // [1340] phi from main_vera_flash::@19 to main_vera_flash::@16 [phi:main_vera_flash::@19->main_vera_flash::@16] + // [1340] phi main_vera_flash::spi_ensure_detect#12 = main_vera_flash::spi_ensure_detect#4 [phi:main_vera_flash::@19->main_vera_flash::@16#0] -- register_copy + jmp __b16 + // [1356] phi from main_vera_flash::@34 to main_vera_flash::@10 [phi:main_vera_flash::@34->main_vera_flash::@10] + // main_vera_flash::@10 + __b10: + // display_info_vera(STATUS_SKIP, "No update required") + // [1357] call display_info_vera + // VFL1 | VERA and VERA.BIN equal | Display that there are no differences between the VERA and VERA.BIN. Set VERA to Flashed. | None + // [1930] phi from main_vera_flash::@10 to display_info_vera [phi:main_vera_flash::@10->display_info_vera] + // [1930] phi display_info_vera::info_text#15 = info_text6 [phi:main_vera_flash::@10->display_info_vera#0] -- pbuz1=pbuc1 + lda #info_text6 + sta.z display_info_vera.info_text+1 + // [1930] phi display_info_vera::info_status#15 = STATUS_SKIP [phi:main_vera_flash::@10->display_info_vera#1] -- vbum1=vbuc1 + lda #STATUS_SKIP + sta display_info_vera.info_status + jsr display_info_vera + jmp __b15 + // [1358] phi from main_vera_flash::@3 to main_vera_flash::@4 [phi:main_vera_flash::@3->main_vera_flash::@4] + // main_vera_flash::@4 + __b4: + // w25q16_detect() + // [1359] call w25q16_detect + // [2223] phi from main_vera_flash::@4 to w25q16_detect [phi:main_vera_flash::@4->w25q16_detect] + jsr w25q16_detect + // [1360] phi from main_vera_flash::@4 to main_vera_flash::@29 [phi:main_vera_flash::@4->main_vera_flash::@29] + // main_vera_flash::@29 + // wait_moment(1) + // [1361] call wait_moment + // [1134] phi from main_vera_flash::@29 to wait_moment [phi:main_vera_flash::@29->wait_moment] + // [1134] phi wait_moment::w#17 = 1 [phi:main_vera_flash::@29->wait_moment#0] -- vbuz1=vbuc1 + lda #1 + sta.z wait_moment.w + jsr wait_moment + // main_vera_flash::@30 + // if(spi_manufacturer == 0xEF && spi_memory_type == 0x40 && spi_memory_capacity == 0x15) + // [1362] if(spi_manufacturer#0!=$ef) goto main_vera_flash::@7 -- vbuxx_neq_vbuc1_then_la1 + cpx #$ef + bne __b7 + // main_vera_flash::@63 + // [1363] if(spi_memory_type#0!=$40) goto main_vera_flash::@7 -- vbuyy_neq_vbuc1_then_la1 + cpy #$40 + bne __b7 + // main_vera_flash::@62 + // [1364] if(spi_memory_capacity#0==$15) goto main_vera_flash::@6 -- vbum1_eq_vbuc1_then_la1 + lda #$15 + cmp spi_memory_capacity + beq __b6 + // [1365] phi from main_vera_flash::@30 main_vera_flash::@62 main_vera_flash::@63 to main_vera_flash::@7 [phi:main_vera_flash::@30/main_vera_flash::@62/main_vera_flash::@63->main_vera_flash::@7] + // main_vera_flash::@7 + __b7: + // display_info_vera(STATUS_WAITING, "Close JP1 jumper pins!") + // [1366] call display_info_vera + // [1930] phi from main_vera_flash::@7 to display_info_vera [phi:main_vera_flash::@7->display_info_vera] + // [1930] phi display_info_vera::info_text#15 = main_vera_flash::info_text5 [phi:main_vera_flash::@7->display_info_vera#0] -- pbuz1=pbuc1 + lda #info_text5 + sta.z display_info_vera.info_text+1 + // [1930] phi display_info_vera::info_status#15 = STATUS_WAITING [phi:main_vera_flash::@7->display_info_vera#1] -- vbum1=vbuc1 + lda #STATUS_WAITING + sta display_info_vera.info_status + jsr display_info_vera jmp __b2 + // main_vera_flash::@6 + __b6: + // spi_ensure_detect++; + // [1367] main_vera_flash::spi_ensure_detect#1 = ++ main_vera_flash::spi_ensure_detect#11 -- vbum1=_inc_vbum1 + inc spi_ensure_detect + // [1255] phi from main_vera_flash::@6 to main_vera_flash::@3 [phi:main_vera_flash::@6->main_vera_flash::@3] + // [1255] phi main_vera_flash::spi_ensure_detect#11 = main_vera_flash::spi_ensure_detect#1 [phi:main_vera_flash::@6->main_vera_flash::@3#0] -- register_copy + jmp __b3 + .segment Data + s: .text "Reading VERA.BIN ... (.) data ( ) empty" + .byte 0 + info_text: .text "VERA SPI activation ..." + .byte 0 + info_text1: .text "Please close the jumper JP1 on the VERA board!" + .byte 0 + info_text2: .text "The jumper JP1 has been closed on the VERA!" + .byte 0 + info_text3: .text "Comparing VERA ... (.) data, (=) same, (*) different." + .byte 0 + info_text5: .text "Close JP1 jumper pins!" + .byte 0 + info_text7: .text "There was an error cleaning your VERA flash memory!" + .byte 0 + info_text8: .text "DO NOT RESET or REBOOT YOUR CX16 AND WAIT!" + .byte 0 + info_text9: .text "ERASE ERROR!" + .byte 0 + info_text10: .text "There was an error updating your VERA flash memory!" + .byte 0 + info_text12: .text "FLASH ERROR!" + .byte 0 + info_text13: .text "VERA SPI de-activation ..." + .byte 0 + info_text14: .text "Please OPEN the jumper JP1 on the VERA board!" + .byte 0 + info_text15: .text "The jumper JP1 has been opened on the VERA!" + .byte 0 + vera_differences: .dword 0 + spi_ensure_detect: .byte 0 + .label vera_flashed = printf_ulong.uvalue + .label vera_differences1 = printf_ulong.uvalue + spi_ensure_detect_1: .byte 0 } +.segment Code // display_info_rom /** * @brief Display the ROM status of a specific rom chip. @@ -7813,103 +8606,86 @@ display_progress_clear: { * @param info_status The status. * @param info_text The status text. */ -// void display_info_rom(__mem() char rom_chip, __zp($ec) char info_status, __zp($ba) char *info_text) +// void display_info_rom(__mem() char rom_chip, __mem() char info_status, __zp($78) char *info_text) display_info_rom: { - .label display_info_rom__6 = $75 - .label display_info_rom__15 = $ec - .label display_info_rom__16 = $af - .label x = $2a - .label y = $76 - .label info_status = $ec - .label info_text = $ba - .label display_info_rom__19 = $75 - .label display_info_rom__20 = $75 + .label info_text = $78 // unsigned char x = wherex() - // [1177] call wherex + // [1369] call wherex jsr wherex - // [1178] wherex::return#12 = wherex::return#0 + // [1370] wherex::return#12 = wherex::return#0 // display_info_rom::@3 - // [1179] display_info_rom::x#0 = wherex::return#12 -- vbuz1=vbum2 - lda wherex.return - sta.z x + // [1371] display_info_rom::x#0 = wherex::return#12 -- vbum1=vbuaa + sta x // unsigned char y = wherey() - // [1180] call wherey + // [1372] call wherey jsr wherey - // [1181] wherey::return#12 = wherey::return#0 + // [1373] wherey::return#12 = wherey::return#0 // display_info_rom::@4 - // [1182] display_info_rom::y#0 = wherey::return#12 -- vbuz1=vbum2 - lda wherey.return - sta.z y + // [1374] display_info_rom::y#0 = wherey::return#12 -- vbum1=vbuaa + sta y // status_rom[rom_chip] = info_status - // [1183] status_rom[display_info_rom::rom_chip#16] = display_info_rom::info_status#16 -- pbuc1_derefidx_vbum1=vbuz2 - lda.z info_status + // [1375] status_rom[display_info_rom::rom_chip#16] = display_info_rom::info_status#16 -- pbuc1_derefidx_vbum1=vbum2 + lda info_status ldy rom_chip sta status_rom,y // display_rom_led(rom_chip, status_color[info_status]) - // [1184] display_rom_led::chip#1 = display_info_rom::rom_chip#16 -- vbuz1=vbum2 + // [1376] display_rom_led::chip#1 = display_info_rom::rom_chip#16 -- vbuz1=vbum2 tya sta.z display_rom_led.chip - // [1185] display_rom_led::c#1 = status_color[display_info_rom::info_status#16] -- vbuz1=pbuc1_derefidx_vbuz2 - ldy.z info_status + // [1377] display_rom_led::c#1 = status_color[display_info_rom::info_status#16] -- vbuz1=pbuc1_derefidx_vbum2 + ldy info_status lda status_color,y sta.z display_rom_led.c - // [1186] call display_rom_led - // [2077] phi from display_info_rom::@4 to display_rom_led [phi:display_info_rom::@4->display_rom_led] - // [2077] phi display_rom_led::c#2 = display_rom_led::c#1 [phi:display_info_rom::@4->display_rom_led#0] -- register_copy - // [2077] phi display_rom_led::chip#2 = display_rom_led::chip#1 [phi:display_info_rom::@4->display_rom_led#1] -- register_copy + // [1378] call display_rom_led + // [2262] phi from display_info_rom::@4 to display_rom_led [phi:display_info_rom::@4->display_rom_led] + // [2262] phi display_rom_led::c#2 = display_rom_led::c#1 [phi:display_info_rom::@4->display_rom_led#0] -- register_copy + // [2262] phi display_rom_led::chip#2 = display_rom_led::chip#1 [phi:display_info_rom::@4->display_rom_led#1] -- register_copy jsr display_rom_led // display_info_rom::@5 // gotoxy(INFO_X, INFO_Y+rom_chip+2) - // [1187] gotoxy::y#19 = display_info_rom::rom_chip#16 + $11+2 -- vbum1=vbum2_plus_vbuc1 + // [1379] gotoxy::y#19 = display_info_rom::rom_chip#16 + $11+2 -- vbum1=vbum2_plus_vbuc1 lda #$11+2 clc adc rom_chip sta gotoxy.y - // [1188] call gotoxy - // [778] phi from display_info_rom::@5 to gotoxy [phi:display_info_rom::@5->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#19 [phi:display_info_rom::@5->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = 4 [phi:display_info_rom::@5->gotoxy#1] -- vbum1=vbuc1 - lda #4 - sta gotoxy.x + // [1380] call gotoxy + // [805] phi from display_info_rom::@5 to gotoxy [phi:display_info_rom::@5->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#19 [phi:display_info_rom::@5->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = 4 [phi:display_info_rom::@5->gotoxy#1] -- vbuyy=vbuc1 + ldy #4 jsr gotoxy // display_info_rom::@6 // printf("ROM%u %-9s %-6s %-13s ", rom_chip, status_text[info_status], rom_device_names[rom_chip], &rom_release_text[rom_chip*13]) - // [1189] display_info_rom::$16 = display_info_rom::rom_chip#16 << 1 -- vbuz1=vbum2_rol_1 + // [1381] display_info_rom::$16 = display_info_rom::rom_chip#16 << 1 -- vbum1=vbum2_rol_1 lda rom_chip asl - sta.z display_info_rom__16 + sta display_info_rom__16 // rom_chip*13 - // [1190] display_info_rom::$19 = display_info_rom::$16 + display_info_rom::rom_chip#16 -- vbuz1=vbuz2_plus_vbum3 - lda rom_chip + // [1382] display_info_rom::$19 = display_info_rom::$16 + display_info_rom::rom_chip#16 -- vbuaa=vbum1_plus_vbum2 clc - adc.z display_info_rom__16 - sta.z display_info_rom__19 - // [1191] display_info_rom::$20 = display_info_rom::$19 << 2 -- vbuz1=vbuz1_rol_2 - lda.z display_info_rom__20 + adc rom_chip + // [1383] display_info_rom::$20 = display_info_rom::$19 << 2 -- vbuaa=vbuaa_rol_2 asl asl - sta.z display_info_rom__20 - // [1192] display_info_rom::$6 = display_info_rom::$20 + display_info_rom::rom_chip#16 -- vbuz1=vbuz1_plus_vbum2 - lda rom_chip + // [1384] display_info_rom::$6 = display_info_rom::$20 + display_info_rom::rom_chip#16 -- vbuaa=vbuaa_plus_vbum1 clc - adc.z display_info_rom__6 - sta.z display_info_rom__6 + adc rom_chip // printf("ROM%u %-9s %-6s %-13s ", rom_chip, status_text[info_status], rom_device_names[rom_chip], &rom_release_text[rom_chip*13]) - // [1193] printf_string::str#10 = rom_release_text + display_info_rom::$6 -- pbum1=pbuc1_plus_vbuz2 + // [1385] printf_string::str#10 = rom_release_text + display_info_rom::$6 -- pbum1=pbuc1_plus_vbuaa clc adc #rom_release_text adc #0 sta printf_string.str_1+1 - // [1194] call printf_str - // [1054] phi from display_info_rom::@6 to printf_str [phi:display_info_rom::@6->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:display_info_rom::@6->printf_str#0] -- pprz1=pprc1 + // [1386] call printf_str + // [1125] phi from display_info_rom::@6 to printf_str [phi:display_info_rom::@6->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:display_info_rom::@6->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = chip [phi:display_info_rom::@6->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = chip [phi:display_info_rom::@6->printf_str#1] -- pbuz1=pbuc1 lda #chip @@ -7917,37 +8693,35 @@ display_info_rom: { jsr printf_str // display_info_rom::@7 // printf("ROM%u %-9s %-6s %-13s ", rom_chip, status_text[info_status], rom_device_names[rom_chip], &rom_release_text[rom_chip*13]) - // [1195] printf_uchar::uvalue#3 = display_info_rom::rom_chip#16 -- vbum1=vbum2 - lda rom_chip - sta printf_uchar.uvalue - // [1196] call printf_uchar - // [1118] phi from display_info_rom::@7 to printf_uchar [phi:display_info_rom::@7->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 0 [phi:display_info_rom::@7->printf_uchar#0] -- vbum1=vbuc1 + // [1387] printf_uchar::uvalue#0 = display_info_rom::rom_chip#16 -- vbuxx=vbum1 + ldx rom_chip + // [1388] call printf_uchar + // [1189] phi from display_info_rom::@7 to printf_uchar [phi:display_info_rom::@7->printf_uchar] + // [1189] phi printf_uchar::format_zero_padding#15 = 0 [phi:display_info_rom::@7->printf_uchar#0] -- vbum1=vbuc1 lda #0 sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 0 [phi:display_info_rom::@7->printf_uchar#1] -- vbum1=vbuc1 + // [1189] phi printf_uchar::format_min_length#15 = 0 [phi:display_info_rom::@7->printf_uchar#1] -- vbum1=vbuc1 sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &cputc [phi:display_info_rom::@7->printf_uchar#2] -- pprz1=pprc1 + // [1189] phi printf_uchar::putc#15 = &cputc [phi:display_info_rom::@7->printf_uchar#2] -- pprz1=pprc1 lda #cputc sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = DECIMAL [phi:display_info_rom::@7->printf_uchar#3] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = printf_uchar::uvalue#3 [phi:display_info_rom::@7->printf_uchar#4] -- register_copy + // [1189] phi printf_uchar::format_radix#15 = DECIMAL [phi:display_info_rom::@7->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL + // [1189] phi printf_uchar::uvalue#15 = printf_uchar::uvalue#0 [phi:display_info_rom::@7->printf_uchar#4] -- register_copy jsr printf_uchar - // [1197] phi from display_info_rom::@7 to display_info_rom::@8 [phi:display_info_rom::@7->display_info_rom::@8] + // [1389] phi from display_info_rom::@7 to display_info_rom::@8 [phi:display_info_rom::@7->display_info_rom::@8] // display_info_rom::@8 // printf("ROM%u %-9s %-6s %-13s ", rom_chip, status_text[info_status], rom_device_names[rom_chip], &rom_release_text[rom_chip*13]) - // [1198] call printf_str - // [1054] phi from display_info_rom::@8 to printf_str [phi:display_info_rom::@8->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:display_info_rom::@8->printf_str#0] -- pprz1=pprc1 + // [1390] call printf_str + // [1125] phi from display_info_rom::@8 to printf_str [phi:display_info_rom::@8->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:display_info_rom::@8->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s [phi:display_info_rom::@8->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s [phi:display_info_rom::@8->printf_str#1] -- pbuz1=pbuc1 lda #s @@ -7955,40 +8729,41 @@ display_info_rom: { jsr printf_str // display_info_rom::@9 // printf("ROM%u %-9s %-6s %-13s ", rom_chip, status_text[info_status], rom_device_names[rom_chip], &rom_release_text[rom_chip*13]) - // [1199] display_info_rom::$15 = display_info_rom::info_status#16 << 1 -- vbuz1=vbuz1_rol_1 - asl.z display_info_rom__15 - // [1200] printf_string::str#8 = status_text[display_info_rom::$15] -- pbuz1=qbuc1_derefidx_vbuz2 - ldy.z display_info_rom__15 + // [1391] display_info_rom::$15 = display_info_rom::info_status#16 << 1 -- vbuaa=vbum1_rol_1 + lda info_status + asl + // [1392] printf_string::str#8 = status_text[display_info_rom::$15] -- pbuz1=qbuc1_derefidx_vbuaa + tay lda status_text,y sta.z printf_string.str lda status_text+1,y sta.z printf_string.str+1 - // [1201] call printf_string - // [1227] phi from display_info_rom::@9 to printf_string [phi:display_info_rom::@9->printf_string] - // [1227] phi printf_string::putc#25 = &cputc [phi:display_info_rom::@9->printf_string#0] -- pprz1=pprc1 + // [1393] call printf_string + // [1419] phi from display_info_rom::@9 to printf_string [phi:display_info_rom::@9->printf_string] + // [1419] phi printf_string::putc#26 = &cputc [phi:display_info_rom::@9->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#8 [phi:display_info_rom::@9->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 1 [phi:display_info_rom::@9->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#8 [phi:display_info_rom::@9->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 1 [phi:display_info_rom::@9->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 9 [phi:display_info_rom::@9->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 9 [phi:display_info_rom::@9->printf_string#3] -- vbum1=vbuc1 lda #9 sta printf_string.format_min_length jsr printf_string - // [1202] phi from display_info_rom::@9 to display_info_rom::@10 [phi:display_info_rom::@9->display_info_rom::@10] + // [1394] phi from display_info_rom::@9 to display_info_rom::@10 [phi:display_info_rom::@9->display_info_rom::@10] // display_info_rom::@10 // printf("ROM%u %-9s %-6s %-13s ", rom_chip, status_text[info_status], rom_device_names[rom_chip], &rom_release_text[rom_chip*13]) - // [1203] call printf_str - // [1054] phi from display_info_rom::@10 to printf_str [phi:display_info_rom::@10->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:display_info_rom::@10->printf_str#0] -- pprz1=pprc1 + // [1395] call printf_str + // [1125] phi from display_info_rom::@10 to printf_str [phi:display_info_rom::@10->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:display_info_rom::@10->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s [phi:display_info_rom::@10->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s [phi:display_info_rom::@10->printf_str#1] -- pbuz1=pbuc1 lda #s @@ -7996,76 +8771,76 @@ display_info_rom: { jsr printf_str // display_info_rom::@11 // printf("ROM%u %-9s %-6s %-13s ", rom_chip, status_text[info_status], rom_device_names[rom_chip], &rom_release_text[rom_chip*13]) - // [1204] printf_string::str#9 = rom_device_names[display_info_rom::$16] -- pbuz1=qbuc1_derefidx_vbuz2 - ldy.z display_info_rom__16 + // [1396] printf_string::str#9 = rom_device_names[display_info_rom::$16] -- pbuz1=qbuc1_derefidx_vbum2 + ldy display_info_rom__16 lda rom_device_names,y sta.z printf_string.str lda rom_device_names+1,y sta.z printf_string.str+1 - // [1205] call printf_string - // [1227] phi from display_info_rom::@11 to printf_string [phi:display_info_rom::@11->printf_string] - // [1227] phi printf_string::putc#25 = &cputc [phi:display_info_rom::@11->printf_string#0] -- pprz1=pprc1 + // [1397] call printf_string + // [1419] phi from display_info_rom::@11 to printf_string [phi:display_info_rom::@11->printf_string] + // [1419] phi printf_string::putc#26 = &cputc [phi:display_info_rom::@11->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#9 [phi:display_info_rom::@11->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 1 [phi:display_info_rom::@11->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#9 [phi:display_info_rom::@11->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 1 [phi:display_info_rom::@11->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 6 [phi:display_info_rom::@11->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 6 [phi:display_info_rom::@11->printf_string#3] -- vbum1=vbuc1 lda #6 sta printf_string.format_min_length jsr printf_string - // [1206] phi from display_info_rom::@11 to display_info_rom::@12 [phi:display_info_rom::@11->display_info_rom::@12] + // [1398] phi from display_info_rom::@11 to display_info_rom::@12 [phi:display_info_rom::@11->display_info_rom::@12] // display_info_rom::@12 // printf("ROM%u %-9s %-6s %-13s ", rom_chip, status_text[info_status], rom_device_names[rom_chip], &rom_release_text[rom_chip*13]) - // [1207] call printf_str - // [1054] phi from display_info_rom::@12 to printf_str [phi:display_info_rom::@12->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:display_info_rom::@12->printf_str#0] -- pprz1=pprc1 + // [1399] call printf_str + // [1125] phi from display_info_rom::@12 to printf_str [phi:display_info_rom::@12->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:display_info_rom::@12->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s [phi:display_info_rom::@12->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s [phi:display_info_rom::@12->printf_str#1] -- pbuz1=pbuc1 lda #s sta.z printf_str.s+1 jsr printf_str // display_info_rom::@13 - // [1208] printf_string::str#40 = printf_string::str#10 -- pbuz1=pbum2 + // [1400] printf_string::str#41 = printf_string::str#10 -- pbuz1=pbum2 lda printf_string.str_1 sta.z printf_string.str lda printf_string.str_1+1 sta.z printf_string.str+1 // printf("ROM%u %-9s %-6s %-13s ", rom_chip, status_text[info_status], rom_device_names[rom_chip], &rom_release_text[rom_chip*13]) - // [1209] call printf_string - // [1227] phi from display_info_rom::@13 to printf_string [phi:display_info_rom::@13->printf_string] - // [1227] phi printf_string::putc#25 = &cputc [phi:display_info_rom::@13->printf_string#0] -- pprz1=pprc1 + // [1401] call printf_string + // [1419] phi from display_info_rom::@13 to printf_string [phi:display_info_rom::@13->printf_string] + // [1419] phi printf_string::putc#26 = &cputc [phi:display_info_rom::@13->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#40 [phi:display_info_rom::@13->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 1 [phi:display_info_rom::@13->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#41 [phi:display_info_rom::@13->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 1 [phi:display_info_rom::@13->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = $d [phi:display_info_rom::@13->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = $d [phi:display_info_rom::@13->printf_string#3] -- vbum1=vbuc1 lda #$d sta printf_string.format_min_length jsr printf_string - // [1210] phi from display_info_rom::@13 to display_info_rom::@14 [phi:display_info_rom::@13->display_info_rom::@14] + // [1402] phi from display_info_rom::@13 to display_info_rom::@14 [phi:display_info_rom::@13->display_info_rom::@14] // display_info_rom::@14 // printf("ROM%u %-9s %-6s %-13s ", rom_chip, status_text[info_status], rom_device_names[rom_chip], &rom_release_text[rom_chip*13]) - // [1211] call printf_str - // [1054] phi from display_info_rom::@14 to printf_str [phi:display_info_rom::@14->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:display_info_rom::@14->printf_str#0] -- pprz1=pprc1 + // [1403] call printf_str + // [1125] phi from display_info_rom::@14 to printf_str [phi:display_info_rom::@14->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:display_info_rom::@14->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s [phi:display_info_rom::@14->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s [phi:display_info_rom::@14->printf_str#1] -- pbuz1=pbuc1 lda #s @@ -8073,7 +8848,7 @@ display_info_rom: { jsr printf_str // display_info_rom::@15 // if(info_text) - // [1212] if((char *)0==display_info_rom::info_text#16) goto display_info_rom::@1 -- pbuc1_eq_pbuz1_then_la1 + // [1404] if((char *)0==display_info_rom::info_text#16) goto display_info_rom::@1 -- pbuc1_eq_pbuz1_then_la1 lda.z info_text cmp #<0 bne !+ @@ -8083,73 +8858,73 @@ display_info_rom: { !: // display_info_rom::@2 // gotoxy(INFO_X+64-28, INFO_Y+rom_chip+2) - // [1213] gotoxy::y#21 = display_info_rom::rom_chip#16 + $11+2 -- vbum1=vbum2_plus_vbuc1 + // [1405] gotoxy::y#21 = display_info_rom::rom_chip#16 + $11+2 -- vbum1=vbum2_plus_vbuc1 lda #$11+2 clc adc rom_chip sta gotoxy.y - // [1214] call gotoxy - // [778] phi from display_info_rom::@2 to gotoxy [phi:display_info_rom::@2->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#21 [phi:display_info_rom::@2->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = 4+$40-$1c [phi:display_info_rom::@2->gotoxy#1] -- vbum1=vbuc1 - lda #4+$40-$1c - sta gotoxy.x + // [1406] call gotoxy + // [805] phi from display_info_rom::@2 to gotoxy [phi:display_info_rom::@2->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#21 [phi:display_info_rom::@2->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = 4+$40-$1c [phi:display_info_rom::@2->gotoxy#1] -- vbuyy=vbuc1 + ldy #4+$40-$1c jsr gotoxy // display_info_rom::@16 // printf("%-25s", info_text) - // [1215] printf_string::str#11 = display_info_rom::info_text#16 -- pbuz1=pbuz2 + // [1407] printf_string::str#11 = display_info_rom::info_text#16 -- pbuz1=pbuz2 lda.z info_text sta.z printf_string.str lda.z info_text+1 sta.z printf_string.str+1 - // [1216] call printf_string - // [1227] phi from display_info_rom::@16 to printf_string [phi:display_info_rom::@16->printf_string] - // [1227] phi printf_string::putc#25 = &cputc [phi:display_info_rom::@16->printf_string#0] -- pprz1=pprc1 + // [1408] call printf_string + // [1419] phi from display_info_rom::@16 to printf_string [phi:display_info_rom::@16->printf_string] + // [1419] phi printf_string::putc#26 = &cputc [phi:display_info_rom::@16->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#11 [phi:display_info_rom::@16->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 1 [phi:display_info_rom::@16->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#11 [phi:display_info_rom::@16->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 1 [phi:display_info_rom::@16->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = $19 [phi:display_info_rom::@16->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = $19 [phi:display_info_rom::@16->printf_string#3] -- vbum1=vbuc1 lda #$19 sta printf_string.format_min_length jsr printf_string // display_info_rom::@1 __b1: // gotoxy(x,y) - // [1217] gotoxy::x#20 = display_info_rom::x#0 -- vbum1=vbuz2 - lda.z x - sta gotoxy.x - // [1218] gotoxy::y#20 = display_info_rom::y#0 -- vbum1=vbuz2 - lda.z y + // [1409] gotoxy::x#20 = display_info_rom::x#0 -- vbuyy=vbum1 + ldy x + // [1410] gotoxy::y#20 = display_info_rom::y#0 -- vbum1=vbum2 + lda y sta gotoxy.y - // [1219] call gotoxy - // [778] phi from display_info_rom::@1 to gotoxy [phi:display_info_rom::@1->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#20 [phi:display_info_rom::@1->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = gotoxy::x#20 [phi:display_info_rom::@1->gotoxy#1] -- register_copy + // [1411] call gotoxy + // [805] phi from display_info_rom::@1 to gotoxy [phi:display_info_rom::@1->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#20 [phi:display_info_rom::@1->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = gotoxy::x#20 [phi:display_info_rom::@1->gotoxy#1] -- register_copy jsr gotoxy // display_info_rom::@return // } - // [1220] return + // [1412] return rts .segment Data - .label rom_chip = main.check_status_rom1_main__0 + display_info_rom__16: .byte 0 + .label rom_chip = w25q16_erase.vera_current_64k_block + x: .byte 0 + y: .byte 0 + .label info_status = w25q16_verify.w25q16_compared_bytes } .segment Code // rom_file -// __mem() char * rom_file(__zp($ca) char rom_chip) +// __mem() char * rom_file(__register(A) char rom_chip) rom_file: { - .label rom_file__0 = $ca - .label rom_chip = $ca // if(rom_chip) - // [1222] if(0!=rom_file::rom_chip#2) goto rom_file::@1 -- 0_neq_vbuz1_then_la1 - lda.z rom_chip + // [1414] if(0!=rom_file::rom_chip#2) goto rom_file::@1 -- 0_neq_vbuaa_then_la1 + cmp #0 bne __b1 - // [1225] phi from rom_file to rom_file::@return [phi:rom_file->rom_file::@return] - // [1225] phi rom_file::return#2 = rom_file::file_rom_cx16 [phi:rom_file->rom_file::@return#0] -- pbum1=pbuc1 + // [1417] phi from rom_file to rom_file::@return [phi:rom_file->rom_file::@return] + // [1417] phi rom_file::return#2 = rom_file::file_rom_cx16 [phi:rom_file->rom_file::@return#0] -- pbum1=pbuc1 lda #file_rom_cx16 @@ -8158,23 +8933,21 @@ rom_file: { // rom_file::@1 __b1: // '0'+rom_chip - // [1223] rom_file::$0 = '0' + rom_file::rom_chip#2 -- vbuz1=vbuc1_plus_vbuz1 - lda #'0' + // [1415] rom_file::$0 = '0' + rom_file::rom_chip#2 -- vbuaa=vbuc1_plus_vbuaa clc - adc.z rom_file__0 - sta.z rom_file__0 + adc #'0' // file_rom_card[3] = '0'+rom_chip - // [1224] *(rom_file::file_rom_card+3) = rom_file::$0 -- _deref_pbuc1=vbuz1 + // [1416] *(rom_file::file_rom_card+3) = rom_file::$0 -- _deref_pbuc1=vbuaa sta file_rom_card+3 - // [1225] phi from rom_file::@1 to rom_file::@return [phi:rom_file::@1->rom_file::@return] - // [1225] phi rom_file::return#2 = rom_file::file_rom_card [phi:rom_file::@1->rom_file::@return#0] -- pbum1=pbuc1 + // [1417] phi from rom_file::@1 to rom_file::@return [phi:rom_file::@1->rom_file::@return] + // [1417] phi rom_file::return#2 = rom_file::file_rom_card [phi:rom_file::@1->rom_file::@return#0] -- pbum1=pbuc1 lda #file_rom_card sta return+1 // rom_file::@return // } - // [1226] return + // [1418] return rts .segment Data file_rom_cx16: .text "ROM.BIN" @@ -8187,65 +8960,64 @@ rom_file: { // printf_string // Print a string value using a specific format // Handles justification and min length -// void printf_string(__zp($3d) void (*putc)(char), __zp($60) char *str, __mem() char format_min_length, __mem() char format_justify_left) +// void printf_string(__zp($3a) void (*putc)(char), __zp($48) char *str, __mem() char format_min_length, __mem() char format_justify_left) printf_string: { - .label printf_string__9 = $b4 - .label str = $60 - .label putc = $3d + .label printf_string__9 = $25 + .label str = $48 + .label putc = $3a // if(format.min_length) - // [1228] if(0==printf_string::format_min_length#25) goto printf_string::@1 -- 0_eq_vbum1_then_la1 + // [1420] if(0==printf_string::format_min_length#26) goto printf_string::@1 -- 0_eq_vbum1_then_la1 lda format_min_length beq __b3 // printf_string::@3 // strlen(str) - // [1229] strlen::str#3 = printf_string::str#25 -- pbuz1=pbuz2 + // [1421] strlen::str#3 = printf_string::str#26 -- pbuz1=pbuz2 lda.z str sta.z strlen.str lda.z str+1 sta.z strlen.str+1 - // [1230] call strlen - // [2155] phi from printf_string::@3 to strlen [phi:printf_string::@3->strlen] - // [2155] phi strlen::str#8 = strlen::str#3 [phi:printf_string::@3->strlen#0] -- register_copy + // [1422] call strlen + // [2555] phi from printf_string::@3 to strlen [phi:printf_string::@3->strlen] + // [2555] phi strlen::str#8 = strlen::str#3 [phi:printf_string::@3->strlen#0] -- register_copy jsr strlen // strlen(str) - // [1231] strlen::return#10 = strlen::len#2 + // [1423] strlen::return#10 = strlen::len#2 // printf_string::@6 - // [1232] printf_string::$9 = strlen::return#10 -- vwuz1=vwum2 + // [1424] printf_string::$9 = strlen::return#10 -- vwuz1=vwum2 lda strlen.return sta.z printf_string__9 lda strlen.return+1 sta.z printf_string__9+1 // signed char len = (signed char)strlen(str) - // [1233] printf_string::len#0 = (signed char)printf_string::$9 -- vbsm1=_sbyte_vwuz2 + // [1425] printf_string::len#0 = (signed char)printf_string::$9 -- vbsaa=_sbyte_vwuz1 lda.z printf_string__9 - sta len // padding = (signed char)format.min_length - len - // [1234] printf_string::padding#1 = (signed char)printf_string::format_min_length#25 - printf_string::len#0 -- vbsm1=vbsm1_minus_vbsm2 - lda padding + // [1426] printf_string::padding#1 = (signed char)printf_string::format_min_length#26 - printf_string::len#0 -- vbsm1=vbsm1_minus_vbsaa + eor #$ff sec - sbc len + adc padding sta padding // if(padding<0) - // [1235] if(printf_string::padding#1>=0) goto printf_string::@10 -- vbsm1_ge_0_then_la1 + // [1427] if(printf_string::padding#1>=0) goto printf_string::@10 -- vbsm1_ge_0_then_la1 cmp #0 bpl __b1 - // [1237] phi from printf_string printf_string::@6 to printf_string::@1 [phi:printf_string/printf_string::@6->printf_string::@1] + // [1429] phi from printf_string printf_string::@6 to printf_string::@1 [phi:printf_string/printf_string::@6->printf_string::@1] __b3: - // [1237] phi printf_string::padding#3 = 0 [phi:printf_string/printf_string::@6->printf_string::@1#0] -- vbsm1=vbsc1 + // [1429] phi printf_string::padding#3 = 0 [phi:printf_string/printf_string::@6->printf_string::@1#0] -- vbsm1=vbsc1 lda #0 sta padding - // [1236] phi from printf_string::@6 to printf_string::@10 [phi:printf_string::@6->printf_string::@10] + // [1428] phi from printf_string::@6 to printf_string::@10 [phi:printf_string::@6->printf_string::@10] // printf_string::@10 - // [1237] phi from printf_string::@10 to printf_string::@1 [phi:printf_string::@10->printf_string::@1] - // [1237] phi printf_string::padding#3 = printf_string::padding#1 [phi:printf_string::@10->printf_string::@1#0] -- register_copy + // [1429] phi from printf_string::@10 to printf_string::@1 [phi:printf_string::@10->printf_string::@1] + // [1429] phi printf_string::padding#3 = printf_string::padding#1 [phi:printf_string::@10->printf_string::@1#0] -- register_copy // printf_string::@1 __b1: // if(!format.justify_left && padding) - // [1238] if(0!=printf_string::format_justify_left#25) goto printf_string::@2 -- 0_neq_vbum1_then_la1 + // [1430] if(0!=printf_string::format_justify_left#26) goto printf_string::@2 -- 0_neq_vbum1_then_la1 lda format_justify_left bne __b2 // printf_string::@8 - // [1239] if(0!=printf_string::padding#3) goto printf_string::@4 -- 0_neq_vbsm1_then_la1 + // [1431] if(0!=printf_string::padding#3) goto printf_string::@4 -- 0_neq_vbsm1_then_la1 lda padding cmp #0 bne __b4 @@ -8253,43 +9025,43 @@ printf_string: { // printf_string::@4 __b4: // printf_padding(putc, ' ',(char)padding) - // [1240] printf_padding::putc#3 = printf_string::putc#25 -- pprz1=pprz2 + // [1432] printf_padding::putc#3 = printf_string::putc#26 -- pprz1=pprz2 lda.z putc sta.z printf_padding.putc lda.z putc+1 sta.z printf_padding.putc+1 - // [1241] printf_padding::length#3 = (char)printf_string::padding#3 -- vbum1=vbum2 + // [1433] printf_padding::length#3 = (char)printf_string::padding#3 -- vbum1=vbum2 lda padding sta printf_padding.length - // [1242] call printf_padding - // [2161] phi from printf_string::@4 to printf_padding [phi:printf_string::@4->printf_padding] - // [2161] phi printf_padding::putc#7 = printf_padding::putc#3 [phi:printf_string::@4->printf_padding#0] -- register_copy - // [2161] phi printf_padding::pad#7 = ' ' [phi:printf_string::@4->printf_padding#1] -- vbum1=vbuc1 + // [1434] call printf_padding + // [2561] phi from printf_string::@4 to printf_padding [phi:printf_string::@4->printf_padding] + // [2561] phi printf_padding::putc#7 = printf_padding::putc#3 [phi:printf_string::@4->printf_padding#0] -- register_copy + // [2561] phi printf_padding::pad#7 = ' ' [phi:printf_string::@4->printf_padding#1] -- vbum1=vbuc1 lda #' ' sta printf_padding.pad - // [2161] phi printf_padding::length#6 = printf_padding::length#3 [phi:printf_string::@4->printf_padding#2] -- register_copy + // [2561] phi printf_padding::length#6 = printf_padding::length#3 [phi:printf_string::@4->printf_padding#2] -- register_copy jsr printf_padding // printf_string::@2 __b2: // printf_str(putc, str) - // [1243] printf_str::putc#1 = printf_string::putc#25 -- pprz1=pprz2 + // [1435] printf_str::putc#1 = printf_string::putc#26 -- pprz1=pprz2 lda.z putc sta.z printf_str.putc lda.z putc+1 sta.z printf_str.putc+1 - // [1244] printf_str::s#2 = printf_string::str#25 - // [1245] call printf_str - // [1054] phi from printf_string::@2 to printf_str [phi:printf_string::@2->printf_str] - // [1054] phi printf_str::putc#75 = printf_str::putc#1 [phi:printf_string::@2->printf_str#0] -- register_copy - // [1054] phi printf_str::s#75 = printf_str::s#2 [phi:printf_string::@2->printf_str#1] -- register_copy + // [1436] printf_str::s#2 = printf_string::str#26 + // [1437] call printf_str + // [1125] phi from printf_string::@2 to printf_str [phi:printf_string::@2->printf_str] + // [1125] phi printf_str::putc#79 = printf_str::putc#1 [phi:printf_string::@2->printf_str#0] -- register_copy + // [1125] phi printf_str::s#79 = printf_str::s#2 [phi:printf_string::@2->printf_str#1] -- register_copy jsr printf_str // printf_string::@7 // if(format.justify_left && padding) - // [1246] if(0==printf_string::format_justify_left#25) goto printf_string::@return -- 0_eq_vbum1_then_la1 + // [1438] if(0==printf_string::format_justify_left#26) goto printf_string::@return -- 0_eq_vbum1_then_la1 lda format_justify_left beq __breturn // printf_string::@9 - // [1247] if(0!=printf_string::padding#3) goto printf_string::@5 -- 0_neq_vbsm1_then_la1 + // [1439] if(0!=printf_string::padding#3) goto printf_string::@5 -- 0_neq_vbsm1_then_la1 lda padding cmp #0 bne __b5 @@ -8297,82 +9069,80 @@ printf_string: { // printf_string::@5 __b5: // printf_padding(putc, ' ',(char)padding) - // [1248] printf_padding::putc#4 = printf_string::putc#25 -- pprz1=pprz2 + // [1440] printf_padding::putc#4 = printf_string::putc#26 -- pprz1=pprz2 lda.z putc sta.z printf_padding.putc lda.z putc+1 sta.z printf_padding.putc+1 - // [1249] printf_padding::length#4 = (char)printf_string::padding#3 -- vbum1=vbum2 + // [1441] printf_padding::length#4 = (char)printf_string::padding#3 -- vbum1=vbum2 lda padding sta printf_padding.length - // [1250] call printf_padding - // [2161] phi from printf_string::@5 to printf_padding [phi:printf_string::@5->printf_padding] - // [2161] phi printf_padding::putc#7 = printf_padding::putc#4 [phi:printf_string::@5->printf_padding#0] -- register_copy - // [2161] phi printf_padding::pad#7 = ' ' [phi:printf_string::@5->printf_padding#1] -- vbum1=vbuc1 + // [1442] call printf_padding + // [2561] phi from printf_string::@5 to printf_padding [phi:printf_string::@5->printf_padding] + // [2561] phi printf_padding::putc#7 = printf_padding::putc#4 [phi:printf_string::@5->printf_padding#0] -- register_copy + // [2561] phi printf_padding::pad#7 = ' ' [phi:printf_string::@5->printf_padding#1] -- vbum1=vbuc1 lda #' ' sta printf_padding.pad - // [2161] phi printf_padding::length#6 = printf_padding::length#4 [phi:printf_string::@5->printf_padding#2] -- register_copy + // [2561] phi printf_padding::length#6 = printf_padding::length#4 [phi:printf_string::@5->printf_padding#2] -- register_copy jsr printf_padding // printf_string::@return __breturn: // } - // [1251] return + // [1443] return rts .segment Data - len: .byte 0 - .label padding = format_min_length - .label str_1 = fopen.cbm_k_setnam1_fopen__0 - format_min_length: .byte 0 + .label padding = printf_uchar.format_min_length + .label str_1 = display_print_chip.text_3 + .label format_min_length = printf_uchar.format_min_length format_justify_left: .byte 0 } .segment Code // rom_read -// __mem() unsigned long rom_read(__zp($c9) char rom_chip, __zp($4e) char *file, __zp($cd) char info_status, __zp($bf) char brom_bank_start, __zp($5a) unsigned long rom_size) +// __mem() unsigned long rom_read(__mem() char rom_chip, __zp($bb) char *file, __zp($c2) char info_status, __zp($dd) char brom_bank_start, __zp($42) unsigned long rom_size) rom_read: { .const bank_set_brom1_bank = 0 - .label rom_read__13 = $e8 - .label rom_read__24 = $2a - .label rom_package_read = $da - .label brom_bank_start = $bf - .label y = $4d - .label rom_bram_ptr = $66 + .label rom_read__13 = $e0 + .label fp = $e4 + .label rom_package_read = $db + .label brom_bank_start = $dd + .label y = $f2 + .label rom_bram_ptr = $65 /// Holds the amount of bytes actually read in the memory to be flashed. - .label rom_row_current = $56 + .label rom_row_current = $4e // We start for ROM from 0x0:0x7800 !!!! - .label rom_bram_bank = $6a - .label rom_chip = $c9 - .label file = $4e - .label rom_size = $5a - .label info_status = $cd - .label rom_action_text = $7e + .label rom_bram_bank = $da + .label file = $bb + .label rom_size = $42 + .label info_status = $c2 + .label rom_action_text = $d8 // rom_read::bank_set_bram1 // BRAM = bank - // [1253] BRAM = 0 -- vbuz1=vbuc1 + // [1445] BRAM = 0 -- vbuz1=vbuc1 lda #0 sta.z BRAM // rom_read::bank_set_brom1 // BROM = bank - // [1254] BROM = rom_read::bank_set_brom1_bank#0 -- vbuz1=vbuc1 + // [1446] BROM = rom_read::bank_set_brom1_bank#0 -- vbuz1=vbuc1 lda #bank_set_brom1_bank sta.z BROM // rom_read::@23 // if(info_status == STATUS_READING) - // [1255] if(rom_read::info_status#11==STATUS_READING) goto rom_read::@1 -- vbuz1_eq_vbuc1_then_la1 + // [1447] if(rom_read::info_status#11==STATUS_READING) goto rom_read::@1 -- vbuz1_eq_vbuc1_then_la1 lda #STATUS_READING cmp.z info_status beq __b1 - // [1257] phi from rom_read::@23 to rom_read::@2 [phi:rom_read::@23->rom_read::@2] - // [1257] phi rom_read::rom_action_text#10 = smc_action_text#2 [phi:rom_read::@23->rom_read::@2#0] -- pbuz1=pbuc1 + // [1449] phi from rom_read::@23 to rom_read::@2 [phi:rom_read::@23->rom_read::@2] + // [1449] phi rom_read::rom_action_text#10 = smc_action_text#2 [phi:rom_read::@23->rom_read::@2#0] -- pbuz1=pbuc1 lda #smc_action_text_1 sta.z rom_action_text+1 jmp __b2 - // [1256] phi from rom_read::@23 to rom_read::@1 [phi:rom_read::@23->rom_read::@1] + // [1448] phi from rom_read::@23 to rom_read::@1 [phi:rom_read::@23->rom_read::@1] // rom_read::@1 __b1: - // [1257] phi from rom_read::@1 to rom_read::@2 [phi:rom_read::@1->rom_read::@2] - // [1257] phi rom_read::rom_action_text#10 = smc_action_text#1 [phi:rom_read::@1->rom_read::@2#0] -- pbuz1=pbuc1 + // [1449] phi from rom_read::@1 to rom_read::@2 [phi:rom_read::@1->rom_read::@2] + // [1449] phi rom_read::rom_action_text#10 = smc_action_text#1 [phi:rom_read::@1->rom_read::@2#0] -- pbuz1=pbuc1 lda #smc_action_text @@ -8380,37 +9150,36 @@ rom_read: { // rom_read::@2 __b2: // unsigned long rom_address = rom_address_from_bank(brom_bank_start) - // [1258] rom_address_from_bank::rom_bank#0 = rom_read::brom_bank_start#10 -- vbum1=vbuz2 + // [1450] rom_address_from_bank::rom_bank#0 = rom_read::brom_bank_start#10 -- vbuaa=vbuz1 lda.z brom_bank_start - sta rom_address_from_bank.rom_bank - // [1259] call rom_address_from_bank - // [2169] phi from rom_read::@2 to rom_address_from_bank [phi:rom_read::@2->rom_address_from_bank] - // [2169] phi rom_address_from_bank::rom_bank#3 = rom_address_from_bank::rom_bank#0 [phi:rom_read::@2->rom_address_from_bank#0] -- register_copy + // [1451] call rom_address_from_bank + // [2569] phi from rom_read::@2 to rom_address_from_bank [phi:rom_read::@2->rom_address_from_bank] + // [2569] phi rom_address_from_bank::rom_bank#3 = rom_address_from_bank::rom_bank#0 [phi:rom_read::@2->rom_address_from_bank#0] -- register_copy jsr rom_address_from_bank // unsigned long rom_address = rom_address_from_bank(brom_bank_start) - // [1260] rom_address_from_bank::return#2 = rom_address_from_bank::return#0 + // [1452] rom_address_from_bank::return#2 = rom_address_from_bank::return#0 // rom_read::@25 - // [1261] rom_read::rom_address#0 = rom_address_from_bank::return#2 + // [1453] rom_read::rom_address#0 = rom_address_from_bank::return#2 // sprintf(info_text, "Opening %s from SD card ...", file) - // [1262] call snprintf_init - // [1113] phi from rom_read::@25 to snprintf_init [phi:rom_read::@25->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:rom_read::@25->snprintf_init#0] -- pbuz1=pbuc1 + // [1454] call snprintf_init + // [1184] phi from rom_read::@25 to snprintf_init [phi:rom_read::@25->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:rom_read::@25->snprintf_init#0] -- pbuz1=pbuc1 lda #info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [1263] phi from rom_read::@25 to rom_read::@26 [phi:rom_read::@25->rom_read::@26] + // [1455] phi from rom_read::@25 to rom_read::@26 [phi:rom_read::@25->rom_read::@26] // rom_read::@26 // sprintf(info_text, "Opening %s from SD card ...", file) - // [1264] call printf_str - // [1054] phi from rom_read::@26 to printf_str [phi:rom_read::@26->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:rom_read::@26->printf_str#0] -- pprz1=pprc1 + // [1456] call printf_str + // [1125] phi from rom_read::@26 to printf_str [phi:rom_read::@26->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:rom_read::@26->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = rom_read::s [phi:rom_read::@26->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = rom_read::s [phi:rom_read::@26->printf_str#1] -- pbuz1=pbuc1 lda #s @@ -8418,36 +9187,36 @@ rom_read: { jsr printf_str // rom_read::@27 // sprintf(info_text, "Opening %s from SD card ...", file) - // [1265] printf_string::str#17 = rom_read::file#10 -- pbuz1=pbuz2 + // [1457] printf_string::str#17 = rom_read::file#10 -- pbuz1=pbuz2 lda.z file sta.z printf_string.str lda.z file+1 sta.z printf_string.str+1 - // [1266] call printf_string - // [1227] phi from rom_read::@27 to printf_string [phi:rom_read::@27->printf_string] - // [1227] phi printf_string::putc#25 = &snputc [phi:rom_read::@27->printf_string#0] -- pprz1=pprc1 + // [1458] call printf_string + // [1419] phi from rom_read::@27 to printf_string [phi:rom_read::@27->printf_string] + // [1419] phi printf_string::putc#26 = &snputc [phi:rom_read::@27->printf_string#0] -- pprz1=pprc1 lda #snputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#17 [phi:rom_read::@27->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 0 [phi:rom_read::@27->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#17 [phi:rom_read::@27->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 0 [phi:rom_read::@27->printf_string#2] -- vbum1=vbuc1 lda #0 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 0 [phi:rom_read::@27->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 0 [phi:rom_read::@27->printf_string#3] -- vbum1=vbuc1 sta printf_string.format_min_length jsr printf_string - // [1267] phi from rom_read::@27 to rom_read::@28 [phi:rom_read::@27->rom_read::@28] + // [1459] phi from rom_read::@27 to rom_read::@28 [phi:rom_read::@27->rom_read::@28] // rom_read::@28 // sprintf(info_text, "Opening %s from SD card ...", file) - // [1268] call printf_str - // [1054] phi from rom_read::@28 to printf_str [phi:rom_read::@28->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:rom_read::@28->printf_str#0] -- pprz1=pprc1 + // [1460] call printf_str + // [1125] phi from rom_read::@28 to printf_str [phi:rom_read::@28->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:rom_read::@28->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = rom_read::s1 [phi:rom_read::@28->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = rom_read::s1 [phi:rom_read::@28->printf_str#1] -- pbuz1=pbuc1 lda #s1 @@ -8455,17 +9224,17 @@ rom_read: { jsr printf_str // rom_read::@29 // sprintf(info_text, "Opening %s from SD card ...", file) - // [1269] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [1461] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [1270] callexecute snputc -- call_vprc1 + // [1462] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [1272] call display_action_text - // [1129] phi from rom_read::@29 to display_action_text [phi:rom_read::@29->display_action_text] - // [1129] phi display_action_text::info_text#17 = info_text [phi:rom_read::@29->display_action_text#0] -- pbuz1=pbuc1 + // [1464] call display_action_text + // [1200] phi from rom_read::@29 to display_action_text [phi:rom_read::@29->display_action_text] + // [1200] phi display_action_text::info_text#25 = info_text [phi:rom_read::@29->display_action_text#0] -- pbuz1=pbuc1 lda #info_text @@ -8473,65 +9242,64 @@ rom_read: { jsr display_action_text // rom_read::@30 // FILE *fp = fopen(file, "r") - // [1273] fopen::path#3 = rom_read::file#10 -- pbuz1=pbuz2 + // [1465] fopen::path#3 = rom_read::file#10 -- pbuz1=pbuz2 lda.z file sta.z fopen.path lda.z file+1 sta.z fopen.path+1 - // [1274] call fopen - // [2173] phi from rom_read::@30 to fopen [phi:rom_read::@30->fopen] - // [2173] phi __errno#322 = __errno#114 [phi:rom_read::@30->fopen#0] -- register_copy - // [2173] phi fopen::pathtoken#0 = fopen::path#3 [phi:rom_read::@30->fopen#1] -- register_copy - // [2173] phi __stdio_filecount#18 = __stdio_filecount#108 [phi:rom_read::@30->fopen#2] -- register_copy + // [1466] call fopen + // [2573] phi from rom_read::@30 to fopen [phi:rom_read::@30->fopen] + // [2573] phi __errno#474 = __errno#103 [phi:rom_read::@30->fopen#0] -- register_copy + // [2573] phi fopen::pathtoken#0 = fopen::path#3 [phi:rom_read::@30->fopen#1] -- register_copy + // [2573] phi __stdio_filecount#27 = __stdio_filecount#126 [phi:rom_read::@30->fopen#2] -- register_copy jsr fopen // FILE *fp = fopen(file, "r") - // [1275] fopen::return#4 = fopen::return#2 + // [1467] fopen::return#4 = fopen::return#2 // rom_read::@31 - // [1276] rom_read::fp#0 = fopen::return#4 -- pssm1=pssz2 + // [1468] rom_read::fp#0 = fopen::return#4 -- pssz1=pssz2 lda.z fopen.return - sta fp + sta.z fp lda.z fopen.return+1 - sta fp+1 + sta.z fp+1 // if (fp) - // [1277] if((struct $2 *)0==rom_read::fp#0) goto rom_read::@3 -- pssc1_eq_pssm1_then_la1 - lda fp + // [1469] if((struct $2 *)0==rom_read::fp#0) goto rom_read::@3 -- pssc1_eq_pssz1_then_la1 + lda.z fp cmp #<0 bne !+ - lda fp+1 + lda.z fp+1 cmp #>0 beq __b4 !: - // [1278] phi from rom_read::@31 to rom_read::@4 [phi:rom_read::@31->rom_read::@4] + // [1470] phi from rom_read::@31 to rom_read::@4 [phi:rom_read::@31->rom_read::@4] // rom_read::@4 // gotoxy(x, y) - // [1279] call gotoxy - // [778] phi from rom_read::@4 to gotoxy [phi:rom_read::@4->gotoxy] - // [778] phi gotoxy::y#33 = PROGRESS_Y [phi:rom_read::@4->gotoxy#0] -- vbum1=vbuc1 + // [1471] call gotoxy + // [805] phi from rom_read::@4 to gotoxy [phi:rom_read::@4->gotoxy] + // [805] phi gotoxy::y#37 = PROGRESS_Y [phi:rom_read::@4->gotoxy#0] -- vbum1=vbuc1 lda #PROGRESS_Y sta gotoxy.y - // [778] phi gotoxy::x#33 = PROGRESS_X [phi:rom_read::@4->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x + // [805] phi gotoxy::x#37 = PROGRESS_X [phi:rom_read::@4->gotoxy#1] -- vbuyy=vbuc1 + ldy #PROGRESS_X jsr gotoxy - // [1280] phi from rom_read::@4 to rom_read::@5 [phi:rom_read::@4->rom_read::@5] - // [1280] phi rom_read::y#11 = PROGRESS_Y [phi:rom_read::@4->rom_read::@5#0] -- vbuz1=vbuc1 + // [1472] phi from rom_read::@4 to rom_read::@5 [phi:rom_read::@4->rom_read::@5] + // [1472] phi rom_read::y#11 = PROGRESS_Y [phi:rom_read::@4->rom_read::@5#0] -- vbuz1=vbuc1 lda #PROGRESS_Y sta.z y - // [1280] phi rom_read::rom_row_current#10 = 0 [phi:rom_read::@4->rom_read::@5#1] -- vwuz1=vwuc1 + // [1472] phi rom_read::rom_row_current#10 = 0 [phi:rom_read::@4->rom_read::@5#1] -- vwuz1=vwuc1 lda #<0 sta.z rom_row_current sta.z rom_row_current+1 - // [1280] phi rom_read::brom_bank_start#11 = rom_read::brom_bank_start#10 [phi:rom_read::@4->rom_read::@5#2] -- register_copy - // [1280] phi rom_read::rom_address#10 = rom_read::rom_address#0 [phi:rom_read::@4->rom_read::@5#3] -- register_copy - // [1280] phi rom_read::rom_bram_ptr#13 = (char *)$7800 [phi:rom_read::@4->rom_read::@5#4] -- pbuz1=pbuc1 + // [1472] phi rom_read::brom_bank_start#11 = rom_read::brom_bank_start#10 [phi:rom_read::@4->rom_read::@5#2] -- register_copy + // [1472] phi rom_read::rom_address#10 = rom_read::rom_address#0 [phi:rom_read::@4->rom_read::@5#3] -- register_copy + // [1472] phi rom_read::rom_bram_ptr#13 = (char *)$7800 [phi:rom_read::@4->rom_read::@5#4] -- pbuz1=pbuc1 lda #<$7800 sta.z rom_bram_ptr lda #>$7800 sta.z rom_bram_ptr+1 - // [1280] phi rom_read::rom_bram_bank#10 = 0 [phi:rom_read::@4->rom_read::@5#5] -- vbuz1=vbuc1 + // [1472] phi rom_read::rom_bram_bank#10 = 0 [phi:rom_read::@4->rom_read::@5#5] -- vbuz1=vbuc1 lda #0 sta.z rom_bram_bank - // [1280] phi rom_read::rom_file_size#13 = 0 [phi:rom_read::@4->rom_read::@5#6] -- vdum1=vduc1 + // [1472] phi rom_read::rom_file_size#13 = 0 [phi:rom_read::@4->rom_read::@5#6] -- vdum1=vduc1 sta rom_file_size sta rom_file_size+1 lda #<0>>$10 @@ -8541,7 +9309,7 @@ rom_read: { // rom_read::@5 __b5: // while (rom_file_size < rom_size) - // [1281] if(rom_read::rom_file_size#13fclose] - // [2254] phi fclose::stream#2 = fclose::stream#1 [phi:rom_read::@10->fclose#0] -- register_copy + // [1474] fclose::stream#1 = rom_read::fp#0 + // [1475] call fclose + // [2654] phi from rom_read::@10 to fclose [phi:rom_read::@10->fclose] + // [2654] phi fclose::stream#3 = fclose::stream#1 [phi:rom_read::@10->fclose#0] -- register_copy jsr fclose - // [1284] phi from rom_read::@10 to rom_read::@3 [phi:rom_read::@10->rom_read::@3] - // [1284] phi __stdio_filecount#30 = __stdio_filecount#2 [phi:rom_read::@10->rom_read::@3#0] -- register_copy - // [1284] phi rom_read::return#0 = rom_read::rom_file_size#13 [phi:rom_read::@10->rom_read::@3#1] -- register_copy + // [1476] phi from rom_read::@10 to rom_read::@3 [phi:rom_read::@10->rom_read::@3] + // [1476] phi __stdio_filecount#39 = __stdio_filecount#2 [phi:rom_read::@10->rom_read::@3#0] -- register_copy + // [1476] phi rom_read::return#0 = rom_read::rom_file_size#13 [phi:rom_read::@10->rom_read::@3#1] -- register_copy rts - // [1284] phi from rom_read::@31 to rom_read::@3 [phi:rom_read::@31->rom_read::@3] + // [1476] phi from rom_read::@31 to rom_read::@3 [phi:rom_read::@31->rom_read::@3] __b4: - // [1284] phi __stdio_filecount#30 = __stdio_filecount#1 [phi:rom_read::@31->rom_read::@3#0] -- register_copy - // [1284] phi rom_read::return#0 = 0 [phi:rom_read::@31->rom_read::@3#1] -- vdum1=vduc1 + // [1476] phi __stdio_filecount#39 = __stdio_filecount#1 [phi:rom_read::@31->rom_read::@3#0] -- register_copy + // [1476] phi rom_read::return#0 = 0 [phi:rom_read::@31->rom_read::@3#1] -- vdum1=vduc1 lda #<0 sta return sta return+1 @@ -8584,39 +9352,39 @@ rom_read: { // rom_read::@3 // rom_read::@return // } - // [1285] return + // [1477] return rts // rom_read::@6 __b6: // if(info_status == STATUS_CHECKING) - // [1286] if(rom_read::info_status#11!=STATUS_CHECKING) goto rom_read::@35 -- vbuz1_neq_vbuc1_then_la1 + // [1478] if(rom_read::info_status#11!=STATUS_CHECKING) goto rom_read::@35 -- vbuz1_neq_vbuc1_then_la1 lda #STATUS_CHECKING cmp.z info_status bne __b7 - // [1288] phi from rom_read::@6 to rom_read::@7 [phi:rom_read::@6->rom_read::@7] - // [1288] phi rom_read::rom_bram_ptr#10 = (char *) 1024 [phi:rom_read::@6->rom_read::@7#0] -- pbuz1=pbuc1 + // [1480] phi from rom_read::@6 to rom_read::@7 [phi:rom_read::@6->rom_read::@7] + // [1480] phi rom_read::rom_bram_ptr#10 = (char *) 1024 [phi:rom_read::@6->rom_read::@7#0] -- pbuz1=pbuc1 lda #<$400 sta.z rom_bram_ptr lda #>$400 sta.z rom_bram_ptr+1 - // [1287] phi from rom_read::@6 to rom_read::@35 [phi:rom_read::@6->rom_read::@35] + // [1479] phi from rom_read::@6 to rom_read::@35 [phi:rom_read::@6->rom_read::@35] // rom_read::@35 - // [1288] phi from rom_read::@35 to rom_read::@7 [phi:rom_read::@35->rom_read::@7] - // [1288] phi rom_read::rom_bram_ptr#10 = rom_read::rom_bram_ptr#13 [phi:rom_read::@35->rom_read::@7#0] -- register_copy + // [1480] phi from rom_read::@35 to rom_read::@7 [phi:rom_read::@35->rom_read::@7] + // [1480] phi rom_read::rom_bram_ptr#10 = rom_read::rom_bram_ptr#13 [phi:rom_read::@35->rom_read::@7#0] -- register_copy // rom_read::@7 __b7: // display_action_text_reading(rom_action_text, file, rom_file_size, rom_size, rom_bram_bank, rom_bram_ptr) - // [1289] display_action_text_reading::action#1 = rom_read::rom_action_text#10 -- pbuz1=pbuz2 + // [1481] display_action_text_reading::action#1 = rom_read::rom_action_text#10 -- pbuz1=pbuz2 lda.z rom_action_text sta.z display_action_text_reading.action lda.z rom_action_text+1 sta.z display_action_text_reading.action+1 - // [1290] display_action_text_reading::file#1 = rom_read::file#10 -- pbuz1=pbuz2 + // [1482] display_action_text_reading::file#1 = rom_read::file#10 -- pbuz1=pbuz2 lda.z file sta.z display_action_text_reading.file lda.z file+1 sta.z display_action_text_reading.file+1 - // [1291] display_action_text_reading::bytes#1 = rom_read::rom_file_size#13 -- vduz1=vdum2 + // [1483] display_action_text_reading::bytes#1 = rom_read::rom_file_size#13 -- vduz1=vdum2 lda rom_file_size sta.z display_action_text_reading.bytes lda rom_file_size+1 @@ -8625,7 +9393,7 @@ rom_read: { sta.z display_action_text_reading.bytes+2 lda rom_file_size+3 sta.z display_action_text_reading.bytes+3 - // [1292] display_action_text_reading::size#1 = rom_read::rom_size#12 -- vduz1=vduz2 + // [1484] display_action_text_reading::size#1 = rom_read::rom_size#12 -- vduz1=vduz2 lda.z rom_size sta.z display_action_text_reading.size lda.z rom_size+1 @@ -8634,26 +9402,26 @@ rom_read: { sta.z display_action_text_reading.size+2 lda.z rom_size+3 sta.z display_action_text_reading.size+3 - // [1293] display_action_text_reading::bram_bank#1 = rom_read::rom_bram_bank#10 -- vbuz1=vbuz2 + // [1485] display_action_text_reading::bram_bank#1 = rom_read::rom_bram_bank#10 -- vbuz1=vbuz2 lda.z rom_bram_bank sta.z display_action_text_reading.bram_bank - // [1294] display_action_text_reading::bram_ptr#1 = rom_read::rom_bram_ptr#10 -- pbuz1=pbuz2 + // [1486] display_action_text_reading::bram_ptr#1 = rom_read::rom_bram_ptr#10 -- pbuz1=pbuz2 lda.z rom_bram_ptr sta.z display_action_text_reading.bram_ptr lda.z rom_bram_ptr+1 sta.z display_action_text_reading.bram_ptr+1 - // [1295] call display_action_text_reading - // [2283] phi from rom_read::@7 to display_action_text_reading [phi:rom_read::@7->display_action_text_reading] - // [2283] phi display_action_text_reading::bram_ptr#10 = display_action_text_reading::bram_ptr#1 [phi:rom_read::@7->display_action_text_reading#0] -- register_copy - // [2283] phi display_action_text_reading::bram_bank#10 = display_action_text_reading::bram_bank#1 [phi:rom_read::@7->display_action_text_reading#1] -- register_copy - // [2283] phi display_action_text_reading::size#2 = display_action_text_reading::size#1 [phi:rom_read::@7->display_action_text_reading#2] -- register_copy - // [2283] phi display_action_text_reading::bytes#2 = display_action_text_reading::bytes#1 [phi:rom_read::@7->display_action_text_reading#3] -- register_copy - // [2283] phi display_action_text_reading::file#2 = display_action_text_reading::file#1 [phi:rom_read::@7->display_action_text_reading#4] -- register_copy - // [2283] phi display_action_text_reading::action#2 = display_action_text_reading::action#1 [phi:rom_read::@7->display_action_text_reading#5] -- register_copy + // [1487] call display_action_text_reading + // [2683] phi from rom_read::@7 to display_action_text_reading [phi:rom_read::@7->display_action_text_reading] + // [2683] phi display_action_text_reading::bram_ptr#10 = display_action_text_reading::bram_ptr#1 [phi:rom_read::@7->display_action_text_reading#0] -- register_copy + // [2683] phi display_action_text_reading::bram_bank#10 = display_action_text_reading::bram_bank#1 [phi:rom_read::@7->display_action_text_reading#1] -- register_copy + // [2683] phi display_action_text_reading::size#10 = display_action_text_reading::size#1 [phi:rom_read::@7->display_action_text_reading#2] -- register_copy + // [2683] phi display_action_text_reading::bytes#3 = display_action_text_reading::bytes#1 [phi:rom_read::@7->display_action_text_reading#3] -- register_copy + // [2683] phi display_action_text_reading::file#3 = display_action_text_reading::file#1 [phi:rom_read::@7->display_action_text_reading#4] -- register_copy + // [2683] phi display_action_text_reading::action#3 = display_action_text_reading::action#1 [phi:rom_read::@7->display_action_text_reading#5] -- register_copy jsr display_action_text_reading // rom_read::@32 // rom_address % 0x04000 - // [1296] rom_read::$13 = rom_read::rom_address#10 & $4000-1 -- vduz1=vdum2_band_vduc1 + // [1488] rom_read::$13 = rom_read::rom_address#10 & $4000-1 -- vduz1=vdum2_band_vduc1 lda rom_address and #<$4000-1 sta.z rom_read__13 @@ -8667,7 +9435,7 @@ rom_read: { and #>$4000-1>>$10 sta.z rom_read__13+3 // if (!(rom_address % 0x04000)) - // [1297] if(0!=rom_read::$13) goto rom_read::@8 -- 0_neq_vduz1_then_la1 + // [1489] if(0!=rom_read::$13) goto rom_read::@8 -- 0_neq_vduz1_then_la1 lda.z rom_read__13 ora.z rom_read__13+1 ora.z rom_read__13+2 @@ -8675,49 +9443,49 @@ rom_read: { bne __b8 // rom_read::@17 // brom_bank_start++; - // [1298] rom_read::brom_bank_start#0 = ++ rom_read::brom_bank_start#11 -- vbuz1=_inc_vbuz1 + // [1490] rom_read::brom_bank_start#0 = ++ rom_read::brom_bank_start#11 -- vbuz1=_inc_vbuz1 inc.z brom_bank_start - // [1299] phi from rom_read::@17 rom_read::@32 to rom_read::@8 [phi:rom_read::@17/rom_read::@32->rom_read::@8] - // [1299] phi rom_read::brom_bank_start#16 = rom_read::brom_bank_start#0 [phi:rom_read::@17/rom_read::@32->rom_read::@8#0] -- register_copy + // [1491] phi from rom_read::@17 rom_read::@32 to rom_read::@8 [phi:rom_read::@17/rom_read::@32->rom_read::@8] + // [1491] phi rom_read::brom_bank_start#16 = rom_read::brom_bank_start#0 [phi:rom_read::@17/rom_read::@32->rom_read::@8#0] -- register_copy // rom_read::@8 __b8: // rom_read::bank_set_bram2 // BRAM = bank - // [1300] BRAM = rom_read::rom_bram_bank#10 -- vbuz1=vbuz2 + // [1492] BRAM = rom_read::rom_bram_bank#10 -- vbuz1=vbuz2 lda.z rom_bram_bank sta.z BRAM // rom_read::@24 // unsigned int rom_package_read = fgets(rom_bram_ptr, ROM_PROGRESS_CELL, fp) - // [1301] fgets::ptr#4 = rom_read::rom_bram_ptr#10 -- pbuz1=pbuz2 + // [1493] fgets::ptr#4 = rom_read::rom_bram_ptr#10 -- pbuz1=pbuz2 lda.z rom_bram_ptr sta.z fgets.ptr lda.z rom_bram_ptr+1 sta.z fgets.ptr+1 - // [1302] fgets::stream#2 = rom_read::fp#0 -- pssz1=pssm2 - lda fp + // [1494] fgets::stream#2 = rom_read::fp#0 -- pssz1=pssz2 + lda.z fp sta.z fgets.stream - lda fp+1 + lda.z fp+1 sta.z fgets.stream+1 - // [1303] call fgets - // [2314] phi from rom_read::@24 to fgets [phi:rom_read::@24->fgets] - // [2314] phi fgets::ptr#13 = fgets::ptr#4 [phi:rom_read::@24->fgets#0] -- register_copy - // [2314] phi fgets::size#11 = ROM_PROGRESS_CELL [phi:rom_read::@24->fgets#1] -- vwum1=vwuc1 + // [1495] call fgets + // [2714] phi from rom_read::@24 to fgets [phi:rom_read::@24->fgets] + // [2714] phi fgets::ptr#14 = fgets::ptr#4 [phi:rom_read::@24->fgets#0] -- register_copy + // [2714] phi fgets::size#10 = ROM_PROGRESS_CELL [phi:rom_read::@24->fgets#1] -- vwum1=vwuc1 lda #ROM_PROGRESS_CELL sta fgets.size+1 - // [2314] phi fgets::stream#3 = fgets::stream#2 [phi:rom_read::@24->fgets#2] -- register_copy + // [2714] phi fgets::stream#4 = fgets::stream#2 [phi:rom_read::@24->fgets#2] -- register_copy jsr fgets // unsigned int rom_package_read = fgets(rom_bram_ptr, ROM_PROGRESS_CELL, fp) - // [1304] fgets::return#11 = fgets::return#1 + // [1496] fgets::return#12 = fgets::return#1 // rom_read::@33 - // [1305] rom_read::rom_package_read#0 = fgets::return#11 -- vwuz1=vwum2 + // [1497] rom_read::rom_package_read#0 = fgets::return#12 -- vwuz1=vwum2 lda fgets.return sta.z rom_package_read lda fgets.return+1 sta.z rom_package_read+1 // if (!rom_package_read) - // [1306] if(0!=rom_read::rom_package_read#0) goto rom_read::@9 -- 0_neq_vwuz1_then_la1 + // [1498] if(0!=rom_read::rom_package_read#0) goto rom_read::@9 -- 0_neq_vwuz1_then_la1 lda.z rom_package_read ora.z rom_package_read+1 bne __b9 @@ -8725,13 +9493,13 @@ rom_read: { // rom_read::@9 __b9: // if(info_status == STATUS_CHECKING) - // [1307] if(rom_read::info_status#11!=STATUS_CHECKING) goto rom_read::@11 -- vbuz1_neq_vbuc1_then_la1 + // [1499] if(rom_read::info_status#11!=STATUS_CHECKING) goto rom_read::@11 -- vbuz1_neq_vbuc1_then_la1 lda #STATUS_CHECKING cmp.z info_status bne __b11 // rom_read::@18 // if(rom_file_size == 0x0) - // [1308] if(rom_read::rom_file_size#13!=0) goto rom_read::@12 -- vdum1_neq_0_then_la1 + // [1500] if(rom_read::rom_file_size#13!=0) goto rom_read::@12 -- vdum1_neq_0_then_la1 lda rom_file_size ora rom_file_size+1 ora rom_file_size+2 @@ -8739,24 +9507,23 @@ rom_read: { bne __b12 // rom_read::@19 // rom_chip*8 - // [1309] rom_read::$24 = rom_read::rom_chip#20 << 3 -- vbuz1=vbuz2_rol_3 - lda.z rom_chip + // [1501] rom_read::$24 = rom_read::rom_chip#20 << 3 -- vbuaa=vbum1_rol_3 + lda rom_chip asl asl asl - sta.z rom_read__24 // rom_get_github_commit_id(&rom_file_github[rom_chip*8], (char*)0x0400) - // [1310] rom_get_github_commit_id::commit_id#0 = rom_file_github + rom_read::$24 -- pbuz1=pbuc1_plus_vbuz2 + // [1502] rom_get_github_commit_id::commit_id#0 = rom_file_github + rom_read::$24 -- pbuz1=pbuc1_plus_vbuaa clc adc #rom_file_github adc #0 sta.z rom_get_github_commit_id.commit_id+1 - // [1311] call rom_get_github_commit_id - // [1818] phi from rom_read::@19 to rom_get_github_commit_id [phi:rom_read::@19->rom_get_github_commit_id] - // [1818] phi rom_get_github_commit_id::commit_id#6 = rom_get_github_commit_id::commit_id#0 [phi:rom_read::@19->rom_get_github_commit_id#0] -- register_copy - // [1818] phi rom_get_github_commit_id::from#6 = (char *) 1024 [phi:rom_read::@19->rom_get_github_commit_id#1] -- pbuz1=pbuc1 + // [1503] call rom_get_github_commit_id + // [1998] phi from rom_read::@19 to rom_get_github_commit_id [phi:rom_read::@19->rom_get_github_commit_id] + // [1998] phi rom_get_github_commit_id::commit_id#6 = rom_get_github_commit_id::commit_id#0 [phi:rom_read::@19->rom_get_github_commit_id#0] -- register_copy + // [1998] phi rom_get_github_commit_id::from#6 = (char *) 1024 [phi:rom_read::@19->rom_get_github_commit_id#1] -- pbuz1=pbuc1 lda #<$400 sta.z rom_get_github_commit_id.from lda #>$400 @@ -8765,7 +9532,7 @@ rom_read: { // rom_read::@12 __b12: // if(rom_file_size == 0x3E00) - // [1312] if(rom_read::rom_file_size#13!=$3e00) goto rom_read::@11 -- vdum1_neq_vduc1_then_la1 + // [1504] if(rom_read::rom_file_size#13!=$3e00) goto rom_read::@11 -- vdum1_neq_vduc1_then_la1 lda rom_file_size+3 cmp #>$3e00>>$10 bne __b11 @@ -8780,14 +9547,14 @@ rom_read: { bne __b11 // rom_read::@13 // rom_file_release[rom_chip] = *((char*)(0x0400+0x0180)) - // [1313] rom_file_release[rom_read::rom_chip#20] = *((char *)$400+$180) -- pbuc1_derefidx_vbuz1=_deref_pbuc2 + // [1505] rom_file_release[rom_read::rom_chip#20] = *((char *)$400+$180) -- pbuc1_derefidx_vbum1=_deref_pbuc2 lda $400+$180 - ldy.z rom_chip + ldy rom_chip sta rom_file_release,y // rom_read::@11 __b11: // if (rom_row_current == ROM_PROGRESS_ROW) - // [1314] if(rom_read::rom_row_current#10!=ROM_PROGRESS_ROW) goto rom_read::@14 -- vwuz1_neq_vwuc1_then_la1 + // [1506] if(rom_read::rom_row_current#10!=ROM_PROGRESS_ROW) goto rom_read::@14 -- vwuz1_neq_vwuc1_then_la1 lda.z rom_row_current+1 cmp #>ROM_PROGRESS_ROW bne __b14 @@ -8796,48 +9563,47 @@ rom_read: { bne __b14 // rom_read::@20 // gotoxy(x, ++y); - // [1315] rom_read::y#1 = ++ rom_read::y#11 -- vbuz1=_inc_vbuz1 + // [1507] rom_read::y#1 = ++ rom_read::y#11 -- vbuz1=_inc_vbuz1 inc.z y // gotoxy(x, ++y) - // [1316] gotoxy::y#28 = rom_read::y#1 -- vbum1=vbuz2 + // [1508] gotoxy::y#28 = rom_read::y#1 -- vbum1=vbuz2 lda.z y sta gotoxy.y - // [1317] call gotoxy - // [778] phi from rom_read::@20 to gotoxy [phi:rom_read::@20->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#28 [phi:rom_read::@20->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = PROGRESS_X [phi:rom_read::@20->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x + // [1509] call gotoxy + // [805] phi from rom_read::@20 to gotoxy [phi:rom_read::@20->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#28 [phi:rom_read::@20->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = PROGRESS_X [phi:rom_read::@20->gotoxy#1] -- vbuyy=vbuc1 + ldy #PROGRESS_X jsr gotoxy - // [1318] phi from rom_read::@20 to rom_read::@14 [phi:rom_read::@20->rom_read::@14] - // [1318] phi rom_read::y#33 = rom_read::y#1 [phi:rom_read::@20->rom_read::@14#0] -- register_copy - // [1318] phi rom_read::rom_row_current#4 = 0 [phi:rom_read::@20->rom_read::@14#1] -- vwuz1=vbuc1 + // [1510] phi from rom_read::@20 to rom_read::@14 [phi:rom_read::@20->rom_read::@14] + // [1510] phi rom_read::y#33 = rom_read::y#1 [phi:rom_read::@20->rom_read::@14#0] -- register_copy + // [1510] phi rom_read::rom_row_current#4 = 0 [phi:rom_read::@20->rom_read::@14#1] -- vwuz1=vbuc1 lda #<0 sta.z rom_row_current sta.z rom_row_current+1 - // [1318] phi from rom_read::@11 to rom_read::@14 [phi:rom_read::@11->rom_read::@14] - // [1318] phi rom_read::y#33 = rom_read::y#11 [phi:rom_read::@11->rom_read::@14#0] -- register_copy - // [1318] phi rom_read::rom_row_current#4 = rom_read::rom_row_current#10 [phi:rom_read::@11->rom_read::@14#1] -- register_copy + // [1510] phi from rom_read::@11 to rom_read::@14 [phi:rom_read::@11->rom_read::@14] + // [1510] phi rom_read::y#33 = rom_read::y#11 [phi:rom_read::@11->rom_read::@14#0] -- register_copy + // [1510] phi rom_read::rom_row_current#4 = rom_read::rom_row_current#10 [phi:rom_read::@11->rom_read::@14#1] -- register_copy // rom_read::@14 __b14: // if(info_status == STATUS_READING) - // [1319] if(rom_read::info_status#11!=STATUS_READING) goto rom_read::@15 -- vbuz1_neq_vbuc1_then_la1 + // [1511] if(rom_read::info_status#11!=STATUS_READING) goto rom_read::@15 -- vbuz1_neq_vbuc1_then_la1 lda #STATUS_READING cmp.z info_status bne __b15 // rom_read::@21 // cputc('.') - // [1320] stackpush(char) = '.' -- _stackpushbyte_=vbuc1 + // [1512] stackpush(char) = '.' -- _stackpushbyte_=vbuc1 lda #'.' pha - // [1321] callexecute cputc -- call_vprc1 + // [1513] callexecute cputc -- call_vprc1 jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // rom_read::@15 __b15: // rom_bram_ptr += rom_package_read - // [1323] rom_read::rom_bram_ptr#2 = rom_read::rom_bram_ptr#10 + rom_read::rom_package_read#0 -- pbuz1=pbuz1_plus_vwuz2 + // [1515] rom_read::rom_bram_ptr#2 = rom_read::rom_bram_ptr#10 + rom_read::rom_package_read#0 -- pbuz1=pbuz1_plus_vwuz2 clc lda.z rom_bram_ptr adc.z rom_package_read @@ -8846,7 +9612,7 @@ rom_read: { adc.z rom_package_read+1 sta.z rom_bram_ptr+1 // rom_address += rom_package_read - // [1324] rom_read::rom_address#1 = rom_read::rom_address#10 + rom_read::rom_package_read#0 -- vdum1=vdum1_plus_vwuz2 + // [1516] rom_read::rom_address#1 = rom_read::rom_address#10 + rom_read::rom_package_read#0 -- vdum1=vdum1_plus_vwuz2 lda rom_address clc adc.z rom_package_read @@ -8861,7 +9627,7 @@ rom_read: { adc #0 sta rom_address+3 // rom_file_size += rom_package_read - // [1325] rom_read::rom_file_size#1 = rom_read::rom_file_size#13 + rom_read::rom_package_read#0 -- vdum1=vdum1_plus_vwuz2 + // [1517] rom_read::rom_file_size#1 = rom_read::rom_file_size#13 + rom_read::rom_package_read#0 -- vdum1=vdum1_plus_vwuz2 lda rom_file_size clc adc.z rom_package_read @@ -8876,7 +9642,7 @@ rom_read: { adc #0 sta rom_file_size+3 // rom_row_current += rom_package_read - // [1326] rom_read::rom_row_current#2 = rom_read::rom_row_current#4 + rom_read::rom_package_read#0 -- vwuz1=vwuz1_plus_vwuz2 + // [1518] rom_read::rom_row_current#2 = rom_read::rom_row_current#4 + rom_read::rom_package_read#0 -- vwuz1=vwuz1_plus_vwuz2 clc lda.z rom_row_current adc.z rom_package_read @@ -8885,7 +9651,7 @@ rom_read: { adc.z rom_package_read+1 sta.z rom_row_current+1 // if (rom_bram_ptr == (bram_ptr_t)BRAM_HIGH) - // [1327] if(rom_read::rom_bram_ptr#2!=(char *)$c000) goto rom_read::@16 -- pbuz1_neq_pbuc1_then_la1 + // [1519] if(rom_read::rom_bram_ptr#2!=(char *)$c000) goto rom_read::@16 -- pbuz1_neq_pbuc1_then_la1 lda.z rom_bram_ptr+1 cmp #>$c000 bne __b16 @@ -8894,22 +9660,22 @@ rom_read: { bne __b16 // rom_read::@22 // rom_bram_bank++; - // [1328] rom_read::rom_bram_bank#1 = ++ rom_read::rom_bram_bank#10 -- vbuz1=_inc_vbuz1 + // [1520] rom_read::rom_bram_bank#1 = ++ rom_read::rom_bram_bank#10 -- vbuz1=_inc_vbuz1 inc.z rom_bram_bank - // [1329] phi from rom_read::@22 to rom_read::@16 [phi:rom_read::@22->rom_read::@16] - // [1329] phi rom_read::rom_bram_bank#14 = rom_read::rom_bram_bank#1 [phi:rom_read::@22->rom_read::@16#0] -- register_copy - // [1329] phi rom_read::rom_bram_ptr#8 = (char *)$a000 [phi:rom_read::@22->rom_read::@16#1] -- pbuz1=pbuc1 + // [1521] phi from rom_read::@22 to rom_read::@16 [phi:rom_read::@22->rom_read::@16] + // [1521] phi rom_read::rom_bram_bank#14 = rom_read::rom_bram_bank#1 [phi:rom_read::@22->rom_read::@16#0] -- register_copy + // [1521] phi rom_read::rom_bram_ptr#8 = (char *)$a000 [phi:rom_read::@22->rom_read::@16#1] -- pbuz1=pbuc1 lda #<$a000 sta.z rom_bram_ptr lda #>$a000 sta.z rom_bram_ptr+1 - // [1329] phi from rom_read::@15 to rom_read::@16 [phi:rom_read::@15->rom_read::@16] - // [1329] phi rom_read::rom_bram_bank#14 = rom_read::rom_bram_bank#10 [phi:rom_read::@15->rom_read::@16#0] -- register_copy - // [1329] phi rom_read::rom_bram_ptr#8 = rom_read::rom_bram_ptr#2 [phi:rom_read::@15->rom_read::@16#1] -- register_copy + // [1521] phi from rom_read::@15 to rom_read::@16 [phi:rom_read::@15->rom_read::@16] + // [1521] phi rom_read::rom_bram_bank#14 = rom_read::rom_bram_bank#10 [phi:rom_read::@15->rom_read::@16#0] -- register_copy + // [1521] phi rom_read::rom_bram_ptr#8 = rom_read::rom_bram_ptr#2 [phi:rom_read::@15->rom_read::@16#1] -- register_copy // rom_read::@16 __b16: // if (rom_bram_ptr == (bram_ptr_t)RAM_HIGH) - // [1330] if(rom_read::rom_bram_ptr#8!=(char *)$9800) goto rom_read::@34 -- pbuz1_neq_pbuc1_then_la1 + // [1522] if(rom_read::rom_bram_ptr#8!=(char *)$9800) goto rom_read::@34 -- pbuz1_neq_pbuc1_then_la1 lda.z rom_bram_ptr+1 cmp #>$9800 beq !__b5+ @@ -8920,69 +9686,68 @@ rom_read: { beq !__b5+ jmp __b5 !__b5: - // [1280] phi from rom_read::@16 to rom_read::@5 [phi:rom_read::@16->rom_read::@5] - // [1280] phi rom_read::y#11 = rom_read::y#33 [phi:rom_read::@16->rom_read::@5#0] -- register_copy - // [1280] phi rom_read::rom_row_current#10 = rom_read::rom_row_current#2 [phi:rom_read::@16->rom_read::@5#1] -- register_copy - // [1280] phi rom_read::brom_bank_start#11 = rom_read::brom_bank_start#16 [phi:rom_read::@16->rom_read::@5#2] -- register_copy - // [1280] phi rom_read::rom_address#10 = rom_read::rom_address#1 [phi:rom_read::@16->rom_read::@5#3] -- register_copy - // [1280] phi rom_read::rom_bram_ptr#13 = (char *)$a000 [phi:rom_read::@16->rom_read::@5#4] -- pbuz1=pbuc1 + // [1472] phi from rom_read::@16 to rom_read::@5 [phi:rom_read::@16->rom_read::@5] + // [1472] phi rom_read::y#11 = rom_read::y#33 [phi:rom_read::@16->rom_read::@5#0] -- register_copy + // [1472] phi rom_read::rom_row_current#10 = rom_read::rom_row_current#2 [phi:rom_read::@16->rom_read::@5#1] -- register_copy + // [1472] phi rom_read::brom_bank_start#11 = rom_read::brom_bank_start#16 [phi:rom_read::@16->rom_read::@5#2] -- register_copy + // [1472] phi rom_read::rom_address#10 = rom_read::rom_address#1 [phi:rom_read::@16->rom_read::@5#3] -- register_copy + // [1472] phi rom_read::rom_bram_ptr#13 = (char *)$a000 [phi:rom_read::@16->rom_read::@5#4] -- pbuz1=pbuc1 lda #<$a000 sta.z rom_bram_ptr lda #>$a000 sta.z rom_bram_ptr+1 - // [1280] phi rom_read::rom_bram_bank#10 = 1 [phi:rom_read::@16->rom_read::@5#5] -- vbuz1=vbuc1 + // [1472] phi rom_read::rom_bram_bank#10 = 1 [phi:rom_read::@16->rom_read::@5#5] -- vbuz1=vbuc1 lda #1 sta.z rom_bram_bank - // [1280] phi rom_read::rom_file_size#13 = rom_read::rom_file_size#1 [phi:rom_read::@16->rom_read::@5#6] -- register_copy + // [1472] phi rom_read::rom_file_size#13 = rom_read::rom_file_size#1 [phi:rom_read::@16->rom_read::@5#6] -- register_copy jmp __b5 - // [1331] phi from rom_read::@16 to rom_read::@34 [phi:rom_read::@16->rom_read::@34] + // [1523] phi from rom_read::@16 to rom_read::@34 [phi:rom_read::@16->rom_read::@34] // rom_read::@34 - // [1280] phi from rom_read::@34 to rom_read::@5 [phi:rom_read::@34->rom_read::@5] - // [1280] phi rom_read::y#11 = rom_read::y#33 [phi:rom_read::@34->rom_read::@5#0] -- register_copy - // [1280] phi rom_read::rom_row_current#10 = rom_read::rom_row_current#2 [phi:rom_read::@34->rom_read::@5#1] -- register_copy - // [1280] phi rom_read::brom_bank_start#11 = rom_read::brom_bank_start#16 [phi:rom_read::@34->rom_read::@5#2] -- register_copy - // [1280] phi rom_read::rom_address#10 = rom_read::rom_address#1 [phi:rom_read::@34->rom_read::@5#3] -- register_copy - // [1280] phi rom_read::rom_bram_ptr#13 = rom_read::rom_bram_ptr#8 [phi:rom_read::@34->rom_read::@5#4] -- register_copy - // [1280] phi rom_read::rom_bram_bank#10 = rom_read::rom_bram_bank#14 [phi:rom_read::@34->rom_read::@5#5] -- register_copy - // [1280] phi rom_read::rom_file_size#13 = rom_read::rom_file_size#1 [phi:rom_read::@34->rom_read::@5#6] -- register_copy + // [1472] phi from rom_read::@34 to rom_read::@5 [phi:rom_read::@34->rom_read::@5] + // [1472] phi rom_read::y#11 = rom_read::y#33 [phi:rom_read::@34->rom_read::@5#0] -- register_copy + // [1472] phi rom_read::rom_row_current#10 = rom_read::rom_row_current#2 [phi:rom_read::@34->rom_read::@5#1] -- register_copy + // [1472] phi rom_read::brom_bank_start#11 = rom_read::brom_bank_start#16 [phi:rom_read::@34->rom_read::@5#2] -- register_copy + // [1472] phi rom_read::rom_address#10 = rom_read::rom_address#1 [phi:rom_read::@34->rom_read::@5#3] -- register_copy + // [1472] phi rom_read::rom_bram_ptr#13 = rom_read::rom_bram_ptr#8 [phi:rom_read::@34->rom_read::@5#4] -- register_copy + // [1472] phi rom_read::rom_bram_bank#10 = rom_read::rom_bram_bank#14 [phi:rom_read::@34->rom_read::@5#5] -- register_copy + // [1472] phi rom_read::rom_file_size#13 = rom_read::rom_file_size#1 [phi:rom_read::@34->rom_read::@5#6] -- register_copy .segment Data s: .text "Opening " .byte 0 s1: .text " from SD card ..." .byte 0 .label rom_address = rom_read_byte.address - .label fp = smc_flash.smc_commit_result return: .dword 0 .label rom_file_size = return + .label rom_chip = main.check_status_smc6_return } .segment Code // rom_verify -// __zp($6f) unsigned long rom_verify(__mem() char rom_chip, __mem() char rom_bank_start, __mem() unsigned long file_size) +// __zp($55) unsigned long rom_verify(__mem() char rom_chip, __register(X) char rom_bank_start, __mem() unsigned long file_size) rom_verify: { - .label rom_verify__17 = $5e - .label rom_address = $62 - .label equal_bytes = $5e - .label y = $a9 - .label rom_bram_ptr = $3b - // We start for ROM from 0x0:0x7800 !!!! - .label rom_bram_bank = $ac - .label rom_different_bytes = $6f - .label return = $6f - .label progress_row_current = $39 + .label rom_verify__17 = $46 + .label rom_address = $4a + .label equal_bytes = $46 + .label y = $cf + .label rom_bram_ptr = $59 + .label rom_different_bytes = $55 + .label return = $55 + .label progress_row_current = $5d // rom_verify::bank_set_bram1 // BRAM = bank - // [1333] BRAM = 0 -- vbuz1=vbuc1 + // [1525] BRAM = 0 -- vbuz1=vbuc1 lda #0 sta.z BRAM // rom_verify::@11 // unsigned long rom_address = rom_address_from_bank(rom_bank_start) - // [1334] rom_address_from_bank::rom_bank#1 = rom_verify::rom_bank_start#0 - // [1335] call rom_address_from_bank - // [2169] phi from rom_verify::@11 to rom_address_from_bank [phi:rom_verify::@11->rom_address_from_bank] - // [2169] phi rom_address_from_bank::rom_bank#3 = rom_address_from_bank::rom_bank#1 [phi:rom_verify::@11->rom_address_from_bank#0] -- register_copy + // [1526] rom_address_from_bank::rom_bank#1 = rom_verify::rom_bank_start#0 -- vbuaa=vbuxx + txa + // [1527] call rom_address_from_bank + // [2569] phi from rom_verify::@11 to rom_address_from_bank [phi:rom_verify::@11->rom_address_from_bank] + // [2569] phi rom_address_from_bank::rom_bank#3 = rom_address_from_bank::rom_bank#1 [phi:rom_verify::@11->rom_address_from_bank#0] -- register_copy jsr rom_address_from_bank // unsigned long rom_address = rom_address_from_bank(rom_bank_start) - // [1336] rom_address_from_bank::return#3 = rom_address_from_bank::return#0 -- vduz1=vdum2 + // [1528] rom_address_from_bank::return#3 = rom_address_from_bank::return#0 -- vduz1=vdum2 lda rom_address_from_bank.return sta.z rom_address_from_bank.return_1 lda rom_address_from_bank.return+1 @@ -8992,9 +9757,9 @@ rom_verify: { lda rom_address_from_bank.return+3 sta.z rom_address_from_bank.return_1+3 // rom_verify::@12 - // [1337] rom_verify::rom_address#0 = rom_address_from_bank::return#3 + // [1529] rom_verify::rom_address#0 = rom_address_from_bank::return#3 // unsigned long rom_boundary = rom_address + file_size - // [1338] rom_verify::rom_boundary#0 = rom_verify::rom_address#0 + rom_verify::file_size#0 -- vdum1=vduz2_plus_vdum1 + // [1530] rom_verify::rom_boundary#0 = rom_verify::rom_address#0 + rom_verify::file_size#0 -- vdum1=vduz2_plus_vdum1 clc lda rom_boundary adc.z rom_address @@ -9008,60 +9773,59 @@ rom_verify: { lda rom_boundary+3 adc.z rom_address+3 sta rom_boundary+3 - // display_info_rom(rom_chip, STATUS_COMPARING, "Comparing ...") - // [1339] display_info_rom::rom_chip#2 = rom_verify::rom_chip#0 - // [1340] call display_info_rom - // [1176] phi from rom_verify::@12 to display_info_rom [phi:rom_verify::@12->display_info_rom] - // [1176] phi display_info_rom::info_text#16 = rom_verify::info_text [phi:rom_verify::@12->display_info_rom#0] -- pbuz1=pbuc1 - lda #display_info_rom] + // [1368] phi display_info_rom::info_text#16 = str [phi:rom_verify::@12->display_info_rom#0] -- pbuz1=pbuc1 + lda #info_text + lda #>str sta.z display_info_rom.info_text+1 - // [1176] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#2 [phi:rom_verify::@12->display_info_rom#1] -- register_copy - // [1176] phi display_info_rom::info_status#16 = STATUS_COMPARING [phi:rom_verify::@12->display_info_rom#2] -- vbuz1=vbuc1 + // [1368] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#2 [phi:rom_verify::@12->display_info_rom#1] -- register_copy + // [1368] phi display_info_rom::info_status#16 = STATUS_COMPARING [phi:rom_verify::@12->display_info_rom#2] -- vbum1=vbuc1 lda #STATUS_COMPARING - sta.z display_info_rom.info_status + sta display_info_rom.info_status jsr display_info_rom - // [1341] phi from rom_verify::@12 to rom_verify::@13 [phi:rom_verify::@12->rom_verify::@13] + // [1533] phi from rom_verify::@12 to rom_verify::@13 [phi:rom_verify::@12->rom_verify::@13] // rom_verify::@13 // gotoxy(x, y) - // [1342] call gotoxy - // [778] phi from rom_verify::@13 to gotoxy [phi:rom_verify::@13->gotoxy] - // [778] phi gotoxy::y#33 = PROGRESS_Y [phi:rom_verify::@13->gotoxy#0] -- vbum1=vbuc1 + // [1534] call gotoxy + // [805] phi from rom_verify::@13 to gotoxy [phi:rom_verify::@13->gotoxy] + // [805] phi gotoxy::y#37 = PROGRESS_Y [phi:rom_verify::@13->gotoxy#0] -- vbum1=vbuc1 lda #PROGRESS_Y sta gotoxy.y - // [778] phi gotoxy::x#33 = PROGRESS_X [phi:rom_verify::@13->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x + // [805] phi gotoxy::x#37 = PROGRESS_X [phi:rom_verify::@13->gotoxy#1] -- vbuyy=vbuc1 + ldy #PROGRESS_X jsr gotoxy - // [1343] phi from rom_verify::@13 to rom_verify::@1 [phi:rom_verify::@13->rom_verify::@1] - // [1343] phi rom_verify::y#3 = PROGRESS_Y [phi:rom_verify::@13->rom_verify::@1#0] -- vbuz1=vbuc1 + // [1535] phi from rom_verify::@13 to rom_verify::@1 [phi:rom_verify::@13->rom_verify::@1] + // [1535] phi rom_verify::y#3 = PROGRESS_Y [phi:rom_verify::@13->rom_verify::@1#0] -- vbuz1=vbuc1 lda #PROGRESS_Y sta.z y - // [1343] phi rom_verify::progress_row_current#3 = 0 [phi:rom_verify::@13->rom_verify::@1#1] -- vwuz1=vwuc1 + // [1535] phi rom_verify::progress_row_current#3 = 0 [phi:rom_verify::@13->rom_verify::@1#1] -- vwuz1=vwuc1 lda #<0 sta.z progress_row_current sta.z progress_row_current+1 - // [1343] phi rom_verify::rom_different_bytes#11 = 0 [phi:rom_verify::@13->rom_verify::@1#2] -- vduz1=vduc1 + // [1535] phi rom_verify::rom_different_bytes#11 = 0 [phi:rom_verify::@13->rom_verify::@1#2] -- vduz1=vduc1 sta.z rom_different_bytes sta.z rom_different_bytes+1 lda #<0>>$10 sta.z rom_different_bytes+2 lda #>0>>$10 sta.z rom_different_bytes+3 - // [1343] phi rom_verify::rom_bram_ptr#10 = (char *)$7800 [phi:rom_verify::@13->rom_verify::@1#3] -- pbuz1=pbuc1 + // [1535] phi rom_verify::rom_bram_ptr#10 = (char *)$7800 [phi:rom_verify::@13->rom_verify::@1#3] -- pbuz1=pbuc1 lda #<$7800 sta.z rom_bram_ptr lda #>$7800 sta.z rom_bram_ptr+1 - // [1343] phi rom_verify::rom_bram_bank#11 = 0 [phi:rom_verify::@13->rom_verify::@1#4] -- vbuz1=vbuc1 + // [1535] phi rom_verify::rom_bram_bank#11 = 0 [phi:rom_verify::@13->rom_verify::@1#4] -- vbum1=vbuc1 lda #0 - sta.z rom_bram_bank - // [1343] phi rom_verify::rom_address#12 = rom_verify::rom_address#0 [phi:rom_verify::@13->rom_verify::@1#5] -- register_copy + sta rom_bram_bank + // [1535] phi rom_verify::rom_address#12 = rom_verify::rom_address#0 [phi:rom_verify::@13->rom_verify::@1#5] -- register_copy // rom_verify::@1 __b1: // while (rom_address < rom_boundary) - // [1344] if(rom_verify::rom_address#12rom_compare] - // [2368] phi rom_compare::ptr_ram#10 = rom_compare::ptr_ram#1 [phi:rom_verify::@2->rom_compare#0] -- register_copy - // [2368] phi rom_compare::rom_compare_size#11 = ROM_PROGRESS_CELL [phi:rom_verify::@2->rom_compare#1] -- vwuz1=vwuc1 + // [2768] phi from rom_verify::@2 to rom_compare [phi:rom_verify::@2->rom_compare] + // [2768] phi rom_compare::ptr_ram#10 = rom_compare::ptr_ram#1 [phi:rom_verify::@2->rom_compare#0] -- register_copy + // [2768] phi rom_compare::rom_compare_size#11 = ROM_PROGRESS_CELL [phi:rom_verify::@2->rom_compare#1] -- vwuz1=vwuc1 lda #ROM_PROGRESS_CELL sta.z rom_compare.rom_compare_size+1 - // [2368] phi rom_compare::rom_compare_address#3 = rom_compare::rom_compare_address#0 [phi:rom_verify::@2->rom_compare#2] -- register_copy - // [2368] phi rom_compare::bank_set_bram1_bank#0 = rom_compare::bank_ram#0 [phi:rom_verify::@2->rom_compare#3] -- vbum1=vbuz2 - lda.z rom_compare.bank_ram - sta rom_compare.bank_set_bram1_bank + // [2768] phi rom_compare::rom_compare_address#3 = rom_compare::rom_compare_address#0 [phi:rom_verify::@2->rom_compare#2] -- register_copy + // [2768] phi rom_compare::bank_set_bram1_bank#0 = rom_compare::bank_ram#0 [phi:rom_verify::@2->rom_compare#3] -- register_copy jsr rom_compare // unsigned int equal_bytes = rom_compare(rom_bram_bank, (bram_ptr_t)rom_bram_ptr, rom_address, ROM_PROGRESS_CELL) - // [1350] rom_compare::return#2 = rom_compare::equal_bytes#2 + // [1542] rom_compare::return#2 = rom_compare::equal_bytes#2 // rom_verify::@14 - // [1351] rom_verify::equal_bytes#0 = rom_compare::return#2 + // [1543] rom_verify::equal_bytes#0 = rom_compare::return#2 // if (progress_row_current == ROM_PROGRESS_ROW) - // [1352] if(rom_verify::progress_row_current#3!=ROM_PROGRESS_ROW) goto rom_verify::@3 -- vwuz1_neq_vwuc1_then_la1 + // [1544] if(rom_verify::progress_row_current#3!=ROM_PROGRESS_ROW) goto rom_verify::@3 -- vwuz1_neq_vwuc1_then_la1 lda.z progress_row_current+1 cmp #>ROM_PROGRESS_ROW bne __b3 @@ -9128,32 +9891,31 @@ rom_verify: { bne __b3 // rom_verify::@8 // gotoxy(x, ++y); - // [1353] rom_verify::y#1 = ++ rom_verify::y#3 -- vbuz1=_inc_vbuz1 + // [1545] rom_verify::y#1 = ++ rom_verify::y#3 -- vbuz1=_inc_vbuz1 inc.z y // gotoxy(x, ++y) - // [1354] gotoxy::y#30 = rom_verify::y#1 -- vbum1=vbuz2 + // [1546] gotoxy::y#30 = rom_verify::y#1 -- vbum1=vbuz2 lda.z y sta gotoxy.y - // [1355] call gotoxy - // [778] phi from rom_verify::@8 to gotoxy [phi:rom_verify::@8->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#30 [phi:rom_verify::@8->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = PROGRESS_X [phi:rom_verify::@8->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x + // [1547] call gotoxy + // [805] phi from rom_verify::@8 to gotoxy [phi:rom_verify::@8->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#30 [phi:rom_verify::@8->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = PROGRESS_X [phi:rom_verify::@8->gotoxy#1] -- vbuyy=vbuc1 + ldy #PROGRESS_X jsr gotoxy - // [1356] phi from rom_verify::@8 to rom_verify::@3 [phi:rom_verify::@8->rom_verify::@3] - // [1356] phi rom_verify::y#11 = rom_verify::y#1 [phi:rom_verify::@8->rom_verify::@3#0] -- register_copy - // [1356] phi rom_verify::progress_row_current#4 = 0 [phi:rom_verify::@8->rom_verify::@3#1] -- vwuz1=vbuc1 + // [1548] phi from rom_verify::@8 to rom_verify::@3 [phi:rom_verify::@8->rom_verify::@3] + // [1548] phi rom_verify::y#11 = rom_verify::y#1 [phi:rom_verify::@8->rom_verify::@3#0] -- register_copy + // [1548] phi rom_verify::progress_row_current#4 = 0 [phi:rom_verify::@8->rom_verify::@3#1] -- vwuz1=vbuc1 lda #<0 sta.z progress_row_current sta.z progress_row_current+1 - // [1356] phi from rom_verify::@14 to rom_verify::@3 [phi:rom_verify::@14->rom_verify::@3] - // [1356] phi rom_verify::y#11 = rom_verify::y#3 [phi:rom_verify::@14->rom_verify::@3#0] -- register_copy - // [1356] phi rom_verify::progress_row_current#4 = rom_verify::progress_row_current#3 [phi:rom_verify::@14->rom_verify::@3#1] -- register_copy + // [1548] phi from rom_verify::@14 to rom_verify::@3 [phi:rom_verify::@14->rom_verify::@3] + // [1548] phi rom_verify::y#11 = rom_verify::y#3 [phi:rom_verify::@14->rom_verify::@3#0] -- register_copy + // [1548] phi rom_verify::progress_row_current#4 = rom_verify::progress_row_current#3 [phi:rom_verify::@14->rom_verify::@3#1] -- register_copy // rom_verify::@3 __b3: // if (equal_bytes != ROM_PROGRESS_CELL) - // [1357] if(rom_verify::equal_bytes#0!=ROM_PROGRESS_CELL) goto rom_verify::@4 -- vwuz1_neq_vwuc1_then_la1 + // [1549] if(rom_verify::equal_bytes#0!=ROM_PROGRESS_CELL) goto rom_verify::@4 -- vwuz1_neq_vwuc1_then_la1 lda.z equal_bytes+1 cmp #>ROM_PROGRESS_CELL beq !__b4+ @@ -9166,17 +9928,17 @@ rom_verify: { !__b4: // rom_verify::@9 // cputc('=') - // [1358] stackpush(char) = '=' -- _stackpushbyte_=vbuc1 + // [1550] stackpush(char) = '=' -- _stackpushbyte_=vbuc1 lda #'=' pha - // [1359] callexecute cputc -- call_vprc1 + // [1551] callexecute cputc -- call_vprc1 jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // rom_verify::@5 __b5: // rom_bram_ptr += ROM_PROGRESS_CELL - // [1361] rom_verify::rom_bram_ptr#1 = rom_verify::rom_bram_ptr#10 + ROM_PROGRESS_CELL -- pbuz1=pbuz1_plus_vwuc1 + // [1553] rom_verify::rom_bram_ptr#1 = rom_verify::rom_bram_ptr#10 + ROM_PROGRESS_CELL -- pbuz1=pbuz1_plus_vwuc1 lda.z rom_bram_ptr clc adc #ROM_PROGRESS_CELL sta.z rom_bram_ptr+1 // rom_address += ROM_PROGRESS_CELL - // [1362] rom_verify::rom_address#1 = rom_verify::rom_address#12 + ROM_PROGRESS_CELL -- vduz1=vduz1_plus_vwuc1 + // [1554] rom_verify::rom_address#1 = rom_verify::rom_address#12 + ROM_PROGRESS_CELL -- vduz1=vduz1_plus_vwuc1 clc lda.z rom_address adc #ROM_PROGRESS_CELL sta.z progress_row_current+1 // if (rom_bram_ptr == BRAM_HIGH) - // [1364] if(rom_verify::rom_bram_ptr#1!=$c000) goto rom_verify::@6 -- pbuz1_neq_vwuc1_then_la1 + // [1556] if(rom_verify::rom_bram_ptr#1!=$c000) goto rom_verify::@6 -- pbuz1_neq_vwuc1_then_la1 lda.z rom_bram_ptr+1 cmp #>$c000 bne __b6 @@ -9218,46 +9980,46 @@ rom_verify: { bne __b6 // rom_verify::@10 // rom_bram_bank++; - // [1365] rom_verify::rom_bram_bank#1 = ++ rom_verify::rom_bram_bank#11 -- vbuz1=_inc_vbuz1 - inc.z rom_bram_bank - // [1366] phi from rom_verify::@10 to rom_verify::@6 [phi:rom_verify::@10->rom_verify::@6] - // [1366] phi rom_verify::rom_bram_bank#25 = rom_verify::rom_bram_bank#1 [phi:rom_verify::@10->rom_verify::@6#0] -- register_copy - // [1366] phi rom_verify::rom_bram_ptr#6 = (char *)$a000 [phi:rom_verify::@10->rom_verify::@6#1] -- pbuz1=pbuc1 + // [1557] rom_verify::rom_bram_bank#1 = ++ rom_verify::rom_bram_bank#11 -- vbum1=_inc_vbum1 + inc rom_bram_bank + // [1558] phi from rom_verify::@10 to rom_verify::@6 [phi:rom_verify::@10->rom_verify::@6] + // [1558] phi rom_verify::rom_bram_bank#25 = rom_verify::rom_bram_bank#1 [phi:rom_verify::@10->rom_verify::@6#0] -- register_copy + // [1558] phi rom_verify::rom_bram_ptr#6 = (char *)$a000 [phi:rom_verify::@10->rom_verify::@6#1] -- pbuz1=pbuc1 lda #<$a000 sta.z rom_bram_ptr lda #>$a000 sta.z rom_bram_ptr+1 - // [1366] phi from rom_verify::@5 to rom_verify::@6 [phi:rom_verify::@5->rom_verify::@6] - // [1366] phi rom_verify::rom_bram_bank#25 = rom_verify::rom_bram_bank#11 [phi:rom_verify::@5->rom_verify::@6#0] -- register_copy - // [1366] phi rom_verify::rom_bram_ptr#6 = rom_verify::rom_bram_ptr#1 [phi:rom_verify::@5->rom_verify::@6#1] -- register_copy + // [1558] phi from rom_verify::@5 to rom_verify::@6 [phi:rom_verify::@5->rom_verify::@6] + // [1558] phi rom_verify::rom_bram_bank#25 = rom_verify::rom_bram_bank#11 [phi:rom_verify::@5->rom_verify::@6#0] -- register_copy + // [1558] phi rom_verify::rom_bram_ptr#6 = rom_verify::rom_bram_ptr#1 [phi:rom_verify::@5->rom_verify::@6#1] -- register_copy // rom_verify::@6 __b6: // if (rom_bram_ptr == RAM_HIGH) - // [1367] if(rom_verify::rom_bram_ptr#6!=$9800) goto rom_verify::@24 -- pbuz1_neq_vwuc1_then_la1 + // [1559] if(rom_verify::rom_bram_ptr#6!=$9800) goto rom_verify::@24 -- pbuz1_neq_vwuc1_then_la1 lda.z rom_bram_ptr+1 cmp #>$9800 bne __b7 lda.z rom_bram_ptr cmp #<$9800 bne __b7 - // [1369] phi from rom_verify::@6 to rom_verify::@7 [phi:rom_verify::@6->rom_verify::@7] - // [1369] phi rom_verify::rom_bram_ptr#11 = (char *)$a000 [phi:rom_verify::@6->rom_verify::@7#0] -- pbuz1=pbuc1 + // [1561] phi from rom_verify::@6 to rom_verify::@7 [phi:rom_verify::@6->rom_verify::@7] + // [1561] phi rom_verify::rom_bram_ptr#11 = (char *)$a000 [phi:rom_verify::@6->rom_verify::@7#0] -- pbuz1=pbuc1 lda #<$a000 sta.z rom_bram_ptr lda #>$a000 sta.z rom_bram_ptr+1 - // [1369] phi rom_verify::rom_bram_bank#10 = 1 [phi:rom_verify::@6->rom_verify::@7#1] -- vbuz1=vbuc1 + // [1561] phi rom_verify::rom_bram_bank#10 = 1 [phi:rom_verify::@6->rom_verify::@7#1] -- vbum1=vbuc1 lda #1 - sta.z rom_bram_bank - // [1368] phi from rom_verify::@6 to rom_verify::@24 [phi:rom_verify::@6->rom_verify::@24] + sta rom_bram_bank + // [1560] phi from rom_verify::@6 to rom_verify::@24 [phi:rom_verify::@6->rom_verify::@24] // rom_verify::@24 - // [1369] phi from rom_verify::@24 to rom_verify::@7 [phi:rom_verify::@24->rom_verify::@7] - // [1369] phi rom_verify::rom_bram_ptr#11 = rom_verify::rom_bram_ptr#6 [phi:rom_verify::@24->rom_verify::@7#0] -- register_copy - // [1369] phi rom_verify::rom_bram_bank#10 = rom_verify::rom_bram_bank#25 [phi:rom_verify::@24->rom_verify::@7#1] -- register_copy + // [1561] phi from rom_verify::@24 to rom_verify::@7 [phi:rom_verify::@24->rom_verify::@7] + // [1561] phi rom_verify::rom_bram_ptr#11 = rom_verify::rom_bram_ptr#6 [phi:rom_verify::@24->rom_verify::@7#0] -- register_copy + // [1561] phi rom_verify::rom_bram_bank#10 = rom_verify::rom_bram_bank#25 [phi:rom_verify::@24->rom_verify::@7#1] -- register_copy // rom_verify::@7 __b7: // ROM_PROGRESS_CELL - equal_bytes - // [1370] rom_verify::$17 = ROM_PROGRESS_CELL - rom_verify::equal_bytes#0 -- vwuz1=vwuc1_minus_vwuz1 + // [1562] rom_verify::$17 = ROM_PROGRESS_CELL - rom_verify::equal_bytes#0 -- vwuz1=vwuc1_minus_vwuz1 lda # ROM:%05x", rom_different_bytes, rom_bram_bank, rom_bram_ptr, rom_address) - // [1372] call snprintf_init - // [1113] phi from rom_verify::@7 to snprintf_init [phi:rom_verify::@7->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:rom_verify::@7->snprintf_init#0] -- pbuz1=pbuc1 - lda #<@info_text + // [1564] call snprintf_init + // [1184] phi from rom_verify::@7 to snprintf_init [phi:rom_verify::@7->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:rom_verify::@7->snprintf_init#0] -- pbuz1=pbuc1 + lda #@info_text + lda #>info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [1373] phi from rom_verify::@7 to rom_verify::@15 [phi:rom_verify::@7->rom_verify::@15] + // [1565] phi from rom_verify::@7 to rom_verify::@15 [phi:rom_verify::@7->rom_verify::@15] // rom_verify::@15 // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", rom_different_bytes, rom_bram_bank, rom_bram_ptr, rom_address) - // [1374] call printf_str - // [1054] phi from rom_verify::@15 to printf_str [phi:rom_verify::@15->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:rom_verify::@15->printf_str#0] -- pprz1=pprc1 + // [1566] call printf_str + // [1125] phi from rom_verify::@15 to printf_str [phi:rom_verify::@15->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:rom_verify::@15->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = rom_verify::s [phi:rom_verify::@15->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = rom_verify::s [phi:rom_verify::@15->printf_str#1] -- pbuz1=pbuc1 lda #s @@ -9307,7 +10069,7 @@ rom_verify: { jsr printf_str // rom_verify::@16 // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", rom_different_bytes, rom_bram_bank, rom_bram_ptr, rom_address) - // [1375] printf_ulong::uvalue#5 = rom_verify::rom_different_bytes#1 -- vdum1=vduz2 + // [1567] printf_ulong::uvalue#6 = rom_verify::rom_different_bytes#1 -- vdum1=vduz2 lda.z rom_different_bytes sta printf_ulong.uvalue lda.z rom_different_bytes+1 @@ -9316,30 +10078,29 @@ rom_verify: { sta printf_ulong.uvalue+2 lda.z rom_different_bytes+3 sta printf_ulong.uvalue+3 - // [1376] call printf_ulong - // [1396] phi from rom_verify::@16 to printf_ulong [phi:rom_verify::@16->printf_ulong] - // [1396] phi printf_ulong::format_zero_padding#10 = 1 [phi:rom_verify::@16->printf_ulong#0] -- vbum1=vbuc1 + // [1568] call printf_ulong + // [1588] phi from rom_verify::@16 to printf_ulong [phi:rom_verify::@16->printf_ulong] + // [1588] phi printf_ulong::format_zero_padding#14 = 1 [phi:rom_verify::@16->printf_ulong#0] -- vbum1=vbuc1 lda #1 sta printf_ulong.format_zero_padding - // [1396] phi printf_ulong::format_min_length#10 = 5 [phi:rom_verify::@16->printf_ulong#1] -- vbum1=vbuc1 + // [1588] phi printf_ulong::format_min_length#14 = 5 [phi:rom_verify::@16->printf_ulong#1] -- vbum1=vbuc1 lda #5 sta printf_ulong.format_min_length - // [1396] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:rom_verify::@16->printf_ulong#2] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_ulong.format_radix - // [1396] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#5 [phi:rom_verify::@16->printf_ulong#3] -- register_copy + // [1588] phi printf_ulong::format_radix#14 = HEXADECIMAL [phi:rom_verify::@16->printf_ulong#2] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1588] phi printf_ulong::uvalue#14 = printf_ulong::uvalue#6 [phi:rom_verify::@16->printf_ulong#3] -- register_copy jsr printf_ulong - // [1377] phi from rom_verify::@16 to rom_verify::@17 [phi:rom_verify::@16->rom_verify::@17] + // [1569] phi from rom_verify::@16 to rom_verify::@17 [phi:rom_verify::@16->rom_verify::@17] // rom_verify::@17 // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", rom_different_bytes, rom_bram_bank, rom_bram_ptr, rom_address) - // [1378] call printf_str - // [1054] phi from rom_verify::@17 to printf_str [phi:rom_verify::@17->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:rom_verify::@17->printf_str#0] -- pprz1=pprc1 + // [1570] call printf_str + // [1125] phi from rom_verify::@17 to printf_str [phi:rom_verify::@17->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:rom_verify::@17->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = rom_verify::s1 [phi:rom_verify::@17->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = rom_verify::s1 [phi:rom_verify::@17->printf_str#1] -- pbuz1=pbuc1 lda #s1 @@ -9347,38 +10108,36 @@ rom_verify: { jsr printf_str // rom_verify::@18 // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", rom_different_bytes, rom_bram_bank, rom_bram_ptr, rom_address) - // [1379] printf_uchar::uvalue#14 = rom_verify::rom_bram_bank#10 -- vbum1=vbuz2 - lda.z rom_bram_bank - sta printf_uchar.uvalue - // [1380] call printf_uchar - // [1118] phi from rom_verify::@18 to printf_uchar [phi:rom_verify::@18->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 1 [phi:rom_verify::@18->printf_uchar#0] -- vbum1=vbuc1 + // [1571] printf_uchar::uvalue#11 = rom_verify::rom_bram_bank#10 -- vbuxx=vbum1 + ldx rom_bram_bank + // [1572] call printf_uchar + // [1189] phi from rom_verify::@18 to printf_uchar [phi:rom_verify::@18->printf_uchar] + // [1189] phi printf_uchar::format_zero_padding#15 = 1 [phi:rom_verify::@18->printf_uchar#0] -- vbum1=vbuc1 lda #1 sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 2 [phi:rom_verify::@18->printf_uchar#1] -- vbum1=vbuc1 + // [1189] phi printf_uchar::format_min_length#15 = 2 [phi:rom_verify::@18->printf_uchar#1] -- vbum1=vbuc1 lda #2 sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &snputc [phi:rom_verify::@18->printf_uchar#2] -- pprz1=pprc1 + // [1189] phi printf_uchar::putc#15 = &snputc [phi:rom_verify::@18->printf_uchar#2] -- pprz1=pprc1 lda #snputc sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = HEXADECIMAL [phi:rom_verify::@18->printf_uchar#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = printf_uchar::uvalue#14 [phi:rom_verify::@18->printf_uchar#4] -- register_copy + // [1189] phi printf_uchar::format_radix#15 = HEXADECIMAL [phi:rom_verify::@18->printf_uchar#3] -- vbuyy=vbuc1 + ldy #HEXADECIMAL + // [1189] phi printf_uchar::uvalue#15 = printf_uchar::uvalue#11 [phi:rom_verify::@18->printf_uchar#4] -- register_copy jsr printf_uchar - // [1381] phi from rom_verify::@18 to rom_verify::@19 [phi:rom_verify::@18->rom_verify::@19] + // [1573] phi from rom_verify::@18 to rom_verify::@19 [phi:rom_verify::@18->rom_verify::@19] // rom_verify::@19 // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", rom_different_bytes, rom_bram_bank, rom_bram_ptr, rom_address) - // [1382] call printf_str - // [1054] phi from rom_verify::@19 to printf_str [phi:rom_verify::@19->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:rom_verify::@19->printf_str#0] -- pprz1=pprc1 + // [1574] call printf_str + // [1125] phi from rom_verify::@19 to printf_str [phi:rom_verify::@19->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:rom_verify::@19->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s2 [phi:rom_verify::@19->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s2 [phi:rom_verify::@19->printf_str#1] -- pbuz1=pbuc1 lda #s2 @@ -9386,40 +10145,39 @@ rom_verify: { jsr printf_str // rom_verify::@20 // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", rom_different_bytes, rom_bram_bank, rom_bram_ptr, rom_address) - // [1383] printf_uint::uvalue#5 = (unsigned int)rom_verify::rom_bram_ptr#11 -- vwum1=vwuz2 + // [1575] printf_uint::uvalue#5 = (unsigned int)rom_verify::rom_bram_ptr#11 -- vwum1=vwuz2 lda.z rom_bram_ptr sta printf_uint.uvalue lda.z rom_bram_ptr+1 sta printf_uint.uvalue+1 - // [1384] call printf_uint - // [1835] phi from rom_verify::@20 to printf_uint [phi:rom_verify::@20->printf_uint] - // [1835] phi printf_uint::format_zero_padding#10 = 1 [phi:rom_verify::@20->printf_uint#0] -- vbum1=vbuc1 + // [1576] call printf_uint + // [2015] phi from rom_verify::@20 to printf_uint [phi:rom_verify::@20->printf_uint] + // [2015] phi printf_uint::format_zero_padding#10 = 1 [phi:rom_verify::@20->printf_uint#0] -- vbum1=vbuc1 lda #1 sta printf_uint.format_zero_padding - // [1835] phi printf_uint::format_min_length#10 = 4 [phi:rom_verify::@20->printf_uint#1] -- vbum1=vbuc1 + // [2015] phi printf_uint::format_min_length#10 = 4 [phi:rom_verify::@20->printf_uint#1] -- vbum1=vbuc1 lda #4 sta printf_uint.format_min_length - // [1835] phi printf_uint::putc#10 = &snputc [phi:rom_verify::@20->printf_uint#2] -- pprz1=pprc1 + // [2015] phi printf_uint::putc#10 = &snputc [phi:rom_verify::@20->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1835] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:rom_verify::@20->printf_uint#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uint.format_radix - // [1835] phi printf_uint::uvalue#10 = printf_uint::uvalue#5 [phi:rom_verify::@20->printf_uint#4] -- register_copy + // [2015] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:rom_verify::@20->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [2015] phi printf_uint::uvalue#10 = printf_uint::uvalue#5 [phi:rom_verify::@20->printf_uint#4] -- register_copy jsr printf_uint - // [1385] phi from rom_verify::@20 to rom_verify::@21 [phi:rom_verify::@20->rom_verify::@21] + // [1577] phi from rom_verify::@20 to rom_verify::@21 [phi:rom_verify::@20->rom_verify::@21] // rom_verify::@21 // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", rom_different_bytes, rom_bram_bank, rom_bram_ptr, rom_address) - // [1386] call printf_str - // [1054] phi from rom_verify::@21 to printf_str [phi:rom_verify::@21->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:rom_verify::@21->printf_str#0] -- pprz1=pprc1 + // [1578] call printf_str + // [1125] phi from rom_verify::@21 to printf_str [phi:rom_verify::@21->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:rom_verify::@21->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = rom_verify::s3 [phi:rom_verify::@21->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = rom_verify::s3 [phi:rom_verify::@21->printf_str#1] -- pbuz1=pbuc1 lda #s3 @@ -9427,7 +10185,7 @@ rom_verify: { jsr printf_str // rom_verify::@22 // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", rom_different_bytes, rom_bram_bank, rom_bram_ptr, rom_address) - // [1387] printf_ulong::uvalue#6 = rom_verify::rom_address#1 -- vdum1=vduz2 + // [1579] printf_ulong::uvalue#7 = rom_verify::rom_address#1 -- vdum1=vduz2 lda.z rom_address sta printf_ulong.uvalue lda.z rom_address+1 @@ -9436,59 +10194,56 @@ rom_verify: { sta printf_ulong.uvalue+2 lda.z rom_address+3 sta printf_ulong.uvalue+3 - // [1388] call printf_ulong - // [1396] phi from rom_verify::@22 to printf_ulong [phi:rom_verify::@22->printf_ulong] - // [1396] phi printf_ulong::format_zero_padding#10 = 1 [phi:rom_verify::@22->printf_ulong#0] -- vbum1=vbuc1 + // [1580] call printf_ulong + // [1588] phi from rom_verify::@22 to printf_ulong [phi:rom_verify::@22->printf_ulong] + // [1588] phi printf_ulong::format_zero_padding#14 = 1 [phi:rom_verify::@22->printf_ulong#0] -- vbum1=vbuc1 lda #1 sta printf_ulong.format_zero_padding - // [1396] phi printf_ulong::format_min_length#10 = 5 [phi:rom_verify::@22->printf_ulong#1] -- vbum1=vbuc1 + // [1588] phi printf_ulong::format_min_length#14 = 5 [phi:rom_verify::@22->printf_ulong#1] -- vbum1=vbuc1 lda #5 sta printf_ulong.format_min_length - // [1396] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:rom_verify::@22->printf_ulong#2] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_ulong.format_radix - // [1396] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#6 [phi:rom_verify::@22->printf_ulong#3] -- register_copy + // [1588] phi printf_ulong::format_radix#14 = HEXADECIMAL [phi:rom_verify::@22->printf_ulong#2] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1588] phi printf_ulong::uvalue#14 = printf_ulong::uvalue#7 [phi:rom_verify::@22->printf_ulong#3] -- register_copy jsr printf_ulong // rom_verify::@23 // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", rom_different_bytes, rom_bram_bank, rom_bram_ptr, rom_address) - // [1389] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [1581] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [1390] callexecute snputc -- call_vprc1 + // [1582] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [1392] call display_action_text - // [1129] phi from rom_verify::@23 to display_action_text [phi:rom_verify::@23->display_action_text] - // [1129] phi display_action_text::info_text#17 = info_text [phi:rom_verify::@23->display_action_text#0] -- pbuz1=pbuc1 - lda #<@info_text + // [1584] call display_action_text + // [1200] phi from rom_verify::@23 to display_action_text [phi:rom_verify::@23->display_action_text] + // [1200] phi display_action_text::info_text#25 = info_text [phi:rom_verify::@23->display_action_text#0] -- pbuz1=pbuc1 + lda #@info_text + lda #>info_text sta.z display_action_text.info_text+1 jsr display_action_text - // [1343] phi from rom_verify::@23 to rom_verify::@1 [phi:rom_verify::@23->rom_verify::@1] - // [1343] phi rom_verify::y#3 = rom_verify::y#11 [phi:rom_verify::@23->rom_verify::@1#0] -- register_copy - // [1343] phi rom_verify::progress_row_current#3 = rom_verify::progress_row_current#11 [phi:rom_verify::@23->rom_verify::@1#1] -- register_copy - // [1343] phi rom_verify::rom_different_bytes#11 = rom_verify::rom_different_bytes#1 [phi:rom_verify::@23->rom_verify::@1#2] -- register_copy - // [1343] phi rom_verify::rom_bram_ptr#10 = rom_verify::rom_bram_ptr#11 [phi:rom_verify::@23->rom_verify::@1#3] -- register_copy - // [1343] phi rom_verify::rom_bram_bank#11 = rom_verify::rom_bram_bank#10 [phi:rom_verify::@23->rom_verify::@1#4] -- register_copy - // [1343] phi rom_verify::rom_address#12 = rom_verify::rom_address#1 [phi:rom_verify::@23->rom_verify::@1#5] -- register_copy + // [1535] phi from rom_verify::@23 to rom_verify::@1 [phi:rom_verify::@23->rom_verify::@1] + // [1535] phi rom_verify::y#3 = rom_verify::y#11 [phi:rom_verify::@23->rom_verify::@1#0] -- register_copy + // [1535] phi rom_verify::progress_row_current#3 = rom_verify::progress_row_current#11 [phi:rom_verify::@23->rom_verify::@1#1] -- register_copy + // [1535] phi rom_verify::rom_different_bytes#11 = rom_verify::rom_different_bytes#1 [phi:rom_verify::@23->rom_verify::@1#2] -- register_copy + // [1535] phi rom_verify::rom_bram_ptr#10 = rom_verify::rom_bram_ptr#11 [phi:rom_verify::@23->rom_verify::@1#3] -- register_copy + // [1535] phi rom_verify::rom_bram_bank#11 = rom_verify::rom_bram_bank#10 [phi:rom_verify::@23->rom_verify::@1#4] -- register_copy + // [1535] phi rom_verify::rom_address#12 = rom_verify::rom_address#1 [phi:rom_verify::@23->rom_verify::@1#5] -- register_copy jmp __b1 // rom_verify::@4 __b4: // cputc('*') - // [1393] stackpush(char) = '*' -- _stackpushbyte_=vbuc1 + // [1585] stackpush(char) = '*' -- _stackpushbyte_=vbuc1 lda #'*' pha - // [1394] callexecute cputc -- call_vprc1 + // [1586] callexecute cputc -- call_vprc1 jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla jmp __b5 .segment Data - info_text: .text "Comparing ..." - .byte 0 s: .text "Comparing: " .byte 0 s1: .text " differences between RAM:" @@ -9496,101 +10251,103 @@ rom_verify: { s3: .text " <-> ROM:" .byte 0 .label rom_boundary = file_size - .label rom_chip = main.check_status_rom1_main__0 - .label rom_bank_start = main.check_status_smc7_main__0 + // We start for ROM from 0x0:0x7800 !!!! + .label rom_bram_bank = main.main__59 + .label rom_chip = w25q16_erase.vera_current_64k_block file_size: .dword 0 } .segment Code // printf_ulong // Print an unsigned int using a specific format -// void printf_ulong(void (*putc)(char), __mem() unsigned long uvalue, __mem() char format_min_length, char format_justify_left, char format_sign_always, __mem() char format_zero_padding, char format_upper_case, __mem() char format_radix) +// void printf_ulong(void (*putc)(char), __mem() unsigned long uvalue, __mem() char format_min_length, char format_justify_left, char format_sign_always, __mem() char format_zero_padding, char format_upper_case, __register(X) char format_radix) printf_ulong: { // printf_ulong::@1 // printf_buffer.sign = format.sign_always?'+':0 - // [1397] *((char *)&printf_buffer) = 0 -- _deref_pbuc1=vbuc2 + // [1589] *((char *)&printf_buffer) = 0 -- _deref_pbuc1=vbuc2 // Handle any sign lda #0 sta printf_buffer // ultoa(uvalue, printf_buffer.digits, format.radix) - // [1398] ultoa::value#1 = printf_ulong::uvalue#10 - // [1399] ultoa::radix#0 = printf_ulong::format_radix#10 - // [1400] call ultoa + // [1590] ultoa::value#1 = printf_ulong::uvalue#14 + // [1591] ultoa::radix#0 = printf_ulong::format_radix#14 + // [1592] call ultoa // Format number into buffer jsr ultoa // printf_ulong::@2 // printf_number_buffer(putc, printf_buffer, format) - // [1401] printf_number_buffer::buffer_sign#0 = *((char *)&printf_buffer) -- vbum1=_deref_pbuc1 + // [1593] printf_number_buffer::buffer_sign#0 = *((char *)&printf_buffer) -- vbum1=_deref_pbuc1 lda printf_buffer sta printf_number_buffer.buffer_sign - // [1402] printf_number_buffer::format_min_length#0 = printf_ulong::format_min_length#10 - // [1403] printf_number_buffer::format_zero_padding#0 = printf_ulong::format_zero_padding#10 - // [1404] call printf_number_buffer + // [1594] printf_number_buffer::format_min_length#0 = printf_ulong::format_min_length#14 -- vbuxx=vbum1 + ldx format_min_length + // [1595] printf_number_buffer::format_zero_padding#0 = printf_ulong::format_zero_padding#14 + // [1596] call printf_number_buffer // Print using format - // [2116] phi from printf_ulong::@2 to printf_number_buffer [phi:printf_ulong::@2->printf_number_buffer] - // [2116] phi printf_number_buffer::putc#10 = &snputc [phi:printf_ulong::@2->printf_number_buffer#0] -- pprz1=pprc1 + // [2362] phi from printf_ulong::@2 to printf_number_buffer [phi:printf_ulong::@2->printf_number_buffer] + // [2362] phi printf_number_buffer::putc#10 = &snputc [phi:printf_ulong::@2->printf_number_buffer#0] -- pprz1=pprc1 lda #snputc sta.z printf_number_buffer.putc+1 - // [2116] phi printf_number_buffer::buffer_sign#10 = printf_number_buffer::buffer_sign#0 [phi:printf_ulong::@2->printf_number_buffer#1] -- register_copy - // [2116] phi printf_number_buffer::format_zero_padding#10 = printf_number_buffer::format_zero_padding#0 [phi:printf_ulong::@2->printf_number_buffer#2] -- register_copy - // [2116] phi printf_number_buffer::format_min_length#3 = printf_number_buffer::format_min_length#0 [phi:printf_ulong::@2->printf_number_buffer#3] -- register_copy + // [2362] phi printf_number_buffer::buffer_sign#10 = printf_number_buffer::buffer_sign#0 [phi:printf_ulong::@2->printf_number_buffer#1] -- register_copy + // [2362] phi printf_number_buffer::format_zero_padding#10 = printf_number_buffer::format_zero_padding#0 [phi:printf_ulong::@2->printf_number_buffer#2] -- register_copy + // [2362] phi printf_number_buffer::format_min_length#3 = printf_number_buffer::format_min_length#0 [phi:printf_ulong::@2->printf_number_buffer#3] -- register_copy jsr printf_number_buffer // printf_ulong::@return // } - // [1405] return + // [1597] return rts .segment Data uvalue: .dword 0 - format_radix: .byte 0 .label format_min_length = printf_uchar.format_min_length .label format_zero_padding = printf_uchar.format_zero_padding } .segment Code // rom_flash -// __zp($e8) unsigned long rom_flash(__mem() char rom_chip, __mem() char rom_bank_start, __mem() unsigned long file_size) +// __zp($e0) unsigned long rom_flash(__mem() char rom_chip, __mem() char rom_bank_start, __zp($f6) unsigned long file_size) rom_flash: { - .label rom_flash__29 = $f2 - .label equal_bytes = $5e - .label ram_address_sector = $f0 - .label equal_bytes_1 = $d8 - .label retries = $f6 - .label flash_errors_sector = $b0 - .label ram_address = $d6 - .label rom_address = $d2 - .label x = $cb - .label flash_errors = $e8 + .label equal_bytes = $46 + .label ram_address_sector = $ec + .label equal_bytes_1 = $d0 + .label retries = $f3 + .label flash_errors_sector = $6b + .label ram_address = $5b + .label rom_address = $c5 + .label flash_bytes_sector = $be + .label x = $b9 + .label flash_errors = $e0 // We start for ROM from 0x0:0x7800 !!!! - .label bram_bank_sector = $dc - .label x_sector = $dd - .label y_sector = $e0 - .label return = $e8 + .label bram_bank_sector = $f5 + .label y_sector = $fa + .label file_size = $f6 + .label return = $e0 // rom_flash::bank_set_bram1 // BRAM = bank - // [1407] BRAM = 0 -- vbuz1=vbuc1 + // [1599] BRAM = 0 -- vbuz1=vbuc1 lda #0 sta.z BRAM - // [1408] phi from rom_flash::bank_set_bram1 to rom_flash::@19 [phi:rom_flash::bank_set_bram1->rom_flash::@19] + // [1600] phi from rom_flash::bank_set_bram1 to rom_flash::@19 [phi:rom_flash::bank_set_bram1->rom_flash::@19] // rom_flash::@19 - // display_action_progress("Flashing ... (-) equal, (+) flashed, (!) error.") - // [1409] call display_action_progress + // display_action_progress(TEXT_PROGRESS_FLASHING) + // [1601] call display_action_progress // Now we compare the RAM with the actual ROM contents. - // [1084] phi from rom_flash::@19 to display_action_progress [phi:rom_flash::@19->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = rom_flash::info_text [phi:rom_flash::@19->display_action_progress#0] -- pbuz1=pbuc1 - lda #display_action_progress] + // [1155] phi display_action_progress::info_text#30 = TEXT_PROGRESS_FLASHING [phi:rom_flash::@19->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text + lda #>TEXT_PROGRESS_FLASHING sta.z display_action_progress.info_text+1 jsr display_action_progress // rom_flash::@20 // unsigned long rom_address_sector = rom_address_from_bank(rom_bank_start) - // [1410] rom_address_from_bank::rom_bank#2 = rom_flash::rom_bank_start#0 - // [1411] call rom_address_from_bank - // [2169] phi from rom_flash::@20 to rom_address_from_bank [phi:rom_flash::@20->rom_address_from_bank] - // [2169] phi rom_address_from_bank::rom_bank#3 = rom_address_from_bank::rom_bank#2 [phi:rom_flash::@20->rom_address_from_bank#0] -- register_copy + // [1602] rom_address_from_bank::rom_bank#2 = rom_flash::rom_bank_start#0 -- vbuaa=vbum1 + lda rom_bank_start + // [1603] call rom_address_from_bank + // [2569] phi from rom_flash::@20 to rom_address_from_bank [phi:rom_flash::@20->rom_address_from_bank] + // [2569] phi rom_address_from_bank::rom_bank#3 = rom_address_from_bank::rom_bank#2 [phi:rom_flash::@20->rom_address_from_bank#0] -- register_copy jsr rom_address_from_bank // unsigned long rom_address_sector = rom_address_from_bank(rom_bank_start) - // [1412] rom_address_from_bank::return#4 = rom_address_from_bank::return#0 -- vdum1=vdum2 + // [1604] rom_address_from_bank::return#4 = rom_address_from_bank::return#0 -- vdum1=vdum2 lda rom_address_from_bank.return sta rom_address_from_bank.return_2 lda rom_address_from_bank.return+1 @@ -9600,40 +10357,32 @@ rom_flash: { lda rom_address_from_bank.return+3 sta rom_address_from_bank.return_2+3 // rom_flash::@21 - // [1413] rom_flash::rom_address_sector#0 = rom_address_from_bank::return#4 + // [1605] rom_flash::rom_address_sector#0 = rom_address_from_bank::return#4 // unsigned long rom_boundary = rom_address_sector + file_size - // [1414] rom_flash::rom_boundary#0 = rom_flash::rom_address_sector#0 + rom_flash::file_size#0 -- vdum1=vdum2_plus_vdum3 + // [1606] rom_flash::rom_boundary#0 = rom_flash::rom_address_sector#0 + rom_flash::file_size#0 -- vdum1=vdum2_plus_vduz3 lda rom_address_sector clc - adc file_size + adc.z file_size sta rom_boundary lda rom_address_sector+1 - adc file_size+1 + adc.z file_size+1 sta rom_boundary+1 lda rom_address_sector+2 - adc file_size+2 + adc.z file_size+2 sta rom_boundary+2 lda rom_address_sector+3 - adc file_size+3 + adc.z file_size+3 sta rom_boundary+3 - // display_info_rom(rom_chip, STATUS_FLASHING, "Flashing ...") - // [1415] display_info_rom::rom_chip#3 = rom_flash::rom_chip#0 -- vbum1=vbum2 - lda rom_chip - sta display_info_rom.rom_chip - // [1416] call display_info_rom - // [1176] phi from rom_flash::@21 to display_info_rom [phi:rom_flash::@21->display_info_rom] - // [1176] phi display_info_rom::info_text#16 = rom_flash::info_text1 [phi:rom_flash::@21->display_info_rom#0] -- pbuz1=pbuc1 - lda #info_text1 - sta.z display_info_rom.info_text+1 - // [1176] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#3 [phi:rom_flash::@21->display_info_rom#1] -- register_copy - // [1176] phi display_info_rom::info_status#16 = STATUS_FLASHING [phi:rom_flash::@21->display_info_rom#2] -- vbuz1=vbuc1 - lda #STATUS_FLASHING - sta.z display_info_rom.info_status - jsr display_info_rom - // [1417] phi from rom_flash::@21 to rom_flash::@1 [phi:rom_flash::@21->rom_flash::@1] - // [1417] phi rom_flash::flash_errors#12 = 0 [phi:rom_flash::@21->rom_flash::@1#0] -- vduz1=vduc1 + // [1607] phi from rom_flash::@21 to rom_flash::@1 [phi:rom_flash::@21->rom_flash::@1] + // [1607] phi rom_flash::flash_bytes#14 = 0 [phi:rom_flash::@21->rom_flash::@1#0] -- vdum1=vduc1 + lda #<0 + sta flash_bytes + sta flash_bytes+1 + lda #<0>>$10 + sta flash_bytes+2 + lda #>0>>$10 + sta flash_bytes+3 + // [1607] phi rom_flash::flash_errors#2 = 0 [phi:rom_flash::@21->rom_flash::@1#1] -- vduz1=vduc1 lda #<0 sta.z flash_errors sta.z flash_errors+1 @@ -9641,25 +10390,25 @@ rom_flash: { sta.z flash_errors+2 lda #>0>>$10 sta.z flash_errors+3 - // [1417] phi rom_flash::y_sector#13 = PROGRESS_Y [phi:rom_flash::@21->rom_flash::@1#1] -- vbuz1=vbuc1 + // [1607] phi rom_flash::y_sector#13 = PROGRESS_Y [phi:rom_flash::@21->rom_flash::@1#2] -- vbuz1=vbuc1 lda #PROGRESS_Y sta.z y_sector - // [1417] phi rom_flash::x_sector#10 = PROGRESS_X [phi:rom_flash::@21->rom_flash::@1#2] -- vbuz1=vbuc1 + // [1607] phi rom_flash::x_sector#10 = PROGRESS_X [phi:rom_flash::@21->rom_flash::@1#3] -- vbum1=vbuc1 lda #PROGRESS_X - sta.z x_sector - // [1417] phi rom_flash::ram_address_sector#11 = (char *)$7800 [phi:rom_flash::@21->rom_flash::@1#3] -- pbuz1=pbuc1 + sta x_sector + // [1607] phi rom_flash::ram_address_sector#11 = (char *)$7800 [phi:rom_flash::@21->rom_flash::@1#4] -- pbuz1=pbuc1 lda #<$7800 sta.z ram_address_sector lda #>$7800 sta.z ram_address_sector+1 - // [1417] phi rom_flash::bram_bank_sector#14 = 0 [phi:rom_flash::@21->rom_flash::@1#4] -- vbuz1=vbuc1 + // [1607] phi rom_flash::bram_bank_sector#14 = 0 [phi:rom_flash::@21->rom_flash::@1#5] -- vbuz1=vbuc1 lda #0 sta.z bram_bank_sector - // [1417] phi rom_flash::rom_address_sector#13 = rom_flash::rom_address_sector#0 [phi:rom_flash::@21->rom_flash::@1#5] -- register_copy + // [1607] phi rom_flash::rom_address_sector#12 = rom_flash::rom_address_sector#0 [phi:rom_flash::@21->rom_flash::@1#6] -- register_copy // rom_flash::@1 __b1: // while (rom_address_sector < rom_boundary) - // [1418] if(rom_flash::rom_address_sector#13display_action_text_flashed] - // [2424] phi display_action_text_flashed::chip#2 = chip [phi:rom_flash::@3->display_action_text_flashed#0] -- pbuz1=pbuc1 + sta display_action_text_flashed.bytes+3 + // [1610] call display_action_text_flashed + // [2824] phi from rom_flash::@3 to display_action_text_flashed [phi:rom_flash::@3->display_action_text_flashed] + // [2824] phi display_action_text_flashed::chip#3 = chip [phi:rom_flash::@3->display_action_text_flashed#0] -- pbuz1=pbuc1 lda #chip sta.z display_action_text_flashed.chip+1 - // [2424] phi display_action_text_flashed::bytes#2 = display_action_text_flashed::bytes#1 [phi:rom_flash::@3->display_action_text_flashed#1] -- register_copy + // [2824] phi display_action_text_flashed::bytes#3 = display_action_text_flashed::bytes#1 [phi:rom_flash::@3->display_action_text_flashed#1] -- register_copy jsr display_action_text_flashed - // [1421] phi from rom_flash::@3 to rom_flash::@23 [phi:rom_flash::@3->rom_flash::@23] + // [1611] phi from rom_flash::@3 to rom_flash::@23 [phi:rom_flash::@3->rom_flash::@23] // rom_flash::@23 - // wait_moment(32) - // [1422] call wait_moment - // [1063] phi from rom_flash::@23 to wait_moment [phi:rom_flash::@23->wait_moment] - // [1063] phi wait_moment::w#7 = $20 [phi:rom_flash::@23->wait_moment#0] -- vbum1=vbuc1 - lda #$20 - sta wait_moment.w + // wait_moment(16) + // [1612] call wait_moment + // [1134] phi from rom_flash::@23 to wait_moment [phi:rom_flash::@23->wait_moment] + // [1134] phi wait_moment::w#17 = $10 [phi:rom_flash::@23->wait_moment#0] -- vbuz1=vbuc1 + lda #$10 + sta.z wait_moment.w jsr wait_moment // rom_flash::@return // } - // [1423] return + // [1613] return rts // rom_flash::@2 __b2: // unsigned int equal_bytes = rom_compare(bram_bank_sector, (bram_ptr_t)ram_address_sector, rom_address_sector, ROM_SECTOR) - // [1424] rom_compare::bank_ram#1 = rom_flash::bram_bank_sector#14 - // [1425] rom_compare::ptr_ram#2 = rom_flash::ram_address_sector#11 -- pbuz1=pbuz2 + // [1614] rom_compare::bank_ram#1 = rom_flash::bram_bank_sector#14 -- vbuxx=vbuz1 + ldx.z bram_bank_sector + // [1615] rom_compare::ptr_ram#2 = rom_flash::ram_address_sector#11 -- pbuz1=pbuz2 lda.z ram_address_sector sta.z rom_compare.ptr_ram lda.z ram_address_sector+1 sta.z rom_compare.ptr_ram+1 - // [1426] rom_compare::rom_compare_address#1 = rom_flash::rom_address_sector#13 -- vduz1=vdum2 + // [1616] rom_compare::rom_compare_address#1 = rom_flash::rom_address_sector#12 -- vduz1=vdum2 lda rom_address_sector sta.z rom_compare.rom_compare_address lda rom_address_sector+1 @@ -9727,26 +10477,24 @@ rom_flash: { sta.z rom_compare.rom_compare_address+2 lda rom_address_sector+3 sta.z rom_compare.rom_compare_address+3 - // [1427] call rom_compare + // [1617] call rom_compare // {asm{.byte $db}} - // [2368] phi from rom_flash::@2 to rom_compare [phi:rom_flash::@2->rom_compare] - // [2368] phi rom_compare::ptr_ram#10 = rom_compare::ptr_ram#2 [phi:rom_flash::@2->rom_compare#0] -- register_copy - // [2368] phi rom_compare::rom_compare_size#11 = $1000 [phi:rom_flash::@2->rom_compare#1] -- vwuz1=vwuc1 + // [2768] phi from rom_flash::@2 to rom_compare [phi:rom_flash::@2->rom_compare] + // [2768] phi rom_compare::ptr_ram#10 = rom_compare::ptr_ram#2 [phi:rom_flash::@2->rom_compare#0] -- register_copy + // [2768] phi rom_compare::rom_compare_size#11 = $1000 [phi:rom_flash::@2->rom_compare#1] -- vwuz1=vwuc1 lda #<$1000 sta.z rom_compare.rom_compare_size lda #>$1000 sta.z rom_compare.rom_compare_size+1 - // [2368] phi rom_compare::rom_compare_address#3 = rom_compare::rom_compare_address#1 [phi:rom_flash::@2->rom_compare#2] -- register_copy - // [2368] phi rom_compare::bank_set_bram1_bank#0 = rom_compare::bank_ram#1 [phi:rom_flash::@2->rom_compare#3] -- vbum1=vbuz2 - lda.z rom_compare.bank_ram_1 - sta rom_compare.bank_set_bram1_bank + // [2768] phi rom_compare::rom_compare_address#3 = rom_compare::rom_compare_address#1 [phi:rom_flash::@2->rom_compare#2] -- register_copy + // [2768] phi rom_compare::bank_set_bram1_bank#0 = rom_compare::bank_ram#1 [phi:rom_flash::@2->rom_compare#3] -- register_copy jsr rom_compare // unsigned int equal_bytes = rom_compare(bram_bank_sector, (bram_ptr_t)ram_address_sector, rom_address_sector, ROM_SECTOR) - // [1428] rom_compare::return#3 = rom_compare::equal_bytes#2 + // [1618] rom_compare::return#3 = rom_compare::equal_bytes#2 // rom_flash::@22 - // [1429] rom_flash::equal_bytes#0 = rom_compare::return#3 + // [1619] rom_flash::equal_bytes#0 = rom_compare::return#3 // if (equal_bytes != ROM_SECTOR) - // [1430] if(rom_flash::equal_bytes#0!=$1000) goto rom_flash::@5 -- vwuz1_neq_vwuc1_then_la1 + // [1620] if(rom_flash::equal_bytes#0!=$1000) goto rom_flash::@5 -- vwuz1_neq_vwuc1_then_la1 lda.z equal_bytes+1 cmp #>$1000 beq !__b3+ @@ -9759,28 +10507,27 @@ rom_flash: { !__b3: // rom_flash::@16 // cputsxy(x_sector, y_sector, "--------") - // [1431] cputsxy::x#3 = rom_flash::x_sector#10 -- vbum1=vbuz2 - lda.z x_sector - sta cputsxy.x - // [1432] cputsxy::y#3 = rom_flash::y_sector#13 -- vbum1=vbuz2 - lda.z y_sector - sta cputsxy.y - // [1433] call cputsxy - // [1966] phi from rom_flash::@16 to cputsxy [phi:rom_flash::@16->cputsxy] - // [1966] phi cputsxy::s#4 = rom_flash::s [phi:rom_flash::@16->cputsxy#0] -- pbuz1=pbuc1 + // [1621] cputsxy::x#3 = rom_flash::x_sector#10 -- vbuyy=vbum1 + ldy x_sector + // [1622] cputsxy::y#3 = rom_flash::y_sector#13 -- vbuxx=vbuz1 + ldx.z y_sector + // [1623] call cputsxy + // [2146] phi from rom_flash::@16 to cputsxy [phi:rom_flash::@16->cputsxy] + // [2146] phi cputsxy::s#4 = rom_flash::s [phi:rom_flash::@16->cputsxy#0] -- pbuz1=pbuc1 lda #s sta.z cputsxy.s+1 - // [1966] phi cputsxy::y#4 = cputsxy::y#3 [phi:rom_flash::@16->cputsxy#1] -- register_copy - // [1966] phi cputsxy::x#4 = cputsxy::x#3 [phi:rom_flash::@16->cputsxy#2] -- register_copy + // [2146] phi cputsxy::y#4 = cputsxy::y#3 [phi:rom_flash::@16->cputsxy#1] -- register_copy + // [2146] phi cputsxy::x#4 = cputsxy::x#3 [phi:rom_flash::@16->cputsxy#2] -- register_copy jsr cputsxy - // [1434] phi from rom_flash::@12 rom_flash::@16 to rom_flash::@4 [phi:rom_flash::@12/rom_flash::@16->rom_flash::@4] - // [1434] phi rom_flash::flash_errors#10 = rom_flash::flash_errors#1 [phi:rom_flash::@12/rom_flash::@16->rom_flash::@4#0] -- register_copy + // [1624] phi from rom_flash::@12 rom_flash::@16 to rom_flash::@4 [phi:rom_flash::@12/rom_flash::@16->rom_flash::@4] + // [1624] phi rom_flash::flash_errors#11 = rom_flash::flash_errors#1 [phi:rom_flash::@12/rom_flash::@16->rom_flash::@4#0] -- register_copy + // [1624] phi rom_flash::flash_bytes#12 = rom_flash::flash_bytes#1 [phi:rom_flash::@12/rom_flash::@16->rom_flash::@4#1] -- register_copy // rom_flash::@4 __b4: // ram_address_sector += ROM_SECTOR - // [1435] rom_flash::ram_address_sector#1 = rom_flash::ram_address_sector#11 + $1000 -- pbuz1=pbuz1_plus_vwuc1 + // [1625] rom_flash::ram_address_sector#1 = rom_flash::ram_address_sector#11 + $1000 -- pbuz1=pbuz1_plus_vwuc1 lda.z ram_address_sector clc adc #<$1000 @@ -9789,7 +10536,7 @@ rom_flash: { adc #>$1000 sta.z ram_address_sector+1 // rom_address_sector += ROM_SECTOR - // [1436] rom_flash::rom_address_sector#1 = rom_flash::rom_address_sector#13 + $1000 -- vdum1=vdum1_plus_vwuc1 + // [1626] rom_flash::rom_address_sector#1 = rom_flash::rom_address_sector#12 + $1000 -- vdum1=vdum1_plus_vwuc1 clc lda rom_address_sector adc #<$1000 @@ -9804,7 +10551,7 @@ rom_flash: { adc #0 sta rom_address_sector+3 // if (ram_address_sector == BRAM_HIGH) - // [1437] if(rom_flash::ram_address_sector#1!=$c000) goto rom_flash::@13 -- pbuz1_neq_vwuc1_then_la1 + // [1627] if(rom_flash::ram_address_sector#1!=$c000) goto rom_flash::@13 -- pbuz1_neq_vwuc1_then_la1 lda.z ram_address_sector+1 cmp #>$c000 bne __b13 @@ -9813,181 +10560,144 @@ rom_flash: { bne __b13 // rom_flash::@17 // bram_bank_sector++; - // [1438] rom_flash::bram_bank_sector#1 = ++ rom_flash::bram_bank_sector#14 -- vbuz1=_inc_vbuz1 + // [1628] rom_flash::bram_bank_sector#1 = ++ rom_flash::bram_bank_sector#14 -- vbuz1=_inc_vbuz1 inc.z bram_bank_sector - // [1439] phi from rom_flash::@17 to rom_flash::@13 [phi:rom_flash::@17->rom_flash::@13] - // [1439] phi rom_flash::bram_bank_sector#40 = rom_flash::bram_bank_sector#1 [phi:rom_flash::@17->rom_flash::@13#0] -- register_copy - // [1439] phi rom_flash::ram_address_sector#8 = (char *)$a000 [phi:rom_flash::@17->rom_flash::@13#1] -- pbuz1=pbuc1 + // [1629] phi from rom_flash::@17 to rom_flash::@13 [phi:rom_flash::@17->rom_flash::@13] + // [1629] phi rom_flash::bram_bank_sector#35 = rom_flash::bram_bank_sector#1 [phi:rom_flash::@17->rom_flash::@13#0] -- register_copy + // [1629] phi rom_flash::ram_address_sector#8 = (char *)$a000 [phi:rom_flash::@17->rom_flash::@13#1] -- pbuz1=pbuc1 lda #<$a000 sta.z ram_address_sector lda #>$a000 sta.z ram_address_sector+1 - // [1439] phi from rom_flash::@4 to rom_flash::@13 [phi:rom_flash::@4->rom_flash::@13] - // [1439] phi rom_flash::bram_bank_sector#40 = rom_flash::bram_bank_sector#14 [phi:rom_flash::@4->rom_flash::@13#0] -- register_copy - // [1439] phi rom_flash::ram_address_sector#8 = rom_flash::ram_address_sector#1 [phi:rom_flash::@4->rom_flash::@13#1] -- register_copy + // [1629] phi from rom_flash::@4 to rom_flash::@13 [phi:rom_flash::@4->rom_flash::@13] + // [1629] phi rom_flash::bram_bank_sector#35 = rom_flash::bram_bank_sector#14 [phi:rom_flash::@4->rom_flash::@13#0] -- register_copy + // [1629] phi rom_flash::ram_address_sector#8 = rom_flash::ram_address_sector#1 [phi:rom_flash::@4->rom_flash::@13#1] -- register_copy // rom_flash::@13 __b13: // if (ram_address_sector == RAM_HIGH) - // [1440] if(rom_flash::ram_address_sector#8!=$9800) goto rom_flash::@36 -- pbuz1_neq_vwuc1_then_la1 + // [1630] if(rom_flash::ram_address_sector#8!=$9800) goto rom_flash::@34 -- pbuz1_neq_vwuc1_then_la1 lda.z ram_address_sector+1 cmp #>$9800 bne __b14 lda.z ram_address_sector cmp #<$9800 bne __b14 - // [1442] phi from rom_flash::@13 to rom_flash::@14 [phi:rom_flash::@13->rom_flash::@14] - // [1442] phi rom_flash::ram_address_sector#15 = (char *)$a000 [phi:rom_flash::@13->rom_flash::@14#0] -- pbuz1=pbuc1 + // [1632] phi from rom_flash::@13 to rom_flash::@14 [phi:rom_flash::@13->rom_flash::@14] + // [1632] phi rom_flash::ram_address_sector#15 = (char *)$a000 [phi:rom_flash::@13->rom_flash::@14#0] -- pbuz1=pbuc1 lda #<$a000 sta.z ram_address_sector lda #>$a000 sta.z ram_address_sector+1 - // [1442] phi rom_flash::bram_bank_sector#12 = 1 [phi:rom_flash::@13->rom_flash::@14#1] -- vbuz1=vbuc1 + // [1632] phi rom_flash::bram_bank_sector#12 = 1 [phi:rom_flash::@13->rom_flash::@14#1] -- vbuz1=vbuc1 lda #1 sta.z bram_bank_sector - // [1441] phi from rom_flash::@13 to rom_flash::@36 [phi:rom_flash::@13->rom_flash::@36] - // rom_flash::@36 - // [1442] phi from rom_flash::@36 to rom_flash::@14 [phi:rom_flash::@36->rom_flash::@14] - // [1442] phi rom_flash::ram_address_sector#15 = rom_flash::ram_address_sector#8 [phi:rom_flash::@36->rom_flash::@14#0] -- register_copy - // [1442] phi rom_flash::bram_bank_sector#12 = rom_flash::bram_bank_sector#40 [phi:rom_flash::@36->rom_flash::@14#1] -- register_copy + // [1631] phi from rom_flash::@13 to rom_flash::@34 [phi:rom_flash::@13->rom_flash::@34] + // rom_flash::@34 + // [1632] phi from rom_flash::@34 to rom_flash::@14 [phi:rom_flash::@34->rom_flash::@14] + // [1632] phi rom_flash::ram_address_sector#15 = rom_flash::ram_address_sector#8 [phi:rom_flash::@34->rom_flash::@14#0] -- register_copy + // [1632] phi rom_flash::bram_bank_sector#12 = rom_flash::bram_bank_sector#35 [phi:rom_flash::@34->rom_flash::@14#1] -- register_copy // rom_flash::@14 __b14: // x_sector += 8 - // [1443] rom_flash::x_sector#1 = rom_flash::x_sector#10 + 8 -- vbuz1=vbuz1_plus_vbuc1 + // [1633] rom_flash::x_sector#1 = rom_flash::x_sector#10 + 8 -- vbum1=vbum1_plus_vbuc1 lda #8 clc - adc.z x_sector - sta.z x_sector + adc x_sector + sta x_sector // rom_address_sector % ROM_PROGRESS_ROW - // [1444] rom_flash::$29 = rom_flash::rom_address_sector#1 & ROM_PROGRESS_ROW-1 -- vduz1=vdum2_band_vduc1 + // [1634] rom_flash::$28 = rom_flash::rom_address_sector#1 & ROM_PROGRESS_ROW-1 -- vdum1=vdum2_band_vduc1 lda rom_address_sector and #ROM_PROGRESS_ROW-1 - sta.z rom_flash__29+1 + sta rom_flash__28+1 lda rom_address_sector+2 and #>$10 - sta.z rom_flash__29+2 + sta rom_flash__28+2 lda rom_address_sector+3 and #>ROM_PROGRESS_ROW-1>>$10 - sta.z rom_flash__29+3 + sta rom_flash__28+3 // if (!(rom_address_sector % ROM_PROGRESS_ROW)) - // [1445] if(0!=rom_flash::$29) goto rom_flash::@15 -- 0_neq_vduz1_then_la1 - lda.z rom_flash__29 - ora.z rom_flash__29+1 - ora.z rom_flash__29+2 - ora.z rom_flash__29+3 + // [1635] if(0!=rom_flash::$28) goto rom_flash::@15 -- 0_neq_vdum1_then_la1 + lda rom_flash__28 + ora rom_flash__28+1 + ora rom_flash__28+2 + ora rom_flash__28+3 bne __b15 // rom_flash::@18 // y_sector++; - // [1446] rom_flash::y_sector#1 = ++ rom_flash::y_sector#13 -- vbuz1=_inc_vbuz1 + // [1636] rom_flash::y_sector#1 = ++ rom_flash::y_sector#13 -- vbuz1=_inc_vbuz1 inc.z y_sector - // [1447] phi from rom_flash::@18 to rom_flash::@15 [phi:rom_flash::@18->rom_flash::@15] - // [1447] phi rom_flash::y_sector#18 = rom_flash::y_sector#1 [phi:rom_flash::@18->rom_flash::@15#0] -- register_copy - // [1447] phi rom_flash::x_sector#20 = PROGRESS_X [phi:rom_flash::@18->rom_flash::@15#1] -- vbuz1=vbuc1 + // [1637] phi from rom_flash::@18 to rom_flash::@15 [phi:rom_flash::@18->rom_flash::@15] + // [1637] phi rom_flash::y_sector#18 = rom_flash::y_sector#1 [phi:rom_flash::@18->rom_flash::@15#0] -- register_copy + // [1637] phi rom_flash::x_sector#20 = PROGRESS_X [phi:rom_flash::@18->rom_flash::@15#1] -- vbum1=vbuc1 lda #PROGRESS_X - sta.z x_sector - // [1447] phi from rom_flash::@14 to rom_flash::@15 [phi:rom_flash::@14->rom_flash::@15] - // [1447] phi rom_flash::y_sector#18 = rom_flash::y_sector#13 [phi:rom_flash::@14->rom_flash::@15#0] -- register_copy - // [1447] phi rom_flash::x_sector#20 = rom_flash::x_sector#1 [phi:rom_flash::@14->rom_flash::@15#1] -- register_copy + sta x_sector + // [1637] phi from rom_flash::@14 to rom_flash::@15 [phi:rom_flash::@14->rom_flash::@15] + // [1637] phi rom_flash::y_sector#18 = rom_flash::y_sector#13 [phi:rom_flash::@14->rom_flash::@15#0] -- register_copy + // [1637] phi rom_flash::x_sector#20 = rom_flash::x_sector#1 [phi:rom_flash::@14->rom_flash::@15#1] -- register_copy // rom_flash::@15 __b15: - // sprintf(info_text, "%u flash errors ...", flash_errors) - // [1448] call snprintf_init - // [1113] phi from rom_flash::@15 to snprintf_init [phi:rom_flash::@15->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:rom_flash::@15->snprintf_init#0] -- pbuz1=pbuc1 - lda #<@info_text - sta.z snprintf_init.s - lda #>@info_text - sta.z snprintf_init.s+1 - jsr snprintf_init + // get_info_text_flashing(flash_bytes) + // [1638] get_info_text_flashing::flash_bytes#1 = rom_flash::flash_bytes#12 -- vduz1=vdum2 + lda flash_bytes + sta.z get_info_text_flashing.flash_bytes + lda flash_bytes+1 + sta.z get_info_text_flashing.flash_bytes+1 + lda flash_bytes+2 + sta.z get_info_text_flashing.flash_bytes+2 + lda flash_bytes+3 + sta.z get_info_text_flashing.flash_bytes+3 + // [1639] call get_info_text_flashing + // [2841] phi from rom_flash::@15 to get_info_text_flashing [phi:rom_flash::@15->get_info_text_flashing] + // [2841] phi get_info_text_flashing::flash_bytes#3 = get_info_text_flashing::flash_bytes#1 [phi:rom_flash::@15->get_info_text_flashing#0] -- register_copy + jsr get_info_text_flashing // rom_flash::@32 - // sprintf(info_text, "%u flash errors ...", flash_errors) - // [1449] printf_ulong::uvalue#7 = rom_flash::flash_errors#10 -- vdum1=vduz2 - lda.z flash_errors - sta printf_ulong.uvalue - lda.z flash_errors+1 - sta printf_ulong.uvalue+1 - lda.z flash_errors+2 - sta printf_ulong.uvalue+2 - lda.z flash_errors+3 - sta printf_ulong.uvalue+3 - // [1450] call printf_ulong - // [1396] phi from rom_flash::@32 to printf_ulong [phi:rom_flash::@32->printf_ulong] - // [1396] phi printf_ulong::format_zero_padding#10 = 0 [phi:rom_flash::@32->printf_ulong#0] -- vbum1=vbuc1 - lda #0 - sta printf_ulong.format_zero_padding - // [1396] phi printf_ulong::format_min_length#10 = 0 [phi:rom_flash::@32->printf_ulong#1] -- vbum1=vbuc1 - sta printf_ulong.format_min_length - // [1396] phi printf_ulong::format_radix#10 = DECIMAL [phi:rom_flash::@32->printf_ulong#2] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_ulong.format_radix - // [1396] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#7 [phi:rom_flash::@32->printf_ulong#3] -- register_copy - jsr printf_ulong - // [1451] phi from rom_flash::@32 to rom_flash::@33 [phi:rom_flash::@32->rom_flash::@33] - // rom_flash::@33 - // sprintf(info_text, "%u flash errors ...", flash_errors) - // [1452] call printf_str - // [1054] phi from rom_flash::@33 to printf_str [phi:rom_flash::@33->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:rom_flash::@33->printf_str#0] -- pprz1=pprc1 - lda #snputc - sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = rom_flash::s2 [phi:rom_flash::@33->printf_str#1] -- pbuz1=pbuc1 - lda #s2 - sta.z printf_str.s+1 - jsr printf_str - // rom_flash::@34 - // sprintf(info_text, "%u flash errors ...", flash_errors) - // [1453] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 - lda #0 - pha - // [1454] callexecute snputc -- call_vprc1 - jsr snputc - // sideeffect stackpullpadding(1) -- _stackpullpadding_1 - pla - // display_info_rom(rom_chip, STATUS_FLASHING, info_text) - // [1456] display_info_rom::rom_chip#4 = rom_flash::rom_chip#0 -- vbum1=vbum2 + // display_info_rom(rom_chip, STATUS_FLASHING, get_info_text_flashing(flash_bytes)) + // [1640] display_info_rom::rom_chip#3 = rom_flash::rom_chip#0 -- vbum1=vbum2 lda rom_chip sta display_info_rom.rom_chip - // [1457] call display_info_rom - // [1176] phi from rom_flash::@34 to display_info_rom [phi:rom_flash::@34->display_info_rom] - // [1176] phi display_info_rom::info_text#16 = info_text [phi:rom_flash::@34->display_info_rom#0] -- pbuz1=pbuc1 - lda #<@info_text + // [1641] call display_info_rom + // [1368] phi from rom_flash::@32 to display_info_rom [phi:rom_flash::@32->display_info_rom] + // [1368] phi display_info_rom::info_text#16 = info_text [phi:rom_flash::@32->display_info_rom#0] -- pbuz1=pbuc1 + lda #@info_text + lda #>info_text sta.z display_info_rom.info_text+1 - // [1176] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#4 [phi:rom_flash::@34->display_info_rom#1] -- register_copy - // [1176] phi display_info_rom::info_status#16 = STATUS_FLASHING [phi:rom_flash::@34->display_info_rom#2] -- vbuz1=vbuc1 + // [1368] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#3 [phi:rom_flash::@32->display_info_rom#1] -- register_copy + // [1368] phi display_info_rom::info_status#16 = STATUS_FLASHING [phi:rom_flash::@32->display_info_rom#2] -- vbum1=vbuc1 lda #STATUS_FLASHING - sta.z display_info_rom.info_status + sta display_info_rom.info_status jsr display_info_rom - // [1417] phi from rom_flash::@34 to rom_flash::@1 [phi:rom_flash::@34->rom_flash::@1] - // [1417] phi rom_flash::flash_errors#12 = rom_flash::flash_errors#10 [phi:rom_flash::@34->rom_flash::@1#0] -- register_copy - // [1417] phi rom_flash::y_sector#13 = rom_flash::y_sector#18 [phi:rom_flash::@34->rom_flash::@1#1] -- register_copy - // [1417] phi rom_flash::x_sector#10 = rom_flash::x_sector#20 [phi:rom_flash::@34->rom_flash::@1#2] -- register_copy - // [1417] phi rom_flash::ram_address_sector#11 = rom_flash::ram_address_sector#15 [phi:rom_flash::@34->rom_flash::@1#3] -- register_copy - // [1417] phi rom_flash::bram_bank_sector#14 = rom_flash::bram_bank_sector#12 [phi:rom_flash::@34->rom_flash::@1#4] -- register_copy - // [1417] phi rom_flash::rom_address_sector#13 = rom_flash::rom_address_sector#1 [phi:rom_flash::@34->rom_flash::@1#5] -- register_copy + // [1607] phi from rom_flash::@32 to rom_flash::@1 [phi:rom_flash::@32->rom_flash::@1] + // [1607] phi rom_flash::flash_bytes#14 = rom_flash::flash_bytes#12 [phi:rom_flash::@32->rom_flash::@1#0] -- register_copy + // [1607] phi rom_flash::flash_errors#2 = rom_flash::flash_errors#11 [phi:rom_flash::@32->rom_flash::@1#1] -- register_copy + // [1607] phi rom_flash::y_sector#13 = rom_flash::y_sector#18 [phi:rom_flash::@32->rom_flash::@1#2] -- register_copy + // [1607] phi rom_flash::x_sector#10 = rom_flash::x_sector#20 [phi:rom_flash::@32->rom_flash::@1#3] -- register_copy + // [1607] phi rom_flash::ram_address_sector#11 = rom_flash::ram_address_sector#15 [phi:rom_flash::@32->rom_flash::@1#4] -- register_copy + // [1607] phi rom_flash::bram_bank_sector#14 = rom_flash::bram_bank_sector#12 [phi:rom_flash::@32->rom_flash::@1#5] -- register_copy + // [1607] phi rom_flash::rom_address_sector#12 = rom_flash::rom_address_sector#1 [phi:rom_flash::@32->rom_flash::@1#6] -- register_copy jmp __b1 - // [1458] phi from rom_flash::@22 to rom_flash::@5 [phi:rom_flash::@22->rom_flash::@5] + // [1642] phi from rom_flash::@22 to rom_flash::@5 [phi:rom_flash::@22->rom_flash::@5] __b3: - // [1458] phi rom_flash::flash_errors_sector#10 = 0 [phi:rom_flash::@22->rom_flash::@5#0] -- vwuz1=vwuc1 + // [1642] phi rom_flash::flash_bytes_sector#10 = 0 [phi:rom_flash::@22->rom_flash::@5#0] -- vwuz1=vwuc1 lda #<0 + sta.z flash_bytes_sector + sta.z flash_bytes_sector+1 + // [1642] phi rom_flash::flash_errors_sector#10 = 0 [phi:rom_flash::@22->rom_flash::@5#1] -- vwuz1=vwuc1 sta.z flash_errors_sector sta.z flash_errors_sector+1 - // [1458] phi rom_flash::retries#12 = 0 [phi:rom_flash::@22->rom_flash::@5#1] -- vbuz1=vbuc1 + // [1642] phi rom_flash::retries#12 = 0 [phi:rom_flash::@22->rom_flash::@5#2] -- vbuz1=vbuc1 sta.z retries - // [1458] phi from rom_flash::@35 to rom_flash::@5 [phi:rom_flash::@35->rom_flash::@5] - // [1458] phi rom_flash::flash_errors_sector#10 = rom_flash::flash_errors_sector#11 [phi:rom_flash::@35->rom_flash::@5#0] -- register_copy - // [1458] phi rom_flash::retries#12 = rom_flash::retries#1 [phi:rom_flash::@35->rom_flash::@5#1] -- register_copy + // [1642] phi from rom_flash::@33 to rom_flash::@5 [phi:rom_flash::@33->rom_flash::@5] + // [1642] phi rom_flash::flash_bytes_sector#10 = rom_flash::flash_bytes_sector#11 [phi:rom_flash::@33->rom_flash::@5#0] -- register_copy + // [1642] phi rom_flash::flash_errors_sector#10 = rom_flash::flash_errors_sector#11 [phi:rom_flash::@33->rom_flash::@5#1] -- register_copy + // [1642] phi rom_flash::retries#12 = rom_flash::retries#1 [phi:rom_flash::@33->rom_flash::@5#2] -- register_copy // rom_flash::@5 __b5: // rom_sector_erase(rom_address_sector) - // [1459] rom_sector_erase::address#0 = rom_flash::rom_address_sector#13 -- vduz1=vdum2 + // [1643] rom_sector_erase::address#0 = rom_flash::rom_address_sector#12 -- vduz1=vdum2 lda rom_address_sector sta.z rom_sector_erase.address lda rom_address_sector+1 @@ -9996,12 +10706,12 @@ rom_flash: { sta.z rom_sector_erase.address+2 lda rom_address_sector+3 sta.z rom_sector_erase.address+3 - // [1460] call rom_sector_erase - // [2441] phi from rom_flash::@5 to rom_sector_erase [phi:rom_flash::@5->rom_sector_erase] + // [1644] call rom_sector_erase + // [2851] phi from rom_flash::@5 to rom_sector_erase [phi:rom_flash::@5->rom_sector_erase] jsr rom_sector_erase // rom_flash::@24 // unsigned long rom_sector_boundary = rom_address_sector + ROM_SECTOR - // [1461] rom_flash::rom_sector_boundary#0 = rom_flash::rom_address_sector#13 + $1000 -- vdum1=vdum2_plus_vwuc1 + // [1645] rom_flash::rom_sector_boundary#0 = rom_flash::rom_address_sector#12 + $1000 -- vdum1=vdum2_plus_vwuc1 clc lda rom_address_sector adc #<$1000 @@ -10016,35 +10726,34 @@ rom_flash: { adc #0 sta rom_sector_boundary+3 // gotoxy(x, y) - // [1462] gotoxy::x#31 = rom_flash::x_sector#10 -- vbum1=vbuz2 - lda.z x_sector - sta gotoxy.x - // [1463] gotoxy::y#31 = rom_flash::y_sector#13 -- vbum1=vbuz2 + // [1646] gotoxy::x#31 = rom_flash::x_sector#10 -- vbuyy=vbum1 + ldy x_sector + // [1647] gotoxy::y#31 = rom_flash::y_sector#13 -- vbum1=vbuz2 lda.z y_sector sta gotoxy.y - // [1464] call gotoxy - // [778] phi from rom_flash::@24 to gotoxy [phi:rom_flash::@24->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#31 [phi:rom_flash::@24->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = gotoxy::x#31 [phi:rom_flash::@24->gotoxy#1] -- register_copy + // [1648] call gotoxy + // [805] phi from rom_flash::@24 to gotoxy [phi:rom_flash::@24->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#31 [phi:rom_flash::@24->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = gotoxy::x#31 [phi:rom_flash::@24->gotoxy#1] -- register_copy jsr gotoxy - // [1465] phi from rom_flash::@24 to rom_flash::@25 [phi:rom_flash::@24->rom_flash::@25] + // [1649] phi from rom_flash::@24 to rom_flash::@25 [phi:rom_flash::@24->rom_flash::@25] // rom_flash::@25 // printf("........") - // [1466] call printf_str - // [1054] phi from rom_flash::@25 to printf_str [phi:rom_flash::@25->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:rom_flash::@25->printf_str#0] -- pprz1=pprc1 + // [1650] call printf_str + // [1125] phi from rom_flash::@25 to printf_str [phi:rom_flash::@25->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:rom_flash::@25->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = rom_flash::s1 [phi:rom_flash::@25->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = rom_flash::s1 [phi:rom_flash::@25->printf_str#1] -- pbuz1=pbuc1 lda #s1 sta.z printf_str.s+1 jsr printf_str // rom_flash::@26 - // [1467] rom_flash::rom_address#16 = rom_flash::rom_address_sector#13 -- vduz1=vdum2 + // [1651] rom_flash::rom_address#16 = rom_flash::rom_address_sector#12 -- vduz1=vdum2 lda rom_address_sector sta.z rom_address lda rom_address_sector+1 @@ -10053,23 +10762,24 @@ rom_flash: { sta.z rom_address+2 lda rom_address_sector+3 sta.z rom_address+3 - // [1468] rom_flash::ram_address#16 = rom_flash::ram_address_sector#11 -- pbuz1=pbuz2 + // [1652] rom_flash::ram_address#16 = rom_flash::ram_address_sector#11 -- pbuz1=pbuz2 lda.z ram_address_sector sta.z ram_address lda.z ram_address_sector+1 sta.z ram_address+1 - // [1469] rom_flash::x#16 = rom_flash::x_sector#10 -- vbuz1=vbuz2 - lda.z x_sector + // [1653] rom_flash::x#16 = rom_flash::x_sector#10 -- vbuz1=vbum2 + lda x_sector sta.z x - // [1470] phi from rom_flash::@10 rom_flash::@26 to rom_flash::@6 [phi:rom_flash::@10/rom_flash::@26->rom_flash::@6] - // [1470] phi rom_flash::x#10 = rom_flash::x#1 [phi:rom_flash::@10/rom_flash::@26->rom_flash::@6#0] -- register_copy - // [1470] phi rom_flash::ram_address#10 = rom_flash::ram_address#1 [phi:rom_flash::@10/rom_flash::@26->rom_flash::@6#1] -- register_copy - // [1470] phi rom_flash::flash_errors_sector#11 = rom_flash::flash_errors_sector#7 [phi:rom_flash::@10/rom_flash::@26->rom_flash::@6#2] -- register_copy - // [1470] phi rom_flash::rom_address#11 = rom_flash::rom_address#1 [phi:rom_flash::@10/rom_flash::@26->rom_flash::@6#3] -- register_copy + // [1654] phi from rom_flash::@10 rom_flash::@26 to rom_flash::@6 [phi:rom_flash::@10/rom_flash::@26->rom_flash::@6] + // [1654] phi rom_flash::x#10 = rom_flash::x#1 [phi:rom_flash::@10/rom_flash::@26->rom_flash::@6#0] -- register_copy + // [1654] phi rom_flash::flash_bytes_sector#11 = rom_flash::flash_bytes_sector#1 [phi:rom_flash::@10/rom_flash::@26->rom_flash::@6#1] -- register_copy + // [1654] phi rom_flash::ram_address#10 = rom_flash::ram_address#1 [phi:rom_flash::@10/rom_flash::@26->rom_flash::@6#2] -- register_copy + // [1654] phi rom_flash::flash_errors_sector#11 = rom_flash::flash_errors_sector#7 [phi:rom_flash::@10/rom_flash::@26->rom_flash::@6#3] -- register_copy + // [1654] phi rom_flash::rom_address#11 = rom_flash::rom_address#1 [phi:rom_flash::@10/rom_flash::@26->rom_flash::@6#4] -- register_copy // rom_flash::@6 __b6: // while (rom_address < rom_sector_boundary) - // [1471] if(rom_flash::rom_address#11display_action_text_flashing] - // [2453] phi display_action_text_flashing::address#10 = display_action_text_flashing::address#1 [phi:rom_flash::@7->display_action_text_flashing#0] -- register_copy - // [2453] phi display_action_text_flashing::chip#10 = chip [phi:rom_flash::@7->display_action_text_flashing#1] -- pbuz1=pbuc1 + // [1664] call display_action_text_flashing + // [2863] phi from rom_flash::@7 to display_action_text_flashing [phi:rom_flash::@7->display_action_text_flashing] + // [2863] phi display_action_text_flashing::address#10 = display_action_text_flashing::address#1 [phi:rom_flash::@7->display_action_text_flashing#0] -- register_copy + // [2863] phi display_action_text_flashing::chip#10 = chip [phi:rom_flash::@7->display_action_text_flashing#1] -- pbuz1=pbuc1 lda #chip sta.z display_action_text_flashing.chip+1 - // [2453] phi display_action_text_flashing::bram_ptr#2 = display_action_text_flashing::bram_ptr#1 [phi:rom_flash::@7->display_action_text_flashing#2] -- register_copy - // [2453] phi display_action_text_flashing::bram_bank#2 = display_action_text_flashing::bram_bank#1 [phi:rom_flash::@7->display_action_text_flashing#3] -- register_copy - // [2453] phi display_action_text_flashing::bytes#2 = $1000 [phi:rom_flash::@7->display_action_text_flashing#4] -- vduz1=vduc1 + // [2863] phi display_action_text_flashing::bram_ptr#3 = display_action_text_flashing::bram_ptr#1 [phi:rom_flash::@7->display_action_text_flashing#2] -- register_copy + // [2863] phi display_action_text_flashing::bram_bank#3 = display_action_text_flashing::bram_bank#1 [phi:rom_flash::@7->display_action_text_flashing#3] -- register_copy + // [2863] phi display_action_text_flashing::bytes#3 = $1000 [phi:rom_flash::@7->display_action_text_flashing#4] -- vduz1=vduc1 lda #<$1000 sta.z display_action_text_flashing.bytes lda #>$1000 @@ -10162,15 +10887,14 @@ rom_flash: { jsr display_action_text_flashing // rom_flash::@27 // unsigned long written_bytes = rom_write(bram_bank, (bram_ptr_t)ram_address, rom_address, ROM_PROGRESS_CELL) - // [1480] rom_write::flash_ram_bank#0 = rom_flash::bram_bank_sector#14 -- vbuz1=vbuz2 - lda.z bram_bank_sector - sta.z rom_write.flash_ram_bank - // [1481] rom_write::flash_ram_address#1 = rom_flash::ram_address#10 -- pbuz1=pbuz2 + // [1665] rom_write::flash_ram_bank#0 = rom_flash::bram_bank_sector#14 -- vbuxx=vbuz1 + ldx.z bram_bank_sector + // [1666] rom_write::flash_ram_address#1 = rom_flash::ram_address#10 -- pbuz1=pbuz2 lda.z ram_address sta.z rom_write.flash_ram_address lda.z ram_address+1 sta.z rom_write.flash_ram_address+1 - // [1482] rom_write::flash_rom_address#1 = rom_flash::rom_address#11 -- vduz1=vduz2 + // [1667] rom_write::flash_rom_address#1 = rom_flash::rom_address#11 -- vduz1=vduz2 lda.z rom_address sta.z rom_write.flash_rom_address lda.z rom_address+1 @@ -10179,17 +10903,18 @@ rom_flash: { sta.z rom_write.flash_rom_address+2 lda.z rom_address+3 sta.z rom_write.flash_rom_address+3 - // [1483] call rom_write + // [1668] call rom_write jsr rom_write // rom_flash::@28 // rom_compare(bram_bank, (bram_ptr_t)ram_address, rom_address, ROM_PROGRESS_CELL) - // [1484] rom_compare::bank_ram#2 = rom_flash::bram_bank_sector#14 - // [1485] rom_compare::ptr_ram#3 = rom_flash::ram_address#10 -- pbuz1=pbuz2 + // [1669] rom_compare::bank_ram#2 = rom_flash::bram_bank_sector#14 -- vbuxx=vbuz1 + ldx.z bram_bank_sector + // [1670] rom_compare::ptr_ram#3 = rom_flash::ram_address#10 -- pbuz1=pbuz2 lda.z ram_address sta.z rom_compare.ptr_ram lda.z ram_address+1 sta.z rom_compare.ptr_ram+1 - // [1486] rom_compare::rom_compare_address#2 = rom_flash::rom_address#11 -- vduz1=vduz2 + // [1671] rom_compare::rom_compare_address#2 = rom_flash::rom_address#11 -- vduz1=vduz2 lda.z rom_address sta.z rom_compare.rom_compare_address lda.z rom_address+1 @@ -10198,43 +10923,40 @@ rom_flash: { sta.z rom_compare.rom_compare_address+2 lda.z rom_address+3 sta.z rom_compare.rom_compare_address+3 - // [1487] call rom_compare - // [2368] phi from rom_flash::@28 to rom_compare [phi:rom_flash::@28->rom_compare] - // [2368] phi rom_compare::ptr_ram#10 = rom_compare::ptr_ram#3 [phi:rom_flash::@28->rom_compare#0] -- register_copy - // [2368] phi rom_compare::rom_compare_size#11 = ROM_PROGRESS_CELL [phi:rom_flash::@28->rom_compare#1] -- vwuz1=vwuc1 + // [1672] call rom_compare + // [2768] phi from rom_flash::@28 to rom_compare [phi:rom_flash::@28->rom_compare] + // [2768] phi rom_compare::ptr_ram#10 = rom_compare::ptr_ram#3 [phi:rom_flash::@28->rom_compare#0] -- register_copy + // [2768] phi rom_compare::rom_compare_size#11 = ROM_PROGRESS_CELL [phi:rom_flash::@28->rom_compare#1] -- vwuz1=vwuc1 lda #ROM_PROGRESS_CELL sta.z rom_compare.rom_compare_size+1 - // [2368] phi rom_compare::rom_compare_address#3 = rom_compare::rom_compare_address#2 [phi:rom_flash::@28->rom_compare#2] -- register_copy - // [2368] phi rom_compare::bank_set_bram1_bank#0 = rom_compare::bank_ram#2 [phi:rom_flash::@28->rom_compare#3] -- vbum1=vbuz2 - lda.z rom_compare.bank_ram_1 - sta rom_compare.bank_set_bram1_bank + // [2768] phi rom_compare::rom_compare_address#3 = rom_compare::rom_compare_address#2 [phi:rom_flash::@28->rom_compare#2] -- register_copy + // [2768] phi rom_compare::bank_set_bram1_bank#0 = rom_compare::bank_ram#2 [phi:rom_flash::@28->rom_compare#3] -- register_copy jsr rom_compare // rom_compare(bram_bank, (bram_ptr_t)ram_address, rom_address, ROM_PROGRESS_CELL) - // [1488] rom_compare::return#4 = rom_compare::equal_bytes#2 + // [1673] rom_compare::return#4 = rom_compare::equal_bytes#2 // rom_flash::@29 // equal_bytes = rom_compare(bram_bank, (bram_ptr_t)ram_address, rom_address, ROM_PROGRESS_CELL) - // [1489] rom_flash::equal_bytes#1 = rom_compare::return#4 -- vwuz1=vwuz2 + // [1674] rom_flash::equal_bytes#1 = rom_compare::return#4 -- vwuz1=vwuz2 lda.z rom_compare.return sta.z equal_bytes_1 lda.z rom_compare.return+1 sta.z equal_bytes_1+1 // gotoxy(x, y) - // [1490] gotoxy::x#32 = rom_flash::x#10 -- vbum1=vbuz2 - lda.z x - sta gotoxy.x - // [1491] gotoxy::y#32 = rom_flash::y_sector#13 -- vbum1=vbuz2 + // [1675] gotoxy::x#32 = rom_flash::x#10 -- vbuyy=vbuz1 + ldy.z x + // [1676] gotoxy::y#32 = rom_flash::y_sector#13 -- vbum1=vbuz2 lda.z y_sector sta gotoxy.y - // [1492] call gotoxy - // [778] phi from rom_flash::@29 to gotoxy [phi:rom_flash::@29->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#32 [phi:rom_flash::@29->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = gotoxy::x#32 [phi:rom_flash::@29->gotoxy#1] -- register_copy + // [1677] call gotoxy + // [805] phi from rom_flash::@29 to gotoxy [phi:rom_flash::@29->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#32 [phi:rom_flash::@29->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = gotoxy::x#32 [phi:rom_flash::@29->gotoxy#1] -- register_copy jsr gotoxy // rom_flash::@30 // if (equal_bytes != ROM_PROGRESS_CELL) - // [1493] if(rom_flash::equal_bytes#1!=ROM_PROGRESS_CELL) goto rom_flash::@9 -- vwuz1_neq_vwuc1_then_la1 + // [1678] if(rom_flash::equal_bytes#1!=ROM_PROGRESS_CELL) goto rom_flash::@9 -- vwuz1_neq_vwuc1_then_la1 lda.z equal_bytes_1+1 cmp #>ROM_PROGRESS_CELL bne __b9 @@ -10243,26 +10965,23 @@ rom_flash: { bne __b9 // rom_flash::@11 // cputcxy(x,y,'+') - // [1494] cputcxy::x#14 = rom_flash::x#10 -- vbum1=vbuz2 - lda.z x - sta cputcxy.x - // [1495] cputcxy::y#14 = rom_flash::y_sector#13 -- vbum1=vbuz2 + // [1679] cputcxy::x#14 = rom_flash::x#10 -- vbuyy=vbuz1 + ldy.z x + // [1680] cputcxy::y#14 = rom_flash::y_sector#13 -- vbuaa=vbuz1 lda.z y_sector - sta cputcxy.y - // [1496] call cputcxy - // [2147] phi from rom_flash::@11 to cputcxy [phi:rom_flash::@11->cputcxy] - // [2147] phi cputcxy::c#15 = '+' [phi:rom_flash::@11->cputcxy#0] -- vbum1=vbuc1 - lda #'+' - sta cputcxy.c - // [2147] phi cputcxy::y#15 = cputcxy::y#14 [phi:rom_flash::@11->cputcxy#1] -- register_copy - // [2147] phi cputcxy::x#15 = cputcxy::x#14 [phi:rom_flash::@11->cputcxy#2] -- register_copy + // [1681] call cputcxy + // [2273] phi from rom_flash::@11 to cputcxy [phi:rom_flash::@11->cputcxy] + // [2273] phi cputcxy::c#17 = '+' [phi:rom_flash::@11->cputcxy#0] -- vbuxx=vbuc1 + ldx #'+' + // [2273] phi cputcxy::y#17 = cputcxy::y#14 [phi:rom_flash::@11->cputcxy#1] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#14 [phi:rom_flash::@11->cputcxy#2] -- register_copy jsr cputcxy - // [1497] phi from rom_flash::@11 rom_flash::@31 to rom_flash::@10 [phi:rom_flash::@11/rom_flash::@31->rom_flash::@10] - // [1497] phi rom_flash::flash_errors_sector#7 = rom_flash::flash_errors_sector#11 [phi:rom_flash::@11/rom_flash::@31->rom_flash::@10#0] -- register_copy + // [1682] phi from rom_flash::@11 rom_flash::@31 to rom_flash::@10 [phi:rom_flash::@11/rom_flash::@31->rom_flash::@10] + // [1682] phi rom_flash::flash_errors_sector#7 = rom_flash::flash_errors_sector#11 [phi:rom_flash::@11/rom_flash::@31->rom_flash::@10#0] -- register_copy // rom_flash::@10 __b10: // ram_address += ROM_PROGRESS_CELL - // [1498] rom_flash::ram_address#1 = rom_flash::ram_address#10 + ROM_PROGRESS_CELL -- pbuz1=pbuz1_plus_vwuc1 + // [1683] rom_flash::ram_address#1 = rom_flash::ram_address#10 + ROM_PROGRESS_CELL -- pbuz1=pbuz1_plus_vwuc1 lda.z ram_address clc adc #ROM_PROGRESS_CELL sta.z ram_address+1 // rom_address += ROM_PROGRESS_CELL - // [1499] rom_flash::rom_address#1 = rom_flash::rom_address#11 + ROM_PROGRESS_CELL -- vduz1=vduz1_plus_vwuc1 + // [1684] rom_flash::rom_address#1 = rom_flash::rom_address#11 + ROM_PROGRESS_CELL -- vduz1=vduz1_plus_vwuc1 clc lda.z rom_address adc #ROM_PROGRESS_CELL + sta.z flash_bytes_sector+1 // x++; - // [1500] rom_flash::x#1 = ++ rom_flash::x#10 -- vbuz1=_inc_vbuz1 + // [1686] rom_flash::x#1 = ++ rom_flash::x#10 -- vbuz1=_inc_vbuz1 inc.z x jmp __b6 // rom_flash::@9 __b9: // cputcxy(x,y,'!') - // [1501] cputcxy::x#13 = rom_flash::x#10 -- vbum1=vbuz2 - lda.z x - sta cputcxy.x - // [1502] cputcxy::y#13 = rom_flash::y_sector#13 -- vbum1=vbuz2 + // [1687] cputcxy::x#13 = rom_flash::x#10 -- vbuyy=vbuz1 + ldy.z x + // [1688] cputcxy::y#13 = rom_flash::y_sector#13 -- vbuaa=vbuz1 lda.z y_sector - sta cputcxy.y - // [1503] call cputcxy - // [2147] phi from rom_flash::@9 to cputcxy [phi:rom_flash::@9->cputcxy] - // [2147] phi cputcxy::c#15 = '!' [phi:rom_flash::@9->cputcxy#0] -- vbum1=vbuc1 - lda #'!' - sta cputcxy.c - // [2147] phi cputcxy::y#15 = cputcxy::y#13 [phi:rom_flash::@9->cputcxy#1] -- register_copy - // [2147] phi cputcxy::x#15 = cputcxy::x#13 [phi:rom_flash::@9->cputcxy#2] -- register_copy + // [1689] call cputcxy + // [2273] phi from rom_flash::@9 to cputcxy [phi:rom_flash::@9->cputcxy] + // [2273] phi cputcxy::c#17 = '!' [phi:rom_flash::@9->cputcxy#0] -- vbuxx=vbuc1 + ldx #'!' + // [2273] phi cputcxy::y#17 = cputcxy::y#13 [phi:rom_flash::@9->cputcxy#1] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#13 [phi:rom_flash::@9->cputcxy#2] -- register_copy jsr cputcxy // rom_flash::@31 // flash_errors_sector++; - // [1504] rom_flash::flash_errors_sector#1 = ++ rom_flash::flash_errors_sector#11 -- vwuz1=_inc_vwuz1 + // [1690] rom_flash::flash_errors_sector#1 = ++ rom_flash::flash_errors_sector#11 -- vwuz1=_inc_vwuz1 inc.z flash_errors_sector bne !+ inc.z flash_errors_sector+1 !: jmp __b10 .segment Data - info_text: .text "Flashing ... (-) equal, (+) flashed, (!) error." - .byte 0 - info_text1: .text "Flashing ..." - .byte 0 s: .text "--------" .byte 0 s1: .text "........" .byte 0 - s2: .text " flash errors ..." - .byte 0 + rom_flash__28: .dword 0 .label rom_address_sector = main.rom_file_modulo rom_boundary: .dword 0 rom_sector_boundary: .dword 0 - .label rom_chip = util_wait_key.return_4 - .label rom_bank_start = main.check_status_smc7_main__0 - .label file_size = main.rom_flash_errors + .label flash_bytes = w25q16_verify.w25q16_verify__7 + .label x_sector = main.check_status_smc9_return + rom_chip: .byte 0 + rom_bank_start: .byte 0 } .segment Code // smc_read @@ -10340,31 +11061,34 @@ rom_flash: { * * @return unsigned int The amount of bytes read from SMC.BIN to be flashed. */ -// __zp($2d) unsigned int smc_read(__zp($29) char info_status) +// __zp($51) unsigned int smc_read(__mem() char info_status) smc_read: { .const smc_bram_bank = 1 - .label return = $2d - .label smc_bram_ptr = $6b - .label smc_file_size = $2d - .label info_status = $29 - .label smc_action_text = $6d + .label fp = $73 + .label return = $51 + .label smc_bram_ptr = $53 + .label smc_file_size = $51 + /// Holds the amount of bytes actually read in the memory to be flashed. + .label progress_row_bytes = $23 + .label smc_file_read_1 = $30 + .label smc_action_text = $40 // if(info_status == STATUS_READING) - // [1506] if(smc_read::info_status#10==STATUS_READING) goto smc_read::@1 -- vbuz1_eq_vbuc1_then_la1 + // [1692] if(smc_read::info_status#10==STATUS_READING) goto smc_read::@1 -- vbum1_eq_vbuc1_then_la1 lda #STATUS_READING - cmp.z info_status + cmp info_status beq __b1 - // [1508] phi from smc_read to smc_read::@2 [phi:smc_read->smc_read::@2] - // [1508] phi smc_read::smc_action_text#12 = smc_action_text#2 [phi:smc_read->smc_read::@2#0] -- pbuz1=pbuc1 + // [1694] phi from smc_read to smc_read::@2 [phi:smc_read->smc_read::@2] + // [1694] phi smc_read::smc_action_text#12 = smc_action_text#2 [phi:smc_read->smc_read::@2#0] -- pbuz1=pbuc1 lda #smc_action_text_1 sta.z smc_action_text+1 jmp __b2 - // [1507] phi from smc_read to smc_read::@1 [phi:smc_read->smc_read::@1] + // [1693] phi from smc_read to smc_read::@1 [phi:smc_read->smc_read::@1] // smc_read::@1 __b1: - // [1508] phi from smc_read::@1 to smc_read::@2 [phi:smc_read::@1->smc_read::@2] - // [1508] phi smc_read::smc_action_text#12 = smc_action_text#1 [phi:smc_read::@1->smc_read::@2#0] -- pbuz1=pbuc1 + // [1694] phi from smc_read::@1 to smc_read::@2 [phi:smc_read::@1->smc_read::@2] + // [1694] phi smc_read::smc_action_text#12 = smc_action_text#1 [phi:smc_read::@1->smc_read::@2#0] -- pbuz1=pbuc1 lda #smc_action_text @@ -10373,57 +11097,55 @@ smc_read: { __b2: // smc_read::bank_set_bram1 // BRAM = bank - // [1509] BRAM = smc_read::smc_bram_bank -- vbuz1=vbuc1 + // [1695] BRAM = smc_read::smc_bram_bank -- vbuz1=vbuc1 lda #smc_bram_bank sta.z BRAM - // [1510] phi from smc_read::bank_set_bram1 to smc_read::@16 [phi:smc_read::bank_set_bram1->smc_read::@16] + // [1696] phi from smc_read::bank_set_bram1 to smc_read::@16 [phi:smc_read::bank_set_bram1->smc_read::@16] // smc_read::@16 // textcolor(WHITE) - // [1511] call textcolor - // [760] phi from smc_read::@16 to textcolor [phi:smc_read::@16->textcolor] - // [760] phi textcolor::color#23 = WHITE [phi:smc_read::@16->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color + // [1697] call textcolor + // [787] phi from smc_read::@16 to textcolor [phi:smc_read::@16->textcolor] + // [787] phi textcolor::color#23 = WHITE [phi:smc_read::@16->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor - // [1512] phi from smc_read::@16 to smc_read::@17 [phi:smc_read::@16->smc_read::@17] + // [1698] phi from smc_read::@16 to smc_read::@17 [phi:smc_read::@16->smc_read::@17] // smc_read::@17 // gotoxy(x, y) - // [1513] call gotoxy - // [778] phi from smc_read::@17 to gotoxy [phi:smc_read::@17->gotoxy] - // [778] phi gotoxy::y#33 = PROGRESS_Y [phi:smc_read::@17->gotoxy#0] -- vbum1=vbuc1 + // [1699] call gotoxy + // [805] phi from smc_read::@17 to gotoxy [phi:smc_read::@17->gotoxy] + // [805] phi gotoxy::y#37 = PROGRESS_Y [phi:smc_read::@17->gotoxy#0] -- vbum1=vbuc1 lda #PROGRESS_Y sta gotoxy.y - // [778] phi gotoxy::x#33 = PROGRESS_X [phi:smc_read::@17->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x + // [805] phi gotoxy::x#37 = PROGRESS_X [phi:smc_read::@17->gotoxy#1] -- vbuyy=vbuc1 + ldy #PROGRESS_X jsr gotoxy - // [1514] phi from smc_read::@17 to smc_read::@18 [phi:smc_read::@17->smc_read::@18] + // [1700] phi from smc_read::@17 to smc_read::@18 [phi:smc_read::@17->smc_read::@18] // smc_read::@18 // FILE *fp = fopen("SMC.BIN", "r") - // [1515] call fopen - // [2173] phi from smc_read::@18 to fopen [phi:smc_read::@18->fopen] - // [2173] phi __errno#322 = __errno#109 [phi:smc_read::@18->fopen#0] -- register_copy - // [2173] phi fopen::pathtoken#0 = smc_read::path [phi:smc_read::@18->fopen#1] -- pbuz1=pbuc1 + // [1701] call fopen + // [2573] phi from smc_read::@18 to fopen [phi:smc_read::@18->fopen] + // [2573] phi __errno#474 = __errno#100 [phi:smc_read::@18->fopen#0] -- register_copy + // [2573] phi fopen::pathtoken#0 = smc_read::path [phi:smc_read::@18->fopen#1] -- pbuz1=pbuc1 lda #path sta.z fopen.pathtoken+1 - // [2173] phi __stdio_filecount#18 = __stdio_filecount#104 [phi:smc_read::@18->fopen#2] -- register_copy + // [2573] phi __stdio_filecount#27 = __stdio_filecount#123 [phi:smc_read::@18->fopen#2] -- register_copy jsr fopen // FILE *fp = fopen("SMC.BIN", "r") - // [1516] fopen::return#3 = fopen::return#2 + // [1702] fopen::return#3 = fopen::return#2 // smc_read::@19 - // [1517] smc_read::fp#0 = fopen::return#3 -- pssm1=pssz2 + // [1703] smc_read::fp#0 = fopen::return#3 -- pssz1=pssz2 lda.z fopen.return - sta fp + sta.z fp lda.z fopen.return+1 - sta fp+1 + sta.z fp+1 // if (fp) - // [1518] if((struct $2 *)0==smc_read::fp#0) goto smc_read::@3 -- pssc1_eq_pssm1_then_la1 - lda fp + // [1704] if((struct $2 *)0==smc_read::fp#0) goto smc_read::@3 -- pssc1_eq_pssz1_then_la1 + lda.z fp cmp #<0 bne !+ - lda fp+1 + lda.z fp+1 cmp #>0 bne !__b5+ jmp __b5 @@ -10431,59 +11153,59 @@ smc_read: { !: // smc_read::@4 // fgets(smc_file_header, 32, fp) - // [1519] fgets::stream#0 = smc_read::fp#0 -- pssz1=pssm2 - lda fp + // [1705] fgets::stream#0 = smc_read::fp#0 -- pssz1=pssz2 + lda.z fp sta.z fgets.stream - lda fp+1 + lda.z fp+1 sta.z fgets.stream+1 - // [1520] call fgets - // [2314] phi from smc_read::@4 to fgets [phi:smc_read::@4->fgets] - // [2314] phi fgets::ptr#13 = smc_file_header [phi:smc_read::@4->fgets#0] -- pbuz1=pbuc1 + // [1706] call fgets + // [2714] phi from smc_read::@4 to fgets [phi:smc_read::@4->fgets] + // [2714] phi fgets::ptr#14 = smc_file_header [phi:smc_read::@4->fgets#0] -- pbuz1=pbuc1 lda #smc_file_header sta.z fgets.ptr+1 - // [2314] phi fgets::size#11 = $20 [phi:smc_read::@4->fgets#1] -- vwum1=vbuc1 + // [2714] phi fgets::size#10 = $20 [phi:smc_read::@4->fgets#1] -- vwum1=vbuc1 lda #<$20 sta fgets.size lda #>$20 sta fgets.size+1 - // [2314] phi fgets::stream#3 = fgets::stream#0 [phi:smc_read::@4->fgets#2] -- register_copy + // [2714] phi fgets::stream#4 = fgets::stream#0 [phi:smc_read::@4->fgets#2] -- register_copy jsr fgets // fgets(smc_file_header, 32, fp) - // [1521] fgets::return#5 = fgets::return#1 + // [1707] fgets::return#10 = fgets::return#1 // smc_read::@20 // smc_file_read = fgets(smc_file_header, 32, fp) - // [1522] smc_read::smc_file_read#1 = fgets::return#5 -- vwum1=vwum2 + // [1708] smc_read::smc_file_read#1 = fgets::return#10 -- vwum1=vwum2 lda fgets.return sta smc_file_read lda fgets.return+1 sta smc_file_read+1 // if(smc_file_read) - // [1523] if(0==smc_read::smc_file_read#1) goto smc_read::@3 -- 0_eq_vwum1_then_la1 + // [1709] if(0==smc_read::smc_file_read#1) goto smc_read::@3 -- 0_eq_vwum1_then_la1 lda smc_file_read ora smc_file_read+1 beq __b5 // smc_read::@5 // if(info_status == STATUS_CHECKING) - // [1524] if(smc_read::info_status#10!=STATUS_CHECKING) goto smc_read::@7 -- vbuz1_neq_vbuc1_then_la1 + // [1710] if(smc_read::info_status#10!=STATUS_CHECKING) goto smc_read::@7 -- vbum1_neq_vbuc1_then_la1 lda #STATUS_CHECKING - cmp.z info_status + cmp info_status bne __b4 - // [1525] phi from smc_read::@5 to smc_read::@6 [phi:smc_read::@5->smc_read::@6] + // [1711] phi from smc_read::@5 to smc_read::@6 [phi:smc_read::@5->smc_read::@6] // smc_read::@6 - // [1526] phi from smc_read::@6 to smc_read::@7 [phi:smc_read::@6->smc_read::@7] - // [1526] phi smc_read::y#12 = PROGRESS_Y [phi:smc_read::@6->smc_read::@7#0] -- vbum1=vbuc1 + // [1712] phi from smc_read::@6 to smc_read::@7 [phi:smc_read::@6->smc_read::@7] + // [1712] phi smc_read::y#12 = PROGRESS_Y [phi:smc_read::@6->smc_read::@7#0] -- vbum1=vbuc1 lda #PROGRESS_Y sta y - // [1526] phi smc_read::progress_row_bytes#10 = 0 [phi:smc_read::@6->smc_read::@7#1] -- vwum1=vwuc1 + // [1712] phi smc_read::progress_row_bytes#10 = 0 [phi:smc_read::@6->smc_read::@7#1] -- vwuz1=vwuc1 lda #<0 - sta progress_row_bytes - sta progress_row_bytes+1 - // [1526] phi smc_read::smc_file_size#10 = 0 [phi:smc_read::@6->smc_read::@7#2] -- vwuz1=vwuc1 + sta.z progress_row_bytes + sta.z progress_row_bytes+1 + // [1712] phi smc_read::smc_file_size#10 = 0 [phi:smc_read::@6->smc_read::@7#2] -- vwuz1=vwuc1 sta.z smc_file_size sta.z smc_file_size+1 - // [1526] phi smc_read::smc_bram_ptr#10 = (char *) 1024 [phi:smc_read::@6->smc_read::@7#3] -- pbuz1=pbuc1 + // [1712] phi smc_read::smc_bram_ptr#10 = (char *) 1024 [phi:smc_read::@6->smc_read::@7#3] -- pbuz1=pbuc1 lda #<$400 sta.z smc_bram_ptr lda #>$400 @@ -10491,19 +11213,19 @@ smc_read: { jmp __b7 // We read block_size bytes at a time, and each block_size bytes we plot a dot. // Every r bytes we move to the next line. - // [1526] phi from smc_read::@5 to smc_read::@7 [phi:smc_read::@5->smc_read::@7] + // [1712] phi from smc_read::@5 to smc_read::@7 [phi:smc_read::@5->smc_read::@7] __b4: - // [1526] phi smc_read::y#12 = PROGRESS_Y [phi:smc_read::@5->smc_read::@7#0] -- vbum1=vbuc1 + // [1712] phi smc_read::y#12 = PROGRESS_Y [phi:smc_read::@5->smc_read::@7#0] -- vbum1=vbuc1 lda #PROGRESS_Y sta y - // [1526] phi smc_read::progress_row_bytes#10 = 0 [phi:smc_read::@5->smc_read::@7#1] -- vwum1=vwuc1 + // [1712] phi smc_read::progress_row_bytes#10 = 0 [phi:smc_read::@5->smc_read::@7#1] -- vwuz1=vwuc1 lda #<0 - sta progress_row_bytes - sta progress_row_bytes+1 - // [1526] phi smc_read::smc_file_size#10 = 0 [phi:smc_read::@5->smc_read::@7#2] -- vwuz1=vwuc1 + sta.z progress_row_bytes + sta.z progress_row_bytes+1 + // [1712] phi smc_read::smc_file_size#10 = 0 [phi:smc_read::@5->smc_read::@7#2] -- vwuz1=vwuc1 sta.z smc_file_size sta.z smc_file_size+1 - // [1526] phi smc_read::smc_bram_ptr#10 = (char *)$a000 [phi:smc_read::@5->smc_read::@7#3] -- pbuz1=pbuc1 + // [1712] phi smc_read::smc_bram_ptr#10 = (char *)$a000 [phi:smc_read::@5->smc_read::@7#3] -- pbuz1=pbuc1 lda #<$a000 sta.z smc_bram_ptr lda #>$a000 @@ -10511,76 +11233,76 @@ smc_read: { // smc_read::@7 __b7: // fgets(smc_bram_ptr, SMC_PROGRESS_CELL, fp) - // [1527] fgets::ptr#3 = smc_read::smc_bram_ptr#10 -- pbuz1=pbuz2 + // [1713] fgets::ptr#3 = smc_read::smc_bram_ptr#10 -- pbuz1=pbuz2 lda.z smc_bram_ptr sta.z fgets.ptr lda.z smc_bram_ptr+1 sta.z fgets.ptr+1 - // [1528] fgets::stream#1 = smc_read::fp#0 -- pssz1=pssm2 - lda fp + // [1714] fgets::stream#1 = smc_read::fp#0 -- pssz1=pssz2 + lda.z fp sta.z fgets.stream - lda fp+1 + lda.z fp+1 sta.z fgets.stream+1 - // [1529] call fgets - // [2314] phi from smc_read::@7 to fgets [phi:smc_read::@7->fgets] - // [2314] phi fgets::ptr#13 = fgets::ptr#3 [phi:smc_read::@7->fgets#0] -- register_copy - // [2314] phi fgets::size#11 = SMC_PROGRESS_CELL [phi:smc_read::@7->fgets#1] -- vwum1=vbuc1 + // [1715] call fgets + // [2714] phi from smc_read::@7 to fgets [phi:smc_read::@7->fgets] + // [2714] phi fgets::ptr#14 = fgets::ptr#3 [phi:smc_read::@7->fgets#0] -- register_copy + // [2714] phi fgets::size#10 = SMC_PROGRESS_CELL [phi:smc_read::@7->fgets#1] -- vwum1=vbuc1 lda #SMC_PROGRESS_CELL sta fgets.size+1 - // [2314] phi fgets::stream#3 = fgets::stream#1 [phi:smc_read::@7->fgets#2] -- register_copy + // [2714] phi fgets::stream#4 = fgets::stream#1 [phi:smc_read::@7->fgets#2] -- register_copy jsr fgets // fgets(smc_bram_ptr, SMC_PROGRESS_CELL, fp) - // [1530] fgets::return#10 = fgets::return#1 + // [1716] fgets::return#11 = fgets::return#1 // smc_read::@21 // smc_file_read = fgets(smc_bram_ptr, SMC_PROGRESS_CELL, fp) - // [1531] smc_read::smc_file_read#10 = fgets::return#10 -- vwum1=vwum2 + // [1717] smc_read::smc_file_read#10 = fgets::return#11 -- vwuz1=vwum2 lda fgets.return - sta smc_file_read_1 + sta.z smc_file_read_1 lda fgets.return+1 - sta smc_file_read_1+1 + sta.z smc_file_read_1+1 // while (smc_file_read = fgets(smc_bram_ptr, SMC_PROGRESS_CELL, fp)) - // [1532] if(0!=smc_read::smc_file_read#10) goto smc_read::@8 -- 0_neq_vwum1_then_la1 - lda smc_file_read_1 - ora smc_file_read_1+1 + // [1718] if(0!=smc_read::smc_file_read#10) goto smc_read::@8 -- 0_neq_vwuz1_then_la1 + lda.z smc_file_read_1 + ora.z smc_file_read_1+1 bne __b8 // smc_read::@9 // fclose(fp) - // [1533] fclose::stream#0 = smc_read::fp#0 -- pssm1=pssm2 - lda fp - sta fclose.stream - lda fp+1 - sta fclose.stream+1 - // [1534] call fclose - // [2254] phi from smc_read::@9 to fclose [phi:smc_read::@9->fclose] - // [2254] phi fclose::stream#2 = fclose::stream#0 [phi:smc_read::@9->fclose#0] -- register_copy + // [1719] fclose::stream#0 = smc_read::fp#0 -- pssz1=pssz2 + lda.z fp + sta.z fclose.stream + lda.z fp+1 + sta.z fclose.stream+1 + // [1720] call fclose + // [2654] phi from smc_read::@9 to fclose [phi:smc_read::@9->fclose] + // [2654] phi fclose::stream#3 = fclose::stream#0 [phi:smc_read::@9->fclose#0] -- register_copy jsr fclose - // [1535] phi from smc_read::@9 to smc_read::@3 [phi:smc_read::@9->smc_read::@3] - // [1535] phi __stdio_filecount#27 = __stdio_filecount#2 [phi:smc_read::@9->smc_read::@3#0] -- register_copy - // [1535] phi smc_read::return#0 = smc_read::smc_file_size#10 [phi:smc_read::@9->smc_read::@3#1] -- register_copy + // [1721] phi from smc_read::@9 to smc_read::@3 [phi:smc_read::@9->smc_read::@3] + // [1721] phi __stdio_filecount#36 = __stdio_filecount#2 [phi:smc_read::@9->smc_read::@3#0] -- register_copy + // [1721] phi smc_read::return#0 = smc_read::smc_file_size#10 [phi:smc_read::@9->smc_read::@3#1] -- register_copy rts - // [1535] phi from smc_read::@19 smc_read::@20 to smc_read::@3 [phi:smc_read::@19/smc_read::@20->smc_read::@3] + // [1721] phi from smc_read::@19 smc_read::@20 to smc_read::@3 [phi:smc_read::@19/smc_read::@20->smc_read::@3] __b5: - // [1535] phi __stdio_filecount#27 = __stdio_filecount#1 [phi:smc_read::@19/smc_read::@20->smc_read::@3#0] -- register_copy - // [1535] phi smc_read::return#0 = 0 [phi:smc_read::@19/smc_read::@20->smc_read::@3#1] -- vwuz1=vwuc1 + // [1721] phi __stdio_filecount#36 = __stdio_filecount#1 [phi:smc_read::@19/smc_read::@20->smc_read::@3#0] -- register_copy + // [1721] phi smc_read::return#0 = 0 [phi:smc_read::@19/smc_read::@20->smc_read::@3#1] -- vwuz1=vwuc1 lda #<0 sta.z return sta.z return+1 // smc_read::@3 // smc_read::@return // } - // [1536] return + // [1722] return rts // smc_read::@8 __b8: // display_action_text_reading(smc_action_text, "SMC.BIN", smc_file_size, SMC_CHIP_SIZE, smc_bram_bank, smc_bram_ptr) - // [1537] display_action_text_reading::action#0 = smc_read::smc_action_text#12 -- pbuz1=pbuz2 + // [1723] display_action_text_reading::action#0 = smc_read::smc_action_text#12 -- pbuz1=pbuz2 lda.z smc_action_text sta.z display_action_text_reading.action lda.z smc_action_text+1 sta.z display_action_text_reading.action+1 - // [1538] display_action_text_reading::bytes#0 = smc_read::smc_file_size#10 -- vduz1=vwuz2 + // [1724] display_action_text_reading::bytes#0 = smc_read::smc_file_size#10 -- vduz1=vwuz2 lda.z smc_file_size sta.z display_action_text_reading.bytes lda.z smc_file_size+1 @@ -10588,18 +11310,18 @@ smc_read: { lda #0 sta.z display_action_text_reading.bytes+2 sta.z display_action_text_reading.bytes+3 - // [1539] display_action_text_reading::bram_ptr#0 = smc_read::smc_bram_ptr#10 -- pbuz1=pbuz2 + // [1725] display_action_text_reading::bram_ptr#0 = smc_read::smc_bram_ptr#10 -- pbuz1=pbuz2 lda.z smc_bram_ptr sta.z display_action_text_reading.bram_ptr lda.z smc_bram_ptr+1 sta.z display_action_text_reading.bram_ptr+1 - // [1540] call display_action_text_reading - // [2283] phi from smc_read::@8 to display_action_text_reading [phi:smc_read::@8->display_action_text_reading] - // [2283] phi display_action_text_reading::bram_ptr#10 = display_action_text_reading::bram_ptr#0 [phi:smc_read::@8->display_action_text_reading#0] -- register_copy - // [2283] phi display_action_text_reading::bram_bank#10 = smc_read::smc_bram_bank [phi:smc_read::@8->display_action_text_reading#1] -- vbuz1=vbuc1 + // [1726] call display_action_text_reading + // [2683] phi from smc_read::@8 to display_action_text_reading [phi:smc_read::@8->display_action_text_reading] + // [2683] phi display_action_text_reading::bram_ptr#10 = display_action_text_reading::bram_ptr#0 [phi:smc_read::@8->display_action_text_reading#0] -- register_copy + // [2683] phi display_action_text_reading::bram_bank#10 = smc_read::smc_bram_bank [phi:smc_read::@8->display_action_text_reading#1] -- vbuz1=vbuc1 lda #smc_bram_bank sta.z display_action_text_reading.bram_bank - // [2283] phi display_action_text_reading::size#2 = SMC_CHIP_SIZE [phi:smc_read::@8->display_action_text_reading#2] -- vduz1=vduc1 + // [2683] phi display_action_text_reading::size#10 = SMC_CHIP_SIZE [phi:smc_read::@8->display_action_text_reading#2] -- vduz1=vduc1 lda #SMC_CHIP_SIZE @@ -10608,86 +11330,85 @@ smc_read: { sta.z display_action_text_reading.size+2 lda #>SMC_CHIP_SIZE>>$10 sta.z display_action_text_reading.size+3 - // [2283] phi display_action_text_reading::bytes#2 = display_action_text_reading::bytes#0 [phi:smc_read::@8->display_action_text_reading#3] -- register_copy - // [2283] phi display_action_text_reading::file#2 = smc_read::path [phi:smc_read::@8->display_action_text_reading#4] -- pbuz1=pbuc1 + // [2683] phi display_action_text_reading::bytes#3 = display_action_text_reading::bytes#0 [phi:smc_read::@8->display_action_text_reading#3] -- register_copy + // [2683] phi display_action_text_reading::file#3 = smc_read::path [phi:smc_read::@8->display_action_text_reading#4] -- pbuz1=pbuc1 lda #path sta.z display_action_text_reading.file+1 - // [2283] phi display_action_text_reading::action#2 = display_action_text_reading::action#0 [phi:smc_read::@8->display_action_text_reading#5] -- register_copy + // [2683] phi display_action_text_reading::action#3 = display_action_text_reading::action#0 [phi:smc_read::@8->display_action_text_reading#5] -- register_copy jsr display_action_text_reading // smc_read::@22 // if (progress_row_bytes == SMC_PROGRESS_ROW) - // [1541] if(smc_read::progress_row_bytes#10!=SMC_PROGRESS_ROW) goto smc_read::@10 -- vwum1_neq_vwuc1_then_la1 - lda progress_row_bytes+1 + // [1727] if(smc_read::progress_row_bytes#10!=SMC_PROGRESS_ROW) goto smc_read::@10 -- vwuz1_neq_vwuc1_then_la1 + lda.z progress_row_bytes+1 cmp #>SMC_PROGRESS_ROW bne __b10 - lda progress_row_bytes + lda.z progress_row_bytes cmp #gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#23 [phi:smc_read::@13->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = PROGRESS_X [phi:smc_read::@13->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x + // [1730] call gotoxy + // [805] phi from smc_read::@13 to gotoxy [phi:smc_read::@13->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#23 [phi:smc_read::@13->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = PROGRESS_X [phi:smc_read::@13->gotoxy#1] -- vbuyy=vbuc1 + ldy #PROGRESS_X jsr gotoxy - // [1545] phi from smc_read::@13 to smc_read::@10 [phi:smc_read::@13->smc_read::@10] - // [1545] phi smc_read::y#13 = smc_read::y#1 [phi:smc_read::@13->smc_read::@10#0] -- register_copy - // [1545] phi smc_read::progress_row_bytes#11 = 0 [phi:smc_read::@13->smc_read::@10#1] -- vwum1=vbuc1 + // [1731] phi from smc_read::@13 to smc_read::@10 [phi:smc_read::@13->smc_read::@10] + // [1731] phi smc_read::y#13 = smc_read::y#1 [phi:smc_read::@13->smc_read::@10#0] -- register_copy + // [1731] phi smc_read::progress_row_bytes#11 = 0 [phi:smc_read::@13->smc_read::@10#1] -- vwuz1=vbuc1 lda #<0 - sta progress_row_bytes - sta progress_row_bytes+1 - // [1545] phi from smc_read::@22 to smc_read::@10 [phi:smc_read::@22->smc_read::@10] - // [1545] phi smc_read::y#13 = smc_read::y#12 [phi:smc_read::@22->smc_read::@10#0] -- register_copy - // [1545] phi smc_read::progress_row_bytes#11 = smc_read::progress_row_bytes#10 [phi:smc_read::@22->smc_read::@10#1] -- register_copy + sta.z progress_row_bytes + sta.z progress_row_bytes+1 + // [1731] phi from smc_read::@22 to smc_read::@10 [phi:smc_read::@22->smc_read::@10] + // [1731] phi smc_read::y#13 = smc_read::y#12 [phi:smc_read::@22->smc_read::@10#0] -- register_copy + // [1731] phi smc_read::progress_row_bytes#11 = smc_read::progress_row_bytes#10 [phi:smc_read::@22->smc_read::@10#1] -- register_copy // smc_read::@10 __b10: // if(info_status == STATUS_READING) - // [1546] if(smc_read::info_status#10!=STATUS_READING) goto smc_read::@11 -- vbuz1_neq_vbuc1_then_la1 + // [1732] if(smc_read::info_status#10!=STATUS_READING) goto smc_read::@11 -- vbum1_neq_vbuc1_then_la1 lda #STATUS_READING - cmp.z info_status + cmp info_status bne __b11 // smc_read::@14 // cputc('.') - // [1547] stackpush(char) = '.' -- _stackpushbyte_=vbuc1 + // [1733] stackpush(char) = '.' -- _stackpushbyte_=vbuc1 lda #'.' pha - // [1548] callexecute cputc -- call_vprc1 + // [1734] callexecute cputc -- call_vprc1 jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // smc_read::@11 __b11: // if(info_status == STATUS_CHECKING) - // [1550] if(smc_read::info_status#10==STATUS_CHECKING) goto smc_read::@12 -- vbuz1_eq_vbuc1_then_la1 + // [1736] if(smc_read::info_status#10==STATUS_CHECKING) goto smc_read::@12 -- vbum1_eq_vbuc1_then_la1 lda #STATUS_CHECKING - cmp.z info_status + cmp info_status beq __b6 // smc_read::@15 // smc_bram_ptr += smc_file_read - // [1551] smc_read::smc_bram_ptr#3 = smc_read::smc_bram_ptr#10 + smc_read::smc_file_read#10 -- pbuz1=pbuz1_plus_vwum2 + // [1737] smc_read::smc_bram_ptr#3 = smc_read::smc_bram_ptr#10 + smc_read::smc_file_read#10 -- pbuz1=pbuz1_plus_vwuz2 clc lda.z smc_bram_ptr - adc smc_file_read_1 + adc.z smc_file_read_1 sta.z smc_bram_ptr lda.z smc_bram_ptr+1 - adc smc_file_read_1+1 + adc.z smc_file_read_1+1 sta.z smc_bram_ptr+1 - // [1552] phi from smc_read::@15 to smc_read::@12 [phi:smc_read::@15->smc_read::@12] - // [1552] phi smc_read::smc_bram_ptr#7 = smc_read::smc_bram_ptr#3 [phi:smc_read::@15->smc_read::@12#0] -- register_copy + // [1738] phi from smc_read::@15 to smc_read::@12 [phi:smc_read::@15->smc_read::@12] + // [1738] phi smc_read::smc_bram_ptr#7 = smc_read::smc_bram_ptr#3 [phi:smc_read::@15->smc_read::@12#0] -- register_copy jmp __b12 - // [1552] phi from smc_read::@11 to smc_read::@12 [phi:smc_read::@11->smc_read::@12] + // [1738] phi from smc_read::@11 to smc_read::@12 [phi:smc_read::@11->smc_read::@12] __b6: - // [1552] phi smc_read::smc_bram_ptr#7 = (char *) 1024 [phi:smc_read::@11->smc_read::@12#0] -- pbuz1=pbuc1 + // [1738] phi smc_read::smc_bram_ptr#7 = (char *) 1024 [phi:smc_read::@11->smc_read::@12#0] -- pbuz1=pbuc1 lda #<$400 sta.z smc_bram_ptr lda #>$400 @@ -10695,38 +11416,35 @@ smc_read: { // smc_read::@12 __b12: // smc_file_size += smc_file_read - // [1553] smc_read::smc_file_size#1 = smc_read::smc_file_size#10 + smc_read::smc_file_read#10 -- vwuz1=vwuz1_plus_vwum2 + // [1739] smc_read::smc_file_size#1 = smc_read::smc_file_size#10 + smc_read::smc_file_read#10 -- vwuz1=vwuz1_plus_vwuz2 clc lda.z smc_file_size - adc smc_file_read_1 + adc.z smc_file_read_1 sta.z smc_file_size lda.z smc_file_size+1 - adc smc_file_read_1+1 + adc.z smc_file_read_1+1 sta.z smc_file_size+1 // progress_row_bytes += smc_file_read - // [1554] smc_read::progress_row_bytes#2 = smc_read::progress_row_bytes#11 + smc_read::smc_file_read#10 -- vwum1=vwum1_plus_vwum2 + // [1740] smc_read::progress_row_bytes#2 = smc_read::progress_row_bytes#11 + smc_read::smc_file_read#10 -- vwuz1=vwuz1_plus_vwuz2 clc - lda progress_row_bytes - adc smc_file_read_1 - sta progress_row_bytes - lda progress_row_bytes+1 - adc smc_file_read_1+1 - sta progress_row_bytes+1 - // [1526] phi from smc_read::@12 to smc_read::@7 [phi:smc_read::@12->smc_read::@7] - // [1526] phi smc_read::y#12 = smc_read::y#13 [phi:smc_read::@12->smc_read::@7#0] -- register_copy - // [1526] phi smc_read::progress_row_bytes#10 = smc_read::progress_row_bytes#2 [phi:smc_read::@12->smc_read::@7#1] -- register_copy - // [1526] phi smc_read::smc_file_size#10 = smc_read::smc_file_size#1 [phi:smc_read::@12->smc_read::@7#2] -- register_copy - // [1526] phi smc_read::smc_bram_ptr#10 = smc_read::smc_bram_ptr#7 [phi:smc_read::@12->smc_read::@7#3] -- register_copy + lda.z progress_row_bytes + adc.z smc_file_read_1 + sta.z progress_row_bytes + lda.z progress_row_bytes+1 + adc.z smc_file_read_1+1 + sta.z progress_row_bytes+1 + // [1712] phi from smc_read::@12 to smc_read::@7 [phi:smc_read::@12->smc_read::@7] + // [1712] phi smc_read::y#12 = smc_read::y#13 [phi:smc_read::@12->smc_read::@7#0] -- register_copy + // [1712] phi smc_read::progress_row_bytes#10 = smc_read::progress_row_bytes#2 [phi:smc_read::@12->smc_read::@7#1] -- register_copy + // [1712] phi smc_read::smc_file_size#10 = smc_read::smc_file_size#1 [phi:smc_read::@12->smc_read::@7#2] -- register_copy + // [1712] phi smc_read::smc_bram_ptr#10 = smc_read::smc_bram_ptr#7 [phi:smc_read::@12->smc_read::@7#3] -- register_copy jmp __b7 .segment Data path: .text "SMC.BIN" .byte 0 - .label fp = rom_read_byte.rom_bank1_rom_read_byte__2 smc_file_read: .word 0 - .label y = main.check_status_smc3_main__0 - /// Holds the amount of bytes actually read in the memory to be flashed. - .label progress_row_bytes = main.main__43 - .label smc_file_read_1 = rom_read_byte.rom_ptr1_rom_read_byte__2 + .label y = main.check_status_vera10_return + .label info_status = main.check_status_smc16_return } .segment Code // smc_flash @@ -10741,44 +11459,40 @@ smc_read: { // __mem() unsigned int smc_flash(__mem() unsigned int smc_bytes_total) smc_flash: { .const smc_bram_bank = 1 - .label smc_flash__29 = $d1 - .label smc_flash__30 = $d1 - .label smc_bootloader_start = $ed - .label smc_bootloader_not_activated = $b4 - .label smc_byte_upload = $af - .label smc_bram_ptr = $73 - .label smc_bytes_checksum = $d1 - .label smc_package_flashed = $b8 + .label smc_bootloader_start = $cd + .label smc_bootloader_not_activated = $25 + .label smc_bytes_checksum = $b4 + .label smc_package_flashed = $76 // smc_flash::bank_set_bram1 // BRAM = bank - // [1556] BRAM = smc_flash::smc_bram_bank -- vbuz1=vbuc1 + // [1742] BRAM = smc_flash::smc_bram_bank -- vbuz1=vbuc1 lda #smc_bram_bank sta.z BRAM - // [1557] phi from smc_flash::bank_set_bram1 to smc_flash::@24 [phi:smc_flash::bank_set_bram1->smc_flash::@24] - // smc_flash::@24 + // [1743] phi from smc_flash::bank_set_bram1 to smc_flash::@25 [phi:smc_flash::bank_set_bram1->smc_flash::@25] + // smc_flash::@25 // display_action_progress("To start the SMC update, do the following ...") - // [1558] call display_action_progress - // [1084] phi from smc_flash::@24 to display_action_progress [phi:smc_flash::@24->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = smc_flash::info_text [phi:smc_flash::@24->display_action_progress#0] -- pbuz1=pbuc1 + // [1744] call display_action_progress + // [1155] phi from smc_flash::@25 to display_action_progress [phi:smc_flash::@25->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = smc_flash::info_text [phi:smc_flash::@25->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text sta.z display_action_progress.info_text+1 jsr display_action_progress - // smc_flash::@28 + // smc_flash::@29 // unsigned char smc_bootloader_start = cx16_k_i2c_write_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_BOOTLOADER_RESET, 0x31) - // [1559] smc_flash::cx16_k_i2c_write_byte1_device = $42 -- vbum1=vbuc1 + // [1745] smc_flash::cx16_k_i2c_write_byte1_device = $42 -- vbum1=vbuc1 lda #$42 sta cx16_k_i2c_write_byte1_device - // [1560] smc_flash::cx16_k_i2c_write_byte1_offset = $8f -- vbum1=vbuc1 + // [1746] smc_flash::cx16_k_i2c_write_byte1_offset = $8f -- vbum1=vbuc1 lda #$8f sta cx16_k_i2c_write_byte1_offset - // [1561] smc_flash::cx16_k_i2c_write_byte1_value = $31 -- vbum1=vbuc1 + // [1747] smc_flash::cx16_k_i2c_write_byte1_value = $31 -- vbum1=vbuc1 lda #$31 sta cx16_k_i2c_write_byte1_value // smc_flash::cx16_k_i2c_write_byte1 // unsigned char result - // [1562] smc_flash::cx16_k_i2c_write_byte1_result = 0 -- vbum1=vbuc1 + // [1748] smc_flash::cx16_k_i2c_write_byte1_result = 0 -- vbum1=vbuc1 lda #0 sta cx16_k_i2c_write_byte1_result // asm @@ -10790,100 +11504,97 @@ smc_flash: { jsr CX16_I2C_WRITE_BYTE rol cx16_k_i2c_write_byte1_result // return result; - // [1564] smc_flash::cx16_k_i2c_write_byte1_return#0 = smc_flash::cx16_k_i2c_write_byte1_result -- vbum1=vbum2 + // [1750] smc_flash::cx16_k_i2c_write_byte1_return#0 = smc_flash::cx16_k_i2c_write_byte1_result -- vbuaa=vbum1 lda cx16_k_i2c_write_byte1_result - sta cx16_k_i2c_write_byte1_return // smc_flash::cx16_k_i2c_write_byte1_@return // } - // [1565] smc_flash::cx16_k_i2c_write_byte1_return#1 = smc_flash::cx16_k_i2c_write_byte1_return#0 - // smc_flash::@25 + // [1751] smc_flash::cx16_k_i2c_write_byte1_return#1 = smc_flash::cx16_k_i2c_write_byte1_return#0 + // smc_flash::@26 // unsigned char smc_bootloader_start = cx16_k_i2c_write_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_BOOTLOADER_RESET, 0x31) - // [1566] smc_flash::smc_bootloader_start#0 = smc_flash::cx16_k_i2c_write_byte1_return#1 -- vbuz1=vbum2 + // [1752] smc_flash::smc_bootloader_start#0 = smc_flash::cx16_k_i2c_write_byte1_return#1 -- vbuz1=vbuaa sta.z smc_bootloader_start // if(smc_bootloader_start) - // [1567] if(0==smc_flash::smc_bootloader_start#0) goto smc_flash::@3 -- 0_eq_vbuz1_then_la1 + // [1753] if(0==smc_flash::smc_bootloader_start#0) goto smc_flash::@3 -- 0_eq_vbuz1_then_la1 beq __b6 - // [1568] phi from smc_flash::@25 to smc_flash::@2 [phi:smc_flash::@25->smc_flash::@2] + // [1754] phi from smc_flash::@26 to smc_flash::@2 [phi:smc_flash::@26->smc_flash::@2] // smc_flash::@2 // sprintf(info_text, "There was a problem starting the SMC bootloader: %x", smc_bootloader_start) - // [1569] call snprintf_init - // [1113] phi from smc_flash::@2 to snprintf_init [phi:smc_flash::@2->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:smc_flash::@2->snprintf_init#0] -- pbuz1=pbuc1 + // [1755] call snprintf_init + // [1184] phi from smc_flash::@2 to snprintf_init [phi:smc_flash::@2->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:smc_flash::@2->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [1570] phi from smc_flash::@2 to smc_flash::@29 [phi:smc_flash::@2->smc_flash::@29] - // smc_flash::@29 + // [1756] phi from smc_flash::@2 to smc_flash::@30 [phi:smc_flash::@2->smc_flash::@30] + // smc_flash::@30 // sprintf(info_text, "There was a problem starting the SMC bootloader: %x", smc_bootloader_start) - // [1571] call printf_str - // [1054] phi from smc_flash::@29 to printf_str [phi:smc_flash::@29->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:smc_flash::@29->printf_str#0] -- pprz1=pprc1 + // [1757] call printf_str + // [1125] phi from smc_flash::@30 to printf_str [phi:smc_flash::@30->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:smc_flash::@30->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = smc_flash::s [phi:smc_flash::@29->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = smc_flash::s [phi:smc_flash::@30->printf_str#1] -- pbuz1=pbuc1 lda #s sta.z printf_str.s+1 jsr printf_str - // smc_flash::@30 + // smc_flash::@31 // sprintf(info_text, "There was a problem starting the SMC bootloader: %x", smc_bootloader_start) - // [1572] printf_uchar::uvalue#9 = smc_flash::smc_bootloader_start#0 -- vbum1=vbuz2 - lda.z smc_bootloader_start - sta printf_uchar.uvalue - // [1573] call printf_uchar - // [1118] phi from smc_flash::@30 to printf_uchar [phi:smc_flash::@30->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 0 [phi:smc_flash::@30->printf_uchar#0] -- vbum1=vbuc1 + // [1758] printf_uchar::uvalue#6 = smc_flash::smc_bootloader_start#0 -- vbuxx=vbuz1 + ldx.z smc_bootloader_start + // [1759] call printf_uchar + // [1189] phi from smc_flash::@31 to printf_uchar [phi:smc_flash::@31->printf_uchar] + // [1189] phi printf_uchar::format_zero_padding#15 = 0 [phi:smc_flash::@31->printf_uchar#0] -- vbum1=vbuc1 lda #0 sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 0 [phi:smc_flash::@30->printf_uchar#1] -- vbum1=vbuc1 + // [1189] phi printf_uchar::format_min_length#15 = 0 [phi:smc_flash::@31->printf_uchar#1] -- vbum1=vbuc1 sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &snputc [phi:smc_flash::@30->printf_uchar#2] -- pprz1=pprc1 + // [1189] phi printf_uchar::putc#15 = &snputc [phi:smc_flash::@31->printf_uchar#2] -- pprz1=pprc1 lda #snputc sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = HEXADECIMAL [phi:smc_flash::@30->printf_uchar#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = printf_uchar::uvalue#9 [phi:smc_flash::@30->printf_uchar#4] -- register_copy + // [1189] phi printf_uchar::format_radix#15 = HEXADECIMAL [phi:smc_flash::@31->printf_uchar#3] -- vbuyy=vbuc1 + ldy #HEXADECIMAL + // [1189] phi printf_uchar::uvalue#15 = printf_uchar::uvalue#6 [phi:smc_flash::@31->printf_uchar#4] -- register_copy jsr printf_uchar - // smc_flash::@31 + // smc_flash::@32 // sprintf(info_text, "There was a problem starting the SMC bootloader: %x", smc_bootloader_start) - // [1574] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [1760] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [1575] callexecute snputc -- call_vprc1 + // [1761] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [1577] call display_action_text - // [1129] phi from smc_flash::@31 to display_action_text [phi:smc_flash::@31->display_action_text] - // [1129] phi display_action_text::info_text#17 = info_text [phi:smc_flash::@31->display_action_text#0] -- pbuz1=pbuc1 + // [1763] call display_action_text + // [1200] phi from smc_flash::@32 to display_action_text [phi:smc_flash::@32->display_action_text] + // [1200] phi display_action_text::info_text#25 = info_text [phi:smc_flash::@32->display_action_text#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_action_text.info_text lda #>@info_text sta.z display_action_text.info_text+1 jsr display_action_text - // smc_flash::@32 + // smc_flash::@33 // cx16_k_i2c_write_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_REBOOT, 0) - // [1578] smc_flash::cx16_k_i2c_write_byte2_device = $42 -- vbum1=vbuc1 + // [1764] smc_flash::cx16_k_i2c_write_byte2_device = $42 -- vbum1=vbuc1 lda #$42 sta cx16_k_i2c_write_byte2_device - // [1579] smc_flash::cx16_k_i2c_write_byte2_offset = $82 -- vbum1=vbuc1 + // [1765] smc_flash::cx16_k_i2c_write_byte2_offset = $82 -- vbum1=vbuc1 lda #$82 sta cx16_k_i2c_write_byte2_offset - // [1580] smc_flash::cx16_k_i2c_write_byte2_value = 0 -- vbum1=vbuc1 + // [1766] smc_flash::cx16_k_i2c_write_byte2_value = 0 -- vbum1=vbuc1 lda #0 sta cx16_k_i2c_write_byte2_value // smc_flash::cx16_k_i2c_write_byte2 // unsigned char result - // [1581] smc_flash::cx16_k_i2c_write_byte2_result = 0 -- vbum1=vbuc1 + // [1767] smc_flash::cx16_k_i2c_write_byte2_result = 0 -- vbum1=vbuc1 sta cx16_k_i2c_write_byte2_result // asm // asm { ldxdevice ldyoffset ldavalue stzresult jsrCX16_I2C_WRITE_BYTE rolresult } @@ -10893,359 +11604,401 @@ smc_flash: { stz cx16_k_i2c_write_byte2_result jsr CX16_I2C_WRITE_BYTE rol cx16_k_i2c_write_byte2_result - // [1583] phi from smc_flash::@50 smc_flash::cx16_k_i2c_write_byte2 to smc_flash::@return [phi:smc_flash::@50/smc_flash::cx16_k_i2c_write_byte2->smc_flash::@return] + // [1769] phi from smc_flash::@51 smc_flash::cx16_k_i2c_write_byte2 to smc_flash::@return [phi:smc_flash::@51/smc_flash::cx16_k_i2c_write_byte2->smc_flash::@return] __b2: - // [1583] phi smc_flash::return#1 = 0 [phi:smc_flash::@50/smc_flash::cx16_k_i2c_write_byte2->smc_flash::@return#0] -- vwum1=vbuc1 + // [1769] phi smc_flash::return#1 = 0 [phi:smc_flash::@51/smc_flash::cx16_k_i2c_write_byte2->smc_flash::@return#0] -- vwum1=vbuc1 lda #<0 sta return sta return+1 // smc_flash::@return // } - // [1584] return + // [1770] return rts - // [1585] phi from smc_flash::@25 to smc_flash::@3 [phi:smc_flash::@25->smc_flash::@3] + // [1771] phi from smc_flash::@26 to smc_flash::@3 [phi:smc_flash::@26->smc_flash::@3] __b6: - // [1585] phi smc_flash::smc_bootloader_activation_countdown#10 = $80 [phi:smc_flash::@25->smc_flash::@3#0] -- vbum1=vbuc1 + // [1771] phi smc_flash::smc_bootloader_activation_countdown#10 = $80 [phi:smc_flash::@26->smc_flash::@3#0] -- vbum1=vbuc1 lda #$80 sta smc_bootloader_activation_countdown // smc_flash::@3 __b3: // while(smc_bootloader_activation_countdown) - // [1586] if(0!=smc_flash::smc_bootloader_activation_countdown#10) goto smc_flash::@4 -- 0_neq_vbum1_then_la1 + // [1772] if(0!=smc_flash::smc_bootloader_activation_countdown#10) goto smc_flash::@4 -- 0_neq_vbum1_then_la1 lda smc_bootloader_activation_countdown beq !__b4+ jmp __b4 !__b4: - // [1587] phi from smc_flash::@3 smc_flash::@33 to smc_flash::@7 [phi:smc_flash::@3/smc_flash::@33->smc_flash::@7] + // [1773] phi from smc_flash::@3 smc_flash::@34 to smc_flash::@7 [phi:smc_flash::@3/smc_flash::@34->smc_flash::@7] __b9: - // [1587] phi smc_flash::smc_bootloader_activation_countdown#12 = $a [phi:smc_flash::@3/smc_flash::@33->smc_flash::@7#0] -- vbum1=vbuc1 + // [1773] phi smc_flash::smc_bootloader_activation_countdown#12 = $a [phi:smc_flash::@3/smc_flash::@34->smc_flash::@7#0] -- vbum1=vbuc1 lda #$a sta smc_bootloader_activation_countdown_1 // smc_flash::@7 __b7: // while(smc_bootloader_activation_countdown) - // [1588] if(0!=smc_flash::smc_bootloader_activation_countdown#12) goto smc_flash::@8 -- 0_neq_vbum1_then_la1 + // [1774] if(0!=smc_flash::smc_bootloader_activation_countdown#12) goto smc_flash::@8 -- 0_neq_vbum1_then_la1 lda smc_bootloader_activation_countdown_1 beq !__b8+ jmp __b8 !__b8: // smc_flash::@9 // cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_OFFSET) - // [1589] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 + // [1775] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 lda #$42 sta cx16_k_i2c_read_byte.device - // [1590] cx16_k_i2c_read_byte::offset = $8e -- vbum1=vbuc1 + // [1776] cx16_k_i2c_read_byte::offset = $8e -- vbum1=vbuc1 lda #$8e sta cx16_k_i2c_read_byte.offset - // [1591] call cx16_k_i2c_read_byte + // [1777] call cx16_k_i2c_read_byte jsr cx16_k_i2c_read_byte - // [1592] cx16_k_i2c_read_byte::return#12 = cx16_k_i2c_read_byte::return#1 - // smc_flash::@45 + // [1778] cx16_k_i2c_read_byte::return#12 = cx16_k_i2c_read_byte::return#1 + // smc_flash::@46 // smc_bootloader_not_activated = cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_OFFSET) - // [1593] smc_flash::smc_bootloader_not_activated#1 = cx16_k_i2c_read_byte::return#12 -- vwuz1=vwum2 + // [1779] smc_flash::smc_bootloader_not_activated#1 = cx16_k_i2c_read_byte::return#12 -- vwuz1=vwum2 lda cx16_k_i2c_read_byte.return sta.z smc_bootloader_not_activated lda cx16_k_i2c_read_byte.return+1 sta.z smc_bootloader_not_activated+1 // if(smc_bootloader_not_activated) - // [1594] if(0==smc_flash::smc_bootloader_not_activated#1) goto smc_flash::@1 -- 0_eq_vwuz1_then_la1 + // [1780] if(0==smc_flash::smc_bootloader_not_activated#1) goto smc_flash::@1 -- 0_eq_vwuz1_then_la1 lda.z smc_bootloader_not_activated ora.z smc_bootloader_not_activated+1 beq __b1 - // [1595] phi from smc_flash::@45 to smc_flash::@10 [phi:smc_flash::@45->smc_flash::@10] + // [1781] phi from smc_flash::@46 to smc_flash::@10 [phi:smc_flash::@46->smc_flash::@10] // smc_flash::@10 // sprintf(info_text, "There was a problem activating the SMC bootloader: %x", smc_bootloader_not_activated) - // [1596] call snprintf_init - // [1113] phi from smc_flash::@10 to snprintf_init [phi:smc_flash::@10->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:smc_flash::@10->snprintf_init#0] -- pbuz1=pbuc1 + // [1782] call snprintf_init + // [1184] phi from smc_flash::@10 to snprintf_init [phi:smc_flash::@10->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:smc_flash::@10->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [1597] phi from smc_flash::@10 to smc_flash::@48 [phi:smc_flash::@10->smc_flash::@48] - // smc_flash::@48 + // [1783] phi from smc_flash::@10 to smc_flash::@49 [phi:smc_flash::@10->smc_flash::@49] + // smc_flash::@49 // sprintf(info_text, "There was a problem activating the SMC bootloader: %x", smc_bootloader_not_activated) - // [1598] call printf_str - // [1054] phi from smc_flash::@48 to printf_str [phi:smc_flash::@48->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:smc_flash::@48->printf_str#0] -- pprz1=pprc1 + // [1784] call printf_str + // [1125] phi from smc_flash::@49 to printf_str [phi:smc_flash::@49->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:smc_flash::@49->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = smc_flash::s5 [phi:smc_flash::@48->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = smc_flash::s5 [phi:smc_flash::@49->printf_str#1] -- pbuz1=pbuc1 lda #s5 sta.z printf_str.s+1 jsr printf_str - // smc_flash::@49 + // smc_flash::@50 // sprintf(info_text, "There was a problem activating the SMC bootloader: %x", smc_bootloader_not_activated) - // [1599] printf_uint::uvalue#3 = smc_flash::smc_bootloader_not_activated#1 -- vwum1=vwuz2 + // [1785] printf_uint::uvalue#3 = smc_flash::smc_bootloader_not_activated#1 -- vwum1=vwuz2 lda.z smc_bootloader_not_activated sta printf_uint.uvalue lda.z smc_bootloader_not_activated+1 sta printf_uint.uvalue+1 - // [1600] call printf_uint - // [1835] phi from smc_flash::@49 to printf_uint [phi:smc_flash::@49->printf_uint] - // [1835] phi printf_uint::format_zero_padding#10 = 0 [phi:smc_flash::@49->printf_uint#0] -- vbum1=vbuc1 + // [1786] call printf_uint + // [2015] phi from smc_flash::@50 to printf_uint [phi:smc_flash::@50->printf_uint] + // [2015] phi printf_uint::format_zero_padding#10 = 0 [phi:smc_flash::@50->printf_uint#0] -- vbum1=vbuc1 lda #0 sta printf_uint.format_zero_padding - // [1835] phi printf_uint::format_min_length#10 = 0 [phi:smc_flash::@49->printf_uint#1] -- vbum1=vbuc1 + // [2015] phi printf_uint::format_min_length#10 = 0 [phi:smc_flash::@50->printf_uint#1] -- vbum1=vbuc1 sta printf_uint.format_min_length - // [1835] phi printf_uint::putc#10 = &snputc [phi:smc_flash::@49->printf_uint#2] -- pprz1=pprc1 + // [2015] phi printf_uint::putc#10 = &snputc [phi:smc_flash::@50->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1835] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:smc_flash::@49->printf_uint#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uint.format_radix - // [1835] phi printf_uint::uvalue#10 = printf_uint::uvalue#3 [phi:smc_flash::@49->printf_uint#4] -- register_copy + // [2015] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:smc_flash::@50->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [2015] phi printf_uint::uvalue#10 = printf_uint::uvalue#3 [phi:smc_flash::@50->printf_uint#4] -- register_copy jsr printf_uint - // smc_flash::@50 + // smc_flash::@51 // sprintf(info_text, "There was a problem activating the SMC bootloader: %x", smc_bootloader_not_activated) - // [1601] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [1787] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [1602] callexecute snputc -- call_vprc1 + // [1788] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [1604] call display_action_text - // [1129] phi from smc_flash::@50 to display_action_text [phi:smc_flash::@50->display_action_text] - // [1129] phi display_action_text::info_text#17 = info_text [phi:smc_flash::@50->display_action_text#0] -- pbuz1=pbuc1 + // [1790] call display_action_text + // [1200] phi from smc_flash::@51 to display_action_text [phi:smc_flash::@51->display_action_text] + // [1200] phi display_action_text::info_text#25 = info_text [phi:smc_flash::@51->display_action_text#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_action_text.info_text lda #>@info_text sta.z display_action_text.info_text+1 jsr display_action_text jmp __b2 - // [1605] phi from smc_flash::@45 to smc_flash::@1 [phi:smc_flash::@45->smc_flash::@1] + // [1791] phi from smc_flash::@46 to smc_flash::@1 [phi:smc_flash::@46->smc_flash::@1] // smc_flash::@1 __b1: // display_action_progress("Updating SMC firmware ... (+) Updated") - // [1606] call display_action_progress - // [1084] phi from smc_flash::@1 to display_action_progress [phi:smc_flash::@1->display_action_progress] - // [1084] phi display_action_progress::info_text#20 = smc_flash::info_text1 [phi:smc_flash::@1->display_action_progress#0] -- pbuz1=pbuc1 + // [1792] call display_action_progress + // [1155] phi from smc_flash::@1 to display_action_progress [phi:smc_flash::@1->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = smc_flash::info_text1 [phi:smc_flash::@1->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text1 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [1607] phi from smc_flash::@1 to smc_flash::@46 [phi:smc_flash::@1->smc_flash::@46] - // smc_flash::@46 + // [1793] phi from smc_flash::@1 to smc_flash::@47 [phi:smc_flash::@1->smc_flash::@47] + // smc_flash::@47 // textcolor(WHITE) - // [1608] call textcolor - // [760] phi from smc_flash::@46 to textcolor [phi:smc_flash::@46->textcolor] - // [760] phi textcolor::color#23 = WHITE [phi:smc_flash::@46->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color + // [1794] call textcolor + // [787] phi from smc_flash::@47 to textcolor [phi:smc_flash::@47->textcolor] + // [787] phi textcolor::color#23 = WHITE [phi:smc_flash::@47->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor - // [1609] phi from smc_flash::@46 to smc_flash::@47 [phi:smc_flash::@46->smc_flash::@47] - // smc_flash::@47 + // [1795] phi from smc_flash::@47 to smc_flash::@48 [phi:smc_flash::@47->smc_flash::@48] + // smc_flash::@48 // gotoxy(x, y) - // [1610] call gotoxy - // [778] phi from smc_flash::@47 to gotoxy [phi:smc_flash::@47->gotoxy] - // [778] phi gotoxy::y#33 = PROGRESS_Y [phi:smc_flash::@47->gotoxy#0] -- vbum1=vbuc1 + // [1796] call gotoxy + // [805] phi from smc_flash::@48 to gotoxy [phi:smc_flash::@48->gotoxy] + // [805] phi gotoxy::y#37 = PROGRESS_Y [phi:smc_flash::@48->gotoxy#0] -- vbum1=vbuc1 lda #PROGRESS_Y sta gotoxy.y - // [778] phi gotoxy::x#33 = PROGRESS_X [phi:smc_flash::@47->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x + // [805] phi gotoxy::x#37 = PROGRESS_X [phi:smc_flash::@48->gotoxy#1] -- vbuyy=vbuc1 + ldy #PROGRESS_X jsr gotoxy - // [1611] phi from smc_flash::@47 to smc_flash::@11 [phi:smc_flash::@47->smc_flash::@11] - // [1611] phi smc_flash::y#36 = PROGRESS_Y [phi:smc_flash::@47->smc_flash::@11#0] -- vbum1=vbuc1 + // [1797] phi from smc_flash::@48 to smc_flash::@11 [phi:smc_flash::@48->smc_flash::@11] + // [1797] phi smc_flash::y#36 = PROGRESS_Y [phi:smc_flash::@48->smc_flash::@11#0] -- vbum1=vbuc1 lda #PROGRESS_Y sta y - // [1611] phi smc_flash::smc_row_bytes#16 = 0 [phi:smc_flash::@47->smc_flash::@11#1] -- vwum1=vwuc1 + // [1797] phi smc_flash::smc_row_bytes#16 = 0 [phi:smc_flash::@48->smc_flash::@11#1] -- vwum1=vwuc1 lda #<0 sta smc_row_bytes sta smc_row_bytes+1 - // [1611] phi smc_flash::smc_bram_ptr#14 = (char *)$a000 [phi:smc_flash::@47->smc_flash::@11#2] -- pbuz1=pbuc1 + // [1797] phi smc_flash::smc_bram_ptr#14 = (char *)$a000 [phi:smc_flash::@48->smc_flash::@11#2] -- pbum1=pbuc1 lda #<$a000 - sta.z smc_bram_ptr + sta smc_bram_ptr lda #>$a000 - sta.z smc_bram_ptr+1 - // [1611] phi smc_flash::smc_bytes_flashed#13 = 0 [phi:smc_flash::@47->smc_flash::@11#3] -- vwum1=vwuc1 + sta smc_bram_ptr+1 + // [1797] phi smc_flash::smc_flashed_bytes#10 = 0 [phi:smc_flash::@48->smc_flash::@11#3] -- vwum1=vwuc1 lda #<0 - sta smc_bytes_flashed - sta smc_bytes_flashed+1 - // [1611] phi from smc_flash::@15 to smc_flash::@11 [phi:smc_flash::@15->smc_flash::@11] - // [1611] phi smc_flash::y#36 = smc_flash::y#21 [phi:smc_flash::@15->smc_flash::@11#0] -- register_copy - // [1611] phi smc_flash::smc_row_bytes#16 = smc_flash::smc_row_bytes#11 [phi:smc_flash::@15->smc_flash::@11#1] -- register_copy - // [1611] phi smc_flash::smc_bram_ptr#14 = smc_flash::smc_bram_ptr#12 [phi:smc_flash::@15->smc_flash::@11#2] -- register_copy - // [1611] phi smc_flash::smc_bytes_flashed#13 = smc_flash::smc_bytes_flashed#12 [phi:smc_flash::@15->smc_flash::@11#3] -- register_copy + sta smc_flashed_bytes + sta smc_flashed_bytes+1 // smc_flash::@11 __b11: - // while(smc_bytes_flashed < smc_bytes_total) - // [1612] if(smc_flash::smc_bytes_flashed#13display_action_text_flashed] - // [2424] phi display_action_text_flashed::chip#2 = smc_flash::chip [phi:smc_flash::@12->display_action_text_flashed#0] -- pbuz1=pbuc1 + sta display_action_text_flashed.bytes+2 + sta display_action_text_flashed.bytes+3 + // [1800] call display_action_text_flashed + // [2824] phi from smc_flash::@12 to display_action_text_flashed [phi:smc_flash::@12->display_action_text_flashed] + // [2824] phi display_action_text_flashed::chip#3 = smc_flash::chip [phi:smc_flash::@12->display_action_text_flashed#0] -- pbuz1=pbuc1 lda #chip sta.z display_action_text_flashed.chip+1 - // [2424] phi display_action_text_flashed::bytes#2 = display_action_text_flashed::bytes#0 [phi:smc_flash::@12->display_action_text_flashed#1] -- register_copy + // [2824] phi display_action_text_flashed::bytes#3 = display_action_text_flashed::bytes#0 [phi:smc_flash::@12->display_action_text_flashed#1] -- register_copy jsr display_action_text_flashed - // [1583] phi from smc_flash::@12 to smc_flash::@return [phi:smc_flash::@12->smc_flash::@return] - // [1583] phi smc_flash::return#1 = smc_flash::smc_bytes_flashed#13 [phi:smc_flash::@12->smc_flash::@return#0] -- register_copy + // [1801] phi from smc_flash::@12 to smc_flash::@52 [phi:smc_flash::@12->smc_flash::@52] + // smc_flash::@52 + // wait_moment(16) + // [1802] call wait_moment + // [1134] phi from smc_flash::@52 to wait_moment [phi:smc_flash::@52->wait_moment] + // [1134] phi wait_moment::w#17 = $10 [phi:smc_flash::@52->wait_moment#0] -- vbuz1=vbuc1 + lda #$10 + sta.z wait_moment.w + jsr wait_moment + // [1769] phi from smc_flash::@52 to smc_flash::@return [phi:smc_flash::@52->smc_flash::@return] + // [1769] phi smc_flash::return#1 = smc_flash::smc_flashed_bytes#10 [phi:smc_flash::@52->smc_flash::@return#0] -- register_copy rts - // [1615] phi from smc_flash::@11 to smc_flash::@13 [phi:smc_flash::@11->smc_flash::@13] + // [1803] phi from smc_flash::@11 to smc_flash::@13 [phi:smc_flash::@11->smc_flash::@13] __b10: - // [1615] phi smc_flash::y#21 = smc_flash::y#36 [phi:smc_flash::@11->smc_flash::@13#0] -- register_copy - // [1615] phi smc_flash::smc_row_bytes#11 = smc_flash::smc_row_bytes#16 [phi:smc_flash::@11->smc_flash::@13#1] -- register_copy - // [1615] phi smc_flash::smc_bytes_flashed#12 = smc_flash::smc_bytes_flashed#13 [phi:smc_flash::@11->smc_flash::@13#2] -- register_copy - // [1615] phi smc_flash::smc_bram_ptr#12 = smc_flash::smc_bram_ptr#14 [phi:smc_flash::@11->smc_flash::@13#3] -- register_copy - // [1615] phi smc_flash::smc_attempts_flashed#15 = 0 [phi:smc_flash::@11->smc_flash::@13#4] -- vbum1=vbuc1 + // [1803] phi smc_flash::y#21 = smc_flash::y#36 [phi:smc_flash::@11->smc_flash::@13#0] -- register_copy + // [1803] phi smc_flash::smc_row_bytes#11 = smc_flash::smc_row_bytes#16 [phi:smc_flash::@11->smc_flash::@13#1] -- register_copy + // [1803] phi smc_flash::smc_flashed_bytes#11 = smc_flash::smc_flashed_bytes#10 [phi:smc_flash::@11->smc_flash::@13#2] -- register_copy + // [1803] phi smc_flash::smc_bram_ptr#12 = smc_flash::smc_bram_ptr#14 [phi:smc_flash::@11->smc_flash::@13#3] -- register_copy + // [1803] phi smc_flash::smc_attempts_flashed#15 = 0 [phi:smc_flash::@11->smc_flash::@13#4] -- vbum1=vbuc1 lda #0 sta smc_attempts_flashed - // [1615] phi smc_flash::smc_package_committed#10 = 0 [phi:smc_flash::@11->smc_flash::@13#5] -- vbum1=vbuc1 + // [1803] phi smc_flash::smc_package_committed#10 = 0 [phi:smc_flash::@11->smc_flash::@13#5] -- vbum1=vbuc1 sta smc_package_committed // smc_flash::@13 __b13: // while(!smc_package_committed && smc_attempts_flashed < 10) - // [1616] if(0!=smc_flash::smc_package_committed#10) goto smc_flash::@15 -- 0_neq_vbum1_then_la1 + // [1804] if(0!=smc_flash::smc_package_committed#10) goto smc_flash::@15 -- 0_neq_vbum1_then_la1 lda smc_package_committed bne __b15 - // smc_flash::@55 - // [1617] if(smc_flash::smc_attempts_flashed#15<$a) goto smc_flash::@14 -- vbum1_lt_vbuc1_then_la1 + // smc_flash::@58 + // [1805] if(smc_flash::smc_attempts_flashed#15<$a) goto smc_flash::@14 -- vbum1_lt_vbuc1_then_la1 lda smc_attempts_flashed cmp #$a - bcc __b14 + bcs !__b14+ + jmp __b14 + !__b14: // smc_flash::@15 __b15: // if(smc_attempts_flashed >= 10) - // [1618] if(smc_flash::smc_attempts_flashed#15<$a) goto smc_flash::@11 -- vbum1_lt_vbuc1_then_la1 + // [1806] if(smc_flash::smc_attempts_flashed#15<$a) goto smc_flash::@24 -- vbum1_lt_vbuc1_then_la1 lda smc_attempts_flashed cmp #$a - bcc __b11 - // [1619] phi from smc_flash::@15 to smc_flash::@23 [phi:smc_flash::@15->smc_flash::@23] + bcc __b24 + // [1807] phi from smc_flash::@15 to smc_flash::@23 [phi:smc_flash::@15->smc_flash::@23] // smc_flash::@23 - // sprintf(info_text, "There were too many attempts trying to flash the SMC at location %04x", smc_bytes_flashed) - // [1620] call snprintf_init - // [1113] phi from smc_flash::@23 to snprintf_init [phi:smc_flash::@23->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:smc_flash::@23->snprintf_init#0] -- pbuz1=pbuc1 + // sprintf(info_text, "There were too many attempts trying to flash the SMC at location %04x", smc_flashed_bytes) + // [1808] call snprintf_init + // [1184] phi from smc_flash::@23 to snprintf_init [phi:smc_flash::@23->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:smc_flash::@23->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [1621] phi from smc_flash::@23 to smc_flash::@52 [phi:smc_flash::@23->smc_flash::@52] - // smc_flash::@52 - // sprintf(info_text, "There were too many attempts trying to flash the SMC at location %04x", smc_bytes_flashed) - // [1622] call printf_str - // [1054] phi from smc_flash::@52 to printf_str [phi:smc_flash::@52->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:smc_flash::@52->printf_str#0] -- pprz1=pprc1 + // [1809] phi from smc_flash::@23 to smc_flash::@55 [phi:smc_flash::@23->smc_flash::@55] + // smc_flash::@55 + // sprintf(info_text, "There were too many attempts trying to flash the SMC at location %04x", smc_flashed_bytes) + // [1810] call printf_str + // [1125] phi from smc_flash::@55 to printf_str [phi:smc_flash::@55->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:smc_flash::@55->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = smc_flash::s6 [phi:smc_flash::@52->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = smc_flash::s6 [phi:smc_flash::@55->printf_str#1] -- pbuz1=pbuc1 lda #s6 sta.z printf_str.s+1 jsr printf_str - // smc_flash::@53 - // sprintf(info_text, "There were too many attempts trying to flash the SMC at location %04x", smc_bytes_flashed) - // [1623] printf_uint::uvalue#4 = smc_flash::smc_bytes_flashed#12 -- vwum1=vwum2 - lda smc_bytes_flashed + // smc_flash::@56 + // sprintf(info_text, "There were too many attempts trying to flash the SMC at location %04x", smc_flashed_bytes) + // [1811] printf_uint::uvalue#4 = smc_flash::smc_flashed_bytes#11 -- vwum1=vwum2 + lda smc_flashed_bytes sta printf_uint.uvalue - lda smc_bytes_flashed+1 + lda smc_flashed_bytes+1 sta printf_uint.uvalue+1 - // [1624] call printf_uint - // [1835] phi from smc_flash::@53 to printf_uint [phi:smc_flash::@53->printf_uint] - // [1835] phi printf_uint::format_zero_padding#10 = 1 [phi:smc_flash::@53->printf_uint#0] -- vbum1=vbuc1 + // [1812] call printf_uint + // [2015] phi from smc_flash::@56 to printf_uint [phi:smc_flash::@56->printf_uint] + // [2015] phi printf_uint::format_zero_padding#10 = 1 [phi:smc_flash::@56->printf_uint#0] -- vbum1=vbuc1 lda #1 sta printf_uint.format_zero_padding - // [1835] phi printf_uint::format_min_length#10 = 4 [phi:smc_flash::@53->printf_uint#1] -- vbum1=vbuc1 + // [2015] phi printf_uint::format_min_length#10 = 4 [phi:smc_flash::@56->printf_uint#1] -- vbum1=vbuc1 lda #4 sta printf_uint.format_min_length - // [1835] phi printf_uint::putc#10 = &snputc [phi:smc_flash::@53->printf_uint#2] -- pprz1=pprc1 + // [2015] phi printf_uint::putc#10 = &snputc [phi:smc_flash::@56->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1835] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:smc_flash::@53->printf_uint#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uint.format_radix - // [1835] phi printf_uint::uvalue#10 = printf_uint::uvalue#4 [phi:smc_flash::@53->printf_uint#4] -- register_copy + // [2015] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:smc_flash::@56->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [2015] phi printf_uint::uvalue#10 = printf_uint::uvalue#4 [phi:smc_flash::@56->printf_uint#4] -- register_copy jsr printf_uint - // smc_flash::@54 - // sprintf(info_text, "There were too many attempts trying to flash the SMC at location %04x", smc_bytes_flashed) - // [1625] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // smc_flash::@57 + // sprintf(info_text, "There were too many attempts trying to flash the SMC at location %04x", smc_flashed_bytes) + // [1813] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [1626] callexecute snputc -- call_vprc1 + // [1814] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [1628] call display_action_text - // [1129] phi from smc_flash::@54 to display_action_text [phi:smc_flash::@54->display_action_text] - // [1129] phi display_action_text::info_text#17 = info_text [phi:smc_flash::@54->display_action_text#0] -- pbuz1=pbuc1 + // [1816] call display_action_text + // [1200] phi from smc_flash::@57 to display_action_text [phi:smc_flash::@57->display_action_text] + // [1200] phi display_action_text::info_text#25 = info_text [phi:smc_flash::@57->display_action_text#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_action_text.info_text lda #>@info_text sta.z display_action_text.info_text+1 jsr display_action_text - // [1583] phi from smc_flash::@54 to smc_flash::@return [phi:smc_flash::@54->smc_flash::@return] - // [1583] phi smc_flash::return#1 = $ffff [phi:smc_flash::@54->smc_flash::@return#0] -- vwum1=vwuc1 + // [1769] phi from smc_flash::@57 to smc_flash::@return [phi:smc_flash::@57->smc_flash::@return] + // [1769] phi smc_flash::return#1 = $ffff [phi:smc_flash::@57->smc_flash::@return#0] -- vwum1=vwuc1 lda #<$ffff sta return lda #>$ffff sta return+1 rts + // smc_flash::@24 + __b24: + // get_info_text_flashing(smc_flashed_bytes) + // [1817] get_info_text_flashing::flash_bytes#0 = smc_flash::smc_flashed_bytes#11 -- vduz1=vwum2 + lda smc_flashed_bytes + sta.z get_info_text_flashing.flash_bytes + lda smc_flashed_bytes+1 + sta.z get_info_text_flashing.flash_bytes+1 + lda #0 + sta.z get_info_text_flashing.flash_bytes+2 + sta.z get_info_text_flashing.flash_bytes+3 + // [1818] call get_info_text_flashing + // [2841] phi from smc_flash::@24 to get_info_text_flashing [phi:smc_flash::@24->get_info_text_flashing] + // [2841] phi get_info_text_flashing::flash_bytes#3 = get_info_text_flashing::flash_bytes#0 [phi:smc_flash::@24->get_info_text_flashing#0] -- register_copy + jsr get_info_text_flashing + // smc_flash::@54 + // [1819] smc_bootloader#600 = smc_bootloader#0 -- vwum1=vwum2 + lda smc_bootloader + sta smc_bootloader_1 + lda smc_bootloader+1 + sta smc_bootloader_1+1 + // display_info_smc(STATUS_FLASHING, get_info_text_flashing(smc_flashed_bytes)) + // [1820] call display_info_smc + // [925] phi from smc_flash::@54 to display_info_smc [phi:smc_flash::@54->display_info_smc] + // [925] phi display_info_smc::info_text#24 = info_text [phi:smc_flash::@54->display_info_smc#0] -- pbuz1=pbuc1 + lda #<@info_text + sta.z display_info_smc.info_text + lda #>@info_text + sta.z display_info_smc.info_text+1 + // [925] phi smc_bootloader#14 = smc_bootloader#600 [phi:smc_flash::@54->display_info_smc#1] -- register_copy + // [925] phi display_info_smc::info_status#24 = STATUS_FLASHING [phi:smc_flash::@54->display_info_smc#2] -- vbuz1=vbuc1 + lda #STATUS_FLASHING + sta.z display_info_smc.info_status + jsr display_info_smc + // [1797] phi from smc_flash::@54 to smc_flash::@11 [phi:smc_flash::@54->smc_flash::@11] + // [1797] phi smc_flash::y#36 = smc_flash::y#21 [phi:smc_flash::@54->smc_flash::@11#0] -- register_copy + // [1797] phi smc_flash::smc_row_bytes#16 = smc_flash::smc_row_bytes#11 [phi:smc_flash::@54->smc_flash::@11#1] -- register_copy + // [1797] phi smc_flash::smc_bram_ptr#14 = smc_flash::smc_bram_ptr#12 [phi:smc_flash::@54->smc_flash::@11#2] -- register_copy + // [1797] phi smc_flash::smc_flashed_bytes#10 = smc_flash::smc_flashed_bytes#11 [phi:smc_flash::@54->smc_flash::@11#3] -- register_copy + jmp __b11 // smc_flash::@14 __b14: - // display_action_text_flashing(8, "SMC", smc_bram_bank, smc_bram_ptr, smc_bytes_flashed) - // [1629] display_action_text_flashing::bram_ptr#0 = smc_flash::smc_bram_ptr#12 -- pbuz1=pbuz2 - lda.z smc_bram_ptr + // display_action_text_flashing(8, "SMC", smc_bram_bank, smc_bram_ptr, smc_flashed_bytes) + // [1821] display_action_text_flashing::bram_ptr#0 = smc_flash::smc_bram_ptr#12 -- pbuz1=pbum2 + lda smc_bram_ptr sta.z display_action_text_flashing.bram_ptr - lda.z smc_bram_ptr+1 + lda smc_bram_ptr+1 sta.z display_action_text_flashing.bram_ptr+1 - // [1630] display_action_text_flashing::address#0 = smc_flash::smc_bytes_flashed#12 -- vduz1=vwum2 - lda smc_bytes_flashed + // [1822] display_action_text_flashing::address#0 = smc_flash::smc_flashed_bytes#11 -- vduz1=vwum2 + lda smc_flashed_bytes sta.z display_action_text_flashing.address - lda smc_bytes_flashed+1 + lda smc_flashed_bytes+1 sta.z display_action_text_flashing.address+1 lda #0 sta.z display_action_text_flashing.address+2 sta.z display_action_text_flashing.address+3 - // [1631] call display_action_text_flashing - // [2453] phi from smc_flash::@14 to display_action_text_flashing [phi:smc_flash::@14->display_action_text_flashing] - // [2453] phi display_action_text_flashing::address#10 = display_action_text_flashing::address#0 [phi:smc_flash::@14->display_action_text_flashing#0] -- register_copy - // [2453] phi display_action_text_flashing::chip#10 = smc_flash::chip [phi:smc_flash::@14->display_action_text_flashing#1] -- pbuz1=pbuc1 + // [1823] call display_action_text_flashing + // [2863] phi from smc_flash::@14 to display_action_text_flashing [phi:smc_flash::@14->display_action_text_flashing] + // [2863] phi display_action_text_flashing::address#10 = display_action_text_flashing::address#0 [phi:smc_flash::@14->display_action_text_flashing#0] -- register_copy + // [2863] phi display_action_text_flashing::chip#10 = smc_flash::chip [phi:smc_flash::@14->display_action_text_flashing#1] -- pbuz1=pbuc1 lda #chip sta.z display_action_text_flashing.chip+1 - // [2453] phi display_action_text_flashing::bram_ptr#2 = display_action_text_flashing::bram_ptr#0 [phi:smc_flash::@14->display_action_text_flashing#2] -- register_copy - // [2453] phi display_action_text_flashing::bram_bank#2 = smc_flash::smc_bram_bank [phi:smc_flash::@14->display_action_text_flashing#3] -- vbuz1=vbuc1 + // [2863] phi display_action_text_flashing::bram_ptr#3 = display_action_text_flashing::bram_ptr#0 [phi:smc_flash::@14->display_action_text_flashing#2] -- register_copy + // [2863] phi display_action_text_flashing::bram_bank#3 = smc_flash::smc_bram_bank [phi:smc_flash::@14->display_action_text_flashing#3] -- vbuz1=vbuc1 lda #smc_bram_bank sta.z display_action_text_flashing.bram_bank - // [2453] phi display_action_text_flashing::bytes#2 = 8 [phi:smc_flash::@14->display_action_text_flashing#4] -- vduz1=vbuc1 + // [2863] phi display_action_text_flashing::bytes#3 = 8 [phi:smc_flash::@14->display_action_text_flashing#4] -- vduz1=vbuc1 lda #8 sta.z display_action_text_flashing.bytes lda #0 @@ -11253,18 +12006,18 @@ smc_flash: { sta.z display_action_text_flashing.bytes+2 sta.z display_action_text_flashing.bytes+3 jsr display_action_text_flashing - // [1632] phi from smc_flash::@14 to smc_flash::@16 [phi:smc_flash::@14->smc_flash::@16] - // [1632] phi smc_flash::smc_bytes_checksum#2 = 0 [phi:smc_flash::@14->smc_flash::@16#0] -- vbuz1=vbuc1 + // [1824] phi from smc_flash::@14 to smc_flash::@16 [phi:smc_flash::@14->smc_flash::@16] + // [1824] phi smc_flash::smc_bytes_checksum#2 = 0 [phi:smc_flash::@14->smc_flash::@16#0] -- vbuz1=vbuc1 lda #0 sta.z smc_bytes_checksum - // [1632] phi smc_flash::smc_bram_ptr#10 = smc_flash::smc_bram_ptr#12 [phi:smc_flash::@14->smc_flash::@16#1] -- register_copy - // [1632] phi smc_flash::smc_package_flashed#2 = 0 [phi:smc_flash::@14->smc_flash::@16#2] -- vwuz1=vwuc1 + // [1824] phi smc_flash::smc_bram_ptr#10 = smc_flash::smc_bram_ptr#12 [phi:smc_flash::@14->smc_flash::@16#1] -- register_copy + // [1824] phi smc_flash::smc_package_flashed#2 = 0 [phi:smc_flash::@14->smc_flash::@16#2] -- vwuz1=vwuc1 sta.z smc_package_flashed sta.z smc_package_flashed+1 // smc_flash::@16 __b16: // while(smc_package_flashed < SMC_PROGRESS_CELL) - // [1633] if(smc_flash::smc_package_flashed#2smc_flash::@13] - // [1615] phi smc_flash::y#21 = smc_flash::y#21 [phi:smc_flash::@19->smc_flash::@13#0] -- register_copy - // [1615] phi smc_flash::smc_row_bytes#11 = smc_flash::smc_row_bytes#11 [phi:smc_flash::@19->smc_flash::@13#1] -- register_copy - // [1615] phi smc_flash::smc_bytes_flashed#12 = smc_flash::smc_bytes_flashed#12 [phi:smc_flash::@19->smc_flash::@13#2] -- register_copy - // [1615] phi smc_flash::smc_bram_ptr#12 = smc_flash::smc_bram_ptr#2 [phi:smc_flash::@19->smc_flash::@13#3] -- register_copy - // [1615] phi smc_flash::smc_attempts_flashed#15 = smc_flash::smc_attempts_flashed#1 [phi:smc_flash::@19->smc_flash::@13#4] -- register_copy - // [1615] phi smc_flash::smc_package_committed#10 = smc_flash::smc_package_committed#10 [phi:smc_flash::@19->smc_flash::@13#5] -- register_copy + // [1803] phi from smc_flash::@19 to smc_flash::@13 [phi:smc_flash::@19->smc_flash::@13] + // [1803] phi smc_flash::y#21 = smc_flash::y#21 [phi:smc_flash::@19->smc_flash::@13#0] -- register_copy + // [1803] phi smc_flash::smc_row_bytes#11 = smc_flash::smc_row_bytes#11 [phi:smc_flash::@19->smc_flash::@13#1] -- register_copy + // [1803] phi smc_flash::smc_flashed_bytes#11 = smc_flash::smc_flashed_bytes#11 [phi:smc_flash::@19->smc_flash::@13#2] -- register_copy + // [1803] phi smc_flash::smc_bram_ptr#12 = smc_flash::smc_bram_ptr#2 [phi:smc_flash::@19->smc_flash::@13#3] -- register_copy + // [1803] phi smc_flash::smc_attempts_flashed#15 = smc_flash::smc_attempts_flashed#1 [phi:smc_flash::@19->smc_flash::@13#4] -- register_copy + // [1803] phi smc_flash::smc_package_committed#10 = smc_flash::smc_package_committed#10 [phi:smc_flash::@19->smc_flash::@13#5] -- register_copy jmp __b13 // smc_flash::@20 __b20: // if (smc_row_bytes == SMC_PROGRESS_ROW) - // [1649] if(smc_flash::smc_row_bytes#11!=SMC_PROGRESS_ROW) goto smc_flash::@21 -- vwum1_neq_vwuc1_then_la1 + // [1841] if(smc_flash::smc_row_bytes#11!=SMC_PROGRESS_ROW) goto smc_flash::@21 -- vwum1_neq_vwuc1_then_la1 lda smc_row_bytes+1 cmp #>SMC_PROGRESS_ROW bne __b21 @@ -11363,49 +12115,48 @@ smc_flash: { bne __b21 // smc_flash::@22 // gotoxy(x, ++y); - // [1650] smc_flash::y#1 = ++ smc_flash::y#21 -- vbum1=_inc_vbum1 + // [1842] smc_flash::y#1 = ++ smc_flash::y#21 -- vbum1=_inc_vbum1 inc y // gotoxy(x, ++y) - // [1651] gotoxy::y#25 = smc_flash::y#1 -- vbum1=vbum2 + // [1843] gotoxy::y#25 = smc_flash::y#1 -- vbum1=vbum2 lda y sta gotoxy.y - // [1652] call gotoxy - // [778] phi from smc_flash::@22 to gotoxy [phi:smc_flash::@22->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#25 [phi:smc_flash::@22->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = PROGRESS_X [phi:smc_flash::@22->gotoxy#1] -- vbum1=vbuc1 - lda #PROGRESS_X - sta gotoxy.x + // [1844] call gotoxy + // [805] phi from smc_flash::@22 to gotoxy [phi:smc_flash::@22->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#25 [phi:smc_flash::@22->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = PROGRESS_X [phi:smc_flash::@22->gotoxy#1] -- vbuyy=vbuc1 + ldy #PROGRESS_X jsr gotoxy - // [1653] phi from smc_flash::@22 to smc_flash::@21 [phi:smc_flash::@22->smc_flash::@21] - // [1653] phi smc_flash::y#38 = smc_flash::y#1 [phi:smc_flash::@22->smc_flash::@21#0] -- register_copy - // [1653] phi smc_flash::smc_row_bytes#4 = 0 [phi:smc_flash::@22->smc_flash::@21#1] -- vwum1=vbuc1 + // [1845] phi from smc_flash::@22 to smc_flash::@21 [phi:smc_flash::@22->smc_flash::@21] + // [1845] phi smc_flash::y#38 = smc_flash::y#1 [phi:smc_flash::@22->smc_flash::@21#0] -- register_copy + // [1845] phi smc_flash::smc_row_bytes#4 = 0 [phi:smc_flash::@22->smc_flash::@21#1] -- vwum1=vbuc1 lda #<0 sta smc_row_bytes sta smc_row_bytes+1 - // [1653] phi from smc_flash::@20 to smc_flash::@21 [phi:smc_flash::@20->smc_flash::@21] - // [1653] phi smc_flash::y#38 = smc_flash::y#21 [phi:smc_flash::@20->smc_flash::@21#0] -- register_copy - // [1653] phi smc_flash::smc_row_bytes#4 = smc_flash::smc_row_bytes#11 [phi:smc_flash::@20->smc_flash::@21#1] -- register_copy + // [1845] phi from smc_flash::@20 to smc_flash::@21 [phi:smc_flash::@20->smc_flash::@21] + // [1845] phi smc_flash::y#38 = smc_flash::y#21 [phi:smc_flash::@20->smc_flash::@21#0] -- register_copy + // [1845] phi smc_flash::smc_row_bytes#4 = smc_flash::smc_row_bytes#11 [phi:smc_flash::@20->smc_flash::@21#1] -- register_copy // smc_flash::@21 __b21: // cputc('+') - // [1654] stackpush(char) = '+' -- _stackpushbyte_=vbuc1 + // [1846] stackpush(char) = '+' -- _stackpushbyte_=vbuc1 lda #'+' pha - // [1655] callexecute cputc -- call_vprc1 + // [1847] callexecute cputc -- call_vprc1 jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla - // smc_bytes_flashed += SMC_PROGRESS_CELL - // [1657] smc_flash::smc_bytes_flashed#1 = smc_flash::smc_bytes_flashed#12 + SMC_PROGRESS_CELL -- vwum1=vwum1_plus_vbuc1 + // smc_flashed_bytes += SMC_PROGRESS_CELL + // [1849] smc_flash::smc_flashed_bytes#1 = smc_flash::smc_flashed_bytes#11 + SMC_PROGRESS_CELL -- vwum1=vwum1_plus_vbuc1 lda #SMC_PROGRESS_CELL clc - adc smc_bytes_flashed - sta smc_bytes_flashed + adc smc_flashed_bytes + sta smc_flashed_bytes bcc !+ - inc smc_bytes_flashed+1 + inc smc_flashed_bytes+1 !: // smc_row_bytes += SMC_PROGRESS_CELL - // [1658] smc_flash::smc_row_bytes#1 = smc_flash::smc_row_bytes#4 + SMC_PROGRESS_CELL -- vwum1=vwum1_plus_vbuc1 + // [1850] smc_flash::smc_row_bytes#1 = smc_flash::smc_row_bytes#4 + SMC_PROGRESS_CELL -- vwum1=vwum1_plus_vbuc1 lda #SMC_PROGRESS_CELL clc adc smc_row_bytes @@ -11413,48 +12164,51 @@ smc_flash: { bcc !+ inc smc_row_bytes+1 !: - // [1615] phi from smc_flash::@21 to smc_flash::@13 [phi:smc_flash::@21->smc_flash::@13] - // [1615] phi smc_flash::y#21 = smc_flash::y#38 [phi:smc_flash::@21->smc_flash::@13#0] -- register_copy - // [1615] phi smc_flash::smc_row_bytes#11 = smc_flash::smc_row_bytes#1 [phi:smc_flash::@21->smc_flash::@13#1] -- register_copy - // [1615] phi smc_flash::smc_bytes_flashed#12 = smc_flash::smc_bytes_flashed#1 [phi:smc_flash::@21->smc_flash::@13#2] -- register_copy - // [1615] phi smc_flash::smc_bram_ptr#12 = smc_flash::smc_bram_ptr#10 [phi:smc_flash::@21->smc_flash::@13#3] -- register_copy - // [1615] phi smc_flash::smc_attempts_flashed#15 = smc_flash::smc_attempts_flashed#15 [phi:smc_flash::@21->smc_flash::@13#4] -- register_copy - // [1615] phi smc_flash::smc_package_committed#10 = 1 [phi:smc_flash::@21->smc_flash::@13#5] -- vbum1=vbuc1 + // [1803] phi from smc_flash::@21 to smc_flash::@13 [phi:smc_flash::@21->smc_flash::@13] + // [1803] phi smc_flash::y#21 = smc_flash::y#38 [phi:smc_flash::@21->smc_flash::@13#0] -- register_copy + // [1803] phi smc_flash::smc_row_bytes#11 = smc_flash::smc_row_bytes#1 [phi:smc_flash::@21->smc_flash::@13#1] -- register_copy + // [1803] phi smc_flash::smc_flashed_bytes#11 = smc_flash::smc_flashed_bytes#1 [phi:smc_flash::@21->smc_flash::@13#2] -- register_copy + // [1803] phi smc_flash::smc_bram_ptr#12 = smc_flash::smc_bram_ptr#10 [phi:smc_flash::@21->smc_flash::@13#3] -- register_copy + // [1803] phi smc_flash::smc_attempts_flashed#15 = smc_flash::smc_attempts_flashed#15 [phi:smc_flash::@21->smc_flash::@13#4] -- register_copy + // [1803] phi smc_flash::smc_package_committed#10 = 1 [phi:smc_flash::@21->smc_flash::@13#5] -- vbum1=vbuc1 lda #1 sta smc_package_committed jmp __b13 // smc_flash::@17 __b17: // unsigned char smc_byte_upload = *smc_bram_ptr - // [1659] smc_flash::smc_byte_upload#0 = *smc_flash::smc_bram_ptr#10 -- vbuz1=_deref_pbuz2 + // [1851] smc_flash::smc_byte_upload#0 = *smc_flash::smc_bram_ptr#10 -- vbuxx=_deref_pbum1 + ldy smc_bram_ptr + sty.z $fe + ldy smc_bram_ptr+1 + sty.z $ff ldy #0 - lda (smc_bram_ptr),y - sta.z smc_byte_upload + lda ($fe),y + tax // smc_bram_ptr++; - // [1660] smc_flash::smc_bram_ptr#1 = ++ smc_flash::smc_bram_ptr#10 -- pbuz1=_inc_pbuz1 - inc.z smc_bram_ptr + // [1852] smc_flash::smc_bram_ptr#1 = ++ smc_flash::smc_bram_ptr#10 -- pbum1=_inc_pbum1 + inc smc_bram_ptr bne !+ - inc.z smc_bram_ptr+1 + inc smc_bram_ptr+1 !: // smc_bytes_checksum += smc_byte_upload - // [1661] smc_flash::smc_bytes_checksum#1 = smc_flash::smc_bytes_checksum#2 + smc_flash::smc_byte_upload#0 -- vbuz1=vbuz1_plus_vbuz2 - lda.z smc_bytes_checksum + // [1853] smc_flash::smc_bytes_checksum#1 = smc_flash::smc_bytes_checksum#2 + smc_flash::smc_byte_upload#0 -- vbuz1=vbuz1_plus_vbuxx + txa clc - adc.z smc_byte_upload + adc.z smc_bytes_checksum sta.z smc_bytes_checksum // unsigned char smc_upload_result = cx16_k_i2c_write_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_UPLOAD, smc_byte_upload) - // [1662] smc_flash::cx16_k_i2c_write_byte3_device = $42 -- vbum1=vbuc1 + // [1854] smc_flash::cx16_k_i2c_write_byte3_device = $42 -- vbum1=vbuc1 lda #$42 sta cx16_k_i2c_write_byte3_device - // [1663] smc_flash::cx16_k_i2c_write_byte3_offset = $80 -- vbum1=vbuc1 + // [1855] smc_flash::cx16_k_i2c_write_byte3_offset = $80 -- vbum1=vbuc1 lda #$80 sta cx16_k_i2c_write_byte3_offset - // [1664] smc_flash::cx16_k_i2c_write_byte3_value = smc_flash::smc_byte_upload#0 -- vbum1=vbuz2 - lda.z smc_byte_upload - sta cx16_k_i2c_write_byte3_value + // [1856] smc_flash::cx16_k_i2c_write_byte3_value = smc_flash::smc_byte_upload#0 -- vbum1=vbuxx + stx cx16_k_i2c_write_byte3_value // smc_flash::cx16_k_i2c_write_byte3 // unsigned char result - // [1665] smc_flash::cx16_k_i2c_write_byte3_result = 0 -- vbum1=vbuc1 + // [1857] smc_flash::cx16_k_i2c_write_byte3_result = 0 -- vbum1=vbuc1 lda #0 sta cx16_k_i2c_write_byte3_result // asm @@ -11465,231 +12219,227 @@ smc_flash: { stz cx16_k_i2c_write_byte3_result jsr CX16_I2C_WRITE_BYTE rol cx16_k_i2c_write_byte3_result - // smc_flash::@26 + // smc_flash::@27 // smc_package_flashed++; - // [1667] smc_flash::smc_package_flashed#1 = ++ smc_flash::smc_package_flashed#2 -- vwuz1=_inc_vwuz1 + // [1859] smc_flash::smc_package_flashed#1 = ++ smc_flash::smc_package_flashed#2 -- vwuz1=_inc_vwuz1 inc.z smc_package_flashed bne !+ inc.z smc_package_flashed+1 !: - // [1632] phi from smc_flash::@26 to smc_flash::@16 [phi:smc_flash::@26->smc_flash::@16] - // [1632] phi smc_flash::smc_bytes_checksum#2 = smc_flash::smc_bytes_checksum#1 [phi:smc_flash::@26->smc_flash::@16#0] -- register_copy - // [1632] phi smc_flash::smc_bram_ptr#10 = smc_flash::smc_bram_ptr#1 [phi:smc_flash::@26->smc_flash::@16#1] -- register_copy - // [1632] phi smc_flash::smc_package_flashed#2 = smc_flash::smc_package_flashed#1 [phi:smc_flash::@26->smc_flash::@16#2] -- register_copy + // [1824] phi from smc_flash::@27 to smc_flash::@16 [phi:smc_flash::@27->smc_flash::@16] + // [1824] phi smc_flash::smc_bytes_checksum#2 = smc_flash::smc_bytes_checksum#1 [phi:smc_flash::@27->smc_flash::@16#0] -- register_copy + // [1824] phi smc_flash::smc_bram_ptr#10 = smc_flash::smc_bram_ptr#1 [phi:smc_flash::@27->smc_flash::@16#1] -- register_copy + // [1824] phi smc_flash::smc_package_flashed#2 = smc_flash::smc_package_flashed#1 [phi:smc_flash::@27->smc_flash::@16#2] -- register_copy jmp __b16 - // [1668] phi from smc_flash::@7 to smc_flash::@8 [phi:smc_flash::@7->smc_flash::@8] + // [1860] phi from smc_flash::@7 to smc_flash::@8 [phi:smc_flash::@7->smc_flash::@8] // smc_flash::@8 __b8: // wait_moment(1) - // [1669] call wait_moment - // [1063] phi from smc_flash::@8 to wait_moment [phi:smc_flash::@8->wait_moment] - // [1063] phi wait_moment::w#7 = 1 [phi:smc_flash::@8->wait_moment#0] -- vbum1=vbuc1 + // [1861] call wait_moment + // [1134] phi from smc_flash::@8 to wait_moment [phi:smc_flash::@8->wait_moment] + // [1134] phi wait_moment::w#17 = 1 [phi:smc_flash::@8->wait_moment#0] -- vbuz1=vbuc1 lda #1 - sta wait_moment.w + sta.z wait_moment.w jsr wait_moment - // [1670] phi from smc_flash::@8 to smc_flash::@39 [phi:smc_flash::@8->smc_flash::@39] - // smc_flash::@39 + // [1862] phi from smc_flash::@8 to smc_flash::@40 [phi:smc_flash::@8->smc_flash::@40] + // smc_flash::@40 // sprintf(info_text, "Updating SMC in %u ...", smc_bootloader_activation_countdown) - // [1671] call snprintf_init - // [1113] phi from smc_flash::@39 to snprintf_init [phi:smc_flash::@39->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:smc_flash::@39->snprintf_init#0] -- pbuz1=pbuc1 + // [1863] call snprintf_init + // [1184] phi from smc_flash::@40 to snprintf_init [phi:smc_flash::@40->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:smc_flash::@40->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [1672] phi from smc_flash::@39 to smc_flash::@40 [phi:smc_flash::@39->smc_flash::@40] - // smc_flash::@40 + // [1864] phi from smc_flash::@40 to smc_flash::@41 [phi:smc_flash::@40->smc_flash::@41] + // smc_flash::@41 // sprintf(info_text, "Updating SMC in %u ...", smc_bootloader_activation_countdown) - // [1673] call printf_str - // [1054] phi from smc_flash::@40 to printf_str [phi:smc_flash::@40->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:smc_flash::@40->printf_str#0] -- pprz1=pprc1 + // [1865] call printf_str + // [1125] phi from smc_flash::@41 to printf_str [phi:smc_flash::@41->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:smc_flash::@41->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = smc_flash::s3 [phi:smc_flash::@40->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = smc_flash::s3 [phi:smc_flash::@41->printf_str#1] -- pbuz1=pbuc1 lda #s3 sta.z printf_str.s+1 jsr printf_str - // smc_flash::@41 + // smc_flash::@42 // sprintf(info_text, "Updating SMC in %u ...", smc_bootloader_activation_countdown) - // [1674] printf_uchar::uvalue#11 = smc_flash::smc_bootloader_activation_countdown#12 -- vbum1=vbum2 - lda smc_bootloader_activation_countdown_1 - sta printf_uchar.uvalue - // [1675] call printf_uchar - // [1118] phi from smc_flash::@41 to printf_uchar [phi:smc_flash::@41->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 0 [phi:smc_flash::@41->printf_uchar#0] -- vbum1=vbuc1 + // [1866] printf_uchar::uvalue#8 = smc_flash::smc_bootloader_activation_countdown#12 -- vbuxx=vbum1 + ldx smc_bootloader_activation_countdown_1 + // [1867] call printf_uchar + // [1189] phi from smc_flash::@42 to printf_uchar [phi:smc_flash::@42->printf_uchar] + // [1189] phi printf_uchar::format_zero_padding#15 = 0 [phi:smc_flash::@42->printf_uchar#0] -- vbum1=vbuc1 lda #0 sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 0 [phi:smc_flash::@41->printf_uchar#1] -- vbum1=vbuc1 + // [1189] phi printf_uchar::format_min_length#15 = 0 [phi:smc_flash::@42->printf_uchar#1] -- vbum1=vbuc1 sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &snputc [phi:smc_flash::@41->printf_uchar#2] -- pprz1=pprc1 + // [1189] phi printf_uchar::putc#15 = &snputc [phi:smc_flash::@42->printf_uchar#2] -- pprz1=pprc1 lda #snputc sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = DECIMAL [phi:smc_flash::@41->printf_uchar#3] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = printf_uchar::uvalue#11 [phi:smc_flash::@41->printf_uchar#4] -- register_copy + // [1189] phi printf_uchar::format_radix#15 = DECIMAL [phi:smc_flash::@42->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL + // [1189] phi printf_uchar::uvalue#15 = printf_uchar::uvalue#8 [phi:smc_flash::@42->printf_uchar#4] -- register_copy jsr printf_uchar - // [1676] phi from smc_flash::@41 to smc_flash::@42 [phi:smc_flash::@41->smc_flash::@42] - // smc_flash::@42 + // [1868] phi from smc_flash::@42 to smc_flash::@43 [phi:smc_flash::@42->smc_flash::@43] + // smc_flash::@43 // sprintf(info_text, "Updating SMC in %u ...", smc_bootloader_activation_countdown) - // [1677] call printf_str - // [1054] phi from smc_flash::@42 to printf_str [phi:smc_flash::@42->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:smc_flash::@42->printf_str#0] -- pprz1=pprc1 + // [1869] call printf_str + // [1125] phi from smc_flash::@43 to printf_str [phi:smc_flash::@43->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:smc_flash::@43->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s4 [phi:smc_flash::@42->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s4 [phi:smc_flash::@43->printf_str#1] -- pbuz1=pbuc1 lda #s4 sta.z printf_str.s+1 jsr printf_str - // smc_flash::@43 + // smc_flash::@44 // sprintf(info_text, "Updating SMC in %u ...", smc_bootloader_activation_countdown) - // [1678] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [1870] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [1679] callexecute snputc -- call_vprc1 + // [1871] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [1681] call display_action_text - // [1129] phi from smc_flash::@43 to display_action_text [phi:smc_flash::@43->display_action_text] - // [1129] phi display_action_text::info_text#17 = info_text [phi:smc_flash::@43->display_action_text#0] -- pbuz1=pbuc1 + // [1873] call display_action_text + // [1200] phi from smc_flash::@44 to display_action_text [phi:smc_flash::@44->display_action_text] + // [1200] phi display_action_text::info_text#25 = info_text [phi:smc_flash::@44->display_action_text#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_action_text.info_text lda #>@info_text sta.z display_action_text.info_text+1 jsr display_action_text - // smc_flash::@44 + // smc_flash::@45 // smc_bootloader_activation_countdown--; - // [1682] smc_flash::smc_bootloader_activation_countdown#3 = -- smc_flash::smc_bootloader_activation_countdown#12 -- vbum1=_dec_vbum1 + // [1874] smc_flash::smc_bootloader_activation_countdown#3 = -- smc_flash::smc_bootloader_activation_countdown#12 -- vbum1=_dec_vbum1 dec smc_bootloader_activation_countdown_1 - // [1587] phi from smc_flash::@44 to smc_flash::@7 [phi:smc_flash::@44->smc_flash::@7] - // [1587] phi smc_flash::smc_bootloader_activation_countdown#12 = smc_flash::smc_bootloader_activation_countdown#3 [phi:smc_flash::@44->smc_flash::@7#0] -- register_copy + // [1773] phi from smc_flash::@45 to smc_flash::@7 [phi:smc_flash::@45->smc_flash::@7] + // [1773] phi smc_flash::smc_bootloader_activation_countdown#12 = smc_flash::smc_bootloader_activation_countdown#3 [phi:smc_flash::@45->smc_flash::@7#0] -- register_copy jmp __b7 // smc_flash::@4 __b4: // unsigned int smc_bootloader_not_activated = cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_OFFSET) - // [1683] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 + // [1875] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 lda #$42 sta cx16_k_i2c_read_byte.device - // [1684] cx16_k_i2c_read_byte::offset = $8e -- vbum1=vbuc1 + // [1876] cx16_k_i2c_read_byte::offset = $8e -- vbum1=vbuc1 lda #$8e sta cx16_k_i2c_read_byte.offset - // [1685] call cx16_k_i2c_read_byte + // [1877] call cx16_k_i2c_read_byte jsr cx16_k_i2c_read_byte - // [1686] cx16_k_i2c_read_byte::return#11 = cx16_k_i2c_read_byte::return#1 - // smc_flash::@33 - // [1687] smc_flash::smc_bootloader_not_activated1#0 = cx16_k_i2c_read_byte::return#11 -- vwum1=vwum2 + // [1878] cx16_k_i2c_read_byte::return#11 = cx16_k_i2c_read_byte::return#1 + // smc_flash::@34 + // [1879] smc_flash::smc_bootloader_not_activated1#0 = cx16_k_i2c_read_byte::return#11 -- vwum1=vwum2 lda cx16_k_i2c_read_byte.return sta smc_bootloader_not_activated1 lda cx16_k_i2c_read_byte.return+1 sta smc_bootloader_not_activated1+1 // if(smc_bootloader_not_activated) - // [1688] if(0!=smc_flash::smc_bootloader_not_activated1#0) goto smc_flash::@5 -- 0_neq_vwum1_then_la1 + // [1880] if(0!=smc_flash::smc_bootloader_not_activated1#0) goto smc_flash::@5 -- 0_neq_vwum1_then_la1 lda smc_bootloader_not_activated1 ora smc_bootloader_not_activated1+1 bne __b5 jmp __b9 - // [1689] phi from smc_flash::@33 to smc_flash::@5 [phi:smc_flash::@33->smc_flash::@5] + // [1881] phi from smc_flash::@34 to smc_flash::@5 [phi:smc_flash::@34->smc_flash::@5] // smc_flash::@5 __b5: // wait_moment(1) - // [1690] call wait_moment - // [1063] phi from smc_flash::@5 to wait_moment [phi:smc_flash::@5->wait_moment] - // [1063] phi wait_moment::w#7 = 1 [phi:smc_flash::@5->wait_moment#0] -- vbum1=vbuc1 + // [1882] call wait_moment + // [1134] phi from smc_flash::@5 to wait_moment [phi:smc_flash::@5->wait_moment] + // [1134] phi wait_moment::w#17 = 1 [phi:smc_flash::@5->wait_moment#0] -- vbuz1=vbuc1 lda #1 - sta wait_moment.w + sta.z wait_moment.w jsr wait_moment - // [1691] phi from smc_flash::@5 to smc_flash::@34 [phi:smc_flash::@5->smc_flash::@34] - // smc_flash::@34 + // [1883] phi from smc_flash::@5 to smc_flash::@35 [phi:smc_flash::@5->smc_flash::@35] + // smc_flash::@35 // sprintf(info_text, "[%03u] Press POWER and RESET on the CX16 to start the SMC update!", smc_bootloader_activation_countdown) - // [1692] call snprintf_init - // [1113] phi from smc_flash::@34 to snprintf_init [phi:smc_flash::@34->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:smc_flash::@34->snprintf_init#0] -- pbuz1=pbuc1 + // [1884] call snprintf_init + // [1184] phi from smc_flash::@35 to snprintf_init [phi:smc_flash::@35->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:smc_flash::@35->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [1693] phi from smc_flash::@34 to smc_flash::@35 [phi:smc_flash::@34->smc_flash::@35] - // smc_flash::@35 + // [1885] phi from smc_flash::@35 to smc_flash::@36 [phi:smc_flash::@35->smc_flash::@36] + // smc_flash::@36 // sprintf(info_text, "[%03u] Press POWER and RESET on the CX16 to start the SMC update!", smc_bootloader_activation_countdown) - // [1694] call printf_str - // [1054] phi from smc_flash::@35 to printf_str [phi:smc_flash::@35->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:smc_flash::@35->printf_str#0] -- pprz1=pprc1 + // [1886] call printf_str + // [1125] phi from smc_flash::@36 to printf_str [phi:smc_flash::@36->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:smc_flash::@36->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s1 [phi:smc_flash::@35->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s1 [phi:smc_flash::@36->printf_str#1] -- pbuz1=pbuc1 lda #s1 sta.z printf_str.s+1 jsr printf_str - // smc_flash::@36 + // smc_flash::@37 // sprintf(info_text, "[%03u] Press POWER and RESET on the CX16 to start the SMC update!", smc_bootloader_activation_countdown) - // [1695] printf_uchar::uvalue#10 = smc_flash::smc_bootloader_activation_countdown#10 -- vbum1=vbum2 - lda smc_bootloader_activation_countdown - sta printf_uchar.uvalue - // [1696] call printf_uchar - // [1118] phi from smc_flash::@36 to printf_uchar [phi:smc_flash::@36->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 1 [phi:smc_flash::@36->printf_uchar#0] -- vbum1=vbuc1 + // [1887] printf_uchar::uvalue#7 = smc_flash::smc_bootloader_activation_countdown#10 -- vbuxx=vbum1 + ldx smc_bootloader_activation_countdown + // [1888] call printf_uchar + // [1189] phi from smc_flash::@37 to printf_uchar [phi:smc_flash::@37->printf_uchar] + // [1189] phi printf_uchar::format_zero_padding#15 = 1 [phi:smc_flash::@37->printf_uchar#0] -- vbum1=vbuc1 lda #1 sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 3 [phi:smc_flash::@36->printf_uchar#1] -- vbum1=vbuc1 + // [1189] phi printf_uchar::format_min_length#15 = 3 [phi:smc_flash::@37->printf_uchar#1] -- vbum1=vbuc1 lda #3 sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &snputc [phi:smc_flash::@36->printf_uchar#2] -- pprz1=pprc1 + // [1189] phi printf_uchar::putc#15 = &snputc [phi:smc_flash::@37->printf_uchar#2] -- pprz1=pprc1 lda #snputc sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = DECIMAL [phi:smc_flash::@36->printf_uchar#3] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = printf_uchar::uvalue#10 [phi:smc_flash::@36->printf_uchar#4] -- register_copy + // [1189] phi printf_uchar::format_radix#15 = DECIMAL [phi:smc_flash::@37->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL + // [1189] phi printf_uchar::uvalue#15 = printf_uchar::uvalue#7 [phi:smc_flash::@37->printf_uchar#4] -- register_copy jsr printf_uchar - // [1697] phi from smc_flash::@36 to smc_flash::@37 [phi:smc_flash::@36->smc_flash::@37] - // smc_flash::@37 + // [1889] phi from smc_flash::@37 to smc_flash::@38 [phi:smc_flash::@37->smc_flash::@38] + // smc_flash::@38 // sprintf(info_text, "[%03u] Press POWER and RESET on the CX16 to start the SMC update!", smc_bootloader_activation_countdown) - // [1698] call printf_str - // [1054] phi from smc_flash::@37 to printf_str [phi:smc_flash::@37->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:smc_flash::@37->printf_str#0] -- pprz1=pprc1 + // [1890] call printf_str + // [1125] phi from smc_flash::@38 to printf_str [phi:smc_flash::@38->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:smc_flash::@38->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = smc_flash::s2 [phi:smc_flash::@37->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = smc_flash::s2 [phi:smc_flash::@38->printf_str#1] -- pbuz1=pbuc1 lda #s2 sta.z printf_str.s+1 jsr printf_str - // smc_flash::@38 + // smc_flash::@39 // sprintf(info_text, "[%03u] Press POWER and RESET on the CX16 to start the SMC update!", smc_bootloader_activation_countdown) - // [1699] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [1891] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [1700] callexecute snputc -- call_vprc1 + // [1892] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [1702] call display_action_text - // [1129] phi from smc_flash::@38 to display_action_text [phi:smc_flash::@38->display_action_text] - // [1129] phi display_action_text::info_text#17 = info_text [phi:smc_flash::@38->display_action_text#0] -- pbuz1=pbuc1 + // [1894] call display_action_text + // [1200] phi from smc_flash::@39 to display_action_text [phi:smc_flash::@39->display_action_text] + // [1200] phi display_action_text::info_text#25 = info_text [phi:smc_flash::@39->display_action_text#0] -- pbuz1=pbuc1 lda #<@info_text sta.z display_action_text.info_text lda #>@info_text @@ -11697,10 +12447,10 @@ smc_flash: { jsr display_action_text // smc_flash::@6 // smc_bootloader_activation_countdown--; - // [1703] smc_flash::smc_bootloader_activation_countdown#2 = -- smc_flash::smc_bootloader_activation_countdown#10 -- vbum1=_dec_vbum1 + // [1895] smc_flash::smc_bootloader_activation_countdown#2 = -- smc_flash::smc_bootloader_activation_countdown#10 -- vbum1=_dec_vbum1 dec smc_bootloader_activation_countdown - // [1585] phi from smc_flash::@6 to smc_flash::@3 [phi:smc_flash::@6->smc_flash::@3] - // [1585] phi smc_flash::smc_bootloader_activation_countdown#10 = smc_flash::smc_bootloader_activation_countdown#2 [phi:smc_flash::@6->smc_flash::@3#0] -- register_copy + // [1771] phi from smc_flash::@6 to smc_flash::@3 [phi:smc_flash::@6->smc_flash::@3] + // [1771] phi smc_flash::smc_bootloader_activation_countdown#10 = smc_flash::smc_bootloader_activation_countdown#2 [phi:smc_flash::@6->smc_flash::@3#0] -- register_copy jmp __b3 .segment Data info_text: .text "To start the SMC update, do the following ..." @@ -11735,20 +12485,20 @@ smc_flash: { cx16_k_i2c_write_byte4_offset: .byte 0 cx16_k_i2c_write_byte4_value: .byte 0 cx16_k_i2c_write_byte4_result: .byte 0 - cx16_k_i2c_write_byte1_return: .byte 0 return: .word 0 - .label smc_bootloader_not_activated1 = fopen.cbm_k_setnam1_fopen__0 + smc_bootloader_not_activated1: .word 0 // Waiting a bit to ensure the bootloader is activated. - .label smc_bootloader_activation_countdown = main.check_status_cx16_rom1_check_status_rom1_main__0 + .label smc_bootloader_activation_countdown = main.check_status_smc17_return // Waiting a bit to ensure the bootloader is activated. - .label smc_bootloader_activation_countdown_1 = main.check_status_smc4_main__0 + .label smc_bootloader_activation_countdown_1 = main.check_status_vera11_return + .label smc_bram_ptr = main.main__50 smc_commit_result: .word 0 - .label smc_attempts_flashed = main.check_status_cx16_rom3_check_status_rom1_main__0 - .label smc_bytes_flashed = return + .label smc_attempts_flashed = main.main__107 + .label smc_flashed_bytes = return .label smc_row_bytes = smc_read.smc_file_read - .label y = main.check_status_cx16_rom2_check_status_rom1_main__0 - .label smc_bytes_total = util_wait_key.ch - .label smc_package_committed = main.check_status_smc5_main__0 + .label y = main.check_status_vera4_return + .label smc_bytes_total = fopen.fopen__11 + .label smc_package_committed = main.check_status_smc10_return } .segment Code // util_wait_key @@ -11759,71 +12509,65 @@ smc_flash: { * @param filter * @return unsigned char */ -// __mem() char util_wait_key(__zp($c1) char *info_text, __zp($41) char *filter) +// __register(A) char util_wait_key(__zp($7e) char *info_text, __zp($32) char *filter) util_wait_key: { .const bank_set_bram1_bank = 0 .const bank_set_brom1_bank = 4 - .label util_wait_key__10 = $ba - .label bram = $ed - .label brom = $44 - .label return = $c0 - .label info_text = $c1 - .label return_1 = $6a - .label return_2 = $c9 - .label return_3 = $cd - .label filter = $41 + .label util_wait_key__10 = $78 + .label bram = $d2 + .label info_text = $7e + .label filter = $32 // display_action_text(info_text) - // [1705] display_action_text::info_text#0 = util_wait_key::info_text#6 - // [1706] call display_action_text - // [1129] phi from util_wait_key to display_action_text [phi:util_wait_key->display_action_text] - // [1129] phi display_action_text::info_text#17 = display_action_text::info_text#0 [phi:util_wait_key->display_action_text#0] -- register_copy + // [1897] display_action_text::info_text#0 = util_wait_key::info_text#6 + // [1898] call display_action_text + // [1200] phi from util_wait_key to display_action_text [phi:util_wait_key->display_action_text] + // [1200] phi display_action_text::info_text#25 = display_action_text::info_text#0 [phi:util_wait_key->display_action_text#0] -- register_copy jsr display_action_text // util_wait_key::bank_get_bram1 // return BRAM; - // [1707] util_wait_key::bram#0 = BRAM -- vbuz1=vbuz2 + // [1899] util_wait_key::bram#0 = BRAM -- vbuz1=vbuz2 lda.z BRAM sta.z bram // util_wait_key::bank_get_brom1 // return BROM; - // [1708] util_wait_key::brom#0 = BROM -- vbuz1=vbuz2 + // [1900] util_wait_key::brom#0 = BROM -- vbum1=vbuz2 lda.z BROM - sta.z brom + sta brom // util_wait_key::bank_set_bram1 // BRAM = bank - // [1709] BRAM = util_wait_key::bank_set_bram1_bank#0 -- vbuz1=vbuc1 + // [1901] BRAM = util_wait_key::bank_set_bram1_bank#0 -- vbuz1=vbuc1 lda #bank_set_bram1_bank sta.z BRAM // util_wait_key::bank_set_brom1 // BROM = bank - // [1710] BROM = util_wait_key::bank_set_brom1_bank#0 -- vbuz1=vbuc1 + // [1902] BROM = util_wait_key::bank_set_brom1_bank#0 -- vbuz1=vbuc1 lda #bank_set_brom1_bank sta.z BROM // util_wait_key::CLI1 // asm // asm { cli } cli - // [1712] phi from util_wait_key::@2 util_wait_key::@5 util_wait_key::CLI1 to util_wait_key::kbhit1 [phi:util_wait_key::@2/util_wait_key::@5/util_wait_key::CLI1->util_wait_key::kbhit1] + // [1904] phi from util_wait_key::@2 util_wait_key::@5 util_wait_key::CLI1 to util_wait_key::kbhit1 [phi:util_wait_key::@2/util_wait_key::@5/util_wait_key::CLI1->util_wait_key::kbhit1] // util_wait_key::kbhit1 kbhit1: // util_wait_key::kbhit1_cbm_k_clrchn1 // asm // asm { jsrCBM_CLRCHN } jsr CBM_CLRCHN - // [1714] phi from util_wait_key::kbhit1_cbm_k_clrchn1 to util_wait_key::kbhit1_@2 [phi:util_wait_key::kbhit1_cbm_k_clrchn1->util_wait_key::kbhit1_@2] + // [1906] phi from util_wait_key::kbhit1_cbm_k_clrchn1 to util_wait_key::kbhit1_@2 [phi:util_wait_key::kbhit1_cbm_k_clrchn1->util_wait_key::kbhit1_@2] // util_wait_key::kbhit1_@2 // cbm_k_getin() - // [1715] call cbm_k_getin + // [1907] call cbm_k_getin jsr cbm_k_getin - // [1716] cbm_k_getin::return#2 = cbm_k_getin::return#1 + // [1908] cbm_k_getin::return#2 = cbm_k_getin::return#1 // util_wait_key::@4 - // [1717] util_wait_key::ch#4 = cbm_k_getin::return#2 -- vwum1=vbum2 - lda cbm_k_getin.return + // [1909] util_wait_key::ch#4 = cbm_k_getin::return#2 -- vwum1=vbuaa sta ch lda #0 sta ch+1 // util_wait_key::@3 // if (filter) - // [1718] if((char *)0!=util_wait_key::filter#16) goto util_wait_key::@1 -- pbuc1_neq_pbuz1_then_la1 + // [1910] if((char *)0!=util_wait_key::filter#16) goto util_wait_key::@1 -- pbuc1_neq_pbuz1_then_la1 // if there is a filter, check the filter, otherwise return ch. lda.z filter+1 cmp #>0 @@ -11833,7 +12577,7 @@ util_wait_key: { bne __b1 // util_wait_key::@2 // if(ch) - // [1719] if(0!=util_wait_key::ch#4) goto util_wait_key::bank_set_bram2 -- 0_neq_vwum1_then_la1 + // [1911] if(0!=util_wait_key::ch#4) goto util_wait_key::bank_set_bram2 -- 0_neq_vwum1_then_la1 lda ch ora ch+1 bne bank_set_bram2 @@ -11841,47 +12585,47 @@ util_wait_key: { // util_wait_key::bank_set_bram2 bank_set_bram2: // BRAM = bank - // [1720] BRAM = util_wait_key::bram#0 -- vbuz1=vbuz2 + // [1912] BRAM = util_wait_key::bram#0 -- vbuz1=vbuz2 lda.z bram sta.z BRAM // util_wait_key::bank_set_brom2 // BROM = bank - // [1721] BROM = util_wait_key::brom#0 -- vbuz1=vbuz2 - lda.z brom + // [1913] BROM = util_wait_key::brom#0 -- vbuz1=vbum2 + lda brom sta.z BROM // util_wait_key::@return // } - // [1722] return + // [1914] return rts // util_wait_key::@1 __b1: // strchr(filter, ch) - // [1723] strchr::str#0 = (const void *)util_wait_key::filter#16 -- pvoz1=pvoz2 + // [1915] strchr::str#0 = (const void *)util_wait_key::filter#16 -- pvoz1=pvoz2 lda.z filter sta.z strchr.str lda.z filter+1 sta.z strchr.str+1 - // [1724] strchr::c#0 = util_wait_key::ch#4 -- vbum1=vwum2 + // [1916] strchr::c#0 = util_wait_key::ch#4 -- vbum1=vwum2 lda ch sta strchr.c - // [1725] call strchr - // [1729] phi from util_wait_key::@1 to strchr [phi:util_wait_key::@1->strchr] - // [1729] phi strchr::c#4 = strchr::c#0 [phi:util_wait_key::@1->strchr#0] -- register_copy - // [1729] phi strchr::str#2 = strchr::str#0 [phi:util_wait_key::@1->strchr#1] -- register_copy + // [1917] call strchr + // [1921] phi from util_wait_key::@1 to strchr [phi:util_wait_key::@1->strchr] + // [1921] phi strchr::c#4 = strchr::c#0 [phi:util_wait_key::@1->strchr#0] -- register_copy + // [1921] phi strchr::str#2 = strchr::str#0 [phi:util_wait_key::@1->strchr#1] -- register_copy jsr strchr // strchr(filter, ch) - // [1726] strchr::return#3 = strchr::return#2 + // [1918] strchr::return#3 = strchr::return#2 // util_wait_key::@5 - // [1727] util_wait_key::$10 = strchr::return#3 + // [1919] util_wait_key::$10 = strchr::return#3 // if(strchr(filter, ch) != NULL) - // [1728] if(util_wait_key::$10!=0) goto util_wait_key::bank_set_bram2 -- pvoz1_neq_0_then_la1 + // [1920] if(util_wait_key::$10!=0) goto util_wait_key::bank_set_bram2 -- pvoz1_neq_0_then_la1 lda.z util_wait_key__10 ora.z util_wait_key__10+1 bne bank_set_bram2 jmp kbhit1 .segment Data + brom: .byte 0 ch: .word 0 - return_4: .byte 0 } .segment Code // strchr @@ -11889,55 +12633,55 @@ util_wait_key: { // - str: The memory to search // - c: A character to search for // Return: A pointer to the matching byte or NULL if the character does not occur in the given memory area. -// __zp($ba) void * strchr(__zp($ba) const void *str, __mem() char c) +// __zp($78) void * strchr(__zp($78) const void *str, __mem() char c) strchr: { - .label ptr = $ba - .label return = $ba - .label str = $ba - // [1730] strchr::ptr#6 = (char *)strchr::str#2 - // [1731] phi from strchr strchr::@3 to strchr::@1 [phi:strchr/strchr::@3->strchr::@1] - // [1731] phi strchr::ptr#2 = strchr::ptr#6 [phi:strchr/strchr::@3->strchr::@1#0] -- register_copy + .label ptr = $78 + .label return = $78 + .label str = $78 + // [1922] strchr::ptr#6 = (char *)strchr::str#2 + // [1923] phi from strchr strchr::@3 to strchr::@1 [phi:strchr/strchr::@3->strchr::@1] + // [1923] phi strchr::ptr#2 = strchr::ptr#6 [phi:strchr/strchr::@3->strchr::@1#0] -- register_copy // strchr::@1 __b1: // while(*ptr) - // [1732] if(0!=*strchr::ptr#2) goto strchr::@2 -- 0_neq__deref_pbuz1_then_la1 + // [1924] if(0!=*strchr::ptr#2) goto strchr::@2 -- 0_neq__deref_pbuz1_then_la1 ldy #0 lda (ptr),y cmp #0 bne __b2 - // [1733] phi from strchr::@1 to strchr::@return [phi:strchr::@1->strchr::@return] - // [1733] phi strchr::return#2 = (void *) 0 [phi:strchr::@1->strchr::@return#0] -- pvoz1=pvoc1 + // [1925] phi from strchr::@1 to strchr::@return [phi:strchr::@1->strchr::@return] + // [1925] phi strchr::return#2 = (void *) 0 [phi:strchr::@1->strchr::@return#0] -- pvoz1=pvoc1 tya sta.z return sta.z return+1 // strchr::@return // } - // [1734] return + // [1926] return rts // strchr::@2 __b2: // if(*ptr==c) - // [1735] if(*strchr::ptr#2!=strchr::c#4) goto strchr::@3 -- _deref_pbuz1_neq_vbum2_then_la1 + // [1927] if(*strchr::ptr#2!=strchr::c#4) goto strchr::@3 -- _deref_pbuz1_neq_vbum2_then_la1 ldy #0 lda (ptr),y cmp c bne __b3 // strchr::@4 - // [1736] strchr::return#8 = (void *)strchr::ptr#2 - // [1733] phi from strchr::@4 to strchr::@return [phi:strchr::@4->strchr::@return] - // [1733] phi strchr::return#2 = strchr::return#8 [phi:strchr::@4->strchr::@return#0] -- register_copy + // [1928] strchr::return#8 = (void *)strchr::ptr#2 + // [1925] phi from strchr::@4 to strchr::@return [phi:strchr::@4->strchr::@return] + // [1925] phi strchr::return#2 = strchr::return#8 [phi:strchr::@4->strchr::@return#0] -- register_copy rts // strchr::@3 __b3: // ptr++; - // [1737] strchr::ptr#1 = ++ strchr::ptr#2 -- pbuz1=_inc_pbuz1 + // [1929] strchr::ptr#1 = ++ strchr::ptr#2 -- pbuz1=_inc_pbuz1 inc.z ptr bne !+ inc.z ptr+1 !: jmp __b1 .segment Data - c: .byte 0 + .label c = printf_uchar.format_min_length } .segment Code // display_info_vera @@ -11946,229 +12690,108 @@ strchr: { * * @param info_status The STATUS_ */ -// void display_info_vera(__mem() char info_status, __zp($58) char *info_text) +// void display_info_vera(__mem() char info_status, __zp($2c) char *info_text) display_info_vera: { - .label x = $44 - .label y = $51 - .label info_text = $58 + .label info_text = $2c // unsigned char x = wherex() - // [1739] call wherex + // [1931] call wherex jsr wherex - // [1740] wherex::return#11 = wherex::return#0 + // [1932] wherex::return#11 = wherex::return#0 // display_info_vera::@3 - // [1741] display_info_vera::x#0 = wherex::return#11 -- vbuz1=vbum2 - lda wherex.return - sta.z x + // [1933] display_info_vera::x#0 = wherex::return#11 -- vbum1=vbuaa + sta x // unsigned char y = wherey() - // [1742] call wherey + // [1934] call wherey jsr wherey - // [1743] wherey::return#11 = wherey::return#0 + // [1935] wherey::return#11 = wherey::return#0 // display_info_vera::@4 - // [1744] display_info_vera::y#0 = wherey::return#11 -- vbuz1=vbum2 - lda wherey.return - sta.z y + // [1936] display_info_vera::y#0 = wherey::return#11 -- vbum1=vbuaa + sta y // status_vera = info_status - // [1745] status_vera#103 = display_info_vera::info_status#2 -- vbum1=vbum2 + // [1937] status_vera#115 = display_info_vera::info_status#15 -- vbum1=vbum2 lda info_status sta status_vera // display_vera_led(status_color[info_status]) - // [1746] display_vera_led::c#1 = status_color[display_info_vera::info_status#2] -- vbum1=pbuc1_derefidx_vbum2 + // [1938] display_vera_led::c#1 = status_color[display_info_vera::info_status#15] -- vbuz1=pbuc1_derefidx_vbum2 ldy info_status lda status_color,y - sta display_vera_led.c - // [1747] call display_vera_led - // [2500] phi from display_info_vera::@4 to display_vera_led [phi:display_info_vera::@4->display_vera_led] - // [2500] phi display_vera_led::c#2 = display_vera_led::c#1 [phi:display_info_vera::@4->display_vera_led#0] -- register_copy + sta.z display_vera_led.c + // [1939] call display_vera_led + // [2910] phi from display_info_vera::@4 to display_vera_led [phi:display_info_vera::@4->display_vera_led] + // [2910] phi display_vera_led::c#2 = display_vera_led::c#1 [phi:display_info_vera::@4->display_vera_led#0] -- register_copy jsr display_vera_led - // [1748] phi from display_info_vera::@4 to display_info_vera::@5 [phi:display_info_vera::@4->display_info_vera::@5] + // [1940] phi from display_info_vera::@4 to display_info_vera::@5 [phi:display_info_vera::@4->display_info_vera::@5] // display_info_vera::@5 // gotoxy(INFO_X, INFO_Y+1) - // [1749] call gotoxy - // [778] phi from display_info_vera::@5 to gotoxy [phi:display_info_vera::@5->gotoxy] - // [778] phi gotoxy::y#33 = $11+1 [phi:display_info_vera::@5->gotoxy#0] -- vbum1=vbuc1 + // [1941] call gotoxy + // [805] phi from display_info_vera::@5 to gotoxy [phi:display_info_vera::@5->gotoxy] + // [805] phi gotoxy::y#37 = $11+1 [phi:display_info_vera::@5->gotoxy#0] -- vbum1=vbuc1 lda #$11+1 sta gotoxy.y - // [778] phi gotoxy::x#33 = 4 [phi:display_info_vera::@5->gotoxy#1] -- vbum1=vbuc1 - lda #4 - sta gotoxy.x + // [805] phi gotoxy::x#37 = 4 [phi:display_info_vera::@5->gotoxy#1] -- vbuyy=vbuc1 + ldy #4 jsr gotoxy - // [1750] phi from display_info_vera::@5 to display_info_vera::@6 [phi:display_info_vera::@5->display_info_vera::@6] + // [1942] phi from display_info_vera::@5 to display_info_vera::@6 [phi:display_info_vera::@5->display_info_vera::@6] // display_info_vera::@6 - // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1751] call printf_str - // [1054] phi from display_info_vera::@6 to printf_str [phi:display_info_vera::@6->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:display_info_vera::@6->printf_str#0] -- pprz1=pprc1 + // printf("VERA %-9s W25Q16", status_text[info_status]) + // [1943] call printf_str + // [1125] phi from display_info_vera::@6 to printf_str [phi:display_info_vera::@6->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:display_info_vera::@6->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = display_info_vera::s [phi:display_info_vera::@6->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = display_info_vera::s [phi:display_info_vera::@6->printf_str#1] -- pbuz1=pbuc1 lda #s sta.z printf_str.s+1 jsr printf_str // display_info_vera::@7 - // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1752] display_info_vera::$9 = display_info_vera::info_status#2 << 1 -- vbum1=vbum1_rol_1 - asl display_info_vera__9 - // [1753] printf_string::str#6 = status_text[display_info_vera::$9] -- pbuz1=qbuc1_derefidx_vbum2 - ldy display_info_vera__9 + // printf("VERA %-9s W25Q16", status_text[info_status]) + // [1944] display_info_vera::$9 = display_info_vera::info_status#15 << 1 -- vbuaa=vbum1_rol_1 + lda info_status + asl + // [1945] printf_string::str#6 = status_text[display_info_vera::$9] -- pbuz1=qbuc1_derefidx_vbuaa + tay lda status_text,y sta.z printf_string.str lda status_text+1,y sta.z printf_string.str+1 - // [1754] call printf_string - // [1227] phi from display_info_vera::@7 to printf_string [phi:display_info_vera::@7->printf_string] - // [1227] phi printf_string::putc#25 = &cputc [phi:display_info_vera::@7->printf_string#0] -- pprz1=pprc1 + // [1946] call printf_string + // [1419] phi from display_info_vera::@7 to printf_string [phi:display_info_vera::@7->printf_string] + // [1419] phi printf_string::putc#26 = &cputc [phi:display_info_vera::@7->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#6 [phi:display_info_vera::@7->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 1 [phi:display_info_vera::@7->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#6 [phi:display_info_vera::@7->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 1 [phi:display_info_vera::@7->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 9 [phi:display_info_vera::@7->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 9 [phi:display_info_vera::@7->printf_string#3] -- vbum1=vbuc1 lda #9 sta printf_string.format_min_length jsr printf_string - // [1755] phi from display_info_vera::@7 to display_info_vera::@8 [phi:display_info_vera::@7->display_info_vera::@8] + // [1947] phi from display_info_vera::@7 to display_info_vera::@8 [phi:display_info_vera::@7->display_info_vera::@8] // display_info_vera::@8 - // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1756] call printf_str - // [1054] phi from display_info_vera::@8 to printf_str [phi:display_info_vera::@8->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:display_info_vera::@8->printf_str#0] -- pprz1=pprc1 + // printf("VERA %-9s W25Q16", status_text[info_status]) + // [1948] call printf_str + // [1125] phi from display_info_vera::@8 to printf_str [phi:display_info_vera::@8->printf_str] + // [1125] phi printf_str::putc#79 = &cputc [phi:display_info_vera::@8->printf_str#0] -- pprz1=pprc1 lda #cputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = display_info_vera::s1 [phi:display_info_vera::@8->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = display_info_vera::s1 [phi:display_info_vera::@8->printf_str#1] -- pbuz1=pbuc1 lda #s1 sta.z printf_str.s+1 jsr printf_str - // [1757] phi from display_info_vera::@8 to display_info_vera::@9 [phi:display_info_vera::@8->display_info_vera::@9] // display_info_vera::@9 - // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1758] call printf_uchar - // [1118] phi from display_info_vera::@9 to printf_uchar [phi:display_info_vera::@9->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 1 [phi:display_info_vera::@9->printf_uchar#0] -- vbum1=vbuc1 - lda #1 - sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 0 [phi:display_info_vera::@9->printf_uchar#1] -- vbum1=vbuc1 - lda #0 - sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &cputc [phi:display_info_vera::@9->printf_uchar#2] -- pprz1=pprc1 - lda #cputc - sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = HEXADECIMAL [phi:display_info_vera::@9->printf_uchar#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = spi_manufacturer#0 [phi:display_info_vera::@9->printf_uchar#4] -- vbum1=vbuc1 - lda #spi_manufacturer - sta printf_uchar.uvalue - jsr printf_uchar - // [1759] phi from display_info_vera::@9 to display_info_vera::@10 [phi:display_info_vera::@9->display_info_vera::@10] - // display_info_vera::@10 - // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1760] call printf_str - // [1054] phi from display_info_vera::@10 to printf_str [phi:display_info_vera::@10->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:display_info_vera::@10->printf_str#0] -- pprz1=pprc1 - lda #cputc - sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s [phi:display_info_vera::@10->printf_str#1] -- pbuz1=pbuc1 - lda #<@s - sta.z printf_str.s - lda #>@s - sta.z printf_str.s+1 - jsr printf_str - // [1761] phi from display_info_vera::@10 to display_info_vera::@11 [phi:display_info_vera::@10->display_info_vera::@11] - // display_info_vera::@11 - // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1762] call printf_uchar - // [1118] phi from display_info_vera::@11 to printf_uchar [phi:display_info_vera::@11->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 1 [phi:display_info_vera::@11->printf_uchar#0] -- vbum1=vbuc1 - lda #1 - sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 0 [phi:display_info_vera::@11->printf_uchar#1] -- vbum1=vbuc1 - lda #0 - sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &cputc [phi:display_info_vera::@11->printf_uchar#2] -- pprz1=pprc1 - lda #cputc - sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = HEXADECIMAL [phi:display_info_vera::@11->printf_uchar#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = spi_memory_type#0 [phi:display_info_vera::@11->printf_uchar#4] -- vbum1=vbuc1 - lda #spi_memory_type - sta printf_uchar.uvalue - jsr printf_uchar - // [1763] phi from display_info_vera::@11 to display_info_vera::@12 [phi:display_info_vera::@11->display_info_vera::@12] - // display_info_vera::@12 - // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1764] call printf_str - // [1054] phi from display_info_vera::@12 to printf_str [phi:display_info_vera::@12->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:display_info_vera::@12->printf_str#0] -- pprz1=pprc1 - lda #cputc - sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s [phi:display_info_vera::@12->printf_str#1] -- pbuz1=pbuc1 - lda #<@s - sta.z printf_str.s - lda #>@s - sta.z printf_str.s+1 - jsr printf_str - // [1765] phi from display_info_vera::@12 to display_info_vera::@13 [phi:display_info_vera::@12->display_info_vera::@13] - // display_info_vera::@13 - // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1766] call printf_uchar - // [1118] phi from display_info_vera::@13 to printf_uchar [phi:display_info_vera::@13->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 1 [phi:display_info_vera::@13->printf_uchar#0] -- vbum1=vbuc1 - lda #1 - sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 0 [phi:display_info_vera::@13->printf_uchar#1] -- vbum1=vbuc1 - lda #0 - sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &cputc [phi:display_info_vera::@13->printf_uchar#2] -- pprz1=pprc1 - lda #cputc - sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = HEXADECIMAL [phi:display_info_vera::@13->printf_uchar#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = spi_memory_capacity#0 [phi:display_info_vera::@13->printf_uchar#4] -- vbum1=vbuc1 - lda #spi_memory_capacity - sta printf_uchar.uvalue - jsr printf_uchar - // [1767] phi from display_info_vera::@13 to display_info_vera::@14 [phi:display_info_vera::@13->display_info_vera::@14] - // display_info_vera::@14 - // printf("VERA %-9s SPI %0x %0x %0x ", status_text[info_status], spi_manufacturer, spi_memory_type, spi_memory_capacity) - // [1768] call printf_str - // [1054] phi from display_info_vera::@14 to printf_str [phi:display_info_vera::@14->printf_str] - // [1054] phi printf_str::putc#75 = &cputc [phi:display_info_vera::@14->printf_str#0] -- pprz1=pprc1 - lda #cputc - sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = display_info_vera::s4 [phi:display_info_vera::@14->printf_str#1] -- pbuz1=pbuc1 - lda #s4 - sta.z printf_str.s+1 - jsr printf_str - // display_info_vera::@15 // if(info_text) - // [1769] if((char *)0==display_info_vera::info_text#10) goto display_info_vera::@1 -- pbuc1_eq_pbuz1_then_la1 + // [1949] if((char *)0==display_info_vera::info_text#15) goto display_info_vera::@1 -- pbuc1_eq_pbuz1_then_la1 lda.z info_text cmp #<0 bne !+ @@ -12176,80 +12799,77 @@ display_info_vera: { cmp #>0 beq __b1 !: - // [1770] phi from display_info_vera::@15 to display_info_vera::@2 [phi:display_info_vera::@15->display_info_vera::@2] + // [1950] phi from display_info_vera::@9 to display_info_vera::@2 [phi:display_info_vera::@9->display_info_vera::@2] // display_info_vera::@2 // gotoxy(INFO_X+64-28, INFO_Y+1) - // [1771] call gotoxy - // [778] phi from display_info_vera::@2 to gotoxy [phi:display_info_vera::@2->gotoxy] - // [778] phi gotoxy::y#33 = $11+1 [phi:display_info_vera::@2->gotoxy#0] -- vbum1=vbuc1 + // [1951] call gotoxy + // [805] phi from display_info_vera::@2 to gotoxy [phi:display_info_vera::@2->gotoxy] + // [805] phi gotoxy::y#37 = $11+1 [phi:display_info_vera::@2->gotoxy#0] -- vbum1=vbuc1 lda #$11+1 sta gotoxy.y - // [778] phi gotoxy::x#33 = 4+$40-$1c [phi:display_info_vera::@2->gotoxy#1] -- vbum1=vbuc1 - lda #4+$40-$1c - sta gotoxy.x + // [805] phi gotoxy::x#37 = 4+$40-$1c [phi:display_info_vera::@2->gotoxy#1] -- vbuyy=vbuc1 + ldy #4+$40-$1c jsr gotoxy - // display_info_vera::@16 + // display_info_vera::@10 // printf("%-25s", info_text) - // [1772] printf_string::str#7 = display_info_vera::info_text#10 -- pbuz1=pbuz2 + // [1952] printf_string::str#7 = display_info_vera::info_text#15 -- pbuz1=pbuz2 lda.z info_text sta.z printf_string.str lda.z info_text+1 sta.z printf_string.str+1 - // [1773] call printf_string - // [1227] phi from display_info_vera::@16 to printf_string [phi:display_info_vera::@16->printf_string] - // [1227] phi printf_string::putc#25 = &cputc [phi:display_info_vera::@16->printf_string#0] -- pprz1=pprc1 + // [1953] call printf_string + // [1419] phi from display_info_vera::@10 to printf_string [phi:display_info_vera::@10->printf_string] + // [1419] phi printf_string::putc#26 = &cputc [phi:display_info_vera::@10->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#7 [phi:display_info_vera::@16->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 1 [phi:display_info_vera::@16->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#7 [phi:display_info_vera::@10->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 1 [phi:display_info_vera::@10->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = $19 [phi:display_info_vera::@16->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = $19 [phi:display_info_vera::@10->printf_string#3] -- vbum1=vbuc1 lda #$19 sta printf_string.format_min_length jsr printf_string // display_info_vera::@1 __b1: // gotoxy(x, y) - // [1774] gotoxy::x#17 = display_info_vera::x#0 -- vbum1=vbuz2 - lda.z x - sta gotoxy.x - // [1775] gotoxy::y#17 = display_info_vera::y#0 -- vbum1=vbuz2 - lda.z y + // [1954] gotoxy::x#17 = display_info_vera::x#0 -- vbuyy=vbum1 + ldy x + // [1955] gotoxy::y#17 = display_info_vera::y#0 -- vbum1=vbum2 + lda y sta gotoxy.y - // [1776] call gotoxy - // [778] phi from display_info_vera::@1 to gotoxy [phi:display_info_vera::@1->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#17 [phi:display_info_vera::@1->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = gotoxy::x#17 [phi:display_info_vera::@1->gotoxy#1] -- register_copy + // [1956] call gotoxy + // [805] phi from display_info_vera::@1 to gotoxy [phi:display_info_vera::@1->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#17 [phi:display_info_vera::@1->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = gotoxy::x#17 [phi:display_info_vera::@1->gotoxy#1] -- register_copy jsr gotoxy // display_info_vera::@return // } - // [1777] return + // [1957] return rts .segment Data s: .text "VERA " .byte 0 - s1: .text " SPI " + s1: .text " W25Q16" .byte 0 - s4: .text " " - .byte 0 - .label display_info_vera__9 = rom_get_prefix.return - .label info_status = rom_get_prefix.return + x: .byte 0 + y: .byte 0 + .label info_status = rom_detect.rom_detect__24 } .segment Code // util_wait_space util_wait_space: { // util_wait_key("Press [SPACE] to continue ...", " ") - // [1779] call util_wait_key - // [1704] phi from util_wait_space to util_wait_key [phi:util_wait_space->util_wait_key] - // [1704] phi util_wait_key::filter#16 = s [phi:util_wait_space->util_wait_key#0] -- pbuz1=pbuc1 + // [1959] call util_wait_key + // [1896] phi from util_wait_space to util_wait_key [phi:util_wait_space->util_wait_key] + // [1896] phi util_wait_key::filter#16 = s [phi:util_wait_space->util_wait_key#0] -- pbuz1=pbuc1 lda #s sta.z util_wait_key.filter+1 - // [1704] phi util_wait_key::info_text#6 = util_wait_space::info_text [phi:util_wait_space->util_wait_key#1] -- pbuz1=pbuc1 + // [1896] phi util_wait_key::info_text#6 = util_wait_space::info_text [phi:util_wait_space->util_wait_key#1] -- pbuz1=pbuc1 lda #info_text @@ -12257,7 +12877,7 @@ util_wait_space: { jsr util_wait_key // util_wait_space::@return // } - // [1780] return + // [1960] return rts .segment Data info_text: .text "Press [SPACE] to continue ..." @@ -12271,24 +12891,24 @@ util_wait_space: { * @param info_status The status. * @param info_text The status text. */ -// void display_info_cx16_rom(__zp($ec) char info_status, __zp($ba) char *info_text) +// void display_info_cx16_rom(__register(X) char info_status, __zp($78) char *info_text) display_info_cx16_rom: { - .label info_status = $ec - .label info_text = $ba + .label info_text = $78 // display_info_rom(0, info_status, info_text) - // [1782] display_info_rom::info_status#1 = display_info_cx16_rom::info_status#8 - // [1783] display_info_rom::info_text#1 = display_info_cx16_rom::info_text#8 - // [1784] call display_info_rom - // [1176] phi from display_info_cx16_rom to display_info_rom [phi:display_info_cx16_rom->display_info_rom] - // [1176] phi display_info_rom::info_text#16 = display_info_rom::info_text#1 [phi:display_info_cx16_rom->display_info_rom#0] -- register_copy - // [1176] phi display_info_rom::rom_chip#16 = 0 [phi:display_info_cx16_rom->display_info_rom#1] -- vbum1=vbuc1 + // [1962] display_info_rom::info_status#1 = display_info_cx16_rom::info_status#8 -- vbum1=vbuxx + stx display_info_rom.info_status + // [1963] display_info_rom::info_text#1 = display_info_cx16_rom::info_text#8 + // [1964] call display_info_rom + // [1368] phi from display_info_cx16_rom to display_info_rom [phi:display_info_cx16_rom->display_info_rom] + // [1368] phi display_info_rom::info_text#16 = display_info_rom::info_text#1 [phi:display_info_cx16_rom->display_info_rom#0] -- register_copy + // [1368] phi display_info_rom::rom_chip#16 = 0 [phi:display_info_cx16_rom->display_info_rom#1] -- vbum1=vbuc1 lda #0 sta display_info_rom.rom_chip - // [1176] phi display_info_rom::info_status#16 = display_info_rom::info_status#1 [phi:display_info_cx16_rom->display_info_rom#2] -- register_copy + // [1368] phi display_info_rom::info_status#16 = display_info_rom::info_status#1 [phi:display_info_cx16_rom->display_info_rom#2] -- register_copy jsr display_info_rom // display_info_cx16_rom::@return // } - // [1785] return + // [1965] return rts } // rom_get_release @@ -12299,36 +12919,32 @@ display_info_cx16_rom: { * @param release The raw release number. * @return unsigned char The release potentially taken 2's complement. */ -// __zp($ec) char rom_get_release(__zp($ec) char release) +// __register(X) char rom_get_release(__register(X) char release) rom_get_release: { - .label rom_get_release__0 = $51 - .label rom_get_release__2 = $ec - .label return = $ec - .label release = $ec // release & 0x80 - // [1787] rom_get_release::$0 = rom_get_release::release#3 & $80 -- vbuz1=vbuz2_band_vbuc1 - lda #$80 - and.z release - sta.z rom_get_release__0 + // [1967] rom_get_release::$0 = rom_get_release::release#3 & $80 -- vbuaa=vbuxx_band_vbuc1 + txa + and #$80 // if(release & 0x80) - // [1788] if(0==rom_get_release::$0) goto rom_get_release::@1 -- 0_eq_vbuz1_then_la1 + // [1968] if(0==rom_get_release::$0) goto rom_get_release::@1 -- 0_eq_vbuaa_then_la1 + cmp #0 beq __b1 // rom_get_release::@2 // ~release - // [1789] rom_get_release::$2 = ~ rom_get_release::release#3 -- vbuz1=_bnot_vbuz1 - lda.z rom_get_release__2 + // [1969] rom_get_release::$2 = ~ rom_get_release::release#3 -- vbuaa=_bnot_vbuxx + txa eor #$ff - sta.z rom_get_release__2 // release = ~release + 1 - // [1790] rom_get_release::release#0 = rom_get_release::$2 + 1 -- vbuz1=vbuz1_plus_1 - inc.z release - // [1791] phi from rom_get_release rom_get_release::@2 to rom_get_release::@1 [phi:rom_get_release/rom_get_release::@2->rom_get_release::@1] - // [1791] phi rom_get_release::return#0 = rom_get_release::release#3 [phi:rom_get_release/rom_get_release::@2->rom_get_release::@1#0] -- register_copy + // [1970] rom_get_release::release#0 = rom_get_release::$2 + 1 -- vbuxx=vbuaa_plus_1 + tax + inx + // [1971] phi from rom_get_release rom_get_release::@2 to rom_get_release::@1 [phi:rom_get_release/rom_get_release::@2->rom_get_release::@1] + // [1971] phi rom_get_release::return#0 = rom_get_release::release#3 [phi:rom_get_release/rom_get_release::@2->rom_get_release::@1#0] -- register_copy // rom_get_release::@1 __b1: // rom_get_release::@return // } - // [1792] return + // [1972] return rts } // rom_get_prefix @@ -12340,111 +12956,96 @@ rom_get_release: { * @param release The release potentially taken 2's complement. * @return unsigned char 'r' if the release is official, 'p' if the release is inofficial of 0xFF. */ -// __mem() char rom_get_prefix(__mem() char release) +// __register(A) char rom_get_prefix(__register(A) char release) rom_get_prefix: { // if(release == 0xFF) - // [1794] if(rom_get_prefix::release#2!=$ff) goto rom_get_prefix::@1 -- vbum1_neq_vbuc1_then_la1 - lda #$ff - cmp release + // [1974] if(rom_get_prefix::release#2!=$ff) goto rom_get_prefix::@1 -- vbuaa_neq_vbuc1_then_la1 + cmp #$ff bne __b3 - // [1795] phi from rom_get_prefix to rom_get_prefix::@3 [phi:rom_get_prefix->rom_get_prefix::@3] + // [1975] phi from rom_get_prefix to rom_get_prefix::@3 [phi:rom_get_prefix->rom_get_prefix::@3] // rom_get_prefix::@3 - // [1796] phi from rom_get_prefix::@3 to rom_get_prefix::@1 [phi:rom_get_prefix::@3->rom_get_prefix::@1] - // [1796] phi rom_get_prefix::prefix#4 = 'p' [phi:rom_get_prefix::@3->rom_get_prefix::@1#0] -- vbum1=vbuc1 - lda #'p' - sta prefix + // [1976] phi from rom_get_prefix::@3 to rom_get_prefix::@1 [phi:rom_get_prefix::@3->rom_get_prefix::@1] + // [1976] phi rom_get_prefix::prefix#4 = 'p' [phi:rom_get_prefix::@3->rom_get_prefix::@1#0] -- vbuxx=vbuc1 + ldx #'p' jmp __b1 - // [1796] phi from rom_get_prefix to rom_get_prefix::@1 [phi:rom_get_prefix->rom_get_prefix::@1] + // [1976] phi from rom_get_prefix to rom_get_prefix::@1 [phi:rom_get_prefix->rom_get_prefix::@1] __b3: - // [1796] phi rom_get_prefix::prefix#4 = 'r' [phi:rom_get_prefix->rom_get_prefix::@1#0] -- vbum1=vbuc1 - lda #'r' - sta prefix + // [1976] phi rom_get_prefix::prefix#4 = 'r' [phi:rom_get_prefix->rom_get_prefix::@1#0] -- vbuxx=vbuc1 + ldx #'r' // rom_get_prefix::@1 __b1: // release & 0x80 - // [1797] rom_get_prefix::$2 = rom_get_prefix::release#2 & $80 -- vbum1=vbum1_band_vbuc1 - lda #$80 - and rom_get_prefix__2 - sta rom_get_prefix__2 + // [1977] rom_get_prefix::$2 = rom_get_prefix::release#2 & $80 -- vbuaa=vbuaa_band_vbuc1 + and #$80 // if(release & 0x80) - // [1798] if(0==rom_get_prefix::$2) goto rom_get_prefix::@4 -- 0_eq_vbum1_then_la1 + // [1978] if(0==rom_get_prefix::$2) goto rom_get_prefix::@4 -- 0_eq_vbuaa_then_la1 + cmp #0 beq __b2 - // [1800] phi from rom_get_prefix::@1 to rom_get_prefix::@2 [phi:rom_get_prefix::@1->rom_get_prefix::@2] - // [1800] phi rom_get_prefix::return#0 = 'p' [phi:rom_get_prefix::@1->rom_get_prefix::@2#0] -- vbum1=vbuc1 - lda #'p' - sta return + // [1980] phi from rom_get_prefix::@1 to rom_get_prefix::@2 [phi:rom_get_prefix::@1->rom_get_prefix::@2] + // [1980] phi rom_get_prefix::return#0 = 'p' [phi:rom_get_prefix::@1->rom_get_prefix::@2#0] -- vbuxx=vbuc1 + ldx #'p' rts - // [1799] phi from rom_get_prefix::@1 to rom_get_prefix::@4 [phi:rom_get_prefix::@1->rom_get_prefix::@4] + // [1979] phi from rom_get_prefix::@1 to rom_get_prefix::@4 [phi:rom_get_prefix::@1->rom_get_prefix::@4] // rom_get_prefix::@4 - // [1800] phi from rom_get_prefix::@4 to rom_get_prefix::@2 [phi:rom_get_prefix::@4->rom_get_prefix::@2] - // [1800] phi rom_get_prefix::return#0 = rom_get_prefix::prefix#4 [phi:rom_get_prefix::@4->rom_get_prefix::@2#0] -- register_copy + // [1980] phi from rom_get_prefix::@4 to rom_get_prefix::@2 [phi:rom_get_prefix::@4->rom_get_prefix::@2] + // [1980] phi rom_get_prefix::return#0 = rom_get_prefix::prefix#4 [phi:rom_get_prefix::@4->rom_get_prefix::@2#0] -- register_copy // rom_get_prefix::@2 __b2: // rom_get_prefix::@return // } - // [1801] return + // [1981] return rts - .segment Data - .label rom_get_prefix__2 = main.check_status_rom1_main__0 - return: .byte 0 - .label release = main.check_status_rom1_main__0 - // If the release is 0xFF, then the release is a preview. - // If bit 7 of the release is set, then the release is a preview. - .label prefix = return } -.segment Code // rom_get_version_text -// void rom_get_version_text(__zp($b8) char *release_info, __mem() char prefix, __zp($ec) char release, __zp($c1) char *github) +// void rom_get_version_text(__zp($76) char *release_info, __register(X) char prefix, __zp($bd) char release, __zp($7e) char *github) rom_get_version_text: { - .label release_info = $b8 - .label release = $ec - .label github = $c1 + .label release_info = $76 + .label release = $bd + .label github = $7e // sprintf(release_info, "%c%u %s", prefix, release, github) - // [1803] snprintf_init::s#9 = rom_get_version_text::release_info#2 - // [1804] call snprintf_init - // [1113] phi from rom_get_version_text to snprintf_init [phi:rom_get_version_text->snprintf_init] - // [1113] phi snprintf_init::s#25 = snprintf_init::s#9 [phi:rom_get_version_text->snprintf_init#0] -- register_copy + // [1983] snprintf_init::s#10 = rom_get_version_text::release_info#2 + // [1984] call snprintf_init + // [1184] phi from rom_get_version_text to snprintf_init [phi:rom_get_version_text->snprintf_init] + // [1184] phi snprintf_init::s#30 = snprintf_init::s#10 [phi:rom_get_version_text->snprintf_init#0] -- register_copy jsr snprintf_init // rom_get_version_text::@1 // sprintf(release_info, "%c%u %s", prefix, release, github) - // [1805] stackpush(char) = rom_get_version_text::prefix#2 -- _stackpushbyte_=vbum1 - lda prefix + // [1985] stackpush(char) = rom_get_version_text::prefix#2 -- _stackpushbyte_=vbuxx + txa pha - // [1806] callexecute snputc -- call_vprc1 + // [1986] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla - // [1808] printf_uchar::uvalue#12 = rom_get_version_text::release#2 -- vbum1=vbuz2 - lda.z release - sta printf_uchar.uvalue - // [1809] call printf_uchar - // [1118] phi from rom_get_version_text::@1 to printf_uchar [phi:rom_get_version_text::@1->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 0 [phi:rom_get_version_text::@1->printf_uchar#0] -- vbum1=vbuc1 + // [1988] printf_uchar::uvalue#9 = rom_get_version_text::release#2 -- vbuxx=vbuz1 + ldx.z release + // [1989] call printf_uchar + // [1189] phi from rom_get_version_text::@1 to printf_uchar [phi:rom_get_version_text::@1->printf_uchar] + // [1189] phi printf_uchar::format_zero_padding#15 = 0 [phi:rom_get_version_text::@1->printf_uchar#0] -- vbum1=vbuc1 lda #0 sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 0 [phi:rom_get_version_text::@1->printf_uchar#1] -- vbum1=vbuc1 + // [1189] phi printf_uchar::format_min_length#15 = 0 [phi:rom_get_version_text::@1->printf_uchar#1] -- vbum1=vbuc1 sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &snputc [phi:rom_get_version_text::@1->printf_uchar#2] -- pprz1=pprc1 + // [1189] phi printf_uchar::putc#15 = &snputc [phi:rom_get_version_text::@1->printf_uchar#2] -- pprz1=pprc1 lda #snputc sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = DECIMAL [phi:rom_get_version_text::@1->printf_uchar#3] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = printf_uchar::uvalue#12 [phi:rom_get_version_text::@1->printf_uchar#4] -- register_copy + // [1189] phi printf_uchar::format_radix#15 = DECIMAL [phi:rom_get_version_text::@1->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL + // [1189] phi printf_uchar::uvalue#15 = printf_uchar::uvalue#9 [phi:rom_get_version_text::@1->printf_uchar#4] -- register_copy jsr printf_uchar - // [1810] phi from rom_get_version_text::@1 to rom_get_version_text::@2 [phi:rom_get_version_text::@1->rom_get_version_text::@2] + // [1990] phi from rom_get_version_text::@1 to rom_get_version_text::@2 [phi:rom_get_version_text::@1->rom_get_version_text::@2] // rom_get_version_text::@2 // sprintf(release_info, "%c%u %s", prefix, release, github) - // [1811] call printf_str - // [1054] phi from rom_get_version_text::@2 to printf_str [phi:rom_get_version_text::@2->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:rom_get_version_text::@2->printf_str#0] -- pprz1=pprc1 + // [1991] call printf_str + // [1125] phi from rom_get_version_text::@2 to printf_str [phi:rom_get_version_text::@2->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:rom_get_version_text::@2->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s [phi:rom_get_version_text::@2->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s [phi:rom_get_version_text::@2->printf_str#1] -- pbuz1=pbuc1 lda #s @@ -12452,42 +13053,39 @@ rom_get_version_text: { jsr printf_str // rom_get_version_text::@3 // sprintf(release_info, "%c%u %s", prefix, release, github) - // [1812] printf_string::str#16 = rom_get_version_text::github#2 -- pbuz1=pbuz2 + // [1992] printf_string::str#16 = rom_get_version_text::github#2 -- pbuz1=pbuz2 lda.z github sta.z printf_string.str lda.z github+1 sta.z printf_string.str+1 - // [1813] call printf_string - // [1227] phi from rom_get_version_text::@3 to printf_string [phi:rom_get_version_text::@3->printf_string] - // [1227] phi printf_string::putc#25 = &snputc [phi:rom_get_version_text::@3->printf_string#0] -- pprz1=pprc1 + // [1993] call printf_string + // [1419] phi from rom_get_version_text::@3 to printf_string [phi:rom_get_version_text::@3->printf_string] + // [1419] phi printf_string::putc#26 = &snputc [phi:rom_get_version_text::@3->printf_string#0] -- pprz1=pprc1 lda #snputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#16 [phi:rom_get_version_text::@3->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 0 [phi:rom_get_version_text::@3->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#16 [phi:rom_get_version_text::@3->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 0 [phi:rom_get_version_text::@3->printf_string#2] -- vbum1=vbuc1 lda #0 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 0 [phi:rom_get_version_text::@3->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 0 [phi:rom_get_version_text::@3->printf_string#3] -- vbum1=vbuc1 sta printf_string.format_min_length jsr printf_string // rom_get_version_text::@4 // sprintf(release_info, "%c%u %s", prefix, release, github) - // [1814] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [1994] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [1815] callexecute snputc -- call_vprc1 + // [1995] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // rom_get_version_text::@return // } - // [1817] return + // [1997] return rts - .segment Data - .label prefix = rom_get_prefix.return } -.segment Code // rom_get_github_commit_id /** * @brief Copy the github commit_id only if the commit_id contains hexadecimal characters. @@ -12495,53 +13093,47 @@ rom_get_version_text: { * @param commit_id The target commit_id. * @param from The source ptr in ROM or RAM. */ -// void rom_get_github_commit_id(__zp($39) char *commit_id, __zp($3b) char *from) +// void rom_get_github_commit_id(__zp($5d) char *commit_id, __zp($59) char *from) rom_get_github_commit_id: { - .label ch = $af - .label c = $a9 - .label commit_id = $39 - .label commit_id_ok = $ac - .label from = $3b - // [1819] phi from rom_get_github_commit_id to rom_get_github_commit_id::@2 [phi:rom_get_github_commit_id->rom_get_github_commit_id::@2] - // [1819] phi rom_get_github_commit_id::commit_id_ok#2 = true [phi:rom_get_github_commit_id->rom_get_github_commit_id::@2#0] -- vboz1=vboc1 + .label commit_id = $5d + .label from = $59 + // [1999] phi from rom_get_github_commit_id to rom_get_github_commit_id::@2 [phi:rom_get_github_commit_id->rom_get_github_commit_id::@2] + // [1999] phi rom_get_github_commit_id::commit_id_ok#2 = true [phi:rom_get_github_commit_id->rom_get_github_commit_id::@2#0] -- vboxx=vboc1 lda #1 - sta.z commit_id_ok - // [1819] phi rom_get_github_commit_id::c#2 = 0 [phi:rom_get_github_commit_id->rom_get_github_commit_id::@2#1] -- vbuz1=vbuc1 - lda #0 - sta.z c + tax + // [1999] phi rom_get_github_commit_id::c#2 = 0 [phi:rom_get_github_commit_id->rom_get_github_commit_id::@2#1] -- vbuyy=vbuc1 + ldy #0 // rom_get_github_commit_id::@2 __b2: // for(unsigned char c=0; c<7; c++) - // [1820] if(rom_get_github_commit_id::c#2<7) goto rom_get_github_commit_id::@3 -- vbuz1_lt_vbuc1_then_la1 - lda.z c - cmp #7 + // [2000] if(rom_get_github_commit_id::c#2<7) goto rom_get_github_commit_id::@3 -- vbuyy_lt_vbuc1_then_la1 + cpy #7 bcc __b3 // rom_get_github_commit_id::@4 // if(commit_id_ok) - // [1821] if(rom_get_github_commit_id::commit_id_ok#2) goto rom_get_github_commit_id::@1 -- vboz1_then_la1 - lda.z commit_id_ok - cmp #0 + // [2001] if(rom_get_github_commit_id::commit_id_ok#2) goto rom_get_github_commit_id::@1 -- vboxx_then_la1 + cpx #0 bne __b1 // rom_get_github_commit_id::@6 // *commit_id = '\0' - // [1822] *rom_get_github_commit_id::commit_id#6 = '@' -- _deref_pbuz1=vbuc1 + // [2002] *rom_get_github_commit_id::commit_id#6 = '@' -- _deref_pbuz1=vbuc1 lda #'@' ldy #0 sta (commit_id),y // rom_get_github_commit_id::@return // } - // [1823] return + // [2003] return rts // rom_get_github_commit_id::@1 __b1: // strncpy(commit_id, from, 7) - // [1824] strncpy::dst#2 = rom_get_github_commit_id::commit_id#6 - // [1825] strncpy::src#2 = rom_get_github_commit_id::from#6 - // [1826] call strncpy - // [2506] phi from rom_get_github_commit_id::@1 to strncpy [phi:rom_get_github_commit_id::@1->strncpy] - // [2506] phi strncpy::dst#8 = strncpy::dst#2 [phi:rom_get_github_commit_id::@1->strncpy#0] -- register_copy - // [2506] phi strncpy::src#6 = strncpy::src#2 [phi:rom_get_github_commit_id::@1->strncpy#1] -- register_copy - // [2506] phi strncpy::n#3 = 7 [phi:rom_get_github_commit_id::@1->strncpy#2] -- vwum1=vbuc1 + // [2004] strncpy::dst#2 = rom_get_github_commit_id::commit_id#6 + // [2005] strncpy::src#2 = rom_get_github_commit_id::from#6 + // [2006] call strncpy + // [2916] phi from rom_get_github_commit_id::@1 to strncpy [phi:rom_get_github_commit_id::@1->strncpy] + // [2916] phi strncpy::dst#8 = strncpy::dst#2 [phi:rom_get_github_commit_id::@1->strncpy#0] -- register_copy + // [2916] phi strncpy::src#6 = strncpy::src#2 [phi:rom_get_github_commit_id::@1->strncpy#1] -- register_copy + // [2916] phi strncpy::n#3 = 7 [phi:rom_get_github_commit_id::@1->strncpy#2] -- vwum1=vbuc1 lda #<7 sta strncpy.n lda #>7 @@ -12551,286 +13143,259 @@ rom_get_github_commit_id: { // rom_get_github_commit_id::@3 __b3: // unsigned char ch = from[c] - // [1827] rom_get_github_commit_id::ch#0 = rom_get_github_commit_id::from#6[rom_get_github_commit_id::c#2] -- vbuz1=pbuz2_derefidx_vbuz3 - ldy.z c + // [2007] rom_get_github_commit_id::ch#0 = rom_get_github_commit_id::from#6[rom_get_github_commit_id::c#2] -- vbuaa=pbuz1_derefidx_vbuyy lda (from),y - sta.z ch // if(!(ch >= 48 && ch <= 48+9 || ch >= 65 && ch <= 65+26)) - // [1828] if(rom_get_github_commit_id::ch#0<$30) goto rom_get_github_commit_id::@7 -- vbuz1_lt_vbuc1_then_la1 + // [2008] if(rom_get_github_commit_id::ch#0<$30) goto rom_get_github_commit_id::@7 -- vbuaa_lt_vbuc1_then_la1 cmp #$30 bcc __b7 // rom_get_github_commit_id::@8 - // [1829] if(rom_get_github_commit_id::ch#0<$30+9+1) goto rom_get_github_commit_id::@5 -- vbuz1_lt_vbuc1_then_la1 + // [2009] if(rom_get_github_commit_id::ch#0<$30+9+1) goto rom_get_github_commit_id::@5 -- vbuaa_lt_vbuc1_then_la1 cmp #$30+9+1 bcc __b5 // rom_get_github_commit_id::@7 __b7: - // [1830] if(rom_get_github_commit_id::ch#0<$41) goto rom_get_github_commit_id::@5 -- vbuz1_lt_vbuc1_then_la1 - lda.z ch + // [2010] if(rom_get_github_commit_id::ch#0<$41) goto rom_get_github_commit_id::@5 -- vbuaa_lt_vbuc1_then_la1 cmp #$41 bcc __b4 // rom_get_github_commit_id::@9 - // [1831] if(rom_get_github_commit_id::ch#0<$41+$1a+1) goto rom_get_github_commit_id::@10 -- vbuz1_lt_vbuc1_then_la1 + // [2011] if(rom_get_github_commit_id::ch#0<$41+$1a+1) goto rom_get_github_commit_id::@10 -- vbuaa_lt_vbuc1_then_la1 cmp #$41+$1a+1 bcc __b5 - // [1833] phi from rom_get_github_commit_id::@7 rom_get_github_commit_id::@9 to rom_get_github_commit_id::@5 [phi:rom_get_github_commit_id::@7/rom_get_github_commit_id::@9->rom_get_github_commit_id::@5] + // [2013] phi from rom_get_github_commit_id::@7 rom_get_github_commit_id::@9 to rom_get_github_commit_id::@5 [phi:rom_get_github_commit_id::@7/rom_get_github_commit_id::@9->rom_get_github_commit_id::@5] __b4: - // [1833] phi rom_get_github_commit_id::commit_id_ok#4 = false [phi:rom_get_github_commit_id::@7/rom_get_github_commit_id::@9->rom_get_github_commit_id::@5#0] -- vboz1=vboc1 + // [2013] phi rom_get_github_commit_id::commit_id_ok#4 = false [phi:rom_get_github_commit_id::@7/rom_get_github_commit_id::@9->rom_get_github_commit_id::@5#0] -- vboxx=vboc1 lda #0 - sta.z commit_id_ok - // [1832] phi from rom_get_github_commit_id::@9 to rom_get_github_commit_id::@10 [phi:rom_get_github_commit_id::@9->rom_get_github_commit_id::@10] + tax + // [2012] phi from rom_get_github_commit_id::@9 to rom_get_github_commit_id::@10 [phi:rom_get_github_commit_id::@9->rom_get_github_commit_id::@10] // rom_get_github_commit_id::@10 - // [1833] phi from rom_get_github_commit_id::@10 rom_get_github_commit_id::@8 to rom_get_github_commit_id::@5 [phi:rom_get_github_commit_id::@10/rom_get_github_commit_id::@8->rom_get_github_commit_id::@5] - // [1833] phi rom_get_github_commit_id::commit_id_ok#4 = rom_get_github_commit_id::commit_id_ok#2 [phi:rom_get_github_commit_id::@10/rom_get_github_commit_id::@8->rom_get_github_commit_id::@5#0] -- register_copy + // [2013] phi from rom_get_github_commit_id::@10 rom_get_github_commit_id::@8 to rom_get_github_commit_id::@5 [phi:rom_get_github_commit_id::@10/rom_get_github_commit_id::@8->rom_get_github_commit_id::@5] + // [2013] phi rom_get_github_commit_id::commit_id_ok#4 = rom_get_github_commit_id::commit_id_ok#2 [phi:rom_get_github_commit_id::@10/rom_get_github_commit_id::@8->rom_get_github_commit_id::@5#0] -- register_copy // rom_get_github_commit_id::@5 __b5: // for(unsigned char c=0; c<7; c++) - // [1834] rom_get_github_commit_id::c#1 = ++ rom_get_github_commit_id::c#2 -- vbuz1=_inc_vbuz1 - inc.z c - // [1819] phi from rom_get_github_commit_id::@5 to rom_get_github_commit_id::@2 [phi:rom_get_github_commit_id::@5->rom_get_github_commit_id::@2] - // [1819] phi rom_get_github_commit_id::commit_id_ok#2 = rom_get_github_commit_id::commit_id_ok#4 [phi:rom_get_github_commit_id::@5->rom_get_github_commit_id::@2#0] -- register_copy - // [1819] phi rom_get_github_commit_id::c#2 = rom_get_github_commit_id::c#1 [phi:rom_get_github_commit_id::@5->rom_get_github_commit_id::@2#1] -- register_copy + // [2014] rom_get_github_commit_id::c#1 = ++ rom_get_github_commit_id::c#2 -- vbuyy=_inc_vbuyy + iny + // [1999] phi from rom_get_github_commit_id::@5 to rom_get_github_commit_id::@2 [phi:rom_get_github_commit_id::@5->rom_get_github_commit_id::@2] + // [1999] phi rom_get_github_commit_id::commit_id_ok#2 = rom_get_github_commit_id::commit_id_ok#4 [phi:rom_get_github_commit_id::@5->rom_get_github_commit_id::@2#0] -- register_copy + // [1999] phi rom_get_github_commit_id::c#2 = rom_get_github_commit_id::c#1 [phi:rom_get_github_commit_id::@5->rom_get_github_commit_id::@2#1] -- register_copy jmp __b2 } // printf_uint // Print an unsigned int using a specific format -// void printf_uint(__zp($aa) void (*putc)(char), __mem() unsigned int uvalue, __mem() char format_min_length, char format_justify_left, char format_sign_always, __mem() char format_zero_padding, char format_upper_case, __mem() char format_radix) +// void printf_uint(__zp($67) void (*putc)(char), __mem() unsigned int uvalue, __mem() char format_min_length, char format_justify_left, char format_sign_always, __mem() char format_zero_padding, char format_upper_case, __register(X) char format_radix) printf_uint: { - .label putc = $aa + .label putc = $67 // printf_uint::@1 // printf_buffer.sign = format.sign_always?'+':0 - // [1836] *((char *)&printf_buffer) = 0 -- _deref_pbuc1=vbuc2 + // [2016] *((char *)&printf_buffer) = 0 -- _deref_pbuc1=vbuc2 // Handle any sign lda #0 sta printf_buffer // utoa(uvalue, printf_buffer.digits, format.radix) - // [1837] utoa::value#1 = printf_uint::uvalue#10 - // [1838] utoa::radix#0 = printf_uint::format_radix#10 - // [1839] call utoa + // [2017] utoa::value#1 = printf_uint::uvalue#10 + // [2018] utoa::radix#0 = printf_uint::format_radix#10 + // [2019] call utoa // Format number into buffer jsr utoa // printf_uint::@2 // printf_number_buffer(putc, printf_buffer, format) - // [1840] printf_number_buffer::putc#1 = printf_uint::putc#10 - // [1841] printf_number_buffer::buffer_sign#1 = *((char *)&printf_buffer) -- vbum1=_deref_pbuc1 + // [2020] printf_number_buffer::putc#1 = printf_uint::putc#10 + // [2021] printf_number_buffer::buffer_sign#1 = *((char *)&printf_buffer) -- vbum1=_deref_pbuc1 lda printf_buffer sta printf_number_buffer.buffer_sign - // [1842] printf_number_buffer::format_min_length#1 = printf_uint::format_min_length#10 - // [1843] printf_number_buffer::format_zero_padding#1 = printf_uint::format_zero_padding#10 - // [1844] call printf_number_buffer + // [2022] printf_number_buffer::format_min_length#1 = printf_uint::format_min_length#10 -- vbuxx=vbum1 + ldx format_min_length + // [2023] printf_number_buffer::format_zero_padding#1 = printf_uint::format_zero_padding#10 + // [2024] call printf_number_buffer // Print using format - // [2116] phi from printf_uint::@2 to printf_number_buffer [phi:printf_uint::@2->printf_number_buffer] - // [2116] phi printf_number_buffer::putc#10 = printf_number_buffer::putc#1 [phi:printf_uint::@2->printf_number_buffer#0] -- register_copy - // [2116] phi printf_number_buffer::buffer_sign#10 = printf_number_buffer::buffer_sign#1 [phi:printf_uint::@2->printf_number_buffer#1] -- register_copy - // [2116] phi printf_number_buffer::format_zero_padding#10 = printf_number_buffer::format_zero_padding#1 [phi:printf_uint::@2->printf_number_buffer#2] -- register_copy - // [2116] phi printf_number_buffer::format_min_length#3 = printf_number_buffer::format_min_length#1 [phi:printf_uint::@2->printf_number_buffer#3] -- register_copy + // [2362] phi from printf_uint::@2 to printf_number_buffer [phi:printf_uint::@2->printf_number_buffer] + // [2362] phi printf_number_buffer::putc#10 = printf_number_buffer::putc#1 [phi:printf_uint::@2->printf_number_buffer#0] -- register_copy + // [2362] phi printf_number_buffer::buffer_sign#10 = printf_number_buffer::buffer_sign#1 [phi:printf_uint::@2->printf_number_buffer#1] -- register_copy + // [2362] phi printf_number_buffer::format_zero_padding#10 = printf_number_buffer::format_zero_padding#1 [phi:printf_uint::@2->printf_number_buffer#2] -- register_copy + // [2362] phi printf_number_buffer::format_min_length#3 = printf_number_buffer::format_min_length#1 [phi:printf_uint::@2->printf_number_buffer#3] -- register_copy jsr printf_number_buffer // printf_uint::@return // } - // [1845] return + // [2025] return rts .segment Data - uvalue: .word 0 - format_radix: .byte 0 + .label uvalue = strncmp.n .label format_min_length = printf_uchar.format_min_length .label format_zero_padding = printf_uchar.format_zero_padding } .segment Code // screenlayer // --- layer management in VERA --- -// void screenlayer(char layer, __mem() char mapbase, __mem() char config) +// void screenlayer(char layer, __register(X) char mapbase, __mem() char config) screenlayer: { - .label screenlayer__0 = $b7 - .label screenlayer__1 = $b6 - .label screenlayer__9 = $f8 - .label screenlayer__10 = $f8 - .label screenlayer__11 = $f8 - .label screenlayer__12 = $f9 - .label screenlayer__13 = $f9 - .label screenlayer__14 = $f9 - .label screenlayer__17 = $ee - .label screenlayer__18 = $f8 - .label screenlayer__19 = $f9 - .label y = $e2 // __mem char vera_dc_hscale_temp = *VERA_DC_HSCALE - // [1846] screenlayer::vera_dc_hscale_temp#0 = *VERA_DC_HSCALE -- vbum1=_deref_pbuc1 + // [2026] screenlayer::vera_dc_hscale_temp#0 = *VERA_DC_HSCALE -- vbum1=_deref_pbuc1 lda VERA_DC_HSCALE sta vera_dc_hscale_temp // __mem char vera_dc_vscale_temp = *VERA_DC_VSCALE - // [1847] screenlayer::vera_dc_vscale_temp#0 = *VERA_DC_VSCALE -- vbum1=_deref_pbuc1 + // [2027] screenlayer::vera_dc_vscale_temp#0 = *VERA_DC_VSCALE -- vbum1=_deref_pbuc1 lda VERA_DC_VSCALE sta vera_dc_vscale_temp // __conio.layer = 0 - // [1848] *((char *)&__conio+2) = 0 -- _deref_pbuc1=vbuc2 + // [2028] *((char *)&__conio+2) = 0 -- _deref_pbuc1=vbuc2 lda #0 sta __conio+2 // mapbase >> 7 - // [1849] screenlayer::$0 = screenlayer::mapbase#0 >> 7 -- vbuz1=vbum2_ror_7 - lda mapbase + // [2029] screenlayer::$0 = screenlayer::mapbase#0 >> 7 -- vbuaa=vbuxx_ror_7 + txa rol rol and #1 - sta.z screenlayer__0 // __conio.mapbase_bank = mapbase >> 7 - // [1850] *((char *)&__conio+5) = screenlayer::$0 -- _deref_pbuc1=vbuz1 + // [2030] *((char *)&__conio+5) = screenlayer::$0 -- _deref_pbuc1=vbuaa sta __conio+5 // (mapbase)<<1 - // [1851] screenlayer::$1 = screenlayer::mapbase#0 << 1 -- vbuz1=vbum2_rol_1 - lda mapbase + // [2031] screenlayer::$1 = screenlayer::mapbase#0 << 1 -- vbuaa=vbuxx_rol_1 + txa asl - sta.z screenlayer__1 // MAKEWORD((mapbase)<<1,0) - // [1852] screenlayer::$2 = screenlayer::$1 w= 0 -- vwum1=vbuz2_word_vbuc1 - lda #0 - ldy.z screenlayer__1 - sty screenlayer__2+1 - sta screenlayer__2 + // [2032] screenlayer::$2 = screenlayer::$1 w= 0 -- vwum1=vbuaa_word_vbuc1 + ldy #0 + sta screenlayer__2+1 + sty screenlayer__2 // __conio.mapbase_offset = MAKEWORD((mapbase)<<1,0) - // [1853] *((unsigned int *)&__conio+3) = screenlayer::$2 -- _deref_pwuc1=vwum1 - sta __conio+3 + // [2033] *((unsigned int *)&__conio+3) = screenlayer::$2 -- _deref_pwuc1=vwum1 tya + sta __conio+3 + lda screenlayer__2+1 sta __conio+3+1 // config & VERA_LAYER_WIDTH_MASK - // [1854] screenlayer::$7 = screenlayer::config#0 & VERA_LAYER_WIDTH_MASK -- vbum1=vbum2_band_vbuc1 + // [2034] screenlayer::$7 = screenlayer::config#0 & VERA_LAYER_WIDTH_MASK -- vbuaa=vbum1_band_vbuc1 lda #VERA_LAYER_WIDTH_MASK and config - sta screenlayer__7 // (config & VERA_LAYER_WIDTH_MASK) >> 4 - // [1855] screenlayer::$8 = screenlayer::$7 >> 4 -- vbum1=vbum1_ror_4 - lda screenlayer__8 + // [2035] screenlayer::$8 = screenlayer::$7 >> 4 -- vbuxx=vbuaa_ror_4 lsr lsr lsr lsr - sta screenlayer__8 + tax // __conio.mapwidth = VERA_LAYER_DIM[ (config & VERA_LAYER_WIDTH_MASK) >> 4] - // [1856] *((char *)&__conio+8) = screenlayer::VERA_LAYER_DIM[screenlayer::$8] -- _deref_pbuc1=pbuc2_derefidx_vbum1 - tay - lda VERA_LAYER_DIM,y + // [2036] *((char *)&__conio+8) = screenlayer::VERA_LAYER_DIM[screenlayer::$8] -- _deref_pbuc1=pbuc2_derefidx_vbuxx + lda VERA_LAYER_DIM,x sta __conio+8 // config & VERA_LAYER_HEIGHT_MASK - // [1857] screenlayer::$5 = screenlayer::config#0 & VERA_LAYER_HEIGHT_MASK -- vbum1=vbum2_band_vbuc1 + // [2037] screenlayer::$5 = screenlayer::config#0 & VERA_LAYER_HEIGHT_MASK -- vbuaa=vbum1_band_vbuc1 lda #VERA_LAYER_HEIGHT_MASK and config - sta screenlayer__5 // (config & VERA_LAYER_HEIGHT_MASK) >> 6 - // [1858] screenlayer::$6 = screenlayer::$5 >> 6 -- vbum1=vbum1_ror_6 - lda screenlayer__6 + // [2038] screenlayer::$6 = screenlayer::$5 >> 6 -- vbuaa=vbuaa_ror_6 rol rol rol and #3 - sta screenlayer__6 // __conio.mapheight = VERA_LAYER_DIM[ (config & VERA_LAYER_HEIGHT_MASK) >> 6] - // [1859] *((char *)&__conio+9) = screenlayer::VERA_LAYER_DIM[screenlayer::$6] -- _deref_pbuc1=pbuc2_derefidx_vbum1 + // [2039] *((char *)&__conio+9) = screenlayer::VERA_LAYER_DIM[screenlayer::$6] -- _deref_pbuc1=pbuc2_derefidx_vbuaa tay lda VERA_LAYER_DIM,y sta __conio+9 // __conio.rowskip = VERA_LAYER_SKIP[(config & VERA_LAYER_WIDTH_MASK)>>4] - // [1860] screenlayer::$16 = screenlayer::$8 << 1 -- vbum1=vbum1_rol_1 - asl screenlayer__16 - // [1861] *((unsigned int *)&__conio+$a) = screenlayer::VERA_LAYER_SKIP[screenlayer::$16] -- _deref_pwuc1=pwuc2_derefidx_vbum1 + // [2040] screenlayer::$16 = screenlayer::$8 << 1 -- vbuaa=vbuxx_rol_1 + txa + asl + // [2041] *((unsigned int *)&__conio+$a) = screenlayer::VERA_LAYER_SKIP[screenlayer::$16] -- _deref_pwuc1=pwuc2_derefidx_vbuaa // __conio.rowshift = ((config & VERA_LAYER_WIDTH_MASK)>>4)+6; - ldy screenlayer__16 + tay lda VERA_LAYER_SKIP,y sta __conio+$a lda VERA_LAYER_SKIP+1,y sta __conio+$a+1 // vera_dc_hscale_temp == 0x80 - // [1862] screenlayer::$9 = screenlayer::vera_dc_hscale_temp#0 == $80 -- vboz1=vbum2_eq_vbuc1 + // [2042] screenlayer::$9 = screenlayer::vera_dc_hscale_temp#0 == $80 -- vboaa=vbum1_eq_vbuc1 lda vera_dc_hscale_temp eor #$80 beq !+ lda #1 !: eor #1 - sta.z screenlayer__9 // 40 << (char)(vera_dc_hscale_temp == 0x80) - // [1863] screenlayer::$18 = (char)screenlayer::$9 - // [1864] screenlayer::$10 = $28 << screenlayer::$18 -- vbuz1=vbuc1_rol_vbuz1 + // [2043] screenlayer::$18 = (char)screenlayer::$9 -- vbuxx=vbuaa + tax + // [2044] screenlayer::$10 = $28 << screenlayer::$18 -- vbuaa=vbuc1_rol_vbuxx lda #$28 - ldy.z screenlayer__10 - cpy #0 + cpx #0 beq !e+ !: asl - dey + dex bne !- !e: - sta.z screenlayer__10 // (40 << (char)(vera_dc_hscale_temp == 0x80))-1 - // [1865] screenlayer::$11 = screenlayer::$10 - 1 -- vbuz1=vbuz1_minus_1 - dec.z screenlayer__11 + // [2045] screenlayer::$11 = screenlayer::$10 - 1 -- vbuaa=vbuaa_minus_1 + sec + sbc #1 // __conio.width = (40 << (char)(vera_dc_hscale_temp == 0x80))-1 - // [1866] *((char *)&__conio+6) = screenlayer::$11 -- _deref_pbuc1=vbuz1 - lda.z screenlayer__11 + // [2046] *((char *)&__conio+6) = screenlayer::$11 -- _deref_pbuc1=vbuaa sta __conio+6 // vera_dc_vscale_temp == 0x80 - // [1867] screenlayer::$12 = screenlayer::vera_dc_vscale_temp#0 == $80 -- vboz1=vbum2_eq_vbuc1 + // [2047] screenlayer::$12 = screenlayer::vera_dc_vscale_temp#0 == $80 -- vboaa=vbum1_eq_vbuc1 lda vera_dc_vscale_temp eor #$80 beq !+ lda #1 !: eor #1 - sta.z screenlayer__12 // 30 << (char)(vera_dc_vscale_temp == 0x80) - // [1868] screenlayer::$19 = (char)screenlayer::$12 - // [1869] screenlayer::$13 = $1e << screenlayer::$19 -- vbuz1=vbuc1_rol_vbuz1 + // [2048] screenlayer::$19 = (char)screenlayer::$12 -- vbuxx=vbuaa + tax + // [2049] screenlayer::$13 = $1e << screenlayer::$19 -- vbuaa=vbuc1_rol_vbuxx lda #$1e - ldy.z screenlayer__13 - cpy #0 + cpx #0 beq !e+ !: asl - dey + dex bne !- !e: - sta.z screenlayer__13 // (30 << (char)(vera_dc_vscale_temp == 0x80))-1 - // [1870] screenlayer::$14 = screenlayer::$13 - 1 -- vbuz1=vbuz1_minus_1 - dec.z screenlayer__14 + // [2050] screenlayer::$14 = screenlayer::$13 - 1 -- vbuaa=vbuaa_minus_1 + sec + sbc #1 // __conio.height = (30 << (char)(vera_dc_vscale_temp == 0x80))-1 - // [1871] *((char *)&__conio+7) = screenlayer::$14 -- _deref_pbuc1=vbuz1 - lda.z screenlayer__14 + // [2051] *((char *)&__conio+7) = screenlayer::$14 -- _deref_pbuc1=vbuaa sta __conio+7 // unsigned int mapbase_offset = __conio.mapbase_offset - // [1872] screenlayer::mapbase_offset#0 = *((unsigned int *)&__conio+3) -- vwum1=_deref_pwuc1 + // [2052] screenlayer::mapbase_offset#0 = *((unsigned int *)&__conio+3) -- vwum1=_deref_pwuc1 lda __conio+3 sta mapbase_offset lda __conio+3+1 sta mapbase_offset+1 - // [1873] phi from screenlayer to screenlayer::@1 [phi:screenlayer->screenlayer::@1] - // [1873] phi screenlayer::mapbase_offset#2 = screenlayer::mapbase_offset#0 [phi:screenlayer->screenlayer::@1#0] -- register_copy - // [1873] phi screenlayer::y#2 = 0 [phi:screenlayer->screenlayer::@1#1] -- vbuz1=vbuc1 - lda #0 - sta.z y + // [2053] phi from screenlayer to screenlayer::@1 [phi:screenlayer->screenlayer::@1] + // [2053] phi screenlayer::mapbase_offset#2 = screenlayer::mapbase_offset#0 [phi:screenlayer->screenlayer::@1#0] -- register_copy + // [2053] phi screenlayer::y#2 = 0 [phi:screenlayer->screenlayer::@1#1] -- vbuxx=vbuc1 + ldx #0 // screenlayer::@1 __b1: // for(register char y=0; y<=__conio.height; y++) - // [1874] if(screenlayer::y#2<=*((char *)&__conio+7)) goto screenlayer::@2 -- vbuz1_le__deref_pbuc1_then_la1 + // [2054] if(screenlayer::y#2<=*((char *)&__conio+7)) goto screenlayer::@2 -- vbuxx_le__deref_pbuc1_then_la1 lda __conio+7 - cmp.z y + stx.z $ff + cmp.z $ff bcs __b2 // screenlayer::@return // } - // [1875] return + // [2055] return rts // screenlayer::@2 __b2: // __conio.offsets[y] = mapbase_offset - // [1876] screenlayer::$17 = screenlayer::y#2 << 1 -- vbuz1=vbuz2_rol_1 - lda.z y + // [2056] screenlayer::$17 = screenlayer::y#2 << 1 -- vbuaa=vbuxx_rol_1 + txa asl - sta.z screenlayer__17 - // [1877] ((unsigned int *)&__conio+$15)[screenlayer::$17] = screenlayer::mapbase_offset#2 -- pwuc1_derefidx_vbuz1=vwum2 + // [2057] ((unsigned int *)&__conio+$15)[screenlayer::$17] = screenlayer::mapbase_offset#2 -- pwuc1_derefidx_vbuaa=vwum1 tay lda mapbase_offset sta __conio+$15,y lda mapbase_offset+1 sta __conio+$15+1,y // mapbase_offset += __conio.rowskip - // [1878] screenlayer::mapbase_offset#1 = screenlayer::mapbase_offset#2 + *((unsigned int *)&__conio+$a) -- vwum1=vwum1_plus__deref_pwuc1 + // [2058] screenlayer::mapbase_offset#1 = screenlayer::mapbase_offset#2 + *((unsigned int *)&__conio+$a) -- vwum1=vwum1_plus__deref_pwuc1 clc lda mapbase_offset adc __conio+$a @@ -12839,22 +13404,16 @@ screenlayer: { adc __conio+$a+1 sta mapbase_offset+1 // for(register char y=0; y<=__conio.height; y++) - // [1879] screenlayer::y#1 = ++ screenlayer::y#2 -- vbuz1=_inc_vbuz1 - inc.z y - // [1873] phi from screenlayer::@2 to screenlayer::@1 [phi:screenlayer::@2->screenlayer::@1] - // [1873] phi screenlayer::mapbase_offset#2 = screenlayer::mapbase_offset#1 [phi:screenlayer::@2->screenlayer::@1#0] -- register_copy - // [1873] phi screenlayer::y#2 = screenlayer::y#1 [phi:screenlayer::@2->screenlayer::@1#1] -- register_copy + // [2059] screenlayer::y#1 = ++ screenlayer::y#2 -- vbuxx=_inc_vbuxx + inx + // [2053] phi from screenlayer::@2 to screenlayer::@1 [phi:screenlayer::@2->screenlayer::@1] + // [2053] phi screenlayer::mapbase_offset#2 = screenlayer::mapbase_offset#1 [phi:screenlayer::@2->screenlayer::@1#0] -- register_copy + // [2053] phi screenlayer::y#2 = screenlayer::y#1 [phi:screenlayer::@2->screenlayer::@1#1] -- register_copy jmp __b1 .segment Data VERA_LAYER_DIM: .byte $1f, $3f, $7f, $ff VERA_LAYER_SKIP: .word $40, $80, $100, $200 - screenlayer__2: .word 0 - screenlayer__5: .byte 0 - .label screenlayer__6 = screenlayer__5 - screenlayer__7: .byte 0 - .label screenlayer__8 = screenlayer__7 - .label screenlayer__16 = screenlayer__7 - mapbase: .byte 0 + .label screenlayer__2 = conio_x16_init.conio_x16_init__4 config: .byte 0 vera_dc_hscale_temp: .byte 0 vera_dc_vscale_temp: .byte 0 @@ -12865,61 +13424,60 @@ screenlayer: { // Scroll the entire screen if the cursor is beyond the last line cscroll: { // if(__conio.cursor_y>__conio.height) - // [1880] if(*((char *)&__conio+1)<=*((char *)&__conio+7)) goto cscroll::@return -- _deref_pbuc1_le__deref_pbuc2_then_la1 + // [2060] if(*((char *)&__conio+1)<=*((char *)&__conio+7)) goto cscroll::@return -- _deref_pbuc1_le__deref_pbuc2_then_la1 lda __conio+7 cmp __conio+1 bcs __breturn // cscroll::@1 // if(__conio.scroll[__conio.layer]) - // [1881] if(0!=((char *)&__conio+$f)[*((char *)&__conio+2)]) goto cscroll::@4 -- 0_neq_pbuc1_derefidx_(_deref_pbuc2)_then_la1 + // [2061] if(0!=((char *)&__conio+$f)[*((char *)&__conio+2)]) goto cscroll::@4 -- 0_neq_pbuc1_derefidx_(_deref_pbuc2)_then_la1 ldy __conio+2 lda __conio+$f,y cmp #0 bne __b4 // cscroll::@2 // if(__conio.cursor_y>__conio.height) - // [1882] if(*((char *)&__conio+1)<=*((char *)&__conio+7)) goto cscroll::@return -- _deref_pbuc1_le__deref_pbuc2_then_la1 + // [2062] if(*((char *)&__conio+1)<=*((char *)&__conio+7)) goto cscroll::@return -- _deref_pbuc1_le__deref_pbuc2_then_la1 lda __conio+7 cmp __conio+1 bcs __breturn - // [1883] phi from cscroll::@2 to cscroll::@3 [phi:cscroll::@2->cscroll::@3] + // [2063] phi from cscroll::@2 to cscroll::@3 [phi:cscroll::@2->cscroll::@3] // cscroll::@3 // gotoxy(0,0) - // [1884] call gotoxy - // [778] phi from cscroll::@3 to gotoxy [phi:cscroll::@3->gotoxy] - // [778] phi gotoxy::y#33 = 0 [phi:cscroll::@3->gotoxy#0] -- vbum1=vbuc1 + // [2064] call gotoxy + // [805] phi from cscroll::@3 to gotoxy [phi:cscroll::@3->gotoxy] + // [805] phi gotoxy::y#37 = 0 [phi:cscroll::@3->gotoxy#0] -- vbum1=vbuc1 lda #0 sta gotoxy.y - // [778] phi gotoxy::x#33 = 0 [phi:cscroll::@3->gotoxy#1] -- vbum1=vbuc1 - sta gotoxy.x + // [805] phi gotoxy::x#37 = 0 [phi:cscroll::@3->gotoxy#1] -- vbuyy=vbuc1 + tay jsr gotoxy // cscroll::@return __breturn: // } - // [1885] return + // [2065] return rts - // [1886] phi from cscroll::@1 to cscroll::@4 [phi:cscroll::@1->cscroll::@4] + // [2066] phi from cscroll::@1 to cscroll::@4 [phi:cscroll::@1->cscroll::@4] // cscroll::@4 __b4: // insertup(1) - // [1887] call insertup + // [2067] call insertup jsr insertup // cscroll::@5 // gotoxy( 0, __conio.height) - // [1888] gotoxy::y#3 = *((char *)&__conio+7) -- vbum1=_deref_pbuc1 + // [2068] gotoxy::y#3 = *((char *)&__conio+7) -- vbum1=_deref_pbuc1 lda __conio+7 sta gotoxy.y - // [1889] call gotoxy - // [778] phi from cscroll::@5 to gotoxy [phi:cscroll::@5->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#3 [phi:cscroll::@5->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = 0 [phi:cscroll::@5->gotoxy#1] -- vbum1=vbuc1 - lda #0 - sta gotoxy.x + // [2069] call gotoxy + // [805] phi from cscroll::@5 to gotoxy [phi:cscroll::@5->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#3 [phi:cscroll::@5->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = 0 [phi:cscroll::@5->gotoxy#1] -- vbuyy=vbuc1 + ldy #0 jsr gotoxy - // [1890] phi from cscroll::@5 to cscroll::@6 [phi:cscroll::@5->cscroll::@6] + // [2070] phi from cscroll::@5 to cscroll::@6 [phi:cscroll::@5->cscroll::@6] // cscroll::@6 // clearline() - // [1891] call clearline + // [2071] call clearline jsr clearline rts } @@ -12933,23 +13491,23 @@ display_frame_init_64: { .const vera_display_set_vstart1_start = $13 .const vera_display_set_vstop1_stop = $db // cx16_k_screen_set_mode(0) - // [1892] cx16_k_screen_set_mode::mode = 0 -- vbum1=vbuc1 + // [2072] cx16_k_screen_set_mode::mode = 0 -- vbum1=vbuc1 lda #0 sta cx16_k_screen_set_mode.mode - // [1893] call cx16_k_screen_set_mode + // [2073] call cx16_k_screen_set_mode jsr cx16_k_screen_set_mode - // [1894] phi from display_frame_init_64 to display_frame_init_64::@2 [phi:display_frame_init_64->display_frame_init_64::@2] + // [2074] phi from display_frame_init_64 to display_frame_init_64::@2 [phi:display_frame_init_64->display_frame_init_64::@2] // display_frame_init_64::@2 // screenlayer1() - // [1895] call screenlayer1 + // [2075] call screenlayer1 // Default 80 columns mode. jsr screenlayer1 // display_frame_init_64::@3 // cx16_k_screen_set_charset(3, (char *)0) - // [1896] display_frame_init_64::cx16_k_screen_set_charset1_charset = 3 -- vbum1=vbuc1 + // [2076] display_frame_init_64::cx16_k_screen_set_charset1_charset = 3 -- vbum1=vbuc1 lda #3 sta cx16_k_screen_set_charset1_charset - // [1897] display_frame_init_64::cx16_k_screen_set_charset1_offset = (char *) 0 -- pbum1=pbuc1 + // [2077] display_frame_init_64::cx16_k_screen_set_charset1_offset = (char *) 0 -- pbum1=pbuc1 lda #<0 sta cx16_k_screen_set_charset1_offset sta cx16_k_screen_set_charset1_offset+1 @@ -12962,107 +13520,105 @@ display_frame_init_64: { jsr CX16_SCREEN_SET_CHARSET // display_frame_init_64::vera_display_set_hstart1 // *VERA_CTRL |= VERA_DCSEL - // [1899] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + // [2079] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 lda #VERA_DCSEL ora VERA_CTRL sta VERA_CTRL // *VERA_DC_HSTART = start - // [1900] *VERA_DC_HSTART = display_frame_init_64::vera_display_set_hstart1_start#0 -- _deref_pbuc1=vbuc2 + // [2080] *VERA_DC_HSTART = display_frame_init_64::vera_display_set_hstart1_start#0 -- _deref_pbuc1=vbuc2 lda #vera_display_set_hstart1_start sta VERA_DC_HSTART // display_frame_init_64::vera_display_set_hstop1 // *VERA_CTRL |= VERA_DCSEL - // [1901] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + // [2081] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 lda #VERA_DCSEL ora VERA_CTRL sta VERA_CTRL // *VERA_DC_HSTOP = stop - // [1902] *VERA_DC_HSTOP = display_frame_init_64::vera_display_set_hstop1_stop#0 -- _deref_pbuc1=vbuc2 + // [2082] *VERA_DC_HSTOP = display_frame_init_64::vera_display_set_hstop1_stop#0 -- _deref_pbuc1=vbuc2 lda #vera_display_set_hstop1_stop sta VERA_DC_HSTOP // display_frame_init_64::vera_display_set_vstart1 // *VERA_CTRL |= VERA_DCSEL - // [1903] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + // [2083] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 lda #VERA_DCSEL ora VERA_CTRL sta VERA_CTRL // *VERA_DC_VSTART = start - // [1904] *VERA_DC_VSTART = display_frame_init_64::vera_display_set_vstart1_start#0 -- _deref_pbuc1=vbuc2 + // [2084] *VERA_DC_VSTART = display_frame_init_64::vera_display_set_vstart1_start#0 -- _deref_pbuc1=vbuc2 lda #vera_display_set_vstart1_start sta VERA_DC_VSTART // display_frame_init_64::vera_display_set_vstop1 // *VERA_CTRL |= VERA_DCSEL - // [1905] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + // [2085] *VERA_CTRL = *VERA_CTRL | VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 lda #VERA_DCSEL ora VERA_CTRL sta VERA_CTRL // *VERA_DC_VSTOP = stop - // [1906] *VERA_DC_VSTOP = display_frame_init_64::vera_display_set_vstop1_stop#0 -- _deref_pbuc1=vbuc2 + // [2086] *VERA_DC_VSTOP = display_frame_init_64::vera_display_set_vstop1_stop#0 -- _deref_pbuc1=vbuc2 lda #vera_display_set_vstop1_stop sta VERA_DC_VSTOP // display_frame_init_64::vera_sprites_hide1 // *VERA_CTRL &= ~VERA_DCSEL - // [1907] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [2087] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_DCSEL^$ff and VERA_CTRL sta VERA_CTRL // *VERA_DC_VIDEO &= ~VERA_SPRITES_ENABLE - // [1908] *VERA_DC_VIDEO = *VERA_DC_VIDEO & ~VERA_SPRITES_ENABLE -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [2088] *VERA_DC_VIDEO = *VERA_DC_VIDEO & ~VERA_SPRITES_ENABLE -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_SPRITES_ENABLE^$ff and VERA_DC_VIDEO sta VERA_DC_VIDEO // display_frame_init_64::vera_layer0_hide1 // *VERA_CTRL &= ~VERA_DCSEL - // [1909] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [2089] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_DCSEL^$ff and VERA_CTRL sta VERA_CTRL // *VERA_DC_VIDEO &= ~VERA_LAYER0_ENABLE - // [1910] *VERA_DC_VIDEO = *VERA_DC_VIDEO & ~VERA_LAYER0_ENABLE -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [2090] *VERA_DC_VIDEO = *VERA_DC_VIDEO & ~VERA_LAYER0_ENABLE -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_LAYER0_ENABLE^$ff and VERA_DC_VIDEO sta VERA_DC_VIDEO // display_frame_init_64::vera_layer1_show1 // *VERA_CTRL &= ~VERA_DCSEL - // [1911] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [2091] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_DCSEL^$ff and VERA_CTRL sta VERA_CTRL // *VERA_DC_VIDEO |= VERA_LAYER1_ENABLE - // [1912] *VERA_DC_VIDEO = *VERA_DC_VIDEO | VERA_LAYER1_ENABLE -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + // [2092] *VERA_DC_VIDEO = *VERA_DC_VIDEO | VERA_LAYER1_ENABLE -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 lda #VERA_LAYER1_ENABLE ora VERA_DC_VIDEO sta VERA_DC_VIDEO - // [1913] phi from display_frame_init_64::vera_layer1_show1 to display_frame_init_64::@1 [phi:display_frame_init_64::vera_layer1_show1->display_frame_init_64::@1] + // [2093] phi from display_frame_init_64::vera_layer1_show1 to display_frame_init_64::@1 [phi:display_frame_init_64::vera_layer1_show1->display_frame_init_64::@1] // display_frame_init_64::@1 // textcolor(WHITE) - // [1914] call textcolor + // [2094] call textcolor // Layer 1 is the current text canvas. - // [760] phi from display_frame_init_64::@1 to textcolor [phi:display_frame_init_64::@1->textcolor] - // [760] phi textcolor::color#23 = WHITE [phi:display_frame_init_64::@1->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color + // [787] phi from display_frame_init_64::@1 to textcolor [phi:display_frame_init_64::@1->textcolor] + // [787] phi textcolor::color#23 = WHITE [phi:display_frame_init_64::@1->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor - // [1915] phi from display_frame_init_64::@1 to display_frame_init_64::@4 [phi:display_frame_init_64::@1->display_frame_init_64::@4] + // [2095] phi from display_frame_init_64::@1 to display_frame_init_64::@4 [phi:display_frame_init_64::@1->display_frame_init_64::@4] // display_frame_init_64::@4 // bgcolor(BLUE) - // [1916] call bgcolor + // [2096] call bgcolor // Default text color is white. - // [765] phi from display_frame_init_64::@4 to bgcolor [phi:display_frame_init_64::@4->bgcolor] - // [765] phi bgcolor::color#15 = BLUE [phi:display_frame_init_64::@4->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color + // [792] phi from display_frame_init_64::@4 to bgcolor [phi:display_frame_init_64::@4->bgcolor] + // [792] phi bgcolor::color#15 = BLUE [phi:display_frame_init_64::@4->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor - // [1917] phi from display_frame_init_64::@4 to display_frame_init_64::@5 [phi:display_frame_init_64::@4->display_frame_init_64::@5] + // [2097] phi from display_frame_init_64::@4 to display_frame_init_64::@5 [phi:display_frame_init_64::@4->display_frame_init_64::@5] // display_frame_init_64::@5 // clrscr() - // [1918] call clrscr + // [2098] call clrscr // With a blue background. // cx16-conio.c won't compile scrolling code for this program with the underlying define, resulting in less code overhead! jsr clrscr // display_frame_init_64::@return // } - // [1919] return + // [2099] return rts .segment Data cx16_k_screen_set_charset1_charset: .byte 0 @@ -13075,328 +13631,325 @@ display_frame_init_64: { */ display_frame_draw: { // textcolor(LIGHT_BLUE) - // [1921] call textcolor - // [760] phi from display_frame_draw to textcolor [phi:display_frame_draw->textcolor] - // [760] phi textcolor::color#23 = LIGHT_BLUE [phi:display_frame_draw->textcolor#0] -- vbum1=vbuc1 - lda #LIGHT_BLUE - sta textcolor.color + // [2101] call textcolor + // [787] phi from display_frame_draw to textcolor [phi:display_frame_draw->textcolor] + // [787] phi textcolor::color#23 = LIGHT_BLUE [phi:display_frame_draw->textcolor#0] -- vbuxx=vbuc1 + ldx #LIGHT_BLUE jsr textcolor - // [1922] phi from display_frame_draw to display_frame_draw::@1 [phi:display_frame_draw->display_frame_draw::@1] + // [2102] phi from display_frame_draw to display_frame_draw::@1 [phi:display_frame_draw->display_frame_draw::@1] // display_frame_draw::@1 // bgcolor(BLUE) - // [1923] call bgcolor - // [765] phi from display_frame_draw::@1 to bgcolor [phi:display_frame_draw::@1->bgcolor] - // [765] phi bgcolor::color#15 = BLUE [phi:display_frame_draw::@1->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color + // [2103] call bgcolor + // [792] phi from display_frame_draw::@1 to bgcolor [phi:display_frame_draw::@1->bgcolor] + // [792] phi bgcolor::color#15 = BLUE [phi:display_frame_draw::@1->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor - // [1924] phi from display_frame_draw::@1 to display_frame_draw::@2 [phi:display_frame_draw::@1->display_frame_draw::@2] + // [2104] phi from display_frame_draw::@1 to display_frame_draw::@2 [phi:display_frame_draw::@1->display_frame_draw::@2] // display_frame_draw::@2 // clrscr() - // [1925] call clrscr + // [2105] call clrscr jsr clrscr - // [1926] phi from display_frame_draw::@2 to display_frame_draw::@3 [phi:display_frame_draw::@2->display_frame_draw::@3] + // [2106] phi from display_frame_draw::@2 to display_frame_draw::@3 [phi:display_frame_draw::@2->display_frame_draw::@3] // display_frame_draw::@3 // display_frame(0, 0, 67, 14) - // [1927] call display_frame - // [2583] phi from display_frame_draw::@3 to display_frame [phi:display_frame_draw::@3->display_frame] - // [2583] phi display_frame::y#0 = 0 [phi:display_frame_draw::@3->display_frame#0] -- vbum1=vbuc1 + // [2107] call display_frame + // [2993] phi from display_frame_draw::@3 to display_frame [phi:display_frame_draw::@3->display_frame] + // [2993] phi display_frame::y#0 = 0 [phi:display_frame_draw::@3->display_frame#0] -- vbum1=vbuc1 lda #0 sta display_frame.y - // [2583] phi display_frame::y1#16 = $e [phi:display_frame_draw::@3->display_frame#1] -- vbum1=vbuc1 + // [2993] phi display_frame::y1#16 = $e [phi:display_frame_draw::@3->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2583] phi display_frame::x#0 = 0 [phi:display_frame_draw::@3->display_frame#2] -- vbuz1=vbuc1 + // [2993] phi display_frame::x#0 = 0 [phi:display_frame_draw::@3->display_frame#2] -- vbum1=vbuc1 lda #0 - sta.z display_frame.x - // [2583] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@3->display_frame#3] -- vbum1=vbuc1 + sta display_frame.x + // [2993] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@3->display_frame#3] -- vbum1=vbuc1 lda #$43 sta display_frame.x1 jsr display_frame - // [1928] phi from display_frame_draw::@3 to display_frame_draw::@4 [phi:display_frame_draw::@3->display_frame_draw::@4] + // [2108] phi from display_frame_draw::@3 to display_frame_draw::@4 [phi:display_frame_draw::@3->display_frame_draw::@4] // display_frame_draw::@4 // display_frame(0, 0, 67, 2) - // [1929] call display_frame - // [2583] phi from display_frame_draw::@4 to display_frame [phi:display_frame_draw::@4->display_frame] - // [2583] phi display_frame::y#0 = 0 [phi:display_frame_draw::@4->display_frame#0] -- vbum1=vbuc1 + // [2109] call display_frame + // [2993] phi from display_frame_draw::@4 to display_frame [phi:display_frame_draw::@4->display_frame] + // [2993] phi display_frame::y#0 = 0 [phi:display_frame_draw::@4->display_frame#0] -- vbum1=vbuc1 lda #0 sta display_frame.y - // [2583] phi display_frame::y1#16 = 2 [phi:display_frame_draw::@4->display_frame#1] -- vbum1=vbuc1 + // [2993] phi display_frame::y1#16 = 2 [phi:display_frame_draw::@4->display_frame#1] -- vbum1=vbuc1 lda #2 sta display_frame.y1 - // [2583] phi display_frame::x#0 = 0 [phi:display_frame_draw::@4->display_frame#2] -- vbuz1=vbuc1 + // [2993] phi display_frame::x#0 = 0 [phi:display_frame_draw::@4->display_frame#2] -- vbum1=vbuc1 lda #0 - sta.z display_frame.x - // [2583] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@4->display_frame#3] -- vbum1=vbuc1 + sta display_frame.x + // [2993] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@4->display_frame#3] -- vbum1=vbuc1 lda #$43 sta display_frame.x1 jsr display_frame - // [1930] phi from display_frame_draw::@4 to display_frame_draw::@5 [phi:display_frame_draw::@4->display_frame_draw::@5] + // [2110] phi from display_frame_draw::@4 to display_frame_draw::@5 [phi:display_frame_draw::@4->display_frame_draw::@5] // display_frame_draw::@5 // display_frame(0, 2, 67, 14) - // [1931] call display_frame - // [2583] phi from display_frame_draw::@5 to display_frame [phi:display_frame_draw::@5->display_frame] - // [2583] phi display_frame::y#0 = 2 [phi:display_frame_draw::@5->display_frame#0] -- vbum1=vbuc1 + // [2111] call display_frame + // [2993] phi from display_frame_draw::@5 to display_frame [phi:display_frame_draw::@5->display_frame] + // [2993] phi display_frame::y#0 = 2 [phi:display_frame_draw::@5->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2583] phi display_frame::y1#16 = $e [phi:display_frame_draw::@5->display_frame#1] -- vbum1=vbuc1 + // [2993] phi display_frame::y1#16 = $e [phi:display_frame_draw::@5->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2583] phi display_frame::x#0 = 0 [phi:display_frame_draw::@5->display_frame#2] -- vbuz1=vbuc1 + // [2993] phi display_frame::x#0 = 0 [phi:display_frame_draw::@5->display_frame#2] -- vbum1=vbuc1 lda #0 - sta.z display_frame.x - // [2583] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@5->display_frame#3] -- vbum1=vbuc1 + sta display_frame.x + // [2993] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@5->display_frame#3] -- vbum1=vbuc1 lda #$43 sta display_frame.x1 jsr display_frame - // [1932] phi from display_frame_draw::@5 to display_frame_draw::@6 [phi:display_frame_draw::@5->display_frame_draw::@6] + // [2112] phi from display_frame_draw::@5 to display_frame_draw::@6 [phi:display_frame_draw::@5->display_frame_draw::@6] // display_frame_draw::@6 // display_frame(0, 2, 8, 14) - // [1933] call display_frame + // [2113] call display_frame // Chipset areas - // [2583] phi from display_frame_draw::@6 to display_frame [phi:display_frame_draw::@6->display_frame] - // [2583] phi display_frame::y#0 = 2 [phi:display_frame_draw::@6->display_frame#0] -- vbum1=vbuc1 + // [2993] phi from display_frame_draw::@6 to display_frame [phi:display_frame_draw::@6->display_frame] + // [2993] phi display_frame::y#0 = 2 [phi:display_frame_draw::@6->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2583] phi display_frame::y1#16 = $e [phi:display_frame_draw::@6->display_frame#1] -- vbum1=vbuc1 + // [2993] phi display_frame::y1#16 = $e [phi:display_frame_draw::@6->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2583] phi display_frame::x#0 = 0 [phi:display_frame_draw::@6->display_frame#2] -- vbuz1=vbuc1 + // [2993] phi display_frame::x#0 = 0 [phi:display_frame_draw::@6->display_frame#2] -- vbum1=vbuc1 lda #0 - sta.z display_frame.x - // [2583] phi display_frame::x1#16 = 8 [phi:display_frame_draw::@6->display_frame#3] -- vbum1=vbuc1 + sta display_frame.x + // [2993] phi display_frame::x1#16 = 8 [phi:display_frame_draw::@6->display_frame#3] -- vbum1=vbuc1 lda #8 sta display_frame.x1 jsr display_frame - // [1934] phi from display_frame_draw::@6 to display_frame_draw::@7 [phi:display_frame_draw::@6->display_frame_draw::@7] + // [2114] phi from display_frame_draw::@6 to display_frame_draw::@7 [phi:display_frame_draw::@6->display_frame_draw::@7] // display_frame_draw::@7 // display_frame(8, 2, 19, 14) - // [1935] call display_frame - // [2583] phi from display_frame_draw::@7 to display_frame [phi:display_frame_draw::@7->display_frame] - // [2583] phi display_frame::y#0 = 2 [phi:display_frame_draw::@7->display_frame#0] -- vbum1=vbuc1 + // [2115] call display_frame + // [2993] phi from display_frame_draw::@7 to display_frame [phi:display_frame_draw::@7->display_frame] + // [2993] phi display_frame::y#0 = 2 [phi:display_frame_draw::@7->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2583] phi display_frame::y1#16 = $e [phi:display_frame_draw::@7->display_frame#1] -- vbum1=vbuc1 + // [2993] phi display_frame::y1#16 = $e [phi:display_frame_draw::@7->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2583] phi display_frame::x#0 = 8 [phi:display_frame_draw::@7->display_frame#2] -- vbuz1=vbuc1 + // [2993] phi display_frame::x#0 = 8 [phi:display_frame_draw::@7->display_frame#2] -- vbum1=vbuc1 lda #8 - sta.z display_frame.x - // [2583] phi display_frame::x1#16 = $13 [phi:display_frame_draw::@7->display_frame#3] -- vbum1=vbuc1 + sta display_frame.x + // [2993] phi display_frame::x1#16 = $13 [phi:display_frame_draw::@7->display_frame#3] -- vbum1=vbuc1 lda #$13 sta display_frame.x1 jsr display_frame - // [1936] phi from display_frame_draw::@7 to display_frame_draw::@8 [phi:display_frame_draw::@7->display_frame_draw::@8] + // [2116] phi from display_frame_draw::@7 to display_frame_draw::@8 [phi:display_frame_draw::@7->display_frame_draw::@8] // display_frame_draw::@8 // display_frame(19, 2, 25, 14) - // [1937] call display_frame - // [2583] phi from display_frame_draw::@8 to display_frame [phi:display_frame_draw::@8->display_frame] - // [2583] phi display_frame::y#0 = 2 [phi:display_frame_draw::@8->display_frame#0] -- vbum1=vbuc1 + // [2117] call display_frame + // [2993] phi from display_frame_draw::@8 to display_frame [phi:display_frame_draw::@8->display_frame] + // [2993] phi display_frame::y#0 = 2 [phi:display_frame_draw::@8->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2583] phi display_frame::y1#16 = $e [phi:display_frame_draw::@8->display_frame#1] -- vbum1=vbuc1 + // [2993] phi display_frame::y1#16 = $e [phi:display_frame_draw::@8->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2583] phi display_frame::x#0 = $13 [phi:display_frame_draw::@8->display_frame#2] -- vbuz1=vbuc1 + // [2993] phi display_frame::x#0 = $13 [phi:display_frame_draw::@8->display_frame#2] -- vbum1=vbuc1 lda #$13 - sta.z display_frame.x - // [2583] phi display_frame::x1#16 = $19 [phi:display_frame_draw::@8->display_frame#3] -- vbum1=vbuc1 + sta display_frame.x + // [2993] phi display_frame::x1#16 = $19 [phi:display_frame_draw::@8->display_frame#3] -- vbum1=vbuc1 lda #$19 sta display_frame.x1 jsr display_frame - // [1938] phi from display_frame_draw::@8 to display_frame_draw::@9 [phi:display_frame_draw::@8->display_frame_draw::@9] + // [2118] phi from display_frame_draw::@8 to display_frame_draw::@9 [phi:display_frame_draw::@8->display_frame_draw::@9] // display_frame_draw::@9 // display_frame(25, 2, 31, 14) - // [1939] call display_frame - // [2583] phi from display_frame_draw::@9 to display_frame [phi:display_frame_draw::@9->display_frame] - // [2583] phi display_frame::y#0 = 2 [phi:display_frame_draw::@9->display_frame#0] -- vbum1=vbuc1 + // [2119] call display_frame + // [2993] phi from display_frame_draw::@9 to display_frame [phi:display_frame_draw::@9->display_frame] + // [2993] phi display_frame::y#0 = 2 [phi:display_frame_draw::@9->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2583] phi display_frame::y1#16 = $e [phi:display_frame_draw::@9->display_frame#1] -- vbum1=vbuc1 + // [2993] phi display_frame::y1#16 = $e [phi:display_frame_draw::@9->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2583] phi display_frame::x#0 = $19 [phi:display_frame_draw::@9->display_frame#2] -- vbuz1=vbuc1 + // [2993] phi display_frame::x#0 = $19 [phi:display_frame_draw::@9->display_frame#2] -- vbum1=vbuc1 lda #$19 - sta.z display_frame.x - // [2583] phi display_frame::x1#16 = $1f [phi:display_frame_draw::@9->display_frame#3] -- vbum1=vbuc1 + sta display_frame.x + // [2993] phi display_frame::x1#16 = $1f [phi:display_frame_draw::@9->display_frame#3] -- vbum1=vbuc1 lda #$1f sta display_frame.x1 jsr display_frame - // [1940] phi from display_frame_draw::@9 to display_frame_draw::@10 [phi:display_frame_draw::@9->display_frame_draw::@10] + // [2120] phi from display_frame_draw::@9 to display_frame_draw::@10 [phi:display_frame_draw::@9->display_frame_draw::@10] // display_frame_draw::@10 // display_frame(31, 2, 37, 14) - // [1941] call display_frame - // [2583] phi from display_frame_draw::@10 to display_frame [phi:display_frame_draw::@10->display_frame] - // [2583] phi display_frame::y#0 = 2 [phi:display_frame_draw::@10->display_frame#0] -- vbum1=vbuc1 + // [2121] call display_frame + // [2993] phi from display_frame_draw::@10 to display_frame [phi:display_frame_draw::@10->display_frame] + // [2993] phi display_frame::y#0 = 2 [phi:display_frame_draw::@10->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2583] phi display_frame::y1#16 = $e [phi:display_frame_draw::@10->display_frame#1] -- vbum1=vbuc1 + // [2993] phi display_frame::y1#16 = $e [phi:display_frame_draw::@10->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2583] phi display_frame::x#0 = $1f [phi:display_frame_draw::@10->display_frame#2] -- vbuz1=vbuc1 + // [2993] phi display_frame::x#0 = $1f [phi:display_frame_draw::@10->display_frame#2] -- vbum1=vbuc1 lda #$1f - sta.z display_frame.x - // [2583] phi display_frame::x1#16 = $25 [phi:display_frame_draw::@10->display_frame#3] -- vbum1=vbuc1 + sta display_frame.x + // [2993] phi display_frame::x1#16 = $25 [phi:display_frame_draw::@10->display_frame#3] -- vbum1=vbuc1 lda #$25 sta display_frame.x1 jsr display_frame - // [1942] phi from display_frame_draw::@10 to display_frame_draw::@11 [phi:display_frame_draw::@10->display_frame_draw::@11] + // [2122] phi from display_frame_draw::@10 to display_frame_draw::@11 [phi:display_frame_draw::@10->display_frame_draw::@11] // display_frame_draw::@11 // display_frame(37, 2, 43, 14) - // [1943] call display_frame - // [2583] phi from display_frame_draw::@11 to display_frame [phi:display_frame_draw::@11->display_frame] - // [2583] phi display_frame::y#0 = 2 [phi:display_frame_draw::@11->display_frame#0] -- vbum1=vbuc1 + // [2123] call display_frame + // [2993] phi from display_frame_draw::@11 to display_frame [phi:display_frame_draw::@11->display_frame] + // [2993] phi display_frame::y#0 = 2 [phi:display_frame_draw::@11->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2583] phi display_frame::y1#16 = $e [phi:display_frame_draw::@11->display_frame#1] -- vbum1=vbuc1 + // [2993] phi display_frame::y1#16 = $e [phi:display_frame_draw::@11->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2583] phi display_frame::x#0 = $25 [phi:display_frame_draw::@11->display_frame#2] -- vbuz1=vbuc1 + // [2993] phi display_frame::x#0 = $25 [phi:display_frame_draw::@11->display_frame#2] -- vbum1=vbuc1 lda #$25 - sta.z display_frame.x - // [2583] phi display_frame::x1#16 = $2b [phi:display_frame_draw::@11->display_frame#3] -- vbum1=vbuc1 + sta display_frame.x + // [2993] phi display_frame::x1#16 = $2b [phi:display_frame_draw::@11->display_frame#3] -- vbum1=vbuc1 lda #$2b sta display_frame.x1 jsr display_frame - // [1944] phi from display_frame_draw::@11 to display_frame_draw::@12 [phi:display_frame_draw::@11->display_frame_draw::@12] + // [2124] phi from display_frame_draw::@11 to display_frame_draw::@12 [phi:display_frame_draw::@11->display_frame_draw::@12] // display_frame_draw::@12 // display_frame(43, 2, 49, 14) - // [1945] call display_frame - // [2583] phi from display_frame_draw::@12 to display_frame [phi:display_frame_draw::@12->display_frame] - // [2583] phi display_frame::y#0 = 2 [phi:display_frame_draw::@12->display_frame#0] -- vbum1=vbuc1 + // [2125] call display_frame + // [2993] phi from display_frame_draw::@12 to display_frame [phi:display_frame_draw::@12->display_frame] + // [2993] phi display_frame::y#0 = 2 [phi:display_frame_draw::@12->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2583] phi display_frame::y1#16 = $e [phi:display_frame_draw::@12->display_frame#1] -- vbum1=vbuc1 + // [2993] phi display_frame::y1#16 = $e [phi:display_frame_draw::@12->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2583] phi display_frame::x#0 = $2b [phi:display_frame_draw::@12->display_frame#2] -- vbuz1=vbuc1 + // [2993] phi display_frame::x#0 = $2b [phi:display_frame_draw::@12->display_frame#2] -- vbum1=vbuc1 lda #$2b - sta.z display_frame.x - // [2583] phi display_frame::x1#16 = $31 [phi:display_frame_draw::@12->display_frame#3] -- vbum1=vbuc1 + sta display_frame.x + // [2993] phi display_frame::x1#16 = $31 [phi:display_frame_draw::@12->display_frame#3] -- vbum1=vbuc1 lda #$31 sta display_frame.x1 jsr display_frame - // [1946] phi from display_frame_draw::@12 to display_frame_draw::@13 [phi:display_frame_draw::@12->display_frame_draw::@13] + // [2126] phi from display_frame_draw::@12 to display_frame_draw::@13 [phi:display_frame_draw::@12->display_frame_draw::@13] // display_frame_draw::@13 // display_frame(49, 2, 55, 14) - // [1947] call display_frame - // [2583] phi from display_frame_draw::@13 to display_frame [phi:display_frame_draw::@13->display_frame] - // [2583] phi display_frame::y#0 = 2 [phi:display_frame_draw::@13->display_frame#0] -- vbum1=vbuc1 + // [2127] call display_frame + // [2993] phi from display_frame_draw::@13 to display_frame [phi:display_frame_draw::@13->display_frame] + // [2993] phi display_frame::y#0 = 2 [phi:display_frame_draw::@13->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2583] phi display_frame::y1#16 = $e [phi:display_frame_draw::@13->display_frame#1] -- vbum1=vbuc1 + // [2993] phi display_frame::y1#16 = $e [phi:display_frame_draw::@13->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2583] phi display_frame::x#0 = $31 [phi:display_frame_draw::@13->display_frame#2] -- vbuz1=vbuc1 + // [2993] phi display_frame::x#0 = $31 [phi:display_frame_draw::@13->display_frame#2] -- vbum1=vbuc1 lda #$31 - sta.z display_frame.x - // [2583] phi display_frame::x1#16 = $37 [phi:display_frame_draw::@13->display_frame#3] -- vbum1=vbuc1 + sta display_frame.x + // [2993] phi display_frame::x1#16 = $37 [phi:display_frame_draw::@13->display_frame#3] -- vbum1=vbuc1 lda #$37 sta display_frame.x1 jsr display_frame - // [1948] phi from display_frame_draw::@13 to display_frame_draw::@14 [phi:display_frame_draw::@13->display_frame_draw::@14] + // [2128] phi from display_frame_draw::@13 to display_frame_draw::@14 [phi:display_frame_draw::@13->display_frame_draw::@14] // display_frame_draw::@14 // display_frame(55, 2, 61, 14) - // [1949] call display_frame - // [2583] phi from display_frame_draw::@14 to display_frame [phi:display_frame_draw::@14->display_frame] - // [2583] phi display_frame::y#0 = 2 [phi:display_frame_draw::@14->display_frame#0] -- vbum1=vbuc1 + // [2129] call display_frame + // [2993] phi from display_frame_draw::@14 to display_frame [phi:display_frame_draw::@14->display_frame] + // [2993] phi display_frame::y#0 = 2 [phi:display_frame_draw::@14->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2583] phi display_frame::y1#16 = $e [phi:display_frame_draw::@14->display_frame#1] -- vbum1=vbuc1 + // [2993] phi display_frame::y1#16 = $e [phi:display_frame_draw::@14->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2583] phi display_frame::x#0 = $37 [phi:display_frame_draw::@14->display_frame#2] -- vbuz1=vbuc1 + // [2993] phi display_frame::x#0 = $37 [phi:display_frame_draw::@14->display_frame#2] -- vbum1=vbuc1 lda #$37 - sta.z display_frame.x - // [2583] phi display_frame::x1#16 = $3d [phi:display_frame_draw::@14->display_frame#3] -- vbum1=vbuc1 + sta display_frame.x + // [2993] phi display_frame::x1#16 = $3d [phi:display_frame_draw::@14->display_frame#3] -- vbum1=vbuc1 lda #$3d sta display_frame.x1 jsr display_frame - // [1950] phi from display_frame_draw::@14 to display_frame_draw::@15 [phi:display_frame_draw::@14->display_frame_draw::@15] + // [2130] phi from display_frame_draw::@14 to display_frame_draw::@15 [phi:display_frame_draw::@14->display_frame_draw::@15] // display_frame_draw::@15 // display_frame(61, 2, 67, 14) - // [1951] call display_frame - // [2583] phi from display_frame_draw::@15 to display_frame [phi:display_frame_draw::@15->display_frame] - // [2583] phi display_frame::y#0 = 2 [phi:display_frame_draw::@15->display_frame#0] -- vbum1=vbuc1 + // [2131] call display_frame + // [2993] phi from display_frame_draw::@15 to display_frame [phi:display_frame_draw::@15->display_frame] + // [2993] phi display_frame::y#0 = 2 [phi:display_frame_draw::@15->display_frame#0] -- vbum1=vbuc1 lda #2 sta display_frame.y - // [2583] phi display_frame::y1#16 = $e [phi:display_frame_draw::@15->display_frame#1] -- vbum1=vbuc1 + // [2993] phi display_frame::y1#16 = $e [phi:display_frame_draw::@15->display_frame#1] -- vbum1=vbuc1 lda #$e sta display_frame.y1 - // [2583] phi display_frame::x#0 = $3d [phi:display_frame_draw::@15->display_frame#2] -- vbuz1=vbuc1 + // [2993] phi display_frame::x#0 = $3d [phi:display_frame_draw::@15->display_frame#2] -- vbum1=vbuc1 lda #$3d - sta.z display_frame.x - // [2583] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@15->display_frame#3] -- vbum1=vbuc1 + sta display_frame.x + // [2993] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@15->display_frame#3] -- vbum1=vbuc1 lda #$43 sta display_frame.x1 jsr display_frame - // [1952] phi from display_frame_draw::@15 to display_frame_draw::@16 [phi:display_frame_draw::@15->display_frame_draw::@16] + // [2132] phi from display_frame_draw::@15 to display_frame_draw::@16 [phi:display_frame_draw::@15->display_frame_draw::@16] // display_frame_draw::@16 // display_frame(0, 14, 67, PROGRESS_Y-5) - // [1953] call display_frame + // [2133] call display_frame // Progress area - // [2583] phi from display_frame_draw::@16 to display_frame [phi:display_frame_draw::@16->display_frame] - // [2583] phi display_frame::y#0 = $e [phi:display_frame_draw::@16->display_frame#0] -- vbum1=vbuc1 + // [2993] phi from display_frame_draw::@16 to display_frame [phi:display_frame_draw::@16->display_frame] + // [2993] phi display_frame::y#0 = $e [phi:display_frame_draw::@16->display_frame#0] -- vbum1=vbuc1 lda #$e sta display_frame.y - // [2583] phi display_frame::y1#16 = PROGRESS_Y-5 [phi:display_frame_draw::@16->display_frame#1] -- vbum1=vbuc1 + // [2993] phi display_frame::y1#16 = PROGRESS_Y-5 [phi:display_frame_draw::@16->display_frame#1] -- vbum1=vbuc1 lda #PROGRESS_Y-5 sta display_frame.y1 - // [2583] phi display_frame::x#0 = 0 [phi:display_frame_draw::@16->display_frame#2] -- vbuz1=vbuc1 + // [2993] phi display_frame::x#0 = 0 [phi:display_frame_draw::@16->display_frame#2] -- vbum1=vbuc1 lda #0 - sta.z display_frame.x - // [2583] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@16->display_frame#3] -- vbum1=vbuc1 + sta display_frame.x + // [2993] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@16->display_frame#3] -- vbum1=vbuc1 lda #$43 sta display_frame.x1 jsr display_frame - // [1954] phi from display_frame_draw::@16 to display_frame_draw::@17 [phi:display_frame_draw::@16->display_frame_draw::@17] + // [2134] phi from display_frame_draw::@16 to display_frame_draw::@17 [phi:display_frame_draw::@16->display_frame_draw::@17] // display_frame_draw::@17 // display_frame(0, PROGRESS_Y-5, 67, PROGRESS_Y-2) - // [1955] call display_frame - // [2583] phi from display_frame_draw::@17 to display_frame [phi:display_frame_draw::@17->display_frame] - // [2583] phi display_frame::y#0 = PROGRESS_Y-5 [phi:display_frame_draw::@17->display_frame#0] -- vbum1=vbuc1 + // [2135] call display_frame + // [2993] phi from display_frame_draw::@17 to display_frame [phi:display_frame_draw::@17->display_frame] + // [2993] phi display_frame::y#0 = PROGRESS_Y-5 [phi:display_frame_draw::@17->display_frame#0] -- vbum1=vbuc1 lda #PROGRESS_Y-5 sta display_frame.y - // [2583] phi display_frame::y1#16 = PROGRESS_Y-2 [phi:display_frame_draw::@17->display_frame#1] -- vbum1=vbuc1 + // [2993] phi display_frame::y1#16 = PROGRESS_Y-2 [phi:display_frame_draw::@17->display_frame#1] -- vbum1=vbuc1 lda #PROGRESS_Y-2 sta display_frame.y1 - // [2583] phi display_frame::x#0 = 0 [phi:display_frame_draw::@17->display_frame#2] -- vbuz1=vbuc1 + // [2993] phi display_frame::x#0 = 0 [phi:display_frame_draw::@17->display_frame#2] -- vbum1=vbuc1 lda #0 - sta.z display_frame.x - // [2583] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@17->display_frame#3] -- vbum1=vbuc1 + sta display_frame.x + // [2993] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@17->display_frame#3] -- vbum1=vbuc1 lda #$43 sta display_frame.x1 jsr display_frame - // [1956] phi from display_frame_draw::@17 to display_frame_draw::@18 [phi:display_frame_draw::@17->display_frame_draw::@18] + // [2136] phi from display_frame_draw::@17 to display_frame_draw::@18 [phi:display_frame_draw::@17->display_frame_draw::@18] // display_frame_draw::@18 // display_frame(0, PROGRESS_Y-2, 67, 49) - // [1957] call display_frame - // [2583] phi from display_frame_draw::@18 to display_frame [phi:display_frame_draw::@18->display_frame] - // [2583] phi display_frame::y#0 = PROGRESS_Y-2 [phi:display_frame_draw::@18->display_frame#0] -- vbum1=vbuc1 + // [2137] call display_frame + // [2993] phi from display_frame_draw::@18 to display_frame [phi:display_frame_draw::@18->display_frame] + // [2993] phi display_frame::y#0 = PROGRESS_Y-2 [phi:display_frame_draw::@18->display_frame#0] -- vbum1=vbuc1 lda #PROGRESS_Y-2 sta display_frame.y - // [2583] phi display_frame::y1#16 = $31 [phi:display_frame_draw::@18->display_frame#1] -- vbum1=vbuc1 + // [2993] phi display_frame::y1#16 = $31 [phi:display_frame_draw::@18->display_frame#1] -- vbum1=vbuc1 lda #$31 sta display_frame.y1 - // [2583] phi display_frame::x#0 = 0 [phi:display_frame_draw::@18->display_frame#2] -- vbuz1=vbuc1 + // [2993] phi display_frame::x#0 = 0 [phi:display_frame_draw::@18->display_frame#2] -- vbum1=vbuc1 lda #0 - sta.z display_frame.x - // [2583] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@18->display_frame#3] -- vbum1=vbuc1 + sta display_frame.x + // [2993] phi display_frame::x1#16 = $43 [phi:display_frame_draw::@18->display_frame#3] -- vbum1=vbuc1 lda #$43 sta display_frame.x1 jsr display_frame - // [1958] phi from display_frame_draw::@18 to display_frame_draw::@19 [phi:display_frame_draw::@18->display_frame_draw::@19] + // [2138] phi from display_frame_draw::@18 to display_frame_draw::@19 [phi:display_frame_draw::@18->display_frame_draw::@19] // display_frame_draw::@19 // textcolor(WHITE) - // [1959] call textcolor - // [760] phi from display_frame_draw::@19 to textcolor [phi:display_frame_draw::@19->textcolor] - // [760] phi textcolor::color#23 = WHITE [phi:display_frame_draw::@19->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color + // [2139] call textcolor + // [787] phi from display_frame_draw::@19 to textcolor [phi:display_frame_draw::@19->textcolor] + // [787] phi textcolor::color#23 = WHITE [phi:display_frame_draw::@19->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor // display_frame_draw::@return // } - // [1960] return + // [2140] return rts } // display_frame_title @@ -13408,108 +13961,100 @@ display_frame_draw: { // void display_frame_title(char *title_text) display_frame_title: { // gotoxy(2, 1) - // [1962] call gotoxy - // [778] phi from display_frame_title to gotoxy [phi:display_frame_title->gotoxy] - // [778] phi gotoxy::y#33 = 1 [phi:display_frame_title->gotoxy#0] -- vbum1=vbuc1 + // [2142] call gotoxy + // [805] phi from display_frame_title to gotoxy [phi:display_frame_title->gotoxy] + // [805] phi gotoxy::y#37 = 1 [phi:display_frame_title->gotoxy#0] -- vbum1=vbuc1 lda #1 sta gotoxy.y - // [778] phi gotoxy::x#33 = 2 [phi:display_frame_title->gotoxy#1] -- vbum1=vbuc1 - lda #2 - sta gotoxy.x + // [805] phi gotoxy::x#37 = 2 [phi:display_frame_title->gotoxy#1] -- vbuyy=vbuc1 + ldy #2 jsr gotoxy - // [1963] phi from display_frame_title to display_frame_title::@1 [phi:display_frame_title->display_frame_title::@1] + // [2143] phi from display_frame_title to display_frame_title::@1 [phi:display_frame_title->display_frame_title::@1] // display_frame_title::@1 // printf("%-65s", title_text) - // [1964] call printf_string - // [1227] phi from display_frame_title::@1 to printf_string [phi:display_frame_title::@1->printf_string] - // [1227] phi printf_string::putc#25 = &cputc [phi:display_frame_title::@1->printf_string#0] -- pprz1=pprc1 + // [2144] call printf_string + // [1419] phi from display_frame_title::@1 to printf_string [phi:display_frame_title::@1->printf_string] + // [1419] phi printf_string::putc#26 = &cputc [phi:display_frame_title::@1->printf_string#0] -- pprz1=pprc1 lda #cputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = init::title_text [phi:display_frame_title::@1->printf_string#1] -- pbuz1=pbuc1 + // [1419] phi printf_string::str#26 = init::title_text [phi:display_frame_title::@1->printf_string#1] -- pbuz1=pbuc1 lda #init.title_text sta.z printf_string.str+1 - // [1227] phi printf_string::format_justify_left#25 = 1 [phi:display_frame_title::@1->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::format_justify_left#26 = 1 [phi:display_frame_title::@1->printf_string#2] -- vbum1=vbuc1 lda #1 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = $41 [phi:display_frame_title::@1->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = $41 [phi:display_frame_title::@1->printf_string#3] -- vbum1=vbuc1 lda #$41 sta printf_string.format_min_length jsr printf_string // display_frame_title::@return // } - // [1965] return + // [2145] return rts } // cputsxy // Move cursor and output a NUL-terminated string // Same as "gotoxy (x, y); puts (s);" -// void cputsxy(__mem() char x, __mem() char y, __zp($b8) const char *s) +// void cputsxy(__register(Y) char x, __register(X) char y, __zp($76) const char *s) cputsxy: { - .label s = $b8 + .label s = $76 // gotoxy(x, y) - // [1967] gotoxy::x#1 = cputsxy::x#4 -- vbum1=vbum2 - lda x - sta gotoxy.x - // [1968] gotoxy::y#1 = cputsxy::y#4 -- vbum1=vbum2 - lda y - sta gotoxy.y - // [1969] call gotoxy - // [778] phi from cputsxy to gotoxy [phi:cputsxy->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#1 [phi:cputsxy->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = gotoxy::x#1 [phi:cputsxy->gotoxy#1] -- register_copy + // [2147] gotoxy::x#1 = cputsxy::x#4 + // [2148] gotoxy::y#1 = cputsxy::y#4 -- vbum1=vbuxx + stx gotoxy.y + // [2149] call gotoxy + // [805] phi from cputsxy to gotoxy [phi:cputsxy->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#1 [phi:cputsxy->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = gotoxy::x#1 [phi:cputsxy->gotoxy#1] -- register_copy jsr gotoxy // cputsxy::@1 // cputs(s) - // [1970] cputs::s#1 = cputsxy::s#4 -- pbuz1=pbuz2 + // [2150] cputs::s#1 = cputsxy::s#4 -- pbuz1=pbuz2 lda.z s sta.z cputs.s lda.z s+1 sta.z cputs.s+1 - // [1971] call cputs - // [2717] phi from cputsxy::@1 to cputs [phi:cputsxy::@1->cputs] + // [2151] call cputs + // [3127] phi from cputsxy::@1 to cputs [phi:cputsxy::@1->cputs] jsr cputs // cputsxy::@return // } - // [1972] return + // [2152] return rts - .segment Data - y: .byte 0 - x: .byte 0 } -.segment Code // display_chip_vera display_chip_vera: { // display_vera_led(GREY) - // [1974] call display_vera_led - // [2500] phi from display_chip_vera to display_vera_led [phi:display_chip_vera->display_vera_led] - // [2500] phi display_vera_led::c#2 = GREY [phi:display_chip_vera->display_vera_led#0] -- vbum1=vbuc1 + // [2154] call display_vera_led + // [2910] phi from display_chip_vera to display_vera_led [phi:display_chip_vera->display_vera_led] + // [2910] phi display_vera_led::c#2 = GREY [phi:display_chip_vera->display_vera_led#0] -- vbuz1=vbuc1 lda #GREY - sta display_vera_led.c + sta.z display_vera_led.c jsr display_vera_led - // [1975] phi from display_chip_vera to display_chip_vera::@1 [phi:display_chip_vera->display_chip_vera::@1] + // [2155] phi from display_chip_vera to display_chip_vera::@1 [phi:display_chip_vera->display_chip_vera::@1] // display_chip_vera::@1 // display_print_chip(CHIP_VERA_X, CHIP_VERA_Y+2, CHIP_VERA_W, "VERA ") - // [1976] call display_print_chip - // [1995] phi from display_chip_vera::@1 to display_print_chip [phi:display_chip_vera::@1->display_print_chip] - // [1995] phi display_print_chip::text#11 = display_chip_vera::text [phi:display_chip_vera::@1->display_print_chip#0] -- pbuz1=pbuc1 + // [2156] call display_print_chip + // [2175] phi from display_chip_vera::@1 to display_print_chip [phi:display_chip_vera::@1->display_print_chip] + // [2175] phi display_print_chip::text#11 = display_chip_vera::text [phi:display_chip_vera::@1->display_print_chip#0] -- pbuz1=pbuc1 lda #text sta.z display_print_chip.text_2+1 - // [1995] phi display_print_chip::w#10 = 8 [phi:display_chip_vera::@1->display_print_chip#1] -- vbum1=vbuc1 + // [2175] phi display_print_chip::w#10 = 8 [phi:display_chip_vera::@1->display_print_chip#1] -- vbum1=vbuc1 lda #8 sta display_print_chip.w - // [1995] phi display_print_chip::x#10 = 9 [phi:display_chip_vera::@1->display_print_chip#2] -- vbuz1=vbuc1 + // [2175] phi display_print_chip::x#10 = 9 [phi:display_chip_vera::@1->display_print_chip#2] -- vbuz1=vbuc1 lda #9 sta.z display_print_chip.x jsr display_print_chip // display_chip_vera::@return // } - // [1977] return + // [2157] return rts .segment Data text: .text "VERA " @@ -13525,56 +14070,46 @@ display_chip_vera: { * @param tc Fore color * @param bc Back color */ -// void display_info_led(__zp($cd) char x, __zp($c9) char y, __zp($c0) char tc, char bc) +// void display_info_led(__register(Y) char x, __zp($af) char y, __register(X) char tc, char bc) display_info_led: { - .label tc = $c0 - .label y = $c9 - .label x = $cd + .label y = $af // textcolor(tc) - // [1979] textcolor::color#13 = display_info_led::tc#4 -- vbum1=vbuz2 - lda.z tc - sta textcolor.color - // [1980] call textcolor - // [760] phi from display_info_led to textcolor [phi:display_info_led->textcolor] - // [760] phi textcolor::color#23 = textcolor::color#13 [phi:display_info_led->textcolor#0] -- register_copy + // [2159] textcolor::color#13 = display_info_led::tc#4 + // [2160] call textcolor + // [787] phi from display_info_led to textcolor [phi:display_info_led->textcolor] + // [787] phi textcolor::color#23 = textcolor::color#13 [phi:display_info_led->textcolor#0] -- register_copy jsr textcolor - // [1981] phi from display_info_led to display_info_led::@1 [phi:display_info_led->display_info_led::@1] + // [2161] phi from display_info_led to display_info_led::@1 [phi:display_info_led->display_info_led::@1] // display_info_led::@1 // bgcolor(bc) - // [1982] call bgcolor - // [765] phi from display_info_led::@1 to bgcolor [phi:display_info_led::@1->bgcolor] - // [765] phi bgcolor::color#15 = BLUE [phi:display_info_led::@1->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color + // [2162] call bgcolor + // [792] phi from display_info_led::@1 to bgcolor [phi:display_info_led::@1->bgcolor] + // [792] phi bgcolor::color#15 = BLUE [phi:display_info_led::@1->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // display_info_led::@2 // cputcxy(x, y, VERA_CHR_UR) - // [1983] cputcxy::x#11 = display_info_led::x#4 -- vbum1=vbuz2 - lda.z x - sta cputcxy.x - // [1984] cputcxy::y#11 = display_info_led::y#4 -- vbum1=vbuz2 + // [2163] cputcxy::x#11 = display_info_led::x#4 + // [2164] cputcxy::y#11 = display_info_led::y#4 -- vbuaa=vbuz1 lda.z y - sta cputcxy.y - // [1985] call cputcxy - // [2147] phi from display_info_led::@2 to cputcxy [phi:display_info_led::@2->cputcxy] - // [2147] phi cputcxy::c#15 = $7c [phi:display_info_led::@2->cputcxy#0] -- vbum1=vbuc1 - lda #$7c - sta cputcxy.c - // [2147] phi cputcxy::y#15 = cputcxy::y#11 [phi:display_info_led::@2->cputcxy#1] -- register_copy - // [2147] phi cputcxy::x#15 = cputcxy::x#11 [phi:display_info_led::@2->cputcxy#2] -- register_copy + // [2165] call cputcxy + // [2273] phi from display_info_led::@2 to cputcxy [phi:display_info_led::@2->cputcxy] + // [2273] phi cputcxy::c#17 = $7c [phi:display_info_led::@2->cputcxy#0] -- vbuxx=vbuc1 + ldx #$7c + // [2273] phi cputcxy::y#17 = cputcxy::y#11 [phi:display_info_led::@2->cputcxy#1] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#11 [phi:display_info_led::@2->cputcxy#2] -- register_copy jsr cputcxy - // [1986] phi from display_info_led::@2 to display_info_led::@3 [phi:display_info_led::@2->display_info_led::@3] + // [2166] phi from display_info_led::@2 to display_info_led::@3 [phi:display_info_led::@2->display_info_led::@3] // display_info_led::@3 // textcolor(WHITE) - // [1987] call textcolor - // [760] phi from display_info_led::@3 to textcolor [phi:display_info_led::@3->textcolor] - // [760] phi textcolor::color#23 = WHITE [phi:display_info_led::@3->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color + // [2167] call textcolor + // [787] phi from display_info_led::@3 to textcolor [phi:display_info_led::@3->textcolor] + // [787] phi textcolor::color#23 = WHITE [phi:display_info_led::@3->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor // display_info_led::@return // } - // [1988] return + // [2168] return rts } // display_smc_led @@ -13583,39 +14118,38 @@ display_info_led: { * * @param c Led color */ -// void display_smc_led(__zp($c0) char c) +// void display_smc_led(__zp($e6) char c) display_smc_led: { - .label c = $c0 + .label c = $e6 // display_chip_led(CHIP_SMC_X+1, CHIP_SMC_Y, CHIP_SMC_W, c, BLUE) - // [1990] display_chip_led::tc#0 = display_smc_led::c#2 -- vbuz1=vbuz2 - lda.z c - sta.z display_chip_led.tc - // [1991] call display_chip_led - // [2726] phi from display_smc_led to display_chip_led [phi:display_smc_led->display_chip_led] - // [2726] phi display_chip_led::w#7 = 5 [phi:display_smc_led->display_chip_led#0] -- vbuz1=vbuc1 + // [2170] display_chip_led::tc#0 = display_smc_led::c#2 -- vbuxx=vbuz1 + ldx.z c + // [2171] call display_chip_led + // [3136] phi from display_smc_led to display_chip_led [phi:display_smc_led->display_chip_led] + // [3136] phi display_chip_led::w#7 = 5 [phi:display_smc_led->display_chip_led#0] -- vbuz1=vbuc1 lda #5 sta.z display_chip_led.w - // [2726] phi display_chip_led::x#7 = 1+1 [phi:display_smc_led->display_chip_led#1] -- vbuz1=vbuc1 + // [3136] phi display_chip_led::x#7 = 1+1 [phi:display_smc_led->display_chip_led#1] -- vbuz1=vbuc1 lda #1+1 sta.z display_chip_led.x - // [2726] phi display_chip_led::tc#3 = display_chip_led::tc#0 [phi:display_smc_led->display_chip_led#2] -- register_copy + // [3136] phi display_chip_led::tc#3 = display_chip_led::tc#0 [phi:display_smc_led->display_chip_led#2] -- register_copy jsr display_chip_led // display_smc_led::@1 // display_info_led(INFO_X-2, INFO_Y, c, BLUE) - // [1992] display_info_led::tc#0 = display_smc_led::c#2 - // [1993] call display_info_led - // [1978] phi from display_smc_led::@1 to display_info_led [phi:display_smc_led::@1->display_info_led] - // [1978] phi display_info_led::y#4 = $11 [phi:display_smc_led::@1->display_info_led#0] -- vbuz1=vbuc1 + // [2172] display_info_led::tc#0 = display_smc_led::c#2 -- vbuxx=vbuz1 + ldx.z c + // [2173] call display_info_led + // [2158] phi from display_smc_led::@1 to display_info_led [phi:display_smc_led::@1->display_info_led] + // [2158] phi display_info_led::y#4 = $11 [phi:display_smc_led::@1->display_info_led#0] -- vbuz1=vbuc1 lda #$11 sta.z display_info_led.y - // [1978] phi display_info_led::x#4 = 4-2 [phi:display_smc_led::@1->display_info_led#1] -- vbuz1=vbuc1 - lda #4-2 - sta.z display_info_led.x - // [1978] phi display_info_led::tc#4 = display_info_led::tc#0 [phi:display_smc_led::@1->display_info_led#2] -- register_copy + // [2158] phi display_info_led::x#4 = 4-2 [phi:display_smc_led::@1->display_info_led#1] -- vbuyy=vbuc1 + ldy #4-2 + // [2158] phi display_info_led::tc#4 = display_info_led::tc#0 [phi:display_smc_led::@1->display_info_led#2] -- register_copy jsr display_info_led // display_smc_led::@return // } - // [1994] return + // [2174] return rts } // display_print_chip @@ -13627,38 +14161,39 @@ display_smc_led: { * @param w Width * @param text Vertical text to be displayed in the chip, starting from the top. */ -// void display_print_chip(__zp($cc) char x, char y, __mem() char w, __zp($47) char *text) +// void display_print_chip(__zp($ba) char x, char y, __mem() char w, __zp($c3) char *text) display_print_chip: { .label y = 3+2+1+1+1+1+1+1+1+1 - .label text = $47 - .label text_1 = $31 - .label x = $cc - .label text_2 = $b4 - .label text_3 = $aa - .label text_4 = $3f + .label text = $c3 + .label text_1 = $ca + .label x = $ba + .label text_2 = $2a + .label text_4 = $34 + .label text_5 = $6f + .label text_6 = $67 // display_chip_line(x, y++, w, *text++) - // [1996] display_chip_line::x#0 = display_print_chip::x#10 -- vbuz1=vbuz2 + // [2176] display_chip_line::x#0 = display_print_chip::x#10 -- vbuz1=vbuz2 lda.z x sta.z display_chip_line.x - // [1997] display_chip_line::w#0 = display_print_chip::w#10 -- vbuz1=vbum2 + // [2177] display_chip_line::w#0 = display_print_chip::w#10 -- vbuz1=vbum2 lda w sta.z display_chip_line.w - // [1998] display_chip_line::c#0 = *display_print_chip::text#11 -- vbuz1=_deref_pbuz2 + // [2178] display_chip_line::c#0 = *display_print_chip::text#11 -- vbuz1=_deref_pbuz2 ldy #0 lda (text_2),y sta.z display_chip_line.c - // [1999] call display_chip_line - // [2744] phi from display_print_chip to display_chip_line [phi:display_print_chip->display_chip_line] - // [2744] phi display_chip_line::c#15 = display_chip_line::c#0 [phi:display_print_chip->display_chip_line#0] -- register_copy - // [2744] phi display_chip_line::w#10 = display_chip_line::w#0 [phi:display_print_chip->display_chip_line#1] -- register_copy - // [2744] phi display_chip_line::y#16 = 3+2 [phi:display_print_chip->display_chip_line#2] -- vbum1=vbuc1 + // [2179] call display_chip_line + // [3154] phi from display_print_chip to display_chip_line [phi:display_print_chip->display_chip_line] + // [3154] phi display_chip_line::c#15 = display_chip_line::c#0 [phi:display_print_chip->display_chip_line#0] -- register_copy + // [3154] phi display_chip_line::w#10 = display_chip_line::w#0 [phi:display_print_chip->display_chip_line#1] -- register_copy + // [3154] phi display_chip_line::y#16 = 3+2 [phi:display_print_chip->display_chip_line#2] -- vbum1=vbuc1 lda #3+2 sta display_chip_line.y - // [2744] phi display_chip_line::x#16 = display_chip_line::x#0 [phi:display_print_chip->display_chip_line#3] -- register_copy + // [3154] phi display_chip_line::x#16 = display_chip_line::x#0 [phi:display_print_chip->display_chip_line#3] -- register_copy jsr display_chip_line // display_print_chip::@1 // display_chip_line(x, y++, w, *text++); - // [2000] display_print_chip::text#0 = ++ display_print_chip::text#11 -- pbuz1=_inc_pbuz2 + // [2180] display_print_chip::text#0 = ++ display_print_chip::text#11 -- pbuz1=_inc_pbuz2 clc lda.z text_2 adc #1 @@ -13667,28 +14202,28 @@ display_print_chip: { adc #0 sta.z text+1 // display_chip_line(x, y++, w, *text++) - // [2001] display_chip_line::x#1 = display_print_chip::x#10 -- vbuz1=vbuz2 + // [2181] display_chip_line::x#1 = display_print_chip::x#10 -- vbuz1=vbuz2 lda.z x sta.z display_chip_line.x - // [2002] display_chip_line::w#1 = display_print_chip::w#10 -- vbuz1=vbum2 + // [2182] display_chip_line::w#1 = display_print_chip::w#10 -- vbuz1=vbum2 lda w sta.z display_chip_line.w - // [2003] display_chip_line::c#1 = *display_print_chip::text#0 -- vbuz1=_deref_pbuz2 + // [2183] display_chip_line::c#1 = *display_print_chip::text#0 -- vbuz1=_deref_pbuz2 ldy #0 lda (text),y sta.z display_chip_line.c - // [2004] call display_chip_line - // [2744] phi from display_print_chip::@1 to display_chip_line [phi:display_print_chip::@1->display_chip_line] - // [2744] phi display_chip_line::c#15 = display_chip_line::c#1 [phi:display_print_chip::@1->display_chip_line#0] -- register_copy - // [2744] phi display_chip_line::w#10 = display_chip_line::w#1 [phi:display_print_chip::@1->display_chip_line#1] -- register_copy - // [2744] phi display_chip_line::y#16 = ++3+2 [phi:display_print_chip::@1->display_chip_line#2] -- vbum1=vbuc1 + // [2184] call display_chip_line + // [3154] phi from display_print_chip::@1 to display_chip_line [phi:display_print_chip::@1->display_chip_line] + // [3154] phi display_chip_line::c#15 = display_chip_line::c#1 [phi:display_print_chip::@1->display_chip_line#0] -- register_copy + // [3154] phi display_chip_line::w#10 = display_chip_line::w#1 [phi:display_print_chip::@1->display_chip_line#1] -- register_copy + // [3154] phi display_chip_line::y#16 = ++3+2 [phi:display_print_chip::@1->display_chip_line#2] -- vbum1=vbuc1 lda #3+2+1 sta display_chip_line.y - // [2744] phi display_chip_line::x#16 = display_chip_line::x#1 [phi:display_print_chip::@1->display_chip_line#3] -- register_copy + // [3154] phi display_chip_line::x#16 = display_chip_line::x#1 [phi:display_print_chip::@1->display_chip_line#3] -- register_copy jsr display_chip_line // display_print_chip::@2 // display_chip_line(x, y++, w, *text++); - // [2005] display_print_chip::text#1 = ++ display_print_chip::text#0 -- pbuz1=_inc_pbuz2 + // [2185] display_print_chip::text#1 = ++ display_print_chip::text#0 -- pbuz1=_inc_pbuz2 clc lda.z text adc #1 @@ -13697,230 +14232,233 @@ display_print_chip: { adc #0 sta.z text_1+1 // display_chip_line(x, y++, w, *text++) - // [2006] display_chip_line::x#2 = display_print_chip::x#10 -- vbuz1=vbuz2 + // [2186] display_chip_line::x#2 = display_print_chip::x#10 -- vbuz1=vbuz2 lda.z x sta.z display_chip_line.x - // [2007] display_chip_line::w#2 = display_print_chip::w#10 -- vbuz1=vbum2 + // [2187] display_chip_line::w#2 = display_print_chip::w#10 -- vbuz1=vbum2 lda w sta.z display_chip_line.w - // [2008] display_chip_line::c#2 = *display_print_chip::text#1 -- vbuz1=_deref_pbuz2 + // [2188] display_chip_line::c#2 = *display_print_chip::text#1 -- vbuz1=_deref_pbuz2 ldy #0 lda (text_1),y sta.z display_chip_line.c - // [2009] call display_chip_line - // [2744] phi from display_print_chip::@2 to display_chip_line [phi:display_print_chip::@2->display_chip_line] - // [2744] phi display_chip_line::c#15 = display_chip_line::c#2 [phi:display_print_chip::@2->display_chip_line#0] -- register_copy - // [2744] phi display_chip_line::w#10 = display_chip_line::w#2 [phi:display_print_chip::@2->display_chip_line#1] -- register_copy - // [2744] phi display_chip_line::y#16 = ++++3+2 [phi:display_print_chip::@2->display_chip_line#2] -- vbum1=vbuc1 + // [2189] call display_chip_line + // [3154] phi from display_print_chip::@2 to display_chip_line [phi:display_print_chip::@2->display_chip_line] + // [3154] phi display_chip_line::c#15 = display_chip_line::c#2 [phi:display_print_chip::@2->display_chip_line#0] -- register_copy + // [3154] phi display_chip_line::w#10 = display_chip_line::w#2 [phi:display_print_chip::@2->display_chip_line#1] -- register_copy + // [3154] phi display_chip_line::y#16 = ++++3+2 [phi:display_print_chip::@2->display_chip_line#2] -- vbum1=vbuc1 lda #3+2+1+1 sta display_chip_line.y - // [2744] phi display_chip_line::x#16 = display_chip_line::x#2 [phi:display_print_chip::@2->display_chip_line#3] -- register_copy + // [3154] phi display_chip_line::x#16 = display_chip_line::x#2 [phi:display_print_chip::@2->display_chip_line#3] -- register_copy jsr display_chip_line // display_print_chip::@3 // display_chip_line(x, y++, w, *text++); - // [2010] display_print_chip::text#15 = ++ display_print_chip::text#1 -- pbuz1=_inc_pbuz2 + // [2190] display_print_chip::text#15 = ++ display_print_chip::text#1 -- pbum1=_inc_pbuz2 clc lda.z text_1 adc #1 - sta.z text_3 + sta text_3 lda.z text_1+1 adc #0 - sta.z text_3+1 + sta text_3+1 // display_chip_line(x, y++, w, *text++) - // [2011] display_chip_line::x#3 = display_print_chip::x#10 -- vbuz1=vbuz2 + // [2191] display_chip_line::x#3 = display_print_chip::x#10 -- vbuz1=vbuz2 lda.z x sta.z display_chip_line.x - // [2012] display_chip_line::w#3 = display_print_chip::w#10 -- vbuz1=vbum2 + // [2192] display_chip_line::w#3 = display_print_chip::w#10 -- vbuz1=vbum2 lda w sta.z display_chip_line.w - // [2013] display_chip_line::c#3 = *display_print_chip::text#15 -- vbuz1=_deref_pbuz2 + // [2193] display_chip_line::c#3 = *display_print_chip::text#15 -- vbuz1=_deref_pbum2 + ldy text_3 + sty.z $fe + ldy text_3+1 + sty.z $ff ldy #0 - lda (text_3),y + lda ($fe),y sta.z display_chip_line.c - // [2014] call display_chip_line - // [2744] phi from display_print_chip::@3 to display_chip_line [phi:display_print_chip::@3->display_chip_line] - // [2744] phi display_chip_line::c#15 = display_chip_line::c#3 [phi:display_print_chip::@3->display_chip_line#0] -- register_copy - // [2744] phi display_chip_line::w#10 = display_chip_line::w#3 [phi:display_print_chip::@3->display_chip_line#1] -- register_copy - // [2744] phi display_chip_line::y#16 = ++++++3+2 [phi:display_print_chip::@3->display_chip_line#2] -- vbum1=vbuc1 + // [2194] call display_chip_line + // [3154] phi from display_print_chip::@3 to display_chip_line [phi:display_print_chip::@3->display_chip_line] + // [3154] phi display_chip_line::c#15 = display_chip_line::c#3 [phi:display_print_chip::@3->display_chip_line#0] -- register_copy + // [3154] phi display_chip_line::w#10 = display_chip_line::w#3 [phi:display_print_chip::@3->display_chip_line#1] -- register_copy + // [3154] phi display_chip_line::y#16 = ++++++3+2 [phi:display_print_chip::@3->display_chip_line#2] -- vbum1=vbuc1 lda #3+2+1+1+1 sta display_chip_line.y - // [2744] phi display_chip_line::x#16 = display_chip_line::x#3 [phi:display_print_chip::@3->display_chip_line#3] -- register_copy + // [3154] phi display_chip_line::x#16 = display_chip_line::x#3 [phi:display_print_chip::@3->display_chip_line#3] -- register_copy jsr display_chip_line // display_print_chip::@4 // display_chip_line(x, y++, w, *text++); - // [2015] display_print_chip::text#16 = ++ display_print_chip::text#15 -- pbuz1=_inc_pbuz2 + // [2195] display_print_chip::text#16 = ++ display_print_chip::text#15 -- pbuz1=_inc_pbum2 clc - lda.z text_3 + lda text_3 adc #1 sta.z text_4 - lda.z text_3+1 + lda text_3+1 adc #0 sta.z text_4+1 // display_chip_line(x, y++, w, *text++) - // [2016] display_chip_line::x#4 = display_print_chip::x#10 -- vbuz1=vbuz2 + // [2196] display_chip_line::x#4 = display_print_chip::x#10 -- vbuz1=vbuz2 lda.z x sta.z display_chip_line.x - // [2017] display_chip_line::w#4 = display_print_chip::w#10 -- vbuz1=vbum2 + // [2197] display_chip_line::w#4 = display_print_chip::w#10 -- vbuz1=vbum2 lda w sta.z display_chip_line.w - // [2018] display_chip_line::c#4 = *display_print_chip::text#16 -- vbuz1=_deref_pbuz2 + // [2198] display_chip_line::c#4 = *display_print_chip::text#16 -- vbuz1=_deref_pbuz2 ldy #0 lda (text_4),y sta.z display_chip_line.c - // [2019] call display_chip_line - // [2744] phi from display_print_chip::@4 to display_chip_line [phi:display_print_chip::@4->display_chip_line] - // [2744] phi display_chip_line::c#15 = display_chip_line::c#4 [phi:display_print_chip::@4->display_chip_line#0] -- register_copy - // [2744] phi display_chip_line::w#10 = display_chip_line::w#4 [phi:display_print_chip::@4->display_chip_line#1] -- register_copy - // [2744] phi display_chip_line::y#16 = ++++++++3+2 [phi:display_print_chip::@4->display_chip_line#2] -- vbum1=vbuc1 + // [2199] call display_chip_line + // [3154] phi from display_print_chip::@4 to display_chip_line [phi:display_print_chip::@4->display_chip_line] + // [3154] phi display_chip_line::c#15 = display_chip_line::c#4 [phi:display_print_chip::@4->display_chip_line#0] -- register_copy + // [3154] phi display_chip_line::w#10 = display_chip_line::w#4 [phi:display_print_chip::@4->display_chip_line#1] -- register_copy + // [3154] phi display_chip_line::y#16 = ++++++++3+2 [phi:display_print_chip::@4->display_chip_line#2] -- vbum1=vbuc1 lda #3+2+1+1+1+1 sta display_chip_line.y - // [2744] phi display_chip_line::x#16 = display_chip_line::x#4 [phi:display_print_chip::@4->display_chip_line#3] -- register_copy + // [3154] phi display_chip_line::x#16 = display_chip_line::x#4 [phi:display_print_chip::@4->display_chip_line#3] -- register_copy jsr display_chip_line // display_print_chip::@5 // display_chip_line(x, y++, w, *text++); - // [2020] display_print_chip::text#17 = ++ display_print_chip::text#16 -- pbum1=_inc_pbuz2 + // [2200] display_print_chip::text#17 = ++ display_print_chip::text#16 -- pbuz1=_inc_pbuz2 clc lda.z text_4 adc #1 - sta text_5 + sta.z text_5 lda.z text_4+1 adc #0 - sta text_5+1 + sta.z text_5+1 // display_chip_line(x, y++, w, *text++) - // [2021] display_chip_line::x#5 = display_print_chip::x#10 -- vbuz1=vbuz2 + // [2201] display_chip_line::x#5 = display_print_chip::x#10 -- vbuz1=vbuz2 lda.z x sta.z display_chip_line.x - // [2022] display_chip_line::w#5 = display_print_chip::w#10 -- vbuz1=vbum2 + // [2202] display_chip_line::w#5 = display_print_chip::w#10 -- vbuz1=vbum2 lda w sta.z display_chip_line.w - // [2023] display_chip_line::c#5 = *display_print_chip::text#17 -- vbuz1=_deref_pbum2 - ldy text_5 - sty.z $fe - ldy text_5+1 - sty.z $ff + // [2203] display_chip_line::c#5 = *display_print_chip::text#17 -- vbuz1=_deref_pbuz2 ldy #0 - lda ($fe),y + lda (text_5),y sta.z display_chip_line.c - // [2024] call display_chip_line - // [2744] phi from display_print_chip::@5 to display_chip_line [phi:display_print_chip::@5->display_chip_line] - // [2744] phi display_chip_line::c#15 = display_chip_line::c#5 [phi:display_print_chip::@5->display_chip_line#0] -- register_copy - // [2744] phi display_chip_line::w#10 = display_chip_line::w#5 [phi:display_print_chip::@5->display_chip_line#1] -- register_copy - // [2744] phi display_chip_line::y#16 = ++++++++++3+2 [phi:display_print_chip::@5->display_chip_line#2] -- vbum1=vbuc1 + // [2204] call display_chip_line + // [3154] phi from display_print_chip::@5 to display_chip_line [phi:display_print_chip::@5->display_chip_line] + // [3154] phi display_chip_line::c#15 = display_chip_line::c#5 [phi:display_print_chip::@5->display_chip_line#0] -- register_copy + // [3154] phi display_chip_line::w#10 = display_chip_line::w#5 [phi:display_print_chip::@5->display_chip_line#1] -- register_copy + // [3154] phi display_chip_line::y#16 = ++++++++++3+2 [phi:display_print_chip::@5->display_chip_line#2] -- vbum1=vbuc1 lda #3+2+1+1+1+1+1 sta display_chip_line.y - // [2744] phi display_chip_line::x#16 = display_chip_line::x#5 [phi:display_print_chip::@5->display_chip_line#3] -- register_copy + // [3154] phi display_chip_line::x#16 = display_chip_line::x#5 [phi:display_print_chip::@5->display_chip_line#3] -- register_copy jsr display_chip_line // display_print_chip::@6 // display_chip_line(x, y++, w, *text++); - // [2025] display_print_chip::text#18 = ++ display_print_chip::text#17 -- pbum1=_inc_pbum2 + // [2205] display_print_chip::text#18 = ++ display_print_chip::text#17 -- pbuz1=_inc_pbuz2 clc - lda text_5 + lda.z text_5 adc #1 - sta text_6 - lda text_5+1 + sta.z text_6 + lda.z text_5+1 adc #0 - sta text_6+1 + sta.z text_6+1 // display_chip_line(x, y++, w, *text++) - // [2026] display_chip_line::x#6 = display_print_chip::x#10 -- vbuz1=vbuz2 + // [2206] display_chip_line::x#6 = display_print_chip::x#10 -- vbuz1=vbuz2 lda.z x sta.z display_chip_line.x - // [2027] display_chip_line::w#6 = display_print_chip::w#10 -- vbuz1=vbum2 + // [2207] display_chip_line::w#6 = display_print_chip::w#10 -- vbuz1=vbum2 lda w sta.z display_chip_line.w - // [2028] display_chip_line::c#6 = *display_print_chip::text#18 -- vbuz1=_deref_pbum2 - ldy text_6 - sty.z $fe - ldy text_6+1 - sty.z $ff + // [2208] display_chip_line::c#6 = *display_print_chip::text#18 -- vbuz1=_deref_pbuz2 ldy #0 - lda ($fe),y + lda (text_6),y sta.z display_chip_line.c - // [2029] call display_chip_line - // [2744] phi from display_print_chip::@6 to display_chip_line [phi:display_print_chip::@6->display_chip_line] - // [2744] phi display_chip_line::c#15 = display_chip_line::c#6 [phi:display_print_chip::@6->display_chip_line#0] -- register_copy - // [2744] phi display_chip_line::w#10 = display_chip_line::w#6 [phi:display_print_chip::@6->display_chip_line#1] -- register_copy - // [2744] phi display_chip_line::y#16 = ++++++++++++3+2 [phi:display_print_chip::@6->display_chip_line#2] -- vbum1=vbuc1 + // [2209] call display_chip_line + // [3154] phi from display_print_chip::@6 to display_chip_line [phi:display_print_chip::@6->display_chip_line] + // [3154] phi display_chip_line::c#15 = display_chip_line::c#6 [phi:display_print_chip::@6->display_chip_line#0] -- register_copy + // [3154] phi display_chip_line::w#10 = display_chip_line::w#6 [phi:display_print_chip::@6->display_chip_line#1] -- register_copy + // [3154] phi display_chip_line::y#16 = ++++++++++++3+2 [phi:display_print_chip::@6->display_chip_line#2] -- vbum1=vbuc1 lda #3+2+1+1+1+1+1+1 sta display_chip_line.y - // [2744] phi display_chip_line::x#16 = display_chip_line::x#6 [phi:display_print_chip::@6->display_chip_line#3] -- register_copy + // [3154] phi display_chip_line::x#16 = display_chip_line::x#6 [phi:display_print_chip::@6->display_chip_line#3] -- register_copy jsr display_chip_line // display_print_chip::@7 // display_chip_line(x, y++, w, *text++); - // [2030] display_print_chip::text#19 = ++ display_print_chip::text#18 -- pbum1=_inc_pbum1 - inc text_6 + // [2210] display_print_chip::text#19 = ++ display_print_chip::text#18 -- pbuz1=_inc_pbuz1 + inc.z text_6 bne !+ - inc text_6+1 + inc.z text_6+1 !: // display_chip_line(x, y++, w, *text++) - // [2031] display_chip_line::x#7 = display_print_chip::x#10 -- vbuz1=vbuz2 + // [2211] display_chip_line::x#7 = display_print_chip::x#10 -- vbuz1=vbuz2 lda.z x sta.z display_chip_line.x - // [2032] display_chip_line::w#7 = display_print_chip::w#10 -- vbuz1=vbum2 + // [2212] display_chip_line::w#7 = display_print_chip::w#10 -- vbuz1=vbum2 lda w sta.z display_chip_line.w - // [2033] display_chip_line::c#7 = *display_print_chip::text#19 -- vbuz1=_deref_pbum2 - ldy text_6 - sty.z $fe - ldy text_6+1 - sty.z $ff + // [2213] display_chip_line::c#7 = *display_print_chip::text#19 -- vbuz1=_deref_pbuz2 ldy #0 - lda ($fe),y + lda (text_6),y sta.z display_chip_line.c - // [2034] call display_chip_line - // [2744] phi from display_print_chip::@7 to display_chip_line [phi:display_print_chip::@7->display_chip_line] - // [2744] phi display_chip_line::c#15 = display_chip_line::c#7 [phi:display_print_chip::@7->display_chip_line#0] -- register_copy - // [2744] phi display_chip_line::w#10 = display_chip_line::w#7 [phi:display_print_chip::@7->display_chip_line#1] -- register_copy - // [2744] phi display_chip_line::y#16 = ++++++++++++++3+2 [phi:display_print_chip::@7->display_chip_line#2] -- vbum1=vbuc1 + // [2214] call display_chip_line + // [3154] phi from display_print_chip::@7 to display_chip_line [phi:display_print_chip::@7->display_chip_line] + // [3154] phi display_chip_line::c#15 = display_chip_line::c#7 [phi:display_print_chip::@7->display_chip_line#0] -- register_copy + // [3154] phi display_chip_line::w#10 = display_chip_line::w#7 [phi:display_print_chip::@7->display_chip_line#1] -- register_copy + // [3154] phi display_chip_line::y#16 = ++++++++++++++3+2 [phi:display_print_chip::@7->display_chip_line#2] -- vbum1=vbuc1 lda #3+2+1+1+1+1+1+1+1 sta display_chip_line.y - // [2744] phi display_chip_line::x#16 = display_chip_line::x#7 [phi:display_print_chip::@7->display_chip_line#3] -- register_copy + // [3154] phi display_chip_line::x#16 = display_chip_line::x#7 [phi:display_print_chip::@7->display_chip_line#3] -- register_copy jsr display_chip_line // display_print_chip::@8 // display_chip_end(x, y++, w) - // [2035] display_chip_end::x#0 = display_print_chip::x#10 - // [2036] display_chip_end::w#0 = display_print_chip::w#10 -- vbuz1=vbum2 + // [2215] display_chip_end::x#0 = display_print_chip::x#10 -- vbuxx=vbuz1 + ldx.z x + // [2216] display_chip_end::w#0 = display_print_chip::w#10 -- vbuz1=vbum2 lda w sta.z display_chip_end.w - // [2037] call display_chip_end + // [2217] call display_chip_end jsr display_chip_end // display_print_chip::@return // } - // [2038] return + // [2218] return rts .segment Data - .label text_5 = fopen.cbm_k_setnam1_fopen__0 - .label text_6 = fopen.fopen__16 - .label w = main.check_status_smc6_main__0 + text_3: .word 0 + .label w = display_info_rom.display_info_rom__16 } .segment Code // wherex // Return the x position of the cursor wherex: { // return __conio.cursor_x; - // [2039] wherex::return#0 = *((char *)&__conio) -- vbum1=_deref_pbuc1 + // [2219] wherex::return#0 = *((char *)&__conio) -- vbuaa=_deref_pbuc1 lda __conio - sta return // wherex::@return // } - // [2040] return + // [2220] return rts - .segment Data - return: .byte 0 } -.segment Code // wherey // Return the y position of the cursor wherey: { // return __conio.cursor_y; - // [2041] wherey::return#0 = *((char *)&__conio+1) -- vbum1=_deref_pbuc1 + // [2221] wherey::return#0 = *((char *)&__conio+1) -- vbuaa=_deref_pbuc1 lda __conio+1 - sta return // wherey::@return // } - // [2042] return + // [2222] return + rts +} +.segment CodeVera + // w25q16_detect +w25q16_detect: { + // spi_get_jedec() + // [2224] call spi_get_jedec + // This conditional compilation ensures that only the detection interpretation happens if it is switched on. + // [3215] phi from w25q16_detect to spi_get_jedec [phi:w25q16_detect->spi_get_jedec] + jsr spi_get_jedec + // [2225] phi from w25q16_detect to w25q16_detect::@1 [phi:w25q16_detect->w25q16_detect::@1] + // w25q16_detect::@1 + // spi_deselect() + // [2226] call spi_deselect + jsr spi_deselect + // w25q16_detect::@return + // } + // [2227] return rts - .segment Data - return: .byte 0 } .segment Code // rom_unlock @@ -13933,13 +14471,13 @@ wherey: { * @param unlock_code The 3rd write to model the specific unlock sequence. */ /* inline */ -// void rom_unlock(__zp($5a) unsigned long address, __zp($6a) char unlock_code) +// void rom_unlock(__zp($42) unsigned long address, __zp($50) char unlock_code) rom_unlock: { - .label chip_address = $52 - .label address = $5a - .label unlock_code = $6a + .label chip_address = $3c + .label address = $42 + .label unlock_code = $50 // unsigned long chip_address = address & ROM_CHIP_MASK - // [2044] rom_unlock::chip_address#0 = rom_unlock::address#5 & $380000 -- vduz1=vduz2_band_vduc1 + // [2229] rom_unlock::chip_address#0 = rom_unlock::address#5 & $380000 -- vduz1=vduz2_band_vduc1 lda.z address and #<$380000 sta.z chip_address @@ -13953,7 +14491,7 @@ rom_unlock: { and #>$380000>>$10 sta.z chip_address+3 // rom_write_byte(chip_address + 0x05555, 0xAA) - // [2045] rom_write_byte::address#0 = rom_unlock::chip_address#0 + $5555 -- vduz1=vduz2_plus_vwuc1 + // [2230] rom_write_byte::address#0 = rom_unlock::chip_address#0 + $5555 -- vduz1=vduz2_plus_vwuc1 clc lda.z chip_address adc #<$5555 @@ -13967,17 +14505,16 @@ rom_unlock: { lda.z chip_address+3 adc #0 sta.z rom_write_byte.address+3 - // [2046] call rom_write_byte + // [2231] call rom_write_byte // This is a very important operation... - // [2805] phi from rom_unlock to rom_write_byte [phi:rom_unlock->rom_write_byte] - // [2805] phi rom_write_byte::value#10 = $aa [phi:rom_unlock->rom_write_byte#0] -- vbuz1=vbuc1 - lda #$aa - sta.z rom_write_byte.value - // [2805] phi rom_write_byte::address#4 = rom_write_byte::address#0 [phi:rom_unlock->rom_write_byte#1] -- register_copy + // [3232] phi from rom_unlock to rom_write_byte [phi:rom_unlock->rom_write_byte] + // [3232] phi rom_write_byte::value#10 = $aa [phi:rom_unlock->rom_write_byte#0] -- vbuyy=vbuc1 + ldy #$aa + // [3232] phi rom_write_byte::address#4 = rom_write_byte::address#0 [phi:rom_unlock->rom_write_byte#1] -- register_copy jsr rom_write_byte // rom_unlock::@1 // rom_write_byte(chip_address + 0x02AAA, 0x55) - // [2047] rom_write_byte::address#1 = rom_unlock::chip_address#0 + $2aaa -- vduz1=vduz2_plus_vwuc1 + // [2232] rom_write_byte::address#1 = rom_unlock::chip_address#0 + $2aaa -- vduz1=vduz2_plus_vwuc1 clc lda.z chip_address adc #<$2aaa @@ -13991,16 +14528,15 @@ rom_unlock: { lda.z chip_address+3 adc #0 sta.z rom_write_byte.address+3 - // [2048] call rom_write_byte - // [2805] phi from rom_unlock::@1 to rom_write_byte [phi:rom_unlock::@1->rom_write_byte] - // [2805] phi rom_write_byte::value#10 = $55 [phi:rom_unlock::@1->rom_write_byte#0] -- vbuz1=vbuc1 - lda #$55 - sta.z rom_write_byte.value - // [2805] phi rom_write_byte::address#4 = rom_write_byte::address#1 [phi:rom_unlock::@1->rom_write_byte#1] -- register_copy + // [2233] call rom_write_byte + // [3232] phi from rom_unlock::@1 to rom_write_byte [phi:rom_unlock::@1->rom_write_byte] + // [3232] phi rom_write_byte::value#10 = $55 [phi:rom_unlock::@1->rom_write_byte#0] -- vbuyy=vbuc1 + ldy #$55 + // [3232] phi rom_write_byte::address#4 = rom_write_byte::address#1 [phi:rom_unlock::@1->rom_write_byte#1] -- register_copy jsr rom_write_byte // rom_unlock::@2 // rom_write_byte(address, unlock_code) - // [2049] rom_write_byte::address#2 = rom_unlock::address#5 -- vduz1=vduz2 + // [2234] rom_write_byte::address#2 = rom_unlock::address#5 -- vduz1=vduz2 lda.z address sta.z rom_write_byte.address lda.z address+1 @@ -14009,17 +14545,16 @@ rom_unlock: { sta.z rom_write_byte.address+2 lda.z address+3 sta.z rom_write_byte.address+3 - // [2050] rom_write_byte::value#2 = rom_unlock::unlock_code#5 -- vbuz1=vbuz2 - lda.z unlock_code - sta.z rom_write_byte.value - // [2051] call rom_write_byte - // [2805] phi from rom_unlock::@2 to rom_write_byte [phi:rom_unlock::@2->rom_write_byte] - // [2805] phi rom_write_byte::value#10 = rom_write_byte::value#2 [phi:rom_unlock::@2->rom_write_byte#0] -- register_copy - // [2805] phi rom_write_byte::address#4 = rom_write_byte::address#2 [phi:rom_unlock::@2->rom_write_byte#1] -- register_copy + // [2235] rom_write_byte::value#2 = rom_unlock::unlock_code#5 -- vbuyy=vbuz1 + ldy.z unlock_code + // [2236] call rom_write_byte + // [3232] phi from rom_unlock::@2 to rom_write_byte [phi:rom_unlock::@2->rom_write_byte] + // [3232] phi rom_write_byte::value#10 = rom_write_byte::value#2 [phi:rom_unlock::@2->rom_write_byte#0] -- register_copy + // [3232] phi rom_write_byte::address#4 = rom_write_byte::address#2 [phi:rom_unlock::@2->rom_write_byte#1] -- register_copy jsr rom_write_byte // rom_unlock::@return // } - // [2052] return + // [2237] return rts } // rom_read_byte @@ -14032,43 +14567,36 @@ rom_unlock: { * @param address The 22 bit ROM address. * @return unsigned char The byte read from the ROM. */ -// __mem() char rom_read_byte(__mem() unsigned long address) +// __register(A) char rom_read_byte(__mem() unsigned long address) rom_read_byte: { - .label rom_bank1_rom_read_byte__0 = $45 - .label rom_bank1_return = $bc // rom_read_byte::rom_bank1 // BYTE2(address) - // [2054] rom_read_byte::rom_bank1_$0 = byte2 rom_read_byte::address#2 -- vbuz1=_byte2_vdum2 + // [2239] rom_read_byte::rom_bank1_$0 = byte2 rom_read_byte::address#2 -- vbuaa=_byte2_vdum1 lda address+2 - sta.z rom_bank1_rom_read_byte__0 // BYTE1(address) - // [2055] rom_read_byte::rom_bank1_$1 = byte1 rom_read_byte::address#2 -- vbum1=_byte1_vdum2 - lda address+1 - sta rom_bank1_rom_read_byte__1 + // [2240] rom_read_byte::rom_bank1_$1 = byte1 rom_read_byte::address#2 -- vbuxx=_byte1_vdum1 + ldx address+1 // MAKEWORD(BYTE2(address),BYTE1(address)) - // [2056] rom_read_byte::rom_bank1_$2 = rom_read_byte::rom_bank1_$0 w= rom_read_byte::rom_bank1_$1 -- vwum1=vbuz2_word_vbum3 - lda.z rom_bank1_rom_read_byte__0 + // [2241] rom_read_byte::rom_bank1_$2 = rom_read_byte::rom_bank1_$0 w= rom_read_byte::rom_bank1_$1 -- vwum1=vbuaa_word_vbuxx sta rom_bank1_rom_read_byte__2+1 - lda rom_bank1_rom_read_byte__1 - sta rom_bank1_rom_read_byte__2 + stx rom_bank1_rom_read_byte__2 // unsigned int bank_unshifted = MAKEWORD(BYTE2(address),BYTE1(address)) << 2 - // [2057] rom_read_byte::rom_bank1_bank_unshifted#0 = rom_read_byte::rom_bank1_$2 << 2 -- vwum1=vwum1_rol_2 + // [2242] rom_read_byte::rom_bank1_bank_unshifted#0 = rom_read_byte::rom_bank1_$2 << 2 -- vwum1=vwum1_rol_2 asl rom_bank1_bank_unshifted rol rom_bank1_bank_unshifted+1 asl rom_bank1_bank_unshifted rol rom_bank1_bank_unshifted+1 // unsigned char bank = BYTE1(bank_unshifted) - // [2058] rom_read_byte::rom_bank1_return#0 = byte1 rom_read_byte::rom_bank1_bank_unshifted#0 -- vbuz1=_byte1_vwum2 - lda rom_bank1_bank_unshifted+1 - sta.z rom_bank1_return + // [2243] rom_read_byte::rom_bank1_return#0 = byte1 rom_read_byte::rom_bank1_bank_unshifted#0 -- vbuxx=_byte1_vwum1 + ldx rom_bank1_bank_unshifted+1 // rom_read_byte::rom_ptr1 // (unsigned int)(address) & ROM_PTR_MASK - // [2059] rom_read_byte::rom_ptr1_$2 = (unsigned int)rom_read_byte::address#2 -- vwum1=_word_vdum2 + // [2244] rom_read_byte::rom_ptr1_$2 = (unsigned int)rom_read_byte::address#2 -- vwum1=_word_vdum2 lda address sta rom_ptr1_rom_read_byte__2 lda address+1 sta rom_ptr1_rom_read_byte__2+1 - // [2060] rom_read_byte::rom_ptr1_$0 = rom_read_byte::rom_ptr1_$2 & $3fff -- vwum1=vwum1_band_vwuc1 + // [2245] rom_read_byte::rom_ptr1_$0 = rom_read_byte::rom_ptr1_$2 & $3fff -- vwum1=vwum1_band_vwuc1 lda rom_ptr1_rom_read_byte__0 and #<$3fff sta rom_ptr1_rom_read_byte__0 @@ -14076,7 +14604,7 @@ rom_read_byte: { and #>$3fff sta rom_ptr1_rom_read_byte__0+1 // ((unsigned int)(address) & ROM_PTR_MASK) + ROM_BASE - // [2061] rom_read_byte::rom_ptr1_return#0 = rom_read_byte::rom_ptr1_$0 + $c000 -- vwum1=vwum1_plus_vwuc1 + // [2246] rom_read_byte::rom_ptr1_return#0 = rom_read_byte::rom_ptr1_$0 + $c000 -- vwum1=vwum1_plus_vwuc1 lda rom_ptr1_return clc adc #<$c000 @@ -14086,61 +14614,57 @@ rom_read_byte: { sta rom_ptr1_return+1 // rom_read_byte::bank_set_brom1 // BROM = bank - // [2062] BROM = rom_read_byte::rom_bank1_return#0 -- vbuz1=vbuz2 - lda.z rom_bank1_return - sta.z BROM + // [2247] BROM = rom_read_byte::rom_bank1_return#0 -- vbuz1=vbuxx + stx.z BROM // rom_read_byte::@1 // return *ptr_rom; - // [2063] rom_read_byte::return#0 = *((char *)rom_read_byte::rom_ptr1_return#0) -- vbum1=_deref_pbum2 + // [2248] rom_read_byte::return#0 = *((char *)rom_read_byte::rom_ptr1_return#0) -- vbuaa=_deref_pbum1 ldy rom_ptr1_return sty.z $fe - ldy rom_ptr1_return+1 + tay sty.z $ff ldy #0 lda ($fe),y - sta return // rom_read_byte::@return // } - // [2064] return + // [2249] return rts .segment Data - .label rom_bank1_rom_read_byte__1 = fopen.fopen__4 rom_bank1_rom_read_byte__2: .word 0 .label rom_ptr1_rom_read_byte__0 = rom_ptr1_rom_read_byte__2 rom_ptr1_rom_read_byte__2: .word 0 .label rom_bank1_bank_unshifted = rom_bank1_rom_read_byte__2 .label rom_ptr1_return = rom_ptr1_rom_read_byte__2 - .label return = fclose.fclose__1 address: .dword 0 } .segment Code // strcat // Concatenates the C string pointed by source into the array pointed by destination, including the terminating null character (and stopping at that point). -// char * strcat(char *destination, __zp($b4) char *source) +// char * strcat(char *destination, __zp($2a) char *source) strcat: { - .label strcat__0 = $4e - .label dst = $4e - .label src = $b4 - .label source = $b4 + .label strcat__0 = $bb + .label dst = $bb + .label src = $2a + .label source = $2a // strlen(destination) - // [2066] call strlen - // [2155] phi from strcat to strlen [phi:strcat->strlen] - // [2155] phi strlen::str#8 = display_chip_rom::rom [phi:strcat->strlen#0] -- pbuz1=pbuc1 + // [2251] call strlen + // [2555] phi from strcat to strlen [phi:strcat->strlen] + // [2555] phi strlen::str#8 = display_chip_rom::rom [phi:strcat->strlen#0] -- pbuz1=pbuc1 lda #display_chip_rom.rom sta.z strlen.str+1 jsr strlen // strlen(destination) - // [2067] strlen::return#0 = strlen::len#2 + // [2252] strlen::return#0 = strlen::len#2 // strcat::@4 - // [2068] strcat::$0 = strlen::return#0 -- vwuz1=vwum2 + // [2253] strcat::$0 = strlen::return#0 -- vwuz1=vwum2 lda strlen.return sta.z strcat__0 lda strlen.return+1 sta.z strcat__0+1 // char* dst = destination + strlen(destination) - // [2069] strcat::dst#0 = display_chip_rom::rom + strcat::$0 -- pbuz1=pbuc1_plus_vwuz1 + // [2254] strcat::dst#0 = display_chip_rom::rom + strcat::$0 -- pbuz1=pbuc1_plus_vwuz1 lda.z dst clc adc #display_chip_rom.rom sta.z dst+1 - // [2070] phi from strcat::@2 strcat::@4 to strcat::@1 [phi:strcat::@2/strcat::@4->strcat::@1] - // [2070] phi strcat::dst#2 = strcat::dst#1 [phi:strcat::@2/strcat::@4->strcat::@1#0] -- register_copy - // [2070] phi strcat::src#2 = strcat::src#1 [phi:strcat::@2/strcat::@4->strcat::@1#1] -- register_copy + // [2255] phi from strcat::@2 strcat::@4 to strcat::@1 [phi:strcat::@2/strcat::@4->strcat::@1] + // [2255] phi strcat::dst#2 = strcat::dst#1 [phi:strcat::@2/strcat::@4->strcat::@1#0] -- register_copy + // [2255] phi strcat::src#2 = strcat::src#1 [phi:strcat::@2/strcat::@4->strcat::@1#1] -- register_copy // strcat::@1 __b1: // while(*src) - // [2071] if(0!=*strcat::src#2) goto strcat::@2 -- 0_neq__deref_pbuz1_then_la1 + // [2256] if(0!=*strcat::src#2) goto strcat::@2 -- 0_neq__deref_pbuz1_then_la1 ldy #0 lda (src),y cmp #0 bne __b2 // strcat::@3 // *dst = 0 - // [2072] *strcat::dst#2 = 0 -- _deref_pbuz1=vbuc1 + // [2257] *strcat::dst#2 = 0 -- _deref_pbuz1=vbuc1 tya tay sta (dst),y // strcat::@return // } - // [2073] return + // [2258] return rts // strcat::@2 __b2: // *dst++ = *src++ - // [2074] *strcat::dst#2 = *strcat::src#2 -- _deref_pbuz1=_deref_pbuz2 + // [2259] *strcat::dst#2 = *strcat::src#2 -- _deref_pbuz1=_deref_pbuz2 ldy #0 lda (src),y sta (dst),y // *dst++ = *src++; - // [2075] strcat::dst#1 = ++ strcat::dst#2 -- pbuz1=_inc_pbuz1 + // [2260] strcat::dst#1 = ++ strcat::dst#2 -- pbuz1=_inc_pbuz1 inc.z dst bne !+ inc.z dst+1 !: - // [2076] strcat::src#1 = ++ strcat::src#2 -- pbuz1=_inc_pbuz1 + // [2261] strcat::src#1 = ++ strcat::src#2 -- pbuz1=_inc_pbuz1 inc.z src bne !+ inc.z src+1 @@ -14196,204 +14720,651 @@ strcat: { * @param chip ROM chip number (0 is main rom chip of CX16) * @param c Led color */ -// void display_rom_led(__zp($df) char chip, __zp($38) char c) +// void display_rom_led(__zp($cd) char chip, __zp($d2) char c) display_rom_led: { - .label display_rom_led__0 = $ae - .label chip = $df - .label c = $38 - .label display_rom_led__7 = $ae - .label display_rom_led__8 = $ae + .label chip = $cd + .label c = $d2 // chip*6 - // [2078] display_rom_led::$7 = display_rom_led::chip#2 << 1 -- vbuz1=vbuz2_rol_1 + // [2263] display_rom_led::$7 = display_rom_led::chip#2 << 1 -- vbuaa=vbuz1_rol_1 lda.z chip asl - sta.z display_rom_led__7 - // [2079] display_rom_led::$8 = display_rom_led::$7 + display_rom_led::chip#2 -- vbuz1=vbuz1_plus_vbuz2 - lda.z display_rom_led__8 + // [2264] display_rom_led::$8 = display_rom_led::$7 + display_rom_led::chip#2 -- vbuaa=vbuaa_plus_vbuz1 clc adc.z chip - sta.z display_rom_led__8 // CHIP_ROM_X+chip*6 - // [2080] display_rom_led::$0 = display_rom_led::$8 << 1 -- vbuz1=vbuz1_rol_1 - asl.z display_rom_led__0 + // [2265] display_rom_led::$0 = display_rom_led::$8 << 1 -- vbuaa=vbuaa_rol_1 + asl // display_chip_led(CHIP_ROM_X+chip*6+1, CHIP_ROM_Y, CHIP_ROM_W, c, BLUE) - // [2081] display_chip_led::x#3 = display_rom_led::$0 + $14+1 -- vbuz1=vbuz1_plus_vbuc1 - lda #$14+1 + // [2266] display_chip_led::x#3 = display_rom_led::$0 + $14+1 -- vbuz1=vbuaa_plus_vbuc1 clc - adc.z display_chip_led.x + adc #$14+1 sta.z display_chip_led.x - // [2082] display_chip_led::tc#2 = display_rom_led::c#2 -- vbuz1=vbuz2 - lda.z c - sta.z display_chip_led.tc - // [2083] call display_chip_led - // [2726] phi from display_rom_led to display_chip_led [phi:display_rom_led->display_chip_led] - // [2726] phi display_chip_led::w#7 = 3 [phi:display_rom_led->display_chip_led#0] -- vbuz1=vbuc1 + // [2267] display_chip_led::tc#2 = display_rom_led::c#2 -- vbuxx=vbuz1 + ldx.z c + // [2268] call display_chip_led + // [3136] phi from display_rom_led to display_chip_led [phi:display_rom_led->display_chip_led] + // [3136] phi display_chip_led::w#7 = 3 [phi:display_rom_led->display_chip_led#0] -- vbuz1=vbuc1 lda #3 sta.z display_chip_led.w - // [2726] phi display_chip_led::x#7 = display_chip_led::x#3 [phi:display_rom_led->display_chip_led#1] -- register_copy - // [2726] phi display_chip_led::tc#3 = display_chip_led::tc#2 [phi:display_rom_led->display_chip_led#2] -- register_copy + // [3136] phi display_chip_led::x#7 = display_chip_led::x#3 [phi:display_rom_led->display_chip_led#1] -- register_copy + // [3136] phi display_chip_led::tc#3 = display_chip_led::tc#2 [phi:display_rom_led->display_chip_led#2] -- register_copy jsr display_chip_led // display_rom_led::@1 // display_info_led(INFO_X-2, INFO_Y+chip+2, c, BLUE) - // [2084] display_info_led::y#2 = display_rom_led::chip#2 + $11+2 -- vbuz1=vbuz2_plus_vbuc1 + // [2269] display_info_led::y#2 = display_rom_led::chip#2 + $11+2 -- vbuz1=vbuz2_plus_vbuc1 lda #$11+2 clc adc.z chip sta.z display_info_led.y - // [2085] display_info_led::tc#2 = display_rom_led::c#2 -- vbuz1=vbuz2 - lda.z c - sta.z display_info_led.tc - // [2086] call display_info_led - // [1978] phi from display_rom_led::@1 to display_info_led [phi:display_rom_led::@1->display_info_led] - // [1978] phi display_info_led::y#4 = display_info_led::y#2 [phi:display_rom_led::@1->display_info_led#0] -- register_copy - // [1978] phi display_info_led::x#4 = 4-2 [phi:display_rom_led::@1->display_info_led#1] -- vbuz1=vbuc1 - lda #4-2 - sta.z display_info_led.x - // [1978] phi display_info_led::tc#4 = display_info_led::tc#2 [phi:display_rom_led::@1->display_info_led#2] -- register_copy + // [2270] display_info_led::tc#2 = display_rom_led::c#2 -- vbuxx=vbuz1 + ldx.z c + // [2271] call display_info_led + // [2158] phi from display_rom_led::@1 to display_info_led [phi:display_rom_led::@1->display_info_led] + // [2158] phi display_info_led::y#4 = display_info_led::y#2 [phi:display_rom_led::@1->display_info_led#0] -- register_copy + // [2158] phi display_info_led::x#4 = 4-2 [phi:display_rom_led::@1->display_info_led#1] -- vbuyy=vbuc1 + ldy #4-2 + // [2158] phi display_info_led::tc#4 = display_info_led::tc#2 [phi:display_rom_led::@1->display_info_led#2] -- register_copy jsr display_info_led // display_rom_led::@return // } - // [2087] return + // [2272] return rts } - // uctoa -// Converts unsigned number value to a string representing it in RADIX format. -// If the leading digits are zero they are not included in the string. -// - value : The number to be converted to RADIX -// - buffer : receives the string representing the number and zero-termination. -// - radix : The radix to convert the number to (from the enum RADIX) -// void uctoa(__mem() char value, __zp($31) char *buffer, __mem() char radix) -uctoa: { - .label uctoa__4 = $45 - .label buffer = $31 - .label digit_values = $41 - // if(radix==DECIMAL) - // [2088] if(uctoa::radix#0==DECIMAL) goto uctoa::@1 -- vbum1_eq_vbuc1_then_la1 - lda #DECIMAL - cmp radix - beq __b2 - // uctoa::@2 - // if(radix==HEXADECIMAL) - // [2089] if(uctoa::radix#0==HEXADECIMAL) goto uctoa::@1 -- vbum1_eq_vbuc1_then_la1 - lda #HEXADECIMAL - cmp radix - beq __b3 - // uctoa::@3 - // if(radix==OCTAL) - // [2090] if(uctoa::radix#0==OCTAL) goto uctoa::@1 -- vbum1_eq_vbuc1_then_la1 - lda #OCTAL - cmp radix - beq __b4 - // uctoa::@4 - // if(radix==BINARY) - // [2091] if(uctoa::radix#0==BINARY) goto uctoa::@1 -- vbum1_eq_vbuc1_then_la1 - lda #BINARY - cmp radix - beq __b5 - // uctoa::@5 - // *buffer++ = 'e' - // [2092] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS) = 'e' -- _deref_pbuc1=vbuc2 - // Unknown radix - lda #'e' - sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS - // *buffer++ = 'r' - // [2093] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1) = 'r' -- _deref_pbuc1=vbuc2 - lda #'r' - sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1 - // [2094] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2) = 'r' -- _deref_pbuc1=vbuc2 - sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2 - // *buffer = 0 - // [2095] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3) = 0 -- _deref_pbuc1=vbuc2 - lda #0 - sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3 - // uctoa::@return + // cputcxy +// Move cursor and output one character +// Same as "gotoxy (x, y); cputc (c);" +// void cputcxy(__register(Y) char x, __register(A) char y, __register(X) char c) +cputcxy: { + // gotoxy(x, y) + // [2274] gotoxy::x#0 = cputcxy::x#17 + // [2275] gotoxy::y#0 = cputcxy::y#17 -- vbum1=vbuaa + sta gotoxy.y + // [2276] call gotoxy + // [805] phi from cputcxy to gotoxy [phi:cputcxy->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#0 [phi:cputcxy->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = gotoxy::x#0 [phi:cputcxy->gotoxy#1] -- register_copy + jsr gotoxy + // cputcxy::@1 + // cputc(c) + // [2277] stackpush(char) = cputcxy::c#17 -- _stackpushbyte_=vbuxx + txa + pha + // [2278] callexecute cputc -- call_vprc1 + jsr cputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // cputcxy::@return // } - // [2096] return + // [2280] return rts - // [2097] phi from uctoa to uctoa::@1 [phi:uctoa->uctoa::@1] +} +.segment CodeVera + // w25q16_read +// __zp($a9) unsigned long w25q16_read(__mem() char info_status) +w25q16_read: { + .const bank_set_brom1_bank = 0 + .label fp = $2e + .label return = $a9 + .label vera_package_read = $25 + .label vera_file_size = $a9 + // w25q16_read::bank_set_bram1 + // BRAM = bank + // [2282] BRAM = 1 -- vbuz1=vbuc1 + lda #1 + sta.z BRAM + // w25q16_read::@16 + // if(info_status == STATUS_READING) + // [2283] if(w25q16_read::info_status#12==STATUS_READING) goto w25q16_read::@1 -- vbum1_eq_vbuc1_then_la1 + lda #STATUS_READING + cmp info_status + beq __b1 + // [2285] phi from w25q16_read::@16 to w25q16_read::@2 [phi:w25q16_read::@16->w25q16_read::@2] + // [2285] phi w25q16_read::vera_bram_bank#14 = 0 [phi:w25q16_read::@16->w25q16_read::@2#0] -- vbum1=vbuc1 + lda #0 + sta vera_bram_bank + // [2285] phi w25q16_read::vera_action_text#10 = smc_action_text#2 [phi:w25q16_read::@16->w25q16_read::@2#1] -- pbum1=pbuc1 + lda #smc_action_text_1 + sta vera_action_text+1 + jmp __b2 + // [2284] phi from w25q16_read::@16 to w25q16_read::@1 [phi:w25q16_read::@16->w25q16_read::@1] + // w25q16_read::@1 + __b1: + // [2285] phi from w25q16_read::@1 to w25q16_read::@2 [phi:w25q16_read::@1->w25q16_read::@2] + // [2285] phi w25q16_read::vera_bram_bank#14 = 1 [phi:w25q16_read::@1->w25q16_read::@2#0] -- vbum1=vbuc1 + lda #1 + sta vera_bram_bank + // [2285] phi w25q16_read::vera_action_text#10 = smc_action_text#1 [phi:w25q16_read::@1->w25q16_read::@2#1] -- pbum1=pbuc1 + lda #smc_action_text + sta vera_action_text+1 + // w25q16_read::@2 __b2: - // [2097] phi uctoa::digit_values#8 = RADIX_DECIMAL_VALUES_CHAR [phi:uctoa->uctoa::@1#0] -- pbuz1=pbuc1 - lda #RADIX_DECIMAL_VALUES_CHAR - sta.z digit_values+1 - // [2097] phi uctoa::max_digits#7 = 3 [phi:uctoa->uctoa::@1#1] -- vbum1=vbuc1 - lda #3 - sta max_digits - jmp __b1 - // [2097] phi from uctoa::@2 to uctoa::@1 [phi:uctoa::@2->uctoa::@1] - __b3: - // [2097] phi uctoa::digit_values#8 = RADIX_HEXADECIMAL_VALUES_CHAR [phi:uctoa::@2->uctoa::@1#0] -- pbuz1=pbuc1 - lda #RADIX_HEXADECIMAL_VALUES_CHAR - sta.z digit_values+1 - // [2097] phi uctoa::max_digits#7 = 2 [phi:uctoa::@2->uctoa::@1#1] -- vbum1=vbuc1 - lda #2 - sta max_digits - jmp __b1 - // [2097] phi from uctoa::@3 to uctoa::@1 [phi:uctoa::@3->uctoa::@1] - __b4: - // [2097] phi uctoa::digit_values#8 = RADIX_OCTAL_VALUES_CHAR [phi:uctoa::@3->uctoa::@1#0] -- pbuz1=pbuc1 - lda #RADIX_OCTAL_VALUES_CHAR - sta.z digit_values+1 - // [2097] phi uctoa::max_digits#7 = 3 [phi:uctoa::@3->uctoa::@1#1] -- vbum1=vbuc1 - lda #3 - sta max_digits - jmp __b1 - // [2097] phi from uctoa::@4 to uctoa::@1 [phi:uctoa::@4->uctoa::@1] + // w25q16_read::bank_set_brom1 + // BROM = bank + // [2286] BROM = w25q16_read::bank_set_brom1_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom1_bank + sta.z BROM + // [2287] phi from w25q16_read::bank_set_brom1 to w25q16_read::@17 [phi:w25q16_read::bank_set_brom1->w25q16_read::@17] + // w25q16_read::@17 + // display_action_text("Opening VERA.BIN from SD card ...") + // [2288] call display_action_text + // [1200] phi from w25q16_read::@17 to display_action_text [phi:w25q16_read::@17->display_action_text] + // [1200] phi display_action_text::info_text#25 = w25q16_read::info_text [phi:w25q16_read::@17->display_action_text#0] -- pbuz1=pbuc1 + lda #info_text + sta.z display_action_text.info_text+1 + jsr display_action_text + // [2289] phi from w25q16_read::@17 to w25q16_read::@19 [phi:w25q16_read::@17->w25q16_read::@19] + // w25q16_read::@19 + // FILE *fp = fopen("VERA.BIN", "r") + // [2290] call fopen + // [2573] phi from w25q16_read::@19 to fopen [phi:w25q16_read::@19->fopen] + // [2573] phi __errno#474 = __errno#105 [phi:w25q16_read::@19->fopen#0] -- register_copy + // [2573] phi fopen::pathtoken#0 = w25q16_read::path [phi:w25q16_read::@19->fopen#1] -- pbuz1=pbuc1 + lda #path + sta.z fopen.pathtoken+1 + // [2573] phi __stdio_filecount#27 = __stdio_filecount#100 [phi:w25q16_read::@19->fopen#2] -- register_copy + jsr fopen + // FILE *fp = fopen("VERA.BIN", "r") + // [2291] fopen::return#5 = fopen::return#2 + // w25q16_read::@20 + // [2292] w25q16_read::fp#0 = fopen::return#5 -- pssz1=pssz2 + lda.z fopen.return + sta.z fp + lda.z fopen.return+1 + sta.z fp+1 + // if (fp) + // [2293] if((struct $2 *)0==w25q16_read::fp#0) goto w25q16_read::@3 -- pssc1_eq_pssz1_then_la1 + lda.z fp + cmp #<0 + bne !+ + lda.z fp+1 + cmp #>0 + beq __b4 + !: + // [2294] phi from w25q16_read::@20 to w25q16_read::@4 [phi:w25q16_read::@20->w25q16_read::@4] + // w25q16_read::@4 + // gotoxy(x, y) + // [2295] call gotoxy + // [805] phi from w25q16_read::@4 to gotoxy [phi:w25q16_read::@4->gotoxy] + // [805] phi gotoxy::y#37 = PROGRESS_Y [phi:w25q16_read::@4->gotoxy#0] -- vbum1=vbuc1 + lda #PROGRESS_Y + sta gotoxy.y + // [805] phi gotoxy::x#37 = PROGRESS_X [phi:w25q16_read::@4->gotoxy#1] -- vbuyy=vbuc1 + ldy #PROGRESS_X + jsr gotoxy + // [2296] phi from w25q16_read::@4 to w25q16_read::@5 [phi:w25q16_read::@4->w25q16_read::@5] + // [2296] phi w25q16_read::y#11 = PROGRESS_Y [phi:w25q16_read::@4->w25q16_read::@5#0] -- vbum1=vbuc1 + lda #PROGRESS_Y + sta y + // [2296] phi w25q16_read::progress_row_current#10 = 0 [phi:w25q16_read::@4->w25q16_read::@5#1] -- vwum1=vwuc1 + lda #<0 + sta progress_row_current + sta progress_row_current+1 + // [2296] phi w25q16_read::vera_bram_ptr#13 = (char *)$a000 [phi:w25q16_read::@4->w25q16_read::@5#2] -- pbum1=pbuc1 + lda #<$a000 + sta vera_bram_ptr + lda #>$a000 + sta vera_bram_ptr+1 + // [2296] phi w25q16_read::vera_bram_bank#10 = w25q16_read::vera_bram_bank#14 [phi:w25q16_read::@4->w25q16_read::@5#3] -- register_copy + // [2296] phi w25q16_read::vera_file_size#11 = 0 [phi:w25q16_read::@4->w25q16_read::@5#4] -- vduz1=vduc1 + lda #<0 + sta.z vera_file_size + sta.z vera_file_size+1 + lda #<0>>$10 + sta.z vera_file_size+2 + lda #>0>>$10 + sta.z vera_file_size+3 + // w25q16_read::@5 __b5: - // [2097] phi uctoa::digit_values#8 = RADIX_BINARY_VALUES_CHAR [phi:uctoa::@4->uctoa::@1#0] -- pbuz1=pbuc1 - lda #RADIX_BINARY_VALUES_CHAR - sta.z digit_values+1 - // [2097] phi uctoa::max_digits#7 = 8 [phi:uctoa::@4->uctoa::@1#1] -- vbum1=vbuc1 - lda #8 - sta max_digits - // uctoa::@1 - __b1: - // [2098] phi from uctoa::@1 to uctoa::@6 [phi:uctoa::@1->uctoa::@6] - // [2098] phi uctoa::buffer#11 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:uctoa::@1->uctoa::@6#0] -- pbuz1=pbuc1 - lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + // while (vera_file_size < vera_size) + // [2297] if(w25q16_read::vera_file_size#11vera_size>>$10 + bcc __b6 + bne !+ + lda.z vera_file_size+2 + cmp #>$10 + bcc __b6 + bne !+ + lda.z vera_file_size+1 + cmp #>vera_size + bcc __b6 + bne !+ + lda.z vera_file_size + cmp #fclose] + // [2654] phi fclose::stream#3 = fclose::stream#2 [phi:w25q16_read::@9->fclose#0] -- register_copy + jsr fclose + // [2300] phi from w25q16_read::@9 to w25q16_read::@3 [phi:w25q16_read::@9->w25q16_read::@3] + // [2300] phi __stdio_filecount#12 = __stdio_filecount#2 [phi:w25q16_read::@9->w25q16_read::@3#0] -- register_copy + // [2300] phi w25q16_read::return#0 = w25q16_read::vera_file_size#11 [phi:w25q16_read::@9->w25q16_read::@3#1] -- register_copy + rts + // [2300] phi from w25q16_read::@20 to w25q16_read::@3 [phi:w25q16_read::@20->w25q16_read::@3] + __b4: + // [2300] phi __stdio_filecount#12 = __stdio_filecount#1 [phi:w25q16_read::@20->w25q16_read::@3#0] -- register_copy + // [2300] phi w25q16_read::return#0 = 0 [phi:w25q16_read::@20->w25q16_read::@3#1] -- vduz1=vduc1 + lda #<0 + sta.z return + sta.z return+1 + lda #<0>>$10 + sta.z return+2 + lda #>0>>$10 + sta.z return+3 + // w25q16_read::@3 + // w25q16_read::@return + // } + // [2301] return + rts + // w25q16_read::@6 + __b6: + // if(info_status == STATUS_CHECKING) + // [2302] if(w25q16_read::info_status#12!=STATUS_CHECKING) goto w25q16_read::@23 -- vbum1_neq_vbuc1_then_la1 + lda #STATUS_CHECKING + cmp info_status + bne __b7 + // [2304] phi from w25q16_read::@6 to w25q16_read::@7 [phi:w25q16_read::@6->w25q16_read::@7] + // [2304] phi w25q16_read::vera_bram_ptr#10 = (char *) 1024 [phi:w25q16_read::@6->w25q16_read::@7#0] -- pbum1=pbuc1 + lda #<$400 + sta vera_bram_ptr + lda #>$400 + sta vera_bram_ptr+1 + // [2303] phi from w25q16_read::@6 to w25q16_read::@23 [phi:w25q16_read::@6->w25q16_read::@23] + // w25q16_read::@23 + // [2304] phi from w25q16_read::@23 to w25q16_read::@7 [phi:w25q16_read::@23->w25q16_read::@7] + // [2304] phi w25q16_read::vera_bram_ptr#10 = w25q16_read::vera_bram_ptr#13 [phi:w25q16_read::@23->w25q16_read::@7#0] -- register_copy + // w25q16_read::@7 + __b7: + // display_action_text_reading(vera_action_text, "VERA.BIN", vera_file_size, vera_size, vera_bram_bank, vera_bram_ptr) + // [2305] display_action_text_reading::action#2 = w25q16_read::vera_action_text#10 -- pbuz1=pbum2 + lda vera_action_text + sta.z display_action_text_reading.action + lda vera_action_text+1 + sta.z display_action_text_reading.action+1 + // [2306] display_action_text_reading::bytes#2 = w25q16_read::vera_file_size#11 -- vduz1=vduz2 + lda.z vera_file_size + sta.z display_action_text_reading.bytes + lda.z vera_file_size+1 + sta.z display_action_text_reading.bytes+1 + lda.z vera_file_size+2 + sta.z display_action_text_reading.bytes+2 + lda.z vera_file_size+3 + sta.z display_action_text_reading.bytes+3 + // [2307] display_action_text_reading::bram_bank#2 = w25q16_read::vera_bram_bank#10 -- vbuz1=vbum2 + lda vera_bram_bank + sta.z display_action_text_reading.bram_bank + // [2308] display_action_text_reading::bram_ptr#2 = w25q16_read::vera_bram_ptr#10 -- pbuz1=pbum2 + lda vera_bram_ptr + sta.z display_action_text_reading.bram_ptr + lda vera_bram_ptr+1 + sta.z display_action_text_reading.bram_ptr+1 + // [2309] call display_action_text_reading + // [2683] phi from w25q16_read::@7 to display_action_text_reading [phi:w25q16_read::@7->display_action_text_reading] + // [2683] phi display_action_text_reading::bram_ptr#10 = display_action_text_reading::bram_ptr#2 [phi:w25q16_read::@7->display_action_text_reading#0] -- register_copy + // [2683] phi display_action_text_reading::bram_bank#10 = display_action_text_reading::bram_bank#2 [phi:w25q16_read::@7->display_action_text_reading#1] -- register_copy + // [2683] phi display_action_text_reading::size#10 = vera_size [phi:w25q16_read::@7->display_action_text_reading#2] -- vduz1=vduc1 + lda #vera_size + sta.z display_action_text_reading.size+1 + lda #>$10 + sta.z display_action_text_reading.size+2 + lda #>vera_size>>$10 + sta.z display_action_text_reading.size+3 + // [2683] phi display_action_text_reading::bytes#3 = display_action_text_reading::bytes#2 [phi:w25q16_read::@7->display_action_text_reading#3] -- register_copy + // [2683] phi display_action_text_reading::file#3 = w25q16_read::path [phi:w25q16_read::@7->display_action_text_reading#4] -- pbuz1=pbuc1 + lda #path + sta.z display_action_text_reading.file+1 + // [2683] phi display_action_text_reading::action#3 = display_action_text_reading::action#2 [phi:w25q16_read::@7->display_action_text_reading#5] -- register_copy + jsr display_action_text_reading + // w25q16_read::bank_set_bram2 + // BRAM = bank + // [2310] BRAM = w25q16_read::vera_bram_bank#10 -- vbuz1=vbum2 + lda vera_bram_bank + sta.z BRAM + // w25q16_read::@18 + // unsigned int vera_package_read = fgets(vera_bram_ptr, VERA_PROGRESS_CELL, fp) + // [2311] fgets::ptr#5 = w25q16_read::vera_bram_ptr#10 -- pbuz1=pbum2 + lda vera_bram_ptr + sta.z fgets.ptr + lda vera_bram_ptr+1 + sta.z fgets.ptr+1 + // [2312] fgets::stream#3 = w25q16_read::fp#0 -- pssz1=pssz2 + lda.z fp + sta.z fgets.stream + lda.z fp+1 + sta.z fgets.stream+1 + // [2313] call fgets + // [2714] phi from w25q16_read::@18 to fgets [phi:w25q16_read::@18->fgets] + // [2714] phi fgets::ptr#14 = fgets::ptr#5 [phi:w25q16_read::@18->fgets#0] -- register_copy + // [2714] phi fgets::size#10 = VERA_PROGRESS_CELL [phi:w25q16_read::@18->fgets#1] -- vwum1=vbuc1 + lda #VERA_PROGRESS_CELL + sta fgets.size+1 + // [2714] phi fgets::stream#4 = fgets::stream#3 [phi:w25q16_read::@18->fgets#2] -- register_copy + jsr fgets + // unsigned int vera_package_read = fgets(vera_bram_ptr, VERA_PROGRESS_CELL, fp) + // [2314] fgets::return#13 = fgets::return#1 + // w25q16_read::@21 + // [2315] w25q16_read::vera_package_read#0 = fgets::return#13 -- vwuz1=vwum2 + lda fgets.return + sta.z vera_package_read + lda fgets.return+1 + sta.z vera_package_read+1 + // if (!vera_package_read) + // [2316] if(0!=w25q16_read::vera_package_read#0) goto w25q16_read::@8 -- 0_neq_vwuz1_then_la1 + lda.z vera_package_read + ora.z vera_package_read+1 + bne __b8 + jmp __b9 + // w25q16_read::@8 + __b8: + // if (progress_row_current == VERA_PROGRESS_ROW) + // [2317] if(w25q16_read::progress_row_current#10!=VERA_PROGRESS_ROW) goto w25q16_read::@10 -- vwum1_neq_vwuc1_then_la1 + lda progress_row_current+1 + cmp #>VERA_PROGRESS_ROW + bne __b10 + lda progress_row_current + cmp #gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#34 [phi:w25q16_read::@13->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = PROGRESS_X [phi:w25q16_read::@13->gotoxy#1] -- vbuyy=vbuc1 + ldy #PROGRESS_X + jsr gotoxy + // [2321] phi from w25q16_read::@13 to w25q16_read::@10 [phi:w25q16_read::@13->w25q16_read::@10] + // [2321] phi w25q16_read::y#22 = w25q16_read::y#1 [phi:w25q16_read::@13->w25q16_read::@10#0] -- register_copy + // [2321] phi w25q16_read::progress_row_current#4 = 0 [phi:w25q16_read::@13->w25q16_read::@10#1] -- vwum1=vbuc1 + lda #<0 + sta progress_row_current + sta progress_row_current+1 + // [2321] phi from w25q16_read::@8 to w25q16_read::@10 [phi:w25q16_read::@8->w25q16_read::@10] + // [2321] phi w25q16_read::y#22 = w25q16_read::y#11 [phi:w25q16_read::@8->w25q16_read::@10#0] -- register_copy + // [2321] phi w25q16_read::progress_row_current#4 = w25q16_read::progress_row_current#10 [phi:w25q16_read::@8->w25q16_read::@10#1] -- register_copy + // w25q16_read::@10 + __b10: + // if(info_status == STATUS_READING) + // [2322] if(w25q16_read::info_status#12!=STATUS_READING) goto w25q16_read::@11 -- vbum1_neq_vbuc1_then_la1 + lda #STATUS_READING + cmp info_status + bne __b11 + // w25q16_read::@14 + // cputc('.') + // [2323] stackpush(char) = '.' -- _stackpushbyte_=vbuc1 + lda #'.' + pha + // [2324] callexecute cputc -- call_vprc1 + jsr cputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // w25q16_read::@11 + __b11: + // vera_bram_ptr += vera_package_read + // [2326] w25q16_read::vera_bram_ptr#2 = w25q16_read::vera_bram_ptr#10 + w25q16_read::vera_package_read#0 -- pbum1=pbum1_plus_vwuz2 + clc + lda vera_bram_ptr + adc.z vera_package_read + sta vera_bram_ptr + lda vera_bram_ptr+1 + adc.z vera_package_read+1 + sta vera_bram_ptr+1 + // vera_file_size += vera_package_read + // [2327] w25q16_read::vera_file_size#1 = w25q16_read::vera_file_size#11 + w25q16_read::vera_package_read#0 -- vduz1=vduz1_plus_vwuz2 + lda.z vera_file_size + clc + adc.z vera_package_read + sta.z vera_file_size + lda.z vera_file_size+1 + adc.z vera_package_read+1 + sta.z vera_file_size+1 + lda.z vera_file_size+2 + adc #0 + sta.z vera_file_size+2 + lda.z vera_file_size+3 + adc #0 + sta.z vera_file_size+3 + // progress_row_current += vera_package_read + // [2328] w25q16_read::progress_row_current#15 = w25q16_read::progress_row_current#4 + w25q16_read::vera_package_read#0 -- vwum1=vwum1_plus_vwuz2 + clc + lda progress_row_current + adc.z vera_package_read + sta progress_row_current + lda progress_row_current+1 + adc.z vera_package_read+1 + sta progress_row_current+1 + // if (vera_bram_ptr == (bram_ptr_t)BRAM_HIGH) + // [2329] if(w25q16_read::vera_bram_ptr#2!=(char *)$c000) goto w25q16_read::@12 -- pbum1_neq_pbuc1_then_la1 + lda vera_bram_ptr+1 + cmp #>$c000 + bne __b12 + lda vera_bram_ptr + cmp #<$c000 + bne __b12 + // w25q16_read::@15 + // vera_bram_bank++; + // [2330] w25q16_read::vera_bram_bank#2 = ++ w25q16_read::vera_bram_bank#10 -- vbum1=_inc_vbum1 + inc vera_bram_bank + // [2331] phi from w25q16_read::@15 to w25q16_read::@12 [phi:w25q16_read::@15->w25q16_read::@12] + // [2331] phi w25q16_read::vera_bram_bank#13 = w25q16_read::vera_bram_bank#2 [phi:w25q16_read::@15->w25q16_read::@12#0] -- register_copy + // [2331] phi w25q16_read::vera_bram_ptr#8 = (char *)$a000 [phi:w25q16_read::@15->w25q16_read::@12#1] -- pbum1=pbuc1 + lda #<$a000 + sta vera_bram_ptr + lda #>$a000 + sta vera_bram_ptr+1 + // [2331] phi from w25q16_read::@11 to w25q16_read::@12 [phi:w25q16_read::@11->w25q16_read::@12] + // [2331] phi w25q16_read::vera_bram_bank#13 = w25q16_read::vera_bram_bank#10 [phi:w25q16_read::@11->w25q16_read::@12#0] -- register_copy + // [2331] phi w25q16_read::vera_bram_ptr#8 = w25q16_read::vera_bram_ptr#2 [phi:w25q16_read::@11->w25q16_read::@12#1] -- register_copy + // w25q16_read::@12 + __b12: + // if (vera_bram_ptr == (bram_ptr_t)RAM_HIGH) + // [2332] if(w25q16_read::vera_bram_ptr#8!=(char *)$9800) goto w25q16_read::@22 -- pbum1_neq_pbuc1_then_la1 + lda vera_bram_ptr+1 + cmp #>$9800 + beq !__b5+ + jmp __b5 + !__b5: + lda vera_bram_ptr + cmp #<$9800 + beq !__b5+ + jmp __b5 + !__b5: + // [2296] phi from w25q16_read::@12 to w25q16_read::@5 [phi:w25q16_read::@12->w25q16_read::@5] + // [2296] phi w25q16_read::y#11 = w25q16_read::y#22 [phi:w25q16_read::@12->w25q16_read::@5#0] -- register_copy + // [2296] phi w25q16_read::progress_row_current#10 = w25q16_read::progress_row_current#15 [phi:w25q16_read::@12->w25q16_read::@5#1] -- register_copy + // [2296] phi w25q16_read::vera_bram_ptr#13 = (char *)$a000 [phi:w25q16_read::@12->w25q16_read::@5#2] -- pbum1=pbuc1 + lda #<$a000 + sta vera_bram_ptr + lda #>$a000 + sta vera_bram_ptr+1 + // [2296] phi w25q16_read::vera_bram_bank#10 = 1 [phi:w25q16_read::@12->w25q16_read::@5#3] -- vbum1=vbuc1 + lda #1 + sta vera_bram_bank + // [2296] phi w25q16_read::vera_file_size#11 = w25q16_read::vera_file_size#1 [phi:w25q16_read::@12->w25q16_read::@5#4] -- register_copy + jmp __b5 + // [2333] phi from w25q16_read::@12 to w25q16_read::@22 [phi:w25q16_read::@12->w25q16_read::@22] + // w25q16_read::@22 + // [2296] phi from w25q16_read::@22 to w25q16_read::@5 [phi:w25q16_read::@22->w25q16_read::@5] + // [2296] phi w25q16_read::y#11 = w25q16_read::y#22 [phi:w25q16_read::@22->w25q16_read::@5#0] -- register_copy + // [2296] phi w25q16_read::progress_row_current#10 = w25q16_read::progress_row_current#15 [phi:w25q16_read::@22->w25q16_read::@5#1] -- register_copy + // [2296] phi w25q16_read::vera_bram_ptr#13 = w25q16_read::vera_bram_ptr#8 [phi:w25q16_read::@22->w25q16_read::@5#2] -- register_copy + // [2296] phi w25q16_read::vera_bram_bank#10 = w25q16_read::vera_bram_bank#13 [phi:w25q16_read::@22->w25q16_read::@5#3] -- register_copy + // [2296] phi w25q16_read::vera_file_size#11 = w25q16_read::vera_file_size#1 [phi:w25q16_read::@22->w25q16_read::@5#4] -- register_copy + .segment Data + info_text: .text "Opening VERA.BIN from SD card ..." + .byte 0 + path: .text "VERA.BIN" + .byte 0 + .label y = w25q16_erase.vera_total_64k_blocks + // We start for VERA from 0x1:0xA000. + .label vera_bram_ptr = smc_flash.smc_bootloader_not_activated1 + .label vera_bram_bank = w25q16_verify.w25q16_byte + .label progress_row_current = util_wait_key.ch + .label info_status = util_wait_key.brom + .label vera_action_text = smc_flash.smc_commit_result +} +.segment Code + // uctoa +// Converts unsigned number value to a string representing it in RADIX format. +// If the leading digits are zero they are not included in the string. +// - value : The number to be converted to RADIX +// - buffer : receives the string representing the number and zero-termination. +// - radix : The radix to convert the number to (from the enum RADIX) +// void uctoa(__register(X) char value, __zp($2c) char *buffer, __register(Y) char radix) +uctoa: { + .label buffer = $2c + .label digit_values = $32 + // if(radix==DECIMAL) + // [2334] if(uctoa::radix#0==DECIMAL) goto uctoa::@1 -- vbuyy_eq_vbuc1_then_la1 + cpy #DECIMAL + beq __b2 + // uctoa::@2 + // if(radix==HEXADECIMAL) + // [2335] if(uctoa::radix#0==HEXADECIMAL) goto uctoa::@1 -- vbuyy_eq_vbuc1_then_la1 + cpy #HEXADECIMAL + beq __b3 + // uctoa::@3 + // if(radix==OCTAL) + // [2336] if(uctoa::radix#0==OCTAL) goto uctoa::@1 -- vbuyy_eq_vbuc1_then_la1 + cpy #OCTAL + beq __b4 + // uctoa::@4 + // if(radix==BINARY) + // [2337] if(uctoa::radix#0==BINARY) goto uctoa::@1 -- vbuyy_eq_vbuc1_then_la1 + cpy #BINARY + beq __b5 + // uctoa::@5 + // *buffer++ = 'e' + // [2338] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS) = 'e' -- _deref_pbuc1=vbuc2 + // Unknown radix + lda #'e' + sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS + // *buffer++ = 'r' + // [2339] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1) = 'r' -- _deref_pbuc1=vbuc2 + lda #'r' + sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1 + // [2340] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2) = 'r' -- _deref_pbuc1=vbuc2 + sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2 + // *buffer = 0 + // [2341] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3) = 0 -- _deref_pbuc1=vbuc2 + lda #0 + sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3 + // uctoa::@return + // } + // [2342] return + rts + // [2343] phi from uctoa to uctoa::@1 [phi:uctoa->uctoa::@1] + __b2: + // [2343] phi uctoa::digit_values#8 = RADIX_DECIMAL_VALUES_CHAR [phi:uctoa->uctoa::@1#0] -- pbuz1=pbuc1 + lda #RADIX_DECIMAL_VALUES_CHAR + sta.z digit_values+1 + // [2343] phi uctoa::max_digits#7 = 3 [phi:uctoa->uctoa::@1#1] -- vbum1=vbuc1 + lda #3 + sta max_digits + jmp __b1 + // [2343] phi from uctoa::@2 to uctoa::@1 [phi:uctoa::@2->uctoa::@1] + __b3: + // [2343] phi uctoa::digit_values#8 = RADIX_HEXADECIMAL_VALUES_CHAR [phi:uctoa::@2->uctoa::@1#0] -- pbuz1=pbuc1 + lda #RADIX_HEXADECIMAL_VALUES_CHAR + sta.z digit_values+1 + // [2343] phi uctoa::max_digits#7 = 2 [phi:uctoa::@2->uctoa::@1#1] -- vbum1=vbuc1 + lda #2 + sta max_digits + jmp __b1 + // [2343] phi from uctoa::@3 to uctoa::@1 [phi:uctoa::@3->uctoa::@1] + __b4: + // [2343] phi uctoa::digit_values#8 = RADIX_OCTAL_VALUES_CHAR [phi:uctoa::@3->uctoa::@1#0] -- pbuz1=pbuc1 + lda #RADIX_OCTAL_VALUES_CHAR + sta.z digit_values+1 + // [2343] phi uctoa::max_digits#7 = 3 [phi:uctoa::@3->uctoa::@1#1] -- vbum1=vbuc1 + lda #3 + sta max_digits + jmp __b1 + // [2343] phi from uctoa::@4 to uctoa::@1 [phi:uctoa::@4->uctoa::@1] + __b5: + // [2343] phi uctoa::digit_values#8 = RADIX_BINARY_VALUES_CHAR [phi:uctoa::@4->uctoa::@1#0] -- pbuz1=pbuc1 + lda #RADIX_BINARY_VALUES_CHAR + sta.z digit_values+1 + // [2343] phi uctoa::max_digits#7 = 8 [phi:uctoa::@4->uctoa::@1#1] -- vbum1=vbuc1 + lda #8 + sta max_digits + // uctoa::@1 + __b1: + // [2344] phi from uctoa::@1 to uctoa::@6 [phi:uctoa::@1->uctoa::@6] + // [2344] phi uctoa::buffer#11 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:uctoa::@1->uctoa::@6#0] -- pbuz1=pbuc1 + lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS sta.z buffer+1 - // [2098] phi uctoa::started#2 = 0 [phi:uctoa::@1->uctoa::@6#1] -- vbum1=vbuc1 + // [2344] phi uctoa::started#2 = 0 [phi:uctoa::@1->uctoa::@6#1] -- vbum1=vbuc1 lda #0 sta started - // [2098] phi uctoa::value#2 = uctoa::value#1 [phi:uctoa::@1->uctoa::@6#2] -- register_copy - // [2098] phi uctoa::digit#2 = 0 [phi:uctoa::@1->uctoa::@6#3] -- vbum1=vbuc1 + // [2344] phi uctoa::value#2 = uctoa::value#1 [phi:uctoa::@1->uctoa::@6#2] -- register_copy + // [2344] phi uctoa::digit#2 = 0 [phi:uctoa::@1->uctoa::@6#3] -- vbum1=vbuc1 sta digit // uctoa::@6 __b6: // max_digits-1 - // [2099] uctoa::$4 = uctoa::max_digits#7 - 1 -- vbuz1=vbum2_minus_1 - ldx max_digits - dex - stx.z uctoa__4 + // [2345] uctoa::$4 = uctoa::max_digits#7 - 1 -- vbuaa=vbum1_minus_1 + lda max_digits + sec + sbc #1 // for( char digit=0; digit= digit_value) - // [2105] if(0!=uctoa::started#2) goto uctoa::@10 -- 0_neq_vbum1_then_la1 + // [2351] if(0!=uctoa::started#2) goto uctoa::@10 -- 0_neq_vbum1_then_la1 lda started bne __b10 // uctoa::@12 - // [2106] if(uctoa::value#2>=uctoa::digit_value#0) goto uctoa::@10 -- vbum1_ge_vbum2_then_la1 - lda value - cmp digit_value + // [2352] if(uctoa::value#2>=uctoa::digit_value#0) goto uctoa::@10 -- vbuxx_ge_vbuyy_then_la1 + sty.z $ff + cpx.z $ff bcs __b10 - // [2107] phi from uctoa::@12 to uctoa::@9 [phi:uctoa::@12->uctoa::@9] - // [2107] phi uctoa::buffer#14 = uctoa::buffer#11 [phi:uctoa::@12->uctoa::@9#0] -- register_copy - // [2107] phi uctoa::started#4 = uctoa::started#2 [phi:uctoa::@12->uctoa::@9#1] -- register_copy - // [2107] phi uctoa::value#6 = uctoa::value#2 [phi:uctoa::@12->uctoa::@9#2] -- register_copy + // [2353] phi from uctoa::@12 to uctoa::@9 [phi:uctoa::@12->uctoa::@9] + // [2353] phi uctoa::buffer#14 = uctoa::buffer#11 [phi:uctoa::@12->uctoa::@9#0] -- register_copy + // [2353] phi uctoa::started#4 = uctoa::started#2 [phi:uctoa::@12->uctoa::@9#1] -- register_copy + // [2353] phi uctoa::value#6 = uctoa::value#2 [phi:uctoa::@12->uctoa::@9#2] -- register_copy // uctoa::@9 __b9: // for( char digit=0; digituctoa::@6] - // [2098] phi uctoa::buffer#11 = uctoa::buffer#14 [phi:uctoa::@9->uctoa::@6#0] -- register_copy - // [2098] phi uctoa::started#2 = uctoa::started#4 [phi:uctoa::@9->uctoa::@6#1] -- register_copy - // [2098] phi uctoa::value#2 = uctoa::value#6 [phi:uctoa::@9->uctoa::@6#2] -- register_copy - // [2098] phi uctoa::digit#2 = uctoa::digit#1 [phi:uctoa::@9->uctoa::@6#3] -- register_copy + // [2344] phi from uctoa::@9 to uctoa::@6 [phi:uctoa::@9->uctoa::@6] + // [2344] phi uctoa::buffer#11 = uctoa::buffer#14 [phi:uctoa::@9->uctoa::@6#0] -- register_copy + // [2344] phi uctoa::started#2 = uctoa::started#4 [phi:uctoa::@9->uctoa::@6#1] -- register_copy + // [2344] phi uctoa::value#2 = uctoa::value#6 [phi:uctoa::@9->uctoa::@6#2] -- register_copy + // [2344] phi uctoa::digit#2 = uctoa::digit#1 [phi:uctoa::@9->uctoa::@6#3] -- register_copy jmp __b6 // uctoa::@10 __b10: // uctoa_append(buffer++, value, digit_value) - // [2109] uctoa_append::buffer#0 = uctoa::buffer#11 -- pbuz1=pbuz2 + // [2355] uctoa_append::buffer#0 = uctoa::buffer#11 -- pbuz1=pbuz2 lda.z buffer sta.z uctoa_append.buffer lda.z buffer+1 sta.z uctoa_append.buffer+1 - // [2110] uctoa_append::value#0 = uctoa::value#2 - // [2111] uctoa_append::sub#0 = uctoa::digit_value#0 - // [2112] call uctoa_append - // [2817] phi from uctoa::@10 to uctoa_append [phi:uctoa::@10->uctoa_append] + // [2356] uctoa_append::value#0 = uctoa::value#2 + // [2357] uctoa_append::sub#0 = uctoa::digit_value#0 -- vbum1=vbuyy + sty uctoa_append.sub + // [2358] call uctoa_append + // [3244] phi from uctoa::@10 to uctoa_append [phi:uctoa::@10->uctoa_append] jsr uctoa_append // uctoa_append(buffer++, value, digit_value) - // [2113] uctoa_append::return#0 = uctoa_append::value#2 + // [2359] uctoa_append::return#0 = uctoa_append::value#2 // uctoa::@11 // value = uctoa_append(buffer++, value, digit_value) - // [2114] uctoa::value#0 = uctoa_append::return#0 + // [2360] uctoa::value#0 = uctoa_append::return#0 // value = uctoa_append(buffer++, value, digit_value); - // [2115] uctoa::buffer#4 = ++ uctoa::buffer#11 -- pbuz1=_inc_pbuz1 + // [2361] uctoa::buffer#4 = ++ uctoa::buffer#11 -- pbuz1=_inc_pbuz1 inc.z buffer bne !+ inc.z buffer+1 !: - // [2107] phi from uctoa::@11 to uctoa::@9 [phi:uctoa::@11->uctoa::@9] - // [2107] phi uctoa::buffer#14 = uctoa::buffer#4 [phi:uctoa::@11->uctoa::@9#0] -- register_copy - // [2107] phi uctoa::started#4 = 1 [phi:uctoa::@11->uctoa::@9#1] -- vbum1=vbuc1 + // [2353] phi from uctoa::@11 to uctoa::@9 [phi:uctoa::@11->uctoa::@9] + // [2353] phi uctoa::buffer#14 = uctoa::buffer#4 [phi:uctoa::@11->uctoa::@9#0] -- register_copy + // [2353] phi uctoa::started#4 = 1 [phi:uctoa::@11->uctoa::@9#1] -- vbum1=vbuc1 lda #1 sta started - // [2107] phi uctoa::value#6 = uctoa::value#0 [phi:uctoa::@11->uctoa::@9#2] -- register_copy + // [2353] phi uctoa::value#6 = uctoa::value#0 [phi:uctoa::@11->uctoa::@9#2] -- register_copy jmp __b9 .segment Data - digit_value: .byte 0 digit: .byte 0 - .label value = printf_uchar.uvalue - .label radix = printf_uchar.format_radix started: .byte 0 - max_digits: .byte 0 + .label max_digits = printf_string.format_justify_left } .segment Code // printf_number_buffer // Print the contents of the number buffer using a specific format. // This handles minimum length, zero-filling, and left/right justification from the format -// void printf_number_buffer(__zp($aa) void (*putc)(char), __mem() char buffer_sign, char *buffer_digits, __mem() char format_min_length, char format_justify_left, char format_sign_always, __mem() char format_zero_padding, char format_upper_case, char format_radix) +// void printf_number_buffer(__zp($67) void (*putc)(char), __mem() char buffer_sign, char *buffer_digits, __register(X) char format_min_length, char format_justify_left, char format_sign_always, __mem() char format_zero_padding, char format_upper_case, char format_radix) printf_number_buffer: { - .label printf_number_buffer__19 = $31 - .label putc = $aa + .label printf_number_buffer__19 = $6f + .label putc = $67 // if(format.min_length) - // [2117] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- 0_eq_vbum1_then_la1 - lda format_min_length + // [2363] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- 0_eq_vbuxx_then_la1 + cpx #0 beq __b5 - // [2118] phi from printf_number_buffer to printf_number_buffer::@5 [phi:printf_number_buffer->printf_number_buffer::@5] + // [2364] phi from printf_number_buffer to printf_number_buffer::@5 [phi:printf_number_buffer->printf_number_buffer::@5] // printf_number_buffer::@5 // strlen(buffer.digits) - // [2119] call strlen - // [2155] phi from printf_number_buffer::@5 to strlen [phi:printf_number_buffer::@5->strlen] - // [2155] phi strlen::str#8 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:printf_number_buffer::@5->strlen#0] -- pbuz1=pbuc1 + // [2365] call strlen + // [2555] phi from printf_number_buffer::@5 to strlen [phi:printf_number_buffer::@5->strlen] + // [2555] phi strlen::str#8 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:printf_number_buffer::@5->strlen#0] -- pbuz1=pbuc1 lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS sta.z strlen.str+1 jsr strlen // strlen(buffer.digits) - // [2120] strlen::return#3 = strlen::len#2 + // [2366] strlen::return#3 = strlen::len#2 // printf_number_buffer::@11 - // [2121] printf_number_buffer::$19 = strlen::return#3 -- vwuz1=vwum2 + // [2367] printf_number_buffer::$19 = strlen::return#3 -- vwuz1=vwum2 lda strlen.return sta.z printf_number_buffer__19 lda strlen.return+1 sta.z printf_number_buffer__19+1 // signed char len = (signed char)strlen(buffer.digits) - // [2122] printf_number_buffer::len#0 = (signed char)printf_number_buffer::$19 -- vbsm1=_sbyte_vwuz2 + // [2368] printf_number_buffer::len#0 = (signed char)printf_number_buffer::$19 -- vbsyy=_sbyte_vwuz1 // There is a minimum length - work out the padding - lda.z printf_number_buffer__19 - sta len + ldy.z printf_number_buffer__19 // if(buffer.sign) - // [2123] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@10 -- 0_eq_vbum1_then_la1 + // [2369] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@10 -- 0_eq_vbum1_then_la1 lda buffer_sign beq __b10 // printf_number_buffer::@6 // len++; - // [2124] printf_number_buffer::len#1 = ++ printf_number_buffer::len#0 -- vbsm1=_inc_vbsm1 - inc len - // [2125] phi from printf_number_buffer::@11 printf_number_buffer::@6 to printf_number_buffer::@10 [phi:printf_number_buffer::@11/printf_number_buffer::@6->printf_number_buffer::@10] - // [2125] phi printf_number_buffer::len#2 = printf_number_buffer::len#0 [phi:printf_number_buffer::@11/printf_number_buffer::@6->printf_number_buffer::@10#0] -- register_copy + // [2370] printf_number_buffer::len#1 = ++ printf_number_buffer::len#0 -- vbsyy=_inc_vbsyy + iny + // [2371] phi from printf_number_buffer::@11 printf_number_buffer::@6 to printf_number_buffer::@10 [phi:printf_number_buffer::@11/printf_number_buffer::@6->printf_number_buffer::@10] + // [2371] phi printf_number_buffer::len#2 = printf_number_buffer::len#0 [phi:printf_number_buffer::@11/printf_number_buffer::@6->printf_number_buffer::@10#0] -- register_copy // printf_number_buffer::@10 __b10: // padding = (signed char)format.min_length - len - // [2126] printf_number_buffer::padding#1 = (signed char)printf_number_buffer::format_min_length#3 - printf_number_buffer::len#2 -- vbsm1=vbsm2_minus_vbsm1 - lda format_min_length + // [2372] printf_number_buffer::padding#1 = (signed char)printf_number_buffer::format_min_length#3 - printf_number_buffer::len#2 -- vbsm1=vbsxx_minus_vbsyy + txa + sty.z $ff sec - sbc padding + sbc.z $ff sta padding // if(padding<0) - // [2127] if(printf_number_buffer::padding#1>=0) goto printf_number_buffer::@15 -- vbsm1_ge_0_then_la1 + // [2373] if(printf_number_buffer::padding#1>=0) goto printf_number_buffer::@15 -- vbsm1_ge_0_then_la1 cmp #0 bpl __b1 - // [2129] phi from printf_number_buffer printf_number_buffer::@10 to printf_number_buffer::@1 [phi:printf_number_buffer/printf_number_buffer::@10->printf_number_buffer::@1] + // [2375] phi from printf_number_buffer printf_number_buffer::@10 to printf_number_buffer::@1 [phi:printf_number_buffer/printf_number_buffer::@10->printf_number_buffer::@1] __b5: - // [2129] phi printf_number_buffer::padding#10 = 0 [phi:printf_number_buffer/printf_number_buffer::@10->printf_number_buffer::@1#0] -- vbsm1=vbsc1 + // [2375] phi printf_number_buffer::padding#10 = 0 [phi:printf_number_buffer/printf_number_buffer::@10->printf_number_buffer::@1#0] -- vbsm1=vbsc1 lda #0 sta padding - // [2128] phi from printf_number_buffer::@10 to printf_number_buffer::@15 [phi:printf_number_buffer::@10->printf_number_buffer::@15] + // [2374] phi from printf_number_buffer::@10 to printf_number_buffer::@15 [phi:printf_number_buffer::@10->printf_number_buffer::@15] // printf_number_buffer::@15 - // [2129] phi from printf_number_buffer::@15 to printf_number_buffer::@1 [phi:printf_number_buffer::@15->printf_number_buffer::@1] - // [2129] phi printf_number_buffer::padding#10 = printf_number_buffer::padding#1 [phi:printf_number_buffer::@15->printf_number_buffer::@1#0] -- register_copy + // [2375] phi from printf_number_buffer::@15 to printf_number_buffer::@1 [phi:printf_number_buffer::@15->printf_number_buffer::@1] + // [2375] phi printf_number_buffer::padding#10 = printf_number_buffer::padding#1 [phi:printf_number_buffer::@15->printf_number_buffer::@1#0] -- register_copy // printf_number_buffer::@1 __b1: // printf_number_buffer::@13 // if(!format.justify_left && !format.zero_padding && padding) - // [2130] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- 0_neq_vbum1_then_la1 + // [2376] if(0!=printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@2 -- 0_neq_vbum1_then_la1 lda format_zero_padding bne __b2 // printf_number_buffer::@12 - // [2131] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@7 -- 0_neq_vbsm1_then_la1 + // [2377] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@7 -- 0_neq_vbsm1_then_la1 lda padding cmp #0 bne __b7 @@ -14551,44 +15520,44 @@ printf_number_buffer: { // printf_number_buffer::@7 __b7: // printf_padding(putc, ' ',(char)padding) - // [2132] printf_padding::putc#0 = printf_number_buffer::putc#10 -- pprz1=pprz2 + // [2378] printf_padding::putc#0 = printf_number_buffer::putc#10 -- pprz1=pprz2 lda.z putc sta.z printf_padding.putc lda.z putc+1 sta.z printf_padding.putc+1 - // [2133] printf_padding::length#0 = (char)printf_number_buffer::padding#10 -- vbum1=vbum2 + // [2379] printf_padding::length#0 = (char)printf_number_buffer::padding#10 -- vbum1=vbum2 lda padding sta printf_padding.length - // [2134] call printf_padding - // [2161] phi from printf_number_buffer::@7 to printf_padding [phi:printf_number_buffer::@7->printf_padding] - // [2161] phi printf_padding::putc#7 = printf_padding::putc#0 [phi:printf_number_buffer::@7->printf_padding#0] -- register_copy - // [2161] phi printf_padding::pad#7 = ' ' [phi:printf_number_buffer::@7->printf_padding#1] -- vbum1=vbuc1 + // [2380] call printf_padding + // [2561] phi from printf_number_buffer::@7 to printf_padding [phi:printf_number_buffer::@7->printf_padding] + // [2561] phi printf_padding::putc#7 = printf_padding::putc#0 [phi:printf_number_buffer::@7->printf_padding#0] -- register_copy + // [2561] phi printf_padding::pad#7 = ' ' [phi:printf_number_buffer::@7->printf_padding#1] -- vbum1=vbuc1 lda #' ' sta printf_padding.pad - // [2161] phi printf_padding::length#6 = printf_padding::length#0 [phi:printf_number_buffer::@7->printf_padding#2] -- register_copy + // [2561] phi printf_padding::length#6 = printf_padding::length#0 [phi:printf_number_buffer::@7->printf_padding#2] -- register_copy jsr printf_padding // printf_number_buffer::@2 __b2: // if(buffer.sign) - // [2135] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- 0_eq_vbum1_then_la1 + // [2381] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@3 -- 0_eq_vbum1_then_la1 lda buffer_sign beq __b3 // printf_number_buffer::@8 // putc(buffer.sign) - // [2136] stackpush(char) = printf_number_buffer::buffer_sign#10 -- _stackpushbyte_=vbum1 + // [2382] stackpush(char) = printf_number_buffer::buffer_sign#10 -- _stackpushbyte_=vbum1 pha - // [2137] callexecute *printf_number_buffer::putc#10 -- call__deref_pprz1 - jsr icall30 + // [2383] callexecute *printf_number_buffer::putc#10 -- call__deref_pprz1 + jsr icall35 // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // printf_number_buffer::@3 __b3: // if(format.zero_padding && padding) - // [2139] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- 0_eq_vbum1_then_la1 + // [2385] if(0==printf_number_buffer::format_zero_padding#10) goto printf_number_buffer::@4 -- 0_eq_vbum1_then_la1 lda format_zero_padding beq __b4 // printf_number_buffer::@14 - // [2140] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@9 -- 0_neq_vbsm1_then_la1 + // [2386] if(0!=printf_number_buffer::padding#10) goto printf_number_buffer::@9 -- 0_neq_vbsm1_then_la1 lda padding cmp #0 bne __b9 @@ -14596,30 +15565,30 @@ printf_number_buffer: { // printf_number_buffer::@9 __b9: // printf_padding(putc, '0',(char)padding) - // [2141] printf_padding::putc#1 = printf_number_buffer::putc#10 -- pprz1=pprz2 + // [2387] printf_padding::putc#1 = printf_number_buffer::putc#10 -- pprz1=pprz2 lda.z putc sta.z printf_padding.putc lda.z putc+1 sta.z printf_padding.putc+1 - // [2142] printf_padding::length#1 = (char)printf_number_buffer::padding#10 -- vbum1=vbum2 + // [2388] printf_padding::length#1 = (char)printf_number_buffer::padding#10 -- vbum1=vbum2 lda padding sta printf_padding.length - // [2143] call printf_padding - // [2161] phi from printf_number_buffer::@9 to printf_padding [phi:printf_number_buffer::@9->printf_padding] - // [2161] phi printf_padding::putc#7 = printf_padding::putc#1 [phi:printf_number_buffer::@9->printf_padding#0] -- register_copy - // [2161] phi printf_padding::pad#7 = '0' [phi:printf_number_buffer::@9->printf_padding#1] -- vbum1=vbuc1 + // [2389] call printf_padding + // [2561] phi from printf_number_buffer::@9 to printf_padding [phi:printf_number_buffer::@9->printf_padding] + // [2561] phi printf_padding::putc#7 = printf_padding::putc#1 [phi:printf_number_buffer::@9->printf_padding#0] -- register_copy + // [2561] phi printf_padding::pad#7 = '0' [phi:printf_number_buffer::@9->printf_padding#1] -- vbum1=vbuc1 lda #'0' sta printf_padding.pad - // [2161] phi printf_padding::length#6 = printf_padding::length#1 [phi:printf_number_buffer::@9->printf_padding#2] -- register_copy + // [2561] phi printf_padding::length#6 = printf_padding::length#1 [phi:printf_number_buffer::@9->printf_padding#2] -- register_copy jsr printf_padding // printf_number_buffer::@4 __b4: // printf_str(putc, buffer.digits) - // [2144] printf_str::putc#0 = printf_number_buffer::putc#10 - // [2145] call printf_str - // [1054] phi from printf_number_buffer::@4 to printf_str [phi:printf_number_buffer::@4->printf_str] - // [1054] phi printf_str::putc#75 = printf_str::putc#0 [phi:printf_number_buffer::@4->printf_str#0] -- register_copy - // [1054] phi printf_str::s#75 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:printf_number_buffer::@4->printf_str#1] -- pbuz1=pbuc1 + // [2390] printf_str::putc#0 = printf_number_buffer::putc#10 + // [2391] call printf_str + // [1125] phi from printf_number_buffer::@4 to printf_str [phi:printf_number_buffer::@4->printf_str] + // [1125] phi printf_str::putc#79 = printf_str::putc#0 [phi:printf_number_buffer::@4->printf_str#0] -- register_copy + // [1125] phi printf_str::s#79 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:printf_number_buffer::@4->printf_str#1] -- pbuz1=pbuc1 lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS @@ -14627,140 +15596,1429 @@ printf_number_buffer: { jsr printf_str // printf_number_buffer::@return // } - // [2146] return + // [2392] return rts // Outside Flow - icall30: + icall35: jmp (putc) .segment Data - buffer_sign: .byte 0 - .label format_min_length = printf_uchar.format_min_length + .label buffer_sign = uctoa.digit .label format_zero_padding = printf_uchar.format_zero_padding - len: .byte 0 - .label padding = len + .label padding = uctoa.started } -.segment Code - // cputcxy -// Move cursor and output one character -// Same as "gotoxy (x, y); cputc (c);" -// void cputcxy(__mem() char x, __mem() char y, __mem() char c) -cputcxy: { +.segment CodeVera + // w25q16_verify +/** + * @brief Verify the w25q16 flash memory contents with the VERA.BIN file contents loaded from RAM $01:A000. + * + * @return unsigned long The total different bytes identified. + */ +// __mem() unsigned long w25q16_verify(__register(X) char verify) +w25q16_verify: { + .label w25q16_verify__10 = $c5 + .label w25q16_address = $36 + .label different_char = $22 + // w25q16_verify::bank_set_bram1 + // BRAM = bank + // [2394] BRAM = 1 -- vbuz1=vbuc1 + lda #1 + sta.z BRAM + // w25q16_verify::@21 + // if(verify) + // [2395] if(0!=w25q16_verify::verify#2) goto w25q16_verify::@1 -- 0_neq_vbuxx_then_la1 + cpx #0 + beq !__b1+ + jmp __b1 + !__b1: + // [2396] phi from w25q16_verify::@21 to w25q16_verify::@3 [phi:w25q16_verify::@21->w25q16_verify::@3] + // w25q16_verify::@3 + // display_action_progress("Comparing VERA with VERA.BIN ... (.) data, (=) same, (*) different.") + // [2397] call display_action_progress + // [1155] phi from w25q16_verify::@3 to display_action_progress [phi:w25q16_verify::@3->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = w25q16_verify::info_text1 [phi:w25q16_verify::@3->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text1 + sta.z display_action_progress.info_text+1 + jsr display_action_progress + // [2398] phi from w25q16_verify::@3 to w25q16_verify::@2 [phi:w25q16_verify::@3->w25q16_verify::@2] + // [2398] phi w25q16_verify::different_char#16 = '*' [phi:w25q16_verify::@3->w25q16_verify::@2#0] -- vbuz1=vbuc1 + lda #'*' + sta.z different_char + // w25q16_verify::@2 + __b2: // gotoxy(x, y) - // [2148] gotoxy::x#0 = cputcxy::x#15 -- vbum1=vbum2 - lda x - sta gotoxy.x - // [2149] gotoxy::y#0 = cputcxy::y#15 -- vbum1=vbum2 - lda y + // [2399] call gotoxy + // [805] phi from w25q16_verify::@2 to gotoxy [phi:w25q16_verify::@2->gotoxy] + // [805] phi gotoxy::y#37 = PROGRESS_Y [phi:w25q16_verify::@2->gotoxy#0] -- vbum1=vbuc1 + lda #PROGRESS_Y sta gotoxy.y - // [2150] call gotoxy - // [778] phi from cputcxy to gotoxy [phi:cputcxy->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#0 [phi:cputcxy->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = gotoxy::x#0 [phi:cputcxy->gotoxy#1] -- register_copy + // [805] phi gotoxy::x#37 = PROGRESS_X [phi:w25q16_verify::@2->gotoxy#1] -- vbuyy=vbuc1 + ldy #PROGRESS_X jsr gotoxy - // cputcxy::@1 - // cputc(c) - // [2151] stackpush(char) = cputcxy::c#15 -- _stackpushbyte_=vbum1 - lda c + // [2400] phi from w25q16_verify::@2 to w25q16_verify::@22 [phi:w25q16_verify::@2->w25q16_verify::@22] + // w25q16_verify::@22 + // spi_read_flash(0UL) + // [2401] call spi_read_flash + // [3251] phi from w25q16_verify::@22 to spi_read_flash [phi:w25q16_verify::@22->spi_read_flash] + jsr spi_read_flash + // [2402] phi from w25q16_verify::@22 to w25q16_verify::@4 [phi:w25q16_verify::@22->w25q16_verify::@4] + // [2402] phi w25q16_verify::y#15 = PROGRESS_Y [phi:w25q16_verify::@22->w25q16_verify::@4#0] -- vbum1=vbuc1 + lda #PROGRESS_Y + sta y + // [2402] phi w25q16_verify::progress_row_current#12 = 0 [phi:w25q16_verify::@22->w25q16_verify::@4#1] -- vwum1=vwuc1 + lda #<0 + sta progress_row_current + sta progress_row_current+1 + // [2402] phi w25q16_verify::bram_ptr#14 = (char *)$a000 [phi:w25q16_verify::@22->w25q16_verify::@4#2] -- pbum1=pbuc1 + lda #<$a000 + sta bram_ptr + lda #>$a000 + sta bram_ptr+1 + // [2402] phi w25q16_verify::w25q16_different_bytes#2 = 0 [phi:w25q16_verify::@22->w25q16_verify::@4#3] -- vdum1=vduc1 + lda #<0 + sta w25q16_different_bytes + sta w25q16_different_bytes+1 + lda #<0>>$10 + sta w25q16_different_bytes+2 + lda #>0>>$10 + sta w25q16_different_bytes+3 + // [2402] phi w25q16_verify::bank_set_bram2_bank#0 = 1 [phi:w25q16_verify::@22->w25q16_verify::@4#4] -- vbum1=vbuc1 + lda #1 + sta bank_set_bram2_bank + // [2402] phi w25q16_verify::w25q16_address#2 = 0 [phi:w25q16_verify::@22->w25q16_verify::@4#5] -- vduz1=vduc1 + lda #<0 + sta.z w25q16_address + sta.z w25q16_address+1 + lda #<0>>$10 + sta.z w25q16_address+2 + lda #>0>>$10 + sta.z w25q16_address+3 + // Start the w26q16 flash memory read cycle from 0x0 using the spi interface + // w25q16_verify::@4 + __b4: + // while (w25q16_address < vera_file_size) + // [2403] if(w25q16_verify::w25q16_address#2w25q16_verify::@6] + // w25q16_verify::@6 + // wait_moment(16) + // [2405] call wait_moment + // [1134] phi from w25q16_verify::@6 to wait_moment [phi:w25q16_verify::@6->wait_moment] + // [1134] phi wait_moment::w#17 = $10 [phi:w25q16_verify::@6->wait_moment#0] -- vbuz1=vbuc1 + lda #$10 + sta.z wait_moment.w + jsr wait_moment + // w25q16_verify::@return + // } + // [2406] return + rts + // w25q16_verify::@5 + __b5: + // w25q16_address + VERA_PROGRESS_CELL + // [2407] w25q16_verify::$7 = w25q16_verify::w25q16_address#2 + VERA_PROGRESS_CELL -- vdum1=vduz2_plus_vbuc1 + lda #VERA_PROGRESS_CELL + clc + adc.z w25q16_address + sta w25q16_verify__7 + lda.z w25q16_address+1 + adc #0 + sta w25q16_verify__7+1 + lda.z w25q16_address+2 + adc #0 + sta w25q16_verify__7+2 + lda.z w25q16_address+3 + adc #0 + sta w25q16_verify__7+3 + // if(w25q16_address + VERA_PROGRESS_CELL > vera_file_size) + // [2408] if(w25q16_verify::$7<=vera_file_size#1) goto w25q16_verify::@7 -- vdum1_le_vdum2_then_la1 + lda vera_file_size+3 + cmp w25q16_verify__7+3 + bcc !+ + bne __b3 + lda vera_file_size+2 + cmp w25q16_verify__7+2 + bcc !+ + bne __b3 + lda vera_file_size+1 + cmp w25q16_verify__7+1 + bcc !+ + bne __b3 + lda vera_file_size + cmp w25q16_verify__7 + bcs __b3 + !: + // w25q16_verify::@18 + // vera_file_size - w25q16_address + // [2409] w25q16_verify::$10 = vera_file_size#1 - w25q16_verify::w25q16_address#2 -- vduz1=vdum2_minus_vduz3 + lda vera_file_size + sec + sbc.z w25q16_address + sta.z w25q16_verify__10 + lda vera_file_size+1 + sbc.z w25q16_address+1 + sta.z w25q16_verify__10+1 + lda vera_file_size+2 + sbc.z w25q16_address+2 + sta.z w25q16_verify__10+2 + lda vera_file_size+3 + sbc.z w25q16_address+3 + sta.z w25q16_verify__10+3 + // w25q16_compare_size = BYTE0(vera_file_size - w25q16_address) + // [2410] w25q16_verify::w25q16_compare_size#1 = byte0 w25q16_verify::$10 -- vbum1=_byte0_vduz2 + lda.z w25q16_verify__10 + sta w25q16_compare_size + // [2411] phi from w25q16_verify::@18 to w25q16_verify::@7 [phi:w25q16_verify::@18->w25q16_verify::@7] + // [2411] phi w25q16_verify::w25q16_compare_size#15 = w25q16_verify::w25q16_compare_size#1 [phi:w25q16_verify::@18->w25q16_verify::@7#0] -- register_copy + jmp __b7 + // [2411] phi from w25q16_verify::@5 to w25q16_verify::@7 [phi:w25q16_verify::@5->w25q16_verify::@7] + __b3: + // [2411] phi w25q16_verify::w25q16_compare_size#15 = VERA_PROGRESS_CELL [phi:w25q16_verify::@5->w25q16_verify::@7#0] -- vbum1=vbuc1 + lda #VERA_PROGRESS_CELL + sta w25q16_compare_size + // w25q16_verify::@7 + __b7: + // w25q16_verify::bank_set_bram2 + // BRAM = bank + // [2412] BRAM = w25q16_verify::bank_set_bram2_bank#0 -- vbuz1=vbum2 + lda bank_set_bram2_bank + sta.z BRAM + // [2413] phi from w25q16_verify::bank_set_bram2 to w25q16_verify::@8 [phi:w25q16_verify::bank_set_bram2->w25q16_verify::@8] + // [2413] phi w25q16_verify::w25q16_equal_bytes#10 = 0 [phi:w25q16_verify::bank_set_bram2->w25q16_verify::@8#0] -- vbum1=vbuc1 + lda #0 + sta w25q16_equal_bytes + // [2413] phi w25q16_verify::w25q16_compared_bytes#2 = 0 [phi:w25q16_verify::bank_set_bram2->w25q16_verify::@8#1] -- vbum1=vbuc1 + sta w25q16_compared_bytes + // [2413] phi w25q16_verify::bram_ptr#10 = w25q16_verify::bram_ptr#14 [phi:w25q16_verify::bank_set_bram2->w25q16_verify::@8#2] -- register_copy + // w25q16_verify::@8 + __b8: + // unsigned char w25q16_byte = spi_read() + // [2414] call spi_read + jsr spi_read + // [2415] spi_read::return#14 = spi_read::return#12 + // w25q16_verify::@23 + // [2416] w25q16_verify::w25q16_byte#0 = spi_read::return#14 -- vbum1=vbuaa + sta w25q16_byte + // if (w25q16_byte == *bram_ptr) + // [2417] if(w25q16_verify::w25q16_byte#0!=*w25q16_verify::bram_ptr#10) goto w25q16_verify::@9 -- vbum1_neq__deref_pbum2_then_la1 + ldy bram_ptr + sty.z $fe + ldy bram_ptr+1 + sty.z $ff + ldy #0 + lda ($fe),y + cmp w25q16_byte + bne __b9 + // w25q16_verify::@10 + // w25q16_equal_bytes++; + // [2418] w25q16_verify::w25q16_equal_bytes#1 = ++ w25q16_verify::w25q16_equal_bytes#10 -- vbum1=_inc_vbum1 + inc w25q16_equal_bytes + // [2419] phi from w25q16_verify::@10 w25q16_verify::@23 to w25q16_verify::@9 [phi:w25q16_verify::@10/w25q16_verify::@23->w25q16_verify::@9] + // [2419] phi w25q16_verify::w25q16_equal_bytes#11 = w25q16_verify::w25q16_equal_bytes#1 [phi:w25q16_verify::@10/w25q16_verify::@23->w25q16_verify::@9#0] -- register_copy + // w25q16_verify::@9 + __b9: + // bram_ptr++; + // [2420] w25q16_verify::bram_ptr#1 = ++ w25q16_verify::bram_ptr#10 -- pbum1=_inc_pbum1 + inc bram_ptr + bne !+ + inc bram_ptr+1 + !: + // w25q16_compare_size-1 + // [2421] w25q16_verify::$16 = w25q16_verify::w25q16_compare_size#15 - 1 -- vbuxx=vbum1_minus_1 + ldx w25q16_compare_size + dex + // while(w25q16_compared_bytes++ != w25q16_compare_size-1) + // [2422] w25q16_verify::w25q16_compared_bytes#1 = ++ w25q16_verify::w25q16_compared_bytes#2 -- vbuaa=_inc_vbum1 + lda w25q16_compared_bytes + inc + // [2423] if(w25q16_verify::w25q16_compared_bytes#2!=w25q16_verify::$16) goto w25q16_verify::@32 -- vbum1_neq_vbuxx_then_la1 + cpx w25q16_compared_bytes + beq !__b32+ + jmp __b32 + !__b32: + // w25q16_verify::@11 + // if (progress_row_current == VERA_PROGRESS_ROW) + // [2424] if(w25q16_verify::progress_row_current#12!=VERA_PROGRESS_ROW) goto w25q16_verify::@13 -- vwum1_neq_vwuc1_then_la1 + lda progress_row_current+1 + cmp #>VERA_PROGRESS_ROW + bne __b13 + lda progress_row_current + cmp #gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#36 [phi:w25q16_verify::@12->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = PROGRESS_X [phi:w25q16_verify::@12->gotoxy#1] -- vbuyy=vbuc1 + ldy #PROGRESS_X + jsr gotoxy + // [2428] phi from w25q16_verify::@12 to w25q16_verify::@13 [phi:w25q16_verify::@12->w25q16_verify::@13] + // [2428] phi w25q16_verify::y#21 = w25q16_verify::y#1 [phi:w25q16_verify::@12->w25q16_verify::@13#0] -- register_copy + // [2428] phi w25q16_verify::progress_row_current#10 = 0 [phi:w25q16_verify::@12->w25q16_verify::@13#1] -- vwum1=vbuc1 + lda #<0 + sta progress_row_current + sta progress_row_current+1 + // [2428] phi from w25q16_verify::@11 to w25q16_verify::@13 [phi:w25q16_verify::@11->w25q16_verify::@13] + // [2428] phi w25q16_verify::y#21 = w25q16_verify::y#15 [phi:w25q16_verify::@11->w25q16_verify::@13#0] -- register_copy + // [2428] phi w25q16_verify::progress_row_current#10 = w25q16_verify::progress_row_current#12 [phi:w25q16_verify::@11->w25q16_verify::@13#1] -- register_copy + // w25q16_verify::@13 + __b13: + // if (w25q16_equal_bytes != w25q16_compare_size) + // [2429] if(w25q16_verify::w25q16_equal_bytes#11!=w25q16_verify::w25q16_compare_size#15) goto w25q16_verify::@14 -- vbum1_neq_vbum2_then_la1 + lda w25q16_equal_bytes + cmp w25q16_compare_size + beq !__b14+ + jmp __b14 + !__b14: + // w25q16_verify::@19 + // cputc('=') + // [2430] stackpush(char) = '=' -- _stackpushbyte_=vbuc1 + lda #'=' + pha + // [2431] callexecute cputc -- call_vprc1 + jsr cputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // w25q16_verify::@15 + __b15: + // w25q16_address += VERA_PROGRESS_CELL + // [2433] w25q16_verify::w25q16_address#1 = w25q16_verify::w25q16_address#2 + VERA_PROGRESS_CELL -- vduz1=vduz1_plus_vbuc1 + // vera_bram_ptr += VERA_PROGRESS_CELL; + lda.z w25q16_address + clc + adc #VERA_PROGRESS_CELL + sta.z w25q16_address + bcc !+ + inc.z w25q16_address+1 + bne !+ + inc.z w25q16_address+2 + bne !+ + inc.z w25q16_address+3 + !: + // progress_row_current += VERA_PROGRESS_CELL + // [2434] w25q16_verify::progress_row_current#18 = w25q16_verify::progress_row_current#10 + VERA_PROGRESS_CELL -- vwum1=vwum1_plus_vbuc1 + lda #VERA_PROGRESS_CELL + clc + adc progress_row_current + sta progress_row_current + bcc !+ + inc progress_row_current+1 + !: + // if (bram_ptr == BRAM_HIGH) + // [2435] if(w25q16_verify::bram_ptr#1!=$c000) goto w25q16_verify::@16 -- pbum1_neq_vwuc1_then_la1 + lda bram_ptr+1 + cmp #>$c000 + bne __b6 + lda bram_ptr + cmp #<$c000 + bne __b6 + // w25q16_verify::@20 + // bram_bank++; + // [2436] w25q16_verify::bram_bank#1 = ++ w25q16_verify::bank_set_bram2_bank#0 -- vbum1=_inc_vbum2 + lda bank_set_bram2_bank + inc + sta bram_bank + // [2437] phi from w25q16_verify::@20 to w25q16_verify::@16 [phi:w25q16_verify::@20->w25q16_verify::@16] + // [2437] phi w25q16_verify::bram_bank#21 = w25q16_verify::bram_bank#1 [phi:w25q16_verify::@20->w25q16_verify::@16#0] -- register_copy + // [2437] phi w25q16_verify::bram_ptr#7 = (char *)$a000 [phi:w25q16_verify::@20->w25q16_verify::@16#1] -- pbum1=pbuc1 + lda #<$a000 + sta bram_ptr + lda #>$a000 + sta bram_ptr+1 + jmp __b16 + // [2437] phi from w25q16_verify::@15 to w25q16_verify::@16 [phi:w25q16_verify::@15->w25q16_verify::@16] + __b6: + // [2437] phi w25q16_verify::bram_bank#21 = w25q16_verify::bank_set_bram2_bank#0 [phi:w25q16_verify::@15->w25q16_verify::@16#0] -- vbum1=vbum2 + lda bank_set_bram2_bank + sta bram_bank + // [2437] phi w25q16_verify::bram_ptr#7 = w25q16_verify::bram_ptr#1 [phi:w25q16_verify::@15->w25q16_verify::@16#1] -- register_copy + // w25q16_verify::@16 + __b16: + // if (bram_ptr == RAM_HIGH) + // [2438] if(w25q16_verify::bram_ptr#7!=$9800) goto w25q16_verify::@33 -- pbum1_neq_vwuc1_then_la1 + lda bram_ptr+1 + cmp #>$9800 + bne __b17 + lda bram_ptr + cmp #<$9800 + bne __b17 + // [2440] phi from w25q16_verify::@16 to w25q16_verify::@17 [phi:w25q16_verify::@16->w25q16_verify::@17] + // [2440] phi w25q16_verify::bram_ptr#13 = (char *)$a000 [phi:w25q16_verify::@16->w25q16_verify::@17#0] -- pbum1=pbuc1 + lda #<$a000 + sta bram_ptr + lda #>$a000 + sta bram_ptr+1 + // [2440] phi w25q16_verify::bram_bank#13 = 1 [phi:w25q16_verify::@16->w25q16_verify::@17#1] -- vbum1=vbuc1 + lda #1 + sta bram_bank + // [2439] phi from w25q16_verify::@16 to w25q16_verify::@33 [phi:w25q16_verify::@16->w25q16_verify::@33] + // w25q16_verify::@33 + // [2440] phi from w25q16_verify::@33 to w25q16_verify::@17 [phi:w25q16_verify::@33->w25q16_verify::@17] + // [2440] phi w25q16_verify::bram_ptr#13 = w25q16_verify::bram_ptr#7 [phi:w25q16_verify::@33->w25q16_verify::@17#0] -- register_copy + // [2440] phi w25q16_verify::bram_bank#13 = w25q16_verify::bram_bank#21 [phi:w25q16_verify::@33->w25q16_verify::@17#1] -- register_copy + // w25q16_verify::@17 + __b17: + // w25q16_compare_size - w25q16_equal_bytes + // [2441] w25q16_verify::$28 = w25q16_verify::w25q16_compare_size#15 - w25q16_verify::w25q16_equal_bytes#11 -- vbuaa=vbum1_minus_vbum2 + lda w25q16_compare_size + sec + sbc w25q16_equal_bytes + // w25q16_different_bytes += (w25q16_compare_size - w25q16_equal_bytes) + // [2442] w25q16_verify::w25q16_different_bytes#1 = w25q16_verify::w25q16_different_bytes#2 + w25q16_verify::$28 -- vdum1=vdum1_plus_vbuaa + clc + adc w25q16_different_bytes + sta w25q16_different_bytes + lda w25q16_different_bytes+1 + adc #0 + sta w25q16_different_bytes+1 + lda w25q16_different_bytes+2 + adc #0 + sta w25q16_different_bytes+2 + lda w25q16_different_bytes+3 + adc #0 + sta w25q16_different_bytes+3 + // sprintf(info_text, "%05x different RAM:%02x:%04p <-> VERA:%05x", w25q16_different_bytes, bram_bank, bram_ptr, w25q16_address) + // [2443] call snprintf_init + // [1184] phi from w25q16_verify::@17 to snprintf_init [phi:w25q16_verify::@17->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:w25q16_verify::@17->snprintf_init#0] -- pbuz1=pbuc1 + lda #<@info_text + sta.z snprintf_init.s + lda #>@info_text + sta.z snprintf_init.s+1 + jsr snprintf_init + // w25q16_verify::@24 + // sprintf(info_text, "%05x different RAM:%02x:%04p <-> VERA:%05x", w25q16_different_bytes, bram_bank, bram_ptr, w25q16_address) + // [2444] printf_ulong::uvalue#8 = w25q16_verify::w25q16_different_bytes#1 -- vdum1=vdum2 + lda w25q16_different_bytes + sta printf_ulong.uvalue + lda w25q16_different_bytes+1 + sta printf_ulong.uvalue+1 + lda w25q16_different_bytes+2 + sta printf_ulong.uvalue+2 + lda w25q16_different_bytes+3 + sta printf_ulong.uvalue+3 + // [2445] call printf_ulong + // [1588] phi from w25q16_verify::@24 to printf_ulong [phi:w25q16_verify::@24->printf_ulong] + // [1588] phi printf_ulong::format_zero_padding#14 = 1 [phi:w25q16_verify::@24->printf_ulong#0] -- vbum1=vbuc1 + lda #1 + sta printf_ulong.format_zero_padding + // [1588] phi printf_ulong::format_min_length#14 = 5 [phi:w25q16_verify::@24->printf_ulong#1] -- vbum1=vbuc1 + lda #5 + sta printf_ulong.format_min_length + // [1588] phi printf_ulong::format_radix#14 = HEXADECIMAL [phi:w25q16_verify::@24->printf_ulong#2] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1588] phi printf_ulong::uvalue#14 = printf_ulong::uvalue#8 [phi:w25q16_verify::@24->printf_ulong#3] -- register_copy + jsr printf_ulong + // [2446] phi from w25q16_verify::@24 to w25q16_verify::@25 [phi:w25q16_verify::@24->w25q16_verify::@25] + // w25q16_verify::@25 + // sprintf(info_text, "%05x different RAM:%02x:%04p <-> VERA:%05x", w25q16_different_bytes, bram_bank, bram_ptr, w25q16_address) + // [2447] call printf_str + // [1125] phi from w25q16_verify::@25 to printf_str [phi:w25q16_verify::@25->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:w25q16_verify::@25->printf_str#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_str.putc+1 + // [1125] phi printf_str::s#79 = w25q16_verify::s [phi:w25q16_verify::@25->printf_str#1] -- pbuz1=pbuc1 + lda #s + sta.z printf_str.s+1 + jsr printf_str + // w25q16_verify::@26 + // sprintf(info_text, "%05x different RAM:%02x:%04p <-> VERA:%05x", w25q16_different_bytes, bram_bank, bram_ptr, w25q16_address) + // [2448] printf_uchar::uvalue#12 = w25q16_verify::bram_bank#13 -- vbuxx=vbum1 + ldx bram_bank + // [2449] call printf_uchar + // [1189] phi from w25q16_verify::@26 to printf_uchar [phi:w25q16_verify::@26->printf_uchar] + // [1189] phi printf_uchar::format_zero_padding#15 = 1 [phi:w25q16_verify::@26->printf_uchar#0] -- vbum1=vbuc1 + lda #1 + sta printf_uchar.format_zero_padding + // [1189] phi printf_uchar::format_min_length#15 = 2 [phi:w25q16_verify::@26->printf_uchar#1] -- vbum1=vbuc1 + lda #2 + sta printf_uchar.format_min_length + // [1189] phi printf_uchar::putc#15 = &snputc [phi:w25q16_verify::@26->printf_uchar#2] -- pprz1=pprc1 + lda #snputc + sta.z printf_uchar.putc+1 + // [1189] phi printf_uchar::format_radix#15 = HEXADECIMAL [phi:w25q16_verify::@26->printf_uchar#3] -- vbuyy=vbuc1 + ldy #HEXADECIMAL + // [1189] phi printf_uchar::uvalue#15 = printf_uchar::uvalue#12 [phi:w25q16_verify::@26->printf_uchar#4] -- register_copy + jsr printf_uchar + // [2450] phi from w25q16_verify::@26 to w25q16_verify::@27 [phi:w25q16_verify::@26->w25q16_verify::@27] + // w25q16_verify::@27 + // sprintf(info_text, "%05x different RAM:%02x:%04p <-> VERA:%05x", w25q16_different_bytes, bram_bank, bram_ptr, w25q16_address) + // [2451] call printf_str + // [1125] phi from w25q16_verify::@27 to printf_str [phi:w25q16_verify::@27->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:w25q16_verify::@27->printf_str#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_str.putc+1 + // [1125] phi printf_str::s#79 = s2 [phi:w25q16_verify::@27->printf_str#1] -- pbuz1=pbuc1 + lda #<@s2 + sta.z printf_str.s + lda #>@s2 + sta.z printf_str.s+1 + jsr printf_str + // w25q16_verify::@28 + // sprintf(info_text, "%05x different RAM:%02x:%04p <-> VERA:%05x", w25q16_different_bytes, bram_bank, bram_ptr, w25q16_address) + // [2452] printf_uint::uvalue#6 = (unsigned int)w25q16_verify::bram_ptr#13 -- vwum1=vwum2 + lda bram_ptr + sta printf_uint.uvalue + lda bram_ptr+1 + sta printf_uint.uvalue+1 + // [2453] call printf_uint + // [2015] phi from w25q16_verify::@28 to printf_uint [phi:w25q16_verify::@28->printf_uint] + // [2015] phi printf_uint::format_zero_padding#10 = 1 [phi:w25q16_verify::@28->printf_uint#0] -- vbum1=vbuc1 + lda #1 + sta printf_uint.format_zero_padding + // [2015] phi printf_uint::format_min_length#10 = 4 [phi:w25q16_verify::@28->printf_uint#1] -- vbum1=vbuc1 + lda #4 + sta printf_uint.format_min_length + // [2015] phi printf_uint::putc#10 = &snputc [phi:w25q16_verify::@28->printf_uint#2] -- pprz1=pprc1 + lda #snputc + sta.z printf_uint.putc+1 + // [2015] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:w25q16_verify::@28->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [2015] phi printf_uint::uvalue#10 = printf_uint::uvalue#6 [phi:w25q16_verify::@28->printf_uint#4] -- register_copy + jsr printf_uint + // [2454] phi from w25q16_verify::@28 to w25q16_verify::@29 [phi:w25q16_verify::@28->w25q16_verify::@29] + // w25q16_verify::@29 + // sprintf(info_text, "%05x different RAM:%02x:%04p <-> VERA:%05x", w25q16_different_bytes, bram_bank, bram_ptr, w25q16_address) + // [2455] call printf_str + // [1125] phi from w25q16_verify::@29 to printf_str [phi:w25q16_verify::@29->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:w25q16_verify::@29->printf_str#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_str.putc+1 + // [1125] phi printf_str::s#79 = w25q16_verify::s2 [phi:w25q16_verify::@29->printf_str#1] -- pbuz1=pbuc1 + lda #s2 + sta.z printf_str.s+1 + jsr printf_str + // w25q16_verify::@30 + // sprintf(info_text, "%05x different RAM:%02x:%04p <-> VERA:%05x", w25q16_different_bytes, bram_bank, bram_ptr, w25q16_address) + // [2456] printf_ulong::uvalue#9 = w25q16_verify::w25q16_address#1 -- vdum1=vduz2 + lda.z w25q16_address + sta printf_ulong.uvalue + lda.z w25q16_address+1 + sta printf_ulong.uvalue+1 + lda.z w25q16_address+2 + sta printf_ulong.uvalue+2 + lda.z w25q16_address+3 + sta printf_ulong.uvalue+3 + // [2457] call printf_ulong + // [1588] phi from w25q16_verify::@30 to printf_ulong [phi:w25q16_verify::@30->printf_ulong] + // [1588] phi printf_ulong::format_zero_padding#14 = 1 [phi:w25q16_verify::@30->printf_ulong#0] -- vbum1=vbuc1 + lda #1 + sta printf_ulong.format_zero_padding + // [1588] phi printf_ulong::format_min_length#14 = 5 [phi:w25q16_verify::@30->printf_ulong#1] -- vbum1=vbuc1 + lda #5 + sta printf_ulong.format_min_length + // [1588] phi printf_ulong::format_radix#14 = HEXADECIMAL [phi:w25q16_verify::@30->printf_ulong#2] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1588] phi printf_ulong::uvalue#14 = printf_ulong::uvalue#9 [phi:w25q16_verify::@30->printf_ulong#3] -- register_copy + jsr printf_ulong + // w25q16_verify::@31 + // sprintf(info_text, "%05x different RAM:%02x:%04p <-> VERA:%05x", w25q16_different_bytes, bram_bank, bram_ptr, w25q16_address) + // [2458] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + lda #0 + pha + // [2459] callexecute snputc -- call_vprc1 + jsr snputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // display_action_text(info_text) + // [2461] call display_action_text + // [1200] phi from w25q16_verify::@31 to display_action_text [phi:w25q16_verify::@31->display_action_text] + // [1200] phi display_action_text::info_text#25 = info_text [phi:w25q16_verify::@31->display_action_text#0] -- pbuz1=pbuc1 + lda #<@info_text + sta.z display_action_text.info_text + lda #>@info_text + sta.z display_action_text.info_text+1 + jsr display_action_text + // [2402] phi from w25q16_verify::@31 to w25q16_verify::@4 [phi:w25q16_verify::@31->w25q16_verify::@4] + // [2402] phi w25q16_verify::y#15 = w25q16_verify::y#21 [phi:w25q16_verify::@31->w25q16_verify::@4#0] -- register_copy + // [2402] phi w25q16_verify::progress_row_current#12 = w25q16_verify::progress_row_current#18 [phi:w25q16_verify::@31->w25q16_verify::@4#1] -- register_copy + // [2402] phi w25q16_verify::bram_ptr#14 = w25q16_verify::bram_ptr#13 [phi:w25q16_verify::@31->w25q16_verify::@4#2] -- register_copy + // [2402] phi w25q16_verify::w25q16_different_bytes#2 = w25q16_verify::w25q16_different_bytes#1 [phi:w25q16_verify::@31->w25q16_verify::@4#3] -- register_copy + // [2402] phi w25q16_verify::bank_set_bram2_bank#0 = w25q16_verify::bram_bank#13 [phi:w25q16_verify::@31->w25q16_verify::@4#4] -- vbum1=vbum2 + lda bram_bank + sta bank_set_bram2_bank + // [2402] phi w25q16_verify::w25q16_address#2 = w25q16_verify::w25q16_address#1 [phi:w25q16_verify::@31->w25q16_verify::@4#5] -- register_copy + jmp __b4 + // w25q16_verify::@14 + __b14: + // cputc(different_char) + // [2462] stackpush(char) = w25q16_verify::different_char#16 -- _stackpushbyte_=vbuz1 + lda.z different_char + pha + // [2463] callexecute cputc -- call_vprc1 + jsr cputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + jmp __b15 + // w25q16_verify::@32 + __b32: + // [2465] w25q16_verify::w25q16_compared_bytes#9 = w25q16_verify::w25q16_compared_bytes#1 -- vbum1=vbuaa + sta w25q16_compared_bytes + // [2413] phi from w25q16_verify::@32 to w25q16_verify::@8 [phi:w25q16_verify::@32->w25q16_verify::@8] + // [2413] phi w25q16_verify::w25q16_equal_bytes#10 = w25q16_verify::w25q16_equal_bytes#11 [phi:w25q16_verify::@32->w25q16_verify::@8#0] -- register_copy + // [2413] phi w25q16_verify::w25q16_compared_bytes#2 = w25q16_verify::w25q16_compared_bytes#9 [phi:w25q16_verify::@32->w25q16_verify::@8#1] -- register_copy + // [2413] phi w25q16_verify::bram_ptr#10 = w25q16_verify::bram_ptr#1 [phi:w25q16_verify::@32->w25q16_verify::@8#2] -- register_copy + jmp __b8 + // [2466] phi from w25q16_verify::@21 to w25q16_verify::@1 [phi:w25q16_verify::@21->w25q16_verify::@1] + // w25q16_verify::@1 + __b1: + // display_action_progress("Verifying VERA after VERA.BIN update ... (=) same, (!) error.") + // [2467] call display_action_progress + // [1155] phi from w25q16_verify::@1 to display_action_progress [phi:w25q16_verify::@1->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = w25q16_verify::info_text [phi:w25q16_verify::@1->display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text + sta.z display_action_progress.info_text+1 + jsr display_action_progress + // [2398] phi from w25q16_verify::@1 to w25q16_verify::@2 [phi:w25q16_verify::@1->w25q16_verify::@2] + // [2398] phi w25q16_verify::different_char#16 = '!' [phi:w25q16_verify::@1->w25q16_verify::@2#0] -- vbuz1=vbuc1 + lda #'!' + sta.z different_char + jmp __b2 + .segment Data + info_text: .text "Verifying VERA after VERA.BIN update ... (=) same, (!) error." + .byte 0 + info_text1: .text "Comparing VERA with VERA.BIN ... (.) data, (=) same, (*) different." + .byte 0 + s: .text " different RAM:" + .byte 0 + s2: .text " <-> VERA:" + .byte 0 + w25q16_verify__7: .dword 0 + .label bank_set_bram2_bank = printf_uchar.format_min_length + /// Holds the amount of bytes actually verified between the VERA and the RAM. + w25q16_compare_size: .byte 0 + w25q16_byte: .byte 0 + .label bram_ptr = rom_read_byte.rom_ptr1_rom_read_byte__2 + // WARNING: if VERA_PROGRESS_CELL every needs to be a value larger than 128 then the char scalar widtg needs to be extended to an int. + w25q16_equal_bytes: .byte 0 + y: .byte 0 + bram_bank: .byte 0 + .label w25q16_different_bytes = rom_flash.rom_flash__28 + .label return = rom_flash.rom_flash__28 + /// Holds the amount of correct and verified bytes flashed in the VERA. + w25q16_compared_bytes: .byte 0 + .label progress_row_current = rom_read_byte.rom_bank1_rom_read_byte__2 +} +.segment CodeVera + // w25q16_erase +w25q16_erase: { + // BYTE2(vera_file_size) + // [2468] w25q16_erase::$0 = byte2 vera_file_size#1 -- vbuaa=_byte2_vdum1 + lda vera_file_size+2 + // unsigned char vera_total_64k_blocks = BYTE2(vera_file_size)+1 + // [2469] w25q16_erase::vera_total_64k_blocks#0 = w25q16_erase::$0 + 1 -- vbum1=vbuaa_plus_1 + inc + sta vera_total_64k_blocks + // [2470] phi from w25q16_erase to w25q16_erase::@1 [phi:w25q16_erase->w25q16_erase::@1] + // [2470] phi w25q16_erase::vera_address#2 = 0 [phi:w25q16_erase->w25q16_erase::@1#0] -- vdum1=vduc1 + lda #<0 + sta vera_address + sta vera_address+1 + lda #<0>>$10 + sta vera_address+2 + lda #>0>>$10 + sta vera_address+3 + // [2470] phi w25q16_erase::vera_current_64k_block#2 = 0 [phi:w25q16_erase->w25q16_erase::@1#1] -- vbum1=vbuc1 + lda #0 + sta vera_current_64k_block + // w25q16_erase::@1 + __b1: + // while(vera_current_64k_block < vera_total_64k_blocks) + // [2471] if(w25q16_erase::vera_current_64k_block#2w25q16_erase::@return] + // [2472] phi w25q16_erase::return#2 = 0 [phi:w25q16_erase::@1->w25q16_erase::@return#0] -- vbuaa=vbuc1 + lda #0 + // w25q16_erase::@return + // } + // [2473] return + rts + // [2474] phi from w25q16_erase::@1 to w25q16_erase::@2 [phi:w25q16_erase::@1->w25q16_erase::@2] + // w25q16_erase::@2 + __b2: + // spi_wait_non_busy() + // [2475] call spi_wait_non_busy + // [3265] phi from w25q16_erase::@2 to spi_wait_non_busy [phi:w25q16_erase::@2->spi_wait_non_busy] + jsr spi_wait_non_busy + // spi_wait_non_busy() + // [2476] spi_wait_non_busy::return#4 = spi_wait_non_busy::return#3 + // w25q16_erase::@4 + // [2477] w25q16_erase::$3 = spi_wait_non_busy::return#4 + // if(!spi_wait_non_busy()) + // [2478] if(0==w25q16_erase::$3) goto w25q16_erase::@3 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b3 + // [2472] phi from w25q16_erase::@4 to w25q16_erase::@return [phi:w25q16_erase::@4->w25q16_erase::@return] + // [2472] phi w25q16_erase::return#2 = 1 [phi:w25q16_erase::@4->w25q16_erase::@return#0] -- vbuaa=vbuc1 + lda #1 + rts + // w25q16_erase::@3 + __b3: + // spi_block_erase(vera_address) + // [2479] spi_block_erase::data#0 = w25q16_erase::vera_address#2 -- vduz1=vdum2 + lda vera_address + sta.z spi_block_erase.data + lda vera_address+1 + sta.z spi_block_erase.data+1 + lda vera_address+2 + sta.z spi_block_erase.data+2 + lda vera_address+3 + sta.z spi_block_erase.data+3 + // [2480] call spi_block_erase + // [3282] phi from w25q16_erase::@3 to spi_block_erase [phi:w25q16_erase::@3->spi_block_erase] + jsr spi_block_erase + // w25q16_erase::@5 + // vera_address += 0x10000 + // [2481] w25q16_erase::vera_address#1 = w25q16_erase::vera_address#2 + $10000 -- vdum1=vdum1_plus_vduc1 + clc + lda vera_address + adc #<$10000 + sta vera_address + lda vera_address+1 + adc #>$10000 + sta vera_address+1 + lda vera_address+2 + adc #<$10000>>$10 + sta vera_address+2 + lda vera_address+3 + adc #>$10000>>$10 + sta vera_address+3 + // vera_current_64k_block++; + // [2482] w25q16_erase::vera_current_64k_block#1 = ++ w25q16_erase::vera_current_64k_block#2 -- vbum1=_inc_vbum1 + inc vera_current_64k_block + // [2470] phi from w25q16_erase::@5 to w25q16_erase::@1 [phi:w25q16_erase::@5->w25q16_erase::@1] + // [2470] phi w25q16_erase::vera_address#2 = w25q16_erase::vera_address#1 [phi:w25q16_erase::@5->w25q16_erase::@1#0] -- register_copy + // [2470] phi w25q16_erase::vera_current_64k_block#2 = w25q16_erase::vera_current_64k_block#1 [phi:w25q16_erase::@5->w25q16_erase::@1#1] -- register_copy + jmp __b1 + .segment Data + vera_total_64k_blocks: .byte 0 + .label vera_address = main.rom_differences + vera_current_64k_block: .byte 0 +} +.segment Code + // display_info_roms +/** + * @brief Display all the ROM statuses. + * + * @param info_status The status. + * @param info_text The status text. + */ +// void display_info_roms(char info_status, char *info_text) +display_info_roms: { + // [2484] phi from display_info_roms to display_info_roms::@1 [phi:display_info_roms->display_info_roms::@1] + // [2484] phi display_info_roms::rom_chip#2 = 0 [phi:display_info_roms->display_info_roms::@1#0] -- vbum1=vbuc1 + lda #0 + sta rom_chip + // display_info_roms::@1 + __b1: + // for(unsigned char rom_chip=0; rom_chip<8; rom_chip++) + // [2485] if(display_info_roms::rom_chip#2<8) goto display_info_roms::@2 -- vbum1_lt_vbuc1_then_la1 + lda rom_chip + cmp #8 + bcc __b2 + // display_info_roms::@return + // } + // [2486] return + rts + // display_info_roms::@2 + __b2: + // display_info_rom(rom_chip, info_status, info_text) + // [2487] display_info_rom::rom_chip#4 = display_info_roms::rom_chip#2 -- vbum1=vbum2 + lda rom_chip + sta display_info_rom.rom_chip + // [2488] call display_info_rom + // [1368] phi from display_info_roms::@2 to display_info_rom [phi:display_info_roms::@2->display_info_rom] + // [1368] phi display_info_rom::info_text#16 = 0 [phi:display_info_roms::@2->display_info_rom#0] -- pbuz1=vbuc1 + lda #<0 + sta.z display_info_rom.info_text + sta.z display_info_rom.info_text+1 + // [1368] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#4 [phi:display_info_roms::@2->display_info_rom#1] -- register_copy + // [1368] phi display_info_rom::info_status#16 = STATUS_ERROR [phi:display_info_roms::@2->display_info_rom#2] -- vbum1=vbuc1 + lda #STATUS_ERROR + sta display_info_rom.info_status + jsr display_info_rom + // display_info_roms::@3 + // for(unsigned char rom_chip=0; rom_chip<8; rom_chip++) + // [2489] display_info_roms::rom_chip#1 = ++ display_info_roms::rom_chip#2 -- vbum1=_inc_vbum1 + inc rom_chip + // [2484] phi from display_info_roms::@3 to display_info_roms::@1 [phi:display_info_roms::@3->display_info_roms::@1] + // [2484] phi display_info_roms::rom_chip#2 = display_info_roms::rom_chip#1 [phi:display_info_roms::@3->display_info_roms::@1#0] -- register_copy + jmp __b1 + .segment Data + rom_chip: .byte 0 +} +.segment CodeVera + // spi_deselect +spi_deselect: { + // *vera_reg_SPICtrl &= 0xfe + // [2490] *vera_reg_SPICtrl = *vera_reg_SPICtrl & $fe -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + /* +.proc spi_deselect + lda Vera::Reg::SPICtrl + and #$fe + sta Vera::Reg::SPICtrl + jsr spi_read + rts +.endproc +*/ + lda #$fe + and vera_reg_SPICtrl + sta vera_reg_SPICtrl + // unsigned char value = spi_read() + // [2491] call spi_read + jsr spi_read + // spi_deselect::@return + // } + // [2492] return + rts +} + // w25q16_flash +w25q16_flash: { + // TODO: ERROR!!! + .label return = $3c + .label i = $d8 + .label vera_bram_ptr = $de + .label vera_address = $5f + .label vera_address_page = $3c + .label vera_flashed_bytes = $d4 + .label w25q16_flash__28 = $e4 + // display_action_progress(TEXT_PROGRESS_FLASHING) + // [2494] call display_action_progress + // [1155] phi from w25q16_flash to display_action_progress [phi:w25q16_flash->display_action_progress] + // [1155] phi display_action_progress::info_text#30 = TEXT_PROGRESS_FLASHING [phi:w25q16_flash->display_action_progress#0] -- pbuz1=pbuc1 + lda #TEXT_PROGRESS_FLASHING + sta.z display_action_progress.info_text+1 + jsr display_action_progress + // [2495] phi from w25q16_flash to w25q16_flash::@1 [phi:w25q16_flash->w25q16_flash::@1] + // [2495] phi w25q16_flash::vera_flashed_bytes#17 = 0 [phi:w25q16_flash->w25q16_flash::@1#0] -- vduz1=vduc1 + lda #<0 + sta.z vera_flashed_bytes + sta.z vera_flashed_bytes+1 + lda #<0>>$10 + sta.z vera_flashed_bytes+2 + lda #>0>>$10 + sta.z vera_flashed_bytes+3 + // [2495] phi w25q16_flash::vera_bram_ptr#12 = (char *)$a000 [phi:w25q16_flash->w25q16_flash::@1#1] -- pbuz1=pbuc1 + lda #<$a000 + sta.z vera_bram_ptr + lda #>$a000 + sta.z vera_bram_ptr+1 + // [2495] phi w25q16_flash::vera_bram_bank#10 = 1 [phi:w25q16_flash->w25q16_flash::@1#2] -- vbum1=vbuc1 + lda #1 + sta vera_bram_bank + // [2495] phi w25q16_flash::y_sector#15 = PROGRESS_Y [phi:w25q16_flash->w25q16_flash::@1#3] -- vbum1=vbuc1 + lda #PROGRESS_Y + sta y_sector + // [2495] phi w25q16_flash::x_sector#14 = PROGRESS_X [phi:w25q16_flash->w25q16_flash::@1#4] -- vbum1=vbuc1 + lda #PROGRESS_X + sta x_sector + // [2495] phi w25q16_flash::vera_address_page#11 = 0 [phi:w25q16_flash->w25q16_flash::@1#5] -- vduz1=vduc1 + lda #<0 + sta.z vera_address_page + sta.z vera_address_page+1 + lda #<0>>$10 + sta.z vera_address_page+2 + lda #>0>>$10 + sta.z vera_address_page+3 + // w25q16_flash::@1 + __b1: + // while (vera_address_page < vera_file_size) + // [2496] if(w25q16_flash::vera_address_page#11display_action_text_flashed] + // [2824] phi display_action_text_flashed::chip#3 = w25q16_flash::chip [phi:w25q16_flash::@3->display_action_text_flashed#0] -- pbuz1=pbuc1 + lda #chip + sta.z display_action_text_flashed.chip+1 + // [2824] phi display_action_text_flashed::bytes#3 = display_action_text_flashed::bytes#2 [phi:w25q16_flash::@3->display_action_text_flashed#1] -- register_copy + jsr display_action_text_flashed + // [2499] phi from w25q16_flash::@3 to w25q16_flash::@18 [phi:w25q16_flash::@3->w25q16_flash::@18] + // w25q16_flash::@18 + // wait_moment(16) + // [2500] call wait_moment + // [1134] phi from w25q16_flash::@18 to wait_moment [phi:w25q16_flash::@18->wait_moment] + // [1134] phi wait_moment::w#17 = $10 [phi:w25q16_flash::@18->wait_moment#0] -- vbuz1=vbuc1 + lda #$10 + sta.z wait_moment.w + jsr wait_moment + // [2501] phi from w25q16_flash::@18 to w25q16_flash::@return [phi:w25q16_flash::@18->w25q16_flash::@return] + // [2501] phi w25q16_flash::return#2 = w25q16_flash::vera_address_page#11 [phi:w25q16_flash::@18->w25q16_flash::@return#0] -- register_copy + // w25q16_flash::@return + // } + // [2502] return + rts + // w25q16_flash::@2 + __b2: + // unsigned long vera_page_boundary = vera_address_page + VERA_PROGRESS_PAGE + // [2503] w25q16_flash::vera_page_boundary#0 = w25q16_flash::vera_address_page#11 + VERA_PROGRESS_PAGE -- vdum1=vduz2_plus_vwuc1 + // {asm{.byte $db}} + clc + lda.z vera_address_page + adc #VERA_PROGRESS_PAGE + sta vera_page_boundary+1 + lda.z vera_address_page+2 + adc #0 + sta vera_page_boundary+2 + lda.z vera_address_page+3 + adc #0 + sta vera_page_boundary+3 + // cputcxy(x,y,'.') + // [2504] cputcxy::x#15 = w25q16_flash::x_sector#14 -- vbuyy=vbum1 + ldy x_sector + // [2505] cputcxy::y#15 = w25q16_flash::y_sector#15 -- vbuaa=vbum1 + lda y_sector + // [2506] call cputcxy + // [2273] phi from w25q16_flash::@2 to cputcxy [phi:w25q16_flash::@2->cputcxy] + // [2273] phi cputcxy::c#17 = '.' [phi:w25q16_flash::@2->cputcxy#0] -- vbuxx=vbuc1 + ldx #'.' + // [2273] phi cputcxy::y#17 = cputcxy::y#15 [phi:w25q16_flash::@2->cputcxy#1] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#15 [phi:w25q16_flash::@2->cputcxy#2] -- register_copy + jsr cputcxy + // w25q16_flash::@16 + // cputc('.') + // [2507] stackpush(char) = '.' -- _stackpushbyte_=vbuc1 + lda #'.' pha - // [2152] callexecute cputc -- call_vprc1 + // [2508] callexecute cputc -- call_vprc1 jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla - // cputcxy::@return - // } - // [2154] return + // spi_wait_non_busy() + // [2510] call spi_wait_non_busy + // [3265] phi from w25q16_flash::@16 to spi_wait_non_busy [phi:w25q16_flash::@16->spi_wait_non_busy] + jsr spi_wait_non_busy + // spi_wait_non_busy() + // [2511] spi_wait_non_busy::return#5 = spi_wait_non_busy::return#3 + // w25q16_flash::@17 + // [2512] w25q16_flash::$7 = spi_wait_non_busy::return#5 + // if(!spi_wait_non_busy()) + // [2513] if(0==w25q16_flash::$7) goto w25q16_flash::bank_set_bram1 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq bank_set_bram1 + // [2501] phi from w25q16_flash::@17 to w25q16_flash::@return [phi:w25q16_flash::@17->w25q16_flash::@return] + // [2501] phi w25q16_flash::return#2 = 0 [phi:w25q16_flash::@17->w25q16_flash::@return#0] -- vduz1=vbuc1 + lda #0 + sta.z return + sta.z return+1 + sta.z return+2 + sta.z return+3 rts + // w25q16_flash::bank_set_bram1 + bank_set_bram1: + // BRAM = bank + // [2514] BRAM = w25q16_flash::vera_bram_bank#10 -- vbuz1=vbum2 + lda vera_bram_bank + sta.z BRAM + // w25q16_flash::@15 + // spi_write_page_begin(vera_address_page) + // [2515] spi_write_page_begin::data#0 = w25q16_flash::vera_address_page#11 -- vduz1=vduz2 + lda.z vera_address_page + sta.z spi_write_page_begin.data + lda.z vera_address_page+1 + sta.z spi_write_page_begin.data+1 + lda.z vera_address_page+2 + sta.z spi_write_page_begin.data+2 + lda.z vera_address_page+3 + sta.z spi_write_page_begin.data+3 + // [2516] call spi_write_page_begin + // [3302] phi from w25q16_flash::@15 to spi_write_page_begin [phi:w25q16_flash::@15->spi_write_page_begin] + jsr spi_write_page_begin + // w25q16_flash::@19 + // [2517] w25q16_flash::vera_address#16 = w25q16_flash::vera_address_page#11 -- vduz1=vduz2 + lda.z vera_address_page + sta.z vera_address + lda.z vera_address_page+1 + sta.z vera_address+1 + lda.z vera_address_page+2 + sta.z vera_address+2 + lda.z vera_address_page+3 + sta.z vera_address+3 + // [2518] phi from w25q16_flash::@19 w25q16_flash::@21 to w25q16_flash::@5 [phi:w25q16_flash::@19/w25q16_flash::@21->w25q16_flash::@5] + // [2518] phi w25q16_flash::vera_flashed_bytes#10 = w25q16_flash::vera_flashed_bytes#17 [phi:w25q16_flash::@19/w25q16_flash::@21->w25q16_flash::@5#0] -- register_copy + // [2518] phi w25q16_flash::vera_address_page#10 = w25q16_flash::vera_address_page#11 [phi:w25q16_flash::@19/w25q16_flash::@21->w25q16_flash::@5#1] -- register_copy + // [2518] phi w25q16_flash::vera_bram_ptr#13 = w25q16_flash::vera_bram_ptr#12 [phi:w25q16_flash::@19/w25q16_flash::@21->w25q16_flash::@5#2] -- register_copy + // [2518] phi w25q16_flash::vera_address#10 = w25q16_flash::vera_address#16 [phi:w25q16_flash::@19/w25q16_flash::@21->w25q16_flash::@5#3] -- register_copy + // w25q16_flash::@5 + __b5: + // while (vera_address < vera_page_boundary) + // [2519] if(w25q16_flash::vera_address#10$c000 + bne __b10 + lda.z vera_bram_ptr + cmp #<$c000 + bne __b10 + // w25q16_flash::@13 + // vera_bram_bank++; + // [2521] w25q16_flash::vera_bram_bank#1 = ++ w25q16_flash::vera_bram_bank#10 -- vbum1=_inc_vbum1 + inc vera_bram_bank + // [2522] phi from w25q16_flash::@13 to w25q16_flash::@10 [phi:w25q16_flash::@13->w25q16_flash::@10] + // [2522] phi w25q16_flash::vera_bram_bank#27 = w25q16_flash::vera_bram_bank#1 [phi:w25q16_flash::@13->w25q16_flash::@10#0] -- register_copy + // [2522] phi w25q16_flash::vera_bram_ptr#8 = (char *)$a000 [phi:w25q16_flash::@13->w25q16_flash::@10#1] -- pbuz1=pbuc1 + lda #<$a000 + sta.z vera_bram_ptr + lda #>$a000 + sta.z vera_bram_ptr+1 + // [2522] phi from w25q16_flash::@4 to w25q16_flash::@10 [phi:w25q16_flash::@4->w25q16_flash::@10] + // [2522] phi w25q16_flash::vera_bram_bank#27 = w25q16_flash::vera_bram_bank#10 [phi:w25q16_flash::@4->w25q16_flash::@10#0] -- register_copy + // [2522] phi w25q16_flash::vera_bram_ptr#8 = w25q16_flash::vera_bram_ptr#13 [phi:w25q16_flash::@4->w25q16_flash::@10#1] -- register_copy + // w25q16_flash::@10 + __b10: + // if (vera_bram_ptr == RAM_HIGH) + // [2523] if(w25q16_flash::vera_bram_ptr#8!=$9800) goto w25q16_flash::@23 -- pbuz1_neq_vwuc1_then_la1 + lda.z vera_bram_ptr+1 + cmp #>$9800 + bne __b11 + lda.z vera_bram_ptr + cmp #<$9800 + bne __b11 + // [2525] phi from w25q16_flash::@10 to w25q16_flash::@11 [phi:w25q16_flash::@10->w25q16_flash::@11] + // [2525] phi w25q16_flash::vera_bram_ptr#23 = (char *)$a000 [phi:w25q16_flash::@10->w25q16_flash::@11#0] -- pbuz1=pbuc1 + lda #<$a000 + sta.z vera_bram_ptr + lda #>$a000 + sta.z vera_bram_ptr+1 + // [2525] phi w25q16_flash::vera_bram_bank#19 = 1 [phi:w25q16_flash::@10->w25q16_flash::@11#1] -- vbum1=vbuc1 + lda #1 + sta vera_bram_bank + // [2524] phi from w25q16_flash::@10 to w25q16_flash::@23 [phi:w25q16_flash::@10->w25q16_flash::@23] + // w25q16_flash::@23 + // [2525] phi from w25q16_flash::@23 to w25q16_flash::@11 [phi:w25q16_flash::@23->w25q16_flash::@11] + // [2525] phi w25q16_flash::vera_bram_ptr#23 = w25q16_flash::vera_bram_ptr#8 [phi:w25q16_flash::@23->w25q16_flash::@11#0] -- register_copy + // [2525] phi w25q16_flash::vera_bram_bank#19 = w25q16_flash::vera_bram_bank#27 [phi:w25q16_flash::@23->w25q16_flash::@11#1] -- register_copy + // w25q16_flash::@11 + __b11: + // x_sector += 2 + // [2526] w25q16_flash::x_sector#1 = w25q16_flash::x_sector#14 + 2 -- vbum1=vbum1_plus_2 + lda x_sector + clc + adc #2 + sta x_sector + // vera_address_page % VERA_PROGRESS_ROW + // [2527] w25q16_flash::$21 = w25q16_flash::vera_address_page#10 & VERA_PROGRESS_ROW-1 -- vdum1=vduz2_band_vduc1 + lda.z vera_address_page + and #VERA_PROGRESS_ROW-1 + sta w25q16_flash__21+1 + lda.z vera_address_page+2 + and #>$10 + sta w25q16_flash__21+2 + lda.z vera_address_page+3 + and #>VERA_PROGRESS_ROW-1>>$10 + sta w25q16_flash__21+3 + // if (!(vera_address_page % VERA_PROGRESS_ROW)) + // [2528] if(0!=w25q16_flash::$21) goto w25q16_flash::@12 -- 0_neq_vdum1_then_la1 + lda w25q16_flash__21 + ora w25q16_flash__21+1 + ora w25q16_flash__21+2 + ora w25q16_flash__21+3 + bne __b12 + // w25q16_flash::@14 + // y_sector++; + // [2529] w25q16_flash::y_sector#1 = ++ w25q16_flash::y_sector#15 -- vbum1=_inc_vbum1 + inc y_sector + // [2530] phi from w25q16_flash::@14 to w25q16_flash::@12 [phi:w25q16_flash::@14->w25q16_flash::@12] + // [2530] phi w25q16_flash::y_sector#12 = w25q16_flash::y_sector#1 [phi:w25q16_flash::@14->w25q16_flash::@12#0] -- register_copy + // [2530] phi w25q16_flash::x_sector#13 = PROGRESS_X [phi:w25q16_flash::@14->w25q16_flash::@12#1] -- vbum1=vbuc1 + lda #PROGRESS_X + sta x_sector + // [2530] phi from w25q16_flash::@11 to w25q16_flash::@12 [phi:w25q16_flash::@11->w25q16_flash::@12] + // [2530] phi w25q16_flash::y_sector#12 = w25q16_flash::y_sector#15 [phi:w25q16_flash::@11->w25q16_flash::@12#0] -- register_copy + // [2530] phi w25q16_flash::x_sector#13 = w25q16_flash::x_sector#1 [phi:w25q16_flash::@11->w25q16_flash::@12#1] -- register_copy + // w25q16_flash::@12 + __b12: + // get_info_text_flashing(vera_flashed_bytes) + // [2531] get_info_text_flashing::flash_bytes#2 = w25q16_flash::vera_flashed_bytes#10 -- vduz1=vduz2 + lda.z vera_flashed_bytes + sta.z get_info_text_flashing.flash_bytes + lda.z vera_flashed_bytes+1 + sta.z get_info_text_flashing.flash_bytes+1 + lda.z vera_flashed_bytes+2 + sta.z get_info_text_flashing.flash_bytes+2 + lda.z vera_flashed_bytes+3 + sta.z get_info_text_flashing.flash_bytes+3 + // [2532] call get_info_text_flashing + // [2841] phi from w25q16_flash::@12 to get_info_text_flashing [phi:w25q16_flash::@12->get_info_text_flashing] + // [2841] phi get_info_text_flashing::flash_bytes#3 = get_info_text_flashing::flash_bytes#2 [phi:w25q16_flash::@12->get_info_text_flashing#0] -- register_copy + jsr get_info_text_flashing + // [2533] phi from w25q16_flash::@12 to w25q16_flash::@22 [phi:w25q16_flash::@12->w25q16_flash::@22] + // w25q16_flash::@22 + // display_info_vera(STATUS_FLASHING, get_info_text_flashing(vera_flashed_bytes)) + // [2534] call display_info_vera + // [1930] phi from w25q16_flash::@22 to display_info_vera [phi:w25q16_flash::@22->display_info_vera] + // [1930] phi display_info_vera::info_text#15 = info_text [phi:w25q16_flash::@22->display_info_vera#0] -- pbuz1=pbuc1 + lda #info_text + sta.z display_info_vera.info_text+1 + // [1930] phi display_info_vera::info_status#15 = STATUS_FLASHING [phi:w25q16_flash::@22->display_info_vera#1] -- vbum1=vbuc1 + lda #STATUS_FLASHING + sta display_info_vera.info_status + jsr display_info_vera + // [2495] phi from w25q16_flash::@22 to w25q16_flash::@1 [phi:w25q16_flash::@22->w25q16_flash::@1] + // [2495] phi w25q16_flash::vera_flashed_bytes#17 = w25q16_flash::vera_flashed_bytes#10 [phi:w25q16_flash::@22->w25q16_flash::@1#0] -- register_copy + // [2495] phi w25q16_flash::vera_bram_ptr#12 = w25q16_flash::vera_bram_ptr#23 [phi:w25q16_flash::@22->w25q16_flash::@1#1] -- register_copy + // [2495] phi w25q16_flash::vera_bram_bank#10 = w25q16_flash::vera_bram_bank#19 [phi:w25q16_flash::@22->w25q16_flash::@1#2] -- register_copy + // [2495] phi w25q16_flash::y_sector#15 = w25q16_flash::y_sector#12 [phi:w25q16_flash::@22->w25q16_flash::@1#3] -- register_copy + // [2495] phi w25q16_flash::x_sector#14 = w25q16_flash::x_sector#13 [phi:w25q16_flash::@22->w25q16_flash::@1#4] -- register_copy + // [2495] phi w25q16_flash::vera_address_page#11 = w25q16_flash::vera_address_page#10 [phi:w25q16_flash::@22->w25q16_flash::@1#5] -- register_copy + jmp __b1 + // w25q16_flash::@6 + __b6: + // display_action_text_flashing(VERA_PROGRESS_PAGE, "VERA", vera_bram_bank, vera_bram_ptr, vera_address) + // [2535] display_action_text_flashing::bram_bank#2 = w25q16_flash::vera_bram_bank#10 -- vbuz1=vbum2 + lda vera_bram_bank + sta.z display_action_text_flashing.bram_bank + // [2536] display_action_text_flashing::bram_ptr#2 = w25q16_flash::vera_bram_ptr#13 -- pbuz1=pbuz2 + lda.z vera_bram_ptr + sta.z display_action_text_flashing.bram_ptr + lda.z vera_bram_ptr+1 + sta.z display_action_text_flashing.bram_ptr+1 + // [2537] display_action_text_flashing::address#2 = w25q16_flash::vera_address#10 -- vduz1=vduz2 + lda.z vera_address + sta.z display_action_text_flashing.address + lda.z vera_address+1 + sta.z display_action_text_flashing.address+1 + lda.z vera_address+2 + sta.z display_action_text_flashing.address+2 + lda.z vera_address+3 + sta.z display_action_text_flashing.address+3 + // [2538] call display_action_text_flashing + // [2863] phi from w25q16_flash::@6 to display_action_text_flashing [phi:w25q16_flash::@6->display_action_text_flashing] + // [2863] phi display_action_text_flashing::address#10 = display_action_text_flashing::address#2 [phi:w25q16_flash::@6->display_action_text_flashing#0] -- register_copy + // [2863] phi display_action_text_flashing::chip#10 = w25q16_flash::chip [phi:w25q16_flash::@6->display_action_text_flashing#1] -- pbuz1=pbuc1 + lda #chip + sta.z display_action_text_flashing.chip+1 + // [2863] phi display_action_text_flashing::bram_ptr#3 = display_action_text_flashing::bram_ptr#2 [phi:w25q16_flash::@6->display_action_text_flashing#2] -- register_copy + // [2863] phi display_action_text_flashing::bram_bank#3 = display_action_text_flashing::bram_bank#2 [phi:w25q16_flash::@6->display_action_text_flashing#3] -- register_copy + // [2863] phi display_action_text_flashing::bytes#3 = VERA_PROGRESS_PAGE [phi:w25q16_flash::@6->display_action_text_flashing#4] -- vduz1=vduc1 + lda #VERA_PROGRESS_PAGE + sta.z display_action_text_flashing.bytes+1 + lda #>$10 + sta.z display_action_text_flashing.bytes+2 + lda #>VERA_PROGRESS_PAGE>>$10 + sta.z display_action_text_flashing.bytes+3 + jsr display_action_text_flashing + // [2539] phi from w25q16_flash::@6 to w25q16_flash::@7 [phi:w25q16_flash::@6->w25q16_flash::@7] + // [2539] phi w25q16_flash::i#2 = 0 [phi:w25q16_flash::@6->w25q16_flash::@7#0] -- vwuz1=vwuc1 + lda #<0 + sta.z i + sta.z i+1 + // w25q16_flash::@7 + __b7: + // for(unsigned int i=0; i<=255; i++) + // [2540] if(w25q16_flash::i#2<=$ff) goto w25q16_flash::@8 -- vwuz1_le_vbuc1_then_la1 + lda #$ff + cmp.z i + bcc !+ + lda.z i+1 + beq __b8 + !: + // w25q16_flash::@9 + // cputcxy(x,y,'+') + // [2541] cputcxy::x#16 = w25q16_flash::x_sector#14 -- vbuyy=vbum1 + ldy x_sector + // [2542] cputcxy::y#16 = w25q16_flash::y_sector#15 -- vbuaa=vbum1 + lda y_sector + // [2543] call cputcxy + // [2273] phi from w25q16_flash::@9 to cputcxy [phi:w25q16_flash::@9->cputcxy] + // [2273] phi cputcxy::c#17 = '+' [phi:w25q16_flash::@9->cputcxy#0] -- vbuxx=vbuc1 + ldx #'+' + // [2273] phi cputcxy::y#17 = cputcxy::y#16 [phi:w25q16_flash::@9->cputcxy#1] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#16 [phi:w25q16_flash::@9->cputcxy#2] -- register_copy + jsr cputcxy + // w25q16_flash::@21 + // cputc('+') + // [2544] stackpush(char) = '+' -- _stackpushbyte_=vbuc1 + lda #'+' + pha + // [2545] callexecute cputc -- call_vprc1 + jsr cputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // vera_bram_ptr += VERA_PROGRESS_PAGE + // [2547] w25q16_flash::vera_bram_ptr#1 = w25q16_flash::vera_bram_ptr#13 + VERA_PROGRESS_PAGE -- pbuz1=pbuz1_plus_vwuc1 + lda.z vera_bram_ptr + clc + adc #VERA_PROGRESS_PAGE + sta.z vera_bram_ptr+1 + // vera_address += VERA_PROGRESS_PAGE + // [2548] w25q16_flash::vera_address#1 = w25q16_flash::vera_address#10 + VERA_PROGRESS_PAGE -- vduz1=vduz1_plus_vwuc1 + clc + lda.z vera_address + adc #VERA_PROGRESS_PAGE + sta.z vera_address+1 + lda.z vera_address+2 + adc #0 + sta.z vera_address+2 + lda.z vera_address+3 + adc #0 + sta.z vera_address+3 + // vera_address_page += VERA_PROGRESS_PAGE + // [2549] w25q16_flash::vera_address_page#1 = w25q16_flash::vera_address_page#10 + VERA_PROGRESS_PAGE -- vduz1=vduz1_plus_vwuc1 + clc + lda.z vera_address_page + adc #VERA_PROGRESS_PAGE + sta.z vera_address_page+1 + lda.z vera_address_page+2 + adc #0 + sta.z vera_address_page+2 + lda.z vera_address_page+3 + adc #0 + sta.z vera_address_page+3 + // vera_flashed_bytes += VERA_PROGRESS_PAGE + // [2550] w25q16_flash::vera_flashed_bytes#1 = w25q16_flash::vera_flashed_bytes#10 + VERA_PROGRESS_PAGE -- vduz1=vduz1_plus_vwuc1 + clc + lda.z vera_flashed_bytes + adc #VERA_PROGRESS_PAGE + sta.z vera_flashed_bytes+1 + lda.z vera_flashed_bytes+2 + adc #0 + sta.z vera_flashed_bytes+2 + lda.z vera_flashed_bytes+3 + adc #0 + sta.z vera_flashed_bytes+3 + jmp __b5 + // w25q16_flash::@8 + __b8: + // spi_write(vera_bram_ptr[i]) + // [2551] w25q16_flash::$28 = w25q16_flash::vera_bram_ptr#13 + w25q16_flash::i#2 -- pbuz1=pbuz2_plus_vwuz3 + lda.z vera_bram_ptr + clc + adc.z i + sta.z w25q16_flash__28 + lda.z vera_bram_ptr+1 + adc.z i+1 + sta.z w25q16_flash__28+1 + // [2552] spi_write::data = *w25q16_flash::$28 -- vbuz1=_deref_pbuz2 + ldy #0 + lda (w25q16_flash__28),y + sta.z spi_write.data + // [2553] call spi_write + jsr spi_write + // w25q16_flash::@20 + // for(unsigned int i=0; i<=255; i++) + // [2554] w25q16_flash::i#1 = ++ w25q16_flash::i#2 -- vwuz1=_inc_vwuz1 + inc.z i + bne !+ + inc.z i+1 + !: + // [2539] phi from w25q16_flash::@20 to w25q16_flash::@7 [phi:w25q16_flash::@20->w25q16_flash::@7] + // [2539] phi w25q16_flash::i#2 = w25q16_flash::i#1 [phi:w25q16_flash::@20->w25q16_flash::@7#0] -- register_copy + jmp __b7 .segment Data - x: .byte 0 - y: .byte 0 - c: .byte 0 + chip: .text "VERA" + .byte 0 + w25q16_flash__21: .dword 0 + vera_page_boundary: .dword 0 + vera_bram_bank: .byte 0 + x_sector: .byte 0 + y_sector: .byte 0 } .segment Code // strlen // Computes the length of the string str up to but not including the terminating null character. -// __mem() unsigned int strlen(__zp($31) char *str) +// __mem() unsigned int strlen(__zp($25) char *str) strlen: { - .label str = $31 - // [2156] phi from strlen to strlen::@1 [phi:strlen->strlen::@1] - // [2156] phi strlen::len#2 = 0 [phi:strlen->strlen::@1#0] -- vwum1=vwuc1 + .label str = $25 + // [2556] phi from strlen to strlen::@1 [phi:strlen->strlen::@1] + // [2556] phi strlen::len#2 = 0 [phi:strlen->strlen::@1#0] -- vwum1=vwuc1 lda #<0 sta len sta len+1 - // [2156] phi strlen::str#6 = strlen::str#8 [phi:strlen->strlen::@1#1] -- register_copy + // [2556] phi strlen::str#6 = strlen::str#8 [phi:strlen->strlen::@1#1] -- register_copy // strlen::@1 __b1: // while(*str) - // [2157] if(0!=*strlen::str#6) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1 + // [2557] if(0!=*strlen::str#6) goto strlen::@2 -- 0_neq__deref_pbuz1_then_la1 ldy #0 lda (str),y cmp #0 bne __b2 // strlen::@return // } - // [2158] return + // [2558] return rts // strlen::@2 __b2: // len++; - // [2159] strlen::len#1 = ++ strlen::len#2 -- vwum1=_inc_vwum1 + // [2559] strlen::len#1 = ++ strlen::len#2 -- vwum1=_inc_vwum1 inc len bne !+ inc len+1 !: // str++; - // [2160] strlen::str#1 = ++ strlen::str#6 -- pbuz1=_inc_pbuz1 + // [2560] strlen::str#1 = ++ strlen::str#6 -- pbuz1=_inc_pbuz1 inc.z str bne !+ inc.z str+1 !: - // [2156] phi from strlen::@2 to strlen::@1 [phi:strlen::@2->strlen::@1] - // [2156] phi strlen::len#2 = strlen::len#1 [phi:strlen::@2->strlen::@1#0] -- register_copy - // [2156] phi strlen::str#6 = strlen::str#1 [phi:strlen::@2->strlen::@1#1] -- register_copy + // [2556] phi from strlen::@2 to strlen::@1 [phi:strlen::@2->strlen::@1] + // [2556] phi strlen::len#2 = strlen::len#1 [phi:strlen::@2->strlen::@1#0] -- register_copy + // [2556] phi strlen::str#6 = strlen::str#1 [phi:strlen::@2->strlen::@1#1] -- register_copy jmp __b1 .segment Data - .label return = len - len: .word 0 + .label return = strncmp.n + .label len = strncmp.n } .segment Code // printf_padding // Print a padding char a number of times -// void printf_padding(__zp($47) void (*putc)(char), __mem() char pad, __mem() char length) +// void printf_padding(__zp($25) void (*putc)(char), __mem() char pad, __mem() char length) printf_padding: { - .label putc = $47 - // [2162] phi from printf_padding to printf_padding::@1 [phi:printf_padding->printf_padding::@1] - // [2162] phi printf_padding::i#2 = 0 [phi:printf_padding->printf_padding::@1#0] -- vbum1=vbuc1 + .label putc = $25 + // [2562] phi from printf_padding to printf_padding::@1 [phi:printf_padding->printf_padding::@1] + // [2562] phi printf_padding::i#2 = 0 [phi:printf_padding->printf_padding::@1#0] -- vbum1=vbuc1 lda #0 sta i // printf_padding::@1 __b1: // for(char i=0;iprintf_padding::@1] - // [2162] phi printf_padding::i#2 = printf_padding::i#1 [phi:printf_padding::@3->printf_padding::@1#0] -- register_copy + // [2562] phi from printf_padding::@3 to printf_padding::@1 [phi:printf_padding::@3->printf_padding::@1] + // [2562] phi printf_padding::i#2 = printf_padding::i#1 [phi:printf_padding::@3->printf_padding::@1#0] -- register_copy jmp __b1 // Outside Flow - icall32: + icall41: jmp (putc) .segment Data i: .byte 0 @@ -14777,18 +17035,17 @@ printf_padding: { * @return unsigned long The 22 bit ROM address. */ /* inline */ -// __mem() unsigned long rom_address_from_bank(__mem() char rom_bank) +// __mem() unsigned long rom_address_from_bank(__register(A) char rom_bank) rom_address_from_bank: { - .label return_1 = $62 + .label return_1 = $4a // ((unsigned long)(rom_bank)) << 14 - // [2170] rom_address_from_bank::$1 = (unsigned long)rom_address_from_bank::rom_bank#3 -- vdum1=_dword_vbum2 - lda rom_bank + // [2570] rom_address_from_bank::$1 = (unsigned long)rom_address_from_bank::rom_bank#3 -- vdum1=_dword_vbuaa sta rom_address_from_bank__1 lda #0 sta rom_address_from_bank__1+1 sta rom_address_from_bank__1+2 sta rom_address_from_bank__1+3 - // [2171] rom_address_from_bank::return#0 = rom_address_from_bank::$1 << $e -- vdum1=vdum1_rol_vbuc1 + // [2571] rom_address_from_bank::return#0 = rom_address_from_bank::$1 << $e -- vdum1=vdum1_rol_vbuc1 ldx #$e cpx #0 beq !e+ @@ -14802,12 +17059,11 @@ rom_address_from_bank: { !e: // rom_address_from_bank::@return // } - // [2172] return + // [2572] return rts .segment Data .label rom_address_from_bank__1 = rom_read_byte.address .label return = rom_read_byte.address - .label rom_bank = main.check_status_smc7_main__0 .label return_2 = main.rom_file_modulo } .segment Code @@ -14823,28 +17079,28 @@ rom_address_from_bank: { * - 0x0000: Something is wrong! Kernal Error Code (https://commodore.ca/manuals/pdfs/commodore_error_messages.pdf) * - other: OK! The last pointer between 0xA000 and 0xBFFF is returned. Note that the last pointer is indicating the first free byte. */ -// __zp($47) struct $2 * fopen(__zp($b0) const char *path, const char *mode) +// __zp($46) struct $2 * fopen(__zp($6b) const char *path, const char *mode) fopen: { - .label fopen__9 = $bc - .label fopen__11 = $3f - .label fopen__26 = $60 - .label fopen__28 = $aa - .label fopen__30 = $47 - .label stream = $47 - .label pathtoken = $b0 - .label pathtoken_1 = $f0 - .label path = $b0 - .label return = $47 + .label fopen__16 = $32 + .label fopen__26 = $2c + .label fopen__28 = $de + .label fopen__30 = $46 + .label cbm_k_setnam1_fopen__0 = $67 + .label stream = $46 + .label pathtoken = $6b + .label pathtoken_1 = $ec + .label path = $6b + .label return = $46 // unsigned char sp = __stdio_filecount - // [2174] fopen::sp#0 = __stdio_filecount#18 -- vbum1=vbum2 + // [2574] fopen::sp#0 = __stdio_filecount#27 -- vbum1=vbum2 lda __stdio_filecount sta sp // (unsigned int)sp | 0x8000 - // [2175] fopen::$30 = (unsigned int)fopen::sp#0 -- vwuz1=_word_vbum2 + // [2575] fopen::$30 = (unsigned int)fopen::sp#0 -- vwuz1=_word_vbum2 sta.z fopen__30 lda #0 sta.z fopen__30+1 - // [2176] fopen::stream#0 = fopen::$30 | $8000 -- vwuz1=vwuz1_bor_vwuc1 + // [2576] fopen::stream#0 = fopen::$30 | $8000 -- vwuz1=vwuz1_bor_vwuc1 lda.z stream ora #<$8000 sta.z stream @@ -14852,49 +17108,49 @@ fopen: { ora #>$8000 sta.z stream+1 // char pathpos = sp * __STDIO_FILECOUNT - // [2177] fopen::pathpos#0 = fopen::sp#0 << 1 -- vbum1=vbum2_rol_1 + // [2577] fopen::pathpos#0 = fopen::sp#0 << 1 -- vbum1=vbum2_rol_1 lda sp asl sta pathpos // __logical = 0 - // [2178] ((char *)&__stdio_file+$40)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + // [2578] ((char *)&__stdio_file+$40)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 lda #0 ldy sp sta __stdio_file+$40,y // __device = 0 - // [2179] ((char *)&__stdio_file+$42)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + // [2579] ((char *)&__stdio_file+$42)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 sta __stdio_file+$42,y // __channel = 0 - // [2180] ((char *)&__stdio_file+$44)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + // [2580] ((char *)&__stdio_file+$44)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 sta __stdio_file+$44,y - // [2181] fopen::pathtoken#22 = fopen::pathtoken#0 -- pbuz1=pbuz2 + // [2581] fopen::pathtoken#22 = fopen::pathtoken#0 -- pbuz1=pbuz2 lda.z pathtoken sta.z pathtoken_1 lda.z pathtoken+1 sta.z pathtoken_1+1 - // [2182] fopen::pathpos#21 = fopen::pathpos#0 -- vbum1=vbum2 + // [2582] fopen::pathpos#21 = fopen::pathpos#0 -- vbum1=vbum2 lda pathpos sta pathpos_1 - // [2183] phi from fopen to fopen::@8 [phi:fopen->fopen::@8] - // [2183] phi fopen::num#10 = 0 [phi:fopen->fopen::@8#0] -- vbum1=vbuc1 - lda #0 - sta num - // [2183] phi fopen::pathpos#10 = fopen::pathpos#21 [phi:fopen->fopen::@8#1] -- register_copy - // [2183] phi fopen::path#10 = fopen::pathtoken#0 [phi:fopen->fopen::@8#2] -- register_copy - // [2183] phi fopen::pathstep#10 = 0 [phi:fopen->fopen::@8#3] -- vbum1=vbuc1 + // [2583] phi from fopen to fopen::@8 [phi:fopen->fopen::@8] + // [2583] phi fopen::num#10 = 0 [phi:fopen->fopen::@8#0] -- vbuxx=vbuc1 + ldx #0 + // [2583] phi fopen::pathpos#10 = fopen::pathpos#21 [phi:fopen->fopen::@8#1] -- register_copy + // [2583] phi fopen::path#10 = fopen::pathtoken#0 [phi:fopen->fopen::@8#2] -- register_copy + // [2583] phi fopen::pathstep#10 = 0 [phi:fopen->fopen::@8#3] -- vbum1=vbuc1 + txa sta pathstep - // [2183] phi fopen::pathtoken#10 = fopen::pathtoken#22 [phi:fopen->fopen::@8#4] -- register_copy + // [2583] phi fopen::pathtoken#10 = fopen::pathtoken#22 [phi:fopen->fopen::@8#4] -- register_copy // Iterate while path is not \0. - // [2183] phi from fopen::@22 to fopen::@8 [phi:fopen::@22->fopen::@8] - // [2183] phi fopen::num#10 = fopen::num#13 [phi:fopen::@22->fopen::@8#0] -- register_copy - // [2183] phi fopen::pathpos#10 = fopen::pathpos#7 [phi:fopen::@22->fopen::@8#1] -- register_copy - // [2183] phi fopen::path#10 = fopen::path#11 [phi:fopen::@22->fopen::@8#2] -- register_copy - // [2183] phi fopen::pathstep#10 = fopen::pathstep#11 [phi:fopen::@22->fopen::@8#3] -- register_copy - // [2183] phi fopen::pathtoken#10 = fopen::pathtoken#1 [phi:fopen::@22->fopen::@8#4] -- register_copy + // [2583] phi from fopen::@22 to fopen::@8 [phi:fopen::@22->fopen::@8] + // [2583] phi fopen::num#10 = fopen::num#13 [phi:fopen::@22->fopen::@8#0] -- register_copy + // [2583] phi fopen::pathpos#10 = fopen::pathpos#7 [phi:fopen::@22->fopen::@8#1] -- register_copy + // [2583] phi fopen::path#10 = fopen::path#12 [phi:fopen::@22->fopen::@8#2] -- register_copy + // [2583] phi fopen::pathstep#10 = fopen::pathstep#11 [phi:fopen::@22->fopen::@8#3] -- register_copy + // [2583] phi fopen::pathtoken#10 = fopen::pathtoken#1 [phi:fopen::@22->fopen::@8#4] -- register_copy // fopen::@8 __b8: // if (*pathtoken == ',' || *pathtoken == '\0') - // [2184] if(*fopen::pathtoken#10==',') goto fopen::@9 -- _deref_pbuz1_eq_vbuc1_then_la1 + // [2584] if(*fopen::pathtoken#10==',') goto fopen::@9 -- _deref_pbuz1_eq_vbuc1_then_la1 lda #',' ldy #0 cmp (pathtoken_1),y @@ -14902,7 +17158,7 @@ fopen: { jmp __b9 !__b9: // fopen::@33 - // [2185] if(*fopen::pathtoken#10=='@') goto fopen::@9 -- _deref_pbuz1_eq_vbuc1_then_la1 + // [2585] if(*fopen::pathtoken#10=='@') goto fopen::@9 -- _deref_pbuz1_eq_vbuc1_then_la1 lda #'@' cmp (pathtoken_1),y bne !__b9+ @@ -14910,34 +17166,34 @@ fopen: { !__b9: // fopen::@23 // if (pathstep == 0) - // [2186] if(fopen::pathstep#10!=0) goto fopen::@10 -- vbum1_neq_0_then_la1 + // [2586] if(fopen::pathstep#10!=0) goto fopen::@10 -- vbum1_neq_0_then_la1 lda pathstep bne __b10 // fopen::@24 // __stdio_file.filename[pathpos] = *pathtoken - // [2187] ((char *)&__stdio_file)[fopen::pathpos#10] = *fopen::pathtoken#10 -- pbuc1_derefidx_vbum1=_deref_pbuz2 + // [2587] ((char *)&__stdio_file)[fopen::pathpos#10] = *fopen::pathtoken#10 -- pbuc1_derefidx_vbum1=_deref_pbuz2 lda (pathtoken_1),y ldy pathpos_1 sta __stdio_file,y // pathpos++; - // [2188] fopen::pathpos#1 = ++ fopen::pathpos#10 -- vbum1=_inc_vbum1 + // [2588] fopen::pathpos#1 = ++ fopen::pathpos#10 -- vbum1=_inc_vbum1 inc pathpos_1 - // [2189] phi from fopen::@12 fopen::@23 fopen::@24 to fopen::@10 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10] - // [2189] phi fopen::num#13 = fopen::num#15 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#0] -- register_copy - // [2189] phi fopen::pathpos#7 = fopen::pathpos#10 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#1] -- register_copy - // [2189] phi fopen::path#11 = fopen::path#13 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#2] -- register_copy - // [2189] phi fopen::pathstep#11 = fopen::pathstep#1 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#3] -- register_copy + // [2589] phi from fopen::@12 fopen::@23 fopen::@24 to fopen::@10 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10] + // [2589] phi fopen::num#13 = fopen::num#15 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#0] -- register_copy + // [2589] phi fopen::pathpos#7 = fopen::pathpos#10 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#1] -- register_copy + // [2589] phi fopen::path#12 = fopen::path#14 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#2] -- register_copy + // [2589] phi fopen::pathstep#11 = fopen::pathstep#1 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#3] -- register_copy // fopen::@10 __b10: // pathtoken++; - // [2190] fopen::pathtoken#1 = ++ fopen::pathtoken#10 -- pbuz1=_inc_pbuz1 + // [2590] fopen::pathtoken#1 = ++ fopen::pathtoken#10 -- pbuz1=_inc_pbuz1 inc.z pathtoken_1 bne !+ inc.z pathtoken_1+1 !: // fopen::@22 // pathtoken - 1 - // [2191] fopen::$28 = fopen::pathtoken#1 - 1 -- pbuz1=pbuz2_minus_1 + // [2591] fopen::$28 = fopen::pathtoken#1 - 1 -- pbuz1=pbuz2_minus_1 lda.z pathtoken_1 sec sbc #1 @@ -14946,101 +17202,99 @@ fopen: { sbc #0 sta.z fopen__28+1 // while (*(pathtoken - 1)) - // [2192] if(0!=*fopen::$28) goto fopen::@8 -- 0_neq__deref_pbuz1_then_la1 + // [2592] if(0!=*fopen::$28) goto fopen::@8 -- 0_neq__deref_pbuz1_then_la1 ldy #0 lda (fopen__28),y cmp #0 bne __b8 // fopen::@26 // __status = 0 - // [2193] ((char *)&__stdio_file+$46)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + // [2593] ((char *)&__stdio_file+$46)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 tya ldy sp sta __stdio_file+$46,y // if(!__logical) - // [2194] if(0!=((char *)&__stdio_file+$40)[fopen::sp#0]) goto fopen::@1 -- 0_neq_pbuc1_derefidx_vbum1_then_la1 + // [2594] if(0!=((char *)&__stdio_file+$40)[fopen::sp#0]) goto fopen::@1 -- 0_neq_pbuc1_derefidx_vbum1_then_la1 lda __stdio_file+$40,y cmp #0 bne __b1 // fopen::@27 // __stdio_filecount+1 - // [2195] fopen::$4 = __stdio_filecount#18 + 1 -- vbum1=vbum2_plus_1 + // [2595] fopen::$4 = __stdio_filecount#27 + 1 -- vbuaa=vbum1_plus_1 lda __stdio_filecount inc - sta fopen__4 // __logical = __stdio_filecount+1 - // [2196] ((char *)&__stdio_file+$40)[fopen::sp#0] = fopen::$4 -- pbuc1_derefidx_vbum1=vbum2 + // [2596] ((char *)&__stdio_file+$40)[fopen::sp#0] = fopen::$4 -- pbuc1_derefidx_vbum1=vbuaa sta __stdio_file+$40,y // fopen::@1 __b1: // if(!__device) - // [2197] if(0!=((char *)&__stdio_file+$42)[fopen::sp#0]) goto fopen::@2 -- 0_neq_pbuc1_derefidx_vbum1_then_la1 + // [2597] if(0!=((char *)&__stdio_file+$42)[fopen::sp#0]) goto fopen::@2 -- 0_neq_pbuc1_derefidx_vbum1_then_la1 ldy sp lda __stdio_file+$42,y cmp #0 bne __b2 // fopen::@5 // __device = 8 - // [2198] ((char *)&__stdio_file+$42)[fopen::sp#0] = 8 -- pbuc1_derefidx_vbum1=vbuc2 + // [2598] ((char *)&__stdio_file+$42)[fopen::sp#0] = 8 -- pbuc1_derefidx_vbum1=vbuc2 lda #8 sta __stdio_file+$42,y // fopen::@2 __b2: // if(!__channel) - // [2199] if(0!=((char *)&__stdio_file+$44)[fopen::sp#0]) goto fopen::@3 -- 0_neq_pbuc1_derefidx_vbum1_then_la1 + // [2599] if(0!=((char *)&__stdio_file+$44)[fopen::sp#0]) goto fopen::@3 -- 0_neq_pbuc1_derefidx_vbum1_then_la1 ldy sp lda __stdio_file+$44,y cmp #0 bne __b3 // fopen::@6 // __stdio_filecount+2 - // [2200] fopen::$9 = __stdio_filecount#18 + 2 -- vbuz1=vbum2_plus_2 + // [2600] fopen::$9 = __stdio_filecount#27 + 2 -- vbuaa=vbum1_plus_2 lda __stdio_filecount clc adc #2 - sta.z fopen__9 // __channel = __stdio_filecount+2 - // [2201] ((char *)&__stdio_file+$44)[fopen::sp#0] = fopen::$9 -- pbuc1_derefidx_vbum1=vbuz2 + // [2601] ((char *)&__stdio_file+$44)[fopen::sp#0] = fopen::$9 -- pbuc1_derefidx_vbum1=vbuaa sta __stdio_file+$44,y // fopen::@3 __b3: // __filename - // [2202] fopen::$11 = (char *)&__stdio_file + fopen::pathpos#0 -- pbuz1=pbuc1_plus_vbum2 + // [2602] fopen::$11 = (char *)&__stdio_file + fopen::pathpos#0 -- pbum1=pbuc1_plus_vbum2 lda pathpos clc adc #<__stdio_file - sta.z fopen__11 + sta fopen__11 lda #>__stdio_file adc #0 - sta.z fopen__11+1 + sta fopen__11+1 // cbm_k_setnam(__filename) - // [2203] fopen::cbm_k_setnam1_filename = fopen::$11 -- pbum1=pbuz2 - lda.z fopen__11 + // [2603] fopen::cbm_k_setnam1_filename = fopen::$11 -- pbum1=pbum2 + lda fopen__11 sta cbm_k_setnam1_filename - lda.z fopen__11+1 + lda fopen__11+1 sta cbm_k_setnam1_filename+1 // fopen::cbm_k_setnam1 // strlen(filename) - // [2204] strlen::str#4 = fopen::cbm_k_setnam1_filename -- pbuz1=pbum2 + // [2604] strlen::str#4 = fopen::cbm_k_setnam1_filename -- pbuz1=pbum2 lda cbm_k_setnam1_filename sta.z strlen.str lda cbm_k_setnam1_filename+1 sta.z strlen.str+1 - // [2205] call strlen - // [2155] phi from fopen::cbm_k_setnam1 to strlen [phi:fopen::cbm_k_setnam1->strlen] - // [2155] phi strlen::str#8 = strlen::str#4 [phi:fopen::cbm_k_setnam1->strlen#0] -- register_copy + // [2605] call strlen + // [2555] phi from fopen::cbm_k_setnam1 to strlen [phi:fopen::cbm_k_setnam1->strlen] + // [2555] phi strlen::str#8 = strlen::str#4 [phi:fopen::cbm_k_setnam1->strlen#0] -- register_copy jsr strlen // strlen(filename) - // [2206] strlen::return#11 = strlen::len#2 + // [2606] strlen::return#11 = strlen::len#2 // fopen::@31 - // [2207] fopen::cbm_k_setnam1_$0 = strlen::return#11 -- vwum1=vwum2 + // [2607] fopen::cbm_k_setnam1_$0 = strlen::return#11 -- vwuz1=vwum2 lda strlen.return - sta cbm_k_setnam1_fopen__0 + sta.z cbm_k_setnam1_fopen__0 lda strlen.return+1 - sta cbm_k_setnam1_fopen__0+1 + sta.z cbm_k_setnam1_fopen__0+1 // char filename_len = (char)strlen(filename) - // [2208] fopen::cbm_k_setnam1_filename_len = (char)fopen::cbm_k_setnam1_$0 -- vbum1=_byte_vwum2 - lda cbm_k_setnam1_fopen__0 + // [2608] fopen::cbm_k_setnam1_filename_len = (char)fopen::cbm_k_setnam1_$0 -- vbum1=_byte_vwuz2 + lda.z cbm_k_setnam1_fopen__0 sta cbm_k_setnam1_filename_len // asm // asm { ldafilename_len ldxfilename ldyfilename+1 jsrCBM_SETNAM } @@ -15049,17 +17303,17 @@ fopen: { jsr CBM_SETNAM // fopen::@28 // cbm_k_setlfs(__logical, __device, __channel) - // [2210] cbm_k_setlfs::channel = ((char *)&__stdio_file+$40)[fopen::sp#0] -- vbum1=pbuc1_derefidx_vbum2 + // [2610] cbm_k_setlfs::channel = ((char *)&__stdio_file+$40)[fopen::sp#0] -- vbum1=pbuc1_derefidx_vbum2 ldy sp lda __stdio_file+$40,y sta cbm_k_setlfs.channel - // [2211] cbm_k_setlfs::device = ((char *)&__stdio_file+$42)[fopen::sp#0] -- vbum1=pbuc1_derefidx_vbum2 + // [2611] cbm_k_setlfs::device = ((char *)&__stdio_file+$42)[fopen::sp#0] -- vbum1=pbuc1_derefidx_vbum2 lda __stdio_file+$42,y sta cbm_k_setlfs.device - // [2212] cbm_k_setlfs::command = ((char *)&__stdio_file+$44)[fopen::sp#0] -- vbum1=pbuc1_derefidx_vbum2 + // [2612] cbm_k_setlfs::command = ((char *)&__stdio_file+$44)[fopen::sp#0] -- vbum1=pbuc1_derefidx_vbum2 lda __stdio_file+$44,y sta cbm_k_setlfs.command - // [2213] call cbm_k_setlfs + // [2613] call cbm_k_setlfs jsr cbm_k_setlfs // fopen::cbm_k_open1 // asm @@ -15067,7 +17321,7 @@ fopen: { jsr CBM_OPEN // fopen::cbm_k_readst1 // char status - // [2215] fopen::cbm_k_readst1_status = 0 -- vbum1=vbuc1 + // [2615] fopen::cbm_k_readst1_status = 0 -- vbum1=vbuc1 lda #0 sta cbm_k_readst1_status // asm @@ -15075,38 +17329,36 @@ fopen: { jsr CBM_READST sta cbm_k_readst1_status // return status; - // [2217] fopen::cbm_k_readst1_return#0 = fopen::cbm_k_readst1_status -- vbum1=vbum2 - sta cbm_k_readst1_return + // [2617] fopen::cbm_k_readst1_return#0 = fopen::cbm_k_readst1_status -- vbuaa=vbum1 // fopen::cbm_k_readst1_@return // } - // [2218] fopen::cbm_k_readst1_return#1 = fopen::cbm_k_readst1_return#0 + // [2618] fopen::cbm_k_readst1_return#1 = fopen::cbm_k_readst1_return#0 // fopen::@29 // cbm_k_readst() - // [2219] fopen::$15 = fopen::cbm_k_readst1_return#1 -- vbum1=vbum2 - sta fopen__15 + // [2619] fopen::$15 = fopen::cbm_k_readst1_return#1 // __status = cbm_k_readst() - // [2220] ((char *)&__stdio_file+$46)[fopen::sp#0] = fopen::$15 -- pbuc1_derefidx_vbum1=vbum2 + // [2620] ((char *)&__stdio_file+$46)[fopen::sp#0] = fopen::$15 -- pbuc1_derefidx_vbum1=vbuaa ldy sp sta __stdio_file+$46,y // ferror(stream) - // [2221] ferror::stream#0 = (struct $2 *)fopen::stream#0 - // [2222] call ferror + // [2621] ferror::stream#0 = (struct $2 *)fopen::stream#0 + // [2622] call ferror jsr ferror - // [2223] ferror::return#0 = ferror::return#1 + // [2623] ferror::return#0 = ferror::return#1 // fopen::@32 - // [2224] fopen::$16 = ferror::return#0 -- vwsm1=vwsm2 + // [2624] fopen::$16 = ferror::return#0 -- vwsz1=vwsm2 lda ferror.return - sta fopen__16 + sta.z fopen__16 lda ferror.return+1 - sta fopen__16+1 + sta.z fopen__16+1 // if (ferror(stream)) - // [2225] if(0==fopen::$16) goto fopen::@4 -- 0_eq_vwsm1_then_la1 - lda fopen__16 - ora fopen__16+1 + // [2625] if(0==fopen::$16) goto fopen::@4 -- 0_eq_vwsz1_then_la1 + lda.z fopen__16 + ora.z fopen__16+1 beq __b4 // fopen::@7 // cbm_k_close(__logical) - // [2226] fopen::cbm_k_close1_channel = ((char *)&__stdio_file+$40)[fopen::sp#0] -- vbum1=pbuc1_derefidx_vbum2 + // [2626] fopen::cbm_k_close1_channel = ((char *)&__stdio_file+$40)[fopen::sp#0] -- vbum1=pbuc1_derefidx_vbum2 ldy sp lda __stdio_file+$40,y sta cbm_k_close1_channel @@ -15114,40 +17366,40 @@ fopen: { // asm // asm { ldachannel jsrCBM_CLOSE } jsr CBM_CLOSE - // [2228] phi from fopen::cbm_k_close1 to fopen::@return [phi:fopen::cbm_k_close1->fopen::@return] - // [2228] phi __stdio_filecount#1 = __stdio_filecount#18 [phi:fopen::cbm_k_close1->fopen::@return#0] -- register_copy - // [2228] phi fopen::return#2 = 0 [phi:fopen::cbm_k_close1->fopen::@return#1] -- pssz1=vbuc1 + // [2628] phi from fopen::cbm_k_close1 to fopen::@return [phi:fopen::cbm_k_close1->fopen::@return] + // [2628] phi __stdio_filecount#1 = __stdio_filecount#27 [phi:fopen::cbm_k_close1->fopen::@return#0] -- register_copy + // [2628] phi fopen::return#2 = 0 [phi:fopen::cbm_k_close1->fopen::@return#1] -- pssz1=vbuc1 lda #<0 sta.z return sta.z return+1 // fopen::@return // } - // [2229] return + // [2629] return rts // fopen::@4 __b4: // __stdio_filecount++; - // [2230] __stdio_filecount#0 = ++ __stdio_filecount#18 -- vbum1=_inc_vbum1 + // [2630] __stdio_filecount#0 = ++ __stdio_filecount#27 -- vbum1=_inc_vbum1 inc __stdio_filecount - // [2231] fopen::return#8 = (struct $2 *)fopen::stream#0 - // [2228] phi from fopen::@4 to fopen::@return [phi:fopen::@4->fopen::@return] - // [2228] phi __stdio_filecount#1 = __stdio_filecount#0 [phi:fopen::@4->fopen::@return#0] -- register_copy - // [2228] phi fopen::return#2 = fopen::return#8 [phi:fopen::@4->fopen::@return#1] -- register_copy + // [2631] fopen::return#10 = (struct $2 *)fopen::stream#0 + // [2628] phi from fopen::@4 to fopen::@return [phi:fopen::@4->fopen::@return] + // [2628] phi __stdio_filecount#1 = __stdio_filecount#0 [phi:fopen::@4->fopen::@return#0] -- register_copy + // [2628] phi fopen::return#2 = fopen::return#10 [phi:fopen::@4->fopen::@return#1] -- register_copy rts // fopen::@9 __b9: // if (pathstep > 0) - // [2232] if(fopen::pathstep#10>0) goto fopen::@11 -- vbum1_gt_0_then_la1 + // [2632] if(fopen::pathstep#10>0) goto fopen::@11 -- vbum1_gt_0_then_la1 lda pathstep bne __b11 // fopen::@25 // __stdio_file.filename[pathpos] = '\0' - // [2233] ((char *)&__stdio_file)[fopen::pathpos#10] = '@' -- pbuc1_derefidx_vbum1=vbuc2 + // [2633] ((char *)&__stdio_file)[fopen::pathpos#10] = '@' -- pbuc1_derefidx_vbum1=vbuc2 lda #'@' ldy pathpos_1 sta __stdio_file,y // path = pathtoken + 1 - // [2234] fopen::path#0 = fopen::pathtoken#10 + 1 -- pbuz1=pbuz2_plus_1 + // [2634] fopen::path#0 = fopen::pathtoken#10 + 1 -- pbuz1=pbuz2_plus_1 clc lda.z pathtoken_1 adc #1 @@ -15155,30 +17407,30 @@ fopen: { lda.z pathtoken_1+1 adc #0 sta.z path+1 - // [2235] phi from fopen::@16 fopen::@17 fopen::@18 fopen::@19 fopen::@25 to fopen::@12 [phi:fopen::@16/fopen::@17/fopen::@18/fopen::@19/fopen::@25->fopen::@12] - // [2235] phi fopen::num#15 = fopen::num#2 [phi:fopen::@16/fopen::@17/fopen::@18/fopen::@19/fopen::@25->fopen::@12#0] -- register_copy - // [2235] phi fopen::path#13 = fopen::path#16 [phi:fopen::@16/fopen::@17/fopen::@18/fopen::@19/fopen::@25->fopen::@12#1] -- register_copy + // [2635] phi from fopen::@16 fopen::@17 fopen::@18 fopen::@19 fopen::@25 to fopen::@12 [phi:fopen::@16/fopen::@17/fopen::@18/fopen::@19/fopen::@25->fopen::@12] + // [2635] phi fopen::num#15 = fopen::num#2 [phi:fopen::@16/fopen::@17/fopen::@18/fopen::@19/fopen::@25->fopen::@12#0] -- register_copy + // [2635] phi fopen::path#14 = fopen::path#17 [phi:fopen::@16/fopen::@17/fopen::@18/fopen::@19/fopen::@25->fopen::@12#1] -- register_copy // fopen::@12 __b12: // pathstep++; - // [2236] fopen::pathstep#1 = ++ fopen::pathstep#10 -- vbum1=_inc_vbum1 + // [2636] fopen::pathstep#1 = ++ fopen::pathstep#10 -- vbum1=_inc_vbum1 inc pathstep jmp __b10 // fopen::@11 __b11: // char pathcmp = *path - // [2237] fopen::pathcmp#0 = *fopen::path#10 -- vbum1=_deref_pbuz2 + // [2637] fopen::pathcmp#0 = *fopen::path#10 -- vbum1=_deref_pbuz2 ldy #0 lda (path),y sta pathcmp // case 'D': - // [2238] if(fopen::pathcmp#0=='D') goto fopen::@13 -- vbum1_eq_vbuc1_then_la1 + // [2638] if(fopen::pathcmp#0=='D') goto fopen::@13 -- vbum1_eq_vbuc1_then_la1 lda #'D' cmp pathcmp beq __b13 // fopen::@20 // case 'L': - // [2239] if(fopen::pathcmp#0=='L') goto fopen::@13 -- vbum1_eq_vbuc1_then_la1 + // [2639] if(fopen::pathcmp#0=='L') goto fopen::@13 -- vbum1_eq_vbuc1_then_la1 lda #'L' cmp pathcmp beq __b13 @@ -15186,19 +17438,19 @@ fopen: { // case 'C': // num = (char)atoi(path + 1); // path = pathtoken + 1; - // [2240] if(fopen::pathcmp#0=='C') goto fopen::@13 -- vbum1_eq_vbuc1_then_la1 + // [2640] if(fopen::pathcmp#0=='C') goto fopen::@13 -- vbum1_eq_vbuc1_then_la1 lda #'C' cmp pathcmp beq __b13 - // [2241] phi from fopen::@21 fopen::@30 to fopen::@14 [phi:fopen::@21/fopen::@30->fopen::@14] - // [2241] phi fopen::path#16 = fopen::path#10 [phi:fopen::@21/fopen::@30->fopen::@14#0] -- register_copy - // [2241] phi fopen::num#2 = fopen::num#10 [phi:fopen::@21/fopen::@30->fopen::@14#1] -- register_copy + // [2641] phi from fopen::@21 fopen::@30 to fopen::@14 [phi:fopen::@21/fopen::@30->fopen::@14] + // [2641] phi fopen::path#17 = fopen::path#10 [phi:fopen::@21/fopen::@30->fopen::@14#0] -- register_copy + // [2641] phi fopen::num#2 = fopen::num#10 [phi:fopen::@21/fopen::@30->fopen::@14#1] -- register_copy // fopen::@14 __b14: // case 'L': // __logical = num; // break; - // [2242] if(fopen::pathcmp#0=='L') goto fopen::@17 -- vbum1_eq_vbuc1_then_la1 + // [2642] if(fopen::pathcmp#0=='L') goto fopen::@17 -- vbum1_eq_vbuc1_then_la1 lda #'L' cmp pathcmp beq __b17 @@ -15206,7 +17458,7 @@ fopen: { // case 'D': // __device = num; // break; - // [2243] if(fopen::pathcmp#0=='D') goto fopen::@18 -- vbum1_eq_vbuc1_then_la1 + // [2643] if(fopen::pathcmp#0=='D') goto fopen::@18 -- vbum1_eq_vbuc1_then_la1 lda #'D' cmp pathcmp beq __b18 @@ -15214,59 +17466,59 @@ fopen: { // case 'C': // __channel = num; // break; - // [2244] if(fopen::pathcmp#0!='C') goto fopen::@12 -- vbum1_neq_vbuc1_then_la1 + // [2644] if(fopen::pathcmp#0!='C') goto fopen::@12 -- vbum1_neq_vbuc1_then_la1 lda #'C' cmp pathcmp bne __b12 // fopen::@19 // __channel = num - // [2245] ((char *)&__stdio_file+$44)[fopen::sp#0] = fopen::num#2 -- pbuc1_derefidx_vbum1=vbum2 - lda num + // [2645] ((char *)&__stdio_file+$44)[fopen::sp#0] = fopen::num#2 -- pbuc1_derefidx_vbum1=vbuxx ldy sp + txa sta __stdio_file+$44,y jmp __b12 // fopen::@18 __b18: // __device = num - // [2246] ((char *)&__stdio_file+$42)[fopen::sp#0] = fopen::num#2 -- pbuc1_derefidx_vbum1=vbum2 - lda num + // [2646] ((char *)&__stdio_file+$42)[fopen::sp#0] = fopen::num#2 -- pbuc1_derefidx_vbum1=vbuxx ldy sp + txa sta __stdio_file+$42,y jmp __b12 // fopen::@17 __b17: // __logical = num - // [2247] ((char *)&__stdio_file+$40)[fopen::sp#0] = fopen::num#2 -- pbuc1_derefidx_vbum1=vbum2 - lda num + // [2647] ((char *)&__stdio_file+$40)[fopen::sp#0] = fopen::num#2 -- pbuc1_derefidx_vbum1=vbuxx ldy sp + txa sta __stdio_file+$40,y jmp __b12 // fopen::@13 __b13: // atoi(path + 1) - // [2248] atoi::str#0 = fopen::path#10 + 1 -- pbuz1=pbuz1_plus_1 + // [2648] atoi::str#0 = fopen::path#10 + 1 -- pbuz1=pbuz1_plus_1 inc.z atoi.str bne !+ inc.z atoi.str+1 !: - // [2249] call atoi - // [2878] phi from fopen::@13 to atoi [phi:fopen::@13->atoi] - // [2878] phi atoi::str#2 = atoi::str#0 [phi:fopen::@13->atoi#0] -- register_copy + // [2649] call atoi + // [3376] phi from fopen::@13 to atoi [phi:fopen::@13->atoi] + // [3376] phi atoi::str#2 = atoi::str#0 [phi:fopen::@13->atoi#0] -- register_copy jsr atoi // atoi(path + 1) - // [2250] atoi::return#3 = atoi::return#2 + // [2650] atoi::return#3 = atoi::return#2 // fopen::@30 - // [2251] fopen::$26 = atoi::return#3 -- vwsz1=vwsm2 + // [2651] fopen::$26 = atoi::return#3 -- vwsz1=vwsm2 lda atoi.return sta.z fopen__26 lda atoi.return+1 sta.z fopen__26+1 // num = (char)atoi(path + 1) - // [2252] fopen::num#1 = (char)fopen::$26 -- vbum1=_byte_vwsz2 + // [2652] fopen::num#1 = (char)fopen::$26 -- vbuxx=_byte_vwsz1 lda.z fopen__26 - sta num + tax // path = pathtoken + 1 - // [2253] fopen::path#1 = fopen::pathtoken#10 + 1 -- pbuz1=pbuz2_plus_1 + // [2653] fopen::path#1 = fopen::pathtoken#10 + 1 -- pbuz1=pbuz2_plus_1 clc lda.z pathtoken_1 adc #1 @@ -15276,22 +17528,17 @@ fopen: { sta.z path+1 jmp __b14 .segment Data - fopen__4: .byte 0 - .label fopen__15 = fclose.fclose__1 - fopen__16: .word 0 + fopen__11: .word 0 cbm_k_setnam1_filename: .word 0 cbm_k_setnam1_filename_len: .byte 0 - cbm_k_setnam1_fopen__0: .word 0 cbm_k_readst1_status: .byte 0 cbm_k_close1_channel: .byte 0 - sp: .byte 0 - pathpos: .byte 0 - pathpos_1: .byte 0 - pathcmp: .byte 0 + .label sp = uctoa.started + .label pathpos = printf_padding.length + .label pathpos_1 = printf_uchar.format_zero_padding + .label pathcmp = printf_padding.pad // Parse path - pathstep: .byte 0 - num: .byte 0 - cbm_k_readst1_return: .byte 0 + .label pathstep = printf_uchar.format_min_length } .segment Code // fclose @@ -15303,22 +17550,21 @@ fopen: { * - 0x0000: Something is wrong! Kernal Error Code (https://commodore.ca/manuals/pdfs/commodore_error_messages.pdf) * - other: OK! The last pointer between 0xA000 and 0xBFFF is returned. Note that the last pointer is indicating the first free byte. */ -// int fclose(__mem() struct $2 *stream) +// int fclose(__zp($e4) struct $2 *stream) fclose: { - .label fclose__4 = $ce - .label fclose__6 = $77 + .label stream = $e4 // unsigned char sp = (unsigned char)stream - // [2255] fclose::sp#0 = (char)fclose::stream#2 -- vbum1=_byte_pssm2 - lda stream + // [2655] fclose::sp#0 = (char)fclose::stream#3 -- vbum1=_byte_pssz2 + lda.z stream sta sp // cbm_k_chkin(__logical) - // [2256] fclose::cbm_k_chkin1_channel = ((char *)&__stdio_file+$40)[fclose::sp#0] -- vbum1=pbuc1_derefidx_vbum2 + // [2656] fclose::cbm_k_chkin1_channel = ((char *)&__stdio_file+$40)[fclose::sp#0] -- vbum1=pbuc1_derefidx_vbum2 tay lda __stdio_file+$40,y sta cbm_k_chkin1_channel // fclose::cbm_k_chkin1 // char status - // [2257] fclose::cbm_k_chkin1_status = 0 -- vbum1=vbuc1 + // [2657] fclose::cbm_k_chkin1_status = 0 -- vbum1=vbuc1 lda #0 sta cbm_k_chkin1_status // asm @@ -15328,7 +17574,7 @@ fclose: { sta cbm_k_chkin1_status // fclose::cbm_k_readst1 // char status - // [2259] fclose::cbm_k_readst1_status = 0 -- vbum1=vbuc1 + // [2659] fclose::cbm_k_readst1_status = 0 -- vbum1=vbuc1 lda #0 sta cbm_k_readst1_status // asm @@ -15336,34 +17582,32 @@ fclose: { jsr CBM_READST sta cbm_k_readst1_status // return status; - // [2261] fclose::cbm_k_readst1_return#0 = fclose::cbm_k_readst1_status -- vbum1=vbum2 - sta cbm_k_readst1_return + // [2661] fclose::cbm_k_readst1_return#0 = fclose::cbm_k_readst1_status -- vbuaa=vbum1 // fclose::cbm_k_readst1_@return // } - // [2262] fclose::cbm_k_readst1_return#1 = fclose::cbm_k_readst1_return#0 + // [2662] fclose::cbm_k_readst1_return#1 = fclose::cbm_k_readst1_return#0 // fclose::@3 // cbm_k_readst() - // [2263] fclose::$1 = fclose::cbm_k_readst1_return#1 -- vbum1=vbum2 - sta fclose__1 + // [2663] fclose::$1 = fclose::cbm_k_readst1_return#1 // __status = cbm_k_readst() - // [2264] ((char *)&__stdio_file+$46)[fclose::sp#0] = fclose::$1 -- pbuc1_derefidx_vbum1=vbum2 + // [2664] ((char *)&__stdio_file+$46)[fclose::sp#0] = fclose::$1 -- pbuc1_derefidx_vbum1=vbuaa ldy sp sta __stdio_file+$46,y // if (__status) - // [2265] if(0==((char *)&__stdio_file+$46)[fclose::sp#0]) goto fclose::@1 -- 0_eq_pbuc1_derefidx_vbum1_then_la1 + // [2665] if(0==((char *)&__stdio_file+$46)[fclose::sp#0]) goto fclose::@1 -- 0_eq_pbuc1_derefidx_vbum1_then_la1 lda __stdio_file+$46,y cmp #0 beq __b1 - // [2266] phi from fclose::@2 fclose::@3 fclose::@4 to fclose::@return [phi:fclose::@2/fclose::@3/fclose::@4->fclose::@return] - // [2266] phi __stdio_filecount#2 = __stdio_filecount#3 [phi:fclose::@2/fclose::@3/fclose::@4->fclose::@return#0] -- register_copy + // [2666] phi from fclose::@2 fclose::@3 fclose::@4 to fclose::@return [phi:fclose::@2/fclose::@3/fclose::@4->fclose::@return] + // [2666] phi __stdio_filecount#2 = __stdio_filecount#3 [phi:fclose::@2/fclose::@3/fclose::@4->fclose::@return#0] -- register_copy // fclose::@return // } - // [2267] return + // [2667] return rts // fclose::@1 __b1: // cbm_k_close(__logical) - // [2268] fclose::cbm_k_close1_channel = ((char *)&__stdio_file+$40)[fclose::sp#0] -- vbum1=pbuc1_derefidx_vbum2 + // [2668] fclose::cbm_k_close1_channel = ((char *)&__stdio_file+$40)[fclose::sp#0] -- vbum1=pbuc1_derefidx_vbum2 ldy sp lda __stdio_file+$40,y sta cbm_k_close1_channel @@ -15373,7 +17617,7 @@ fclose: { jsr CBM_CLOSE // fclose::cbm_k_readst2 // char status - // [2270] fclose::cbm_k_readst2_status = 0 -- vbum1=vbuc1 + // [2670] fclose::cbm_k_readst2_status = 0 -- vbum1=vbuc1 lda #0 sta cbm_k_readst2_status // asm @@ -15381,21 +17625,19 @@ fclose: { jsr CBM_READST sta cbm_k_readst2_status // return status; - // [2272] fclose::cbm_k_readst2_return#0 = fclose::cbm_k_readst2_status -- vbum1=vbum2 - sta cbm_k_readst2_return + // [2672] fclose::cbm_k_readst2_return#0 = fclose::cbm_k_readst2_status -- vbuaa=vbum1 // fclose::cbm_k_readst2_@return // } - // [2273] fclose::cbm_k_readst2_return#1 = fclose::cbm_k_readst2_return#0 + // [2673] fclose::cbm_k_readst2_return#1 = fclose::cbm_k_readst2_return#0 // fclose::@4 // cbm_k_readst() - // [2274] fclose::$4 = fclose::cbm_k_readst2_return#1 -- vbuz1=vbum2 - sta.z fclose__4 + // [2674] fclose::$4 = fclose::cbm_k_readst2_return#1 // __status = cbm_k_readst() - // [2275] ((char *)&__stdio_file+$46)[fclose::sp#0] = fclose::$4 -- pbuc1_derefidx_vbum1=vbuz2 + // [2675] ((char *)&__stdio_file+$46)[fclose::sp#0] = fclose::$4 -- pbuc1_derefidx_vbum1=vbuaa ldy sp sta __stdio_file+$46,y // if (__status) - // [2276] if(0==((char *)&__stdio_file+$46)[fclose::sp#0]) goto fclose::@2 -- 0_eq_pbuc1_derefidx_vbum1_then_la1 + // [2676] if(0==((char *)&__stdio_file+$46)[fclose::sp#0]) goto fclose::@2 -- 0_eq_pbuc1_derefidx_vbum1_then_la1 lda __stdio_file+$46,y cmp #0 beq __b2 @@ -15403,56 +17645,51 @@ fclose: { // fclose::@2 __b2: // __logical = 0 - // [2277] ((char *)&__stdio_file+$40)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + // [2677] ((char *)&__stdio_file+$40)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 lda #0 ldy sp sta __stdio_file+$40,y // __device = 0 - // [2278] ((char *)&__stdio_file+$42)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + // [2678] ((char *)&__stdio_file+$42)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 sta __stdio_file+$42,y // __channel = 0 - // [2279] ((char *)&__stdio_file+$44)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + // [2679] ((char *)&__stdio_file+$44)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 sta __stdio_file+$44,y // __filename - // [2280] fclose::$6 = fclose::sp#0 << 1 -- vbuz1=vbum2_rol_1 + // [2680] fclose::$6 = fclose::sp#0 << 1 -- vbuaa=vbum1_rol_1 tya asl - sta.z fclose__6 // *__filename = '\0' - // [2281] ((char *)&__stdio_file)[fclose::$6] = '@' -- pbuc1_derefidx_vbuz1=vbuc2 + // [2681] ((char *)&__stdio_file)[fclose::$6] = '@' -- pbuc1_derefidx_vbuaa=vbuc2 + tay lda #'@' - ldy.z fclose__6 sta __stdio_file,y // __stdio_filecount--; - // [2282] __stdio_filecount#3 = -- __stdio_filecount#1 -- vbum1=_dec_vbum1 + // [2682] __stdio_filecount#3 = -- __stdio_filecount#1 -- vbum1=_dec_vbum1 dec __stdio_filecount rts .segment Data - fclose__1: .byte 0 cbm_k_chkin1_channel: .byte 0 cbm_k_chkin1_status: .byte 0 cbm_k_readst1_status: .byte 0 cbm_k_close1_channel: .byte 0 cbm_k_readst2_status: .byte 0 - sp: .byte 0 - cbm_k_readst1_return: .byte 0 - cbm_k_readst2_return: .byte 0 - .label stream = smc_flash.smc_commit_result + .label sp = printf_uchar.format_min_length } .segment Code // display_action_text_reading -// void display_action_text_reading(__zp($60) char *action, __zp($5e) char *file, __zp($49) unsigned long bytes, __zp($f2) unsigned long size, __zp($c0) char bram_bank, __zp($b2) char *bram_ptr) +// void display_action_text_reading(__zp($48) char *action, __zp($6d) char *file, __zp($e7) unsigned long bytes, __zp($ee) unsigned long size, __zp($e6) char bram_bank, __zp($db) char *bram_ptr) display_action_text_reading: { - .label action = $60 - .label bytes = $49 - .label bram_ptr = $b2 - .label file = $5e - .label size = $f2 - .label bram_bank = $c0 + .label action = $48 + .label bytes = $e7 + .label bram_ptr = $db + .label file = $6d + .label size = $ee + .label bram_bank = $e6 // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2284] call snprintf_init - // [1113] phi from display_action_text_reading to snprintf_init [phi:display_action_text_reading->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:display_action_text_reading->snprintf_init#0] -- pbuz1=pbuc1 + // [2684] call snprintf_init + // [1184] phi from display_action_text_reading to snprintf_init [phi:display_action_text_reading->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:display_action_text_reading->snprintf_init#0] -- pbuz1=pbuc1 lda #info_text @@ -15460,32 +17697,32 @@ display_action_text_reading: { jsr snprintf_init // display_action_text_reading::@1 // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2285] printf_string::str#14 = display_action_text_reading::action#2 - // [2286] call printf_string - // [1227] phi from display_action_text_reading::@1 to printf_string [phi:display_action_text_reading::@1->printf_string] - // [1227] phi printf_string::putc#25 = &snputc [phi:display_action_text_reading::@1->printf_string#0] -- pprz1=pprc1 + // [2685] printf_string::str#14 = display_action_text_reading::action#3 + // [2686] call printf_string + // [1419] phi from display_action_text_reading::@1 to printf_string [phi:display_action_text_reading::@1->printf_string] + // [1419] phi printf_string::putc#26 = &snputc [phi:display_action_text_reading::@1->printf_string#0] -- pprz1=pprc1 lda #snputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#14 [phi:display_action_text_reading::@1->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 0 [phi:display_action_text_reading::@1->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#14 [phi:display_action_text_reading::@1->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 0 [phi:display_action_text_reading::@1->printf_string#2] -- vbum1=vbuc1 lda #0 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 0 [phi:display_action_text_reading::@1->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 0 [phi:display_action_text_reading::@1->printf_string#3] -- vbum1=vbuc1 sta printf_string.format_min_length jsr printf_string - // [2287] phi from display_action_text_reading::@1 to display_action_text_reading::@2 [phi:display_action_text_reading::@1->display_action_text_reading::@2] + // [2687] phi from display_action_text_reading::@1 to display_action_text_reading::@2 [phi:display_action_text_reading::@1->display_action_text_reading::@2] // display_action_text_reading::@2 // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2288] call printf_str - // [1054] phi from display_action_text_reading::@2 to printf_str [phi:display_action_text_reading::@2->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:display_action_text_reading::@2->printf_str#0] -- pprz1=pprc1 + // [2688] call printf_str + // [1125] phi from display_action_text_reading::@2 to printf_str [phi:display_action_text_reading::@2->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:display_action_text_reading::@2->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s [phi:display_action_text_reading::@2->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s [phi:display_action_text_reading::@2->printf_str#1] -- pbuz1=pbuc1 lda #s @@ -15493,36 +17730,36 @@ display_action_text_reading: { jsr printf_str // display_action_text_reading::@3 // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2289] printf_string::str#15 = display_action_text_reading::file#2 -- pbuz1=pbuz2 + // [2689] printf_string::str#15 = display_action_text_reading::file#3 -- pbuz1=pbuz2 lda.z file sta.z printf_string.str lda.z file+1 sta.z printf_string.str+1 - // [2290] call printf_string - // [1227] phi from display_action_text_reading::@3 to printf_string [phi:display_action_text_reading::@3->printf_string] - // [1227] phi printf_string::putc#25 = &snputc [phi:display_action_text_reading::@3->printf_string#0] -- pprz1=pprc1 + // [2690] call printf_string + // [1419] phi from display_action_text_reading::@3 to printf_string [phi:display_action_text_reading::@3->printf_string] + // [1419] phi printf_string::putc#26 = &snputc [phi:display_action_text_reading::@3->printf_string#0] -- pprz1=pprc1 lda #snputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#15 [phi:display_action_text_reading::@3->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 0 [phi:display_action_text_reading::@3->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#15 [phi:display_action_text_reading::@3->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 0 [phi:display_action_text_reading::@3->printf_string#2] -- vbum1=vbuc1 lda #0 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 0 [phi:display_action_text_reading::@3->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 0 [phi:display_action_text_reading::@3->printf_string#3] -- vbum1=vbuc1 sta printf_string.format_min_length jsr printf_string - // [2291] phi from display_action_text_reading::@3 to display_action_text_reading::@4 [phi:display_action_text_reading::@3->display_action_text_reading::@4] + // [2691] phi from display_action_text_reading::@3 to display_action_text_reading::@4 [phi:display_action_text_reading::@3->display_action_text_reading::@4] // display_action_text_reading::@4 // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2292] call printf_str - // [1054] phi from display_action_text_reading::@4 to printf_str [phi:display_action_text_reading::@4->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:display_action_text_reading::@4->printf_str#0] -- pprz1=pprc1 + // [2692] call printf_str + // [1125] phi from display_action_text_reading::@4 to printf_str [phi:display_action_text_reading::@4->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:display_action_text_reading::@4->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s2 [phi:display_action_text_reading::@4->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s2 [phi:display_action_text_reading::@4->printf_str#1] -- pbuz1=pbuc1 lda #<@s2 sta.z printf_str.s lda #>@s2 @@ -15530,7 +17767,7 @@ display_action_text_reading: { jsr printf_str // display_action_text_reading::@5 // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2293] printf_ulong::uvalue#3 = display_action_text_reading::bytes#2 -- vdum1=vduz2 + // [2693] printf_ulong::uvalue#3 = display_action_text_reading::bytes#3 -- vdum1=vduz2 lda.z bytes sta printf_ulong.uvalue lda.z bytes+1 @@ -15539,30 +17776,29 @@ display_action_text_reading: { sta printf_ulong.uvalue+2 lda.z bytes+3 sta printf_ulong.uvalue+3 - // [2294] call printf_ulong - // [1396] phi from display_action_text_reading::@5 to printf_ulong [phi:display_action_text_reading::@5->printf_ulong] - // [1396] phi printf_ulong::format_zero_padding#10 = 1 [phi:display_action_text_reading::@5->printf_ulong#0] -- vbum1=vbuc1 + // [2694] call printf_ulong + // [1588] phi from display_action_text_reading::@5 to printf_ulong [phi:display_action_text_reading::@5->printf_ulong] + // [1588] phi printf_ulong::format_zero_padding#14 = 1 [phi:display_action_text_reading::@5->printf_ulong#0] -- vbum1=vbuc1 lda #1 sta printf_ulong.format_zero_padding - // [1396] phi printf_ulong::format_min_length#10 = 5 [phi:display_action_text_reading::@5->printf_ulong#1] -- vbum1=vbuc1 + // [1588] phi printf_ulong::format_min_length#14 = 5 [phi:display_action_text_reading::@5->printf_ulong#1] -- vbum1=vbuc1 lda #5 sta printf_ulong.format_min_length - // [1396] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:display_action_text_reading::@5->printf_ulong#2] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_ulong.format_radix - // [1396] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#3 [phi:display_action_text_reading::@5->printf_ulong#3] -- register_copy + // [1588] phi printf_ulong::format_radix#14 = HEXADECIMAL [phi:display_action_text_reading::@5->printf_ulong#2] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1588] phi printf_ulong::uvalue#14 = printf_ulong::uvalue#3 [phi:display_action_text_reading::@5->printf_ulong#3] -- register_copy jsr printf_ulong - // [2295] phi from display_action_text_reading::@5 to display_action_text_reading::@6 [phi:display_action_text_reading::@5->display_action_text_reading::@6] + // [2695] phi from display_action_text_reading::@5 to display_action_text_reading::@6 [phi:display_action_text_reading::@5->display_action_text_reading::@6] // display_action_text_reading::@6 // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2296] call printf_str - // [1054] phi from display_action_text_reading::@6 to printf_str [phi:display_action_text_reading::@6->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:display_action_text_reading::@6->printf_str#0] -- pprz1=pprc1 + // [2696] call printf_str + // [1125] phi from display_action_text_reading::@6 to printf_str [phi:display_action_text_reading::@6->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:display_action_text_reading::@6->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = display_action_text_reading::s2 [phi:display_action_text_reading::@6->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = display_action_text_reading::s2 [phi:display_action_text_reading::@6->printf_str#1] -- pbuz1=pbuc1 lda #s2 @@ -15570,7 +17806,7 @@ display_action_text_reading: { jsr printf_str // display_action_text_reading::@7 // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2297] printf_ulong::uvalue#4 = display_action_text_reading::size#2 -- vdum1=vduz2 + // [2697] printf_ulong::uvalue#4 = display_action_text_reading::size#10 -- vdum1=vduz2 lda.z size sta printf_ulong.uvalue lda.z size+1 @@ -15579,30 +17815,29 @@ display_action_text_reading: { sta printf_ulong.uvalue+2 lda.z size+3 sta printf_ulong.uvalue+3 - // [2298] call printf_ulong - // [1396] phi from display_action_text_reading::@7 to printf_ulong [phi:display_action_text_reading::@7->printf_ulong] - // [1396] phi printf_ulong::format_zero_padding#10 = 1 [phi:display_action_text_reading::@7->printf_ulong#0] -- vbum1=vbuc1 + // [2698] call printf_ulong + // [1588] phi from display_action_text_reading::@7 to printf_ulong [phi:display_action_text_reading::@7->printf_ulong] + // [1588] phi printf_ulong::format_zero_padding#14 = 1 [phi:display_action_text_reading::@7->printf_ulong#0] -- vbum1=vbuc1 lda #1 sta printf_ulong.format_zero_padding - // [1396] phi printf_ulong::format_min_length#10 = 5 [phi:display_action_text_reading::@7->printf_ulong#1] -- vbum1=vbuc1 + // [1588] phi printf_ulong::format_min_length#14 = 5 [phi:display_action_text_reading::@7->printf_ulong#1] -- vbum1=vbuc1 lda #5 sta printf_ulong.format_min_length - // [1396] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:display_action_text_reading::@7->printf_ulong#2] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_ulong.format_radix - // [1396] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#4 [phi:display_action_text_reading::@7->printf_ulong#3] -- register_copy + // [1588] phi printf_ulong::format_radix#14 = HEXADECIMAL [phi:display_action_text_reading::@7->printf_ulong#2] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1588] phi printf_ulong::uvalue#14 = printf_ulong::uvalue#4 [phi:display_action_text_reading::@7->printf_ulong#3] -- register_copy jsr printf_ulong - // [2299] phi from display_action_text_reading::@7 to display_action_text_reading::@8 [phi:display_action_text_reading::@7->display_action_text_reading::@8] + // [2699] phi from display_action_text_reading::@7 to display_action_text_reading::@8 [phi:display_action_text_reading::@7->display_action_text_reading::@8] // display_action_text_reading::@8 // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2300] call printf_str - // [1054] phi from display_action_text_reading::@8 to printf_str [phi:display_action_text_reading::@8->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:display_action_text_reading::@8->printf_str#0] -- pprz1=pprc1 + // [2700] call printf_str + // [1125] phi from display_action_text_reading::@8 to printf_str [phi:display_action_text_reading::@8->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:display_action_text_reading::@8->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = display_action_text_reading::s3 [phi:display_action_text_reading::@8->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = display_action_text_reading::s3 [phi:display_action_text_reading::@8->printf_str#1] -- pbuz1=pbuc1 lda #s3 @@ -15610,38 +17845,36 @@ display_action_text_reading: { jsr printf_str // display_action_text_reading::@9 // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2301] printf_uchar::uvalue#5 = display_action_text_reading::bram_bank#10 -- vbum1=vbuz2 - lda.z bram_bank - sta printf_uchar.uvalue - // [2302] call printf_uchar - // [1118] phi from display_action_text_reading::@9 to printf_uchar [phi:display_action_text_reading::@9->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 1 [phi:display_action_text_reading::@9->printf_uchar#0] -- vbum1=vbuc1 + // [2701] printf_uchar::uvalue#2 = display_action_text_reading::bram_bank#10 -- vbuxx=vbuz1 + ldx.z bram_bank + // [2702] call printf_uchar + // [1189] phi from display_action_text_reading::@9 to printf_uchar [phi:display_action_text_reading::@9->printf_uchar] + // [1189] phi printf_uchar::format_zero_padding#15 = 1 [phi:display_action_text_reading::@9->printf_uchar#0] -- vbum1=vbuc1 lda #1 sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 2 [phi:display_action_text_reading::@9->printf_uchar#1] -- vbum1=vbuc1 + // [1189] phi printf_uchar::format_min_length#15 = 2 [phi:display_action_text_reading::@9->printf_uchar#1] -- vbum1=vbuc1 lda #2 sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &snputc [phi:display_action_text_reading::@9->printf_uchar#2] -- pprz1=pprc1 + // [1189] phi printf_uchar::putc#15 = &snputc [phi:display_action_text_reading::@9->printf_uchar#2] -- pprz1=pprc1 lda #snputc sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = HEXADECIMAL [phi:display_action_text_reading::@9->printf_uchar#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = printf_uchar::uvalue#5 [phi:display_action_text_reading::@9->printf_uchar#4] -- register_copy + // [1189] phi printf_uchar::format_radix#15 = HEXADECIMAL [phi:display_action_text_reading::@9->printf_uchar#3] -- vbuyy=vbuc1 + ldy #HEXADECIMAL + // [1189] phi printf_uchar::uvalue#15 = printf_uchar::uvalue#2 [phi:display_action_text_reading::@9->printf_uchar#4] -- register_copy jsr printf_uchar - // [2303] phi from display_action_text_reading::@9 to display_action_text_reading::@10 [phi:display_action_text_reading::@9->display_action_text_reading::@10] + // [2703] phi from display_action_text_reading::@9 to display_action_text_reading::@10 [phi:display_action_text_reading::@9->display_action_text_reading::@10] // display_action_text_reading::@10 // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2304] call printf_str - // [1054] phi from display_action_text_reading::@10 to printf_str [phi:display_action_text_reading::@10->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:display_action_text_reading::@10->printf_str#0] -- pprz1=pprc1 + // [2704] call printf_str + // [1125] phi from display_action_text_reading::@10 to printf_str [phi:display_action_text_reading::@10->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:display_action_text_reading::@10->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s2 [phi:display_action_text_reading::@10->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s2 [phi:display_action_text_reading::@10->printf_str#1] -- pbuz1=pbuc1 lda #<@s2 sta.z printf_str.s lda #>@s2 @@ -15649,40 +17882,39 @@ display_action_text_reading: { jsr printf_str // display_action_text_reading::@11 // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2305] printf_uint::uvalue#2 = (unsigned int)display_action_text_reading::bram_ptr#10 -- vwum1=vwuz2 + // [2705] printf_uint::uvalue#2 = (unsigned int)display_action_text_reading::bram_ptr#10 -- vwum1=vwuz2 lda.z bram_ptr sta printf_uint.uvalue lda.z bram_ptr+1 sta printf_uint.uvalue+1 - // [2306] call printf_uint - // [1835] phi from display_action_text_reading::@11 to printf_uint [phi:display_action_text_reading::@11->printf_uint] - // [1835] phi printf_uint::format_zero_padding#10 = 1 [phi:display_action_text_reading::@11->printf_uint#0] -- vbum1=vbuc1 + // [2706] call printf_uint + // [2015] phi from display_action_text_reading::@11 to printf_uint [phi:display_action_text_reading::@11->printf_uint] + // [2015] phi printf_uint::format_zero_padding#10 = 1 [phi:display_action_text_reading::@11->printf_uint#0] -- vbum1=vbuc1 lda #1 sta printf_uint.format_zero_padding - // [1835] phi printf_uint::format_min_length#10 = 4 [phi:display_action_text_reading::@11->printf_uint#1] -- vbum1=vbuc1 + // [2015] phi printf_uint::format_min_length#10 = 4 [phi:display_action_text_reading::@11->printf_uint#1] -- vbum1=vbuc1 lda #4 sta printf_uint.format_min_length - // [1835] phi printf_uint::putc#10 = &snputc [phi:display_action_text_reading::@11->printf_uint#2] -- pprz1=pprc1 + // [2015] phi printf_uint::putc#10 = &snputc [phi:display_action_text_reading::@11->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1835] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:display_action_text_reading::@11->printf_uint#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uint.format_radix - // [1835] phi printf_uint::uvalue#10 = printf_uint::uvalue#2 [phi:display_action_text_reading::@11->printf_uint#4] -- register_copy + // [2015] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:display_action_text_reading::@11->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [2015] phi printf_uint::uvalue#10 = printf_uint::uvalue#2 [phi:display_action_text_reading::@11->printf_uint#4] -- register_copy jsr printf_uint - // [2307] phi from display_action_text_reading::@11 to display_action_text_reading::@12 [phi:display_action_text_reading::@11->display_action_text_reading::@12] + // [2707] phi from display_action_text_reading::@11 to display_action_text_reading::@12 [phi:display_action_text_reading::@11->display_action_text_reading::@12] // display_action_text_reading::@12 // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2308] call printf_str - // [1054] phi from display_action_text_reading::@12 to printf_str [phi:display_action_text_reading::@12->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:display_action_text_reading::@12->printf_str#0] -- pprz1=pprc1 + // [2708] call printf_str + // [1125] phi from display_action_text_reading::@12 to printf_str [phi:display_action_text_reading::@12->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:display_action_text_reading::@12->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s4 [phi:display_action_text_reading::@12->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s4 [phi:display_action_text_reading::@12->printf_str#1] -- pbuz1=pbuc1 lda #s4 @@ -15690,17 +17922,17 @@ display_action_text_reading: { jsr printf_str // display_action_text_reading::@13 // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", action, file, bytes, size, bram_bank, bram_ptr) - // [2309] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [2709] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [2310] callexecute snputc -- call_vprc1 + // [2710] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [2312] call display_action_text - // [1129] phi from display_action_text_reading::@13 to display_action_text [phi:display_action_text_reading::@13->display_action_text] - // [1129] phi display_action_text::info_text#17 = info_text [phi:display_action_text_reading::@13->display_action_text#0] -- pbuz1=pbuc1 + // [2712] call display_action_text + // [1200] phi from display_action_text_reading::@13 to display_action_text [phi:display_action_text_reading::@13->display_action_text] + // [1200] phi display_action_text::info_text#25 = info_text [phi:display_action_text_reading::@13->display_action_text#0] -- pbuz1=pbuc1 lda #info_text @@ -15708,7 +17940,7 @@ display_action_text_reading: { jsr display_action_text // display_action_text_reading::@return // } - // [2313] return + // [2713] return rts .segment Data s2: .text "/" @@ -15727,26 +17959,22 @@ display_action_text_reading: { * @param filename Name of the file to be loaded. * @return ptr the pointer advanced to the point where the stream ends. */ -// __mem() unsigned int fgets(__zp($73) char *ptr, __mem() unsigned int size, __zp($d6) struct $2 *stream) +// __mem() unsigned int fgets(__zp($5b) char *ptr, __mem() unsigned int size, __zp($be) struct $2 *stream) fgets: { - .label fgets__1 = $ce - .label fgets__8 = $77 - .label fgets__9 = $75 - .label fgets__13 = $76 - .label ptr = $73 - .label stream = $d6 + .label ptr = $5b + .label stream = $be // unsigned char sp = (unsigned char)stream - // [2315] fgets::sp#0 = (char)fgets::stream#3 -- vbum1=_byte_pssz2 + // [2715] fgets::sp#0 = (char)fgets::stream#4 -- vbum1=_byte_pssz2 lda.z stream sta sp // cbm_k_chkin(__logical) - // [2316] fgets::cbm_k_chkin1_channel = ((char *)&__stdio_file+$40)[fgets::sp#0] -- vbum1=pbuc1_derefidx_vbum2 + // [2716] fgets::cbm_k_chkin1_channel = ((char *)&__stdio_file+$40)[fgets::sp#0] -- vbum1=pbuc1_derefidx_vbum2 tay lda __stdio_file+$40,y sta cbm_k_chkin1_channel // fgets::cbm_k_chkin1 // char status - // [2317] fgets::cbm_k_chkin1_status = 0 -- vbum1=vbuc1 + // [2717] fgets::cbm_k_chkin1_status = 0 -- vbum1=vbuc1 lda #0 sta cbm_k_chkin1_status // asm @@ -15756,7 +17984,7 @@ fgets: { sta cbm_k_chkin1_status // fgets::cbm_k_readst1 // char status - // [2319] fgets::cbm_k_readst1_status = 0 -- vbum1=vbuc1 + // [2719] fgets::cbm_k_readst1_status = 0 -- vbum1=vbuc1 lda #0 sta cbm_k_readst1_status // asm @@ -15764,56 +17992,54 @@ fgets: { jsr CBM_READST sta cbm_k_readst1_status // return status; - // [2321] fgets::cbm_k_readst1_return#0 = fgets::cbm_k_readst1_status -- vbum1=vbum2 - sta cbm_k_readst1_return + // [2721] fgets::cbm_k_readst1_return#0 = fgets::cbm_k_readst1_status -- vbuaa=vbum1 // fgets::cbm_k_readst1_@return // } - // [2322] fgets::cbm_k_readst1_return#1 = fgets::cbm_k_readst1_return#0 + // [2722] fgets::cbm_k_readst1_return#1 = fgets::cbm_k_readst1_return#0 // fgets::@11 // cbm_k_readst() - // [2323] fgets::$1 = fgets::cbm_k_readst1_return#1 -- vbuz1=vbum2 - sta.z fgets__1 + // [2723] fgets::$1 = fgets::cbm_k_readst1_return#1 // __status = cbm_k_readst() - // [2324] ((char *)&__stdio_file+$46)[fgets::sp#0] = fgets::$1 -- pbuc1_derefidx_vbum1=vbuz2 + // [2724] ((char *)&__stdio_file+$46)[fgets::sp#0] = fgets::$1 -- pbuc1_derefidx_vbum1=vbuaa ldy sp sta __stdio_file+$46,y // if (__status) - // [2325] if(0==((char *)&__stdio_file+$46)[fgets::sp#0]) goto fgets::@1 -- 0_eq_pbuc1_derefidx_vbum1_then_la1 + // [2725] if(0==((char *)&__stdio_file+$46)[fgets::sp#0]) goto fgets::@1 -- 0_eq_pbuc1_derefidx_vbum1_then_la1 lda __stdio_file+$46,y cmp #0 beq __b1 - // [2326] phi from fgets::@11 fgets::@12 fgets::@5 to fgets::@return [phi:fgets::@11/fgets::@12/fgets::@5->fgets::@return] + // [2726] phi from fgets::@11 fgets::@12 fgets::@5 to fgets::@return [phi:fgets::@11/fgets::@12/fgets::@5->fgets::@return] __b8: - // [2326] phi fgets::return#1 = 0 [phi:fgets::@11/fgets::@12/fgets::@5->fgets::@return#0] -- vwum1=vbuc1 + // [2726] phi fgets::return#1 = 0 [phi:fgets::@11/fgets::@12/fgets::@5->fgets::@return#0] -- vwum1=vbuc1 lda #<0 sta return sta return+1 // fgets::@return // } - // [2327] return + // [2727] return rts // fgets::@1 __b1: - // [2328] fgets::remaining#22 = fgets::size#11 -- vwum1=vwum2 + // [2728] fgets::remaining#22 = fgets::size#10 -- vwum1=vwum2 lda size sta remaining lda size+1 sta remaining+1 - // [2329] phi from fgets::@1 to fgets::@2 [phi:fgets::@1->fgets::@2] - // [2329] phi fgets::read#10 = 0 [phi:fgets::@1->fgets::@2#0] -- vwum1=vwuc1 + // [2729] phi from fgets::@1 to fgets::@2 [phi:fgets::@1->fgets::@2] + // [2729] phi fgets::read#10 = 0 [phi:fgets::@1->fgets::@2#0] -- vwum1=vwuc1 lda #<0 sta read sta read+1 - // [2329] phi fgets::remaining#11 = fgets::remaining#22 [phi:fgets::@1->fgets::@2#1] -- register_copy - // [2329] phi fgets::ptr#10 = fgets::ptr#13 [phi:fgets::@1->fgets::@2#2] -- register_copy - // [2329] phi from fgets::@17 fgets::@18 to fgets::@2 [phi:fgets::@17/fgets::@18->fgets::@2] - // [2329] phi fgets::read#10 = fgets::read#1 [phi:fgets::@17/fgets::@18->fgets::@2#0] -- register_copy - // [2329] phi fgets::remaining#11 = fgets::remaining#1 [phi:fgets::@17/fgets::@18->fgets::@2#1] -- register_copy - // [2329] phi fgets::ptr#10 = fgets::ptr#14 [phi:fgets::@17/fgets::@18->fgets::@2#2] -- register_copy + // [2729] phi fgets::remaining#11 = fgets::remaining#22 [phi:fgets::@1->fgets::@2#1] -- register_copy + // [2729] phi fgets::ptr#11 = fgets::ptr#14 [phi:fgets::@1->fgets::@2#2] -- register_copy + // [2729] phi from fgets::@17 fgets::@18 to fgets::@2 [phi:fgets::@17/fgets::@18->fgets::@2] + // [2729] phi fgets::read#10 = fgets::read#1 [phi:fgets::@17/fgets::@18->fgets::@2#0] -- register_copy + // [2729] phi fgets::remaining#11 = fgets::remaining#1 [phi:fgets::@17/fgets::@18->fgets::@2#1] -- register_copy + // [2729] phi fgets::ptr#11 = fgets::ptr#15 [phi:fgets::@17/fgets::@18->fgets::@2#2] -- register_copy // fgets::@2 __b2: // if (!size) - // [2330] if(0==fgets::size#11) goto fgets::@3 -- 0_eq_vwum1_then_la1 + // [2730] if(0==fgets::size#10) goto fgets::@3 -- 0_eq_vwum1_then_la1 lda size ora size+1 bne !__b3+ @@ -15821,7 +18047,7 @@ fgets: { !__b3: // fgets::@8 // if (remaining >= 512) - // [2331] if(fgets::remaining#11>=$200) goto fgets::@4 -- vwum1_ge_vwuc1_then_la1 + // [2731] if(fgets::remaining#11>=$200) goto fgets::@4 -- vwum1_ge_vwuc1_then_la1 lda remaining+1 cmp #>$200 bcc !+ @@ -15836,26 +18062,26 @@ fgets: { !: // fgets::@9 // cx16_k_macptr(remaining, ptr) - // [2332] cx16_k_macptr::bytes = fgets::remaining#11 -- vbum1=vwum2 + // [2732] cx16_k_macptr::bytes = fgets::remaining#11 -- vbum1=vwum2 lda remaining sta cx16_k_macptr.bytes - // [2333] cx16_k_macptr::buffer = (void *)fgets::ptr#10 -- pvoz1=pvoz2 + // [2733] cx16_k_macptr::buffer = (void *)fgets::ptr#11 -- pvoz1=pvoz2 lda.z ptr sta.z cx16_k_macptr.buffer lda.z ptr+1 sta.z cx16_k_macptr.buffer+1 - // [2334] call cx16_k_macptr + // [2734] call cx16_k_macptr jsr cx16_k_macptr - // [2335] cx16_k_macptr::return#4 = cx16_k_macptr::return#1 + // [2735] cx16_k_macptr::return#4 = cx16_k_macptr::return#1 // fgets::@15 __b15: // bytes = cx16_k_macptr(remaining, ptr) - // [2336] fgets::bytes#3 = cx16_k_macptr::return#4 - // [2337] phi from fgets::@13 fgets::@14 fgets::@15 to fgets::cbm_k_readst2 [phi:fgets::@13/fgets::@14/fgets::@15->fgets::cbm_k_readst2] - // [2337] phi fgets::bytes#10 = fgets::bytes#1 [phi:fgets::@13/fgets::@14/fgets::@15->fgets::cbm_k_readst2#0] -- register_copy + // [2736] fgets::bytes#3 = cx16_k_macptr::return#4 + // [2737] phi from fgets::@13 fgets::@14 fgets::@15 to fgets::cbm_k_readst2 [phi:fgets::@13/fgets::@14/fgets::@15->fgets::cbm_k_readst2] + // [2737] phi fgets::bytes#10 = fgets::bytes#1 [phi:fgets::@13/fgets::@14/fgets::@15->fgets::cbm_k_readst2#0] -- register_copy // fgets::cbm_k_readst2 // char status - // [2338] fgets::cbm_k_readst2_status = 0 -- vbum1=vbuc1 + // [2738] fgets::cbm_k_readst2_status = 0 -- vbum1=vbuc1 lda #0 sta cbm_k_readst2_status // asm @@ -15863,32 +18089,30 @@ fgets: { jsr CBM_READST sta cbm_k_readst2_status // return status; - // [2340] fgets::cbm_k_readst2_return#0 = fgets::cbm_k_readst2_status -- vbum1=vbum2 - sta cbm_k_readst2_return + // [2740] fgets::cbm_k_readst2_return#0 = fgets::cbm_k_readst2_status -- vbuaa=vbum1 // fgets::cbm_k_readst2_@return // } - // [2341] fgets::cbm_k_readst2_return#1 = fgets::cbm_k_readst2_return#0 + // [2741] fgets::cbm_k_readst2_return#1 = fgets::cbm_k_readst2_return#0 // fgets::@12 // cbm_k_readst() - // [2342] fgets::$8 = fgets::cbm_k_readst2_return#1 -- vbuz1=vbum2 - sta.z fgets__8 + // [2742] fgets::$8 = fgets::cbm_k_readst2_return#1 // __status = cbm_k_readst() - // [2343] ((char *)&__stdio_file+$46)[fgets::sp#0] = fgets::$8 -- pbuc1_derefidx_vbum1=vbuz2 + // [2743] ((char *)&__stdio_file+$46)[fgets::sp#0] = fgets::$8 -- pbuc1_derefidx_vbum1=vbuaa ldy sp sta __stdio_file+$46,y // __status & 0xBF - // [2344] fgets::$9 = ((char *)&__stdio_file+$46)[fgets::sp#0] & $bf -- vbuz1=pbuc1_derefidx_vbum2_band_vbuc2 + // [2744] fgets::$9 = ((char *)&__stdio_file+$46)[fgets::sp#0] & $bf -- vbuaa=pbuc1_derefidx_vbum1_band_vbuc2 lda #$bf and __stdio_file+$46,y - sta.z fgets__9 // if (__status & 0xBF) - // [2345] if(0==fgets::$9) goto fgets::@5 -- 0_eq_vbuz1_then_la1 + // [2745] if(0==fgets::$9) goto fgets::@5 -- 0_eq_vbuaa_then_la1 + cmp #0 beq __b5 jmp __b8 // fgets::@5 __b5: // if (bytes == 0xFFFF) - // [2346] if(fgets::bytes#10!=$ffff) goto fgets::@6 -- vwum1_neq_vwuc1_then_la1 + // [2746] if(fgets::bytes#10!=$ffff) goto fgets::@6 -- vwum1_neq_vwuc1_then_la1 lda bytes+1 cmp #>$ffff bne __b6 @@ -15899,7 +18123,7 @@ fgets: { // fgets::@6 __b6: // read += bytes - // [2347] fgets::read#1 = fgets::read#10 + fgets::bytes#10 -- vwum1=vwum1_plus_vwum2 + // [2747] fgets::read#1 = fgets::read#10 + fgets::bytes#10 -- vwum1=vwum1_plus_vwum2 clc lda read adc bytes @@ -15908,7 +18132,7 @@ fgets: { adc bytes+1 sta read+1 // ptr += bytes - // [2348] fgets::ptr#0 = fgets::ptr#10 + fgets::bytes#10 -- pbuz1=pbuz1_plus_vwum2 + // [2748] fgets::ptr#0 = fgets::ptr#11 + fgets::bytes#10 -- pbuz1=pbuz1_plus_vwum2 clc lda.z ptr adc bytes @@ -15917,16 +18141,14 @@ fgets: { adc bytes+1 sta.z ptr+1 // BYTE1(ptr) - // [2349] fgets::$13 = byte1 fgets::ptr#0 -- vbuz1=_byte1_pbuz2 - sta.z fgets__13 + // [2749] fgets::$13 = byte1 fgets::ptr#0 -- vbuaa=_byte1_pbuz1 // if (BYTE1(ptr) == 0xC0) - // [2350] if(fgets::$13!=$c0) goto fgets::@7 -- vbuz1_neq_vbuc1_then_la1 - lda #$c0 - cmp.z fgets__13 + // [2750] if(fgets::$13!=$c0) goto fgets::@7 -- vbuaa_neq_vbuc1_then_la1 + cmp #$c0 bne __b7 // fgets::@10 // ptr -= 0x2000 - // [2351] fgets::ptr#1 = fgets::ptr#0 - $2000 -- pbuz1=pbuz1_minus_vwuc1 + // [2751] fgets::ptr#1 = fgets::ptr#0 - $2000 -- pbuz1=pbuz1_minus_vwuc1 lda.z ptr sec sbc #<$2000 @@ -15934,12 +18156,12 @@ fgets: { lda.z ptr+1 sbc #>$2000 sta.z ptr+1 - // [2352] phi from fgets::@10 fgets::@6 to fgets::@7 [phi:fgets::@10/fgets::@6->fgets::@7] - // [2352] phi fgets::ptr#14 = fgets::ptr#1 [phi:fgets::@10/fgets::@6->fgets::@7#0] -- register_copy + // [2752] phi from fgets::@10 fgets::@6 to fgets::@7 [phi:fgets::@10/fgets::@6->fgets::@7] + // [2752] phi fgets::ptr#15 = fgets::ptr#1 [phi:fgets::@10/fgets::@6->fgets::@7#0] -- register_copy // fgets::@7 __b7: // remaining -= bytes - // [2353] fgets::remaining#1 = fgets::remaining#11 - fgets::bytes#10 -- vwum1=vwum1_minus_vwum2 + // [2753] fgets::remaining#1 = fgets::remaining#11 - fgets::bytes#10 -- vwum1=vwum1_minus_vwum2 lda remaining sec sbc bytes @@ -15948,23 +18170,23 @@ fgets: { sbc bytes+1 sta remaining+1 // while ((__status == 0) && ((size && remaining) || !size)) - // [2354] if(((char *)&__stdio_file+$46)[fgets::sp#0]==0) goto fgets::@16 -- pbuc1_derefidx_vbum1_eq_0_then_la1 + // [2754] if(((char *)&__stdio_file+$46)[fgets::sp#0]==0) goto fgets::@16 -- pbuc1_derefidx_vbum1_eq_0_then_la1 ldy sp lda __stdio_file+$46,y cmp #0 beq __b16 - // [2326] phi from fgets::@17 fgets::@7 to fgets::@return [phi:fgets::@17/fgets::@7->fgets::@return] - // [2326] phi fgets::return#1 = fgets::read#1 [phi:fgets::@17/fgets::@7->fgets::@return#0] -- register_copy + // [2726] phi from fgets::@17 fgets::@7 to fgets::@return [phi:fgets::@17/fgets::@7->fgets::@return] + // [2726] phi fgets::return#1 = fgets::read#1 [phi:fgets::@17/fgets::@7->fgets::@return#0] -- register_copy rts // fgets::@16 __b16: // while ((__status == 0) && ((size && remaining) || !size)) - // [2355] if(0==fgets::size#11) goto fgets::@17 -- 0_eq_vwum1_then_la1 + // [2755] if(0==fgets::size#10) goto fgets::@17 -- 0_eq_vwum1_then_la1 lda size ora size+1 beq __b17 // fgets::@18 - // [2356] if(0!=fgets::remaining#1) goto fgets::@2 -- 0_neq_vwum1_then_la1 + // [2756] if(0!=fgets::remaining#1) goto fgets::@2 -- 0_neq_vwum1_then_la1 lda remaining ora remaining+1 beq !__b2+ @@ -15972,7 +18194,7 @@ fgets: { !__b2: // fgets::@17 __b17: - // [2357] if(0==fgets::size#11) goto fgets::@2 -- 0_eq_vwum1_then_la1 + // [2757] if(0==fgets::size#10) goto fgets::@2 -- 0_eq_vwum1_then_la1 lda size ora size+1 bne !__b2+ @@ -15982,114 +18204,100 @@ fgets: { // fgets::@4 __b4: // cx16_k_macptr(512, ptr) - // [2358] cx16_k_macptr::bytes = $200 -- vbum1=vwuc1 + // [2758] cx16_k_macptr::bytes = $200 -- vbum1=vwuc1 lda #<$200 sta cx16_k_macptr.bytes - // [2359] cx16_k_macptr::buffer = (void *)fgets::ptr#10 -- pvoz1=pvoz2 + // [2759] cx16_k_macptr::buffer = (void *)fgets::ptr#11 -- pvoz1=pvoz2 lda.z ptr sta.z cx16_k_macptr.buffer lda.z ptr+1 sta.z cx16_k_macptr.buffer+1 - // [2360] call cx16_k_macptr + // [2760] call cx16_k_macptr jsr cx16_k_macptr - // [2361] cx16_k_macptr::return#3 = cx16_k_macptr::return#1 + // [2761] cx16_k_macptr::return#3 = cx16_k_macptr::return#1 // fgets::@14 // bytes = cx16_k_macptr(512, ptr) - // [2362] fgets::bytes#2 = cx16_k_macptr::return#3 + // [2762] fgets::bytes#2 = cx16_k_macptr::return#3 jmp __b15 // fgets::@3 __b3: // cx16_k_macptr(0, ptr) - // [2363] cx16_k_macptr::bytes = 0 -- vbum1=vbuc1 + // [2763] cx16_k_macptr::bytes = 0 -- vbum1=vbuc1 lda #0 sta cx16_k_macptr.bytes - // [2364] cx16_k_macptr::buffer = (void *)fgets::ptr#10 -- pvoz1=pvoz2 + // [2764] cx16_k_macptr::buffer = (void *)fgets::ptr#11 -- pvoz1=pvoz2 lda.z ptr sta.z cx16_k_macptr.buffer lda.z ptr+1 sta.z cx16_k_macptr.buffer+1 - // [2365] call cx16_k_macptr + // [2765] call cx16_k_macptr jsr cx16_k_macptr - // [2366] cx16_k_macptr::return#2 = cx16_k_macptr::return#1 + // [2766] cx16_k_macptr::return#2 = cx16_k_macptr::return#1 // fgets::@13 // bytes = cx16_k_macptr(0, ptr) - // [2367] fgets::bytes#1 = cx16_k_macptr::return#2 + // [2767] fgets::bytes#1 = cx16_k_macptr::return#2 jmp __b15 .segment Data cbm_k_chkin1_channel: .byte 0 cbm_k_chkin1_status: .byte 0 cbm_k_readst1_status: .byte 0 cbm_k_readst2_status: .byte 0 - sp: .byte 0 - cbm_k_readst1_return: .byte 0 + .label sp = printf_uchar.format_min_length .label return = read bytes: .word 0 - cbm_k_readst2_return: .byte 0 read: .word 0 remaining: .word 0 - size: .word 0 + .label size = strncmp.n } .segment Code // rom_compare -// __zp($5e) unsigned int rom_compare(__zp($ac) char bank_ram, __zp($6d) char *ptr_ram, __zp($c3) unsigned long rom_compare_address, __zp($7e) unsigned int rom_compare_size) +// __zp($46) unsigned int rom_compare(__register(X) char bank_ram, __zp($53) char *ptr_ram, __zp($a9) unsigned long rom_compare_address, __zp($65) unsigned int rom_compare_size) rom_compare: { - .label rom_compare__5 = $29 - .label rom_bank1_rom_compare__0 = $75 - .label rom_bank1_rom_compare__1 = $76 - .label rom_bank1_rom_compare__2 = $60 - .label rom_ptr1_rom_compare__0 = $56 - .label rom_ptr1_rom_compare__2 = $56 - .label rom_bank1_bank_unshifted = $60 - .label rom_bank1_return = $44 - .label rom_ptr1_return = $56 - .label ptr_rom = $56 - .label ptr_ram = $6d - .label compared_bytes = $66 + .label rom_bank1_rom_compare__2 = $73 + .label rom_ptr1_rom_compare__0 = $40 + .label rom_ptr1_rom_compare__2 = $40 + .label rom_bank1_bank_unshifted = $73 + .label rom_ptr1_return = $40 + .label ptr_rom = $40 + .label ptr_ram = $53 + .label compared_bytes = $4e /// Holds the amount of bytes actually verified between the ROM and the RAM. - .label equal_bytes = $5e - .label bank_ram = $ac - .label rom_compare_address = $c3 - .label return = $5e - .label bank_ram_1 = $dc - .label rom_compare_size = $7e + .label equal_bytes = $46 + .label rom_compare_address = $a9 + .label return = $46 + .label rom_compare_size = $65 // rom_compare::bank_set_bram1 // BRAM = bank - // [2369] BRAM = rom_compare::bank_set_bram1_bank#0 -- vbuz1=vbum2 - lda bank_set_bram1_bank - sta.z BRAM + // [2769] BRAM = rom_compare::bank_set_bram1_bank#0 -- vbuz1=vbuxx + stx.z BRAM // rom_compare::rom_bank1 // BYTE2(address) - // [2370] rom_compare::rom_bank1_$0 = byte2 rom_compare::rom_compare_address#3 -- vbuz1=_byte2_vduz2 - lda.z rom_compare_address+2 - sta.z rom_bank1_rom_compare__0 + // [2770] rom_compare::rom_bank1_$0 = byte2 rom_compare::rom_compare_address#3 -- vbuxx=_byte2_vduz1 + ldx.z rom_compare_address+2 // BYTE1(address) - // [2371] rom_compare::rom_bank1_$1 = byte1 rom_compare::rom_compare_address#3 -- vbuz1=_byte1_vduz2 + // [2771] rom_compare::rom_bank1_$1 = byte1 rom_compare::rom_compare_address#3 -- vbuaa=_byte1_vduz1 lda.z rom_compare_address+1 - sta.z rom_bank1_rom_compare__1 // MAKEWORD(BYTE2(address),BYTE1(address)) - // [2372] rom_compare::rom_bank1_$2 = rom_compare::rom_bank1_$0 w= rom_compare::rom_bank1_$1 -- vwuz1=vbuz2_word_vbuz3 - lda.z rom_bank1_rom_compare__0 - sta.z rom_bank1_rom_compare__2+1 - lda.z rom_bank1_rom_compare__1 + // [2772] rom_compare::rom_bank1_$2 = rom_compare::rom_bank1_$0 w= rom_compare::rom_bank1_$1 -- vwuz1=vbuxx_word_vbuaa + stx.z rom_bank1_rom_compare__2+1 sta.z rom_bank1_rom_compare__2 // unsigned int bank_unshifted = MAKEWORD(BYTE2(address),BYTE1(address)) << 2 - // [2373] rom_compare::rom_bank1_bank_unshifted#0 = rom_compare::rom_bank1_$2 << 2 -- vwuz1=vwuz1_rol_2 + // [2773] rom_compare::rom_bank1_bank_unshifted#0 = rom_compare::rom_bank1_$2 << 2 -- vwuz1=vwuz1_rol_2 asl.z rom_bank1_bank_unshifted rol.z rom_bank1_bank_unshifted+1 asl.z rom_bank1_bank_unshifted rol.z rom_bank1_bank_unshifted+1 // unsigned char bank = BYTE1(bank_unshifted) - // [2374] rom_compare::rom_bank1_return#0 = byte1 rom_compare::rom_bank1_bank_unshifted#0 -- vbuz1=_byte1_vwuz2 - lda.z rom_bank1_bank_unshifted+1 - sta.z rom_bank1_return + // [2774] rom_compare::rom_bank1_return#0 = byte1 rom_compare::rom_bank1_bank_unshifted#0 -- vbuxx=_byte1_vwuz1 + ldx.z rom_bank1_bank_unshifted+1 // rom_compare::rom_ptr1 // (unsigned int)(address) & ROM_PTR_MASK - // [2375] rom_compare::rom_ptr1_$2 = (unsigned int)rom_compare::rom_compare_address#3 -- vwuz1=_word_vduz2 + // [2775] rom_compare::rom_ptr1_$2 = (unsigned int)rom_compare::rom_compare_address#3 -- vwuz1=_word_vduz2 lda.z rom_compare_address sta.z rom_ptr1_rom_compare__2 lda.z rom_compare_address+1 sta.z rom_ptr1_rom_compare__2+1 - // [2376] rom_compare::rom_ptr1_$0 = rom_compare::rom_ptr1_$2 & $3fff -- vwuz1=vwuz1_band_vwuc1 + // [2776] rom_compare::rom_ptr1_$0 = rom_compare::rom_ptr1_$2 & $3fff -- vwuz1=vwuz1_band_vwuc1 lda.z rom_ptr1_rom_compare__0 and #<$3fff sta.z rom_ptr1_rom_compare__0 @@ -16097,7 +18305,7 @@ rom_compare: { and #>$3fff sta.z rom_ptr1_rom_compare__0+1 // ((unsigned int)(address) & ROM_PTR_MASK) + ROM_BASE - // [2377] rom_compare::rom_ptr1_return#0 = rom_compare::rom_ptr1_$0 + $c000 -- vwuz1=vwuz1_plus_vwuc1 + // [2777] rom_compare::rom_ptr1_return#0 = rom_compare::rom_ptr1_$0 + $c000 -- vwuz1=vwuz1_plus_vwuc1 lda.z rom_ptr1_return clc adc #<$c000 @@ -16107,24 +18315,23 @@ rom_compare: { sta.z rom_ptr1_return+1 // rom_compare::bank_set_brom1 // BROM = bank - // [2378] BROM = rom_compare::rom_bank1_return#0 -- vbuz1=vbuz2 - lda.z rom_bank1_return - sta.z BROM - // [2379] rom_compare::ptr_rom#9 = (char *)rom_compare::rom_ptr1_return#0 - // [2380] phi from rom_compare::bank_set_brom1 to rom_compare::@1 [phi:rom_compare::bank_set_brom1->rom_compare::@1] - // [2380] phi rom_compare::equal_bytes#2 = 0 [phi:rom_compare::bank_set_brom1->rom_compare::@1#0] -- vwuz1=vwuc1 + // [2778] BROM = rom_compare::rom_bank1_return#0 -- vbuz1=vbuxx + stx.z BROM + // [2779] rom_compare::ptr_rom#9 = (char *)rom_compare::rom_ptr1_return#0 + // [2780] phi from rom_compare::bank_set_brom1 to rom_compare::@1 [phi:rom_compare::bank_set_brom1->rom_compare::@1] + // [2780] phi rom_compare::equal_bytes#2 = 0 [phi:rom_compare::bank_set_brom1->rom_compare::@1#0] -- vwuz1=vwuc1 lda #<0 sta.z equal_bytes sta.z equal_bytes+1 - // [2380] phi rom_compare::ptr_ram#4 = rom_compare::ptr_ram#10 [phi:rom_compare::bank_set_brom1->rom_compare::@1#1] -- register_copy - // [2380] phi rom_compare::ptr_rom#2 = rom_compare::ptr_rom#9 [phi:rom_compare::bank_set_brom1->rom_compare::@1#2] -- register_copy - // [2380] phi rom_compare::compared_bytes#2 = 0 [phi:rom_compare::bank_set_brom1->rom_compare::@1#3] -- vwuz1=vwuc1 + // [2780] phi rom_compare::ptr_ram#4 = rom_compare::ptr_ram#10 [phi:rom_compare::bank_set_brom1->rom_compare::@1#1] -- register_copy + // [2780] phi rom_compare::ptr_rom#2 = rom_compare::ptr_rom#9 [phi:rom_compare::bank_set_brom1->rom_compare::@1#2] -- register_copy + // [2780] phi rom_compare::compared_bytes#2 = 0 [phi:rom_compare::bank_set_brom1->rom_compare::@1#3] -- vwuz1=vwuc1 sta.z compared_bytes sta.z compared_bytes+1 // rom_compare::@1 __b1: // while (compared_bytes < rom_compare_size) - // [2381] if(rom_compare::compared_bytes#2rom_compare::@3] - // [2390] phi rom_compare::equal_bytes#6 = rom_compare::equal_bytes#1 [phi:rom_compare::@4/rom_compare::@5->rom_compare::@3#0] -- register_copy + // [2790] phi from rom_compare::@4 rom_compare::@5 to rom_compare::@3 [phi:rom_compare::@4/rom_compare::@5->rom_compare::@3] + // [2790] phi rom_compare::equal_bytes#6 = rom_compare::equal_bytes#1 [phi:rom_compare::@4/rom_compare::@5->rom_compare::@3#0] -- register_copy // rom_compare::@3 __b3: // ptr_rom++; - // [2391] rom_compare::ptr_rom#1 = ++ rom_compare::ptr_rom#2 -- pbuz1=_inc_pbuz1 + // [2791] rom_compare::ptr_rom#1 = ++ rom_compare::ptr_rom#2 -- pbuz1=_inc_pbuz1 inc.z ptr_rom bne !+ inc.z ptr_rom+1 !: // ptr_ram++; - // [2392] rom_compare::ptr_ram#0 = ++ rom_compare::ptr_ram#4 -- pbuz1=_inc_pbuz1 + // [2792] rom_compare::ptr_ram#0 = ++ rom_compare::ptr_ram#4 -- pbuz1=_inc_pbuz1 inc.z ptr_ram bne !+ inc.z ptr_ram+1 !: // compared_bytes++; - // [2393] rom_compare::compared_bytes#1 = ++ rom_compare::compared_bytes#2 -- vwuz1=_inc_vwuz1 + // [2793] rom_compare::compared_bytes#1 = ++ rom_compare::compared_bytes#2 -- vwuz1=_inc_vwuz1 inc.z compared_bytes bne !+ inc.z compared_bytes+1 !: - // [2380] phi from rom_compare::@3 to rom_compare::@1 [phi:rom_compare::@3->rom_compare::@1] - // [2380] phi rom_compare::equal_bytes#2 = rom_compare::equal_bytes#6 [phi:rom_compare::@3->rom_compare::@1#0] -- register_copy - // [2380] phi rom_compare::ptr_ram#4 = rom_compare::ptr_ram#0 [phi:rom_compare::@3->rom_compare::@1#1] -- register_copy - // [2380] phi rom_compare::ptr_rom#2 = rom_compare::ptr_rom#1 [phi:rom_compare::@3->rom_compare::@1#2] -- register_copy - // [2380] phi rom_compare::compared_bytes#2 = rom_compare::compared_bytes#1 [phi:rom_compare::@3->rom_compare::@1#3] -- register_copy + // [2780] phi from rom_compare::@3 to rom_compare::@1 [phi:rom_compare::@3->rom_compare::@1] + // [2780] phi rom_compare::equal_bytes#2 = rom_compare::equal_bytes#6 [phi:rom_compare::@3->rom_compare::@1#0] -- register_copy + // [2780] phi rom_compare::ptr_ram#4 = rom_compare::ptr_ram#0 [phi:rom_compare::@3->rom_compare::@1#1] -- register_copy + // [2780] phi rom_compare::ptr_rom#2 = rom_compare::ptr_rom#1 [phi:rom_compare::@3->rom_compare::@1#2] -- register_copy + // [2780] phi rom_compare::compared_bytes#2 = rom_compare::compared_bytes#1 [phi:rom_compare::@3->rom_compare::@1#3] -- register_copy jmp __b1 - .segment Data - bank_set_bram1_bank: .byte 0 } -.segment Code // ultoa // Converts unsigned number value to a string representing it in RADIX format. // If the leading digits are zero they are not included in the string. // - value : The number to be converted to RADIX // - buffer : receives the string representing the number and zero-termination. // - radix : The radix to convert the number to (from the enum RADIX) -// void ultoa(__mem() unsigned long value, __zp($3d) char *buffer, __mem() char radix) +// void ultoa(__mem() unsigned long value, __zp($2a) char *buffer, __register(X) char radix) ultoa: { - .label ultoa__4 = $44 - .label ultoa__10 = $38 - .label ultoa__11 = $51 - .label buffer = $3d - .label digit_values = $58 + .label buffer = $2a + .label digit_values = $3a // if(radix==DECIMAL) - // [2394] if(ultoa::radix#0==DECIMAL) goto ultoa::@1 -- vbum1_eq_vbuc1_then_la1 - lda #DECIMAL - cmp radix + // [2794] if(ultoa::radix#0==DECIMAL) goto ultoa::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #DECIMAL beq __b2 // ultoa::@2 // if(radix==HEXADECIMAL) - // [2395] if(ultoa::radix#0==HEXADECIMAL) goto ultoa::@1 -- vbum1_eq_vbuc1_then_la1 - lda #HEXADECIMAL - cmp radix + // [2795] if(ultoa::radix#0==HEXADECIMAL) goto ultoa::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #HEXADECIMAL beq __b3 // ultoa::@3 // if(radix==OCTAL) - // [2396] if(ultoa::radix#0==OCTAL) goto ultoa::@1 -- vbum1_eq_vbuc1_then_la1 - lda #OCTAL - cmp radix + // [2796] if(ultoa::radix#0==OCTAL) goto ultoa::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #OCTAL beq __b4 // ultoa::@4 // if(radix==BINARY) - // [2397] if(ultoa::radix#0==BINARY) goto ultoa::@1 -- vbum1_eq_vbuc1_then_la1 - lda #BINARY - cmp radix + // [2797] if(ultoa::radix#0==BINARY) goto ultoa::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #BINARY beq __b5 // ultoa::@5 // *buffer++ = 'e' - // [2398] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS) = 'e' -- _deref_pbuc1=vbuc2 + // [2798] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS) = 'e' -- _deref_pbuc1=vbuc2 // Unknown radix lda #'e' sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS // *buffer++ = 'r' - // [2399] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1) = 'r' -- _deref_pbuc1=vbuc2 + // [2799] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1) = 'r' -- _deref_pbuc1=vbuc2 lda #'r' sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1 - // [2400] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2) = 'r' -- _deref_pbuc1=vbuc2 + // [2800] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2) = 'r' -- _deref_pbuc1=vbuc2 sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2 // *buffer = 0 - // [2401] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3) = 0 -- _deref_pbuc1=vbuc2 + // [2801] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3) = 0 -- _deref_pbuc1=vbuc2 lda #0 sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3 // ultoa::@return // } - // [2402] return + // [2802] return rts - // [2403] phi from ultoa to ultoa::@1 [phi:ultoa->ultoa::@1] + // [2803] phi from ultoa to ultoa::@1 [phi:ultoa->ultoa::@1] __b2: - // [2403] phi ultoa::digit_values#8 = RADIX_DECIMAL_VALUES_LONG [phi:ultoa->ultoa::@1#0] -- pduz1=pduc1 + // [2803] phi ultoa::digit_values#8 = RADIX_DECIMAL_VALUES_LONG [phi:ultoa->ultoa::@1#0] -- pduz1=pduc1 lda #RADIX_DECIMAL_VALUES_LONG sta.z digit_values+1 - // [2403] phi ultoa::max_digits#7 = $a [phi:ultoa->ultoa::@1#1] -- vbum1=vbuc1 + // [2803] phi ultoa::max_digits#7 = $a [phi:ultoa->ultoa::@1#1] -- vbum1=vbuc1 lda #$a sta max_digits jmp __b1 - // [2403] phi from ultoa::@2 to ultoa::@1 [phi:ultoa::@2->ultoa::@1] + // [2803] phi from ultoa::@2 to ultoa::@1 [phi:ultoa::@2->ultoa::@1] __b3: - // [2403] phi ultoa::digit_values#8 = RADIX_HEXADECIMAL_VALUES_LONG [phi:ultoa::@2->ultoa::@1#0] -- pduz1=pduc1 + // [2803] phi ultoa::digit_values#8 = RADIX_HEXADECIMAL_VALUES_LONG [phi:ultoa::@2->ultoa::@1#0] -- pduz1=pduc1 lda #RADIX_HEXADECIMAL_VALUES_LONG sta.z digit_values+1 - // [2403] phi ultoa::max_digits#7 = 8 [phi:ultoa::@2->ultoa::@1#1] -- vbum1=vbuc1 + // [2803] phi ultoa::max_digits#7 = 8 [phi:ultoa::@2->ultoa::@1#1] -- vbum1=vbuc1 lda #8 sta max_digits jmp __b1 - // [2403] phi from ultoa::@3 to ultoa::@1 [phi:ultoa::@3->ultoa::@1] + // [2803] phi from ultoa::@3 to ultoa::@1 [phi:ultoa::@3->ultoa::@1] __b4: - // [2403] phi ultoa::digit_values#8 = RADIX_OCTAL_VALUES_LONG [phi:ultoa::@3->ultoa::@1#0] -- pduz1=pduc1 + // [2803] phi ultoa::digit_values#8 = RADIX_OCTAL_VALUES_LONG [phi:ultoa::@3->ultoa::@1#0] -- pduz1=pduc1 lda #RADIX_OCTAL_VALUES_LONG sta.z digit_values+1 - // [2403] phi ultoa::max_digits#7 = $b [phi:ultoa::@3->ultoa::@1#1] -- vbum1=vbuc1 + // [2803] phi ultoa::max_digits#7 = $b [phi:ultoa::@3->ultoa::@1#1] -- vbum1=vbuc1 lda #$b sta max_digits jmp __b1 - // [2403] phi from ultoa::@4 to ultoa::@1 [phi:ultoa::@4->ultoa::@1] + // [2803] phi from ultoa::@4 to ultoa::@1 [phi:ultoa::@4->ultoa::@1] __b5: - // [2403] phi ultoa::digit_values#8 = RADIX_BINARY_VALUES_LONG [phi:ultoa::@4->ultoa::@1#0] -- pduz1=pduc1 + // [2803] phi ultoa::digit_values#8 = RADIX_BINARY_VALUES_LONG [phi:ultoa::@4->ultoa::@1#0] -- pduz1=pduc1 lda #RADIX_BINARY_VALUES_LONG sta.z digit_values+1 - // [2403] phi ultoa::max_digits#7 = $20 [phi:ultoa::@4->ultoa::@1#1] -- vbum1=vbuc1 + // [2803] phi ultoa::max_digits#7 = $20 [phi:ultoa::@4->ultoa::@1#1] -- vbum1=vbuc1 lda #$20 sta max_digits // ultoa::@1 __b1: - // [2404] phi from ultoa::@1 to ultoa::@6 [phi:ultoa::@1->ultoa::@6] - // [2404] phi ultoa::buffer#11 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:ultoa::@1->ultoa::@6#0] -- pbuz1=pbuc1 + // [2804] phi from ultoa::@1 to ultoa::@6 [phi:ultoa::@1->ultoa::@6] + // [2804] phi ultoa::buffer#11 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:ultoa::@1->ultoa::@6#0] -- pbuz1=pbuc1 lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS sta.z buffer+1 - // [2404] phi ultoa::started#2 = 0 [phi:ultoa::@1->ultoa::@6#1] -- vbum1=vbuc1 - lda #0 - sta started - // [2404] phi ultoa::value#2 = ultoa::value#1 [phi:ultoa::@1->ultoa::@6#2] -- register_copy - // [2404] phi ultoa::digit#2 = 0 [phi:ultoa::@1->ultoa::@6#3] -- vbum1=vbuc1 + // [2804] phi ultoa::started#2 = 0 [phi:ultoa::@1->ultoa::@6#1] -- vbuxx=vbuc1 + ldx #0 + // [2804] phi ultoa::value#2 = ultoa::value#1 [phi:ultoa::@1->ultoa::@6#2] -- register_copy + // [2804] phi ultoa::digit#2 = 0 [phi:ultoa::@1->ultoa::@6#3] -- vbum1=vbuc1 + txa sta digit // ultoa::@6 __b6: // max_digits-1 - // [2405] ultoa::$4 = ultoa::max_digits#7 - 1 -- vbuz1=vbum2_minus_1 - ldx max_digits - dex - stx.z ultoa__4 + // [2805] ultoa::$4 = ultoa::max_digits#7 - 1 -- vbuaa=vbum1_minus_1 + lda max_digits + sec + sbc #1 // for( char digit=0; digit= digit_value) - // [2413] if(0!=ultoa::started#2) goto ultoa::@10 -- 0_neq_vbum1_then_la1 - lda started + // [2813] if(0!=ultoa::started#2) goto ultoa::@10 -- 0_neq_vbuxx_then_la1 + cpx #0 bne __b10 // ultoa::@12 - // [2414] if(ultoa::value#2>=ultoa::digit_value#0) goto ultoa::@10 -- vdum1_ge_vdum2_then_la1 + // [2814] if(ultoa::value#2>=ultoa::digit_value#0) goto ultoa::@10 -- vdum1_ge_vdum2_then_la1 lda value+3 cmp digit_value+3 bcc !+ @@ -16383,86 +18578,82 @@ ultoa: { cmp digit_value bcs __b10 !: - // [2415] phi from ultoa::@12 to ultoa::@9 [phi:ultoa::@12->ultoa::@9] - // [2415] phi ultoa::buffer#14 = ultoa::buffer#11 [phi:ultoa::@12->ultoa::@9#0] -- register_copy - // [2415] phi ultoa::started#4 = ultoa::started#2 [phi:ultoa::@12->ultoa::@9#1] -- register_copy - // [2415] phi ultoa::value#6 = ultoa::value#2 [phi:ultoa::@12->ultoa::@9#2] -- register_copy + // [2815] phi from ultoa::@12 to ultoa::@9 [phi:ultoa::@12->ultoa::@9] + // [2815] phi ultoa::buffer#14 = ultoa::buffer#11 [phi:ultoa::@12->ultoa::@9#0] -- register_copy + // [2815] phi ultoa::started#4 = ultoa::started#2 [phi:ultoa::@12->ultoa::@9#1] -- register_copy + // [2815] phi ultoa::value#6 = ultoa::value#2 [phi:ultoa::@12->ultoa::@9#2] -- register_copy // ultoa::@9 __b9: // for( char digit=0; digitultoa::@6] - // [2404] phi ultoa::buffer#11 = ultoa::buffer#14 [phi:ultoa::@9->ultoa::@6#0] -- register_copy - // [2404] phi ultoa::started#2 = ultoa::started#4 [phi:ultoa::@9->ultoa::@6#1] -- register_copy - // [2404] phi ultoa::value#2 = ultoa::value#6 [phi:ultoa::@9->ultoa::@6#2] -- register_copy - // [2404] phi ultoa::digit#2 = ultoa::digit#1 [phi:ultoa::@9->ultoa::@6#3] -- register_copy + // [2804] phi from ultoa::@9 to ultoa::@6 [phi:ultoa::@9->ultoa::@6] + // [2804] phi ultoa::buffer#11 = ultoa::buffer#14 [phi:ultoa::@9->ultoa::@6#0] -- register_copy + // [2804] phi ultoa::started#2 = ultoa::started#4 [phi:ultoa::@9->ultoa::@6#1] -- register_copy + // [2804] phi ultoa::value#2 = ultoa::value#6 [phi:ultoa::@9->ultoa::@6#2] -- register_copy + // [2804] phi ultoa::digit#2 = ultoa::digit#1 [phi:ultoa::@9->ultoa::@6#3] -- register_copy jmp __b6 // ultoa::@10 __b10: // ultoa_append(buffer++, value, digit_value) - // [2417] ultoa_append::buffer#0 = ultoa::buffer#11 -- pbuz1=pbuz2 + // [2817] ultoa_append::buffer#0 = ultoa::buffer#11 -- pbuz1=pbuz2 lda.z buffer sta.z ultoa_append.buffer lda.z buffer+1 sta.z ultoa_append.buffer+1 - // [2418] ultoa_append::value#0 = ultoa::value#2 - // [2419] ultoa_append::sub#0 = ultoa::digit_value#0 - // [2420] call ultoa_append - // [2903] phi from ultoa::@10 to ultoa_append [phi:ultoa::@10->ultoa_append] + // [2818] ultoa_append::value#0 = ultoa::value#2 + // [2819] ultoa_append::sub#0 = ultoa::digit_value#0 + // [2820] call ultoa_append + // [3401] phi from ultoa::@10 to ultoa_append [phi:ultoa::@10->ultoa_append] jsr ultoa_append // ultoa_append(buffer++, value, digit_value) - // [2421] ultoa_append::return#0 = ultoa_append::value#2 + // [2821] ultoa_append::return#0 = ultoa_append::value#2 // ultoa::@11 // value = ultoa_append(buffer++, value, digit_value) - // [2422] ultoa::value#0 = ultoa_append::return#0 + // [2822] ultoa::value#0 = ultoa_append::return#0 // value = ultoa_append(buffer++, value, digit_value); - // [2423] ultoa::buffer#4 = ++ ultoa::buffer#11 -- pbuz1=_inc_pbuz1 + // [2823] ultoa::buffer#4 = ++ ultoa::buffer#11 -- pbuz1=_inc_pbuz1 inc.z buffer bne !+ inc.z buffer+1 !: - // [2415] phi from ultoa::@11 to ultoa::@9 [phi:ultoa::@11->ultoa::@9] - // [2415] phi ultoa::buffer#14 = ultoa::buffer#4 [phi:ultoa::@11->ultoa::@9#0] -- register_copy - // [2415] phi ultoa::started#4 = 1 [phi:ultoa::@11->ultoa::@9#1] -- vbum1=vbuc1 - lda #1 - sta started - // [2415] phi ultoa::value#6 = ultoa::value#0 [phi:ultoa::@11->ultoa::@9#2] -- register_copy + // [2815] phi from ultoa::@11 to ultoa::@9 [phi:ultoa::@11->ultoa::@9] + // [2815] phi ultoa::buffer#14 = ultoa::buffer#4 [phi:ultoa::@11->ultoa::@9#0] -- register_copy + // [2815] phi ultoa::started#4 = 1 [phi:ultoa::@11->ultoa::@9#1] -- vbuxx=vbuc1 + ldx #1 + // [2815] phi ultoa::value#6 = ultoa::value#0 [phi:ultoa::@11->ultoa::@9#2] -- register_copy jmp __b9 .segment Data digit_value: .dword 0 - digit: .byte 0 + .label digit = uctoa.digit .label value = printf_ulong.uvalue - .label radix = printf_ulong.format_radix - started: .byte 0 - max_digits: .byte 0 + .label max_digits = printf_string.format_justify_left } .segment Code // display_action_text_flashed -// void display_action_text_flashed(__zp($e3) unsigned long bytes, __zp($3f) char *chip) +// void display_action_text_flashed(__mem() unsigned long bytes, __zp($d0) char *chip) display_action_text_flashed: { - .label bytes = $e3 - .label chip = $3f + .label chip = $d0 // sprintf(info_text, "Flashed %u bytes from RAM -> %s ... ", bytes, chip) - // [2425] call snprintf_init - // [1113] phi from display_action_text_flashed to snprintf_init [phi:display_action_text_flashed->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:display_action_text_flashed->snprintf_init#0] -- pbuz1=pbuc1 + // [2825] call snprintf_init + // [1184] phi from display_action_text_flashed to snprintf_init [phi:display_action_text_flashed->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:display_action_text_flashed->snprintf_init#0] -- pbuz1=pbuc1 lda #info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [2426] phi from display_action_text_flashed to display_action_text_flashed::@1 [phi:display_action_text_flashed->display_action_text_flashed::@1] + // [2826] phi from display_action_text_flashed to display_action_text_flashed::@1 [phi:display_action_text_flashed->display_action_text_flashed::@1] // display_action_text_flashed::@1 // sprintf(info_text, "Flashed %u bytes from RAM -> %s ... ", bytes, chip) - // [2427] call printf_str - // [1054] phi from display_action_text_flashed::@1 to printf_str [phi:display_action_text_flashed::@1->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:display_action_text_flashed::@1->printf_str#0] -- pprz1=pprc1 + // [2827] call printf_str + // [1125] phi from display_action_text_flashed::@1 to printf_str [phi:display_action_text_flashed::@1->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:display_action_text_flashed::@1->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = display_action_text_flashed::s [phi:display_action_text_flashed::@1->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = display_action_text_flashed::s [phi:display_action_text_flashed::@1->printf_str#1] -- pbuz1=pbuc1 lda #s @@ -16470,38 +18661,37 @@ display_action_text_flashed: { jsr printf_str // display_action_text_flashed::@2 // sprintf(info_text, "Flashed %u bytes from RAM -> %s ... ", bytes, chip) - // [2428] printf_ulong::uvalue#2 = display_action_text_flashed::bytes#2 -- vdum1=vduz2 - lda.z bytes + // [2828] printf_ulong::uvalue#2 = display_action_text_flashed::bytes#3 -- vdum1=vdum2 + lda bytes sta printf_ulong.uvalue - lda.z bytes+1 + lda bytes+1 sta printf_ulong.uvalue+1 - lda.z bytes+2 + lda bytes+2 sta printf_ulong.uvalue+2 - lda.z bytes+3 + lda bytes+3 sta printf_ulong.uvalue+3 - // [2429] call printf_ulong - // [1396] phi from display_action_text_flashed::@2 to printf_ulong [phi:display_action_text_flashed::@2->printf_ulong] - // [1396] phi printf_ulong::format_zero_padding#10 = 0 [phi:display_action_text_flashed::@2->printf_ulong#0] -- vbum1=vbuc1 + // [2829] call printf_ulong + // [1588] phi from display_action_text_flashed::@2 to printf_ulong [phi:display_action_text_flashed::@2->printf_ulong] + // [1588] phi printf_ulong::format_zero_padding#14 = 0 [phi:display_action_text_flashed::@2->printf_ulong#0] -- vbum1=vbuc1 lda #0 sta printf_ulong.format_zero_padding - // [1396] phi printf_ulong::format_min_length#10 = 0 [phi:display_action_text_flashed::@2->printf_ulong#1] -- vbum1=vbuc1 + // [1588] phi printf_ulong::format_min_length#14 = 0 [phi:display_action_text_flashed::@2->printf_ulong#1] -- vbum1=vbuc1 sta printf_ulong.format_min_length - // [1396] phi printf_ulong::format_radix#10 = DECIMAL [phi:display_action_text_flashed::@2->printf_ulong#2] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_ulong.format_radix - // [1396] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#2 [phi:display_action_text_flashed::@2->printf_ulong#3] -- register_copy + // [1588] phi printf_ulong::format_radix#14 = DECIMAL [phi:display_action_text_flashed::@2->printf_ulong#2] -- vbuxx=vbuc1 + ldx #DECIMAL + // [1588] phi printf_ulong::uvalue#14 = printf_ulong::uvalue#2 [phi:display_action_text_flashed::@2->printf_ulong#3] -- register_copy jsr printf_ulong - // [2430] phi from display_action_text_flashed::@2 to display_action_text_flashed::@3 [phi:display_action_text_flashed::@2->display_action_text_flashed::@3] + // [2830] phi from display_action_text_flashed::@2 to display_action_text_flashed::@3 [phi:display_action_text_flashed::@2->display_action_text_flashed::@3] // display_action_text_flashed::@3 // sprintf(info_text, "Flashed %u bytes from RAM -> %s ... ", bytes, chip) - // [2431] call printf_str - // [1054] phi from display_action_text_flashed::@3 to printf_str [phi:display_action_text_flashed::@3->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:display_action_text_flashed::@3->printf_str#0] -- pprz1=pprc1 + // [2831] call printf_str + // [1125] phi from display_action_text_flashed::@3 to printf_str [phi:display_action_text_flashed::@3->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:display_action_text_flashed::@3->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = display_action_text_flashed::s1 [phi:display_action_text_flashed::@3->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = display_action_text_flashed::s1 [phi:display_action_text_flashed::@3->printf_str#1] -- pbuz1=pbuc1 lda #s1 @@ -16509,36 +18699,36 @@ display_action_text_flashed: { jsr printf_str // display_action_text_flashed::@4 // sprintf(info_text, "Flashed %u bytes from RAM -> %s ... ", bytes, chip) - // [2432] printf_string::str#13 = display_action_text_flashed::chip#2 -- pbuz1=pbuz2 + // [2832] printf_string::str#13 = display_action_text_flashed::chip#3 -- pbuz1=pbuz2 lda.z chip sta.z printf_string.str lda.z chip+1 sta.z printf_string.str+1 - // [2433] call printf_string - // [1227] phi from display_action_text_flashed::@4 to printf_string [phi:display_action_text_flashed::@4->printf_string] - // [1227] phi printf_string::putc#25 = &snputc [phi:display_action_text_flashed::@4->printf_string#0] -- pprz1=pprc1 + // [2833] call printf_string + // [1419] phi from display_action_text_flashed::@4 to printf_string [phi:display_action_text_flashed::@4->printf_string] + // [1419] phi printf_string::putc#26 = &snputc [phi:display_action_text_flashed::@4->printf_string#0] -- pprz1=pprc1 lda #snputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#13 [phi:display_action_text_flashed::@4->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 0 [phi:display_action_text_flashed::@4->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#13 [phi:display_action_text_flashed::@4->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 0 [phi:display_action_text_flashed::@4->printf_string#2] -- vbum1=vbuc1 lda #0 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 0 [phi:display_action_text_flashed::@4->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 0 [phi:display_action_text_flashed::@4->printf_string#3] -- vbum1=vbuc1 sta printf_string.format_min_length jsr printf_string - // [2434] phi from display_action_text_flashed::@4 to display_action_text_flashed::@5 [phi:display_action_text_flashed::@4->display_action_text_flashed::@5] + // [2834] phi from display_action_text_flashed::@4 to display_action_text_flashed::@5 [phi:display_action_text_flashed::@4->display_action_text_flashed::@5] // display_action_text_flashed::@5 // sprintf(info_text, "Flashed %u bytes from RAM -> %s ... ", bytes, chip) - // [2435] call printf_str - // [1054] phi from display_action_text_flashed::@5 to printf_str [phi:display_action_text_flashed::@5->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:display_action_text_flashed::@5->printf_str#0] -- pprz1=pprc1 + // [2835] call printf_str + // [1125] phi from display_action_text_flashed::@5 to printf_str [phi:display_action_text_flashed::@5->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:display_action_text_flashed::@5->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s5 [phi:display_action_text_flashed::@5->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s5 [phi:display_action_text_flashed::@5->printf_str#1] -- pbuz1=pbuc1 lda #s5 @@ -16546,17 +18736,17 @@ display_action_text_flashed: { jsr printf_str // display_action_text_flashed::@6 // sprintf(info_text, "Flashed %u bytes from RAM -> %s ... ", bytes, chip) - // [2436] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [2836] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [2437] callexecute snputc -- call_vprc1 + // [2837] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [2439] call display_action_text - // [1129] phi from display_action_text_flashed::@6 to display_action_text [phi:display_action_text_flashed::@6->display_action_text] - // [1129] phi display_action_text::info_text#17 = info_text [phi:display_action_text_flashed::@6->display_action_text#0] -- pbuz1=pbuc1 + // [2839] call display_action_text + // [1200] phi from display_action_text_flashed::@6 to display_action_text [phi:display_action_text_flashed::@6->display_action_text] + // [1200] phi display_action_text::info_text#25 = info_text [phi:display_action_text_flashed::@6->display_action_text#0] -- pbuz1=pbuc1 lda #info_text @@ -16564,13 +18754,83 @@ display_action_text_flashed: { jsr display_action_text // display_action_text_flashed::@return // } - // [2440] return + // [2840] return rts .segment Data s: .text "Flashed " .byte 0 s1: .text " bytes from RAM -> " .byte 0 + .label bytes = w25q16_flash.w25q16_flash__21 +} +.segment Code + // get_info_text_flashing +// char * get_info_text_flashing(__zp($f6) unsigned long flash_bytes) +get_info_text_flashing: { + .label flash_bytes = $f6 + // sprintf(info_text, "%u bytes flashed", flash_bytes) + // [2842] call snprintf_init + // [1184] phi from get_info_text_flashing to snprintf_init [phi:get_info_text_flashing->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:get_info_text_flashing->snprintf_init#0] -- pbuz1=pbuc1 + lda #info_text + sta.z snprintf_init.s+1 + jsr snprintf_init + // get_info_text_flashing::@1 + // sprintf(info_text, "%u bytes flashed", flash_bytes) + // [2843] printf_ulong::uvalue#5 = get_info_text_flashing::flash_bytes#3 -- vdum1=vduz2 + lda.z flash_bytes + sta printf_ulong.uvalue + lda.z flash_bytes+1 + sta printf_ulong.uvalue+1 + lda.z flash_bytes+2 + sta printf_ulong.uvalue+2 + lda.z flash_bytes+3 + sta printf_ulong.uvalue+3 + // [2844] call printf_ulong + // [1588] phi from get_info_text_flashing::@1 to printf_ulong [phi:get_info_text_flashing::@1->printf_ulong] + // [1588] phi printf_ulong::format_zero_padding#14 = 0 [phi:get_info_text_flashing::@1->printf_ulong#0] -- vbum1=vbuc1 + lda #0 + sta printf_ulong.format_zero_padding + // [1588] phi printf_ulong::format_min_length#14 = 0 [phi:get_info_text_flashing::@1->printf_ulong#1] -- vbum1=vbuc1 + sta printf_ulong.format_min_length + // [1588] phi printf_ulong::format_radix#14 = DECIMAL [phi:get_info_text_flashing::@1->printf_ulong#2] -- vbuxx=vbuc1 + ldx #DECIMAL + // [1588] phi printf_ulong::uvalue#14 = printf_ulong::uvalue#5 [phi:get_info_text_flashing::@1->printf_ulong#3] -- register_copy + jsr printf_ulong + // [2845] phi from get_info_text_flashing::@1 to get_info_text_flashing::@2 [phi:get_info_text_flashing::@1->get_info_text_flashing::@2] + // get_info_text_flashing::@2 + // sprintf(info_text, "%u bytes flashed", flash_bytes) + // [2846] call printf_str + // [1125] phi from get_info_text_flashing::@2 to printf_str [phi:get_info_text_flashing::@2->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:get_info_text_flashing::@2->printf_str#0] -- pprz1=pprc1 + lda #snputc + sta.z printf_str.putc+1 + // [1125] phi printf_str::s#79 = get_info_text_flashing::s [phi:get_info_text_flashing::@2->printf_str#1] -- pbuz1=pbuc1 + lda #s + sta.z printf_str.s+1 + jsr printf_str + // get_info_text_flashing::@3 + // sprintf(info_text, "%u bytes flashed", flash_bytes) + // [2847] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + lda #0 + pha + // [2848] callexecute snputc -- call_vprc1 + jsr snputc + // sideeffect stackpullpadding(1) -- _stackpullpadding_1 + pla + // get_info_text_flashing::@return + // } + // [2850] return + rts + .segment Data + s: .text " bytes flashed" + .byte 0 } .segment Code // rom_sector_erase @@ -16603,21 +18863,21 @@ display_action_text_flashed: { * @param address The 22 bit ROM address. */ /* inline */ -// void rom_sector_erase(__zp($e3) unsigned long address) +// void rom_sector_erase(__zp($d4) unsigned long address) rom_sector_erase: { - .label rom_ptr1_rom_sector_erase__0 = $2d - .label rom_ptr1_rom_sector_erase__2 = $2d - .label rom_ptr1_return = $2d - .label rom_chip_address = $5a - .label address = $e3 + .label rom_ptr1_rom_sector_erase__0 = $23 + .label rom_ptr1_rom_sector_erase__2 = $23 + .label rom_ptr1_return = $23 + .label rom_chip_address = $42 + .label address = $d4 // rom_sector_erase::rom_ptr1 // (unsigned int)(address) & ROM_PTR_MASK - // [2442] rom_sector_erase::rom_ptr1_$2 = (unsigned int)rom_sector_erase::address#0 -- vwuz1=_word_vduz2 + // [2852] rom_sector_erase::rom_ptr1_$2 = (unsigned int)rom_sector_erase::address#0 -- vwuz1=_word_vduz2 lda.z address sta.z rom_ptr1_rom_sector_erase__2 lda.z address+1 sta.z rom_ptr1_rom_sector_erase__2+1 - // [2443] rom_sector_erase::rom_ptr1_$0 = rom_sector_erase::rom_ptr1_$2 & $3fff -- vwuz1=vwuz1_band_vwuc1 + // [2853] rom_sector_erase::rom_ptr1_$0 = rom_sector_erase::rom_ptr1_$2 & $3fff -- vwuz1=vwuz1_band_vwuc1 lda.z rom_ptr1_rom_sector_erase__0 and #<$3fff sta.z rom_ptr1_rom_sector_erase__0 @@ -16625,7 +18885,7 @@ rom_sector_erase: { and #>$3fff sta.z rom_ptr1_rom_sector_erase__0+1 // ((unsigned int)(address) & ROM_PTR_MASK) + ROM_BASE - // [2444] rom_sector_erase::rom_ptr1_return#0 = rom_sector_erase::rom_ptr1_$0 + $c000 -- vwuz1=vwuz1_plus_vwuc1 + // [2854] rom_sector_erase::rom_ptr1_return#0 = rom_sector_erase::rom_ptr1_$0 + $c000 -- vwuz1=vwuz1_plus_vwuc1 lda.z rom_ptr1_return clc adc #<$c000 @@ -16635,7 +18895,7 @@ rom_sector_erase: { sta.z rom_ptr1_return+1 // rom_sector_erase::@1 // unsigned long rom_chip_address = address & ROM_CHIP_MASK - // [2445] rom_sector_erase::rom_chip_address#0 = rom_sector_erase::address#0 & $380000 -- vduz1=vduz2_band_vduc1 + // [2855] rom_sector_erase::rom_chip_address#0 = rom_sector_erase::address#0 & $380000 -- vduz1=vduz2_band_vduc1 lda.z address and #<$380000 sta.z rom_chip_address @@ -16649,7 +18909,7 @@ rom_sector_erase: { and #>$380000>>$10 sta.z rom_chip_address+3 // rom_unlock(rom_chip_address + 0x05555, 0x80) - // [2446] rom_unlock::address#0 = rom_sector_erase::rom_chip_address#0 + $5555 -- vduz1=vduz1_plus_vwuc1 + // [2856] rom_unlock::address#0 = rom_sector_erase::rom_chip_address#0 + $5555 -- vduz1=vduz1_plus_vwuc1 clc lda.z rom_unlock.address adc #<$5555 @@ -16663,16 +18923,16 @@ rom_sector_erase: { lda.z rom_unlock.address+3 adc #0 sta.z rom_unlock.address+3 - // [2447] call rom_unlock - // [2043] phi from rom_sector_erase::@1 to rom_unlock [phi:rom_sector_erase::@1->rom_unlock] - // [2043] phi rom_unlock::unlock_code#5 = $80 [phi:rom_sector_erase::@1->rom_unlock#0] -- vbuz1=vbuc1 + // [2857] call rom_unlock + // [2228] phi from rom_sector_erase::@1 to rom_unlock [phi:rom_sector_erase::@1->rom_unlock] + // [2228] phi rom_unlock::unlock_code#5 = $80 [phi:rom_sector_erase::@1->rom_unlock#0] -- vbuz1=vbuc1 lda #$80 sta.z rom_unlock.unlock_code - // [2043] phi rom_unlock::address#5 = rom_unlock::address#0 [phi:rom_sector_erase::@1->rom_unlock#1] -- register_copy + // [2228] phi rom_unlock::address#5 = rom_unlock::address#0 [phi:rom_sector_erase::@1->rom_unlock#1] -- register_copy jsr rom_unlock // rom_sector_erase::@2 // rom_unlock(address, 0x30) - // [2448] rom_unlock::address#1 = rom_sector_erase::address#0 -- vduz1=vduz2 + // [2858] rom_unlock::address#1 = rom_sector_erase::address#0 -- vduz1=vduz2 lda.z address sta.z rom_unlock.address lda.z address+1 @@ -16681,53 +18941,53 @@ rom_sector_erase: { sta.z rom_unlock.address+2 lda.z address+3 sta.z rom_unlock.address+3 - // [2449] call rom_unlock - // [2043] phi from rom_sector_erase::@2 to rom_unlock [phi:rom_sector_erase::@2->rom_unlock] - // [2043] phi rom_unlock::unlock_code#5 = $30 [phi:rom_sector_erase::@2->rom_unlock#0] -- vbuz1=vbuc1 + // [2859] call rom_unlock + // [2228] phi from rom_sector_erase::@2 to rom_unlock [phi:rom_sector_erase::@2->rom_unlock] + // [2228] phi rom_unlock::unlock_code#5 = $30 [phi:rom_sector_erase::@2->rom_unlock#0] -- vbuz1=vbuc1 lda #$30 sta.z rom_unlock.unlock_code - // [2043] phi rom_unlock::address#5 = rom_unlock::address#1 [phi:rom_sector_erase::@2->rom_unlock#1] -- register_copy + // [2228] phi rom_unlock::address#5 = rom_unlock::address#1 [phi:rom_sector_erase::@2->rom_unlock#1] -- register_copy jsr rom_unlock // rom_sector_erase::@3 // rom_wait(ptr_rom) - // [2450] rom_wait::ptr_rom#0 = (char *)rom_sector_erase::rom_ptr1_return#0 - // [2451] call rom_wait - // [2910] phi from rom_sector_erase::@3 to rom_wait [phi:rom_sector_erase::@3->rom_wait] - // [2910] phi rom_wait::ptr_rom#3 = rom_wait::ptr_rom#0 [phi:rom_sector_erase::@3->rom_wait#0] -- register_copy + // [2860] rom_wait::ptr_rom#0 = (char *)rom_sector_erase::rom_ptr1_return#0 + // [2861] call rom_wait + // [3408] phi from rom_sector_erase::@3 to rom_wait [phi:rom_sector_erase::@3->rom_wait] + // [3408] phi rom_wait::ptr_rom#3 = rom_wait::ptr_rom#0 [phi:rom_sector_erase::@3->rom_wait#0] -- register_copy jsr rom_wait // rom_sector_erase::@return // } - // [2452] return + // [2862] return rts } // display_action_text_flashing -// void display_action_text_flashing(__zp($52) unsigned long bytes, __zp($d8) char *chip, __zp($cc) char bram_bank, __zp($da) char *bram_ptr, __zp($78) unsigned long address) +// void display_action_text_flashing(__zp($b5) unsigned long bytes, __zp($ca) char *chip, __zp($ba) char bram_bank, __zp($c3) char *bram_ptr, __zp($b0) unsigned long address) display_action_text_flashing: { - .label bram_ptr = $da - .label address = $78 - .label bram_bank = $cc - .label bytes = $52 - .label chip = $d8 + .label bram_ptr = $c3 + .label address = $b0 + .label bram_bank = $ba + .label bytes = $b5 + .label chip = $ca // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2454] call snprintf_init - // [1113] phi from display_action_text_flashing to snprintf_init [phi:display_action_text_flashing->snprintf_init] - // [1113] phi snprintf_init::s#25 = info_text [phi:display_action_text_flashing->snprintf_init#0] -- pbuz1=pbuc1 + // [2864] call snprintf_init + // [1184] phi from display_action_text_flashing to snprintf_init [phi:display_action_text_flashing->snprintf_init] + // [1184] phi snprintf_init::s#30 = info_text [phi:display_action_text_flashing->snprintf_init#0] -- pbuz1=pbuc1 lda #info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [2455] phi from display_action_text_flashing to display_action_text_flashing::@1 [phi:display_action_text_flashing->display_action_text_flashing::@1] + // [2865] phi from display_action_text_flashing to display_action_text_flashing::@1 [phi:display_action_text_flashing->display_action_text_flashing::@1] // display_action_text_flashing::@1 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2456] call printf_str - // [1054] phi from display_action_text_flashing::@1 to printf_str [phi:display_action_text_flashing::@1->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:display_action_text_flashing::@1->printf_str#0] -- pprz1=pprc1 + // [2866] call printf_str + // [1125] phi from display_action_text_flashing::@1 to printf_str [phi:display_action_text_flashing::@1->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:display_action_text_flashing::@1->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = display_action_text_flashing::s [phi:display_action_text_flashing::@1->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = display_action_text_flashing::s [phi:display_action_text_flashing::@1->printf_str#1] -- pbuz1=pbuc1 lda #s @@ -16735,7 +18995,7 @@ display_action_text_flashing: { jsr printf_str // display_action_text_flashing::@2 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2457] printf_ulong::uvalue#0 = display_action_text_flashing::bytes#2 -- vdum1=vduz2 + // [2867] printf_ulong::uvalue#0 = display_action_text_flashing::bytes#3 -- vdum1=vduz2 lda.z bytes sta printf_ulong.uvalue lda.z bytes+1 @@ -16744,29 +19004,28 @@ display_action_text_flashing: { sta printf_ulong.uvalue+2 lda.z bytes+3 sta printf_ulong.uvalue+3 - // [2458] call printf_ulong - // [1396] phi from display_action_text_flashing::@2 to printf_ulong [phi:display_action_text_flashing::@2->printf_ulong] - // [1396] phi printf_ulong::format_zero_padding#10 = 0 [phi:display_action_text_flashing::@2->printf_ulong#0] -- vbum1=vbuc1 + // [2868] call printf_ulong + // [1588] phi from display_action_text_flashing::@2 to printf_ulong [phi:display_action_text_flashing::@2->printf_ulong] + // [1588] phi printf_ulong::format_zero_padding#14 = 0 [phi:display_action_text_flashing::@2->printf_ulong#0] -- vbum1=vbuc1 lda #0 sta printf_ulong.format_zero_padding - // [1396] phi printf_ulong::format_min_length#10 = 0 [phi:display_action_text_flashing::@2->printf_ulong#1] -- vbum1=vbuc1 + // [1588] phi printf_ulong::format_min_length#14 = 0 [phi:display_action_text_flashing::@2->printf_ulong#1] -- vbum1=vbuc1 sta printf_ulong.format_min_length - // [1396] phi printf_ulong::format_radix#10 = DECIMAL [phi:display_action_text_flashing::@2->printf_ulong#2] -- vbum1=vbuc1 - lda #DECIMAL - sta printf_ulong.format_radix - // [1396] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#0 [phi:display_action_text_flashing::@2->printf_ulong#3] -- register_copy + // [1588] phi printf_ulong::format_radix#14 = DECIMAL [phi:display_action_text_flashing::@2->printf_ulong#2] -- vbuxx=vbuc1 + ldx #DECIMAL + // [1588] phi printf_ulong::uvalue#14 = printf_ulong::uvalue#0 [phi:display_action_text_flashing::@2->printf_ulong#3] -- register_copy jsr printf_ulong - // [2459] phi from display_action_text_flashing::@2 to display_action_text_flashing::@3 [phi:display_action_text_flashing::@2->display_action_text_flashing::@3] + // [2869] phi from display_action_text_flashing::@2 to display_action_text_flashing::@3 [phi:display_action_text_flashing::@2->display_action_text_flashing::@3] // display_action_text_flashing::@3 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2460] call printf_str - // [1054] phi from display_action_text_flashing::@3 to printf_str [phi:display_action_text_flashing::@3->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:display_action_text_flashing::@3->printf_str#0] -- pprz1=pprc1 + // [2870] call printf_str + // [1125] phi from display_action_text_flashing::@3 to printf_str [phi:display_action_text_flashing::@3->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:display_action_text_flashing::@3->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = display_action_text_flashing::s1 [phi:display_action_text_flashing::@3->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = display_action_text_flashing::s1 [phi:display_action_text_flashing::@3->printf_str#1] -- pbuz1=pbuc1 lda #s1 @@ -16774,38 +19033,36 @@ display_action_text_flashing: { jsr printf_str // display_action_text_flashing::@4 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2461] printf_uchar::uvalue#4 = display_action_text_flashing::bram_bank#2 -- vbum1=vbuz2 - lda.z bram_bank - sta printf_uchar.uvalue - // [2462] call printf_uchar - // [1118] phi from display_action_text_flashing::@4 to printf_uchar [phi:display_action_text_flashing::@4->printf_uchar] - // [1118] phi printf_uchar::format_zero_padding#17 = 1 [phi:display_action_text_flashing::@4->printf_uchar#0] -- vbum1=vbuc1 + // [2871] printf_uchar::uvalue#1 = display_action_text_flashing::bram_bank#3 -- vbuxx=vbuz1 + ldx.z bram_bank + // [2872] call printf_uchar + // [1189] phi from display_action_text_flashing::@4 to printf_uchar [phi:display_action_text_flashing::@4->printf_uchar] + // [1189] phi printf_uchar::format_zero_padding#15 = 1 [phi:display_action_text_flashing::@4->printf_uchar#0] -- vbum1=vbuc1 lda #1 sta printf_uchar.format_zero_padding - // [1118] phi printf_uchar::format_min_length#17 = 2 [phi:display_action_text_flashing::@4->printf_uchar#1] -- vbum1=vbuc1 + // [1189] phi printf_uchar::format_min_length#15 = 2 [phi:display_action_text_flashing::@4->printf_uchar#1] -- vbum1=vbuc1 lda #2 sta printf_uchar.format_min_length - // [1118] phi printf_uchar::putc#17 = &snputc [phi:display_action_text_flashing::@4->printf_uchar#2] -- pprz1=pprc1 + // [1189] phi printf_uchar::putc#15 = &snputc [phi:display_action_text_flashing::@4->printf_uchar#2] -- pprz1=pprc1 lda #snputc sta.z printf_uchar.putc+1 - // [1118] phi printf_uchar::format_radix#17 = HEXADECIMAL [phi:display_action_text_flashing::@4->printf_uchar#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uchar.format_radix - // [1118] phi printf_uchar::uvalue#17 = printf_uchar::uvalue#4 [phi:display_action_text_flashing::@4->printf_uchar#4] -- register_copy + // [1189] phi printf_uchar::format_radix#15 = HEXADECIMAL [phi:display_action_text_flashing::@4->printf_uchar#3] -- vbuyy=vbuc1 + ldy #HEXADECIMAL + // [1189] phi printf_uchar::uvalue#15 = printf_uchar::uvalue#1 [phi:display_action_text_flashing::@4->printf_uchar#4] -- register_copy jsr printf_uchar - // [2463] phi from display_action_text_flashing::@4 to display_action_text_flashing::@5 [phi:display_action_text_flashing::@4->display_action_text_flashing::@5] + // [2873] phi from display_action_text_flashing::@4 to display_action_text_flashing::@5 [phi:display_action_text_flashing::@4->display_action_text_flashing::@5] // display_action_text_flashing::@5 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2464] call printf_str - // [1054] phi from display_action_text_flashing::@5 to printf_str [phi:display_action_text_flashing::@5->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:display_action_text_flashing::@5->printf_str#0] -- pprz1=pprc1 + // [2874] call printf_str + // [1125] phi from display_action_text_flashing::@5 to printf_str [phi:display_action_text_flashing::@5->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:display_action_text_flashing::@5->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s2 [phi:display_action_text_flashing::@5->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s2 [phi:display_action_text_flashing::@5->printf_str#1] -- pbuz1=pbuc1 lda #s2 @@ -16813,40 +19070,39 @@ display_action_text_flashing: { jsr printf_str // display_action_text_flashing::@6 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2465] printf_uint::uvalue#1 = (unsigned int)display_action_text_flashing::bram_ptr#2 -- vwum1=vwuz2 + // [2875] printf_uint::uvalue#1 = (unsigned int)display_action_text_flashing::bram_ptr#3 -- vwum1=vwuz2 lda.z bram_ptr sta printf_uint.uvalue lda.z bram_ptr+1 sta printf_uint.uvalue+1 - // [2466] call printf_uint - // [1835] phi from display_action_text_flashing::@6 to printf_uint [phi:display_action_text_flashing::@6->printf_uint] - // [1835] phi printf_uint::format_zero_padding#10 = 1 [phi:display_action_text_flashing::@6->printf_uint#0] -- vbum1=vbuc1 + // [2876] call printf_uint + // [2015] phi from display_action_text_flashing::@6 to printf_uint [phi:display_action_text_flashing::@6->printf_uint] + // [2015] phi printf_uint::format_zero_padding#10 = 1 [phi:display_action_text_flashing::@6->printf_uint#0] -- vbum1=vbuc1 lda #1 sta printf_uint.format_zero_padding - // [1835] phi printf_uint::format_min_length#10 = 4 [phi:display_action_text_flashing::@6->printf_uint#1] -- vbum1=vbuc1 + // [2015] phi printf_uint::format_min_length#10 = 4 [phi:display_action_text_flashing::@6->printf_uint#1] -- vbum1=vbuc1 lda #4 sta printf_uint.format_min_length - // [1835] phi printf_uint::putc#10 = &snputc [phi:display_action_text_flashing::@6->printf_uint#2] -- pprz1=pprc1 + // [2015] phi printf_uint::putc#10 = &snputc [phi:display_action_text_flashing::@6->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1835] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:display_action_text_flashing::@6->printf_uint#3] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_uint.format_radix - // [1835] phi printf_uint::uvalue#10 = printf_uint::uvalue#1 [phi:display_action_text_flashing::@6->printf_uint#4] -- register_copy + // [2015] phi printf_uint::format_radix#10 = HEXADECIMAL [phi:display_action_text_flashing::@6->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [2015] phi printf_uint::uvalue#10 = printf_uint::uvalue#1 [phi:display_action_text_flashing::@6->printf_uint#4] -- register_copy jsr printf_uint - // [2467] phi from display_action_text_flashing::@6 to display_action_text_flashing::@7 [phi:display_action_text_flashing::@6->display_action_text_flashing::@7] + // [2877] phi from display_action_text_flashing::@6 to display_action_text_flashing::@7 [phi:display_action_text_flashing::@6->display_action_text_flashing::@7] // display_action_text_flashing::@7 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2468] call printf_str - // [1054] phi from display_action_text_flashing::@7 to printf_str [phi:display_action_text_flashing::@7->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:display_action_text_flashing::@7->printf_str#0] -- pprz1=pprc1 + // [2878] call printf_str + // [1125] phi from display_action_text_flashing::@7 to printf_str [phi:display_action_text_flashing::@7->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:display_action_text_flashing::@7->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = display_action_text_flashing::s3 [phi:display_action_text_flashing::@7->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = display_action_text_flashing::s3 [phi:display_action_text_flashing::@7->printf_str#1] -- pbuz1=pbuc1 lda #s3 @@ -16854,36 +19110,36 @@ display_action_text_flashing: { jsr printf_str // display_action_text_flashing::@8 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2469] printf_string::str#12 = display_action_text_flashing::chip#10 -- pbuz1=pbuz2 + // [2879] printf_string::str#12 = display_action_text_flashing::chip#10 -- pbuz1=pbuz2 lda.z chip sta.z printf_string.str lda.z chip+1 sta.z printf_string.str+1 - // [2470] call printf_string - // [1227] phi from display_action_text_flashing::@8 to printf_string [phi:display_action_text_flashing::@8->printf_string] - // [1227] phi printf_string::putc#25 = &snputc [phi:display_action_text_flashing::@8->printf_string#0] -- pprz1=pprc1 + // [2880] call printf_string + // [1419] phi from display_action_text_flashing::@8 to printf_string [phi:display_action_text_flashing::@8->printf_string] + // [1419] phi printf_string::putc#26 = &snputc [phi:display_action_text_flashing::@8->printf_string#0] -- pprz1=pprc1 lda #snputc sta.z printf_string.putc+1 - // [1227] phi printf_string::str#25 = printf_string::str#12 [phi:display_action_text_flashing::@8->printf_string#1] -- register_copy - // [1227] phi printf_string::format_justify_left#25 = 0 [phi:display_action_text_flashing::@8->printf_string#2] -- vbum1=vbuc1 + // [1419] phi printf_string::str#26 = printf_string::str#12 [phi:display_action_text_flashing::@8->printf_string#1] -- register_copy + // [1419] phi printf_string::format_justify_left#26 = 0 [phi:display_action_text_flashing::@8->printf_string#2] -- vbum1=vbuc1 lda #0 sta printf_string.format_justify_left - // [1227] phi printf_string::format_min_length#25 = 0 [phi:display_action_text_flashing::@8->printf_string#3] -- vbum1=vbuc1 + // [1419] phi printf_string::format_min_length#26 = 0 [phi:display_action_text_flashing::@8->printf_string#3] -- vbum1=vbuc1 sta printf_string.format_min_length jsr printf_string - // [2471] phi from display_action_text_flashing::@8 to display_action_text_flashing::@9 [phi:display_action_text_flashing::@8->display_action_text_flashing::@9] + // [2881] phi from display_action_text_flashing::@8 to display_action_text_flashing::@9 [phi:display_action_text_flashing::@8->display_action_text_flashing::@9] // display_action_text_flashing::@9 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2472] call printf_str - // [1054] phi from display_action_text_flashing::@9 to printf_str [phi:display_action_text_flashing::@9->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:display_action_text_flashing::@9->printf_str#0] -- pprz1=pprc1 + // [2882] call printf_str + // [1125] phi from display_action_text_flashing::@9 to printf_str [phi:display_action_text_flashing::@9->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:display_action_text_flashing::@9->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s2 [phi:display_action_text_flashing::@9->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s2 [phi:display_action_text_flashing::@9->printf_str#1] -- pbuz1=pbuc1 lda #s2 @@ -16891,7 +19147,7 @@ display_action_text_flashing: { jsr printf_str // display_action_text_flashing::@10 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2473] printf_ulong::uvalue#1 = display_action_text_flashing::address#10 -- vdum1=vduz2 + // [2883] printf_ulong::uvalue#1 = display_action_text_flashing::address#10 -- vdum1=vduz2 lda.z address sta printf_ulong.uvalue lda.z address+1 @@ -16900,30 +19156,29 @@ display_action_text_flashing: { sta printf_ulong.uvalue+2 lda.z address+3 sta printf_ulong.uvalue+3 - // [2474] call printf_ulong - // [1396] phi from display_action_text_flashing::@10 to printf_ulong [phi:display_action_text_flashing::@10->printf_ulong] - // [1396] phi printf_ulong::format_zero_padding#10 = 1 [phi:display_action_text_flashing::@10->printf_ulong#0] -- vbum1=vbuc1 + // [2884] call printf_ulong + // [1588] phi from display_action_text_flashing::@10 to printf_ulong [phi:display_action_text_flashing::@10->printf_ulong] + // [1588] phi printf_ulong::format_zero_padding#14 = 1 [phi:display_action_text_flashing::@10->printf_ulong#0] -- vbum1=vbuc1 lda #1 sta printf_ulong.format_zero_padding - // [1396] phi printf_ulong::format_min_length#10 = 5 [phi:display_action_text_flashing::@10->printf_ulong#1] -- vbum1=vbuc1 + // [1588] phi printf_ulong::format_min_length#14 = 5 [phi:display_action_text_flashing::@10->printf_ulong#1] -- vbum1=vbuc1 lda #5 sta printf_ulong.format_min_length - // [1396] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:display_action_text_flashing::@10->printf_ulong#2] -- vbum1=vbuc1 - lda #HEXADECIMAL - sta printf_ulong.format_radix - // [1396] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#1 [phi:display_action_text_flashing::@10->printf_ulong#3] -- register_copy + // [1588] phi printf_ulong::format_radix#14 = HEXADECIMAL [phi:display_action_text_flashing::@10->printf_ulong#2] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1588] phi printf_ulong::uvalue#14 = printf_ulong::uvalue#1 [phi:display_action_text_flashing::@10->printf_ulong#3] -- register_copy jsr printf_ulong - // [2475] phi from display_action_text_flashing::@10 to display_action_text_flashing::@11 [phi:display_action_text_flashing::@10->display_action_text_flashing::@11] + // [2885] phi from display_action_text_flashing::@10 to display_action_text_flashing::@11 [phi:display_action_text_flashing::@10->display_action_text_flashing::@11] // display_action_text_flashing::@11 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2476] call printf_str - // [1054] phi from display_action_text_flashing::@11 to printf_str [phi:display_action_text_flashing::@11->printf_str] - // [1054] phi printf_str::putc#75 = &snputc [phi:display_action_text_flashing::@11->printf_str#0] -- pprz1=pprc1 + // [2886] call printf_str + // [1125] phi from display_action_text_flashing::@11 to printf_str [phi:display_action_text_flashing::@11->printf_str] + // [1125] phi printf_str::putc#79 = &snputc [phi:display_action_text_flashing::@11->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1054] phi printf_str::s#75 = s5 [phi:display_action_text_flashing::@11->printf_str#1] -- pbuz1=pbuc1 + // [1125] phi printf_str::s#79 = s5 [phi:display_action_text_flashing::@11->printf_str#1] -- pbuz1=pbuc1 lda #s5 @@ -16931,17 +19186,17 @@ display_action_text_flashing: { jsr printf_str // display_action_text_flashing::@12 // sprintf(info_text, "Flashing %u bytes from RAM:%02x:%04p -> %s:%05x ... ", bytes, bram_bank, bram_ptr, chip, address) - // [2477] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [2887] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [2478] callexecute snputc -- call_vprc1 + // [2888] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_action_text(info_text) - // [2480] call display_action_text - // [1129] phi from display_action_text_flashing::@12 to display_action_text [phi:display_action_text_flashing::@12->display_action_text] - // [1129] phi display_action_text::info_text#17 = info_text [phi:display_action_text_flashing::@12->display_action_text#0] -- pbuz1=pbuc1 + // [2890] call display_action_text + // [1200] phi from display_action_text_flashing::@12 to display_action_text [phi:display_action_text_flashing::@12->display_action_text] + // [1200] phi display_action_text::info_text#25 = info_text [phi:display_action_text_flashing::@12->display_action_text#0] -- pbuz1=pbuc1 lda #info_text @@ -16949,7 +19204,7 @@ display_action_text_flashing: { jsr display_action_text // display_action_text_flashing::@return // } - // [2481] return + // [2891] return rts .segment Data s: .text "Flashing " @@ -16962,15 +19217,14 @@ display_action_text_flashing: { .segment Code // rom_write /* inline */ -// unsigned long rom_write(__zp($76) char flash_ram_bank, __zp($6b) char *flash_ram_address, __zp($6f) unsigned long flash_rom_address, unsigned int flash_rom_size) +// unsigned long rom_write(__register(X) char flash_ram_bank, __zp($51) char *flash_ram_address, __zp($55) unsigned long flash_rom_address, unsigned int flash_rom_size) rom_write: { - .label rom_chip_address = $78 - .label flash_rom_address = $6f - .label flash_ram_address = $6b - .label flashed_bytes = $62 - .label flash_ram_bank = $76 + .label rom_chip_address = $5f + .label flash_rom_address = $55 + .label flash_ram_address = $51 + .label flashed_bytes = $4a // unsigned long rom_chip_address = flash_rom_address & ROM_CHIP_MASK - // [2482] rom_write::rom_chip_address#0 = rom_write::flash_rom_address#1 & $380000 -- vduz1=vduz2_band_vduc1 + // [2892] rom_write::rom_chip_address#0 = rom_write::flash_rom_address#1 & $380000 -- vduz1=vduz2_band_vduc1 /// Holds the amount of bytes actually flashed in the ROM. lda.z flash_rom_address and #<$380000 @@ -16986,13 +19240,12 @@ rom_write: { sta.z rom_chip_address+3 // rom_write::bank_set_bram1 // BRAM = bank - // [2483] BRAM = rom_write::flash_ram_bank#0 -- vbuz1=vbuz2 - lda.z flash_ram_bank - sta.z BRAM - // [2484] phi from rom_write::bank_set_bram1 to rom_write::@1 [phi:rom_write::bank_set_bram1->rom_write::@1] - // [2484] phi rom_write::flash_ram_address#2 = rom_write::flash_ram_address#1 [phi:rom_write::bank_set_bram1->rom_write::@1#0] -- register_copy - // [2484] phi rom_write::flash_rom_address#3 = rom_write::flash_rom_address#1 [phi:rom_write::bank_set_bram1->rom_write::@1#1] -- register_copy - // [2484] phi rom_write::flashed_bytes#2 = 0 [phi:rom_write::bank_set_bram1->rom_write::@1#2] -- vduz1=vduc1 + // [2893] BRAM = rom_write::flash_ram_bank#0 -- vbuz1=vbuxx + stx.z BRAM + // [2894] phi from rom_write::bank_set_bram1 to rom_write::@1 [phi:rom_write::bank_set_bram1->rom_write::@1] + // [2894] phi rom_write::flash_ram_address#2 = rom_write::flash_ram_address#1 [phi:rom_write::bank_set_bram1->rom_write::@1#0] -- register_copy + // [2894] phi rom_write::flash_rom_address#3 = rom_write::flash_rom_address#1 [phi:rom_write::bank_set_bram1->rom_write::@1#1] -- register_copy + // [2894] phi rom_write::flashed_bytes#2 = 0 [phi:rom_write::bank_set_bram1->rom_write::@1#2] -- vduz1=vduc1 lda #<0 sta.z flashed_bytes sta.z flashed_bytes+1 @@ -17003,7 +19256,7 @@ rom_write: { // rom_write::@1 __b1: // while (flashed_bytes < flash_rom_size) - // [2485] if(rom_write::flashed_bytes#2ROM_PROGRESS_CELL>>$10 bcc __b2 @@ -17022,12 +19275,12 @@ rom_write: { !: // rom_write::@return // } - // [2486] return + // [2896] return rts // rom_write::@2 __b2: // rom_unlock(rom_chip_address + 0x05555, 0xA0) - // [2487] rom_unlock::address#4 = rom_write::rom_chip_address#0 + $5555 -- vduz1=vduz2_plus_vwuc1 + // [2897] rom_unlock::address#4 = rom_write::rom_chip_address#0 + $5555 -- vduz1=vduz2_plus_vwuc1 clc lda.z rom_chip_address adc #<$5555 @@ -17041,16 +19294,16 @@ rom_write: { lda.z rom_chip_address+3 adc #0 sta.z rom_unlock.address+3 - // [2488] call rom_unlock - // [2043] phi from rom_write::@2 to rom_unlock [phi:rom_write::@2->rom_unlock] - // [2043] phi rom_unlock::unlock_code#5 = $a0 [phi:rom_write::@2->rom_unlock#0] -- vbuz1=vbuc1 + // [2898] call rom_unlock + // [2228] phi from rom_write::@2 to rom_unlock [phi:rom_write::@2->rom_unlock] + // [2228] phi rom_unlock::unlock_code#5 = $a0 [phi:rom_write::@2->rom_unlock#0] -- vbuz1=vbuc1 lda #$a0 sta.z rom_unlock.unlock_code - // [2043] phi rom_unlock::address#5 = rom_unlock::address#4 [phi:rom_write::@2->rom_unlock#1] -- register_copy + // [2228] phi rom_unlock::address#5 = rom_unlock::address#4 [phi:rom_write::@2->rom_unlock#1] -- register_copy jsr rom_unlock // rom_write::@3 // rom_byte_program(flash_rom_address, *flash_ram_address) - // [2489] rom_byte_program::address#0 = rom_write::flash_rom_address#3 -- vduz1=vduz2 + // [2899] rom_byte_program::address#0 = rom_write::flash_rom_address#3 -- vduz1=vduz2 lda.z flash_rom_address sta.z rom_byte_program.address lda.z flash_rom_address+1 @@ -17059,16 +19312,16 @@ rom_write: { sta.z rom_byte_program.address+2 lda.z flash_rom_address+3 sta.z rom_byte_program.address+3 - // [2490] rom_byte_program::value#0 = *rom_write::flash_ram_address#2 -- vbuz1=_deref_pbuz2 + // [2900] rom_byte_program::value#0 = *rom_write::flash_ram_address#2 -- vbuyy=_deref_pbuz1 ldy #0 lda (flash_ram_address),y - sta.z rom_byte_program.value - // [2491] call rom_byte_program - // [2917] phi from rom_write::@3 to rom_byte_program [phi:rom_write::@3->rom_byte_program] + tay + // [2901] call rom_byte_program + // [3415] phi from rom_write::@3 to rom_byte_program [phi:rom_write::@3->rom_byte_program] jsr rom_byte_program // rom_write::@4 // flash_rom_address++; - // [2492] rom_write::flash_rom_address#0 = ++ rom_write::flash_rom_address#3 -- vduz1=_inc_vduz1 + // [2902] rom_write::flash_rom_address#0 = ++ rom_write::flash_rom_address#3 -- vduz1=_inc_vduz1 inc.z flash_rom_address bne !+ inc.z flash_rom_address+1 @@ -17078,13 +19331,13 @@ rom_write: { inc.z flash_rom_address+3 !: // flash_ram_address++; - // [2493] rom_write::flash_ram_address#0 = ++ rom_write::flash_ram_address#2 -- pbuz1=_inc_pbuz1 + // [2903] rom_write::flash_ram_address#0 = ++ rom_write::flash_ram_address#2 -- pbuz1=_inc_pbuz1 inc.z flash_ram_address bne !+ inc.z flash_ram_address+1 !: // flashed_bytes++; - // [2494] rom_write::flashed_bytes#1 = ++ rom_write::flashed_bytes#2 -- vduz1=_inc_vduz1 + // [2904] rom_write::flashed_bytes#1 = ++ rom_write::flashed_bytes#2 -- vduz1=_inc_vduz1 inc.z flashed_bytes bne !+ inc.z flashed_bytes+1 @@ -17093,10 +19346,10 @@ rom_write: { bne !+ inc.z flashed_bytes+3 !: - // [2484] phi from rom_write::@4 to rom_write::@1 [phi:rom_write::@4->rom_write::@1] - // [2484] phi rom_write::flash_ram_address#2 = rom_write::flash_ram_address#0 [phi:rom_write::@4->rom_write::@1#0] -- register_copy - // [2484] phi rom_write::flash_rom_address#3 = rom_write::flash_rom_address#0 [phi:rom_write::@4->rom_write::@1#1] -- register_copy - // [2484] phi rom_write::flashed_bytes#2 = rom_write::flashed_bytes#1 [phi:rom_write::@4->rom_write::@1#2] -- register_copy + // [2894] phi from rom_write::@4 to rom_write::@1 [phi:rom_write::@4->rom_write::@1] + // [2894] phi rom_write::flash_ram_address#2 = rom_write::flash_ram_address#0 [phi:rom_write::@4->rom_write::@1#0] -- register_copy + // [2894] phi rom_write::flash_rom_address#3 = rom_write::flash_rom_address#0 [phi:rom_write::@4->rom_write::@1#1] -- register_copy + // [2894] phi rom_write::flashed_bytes#2 = rom_write::flashed_bytes#1 [phi:rom_write::@4->rom_write::@1#2] -- register_copy jmp __b1 } // cbm_k_getin @@ -17107,7 +19360,7 @@ rom_write: { */ cbm_k_getin: { // __mem unsigned char ch - // [2495] cbm_k_getin::ch = 0 -- vbum1=vbuc1 + // [2905] cbm_k_getin::ch = 0 -- vbum1=vbuc1 lda #0 sta ch // asm @@ -17115,16 +19368,14 @@ cbm_k_getin: { jsr CBM_GETIN sta ch // return ch; - // [2497] cbm_k_getin::return#0 = cbm_k_getin::ch -- vbum1=vbum2 - sta return + // [2907] cbm_k_getin::return#0 = cbm_k_getin::ch -- vbuaa=vbum1 // cbm_k_getin::@return // } - // [2498] cbm_k_getin::return#1 = cbm_k_getin::return#0 - // [2499] return + // [2908] cbm_k_getin::return#1 = cbm_k_getin::return#0 + // [2909] return rts .segment Data ch: .byte 0 - return: .byte 0 } .segment Code // display_vera_led @@ -17133,45 +19384,40 @@ cbm_k_getin: { * * @param c Led color */ -// void display_vera_led(__mem() char c) +// void display_vera_led(__zp($f4) char c) display_vera_led: { + .label c = $f4 // display_chip_led(CHIP_VERA_X+1, CHIP_VERA_Y, CHIP_VERA_W, c, BLUE) - // [2501] display_chip_led::tc#1 = display_vera_led::c#2 -- vbuz1=vbum2 - lda c - sta.z display_chip_led.tc - // [2502] call display_chip_led - // [2726] phi from display_vera_led to display_chip_led [phi:display_vera_led->display_chip_led] - // [2726] phi display_chip_led::w#7 = 8 [phi:display_vera_led->display_chip_led#0] -- vbuz1=vbuc1 + // [2911] display_chip_led::tc#1 = display_vera_led::c#2 -- vbuxx=vbuz1 + ldx.z c + // [2912] call display_chip_led + // [3136] phi from display_vera_led to display_chip_led [phi:display_vera_led->display_chip_led] + // [3136] phi display_chip_led::w#7 = 8 [phi:display_vera_led->display_chip_led#0] -- vbuz1=vbuc1 lda #8 sta.z display_chip_led.w - // [2726] phi display_chip_led::x#7 = 9+1 [phi:display_vera_led->display_chip_led#1] -- vbuz1=vbuc1 + // [3136] phi display_chip_led::x#7 = 9+1 [phi:display_vera_led->display_chip_led#1] -- vbuz1=vbuc1 lda #9+1 sta.z display_chip_led.x - // [2726] phi display_chip_led::tc#3 = display_chip_led::tc#1 [phi:display_vera_led->display_chip_led#2] -- register_copy + // [3136] phi display_chip_led::tc#3 = display_chip_led::tc#1 [phi:display_vera_led->display_chip_led#2] -- register_copy jsr display_chip_led // display_vera_led::@1 // display_info_led(INFO_X-2, INFO_Y+1, c, BLUE) - // [2503] display_info_led::tc#1 = display_vera_led::c#2 -- vbuz1=vbum2 - lda c - sta.z display_info_led.tc - // [2504] call display_info_led - // [1978] phi from display_vera_led::@1 to display_info_led [phi:display_vera_led::@1->display_info_led] - // [1978] phi display_info_led::y#4 = $11+1 [phi:display_vera_led::@1->display_info_led#0] -- vbuz1=vbuc1 + // [2913] display_info_led::tc#1 = display_vera_led::c#2 -- vbuxx=vbuz1 + ldx.z c + // [2914] call display_info_led + // [2158] phi from display_vera_led::@1 to display_info_led [phi:display_vera_led::@1->display_info_led] + // [2158] phi display_info_led::y#4 = $11+1 [phi:display_vera_led::@1->display_info_led#0] -- vbuz1=vbuc1 lda #$11+1 sta.z display_info_led.y - // [1978] phi display_info_led::x#4 = 4-2 [phi:display_vera_led::@1->display_info_led#1] -- vbuz1=vbuc1 - lda #4-2 - sta.z display_info_led.x - // [1978] phi display_info_led::tc#4 = display_info_led::tc#1 [phi:display_vera_led::@1->display_info_led#2] -- register_copy + // [2158] phi display_info_led::x#4 = 4-2 [phi:display_vera_led::@1->display_info_led#1] -- vbuyy=vbuc1 + ldy #4-2 + // [2158] phi display_info_led::tc#4 = display_info_led::tc#1 [phi:display_vera_led::@1->display_info_led#2] -- register_copy jsr display_info_led // display_vera_led::@return // } - // [2505] return + // [2915] return rts - .segment Data - .label c = main.check_status_cx16_rom5_check_status_rom1_main__0 } -.segment Code // strncpy /// Copies up to n characters from the string pointed to, by src to dst. /// In a case where the length of src is less than that of n, the remainder of dst will be padded with null bytes. @@ -17179,21 +19425,21 @@ display_vera_led: { /// @param src ? This is the string to be copied. /// @param n ? The number of characters to be copied from source. /// @return The destination -// char * strncpy(__zp($39) char *dst, __zp($3b) const char *src, __mem() unsigned int n) +// char * strncpy(__zp($5d) char *dst, __zp($59) const char *src, __mem() unsigned int n) strncpy: { - .label dst = $39 - .label src = $3b - // [2507] phi from strncpy to strncpy::@1 [phi:strncpy->strncpy::@1] - // [2507] phi strncpy::dst#3 = strncpy::dst#8 [phi:strncpy->strncpy::@1#0] -- register_copy - // [2507] phi strncpy::src#3 = strncpy::src#6 [phi:strncpy->strncpy::@1#1] -- register_copy - // [2507] phi strncpy::i#2 = 0 [phi:strncpy->strncpy::@1#2] -- vwum1=vwuc1 + .label dst = $5d + .label src = $59 + // [2917] phi from strncpy to strncpy::@1 [phi:strncpy->strncpy::@1] + // [2917] phi strncpy::dst#3 = strncpy::dst#8 [phi:strncpy->strncpy::@1#0] -- register_copy + // [2917] phi strncpy::src#3 = strncpy::src#6 [phi:strncpy->strncpy::@1#1] -- register_copy + // [2917] phi strncpy::i#2 = 0 [phi:strncpy->strncpy::@1#2] -- vwum1=vwuc1 lda #<0 sta i sta i+1 // strncpy::@1 __b1: // for(size_t i = 0;istrncpy::@3] - // [2513] phi strncpy::src#7 = strncpy::src#3 [phi:strncpy::@2/strncpy::@4->strncpy::@3#0] -- register_copy + // [2923] phi from strncpy::@2 strncpy::@4 to strncpy::@3 [phi:strncpy::@2/strncpy::@4->strncpy::@3] + // [2923] phi strncpy::src#7 = strncpy::src#3 [phi:strncpy::@2/strncpy::@4->strncpy::@3#0] -- register_copy // strncpy::@3 __b3: // *dst++ = c - // [2514] *strncpy::dst#3 = strncpy::c#0 -- _deref_pbuz1=vbum2 - lda c + // [2924] *strncpy::dst#3 = strncpy::c#0 -- _deref_pbuz1=vbuaa ldy #0 sta (dst),y // *dst++ = c; - // [2515] strncpy::dst#0 = ++ strncpy::dst#3 -- pbuz1=_inc_pbuz1 + // [2925] strncpy::dst#0 = ++ strncpy::dst#3 -- pbuz1=_inc_pbuz1 inc.z dst bne !+ inc.z dst+1 !: // for(size_t i = 0;istrncpy::@1] - // [2507] phi strncpy::dst#3 = strncpy::dst#0 [phi:strncpy::@3->strncpy::@1#0] -- register_copy - // [2507] phi strncpy::src#3 = strncpy::src#7 [phi:strncpy::@3->strncpy::@1#1] -- register_copy - // [2507] phi strncpy::i#2 = strncpy::i#1 [phi:strncpy::@3->strncpy::@1#2] -- register_copy + // [2917] phi from strncpy::@3 to strncpy::@1 [phi:strncpy::@3->strncpy::@1] + // [2917] phi strncpy::dst#3 = strncpy::dst#0 [phi:strncpy::@3->strncpy::@1#0] -- register_copy + // [2917] phi strncpy::src#3 = strncpy::src#7 [phi:strncpy::@3->strncpy::@1#1] -- register_copy + // [2917] phi strncpy::i#2 = strncpy::i#1 [phi:strncpy::@3->strncpy::@1#2] -- register_copy jmp __b1 .segment Data - c: .byte 0 - i: .word 0 - n: .word 0 + .label i = fgets.remaining + .label n = strncmp.n } .segment Code // utoa @@ -17261,143 +19505,135 @@ strncpy: { // - value : The number to be converted to RADIX // - buffer : receives the string representing the number and zero-termination. // - radix : The radix to convert the number to (from the enum RADIX) -// void utoa(__mem() unsigned int value, __zp($3f) char *buffer, __mem() char radix) +// void utoa(__mem() unsigned int value, __zp($2a) char *buffer, __register(X) char radix) utoa: { - .label utoa__4 = $38 - .label utoa__10 = $46 - .label utoa__11 = $43 - .label buffer = $3f - .label digit_values = $3d + .label buffer = $2a + .label digit_values = $3a // if(radix==DECIMAL) - // [2517] if(utoa::radix#0==DECIMAL) goto utoa::@1 -- vbum1_eq_vbuc1_then_la1 - lda #DECIMAL - cmp radix + // [2927] if(utoa::radix#0==DECIMAL) goto utoa::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #DECIMAL beq __b2 // utoa::@2 // if(radix==HEXADECIMAL) - // [2518] if(utoa::radix#0==HEXADECIMAL) goto utoa::@1 -- vbum1_eq_vbuc1_then_la1 - lda #HEXADECIMAL - cmp radix + // [2928] if(utoa::radix#0==HEXADECIMAL) goto utoa::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #HEXADECIMAL beq __b3 // utoa::@3 // if(radix==OCTAL) - // [2519] if(utoa::radix#0==OCTAL) goto utoa::@1 -- vbum1_eq_vbuc1_then_la1 - lda #OCTAL - cmp radix + // [2929] if(utoa::radix#0==OCTAL) goto utoa::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #OCTAL beq __b4 // utoa::@4 // if(radix==BINARY) - // [2520] if(utoa::radix#0==BINARY) goto utoa::@1 -- vbum1_eq_vbuc1_then_la1 - lda #BINARY - cmp radix + // [2930] if(utoa::radix#0==BINARY) goto utoa::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #BINARY beq __b5 // utoa::@5 // *buffer++ = 'e' - // [2521] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS) = 'e' -- _deref_pbuc1=vbuc2 + // [2931] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS) = 'e' -- _deref_pbuc1=vbuc2 // Unknown radix lda #'e' sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS // *buffer++ = 'r' - // [2522] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1) = 'r' -- _deref_pbuc1=vbuc2 + // [2932] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1) = 'r' -- _deref_pbuc1=vbuc2 lda #'r' sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+1 - // [2523] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2) = 'r' -- _deref_pbuc1=vbuc2 + // [2933] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2) = 'r' -- _deref_pbuc1=vbuc2 sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+2 // *buffer = 0 - // [2524] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3) = 0 -- _deref_pbuc1=vbuc2 + // [2934] *((char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3) = 0 -- _deref_pbuc1=vbuc2 lda #0 sta printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS+3 // utoa::@return // } - // [2525] return + // [2935] return rts - // [2526] phi from utoa to utoa::@1 [phi:utoa->utoa::@1] + // [2936] phi from utoa to utoa::@1 [phi:utoa->utoa::@1] __b2: - // [2526] phi utoa::digit_values#8 = RADIX_DECIMAL_VALUES [phi:utoa->utoa::@1#0] -- pwuz1=pwuc1 + // [2936] phi utoa::digit_values#8 = RADIX_DECIMAL_VALUES [phi:utoa->utoa::@1#0] -- pwuz1=pwuc1 lda #RADIX_DECIMAL_VALUES sta.z digit_values+1 - // [2526] phi utoa::max_digits#7 = 5 [phi:utoa->utoa::@1#1] -- vbum1=vbuc1 + // [2936] phi utoa::max_digits#7 = 5 [phi:utoa->utoa::@1#1] -- vbum1=vbuc1 lda #5 sta max_digits jmp __b1 - // [2526] phi from utoa::@2 to utoa::@1 [phi:utoa::@2->utoa::@1] + // [2936] phi from utoa::@2 to utoa::@1 [phi:utoa::@2->utoa::@1] __b3: - // [2526] phi utoa::digit_values#8 = RADIX_HEXADECIMAL_VALUES [phi:utoa::@2->utoa::@1#0] -- pwuz1=pwuc1 + // [2936] phi utoa::digit_values#8 = RADIX_HEXADECIMAL_VALUES [phi:utoa::@2->utoa::@1#0] -- pwuz1=pwuc1 lda #RADIX_HEXADECIMAL_VALUES sta.z digit_values+1 - // [2526] phi utoa::max_digits#7 = 4 [phi:utoa::@2->utoa::@1#1] -- vbum1=vbuc1 + // [2936] phi utoa::max_digits#7 = 4 [phi:utoa::@2->utoa::@1#1] -- vbum1=vbuc1 lda #4 sta max_digits jmp __b1 - // [2526] phi from utoa::@3 to utoa::@1 [phi:utoa::@3->utoa::@1] + // [2936] phi from utoa::@3 to utoa::@1 [phi:utoa::@3->utoa::@1] __b4: - // [2526] phi utoa::digit_values#8 = RADIX_OCTAL_VALUES [phi:utoa::@3->utoa::@1#0] -- pwuz1=pwuc1 + // [2936] phi utoa::digit_values#8 = RADIX_OCTAL_VALUES [phi:utoa::@3->utoa::@1#0] -- pwuz1=pwuc1 lda #RADIX_OCTAL_VALUES sta.z digit_values+1 - // [2526] phi utoa::max_digits#7 = 6 [phi:utoa::@3->utoa::@1#1] -- vbum1=vbuc1 + // [2936] phi utoa::max_digits#7 = 6 [phi:utoa::@3->utoa::@1#1] -- vbum1=vbuc1 lda #6 sta max_digits jmp __b1 - // [2526] phi from utoa::@4 to utoa::@1 [phi:utoa::@4->utoa::@1] + // [2936] phi from utoa::@4 to utoa::@1 [phi:utoa::@4->utoa::@1] __b5: - // [2526] phi utoa::digit_values#8 = RADIX_BINARY_VALUES [phi:utoa::@4->utoa::@1#0] -- pwuz1=pwuc1 + // [2936] phi utoa::digit_values#8 = RADIX_BINARY_VALUES [phi:utoa::@4->utoa::@1#0] -- pwuz1=pwuc1 lda #RADIX_BINARY_VALUES sta.z digit_values+1 - // [2526] phi utoa::max_digits#7 = $10 [phi:utoa::@4->utoa::@1#1] -- vbum1=vbuc1 + // [2936] phi utoa::max_digits#7 = $10 [phi:utoa::@4->utoa::@1#1] -- vbum1=vbuc1 lda #$10 sta max_digits // utoa::@1 __b1: - // [2527] phi from utoa::@1 to utoa::@6 [phi:utoa::@1->utoa::@6] - // [2527] phi utoa::buffer#11 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:utoa::@1->utoa::@6#0] -- pbuz1=pbuc1 + // [2937] phi from utoa::@1 to utoa::@6 [phi:utoa::@1->utoa::@6] + // [2937] phi utoa::buffer#11 = (char *)&printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS [phi:utoa::@1->utoa::@6#0] -- pbuz1=pbuc1 lda #printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS sta.z buffer+1 - // [2527] phi utoa::started#2 = 0 [phi:utoa::@1->utoa::@6#1] -- vbum1=vbuc1 - lda #0 - sta started - // [2527] phi utoa::value#2 = utoa::value#1 [phi:utoa::@1->utoa::@6#2] -- register_copy - // [2527] phi utoa::digit#2 = 0 [phi:utoa::@1->utoa::@6#3] -- vbum1=vbuc1 + // [2937] phi utoa::started#2 = 0 [phi:utoa::@1->utoa::@6#1] -- vbuxx=vbuc1 + ldx #0 + // [2937] phi utoa::value#2 = utoa::value#1 [phi:utoa::@1->utoa::@6#2] -- register_copy + // [2937] phi utoa::digit#2 = 0 [phi:utoa::@1->utoa::@6#3] -- vbum1=vbuc1 + txa sta digit // utoa::@6 __b6: // max_digits-1 - // [2528] utoa::$4 = utoa::max_digits#7 - 1 -- vbuz1=vbum2_minus_1 - ldx max_digits - dex - stx.z utoa__4 + // [2938] utoa::$4 = utoa::max_digits#7 - 1 -- vbuaa=vbum1_minus_1 + lda max_digits + sec + sbc #1 // for( char digit=0; digit= digit_value) - // [2536] if(0!=utoa::started#2) goto utoa::@10 -- 0_neq_vbum1_then_la1 - lda started + // [2946] if(0!=utoa::started#2) goto utoa::@10 -- 0_neq_vbuxx_then_la1 + cpx #0 bne __b10 // utoa::@12 - // [2537] if(utoa::value#2>=utoa::digit_value#0) goto utoa::@10 -- vwum1_ge_vwum2_then_la1 - lda digit_value+1 + // [2947] if(utoa::value#2>=utoa::digit_value#0) goto utoa::@10 -- vwum1_ge_vwum2_then_la1 cmp value+1 bne !+ lda digit_value @@ -17430,142 +19664,132 @@ utoa: { beq __b10 !: bcc __b10 - // [2538] phi from utoa::@12 to utoa::@9 [phi:utoa::@12->utoa::@9] - // [2538] phi utoa::buffer#14 = utoa::buffer#11 [phi:utoa::@12->utoa::@9#0] -- register_copy - // [2538] phi utoa::started#4 = utoa::started#2 [phi:utoa::@12->utoa::@9#1] -- register_copy - // [2538] phi utoa::value#6 = utoa::value#2 [phi:utoa::@12->utoa::@9#2] -- register_copy + // [2948] phi from utoa::@12 to utoa::@9 [phi:utoa::@12->utoa::@9] + // [2948] phi utoa::buffer#14 = utoa::buffer#11 [phi:utoa::@12->utoa::@9#0] -- register_copy + // [2948] phi utoa::started#4 = utoa::started#2 [phi:utoa::@12->utoa::@9#1] -- register_copy + // [2948] phi utoa::value#6 = utoa::value#2 [phi:utoa::@12->utoa::@9#2] -- register_copy // utoa::@9 __b9: // for( char digit=0; digitutoa::@6] - // [2527] phi utoa::buffer#11 = utoa::buffer#14 [phi:utoa::@9->utoa::@6#0] -- register_copy - // [2527] phi utoa::started#2 = utoa::started#4 [phi:utoa::@9->utoa::@6#1] -- register_copy - // [2527] phi utoa::value#2 = utoa::value#6 [phi:utoa::@9->utoa::@6#2] -- register_copy - // [2527] phi utoa::digit#2 = utoa::digit#1 [phi:utoa::@9->utoa::@6#3] -- register_copy + // [2937] phi from utoa::@9 to utoa::@6 [phi:utoa::@9->utoa::@6] + // [2937] phi utoa::buffer#11 = utoa::buffer#14 [phi:utoa::@9->utoa::@6#0] -- register_copy + // [2937] phi utoa::started#2 = utoa::started#4 [phi:utoa::@9->utoa::@6#1] -- register_copy + // [2937] phi utoa::value#2 = utoa::value#6 [phi:utoa::@9->utoa::@6#2] -- register_copy + // [2937] phi utoa::digit#2 = utoa::digit#1 [phi:utoa::@9->utoa::@6#3] -- register_copy jmp __b6 // utoa::@10 __b10: // utoa_append(buffer++, value, digit_value) - // [2540] utoa_append::buffer#0 = utoa::buffer#11 -- pbuz1=pbuz2 + // [2950] utoa_append::buffer#0 = utoa::buffer#11 -- pbuz1=pbuz2 lda.z buffer sta.z utoa_append.buffer lda.z buffer+1 sta.z utoa_append.buffer+1 - // [2541] utoa_append::value#0 = utoa::value#2 - // [2542] utoa_append::sub#0 = utoa::digit_value#0 - // [2543] call utoa_append - // [2927] phi from utoa::@10 to utoa_append [phi:utoa::@10->utoa_append] + // [2951] utoa_append::value#0 = utoa::value#2 + // [2952] utoa_append::sub#0 = utoa::digit_value#0 + // [2953] call utoa_append + // [3425] phi from utoa::@10 to utoa_append [phi:utoa::@10->utoa_append] jsr utoa_append // utoa_append(buffer++, value, digit_value) - // [2544] utoa_append::return#0 = utoa_append::value#2 + // [2954] utoa_append::return#0 = utoa_append::value#2 // utoa::@11 // value = utoa_append(buffer++, value, digit_value) - // [2545] utoa::value#0 = utoa_append::return#0 + // [2955] utoa::value#0 = utoa_append::return#0 // value = utoa_append(buffer++, value, digit_value); - // [2546] utoa::buffer#4 = ++ utoa::buffer#11 -- pbuz1=_inc_pbuz1 + // [2956] utoa::buffer#4 = ++ utoa::buffer#11 -- pbuz1=_inc_pbuz1 inc.z buffer bne !+ inc.z buffer+1 !: - // [2538] phi from utoa::@11 to utoa::@9 [phi:utoa::@11->utoa::@9] - // [2538] phi utoa::buffer#14 = utoa::buffer#4 [phi:utoa::@11->utoa::@9#0] -- register_copy - // [2538] phi utoa::started#4 = 1 [phi:utoa::@11->utoa::@9#1] -- vbum1=vbuc1 - lda #1 - sta started - // [2538] phi utoa::value#6 = utoa::value#0 [phi:utoa::@11->utoa::@9#2] -- register_copy + // [2948] phi from utoa::@11 to utoa::@9 [phi:utoa::@11->utoa::@9] + // [2948] phi utoa::buffer#14 = utoa::buffer#4 [phi:utoa::@11->utoa::@9#0] -- register_copy + // [2948] phi utoa::started#4 = 1 [phi:utoa::@11->utoa::@9#1] -- vbuxx=vbuc1 + ldx #1 + // [2948] phi utoa::value#6 = utoa::value#0 [phi:utoa::@11->utoa::@9#2] -- register_copy jmp __b9 .segment Data - digit_value: .word 0 - digit: .byte 0 - .label value = printf_uint.uvalue - .label radix = printf_uint.format_radix - started: .byte 0 - max_digits: .byte 0 + .label digit_value = fgets.remaining + .label digit = uctoa.digit + .label value = strncmp.n + .label max_digits = printf_string.format_justify_left } .segment Code // insertup // Insert a new line, and scroll the upper part of the screen up. // void insertup(char rows) insertup: { - .label insertup__0 = $36 - .label insertup__4 = $2b - .label insertup__6 = $2c - .label insertup__7 = $2b // __conio.width+1 - // [2547] insertup::$0 = *((char *)&__conio+6) + 1 -- vbuz1=_deref_pbuc1_plus_1 + // [2957] insertup::$0 = *((char *)&__conio+6) + 1 -- vbuaa=_deref_pbuc1_plus_1 lda __conio+6 inc - sta.z insertup__0 // unsigned char width = (__conio.width+1) * 2 - // [2548] insertup::width#0 = insertup::$0 << 1 -- vbum1=vbuz2_rol_1 + // [2958] insertup::width#0 = insertup::$0 << 1 -- vbum1=vbuaa_rol_1 // {asm{.byte $db}} asl sta width - // [2549] phi from insertup to insertup::@1 [phi:insertup->insertup::@1] - // [2549] phi insertup::y#2 = 0 [phi:insertup->insertup::@1#0] -- vbum1=vbuc1 + // [2959] phi from insertup to insertup::@1 [phi:insertup->insertup::@1] + // [2959] phi insertup::y#2 = 0 [phi:insertup->insertup::@1#0] -- vbum1=vbuc1 lda #0 sta y // insertup::@1 __b1: // for(unsigned char y=0; y<__conio.cursor_y; y++) - // [2550] if(insertup::y#2<*((char *)&__conio+1)) goto insertup::@2 -- vbum1_lt__deref_pbuc1_then_la1 + // [2960] if(insertup::y#2<*((char *)&__conio+1)) goto insertup::@2 -- vbum1_lt__deref_pbuc1_then_la1 lda y cmp __conio+1 bcc __b2 - // [2551] phi from insertup::@1 to insertup::@3 [phi:insertup::@1->insertup::@3] + // [2961] phi from insertup::@1 to insertup::@3 [phi:insertup::@1->insertup::@3] // insertup::@3 // clearline() - // [2552] call clearline + // [2962] call clearline jsr clearline // insertup::@return // } - // [2553] return + // [2963] return rts // insertup::@2 __b2: // y+1 - // [2554] insertup::$4 = insertup::y#2 + 1 -- vbuz1=vbum2_plus_1 - lda y - inc - sta.z insertup__4 + // [2964] insertup::$4 = insertup::y#2 + 1 -- vbuxx=vbum1_plus_1 + ldx y + inx // memcpy8_vram_vram(__conio.mapbase_bank, __conio.offsets[y], __conio.mapbase_bank, __conio.offsets[y+1], width) - // [2555] insertup::$6 = insertup::y#2 << 1 -- vbuz1=vbum2_rol_1 + // [2965] insertup::$6 = insertup::y#2 << 1 -- vbuyy=vbum1_rol_1 lda y asl - sta.z insertup__6 - // [2556] insertup::$7 = insertup::$4 << 1 -- vbuz1=vbuz1_rol_1 - asl.z insertup__7 - // [2557] memcpy8_vram_vram::dbank_vram#0 = *((char *)&__conio+5) -- vbum1=_deref_pbuc1 + tay + // [2966] insertup::$7 = insertup::$4 << 1 -- vbuxx=vbuxx_rol_1 + txa + asl + tax + // [2967] memcpy8_vram_vram::dbank_vram#0 = *((char *)&__conio+5) -- vbum1=_deref_pbuc1 lda __conio+5 sta memcpy8_vram_vram.dbank_vram - // [2558] memcpy8_vram_vram::doffset_vram#0 = ((unsigned int *)&__conio+$15)[insertup::$6] -- vwum1=pwuc1_derefidx_vbuz2 - ldy.z insertup__6 + // [2968] memcpy8_vram_vram::doffset_vram#0 = ((unsigned int *)&__conio+$15)[insertup::$6] -- vwum1=pwuc1_derefidx_vbuyy lda __conio+$15,y sta memcpy8_vram_vram.doffset_vram lda __conio+$15+1,y sta memcpy8_vram_vram.doffset_vram+1 - // [2559] memcpy8_vram_vram::sbank_vram#0 = *((char *)&__conio+5) -- vbum1=_deref_pbuc1 + // [2969] memcpy8_vram_vram::sbank_vram#0 = *((char *)&__conio+5) -- vbum1=_deref_pbuc1 lda __conio+5 sta memcpy8_vram_vram.sbank_vram - // [2560] memcpy8_vram_vram::soffset_vram#0 = ((unsigned int *)&__conio+$15)[insertup::$7] -- vwum1=pwuc1_derefidx_vbuz2 - ldy.z insertup__7 - lda __conio+$15,y + // [2970] memcpy8_vram_vram::soffset_vram#0 = ((unsigned int *)&__conio+$15)[insertup::$7] -- vwum1=pwuc1_derefidx_vbuxx + lda __conio+$15,x sta memcpy8_vram_vram.soffset_vram - lda __conio+$15+1,y + lda __conio+$15+1,x sta memcpy8_vram_vram.soffset_vram+1 - // [2561] memcpy8_vram_vram::num8#1 = insertup::width#0 -- vbum1=vbum2 - lda width - sta memcpy8_vram_vram.num8_1 - // [2562] call memcpy8_vram_vram + // [2971] memcpy8_vram_vram::num8#1 = insertup::width#0 -- vbuyy=vbum1 + ldy width + // [2972] call memcpy8_vram_vram jsr memcpy8_vram_vram // insertup::@4 // for(unsigned char y=0; y<__conio.cursor_y; y++) - // [2563] insertup::y#1 = ++ insertup::y#2 -- vbum1=_inc_vbum1 + // [2973] insertup::y#1 = ++ insertup::y#2 -- vbum1=_inc_vbum1 inc y - // [2549] phi from insertup::@4 to insertup::@1 [phi:insertup::@4->insertup::@1] - // [2549] phi insertup::y#2 = insertup::y#1 [phi:insertup::@4->insertup::@1#0] -- register_copy + // [2959] phi from insertup::@4 to insertup::@1 [phi:insertup::@4->insertup::@1] + // [2959] phi insertup::y#2 = insertup::y#1 [phi:insertup::@4->insertup::@1#0] -- register_copy jmp __b1 .segment Data width: .byte 0 @@ -17574,78 +19798,68 @@ insertup: { .segment Code // clearline clearline: { - .label clearline__0 = $24 - .label clearline__1 = $25 - .label clearline__2 = $26 - .label clearline__3 = $23 - .label c = $22 // unsigned int addr = __conio.offsets[__conio.cursor_y] - // [2564] clearline::$3 = *((char *)&__conio+1) << 1 -- vbuz1=_deref_pbuc1_rol_1 + // [2974] clearline::$3 = *((char *)&__conio+1) << 1 -- vbuaa=_deref_pbuc1_rol_1 lda __conio+1 asl - sta.z clearline__3 - // [2565] clearline::addr#0 = ((unsigned int *)&__conio+$15)[clearline::$3] -- vwum1=pwuc1_derefidx_vbuz2 + // [2975] clearline::addr#0 = ((unsigned int *)&__conio+$15)[clearline::$3] -- vwum1=pwuc1_derefidx_vbuaa tay lda __conio+$15,y sta addr lda __conio+$15+1,y sta addr+1 // *VERA_CTRL &= ~VERA_ADDRSEL - // [2566] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [2976] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_ADDRSEL^$ff and VERA_CTRL sta VERA_CTRL // BYTE0(addr) - // [2567] clearline::$0 = byte0 clearline::addr#0 -- vbuz1=_byte0_vwum2 + // [2977] clearline::$0 = byte0 clearline::addr#0 -- vbuaa=_byte0_vwum1 lda addr - sta.z clearline__0 // *VERA_ADDRX_L = BYTE0(addr) - // [2568] *VERA_ADDRX_L = clearline::$0 -- _deref_pbuc1=vbuz1 + // [2978] *VERA_ADDRX_L = clearline::$0 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_L // BYTE1(addr) - // [2569] clearline::$1 = byte1 clearline::addr#0 -- vbuz1=_byte1_vwum2 + // [2979] clearline::$1 = byte1 clearline::addr#0 -- vbuaa=_byte1_vwum1 lda addr+1 - sta.z clearline__1 // *VERA_ADDRX_M = BYTE1(addr) - // [2570] *VERA_ADDRX_M = clearline::$1 -- _deref_pbuc1=vbuz1 + // [2980] *VERA_ADDRX_M = clearline::$1 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_M // __conio.mapbase_bank | VERA_INC_1 - // [2571] clearline::$2 = *((char *)&__conio+5) | VERA_INC_1 -- vbuz1=_deref_pbuc1_bor_vbuc2 + // [2981] clearline::$2 = *((char *)&__conio+5) | VERA_INC_1 -- vbuaa=_deref_pbuc1_bor_vbuc2 lda #VERA_INC_1 ora __conio+5 - sta.z clearline__2 // *VERA_ADDRX_H = __conio.mapbase_bank | VERA_INC_1 - // [2572] *VERA_ADDRX_H = clearline::$2 -- _deref_pbuc1=vbuz1 + // [2982] *VERA_ADDRX_H = clearline::$2 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_H // register unsigned char c=__conio.width - // [2573] clearline::c#0 = *((char *)&__conio+6) -- vbuz1=_deref_pbuc1 - lda __conio+6 - sta.z c - // [2574] phi from clearline clearline::@1 to clearline::@1 [phi:clearline/clearline::@1->clearline::@1] - // [2574] phi clearline::c#2 = clearline::c#0 [phi:clearline/clearline::@1->clearline::@1#0] -- register_copy + // [2983] clearline::c#0 = *((char *)&__conio+6) -- vbuxx=_deref_pbuc1 + ldx __conio+6 + // [2984] phi from clearline clearline::@1 to clearline::@1 [phi:clearline/clearline::@1->clearline::@1] + // [2984] phi clearline::c#2 = clearline::c#0 [phi:clearline/clearline::@1->clearline::@1#0] -- register_copy // clearline::@1 __b1: // *VERA_DATA0 = ' ' - // [2575] *VERA_DATA0 = ' ' -- _deref_pbuc1=vbuc2 + // [2985] *VERA_DATA0 = ' ' -- _deref_pbuc1=vbuc2 lda #' ' sta VERA_DATA0 // *VERA_DATA0 = __conio.color - // [2576] *VERA_DATA0 = *((char *)&__conio+$d) -- _deref_pbuc1=_deref_pbuc2 + // [2986] *VERA_DATA0 = *((char *)&__conio+$d) -- _deref_pbuc1=_deref_pbuc2 lda __conio+$d sta VERA_DATA0 // c--; - // [2577] clearline::c#1 = -- clearline::c#2 -- vbuz1=_dec_vbuz1 - dec.z c + // [2987] clearline::c#1 = -- clearline::c#2 -- vbuxx=_dec_vbuxx + dex // while(c) - // [2578] if(0!=clearline::c#1) goto clearline::@1 -- 0_neq_vbuz1_then_la1 - lda.z c + // [2988] if(0!=clearline::c#1) goto clearline::@1 -- 0_neq_vbuxx_then_la1 + cpx #0 bne __b1 // clearline::@return // } - // [2579] return + // [2989] return rts .segment Data - addr: .word 0 + .label addr = memcpy8_vram_vram.doffset_vram } .segment Code // cx16_k_screen_set_mode @@ -17657,7 +19871,7 @@ clearline: { // char cx16_k_screen_set_mode(__mem() volatile char mode) cx16_k_screen_set_mode: { // cx16_k_screen_mode_error_t error = 0 - // [2580] cx16_k_screen_set_mode::error = 0 -- vbum1=vbuc1 + // [2990] cx16_k_screen_set_mode::error = 0 -- vbum1=vbuc1 lda #0 sta error // asm @@ -17668,7 +19882,7 @@ cx16_k_screen_set_mode: { rol error // cx16_k_screen_set_mode::@return // } - // [2582] return + // [2992] return rts .segment Data mode: .byte 0 @@ -17690,572 +19904,506 @@ cx16_k_screen_set_mode: { */ // void display_frame(char x0, char y0, __mem() char x1, __mem() char y1) display_frame: { - .label w = $43 - .label h = $46 - .label x = $fb - .label mask = $e0 - .label c = $dc - .label y_1 = $f7 // unsigned char w = x1 - x0 - // [2584] display_frame::w#0 = display_frame::x1#16 - display_frame::x#0 -- vbuz1=vbum2_minus_vbuz3 + // [2994] display_frame::w#0 = display_frame::x1#16 - display_frame::x#0 -- vbum1=vbum2_minus_vbum3 lda x1 sec - sbc.z x - sta.z w + sbc x + sta w // unsigned char h = y1 - y0 - // [2585] display_frame::h#0 = display_frame::y1#16 - display_frame::y#0 -- vbuz1=vbum2_minus_vbum3 + // [2995] display_frame::h#0 = display_frame::y1#16 - display_frame::y#0 -- vbum1=vbum2_minus_vbum3 lda y1 sec sbc y - sta.z h + sta h // unsigned char mask = display_frame_maskxy(x, y) - // [2586] display_frame_maskxy::x#0 = display_frame::x#0 - // [2587] display_frame_maskxy::y#0 = display_frame::y#0 - // [2588] call display_frame_maskxy - // [2954] phi from display_frame to display_frame_maskxy [phi:display_frame->display_frame_maskxy] - // [2954] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#0 [phi:display_frame->display_frame_maskxy#0] -- vbum1=vbum2 - lda display_frame_maskxy.y - sta display_frame_maskxy.cpeekcxy1_y - // [2954] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#0 [phi:display_frame->display_frame_maskxy#1] -- vbum1=vbuz2 - lda.z display_frame_maskxy.x - sta display_frame_maskxy.cpeekcxy1_x + // [2996] display_frame_maskxy::x#0 = display_frame::x#0 -- vbuyy=vbum1 + ldy x + // [2997] display_frame_maskxy::y#0 = display_frame::y#0 -- vbuaa=vbum1 + lda y + // [2998] call display_frame_maskxy + // [3452] phi from display_frame to display_frame_maskxy [phi:display_frame->display_frame_maskxy] + // [3452] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#0 [phi:display_frame->display_frame_maskxy#0] -- register_copy + // [3452] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#0 [phi:display_frame->display_frame_maskxy#1] -- register_copy jsr display_frame_maskxy // unsigned char mask = display_frame_maskxy(x, y) - // [2589] display_frame_maskxy::return#13 = display_frame_maskxy::return#12 + // [2999] display_frame_maskxy::return#13 = display_frame_maskxy::return#12 // display_frame::@13 - // [2590] display_frame::mask#0 = display_frame_maskxy::return#13 + // [3000] display_frame::mask#0 = display_frame_maskxy::return#13 // mask |= 0b0110 - // [2591] display_frame::mask#1 = display_frame::mask#0 | 6 -- vbuz1=vbuz1_bor_vbuc1 - lda #6 - ora.z mask - sta.z mask + // [3001] display_frame::mask#1 = display_frame::mask#0 | 6 -- vbuaa=vbuaa_bor_vbuc1 + ora #6 // unsigned char c = display_frame_char(mask) - // [2592] display_frame_char::mask#0 = display_frame::mask#1 - // [2593] call display_frame_char + // [3002] display_frame_char::mask#0 = display_frame::mask#1 + // [3003] call display_frame_char // Add a corner. - // [2980] phi from display_frame::@13 to display_frame_char [phi:display_frame::@13->display_frame_char] - // [2980] phi display_frame_char::mask#10 = display_frame_char::mask#0 [phi:display_frame::@13->display_frame_char#0] -- register_copy + // [3478] phi from display_frame::@13 to display_frame_char [phi:display_frame::@13->display_frame_char] + // [3478] phi display_frame_char::mask#10 = display_frame_char::mask#0 [phi:display_frame::@13->display_frame_char#0] -- register_copy jsr display_frame_char // unsigned char c = display_frame_char(mask) - // [2594] display_frame_char::return#13 = display_frame_char::return#12 + // [3004] display_frame_char::return#13 = display_frame_char::return#12 // display_frame::@14 - // [2595] display_frame::c#0 = display_frame_char::return#13 + // [3005] display_frame::c#0 = display_frame_char::return#13 -- vbuxx=vbuaa + tax // cputcxy(x, y, c) - // [2596] cputcxy::x#0 = display_frame::x#0 -- vbum1=vbuz2 - lda.z x - sta cputcxy.x - // [2597] cputcxy::y#0 = display_frame::y#0 -- vbum1=vbum2 + // [3006] cputcxy::x#0 = display_frame::x#0 -- vbuyy=vbum1 + ldy x + // [3007] cputcxy::y#0 = display_frame::y#0 -- vbuaa=vbum1 lda y - sta cputcxy.y - // [2598] cputcxy::c#0 = display_frame::c#0 -- vbum1=vbuz2 - lda.z c - sta cputcxy.c - // [2599] call cputcxy - // [2147] phi from display_frame::@14 to cputcxy [phi:display_frame::@14->cputcxy] - // [2147] phi cputcxy::c#15 = cputcxy::c#0 [phi:display_frame::@14->cputcxy#0] -- register_copy - // [2147] phi cputcxy::y#15 = cputcxy::y#0 [phi:display_frame::@14->cputcxy#1] -- register_copy - // [2147] phi cputcxy::x#15 = cputcxy::x#0 [phi:display_frame::@14->cputcxy#2] -- register_copy + // [3008] cputcxy::c#0 = display_frame::c#0 + // [3009] call cputcxy + // [2273] phi from display_frame::@14 to cputcxy [phi:display_frame::@14->cputcxy] + // [2273] phi cputcxy::c#17 = cputcxy::c#0 [phi:display_frame::@14->cputcxy#0] -- register_copy + // [2273] phi cputcxy::y#17 = cputcxy::y#0 [phi:display_frame::@14->cputcxy#1] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#0 [phi:display_frame::@14->cputcxy#2] -- register_copy jsr cputcxy // display_frame::@15 // if(w>=2) - // [2600] if(display_frame::w#0<2) goto display_frame::@36 -- vbuz1_lt_vbuc1_then_la1 - lda.z w + // [3010] if(display_frame::w#0<2) goto display_frame::@36 -- vbum1_lt_vbuc1_then_la1 + lda w cmp #2 bcs !__b36+ jmp __b36 !__b36: // display_frame::@2 // x++; - // [2601] display_frame::x#1 = ++ display_frame::x#0 -- vbum1=_inc_vbuz2 - lda.z x + // [3011] display_frame::x#1 = ++ display_frame::x#0 -- vbum1=_inc_vbum2 + lda x inc sta x_1 - // [2602] phi from display_frame::@2 display_frame::@21 to display_frame::@4 [phi:display_frame::@2/display_frame::@21->display_frame::@4] - // [2602] phi display_frame::x#10 = display_frame::x#1 [phi:display_frame::@2/display_frame::@21->display_frame::@4#0] -- register_copy + // [3012] phi from display_frame::@2 display_frame::@21 to display_frame::@4 [phi:display_frame::@2/display_frame::@21->display_frame::@4] + // [3012] phi display_frame::x#10 = display_frame::x#1 [phi:display_frame::@2/display_frame::@21->display_frame::@4#0] -- register_copy // display_frame::@4 __b4: // while(x < x1) - // [2603] if(display_frame::x#10display_frame::@1] - // [2604] phi display_frame::x#24 = display_frame::x#30 [phi:display_frame::@36/display_frame::@4->display_frame::@1#0] -- register_copy + // [3014] phi from display_frame::@36 display_frame::@4 to display_frame::@1 [phi:display_frame::@36/display_frame::@4->display_frame::@1] + // [3014] phi display_frame::x#24 = display_frame::x#30 [phi:display_frame::@36/display_frame::@4->display_frame::@1#0] -- register_copy // display_frame::@1 __b1: // display_frame_maskxy(x, y) - // [2605] display_frame_maskxy::x#1 = display_frame::x#24 - // [2606] display_frame_maskxy::y#1 = display_frame::y#0 - // [2607] call display_frame_maskxy - // [2954] phi from display_frame::@1 to display_frame_maskxy [phi:display_frame::@1->display_frame_maskxy] - // [2954] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#1 [phi:display_frame::@1->display_frame_maskxy#0] -- vbum1=vbum2 - lda display_frame_maskxy.y - sta display_frame_maskxy.cpeekcxy1_y - // [2954] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#1 [phi:display_frame::@1->display_frame_maskxy#1] -- vbum1=vbum2 - lda display_frame_maskxy.x_1 - sta display_frame_maskxy.cpeekcxy1_x + // [3015] display_frame_maskxy::x#1 = display_frame::x#24 -- vbuyy=vbum1 + ldy x_1 + // [3016] display_frame_maskxy::y#1 = display_frame::y#0 -- vbuaa=vbum1 + lda y + // [3017] call display_frame_maskxy + // [3452] phi from display_frame::@1 to display_frame_maskxy [phi:display_frame::@1->display_frame_maskxy] + // [3452] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#1 [phi:display_frame::@1->display_frame_maskxy#0] -- register_copy + // [3452] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#1 [phi:display_frame::@1->display_frame_maskxy#1] -- register_copy jsr display_frame_maskxy // display_frame_maskxy(x, y) - // [2608] display_frame_maskxy::return#14 = display_frame_maskxy::return#12 + // [3018] display_frame_maskxy::return#14 = display_frame_maskxy::return#12 // display_frame::@16 // mask = display_frame_maskxy(x, y) - // [2609] display_frame::mask#2 = display_frame_maskxy::return#14 + // [3019] display_frame::mask#2 = display_frame_maskxy::return#14 // mask |= 0b0011 - // [2610] display_frame::mask#3 = display_frame::mask#2 | 3 -- vbuz1=vbuz1_bor_vbuc1 - lda #3 - ora.z mask - sta.z mask + // [3020] display_frame::mask#3 = display_frame::mask#2 | 3 -- vbuaa=vbuaa_bor_vbuc1 + ora #3 // display_frame_char(mask) - // [2611] display_frame_char::mask#1 = display_frame::mask#3 - // [2612] call display_frame_char - // [2980] phi from display_frame::@16 to display_frame_char [phi:display_frame::@16->display_frame_char] - // [2980] phi display_frame_char::mask#10 = display_frame_char::mask#1 [phi:display_frame::@16->display_frame_char#0] -- register_copy + // [3021] display_frame_char::mask#1 = display_frame::mask#3 + // [3022] call display_frame_char + // [3478] phi from display_frame::@16 to display_frame_char [phi:display_frame::@16->display_frame_char] + // [3478] phi display_frame_char::mask#10 = display_frame_char::mask#1 [phi:display_frame::@16->display_frame_char#0] -- register_copy jsr display_frame_char // display_frame_char(mask) - // [2613] display_frame_char::return#14 = display_frame_char::return#12 + // [3023] display_frame_char::return#14 = display_frame_char::return#12 // display_frame::@17 // c = display_frame_char(mask) - // [2614] display_frame::c#1 = display_frame_char::return#14 + // [3024] display_frame::c#1 = display_frame_char::return#14 -- vbuxx=vbuaa + tax // cputcxy(x, y, c) - // [2615] cputcxy::x#1 = display_frame::x#24 -- vbum1=vbum2 - lda x_1 - sta cputcxy.x - // [2616] cputcxy::y#1 = display_frame::y#0 -- vbum1=vbum2 + // [3025] cputcxy::x#1 = display_frame::x#24 -- vbuyy=vbum1 + ldy x_1 + // [3026] cputcxy::y#1 = display_frame::y#0 -- vbuaa=vbum1 lda y - sta cputcxy.y - // [2617] cputcxy::c#1 = display_frame::c#1 -- vbum1=vbuz2 - lda.z c - sta cputcxy.c - // [2618] call cputcxy - // [2147] phi from display_frame::@17 to cputcxy [phi:display_frame::@17->cputcxy] - // [2147] phi cputcxy::c#15 = cputcxy::c#1 [phi:display_frame::@17->cputcxy#0] -- register_copy - // [2147] phi cputcxy::y#15 = cputcxy::y#1 [phi:display_frame::@17->cputcxy#1] -- register_copy - // [2147] phi cputcxy::x#15 = cputcxy::x#1 [phi:display_frame::@17->cputcxy#2] -- register_copy + // [3027] cputcxy::c#1 = display_frame::c#1 + // [3028] call cputcxy + // [2273] phi from display_frame::@17 to cputcxy [phi:display_frame::@17->cputcxy] + // [2273] phi cputcxy::c#17 = cputcxy::c#1 [phi:display_frame::@17->cputcxy#0] -- register_copy + // [2273] phi cputcxy::y#17 = cputcxy::y#1 [phi:display_frame::@17->cputcxy#1] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#1 [phi:display_frame::@17->cputcxy#2] -- register_copy jsr cputcxy // display_frame::@18 // if(h>=2) - // [2619] if(display_frame::h#0<2) goto display_frame::@return -- vbuz1_lt_vbuc1_then_la1 - lda.z h + // [3029] if(display_frame::h#0<2) goto display_frame::@return -- vbum1_lt_vbuc1_then_la1 + lda h cmp #2 bcc __breturn // display_frame::@3 // y++; - // [2620] display_frame::y#1 = ++ display_frame::y#0 -- vbuz1=_inc_vbum2 + // [3030] display_frame::y#1 = ++ display_frame::y#0 -- vbum1=_inc_vbum2 lda y inc - sta.z y_1 - // [2621] phi from display_frame::@27 display_frame::@3 to display_frame::@6 [phi:display_frame::@27/display_frame::@3->display_frame::@6] - // [2621] phi display_frame::y#10 = display_frame::y#2 [phi:display_frame::@27/display_frame::@3->display_frame::@6#0] -- register_copy + sta y_1 + // [3031] phi from display_frame::@27 display_frame::@3 to display_frame::@6 [phi:display_frame::@27/display_frame::@3->display_frame::@6] + // [3031] phi display_frame::y#10 = display_frame::y#2 [phi:display_frame::@27/display_frame::@3->display_frame::@6#0] -- register_copy // display_frame::@6 __b6: // while(y < y1) - // [2622] if(display_frame::y#10display_frame_maskxy] - // [2954] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#5 [phi:display_frame::@8->display_frame_maskxy#0] -- vbum1=vbuz2 - lda.z display_frame_maskxy.y_1 - sta display_frame_maskxy.cpeekcxy1_y - // [2954] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#5 [phi:display_frame::@8->display_frame_maskxy#1] -- vbum1=vbuz2 - lda.z display_frame_maskxy.x - sta display_frame_maskxy.cpeekcxy1_x + // [3033] display_frame_maskxy::x#5 = display_frame::x#0 -- vbuyy=vbum1 + ldy x + // [3034] display_frame_maskxy::y#5 = display_frame::y#10 -- vbuaa=vbum1 + // [3035] call display_frame_maskxy + // [3452] phi from display_frame::@8 to display_frame_maskxy [phi:display_frame::@8->display_frame_maskxy] + // [3452] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#5 [phi:display_frame::@8->display_frame_maskxy#0] -- register_copy + // [3452] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#5 [phi:display_frame::@8->display_frame_maskxy#1] -- register_copy jsr display_frame_maskxy // display_frame_maskxy(x, y) - // [2626] display_frame_maskxy::return#18 = display_frame_maskxy::return#12 + // [3036] display_frame_maskxy::return#18 = display_frame_maskxy::return#12 // display_frame::@28 // mask = display_frame_maskxy(x, y) - // [2627] display_frame::mask#10 = display_frame_maskxy::return#18 + // [3037] display_frame::mask#10 = display_frame_maskxy::return#18 // mask |= 0b1100 - // [2628] display_frame::mask#11 = display_frame::mask#10 | $c -- vbuz1=vbuz1_bor_vbuc1 - lda #$c - ora.z mask - sta.z mask + // [3038] display_frame::mask#11 = display_frame::mask#10 | $c -- vbuaa=vbuaa_bor_vbuc1 + ora #$c // display_frame_char(mask) - // [2629] display_frame_char::mask#5 = display_frame::mask#11 - // [2630] call display_frame_char - // [2980] phi from display_frame::@28 to display_frame_char [phi:display_frame::@28->display_frame_char] - // [2980] phi display_frame_char::mask#10 = display_frame_char::mask#5 [phi:display_frame::@28->display_frame_char#0] -- register_copy + // [3039] display_frame_char::mask#5 = display_frame::mask#11 + // [3040] call display_frame_char + // [3478] phi from display_frame::@28 to display_frame_char [phi:display_frame::@28->display_frame_char] + // [3478] phi display_frame_char::mask#10 = display_frame_char::mask#5 [phi:display_frame::@28->display_frame_char#0] -- register_copy jsr display_frame_char // display_frame_char(mask) - // [2631] display_frame_char::return#18 = display_frame_char::return#12 + // [3041] display_frame_char::return#18 = display_frame_char::return#12 // display_frame::@29 // c = display_frame_char(mask) - // [2632] display_frame::c#5 = display_frame_char::return#18 + // [3042] display_frame::c#5 = display_frame_char::return#18 -- vbuxx=vbuaa + tax // cputcxy(x, y, c) - // [2633] cputcxy::x#5 = display_frame::x#0 -- vbum1=vbuz2 - lda.z x - sta cputcxy.x - // [2634] cputcxy::y#5 = display_frame::y#10 -- vbum1=vbuz2 - lda.z y_1 - sta cputcxy.y - // [2635] cputcxy::c#5 = display_frame::c#5 -- vbum1=vbuz2 - lda.z c - sta cputcxy.c - // [2636] call cputcxy - // [2147] phi from display_frame::@29 to cputcxy [phi:display_frame::@29->cputcxy] - // [2147] phi cputcxy::c#15 = cputcxy::c#5 [phi:display_frame::@29->cputcxy#0] -- register_copy - // [2147] phi cputcxy::y#15 = cputcxy::y#5 [phi:display_frame::@29->cputcxy#1] -- register_copy - // [2147] phi cputcxy::x#15 = cputcxy::x#5 [phi:display_frame::@29->cputcxy#2] -- register_copy + // [3043] cputcxy::x#5 = display_frame::x#0 -- vbuyy=vbum1 + ldy x + // [3044] cputcxy::y#5 = display_frame::y#10 -- vbuaa=vbum1 + lda y_1 + // [3045] cputcxy::c#5 = display_frame::c#5 + // [3046] call cputcxy + // [2273] phi from display_frame::@29 to cputcxy [phi:display_frame::@29->cputcxy] + // [2273] phi cputcxy::c#17 = cputcxy::c#5 [phi:display_frame::@29->cputcxy#0] -- register_copy + // [2273] phi cputcxy::y#17 = cputcxy::y#5 [phi:display_frame::@29->cputcxy#1] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#5 [phi:display_frame::@29->cputcxy#2] -- register_copy jsr cputcxy // display_frame::@30 // if(w>=2) - // [2637] if(display_frame::w#0<2) goto display_frame::@10 -- vbuz1_lt_vbuc1_then_la1 - lda.z w + // [3047] if(display_frame::w#0<2) goto display_frame::@10 -- vbum1_lt_vbuc1_then_la1 + lda w cmp #2 bcc __b10 // display_frame::@9 // x++; - // [2638] display_frame::x#4 = ++ display_frame::x#0 -- vbuz1=_inc_vbuz1 - inc.z x - // [2639] phi from display_frame::@35 display_frame::@9 to display_frame::@11 [phi:display_frame::@35/display_frame::@9->display_frame::@11] - // [2639] phi display_frame::x#18 = display_frame::x#5 [phi:display_frame::@35/display_frame::@9->display_frame::@11#0] -- register_copy + // [3048] display_frame::x#4 = ++ display_frame::x#0 -- vbum1=_inc_vbum1 + inc x + // [3049] phi from display_frame::@35 display_frame::@9 to display_frame::@11 [phi:display_frame::@35/display_frame::@9->display_frame::@11] + // [3049] phi display_frame::x#18 = display_frame::x#5 [phi:display_frame::@35/display_frame::@9->display_frame::@11#0] -- register_copy // display_frame::@11 __b11: // while(x < x1) - // [2640] if(display_frame::x#18display_frame::@10] - // [2641] phi display_frame::x#15 = display_frame::x#18 [phi:display_frame::@11/display_frame::@30->display_frame::@10#0] -- register_copy + // [3051] phi from display_frame::@11 display_frame::@30 to display_frame::@10 [phi:display_frame::@11/display_frame::@30->display_frame::@10] + // [3051] phi display_frame::x#15 = display_frame::x#18 [phi:display_frame::@11/display_frame::@30->display_frame::@10#0] -- register_copy // display_frame::@10 __b10: // display_frame_maskxy(x, y) - // [2642] display_frame_maskxy::x#6 = display_frame::x#15 - // [2643] display_frame_maskxy::y#6 = display_frame::y#10 - // [2644] call display_frame_maskxy - // [2954] phi from display_frame::@10 to display_frame_maskxy [phi:display_frame::@10->display_frame_maskxy] - // [2954] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#6 [phi:display_frame::@10->display_frame_maskxy#0] -- vbum1=vbuz2 - lda.z display_frame_maskxy.y_1 - sta display_frame_maskxy.cpeekcxy1_y - // [2954] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#6 [phi:display_frame::@10->display_frame_maskxy#1] -- vbum1=vbuz2 - lda.z display_frame_maskxy.x - sta display_frame_maskxy.cpeekcxy1_x + // [3052] display_frame_maskxy::x#6 = display_frame::x#15 -- vbuyy=vbum1 + ldy x + // [3053] display_frame_maskxy::y#6 = display_frame::y#10 -- vbuaa=vbum1 + lda y_1 + // [3054] call display_frame_maskxy + // [3452] phi from display_frame::@10 to display_frame_maskxy [phi:display_frame::@10->display_frame_maskxy] + // [3452] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#6 [phi:display_frame::@10->display_frame_maskxy#0] -- register_copy + // [3452] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#6 [phi:display_frame::@10->display_frame_maskxy#1] -- register_copy jsr display_frame_maskxy // display_frame_maskxy(x, y) - // [2645] display_frame_maskxy::return#19 = display_frame_maskxy::return#12 + // [3055] display_frame_maskxy::return#19 = display_frame_maskxy::return#12 // display_frame::@31 // mask = display_frame_maskxy(x, y) - // [2646] display_frame::mask#12 = display_frame_maskxy::return#19 + // [3056] display_frame::mask#12 = display_frame_maskxy::return#19 // mask |= 0b1001 - // [2647] display_frame::mask#13 = display_frame::mask#12 | 9 -- vbuz1=vbuz1_bor_vbuc1 - lda #9 - ora.z mask - sta.z mask + // [3057] display_frame::mask#13 = display_frame::mask#12 | 9 -- vbuaa=vbuaa_bor_vbuc1 + ora #9 // display_frame_char(mask) - // [2648] display_frame_char::mask#6 = display_frame::mask#13 - // [2649] call display_frame_char - // [2980] phi from display_frame::@31 to display_frame_char [phi:display_frame::@31->display_frame_char] - // [2980] phi display_frame_char::mask#10 = display_frame_char::mask#6 [phi:display_frame::@31->display_frame_char#0] -- register_copy + // [3058] display_frame_char::mask#6 = display_frame::mask#13 + // [3059] call display_frame_char + // [3478] phi from display_frame::@31 to display_frame_char [phi:display_frame::@31->display_frame_char] + // [3478] phi display_frame_char::mask#10 = display_frame_char::mask#6 [phi:display_frame::@31->display_frame_char#0] -- register_copy jsr display_frame_char // display_frame_char(mask) - // [2650] display_frame_char::return#19 = display_frame_char::return#12 + // [3060] display_frame_char::return#19 = display_frame_char::return#12 // display_frame::@32 // c = display_frame_char(mask) - // [2651] display_frame::c#6 = display_frame_char::return#19 + // [3061] display_frame::c#6 = display_frame_char::return#19 -- vbuxx=vbuaa + tax // cputcxy(x, y, c) - // [2652] cputcxy::x#6 = display_frame::x#15 -- vbum1=vbuz2 - lda.z x - sta cputcxy.x - // [2653] cputcxy::y#6 = display_frame::y#10 -- vbum1=vbuz2 - lda.z y_1 - sta cputcxy.y - // [2654] cputcxy::c#6 = display_frame::c#6 -- vbum1=vbuz2 - lda.z c - sta cputcxy.c - // [2655] call cputcxy - // [2147] phi from display_frame::@32 to cputcxy [phi:display_frame::@32->cputcxy] - // [2147] phi cputcxy::c#15 = cputcxy::c#6 [phi:display_frame::@32->cputcxy#0] -- register_copy - // [2147] phi cputcxy::y#15 = cputcxy::y#6 [phi:display_frame::@32->cputcxy#1] -- register_copy - // [2147] phi cputcxy::x#15 = cputcxy::x#6 [phi:display_frame::@32->cputcxy#2] -- register_copy + // [3062] cputcxy::x#6 = display_frame::x#15 -- vbuyy=vbum1 + ldy x + // [3063] cputcxy::y#6 = display_frame::y#10 -- vbuaa=vbum1 + lda y_1 + // [3064] cputcxy::c#6 = display_frame::c#6 + // [3065] call cputcxy + // [2273] phi from display_frame::@32 to cputcxy [phi:display_frame::@32->cputcxy] + // [2273] phi cputcxy::c#17 = cputcxy::c#6 [phi:display_frame::@32->cputcxy#0] -- register_copy + // [2273] phi cputcxy::y#17 = cputcxy::y#6 [phi:display_frame::@32->cputcxy#1] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#6 [phi:display_frame::@32->cputcxy#2] -- register_copy jsr cputcxy // display_frame::@return __breturn: // } - // [2656] return + // [3066] return rts // display_frame::@12 __b12: // display_frame_maskxy(x, y) - // [2657] display_frame_maskxy::x#7 = display_frame::x#18 - // [2658] display_frame_maskxy::y#7 = display_frame::y#10 - // [2659] call display_frame_maskxy - // [2954] phi from display_frame::@12 to display_frame_maskxy [phi:display_frame::@12->display_frame_maskxy] - // [2954] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#7 [phi:display_frame::@12->display_frame_maskxy#0] -- vbum1=vbuz2 - lda.z display_frame_maskxy.y_1 - sta display_frame_maskxy.cpeekcxy1_y - // [2954] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#7 [phi:display_frame::@12->display_frame_maskxy#1] -- vbum1=vbuz2 - lda.z display_frame_maskxy.x - sta display_frame_maskxy.cpeekcxy1_x + // [3067] display_frame_maskxy::x#7 = display_frame::x#18 -- vbuyy=vbum1 + ldy x + // [3068] display_frame_maskxy::y#7 = display_frame::y#10 -- vbuaa=vbum1 + lda y_1 + // [3069] call display_frame_maskxy + // [3452] phi from display_frame::@12 to display_frame_maskxy [phi:display_frame::@12->display_frame_maskxy] + // [3452] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#7 [phi:display_frame::@12->display_frame_maskxy#0] -- register_copy + // [3452] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#7 [phi:display_frame::@12->display_frame_maskxy#1] -- register_copy jsr display_frame_maskxy // display_frame_maskxy(x, y) - // [2660] display_frame_maskxy::return#20 = display_frame_maskxy::return#12 + // [3070] display_frame_maskxy::return#20 = display_frame_maskxy::return#12 // display_frame::@33 // mask = display_frame_maskxy(x, y) - // [2661] display_frame::mask#14 = display_frame_maskxy::return#20 + // [3071] display_frame::mask#14 = display_frame_maskxy::return#20 // mask |= 0b0101 - // [2662] display_frame::mask#15 = display_frame::mask#14 | 5 -- vbuz1=vbuz1_bor_vbuc1 - lda #5 - ora.z mask - sta.z mask + // [3072] display_frame::mask#15 = display_frame::mask#14 | 5 -- vbuaa=vbuaa_bor_vbuc1 + ora #5 // display_frame_char(mask) - // [2663] display_frame_char::mask#7 = display_frame::mask#15 - // [2664] call display_frame_char - // [2980] phi from display_frame::@33 to display_frame_char [phi:display_frame::@33->display_frame_char] - // [2980] phi display_frame_char::mask#10 = display_frame_char::mask#7 [phi:display_frame::@33->display_frame_char#0] -- register_copy + // [3073] display_frame_char::mask#7 = display_frame::mask#15 + // [3074] call display_frame_char + // [3478] phi from display_frame::@33 to display_frame_char [phi:display_frame::@33->display_frame_char] + // [3478] phi display_frame_char::mask#10 = display_frame_char::mask#7 [phi:display_frame::@33->display_frame_char#0] -- register_copy jsr display_frame_char // display_frame_char(mask) - // [2665] display_frame_char::return#20 = display_frame_char::return#12 + // [3075] display_frame_char::return#20 = display_frame_char::return#12 // display_frame::@34 // c = display_frame_char(mask) - // [2666] display_frame::c#7 = display_frame_char::return#20 + // [3076] display_frame::c#7 = display_frame_char::return#20 -- vbuxx=vbuaa + tax // cputcxy(x, y, c) - // [2667] cputcxy::x#7 = display_frame::x#18 -- vbum1=vbuz2 - lda.z x - sta cputcxy.x - // [2668] cputcxy::y#7 = display_frame::y#10 -- vbum1=vbuz2 - lda.z y_1 - sta cputcxy.y - // [2669] cputcxy::c#7 = display_frame::c#7 -- vbum1=vbuz2 - lda.z c - sta cputcxy.c - // [2670] call cputcxy - // [2147] phi from display_frame::@34 to cputcxy [phi:display_frame::@34->cputcxy] - // [2147] phi cputcxy::c#15 = cputcxy::c#7 [phi:display_frame::@34->cputcxy#0] -- register_copy - // [2147] phi cputcxy::y#15 = cputcxy::y#7 [phi:display_frame::@34->cputcxy#1] -- register_copy - // [2147] phi cputcxy::x#15 = cputcxy::x#7 [phi:display_frame::@34->cputcxy#2] -- register_copy + // [3077] cputcxy::x#7 = display_frame::x#18 -- vbuyy=vbum1 + ldy x + // [3078] cputcxy::y#7 = display_frame::y#10 -- vbuaa=vbum1 + lda y_1 + // [3079] cputcxy::c#7 = display_frame::c#7 + // [3080] call cputcxy + // [2273] phi from display_frame::@34 to cputcxy [phi:display_frame::@34->cputcxy] + // [2273] phi cputcxy::c#17 = cputcxy::c#7 [phi:display_frame::@34->cputcxy#0] -- register_copy + // [2273] phi cputcxy::y#17 = cputcxy::y#7 [phi:display_frame::@34->cputcxy#1] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#7 [phi:display_frame::@34->cputcxy#2] -- register_copy jsr cputcxy // display_frame::@35 // x++; - // [2671] display_frame::x#5 = ++ display_frame::x#18 -- vbuz1=_inc_vbuz1 - inc.z x + // [3081] display_frame::x#5 = ++ display_frame::x#18 -- vbum1=_inc_vbum1 + inc x jmp __b11 // display_frame::@7 __b7: // display_frame_maskxy(x0, y) - // [2672] display_frame_maskxy::x#3 = display_frame::x#0 - // [2673] display_frame_maskxy::y#3 = display_frame::y#10 - // [2674] call display_frame_maskxy - // [2954] phi from display_frame::@7 to display_frame_maskxy [phi:display_frame::@7->display_frame_maskxy] - // [2954] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#3 [phi:display_frame::@7->display_frame_maskxy#0] -- vbum1=vbuz2 - lda.z display_frame_maskxy.y_1 - sta display_frame_maskxy.cpeekcxy1_y - // [2954] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#3 [phi:display_frame::@7->display_frame_maskxy#1] -- vbum1=vbuz2 - lda.z display_frame_maskxy.x - sta display_frame_maskxy.cpeekcxy1_x + // [3082] display_frame_maskxy::x#3 = display_frame::x#0 -- vbuyy=vbum1 + ldy x + // [3083] display_frame_maskxy::y#3 = display_frame::y#10 -- vbuaa=vbum1 + lda y_1 + // [3084] call display_frame_maskxy + // [3452] phi from display_frame::@7 to display_frame_maskxy [phi:display_frame::@7->display_frame_maskxy] + // [3452] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#3 [phi:display_frame::@7->display_frame_maskxy#0] -- register_copy + // [3452] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#3 [phi:display_frame::@7->display_frame_maskxy#1] -- register_copy jsr display_frame_maskxy // display_frame_maskxy(x0, y) - // [2675] display_frame_maskxy::return#16 = display_frame_maskxy::return#12 + // [3085] display_frame_maskxy::return#16 = display_frame_maskxy::return#12 // display_frame::@22 // mask = display_frame_maskxy(x0, y) - // [2676] display_frame::mask#6 = display_frame_maskxy::return#16 + // [3086] display_frame::mask#6 = display_frame_maskxy::return#16 // mask |= 0b1010 - // [2677] display_frame::mask#7 = display_frame::mask#6 | $a -- vbuz1=vbuz1_bor_vbuc1 - lda #$a - ora.z mask - sta.z mask + // [3087] display_frame::mask#7 = display_frame::mask#6 | $a -- vbuaa=vbuaa_bor_vbuc1 + ora #$a // display_frame_char(mask) - // [2678] display_frame_char::mask#3 = display_frame::mask#7 - // [2679] call display_frame_char - // [2980] phi from display_frame::@22 to display_frame_char [phi:display_frame::@22->display_frame_char] - // [2980] phi display_frame_char::mask#10 = display_frame_char::mask#3 [phi:display_frame::@22->display_frame_char#0] -- register_copy + // [3088] display_frame_char::mask#3 = display_frame::mask#7 + // [3089] call display_frame_char + // [3478] phi from display_frame::@22 to display_frame_char [phi:display_frame::@22->display_frame_char] + // [3478] phi display_frame_char::mask#10 = display_frame_char::mask#3 [phi:display_frame::@22->display_frame_char#0] -- register_copy jsr display_frame_char // display_frame_char(mask) - // [2680] display_frame_char::return#16 = display_frame_char::return#12 + // [3090] display_frame_char::return#16 = display_frame_char::return#12 // display_frame::@23 // c = display_frame_char(mask) - // [2681] display_frame::c#3 = display_frame_char::return#16 + // [3091] display_frame::c#3 = display_frame_char::return#16 -- vbuxx=vbuaa + tax // cputcxy(x0, y, c) - // [2682] cputcxy::x#3 = display_frame::x#0 -- vbum1=vbuz2 - lda.z x - sta cputcxy.x - // [2683] cputcxy::y#3 = display_frame::y#10 -- vbum1=vbuz2 - lda.z y_1 - sta cputcxy.y - // [2684] cputcxy::c#3 = display_frame::c#3 -- vbum1=vbuz2 - lda.z c - sta cputcxy.c - // [2685] call cputcxy - // [2147] phi from display_frame::@23 to cputcxy [phi:display_frame::@23->cputcxy] - // [2147] phi cputcxy::c#15 = cputcxy::c#3 [phi:display_frame::@23->cputcxy#0] -- register_copy - // [2147] phi cputcxy::y#15 = cputcxy::y#3 [phi:display_frame::@23->cputcxy#1] -- register_copy - // [2147] phi cputcxy::x#15 = cputcxy::x#3 [phi:display_frame::@23->cputcxy#2] -- register_copy + // [3092] cputcxy::x#3 = display_frame::x#0 -- vbuyy=vbum1 + ldy x + // [3093] cputcxy::y#3 = display_frame::y#10 -- vbuaa=vbum1 + lda y_1 + // [3094] cputcxy::c#3 = display_frame::c#3 + // [3095] call cputcxy + // [2273] phi from display_frame::@23 to cputcxy [phi:display_frame::@23->cputcxy] + // [2273] phi cputcxy::c#17 = cputcxy::c#3 [phi:display_frame::@23->cputcxy#0] -- register_copy + // [2273] phi cputcxy::y#17 = cputcxy::y#3 [phi:display_frame::@23->cputcxy#1] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#3 [phi:display_frame::@23->cputcxy#2] -- register_copy jsr cputcxy // display_frame::@24 // display_frame_maskxy(x1, y) - // [2686] display_frame_maskxy::x#4 = display_frame::x1#16 - // [2687] display_frame_maskxy::y#4 = display_frame::y#10 - // [2688] call display_frame_maskxy - // [2954] phi from display_frame::@24 to display_frame_maskxy [phi:display_frame::@24->display_frame_maskxy] - // [2954] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#4 [phi:display_frame::@24->display_frame_maskxy#0] -- vbum1=vbuz2 - lda.z display_frame_maskxy.y_1 - sta display_frame_maskxy.cpeekcxy1_y - // [2954] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#4 [phi:display_frame::@24->display_frame_maskxy#1] -- vbum1=vbum2 - lda display_frame_maskxy.x_2 - sta display_frame_maskxy.cpeekcxy1_x + // [3096] display_frame_maskxy::x#4 = display_frame::x1#16 -- vbuyy=vbum1 + ldy x1 + // [3097] display_frame_maskxy::y#4 = display_frame::y#10 -- vbuaa=vbum1 + lda y_1 + // [3098] call display_frame_maskxy + // [3452] phi from display_frame::@24 to display_frame_maskxy [phi:display_frame::@24->display_frame_maskxy] + // [3452] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#4 [phi:display_frame::@24->display_frame_maskxy#0] -- register_copy + // [3452] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#4 [phi:display_frame::@24->display_frame_maskxy#1] -- register_copy jsr display_frame_maskxy // display_frame_maskxy(x1, y) - // [2689] display_frame_maskxy::return#17 = display_frame_maskxy::return#12 + // [3099] display_frame_maskxy::return#17 = display_frame_maskxy::return#12 // display_frame::@25 // mask = display_frame_maskxy(x1, y) - // [2690] display_frame::mask#8 = display_frame_maskxy::return#17 + // [3100] display_frame::mask#8 = display_frame_maskxy::return#17 // mask |= 0b1010 - // [2691] display_frame::mask#9 = display_frame::mask#8 | $a -- vbuz1=vbuz1_bor_vbuc1 - lda #$a - ora.z mask - sta.z mask + // [3101] display_frame::mask#9 = display_frame::mask#8 | $a -- vbuaa=vbuaa_bor_vbuc1 + ora #$a // display_frame_char(mask) - // [2692] display_frame_char::mask#4 = display_frame::mask#9 - // [2693] call display_frame_char - // [2980] phi from display_frame::@25 to display_frame_char [phi:display_frame::@25->display_frame_char] - // [2980] phi display_frame_char::mask#10 = display_frame_char::mask#4 [phi:display_frame::@25->display_frame_char#0] -- register_copy + // [3102] display_frame_char::mask#4 = display_frame::mask#9 + // [3103] call display_frame_char + // [3478] phi from display_frame::@25 to display_frame_char [phi:display_frame::@25->display_frame_char] + // [3478] phi display_frame_char::mask#10 = display_frame_char::mask#4 [phi:display_frame::@25->display_frame_char#0] -- register_copy jsr display_frame_char // display_frame_char(mask) - // [2694] display_frame_char::return#17 = display_frame_char::return#12 + // [3104] display_frame_char::return#17 = display_frame_char::return#12 // display_frame::@26 // c = display_frame_char(mask) - // [2695] display_frame::c#4 = display_frame_char::return#17 + // [3105] display_frame::c#4 = display_frame_char::return#17 -- vbuxx=vbuaa + tax // cputcxy(x1, y, c) - // [2696] cputcxy::x#4 = display_frame::x1#16 -- vbum1=vbum2 - lda x1 - sta cputcxy.x - // [2697] cputcxy::y#4 = display_frame::y#10 -- vbum1=vbuz2 - lda.z y_1 - sta cputcxy.y - // [2698] cputcxy::c#4 = display_frame::c#4 -- vbum1=vbuz2 - lda.z c - sta cputcxy.c - // [2699] call cputcxy - // [2147] phi from display_frame::@26 to cputcxy [phi:display_frame::@26->cputcxy] - // [2147] phi cputcxy::c#15 = cputcxy::c#4 [phi:display_frame::@26->cputcxy#0] -- register_copy - // [2147] phi cputcxy::y#15 = cputcxy::y#4 [phi:display_frame::@26->cputcxy#1] -- register_copy - // [2147] phi cputcxy::x#15 = cputcxy::x#4 [phi:display_frame::@26->cputcxy#2] -- register_copy + // [3106] cputcxy::x#4 = display_frame::x1#16 -- vbuyy=vbum1 + ldy x1 + // [3107] cputcxy::y#4 = display_frame::y#10 -- vbuaa=vbum1 + lda y_1 + // [3108] cputcxy::c#4 = display_frame::c#4 + // [3109] call cputcxy + // [2273] phi from display_frame::@26 to cputcxy [phi:display_frame::@26->cputcxy] + // [2273] phi cputcxy::c#17 = cputcxy::c#4 [phi:display_frame::@26->cputcxy#0] -- register_copy + // [2273] phi cputcxy::y#17 = cputcxy::y#4 [phi:display_frame::@26->cputcxy#1] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#4 [phi:display_frame::@26->cputcxy#2] -- register_copy jsr cputcxy // display_frame::@27 // y++; - // [2700] display_frame::y#2 = ++ display_frame::y#10 -- vbuz1=_inc_vbuz1 - inc.z y_1 + // [3110] display_frame::y#2 = ++ display_frame::y#10 -- vbum1=_inc_vbum1 + inc y_1 jmp __b6 // display_frame::@5 __b5: // display_frame_maskxy(x, y) - // [2701] display_frame_maskxy::x#2 = display_frame::x#10 - // [2702] display_frame_maskxy::y#2 = display_frame::y#0 - // [2703] call display_frame_maskxy - // [2954] phi from display_frame::@5 to display_frame_maskxy [phi:display_frame::@5->display_frame_maskxy] - // [2954] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#2 [phi:display_frame::@5->display_frame_maskxy#0] -- vbum1=vbum2 - lda display_frame_maskxy.y - sta display_frame_maskxy.cpeekcxy1_y - // [2954] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#2 [phi:display_frame::@5->display_frame_maskxy#1] -- vbum1=vbum2 - lda display_frame_maskxy.x_1 - sta display_frame_maskxy.cpeekcxy1_x + // [3111] display_frame_maskxy::x#2 = display_frame::x#10 -- vbuyy=vbum1 + ldy x_1 + // [3112] display_frame_maskxy::y#2 = display_frame::y#0 -- vbuaa=vbum1 + lda y + // [3113] call display_frame_maskxy + // [3452] phi from display_frame::@5 to display_frame_maskxy [phi:display_frame::@5->display_frame_maskxy] + // [3452] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#2 [phi:display_frame::@5->display_frame_maskxy#0] -- register_copy + // [3452] phi display_frame_maskxy::cpeekcxy1_x#0 = display_frame_maskxy::x#2 [phi:display_frame::@5->display_frame_maskxy#1] -- register_copy jsr display_frame_maskxy // display_frame_maskxy(x, y) - // [2704] display_frame_maskxy::return#15 = display_frame_maskxy::return#12 + // [3114] display_frame_maskxy::return#15 = display_frame_maskxy::return#12 // display_frame::@19 // mask = display_frame_maskxy(x, y) - // [2705] display_frame::mask#4 = display_frame_maskxy::return#15 + // [3115] display_frame::mask#4 = display_frame_maskxy::return#15 // mask |= 0b0101 - // [2706] display_frame::mask#5 = display_frame::mask#4 | 5 -- vbuz1=vbuz1_bor_vbuc1 - lda #5 - ora.z mask - sta.z mask + // [3116] display_frame::mask#5 = display_frame::mask#4 | 5 -- vbuaa=vbuaa_bor_vbuc1 + ora #5 // display_frame_char(mask) - // [2707] display_frame_char::mask#2 = display_frame::mask#5 - // [2708] call display_frame_char - // [2980] phi from display_frame::@19 to display_frame_char [phi:display_frame::@19->display_frame_char] - // [2980] phi display_frame_char::mask#10 = display_frame_char::mask#2 [phi:display_frame::@19->display_frame_char#0] -- register_copy + // [3117] display_frame_char::mask#2 = display_frame::mask#5 + // [3118] call display_frame_char + // [3478] phi from display_frame::@19 to display_frame_char [phi:display_frame::@19->display_frame_char] + // [3478] phi display_frame_char::mask#10 = display_frame_char::mask#2 [phi:display_frame::@19->display_frame_char#0] -- register_copy jsr display_frame_char // display_frame_char(mask) - // [2709] display_frame_char::return#15 = display_frame_char::return#12 + // [3119] display_frame_char::return#15 = display_frame_char::return#12 // display_frame::@20 // c = display_frame_char(mask) - // [2710] display_frame::c#2 = display_frame_char::return#15 + // [3120] display_frame::c#2 = display_frame_char::return#15 -- vbuxx=vbuaa + tax // cputcxy(x, y, c) - // [2711] cputcxy::x#2 = display_frame::x#10 -- vbum1=vbum2 - lda x_1 - sta cputcxy.x - // [2712] cputcxy::y#2 = display_frame::y#0 -- vbum1=vbum2 + // [3121] cputcxy::x#2 = display_frame::x#10 -- vbuyy=vbum1 + ldy x_1 + // [3122] cputcxy::y#2 = display_frame::y#0 -- vbuaa=vbum1 lda y - sta cputcxy.y - // [2713] cputcxy::c#2 = display_frame::c#2 -- vbum1=vbuz2 - lda.z c - sta cputcxy.c - // [2714] call cputcxy - // [2147] phi from display_frame::@20 to cputcxy [phi:display_frame::@20->cputcxy] - // [2147] phi cputcxy::c#15 = cputcxy::c#2 [phi:display_frame::@20->cputcxy#0] -- register_copy - // [2147] phi cputcxy::y#15 = cputcxy::y#2 [phi:display_frame::@20->cputcxy#1] -- register_copy - // [2147] phi cputcxy::x#15 = cputcxy::x#2 [phi:display_frame::@20->cputcxy#2] -- register_copy + // [3123] cputcxy::c#2 = display_frame::c#2 + // [3124] call cputcxy + // [2273] phi from display_frame::@20 to cputcxy [phi:display_frame::@20->cputcxy] + // [2273] phi cputcxy::c#17 = cputcxy::c#2 [phi:display_frame::@20->cputcxy#0] -- register_copy + // [2273] phi cputcxy::y#17 = cputcxy::y#2 [phi:display_frame::@20->cputcxy#1] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#2 [phi:display_frame::@20->cputcxy#2] -- register_copy jsr cputcxy // display_frame::@21 // x++; - // [2715] display_frame::x#2 = ++ display_frame::x#10 -- vbum1=_inc_vbum1 + // [3125] display_frame::x#2 = ++ display_frame::x#10 -- vbum1=_inc_vbum1 inc x_1 jmp __b4 // display_frame::@36 __b36: - // [2716] display_frame::x#30 = display_frame::x#0 -- vbum1=vbuz2 - lda.z x + // [3126] display_frame::x#30 = display_frame::x#0 -- vbum1=vbum2 + lda x sta x_1 jmp __b1 .segment Data - .label y = main.main__52 - .label x_1 = main.check_status_smc9_main__0 - .label x1 = main.check_status_smc8_main__0 - .label y1 = main.check_status_vera1_main__0 + w: .byte 0 + h: .byte 0 + x: .byte 0 + y: .byte 0 + x_1: .byte 0 + y_1: .byte 0 + x1: .byte 0 + y1: .byte 0 } .segment Code // cputs // Output a NUL-terminated string at the current cursor position -// void cputs(__zp($b2) const char *s) +// void cputs(__zp($6d) const char *s) cputs: { - .label s = $b2 - // [2718] phi from cputs cputs::@2 to cputs::@1 [phi:cputs/cputs::@2->cputs::@1] - // [2718] phi cputs::s#2 = cputs::s#1 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy + .label s = $6d + // [3128] phi from cputs cputs::@2 to cputs::@1 [phi:cputs/cputs::@2->cputs::@1] + // [3128] phi cputs::s#2 = cputs::s#1 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy // cputs::@1 __b1: // while(c=*s++) - // [2719] cputs::c#1 = *cputs::s#2 -- vbum1=_deref_pbuz2 + // [3129] cputs::c#1 = *cputs::s#2 -- vbuaa=_deref_pbuz1 ldy #0 lda (s),y - sta c - // [2720] cputs::s#0 = ++ cputs::s#2 -- pbuz1=_inc_pbuz1 + // [3130] cputs::s#0 = ++ cputs::s#2 -- pbuz1=_inc_pbuz1 inc.z s bne !+ inc.z s+1 !: - // [2721] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbum1_then_la1 - lda c + // [3131] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1 + cmp #0 bne __b2 // cputs::@return // } - // [2722] return + // [3132] return rts // cputs::@2 __b2: // cputc(c) - // [2723] stackpush(char) = cputs::c#1 -- _stackpushbyte_=vbum1 - lda c + // [3133] stackpush(char) = cputs::c#1 -- _stackpushbyte_=vbuaa pha - // [2724] callexecute cputc -- call_vprc1 + // [3134] callexecute cputc -- call_vprc1 jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla jmp __b1 - .segment Data - c: .byte 0 } -.segment Code // display_chip_led /** * @brief Print the colored led of a chip figure. @@ -18266,93 +20414,81 @@ cputs: { * @param tc Fore color * @param bc Back color */ -// void display_chip_led(__zp($ae) char x, char y, __zp($ad) char w, __zp($bf) char tc, char bc) +// void display_chip_led(__zp($6a) char x, char y, __zp($69) char w, __register(X) char tc, char bc) display_chip_led: { - .label x = $ae - .label w = $ad - .label tc = $bf + .label x = $6a + .label w = $69 // textcolor(tc) - // [2727] textcolor::color#11 = display_chip_led::tc#3 -- vbum1=vbuz2 - lda.z tc - sta textcolor.color - // [2728] call textcolor - // [760] phi from display_chip_led to textcolor [phi:display_chip_led->textcolor] - // [760] phi textcolor::color#23 = textcolor::color#11 [phi:display_chip_led->textcolor#0] -- register_copy + // [3137] textcolor::color#11 = display_chip_led::tc#3 + // [3138] call textcolor + // [787] phi from display_chip_led to textcolor [phi:display_chip_led->textcolor] + // [787] phi textcolor::color#23 = textcolor::color#11 [phi:display_chip_led->textcolor#0] -- register_copy jsr textcolor - // [2729] phi from display_chip_led to display_chip_led::@3 [phi:display_chip_led->display_chip_led::@3] + // [3139] phi from display_chip_led to display_chip_led::@3 [phi:display_chip_led->display_chip_led::@3] // display_chip_led::@3 // bgcolor(bc) - // [2730] call bgcolor - // [765] phi from display_chip_led::@3 to bgcolor [phi:display_chip_led::@3->bgcolor] - // [765] phi bgcolor::color#15 = BLUE [phi:display_chip_led::@3->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color + // [3140] call bgcolor + // [792] phi from display_chip_led::@3 to bgcolor [phi:display_chip_led::@3->bgcolor] + // [792] phi bgcolor::color#15 = BLUE [phi:display_chip_led::@3->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor - // [2731] phi from display_chip_led::@3 display_chip_led::@5 to display_chip_led::@1 [phi:display_chip_led::@3/display_chip_led::@5->display_chip_led::@1] - // [2731] phi display_chip_led::w#4 = display_chip_led::w#7 [phi:display_chip_led::@3/display_chip_led::@5->display_chip_led::@1#0] -- register_copy - // [2731] phi display_chip_led::x#4 = display_chip_led::x#7 [phi:display_chip_led::@3/display_chip_led::@5->display_chip_led::@1#1] -- register_copy + // [3141] phi from display_chip_led::@3 display_chip_led::@5 to display_chip_led::@1 [phi:display_chip_led::@3/display_chip_led::@5->display_chip_led::@1] + // [3141] phi display_chip_led::w#4 = display_chip_led::w#7 [phi:display_chip_led::@3/display_chip_led::@5->display_chip_led::@1#0] -- register_copy + // [3141] phi display_chip_led::x#4 = display_chip_led::x#7 [phi:display_chip_led::@3/display_chip_led::@5->display_chip_led::@1#1] -- register_copy // display_chip_led::@1 __b1: // cputcxy(x, y, 0x6F) - // [2732] cputcxy::x#9 = display_chip_led::x#4 -- vbum1=vbuz2 - lda.z x - sta cputcxy.x - // [2733] call cputcxy - // [2147] phi from display_chip_led::@1 to cputcxy [phi:display_chip_led::@1->cputcxy] - // [2147] phi cputcxy::c#15 = $6f [phi:display_chip_led::@1->cputcxy#0] -- vbum1=vbuc1 - lda #$6f - sta cputcxy.c - // [2147] phi cputcxy::y#15 = 3 [phi:display_chip_led::@1->cputcxy#1] -- vbum1=vbuc1 + // [3142] cputcxy::x#9 = display_chip_led::x#4 -- vbuyy=vbuz1 + ldy.z x + // [3143] call cputcxy + // [2273] phi from display_chip_led::@1 to cputcxy [phi:display_chip_led::@1->cputcxy] + // [2273] phi cputcxy::c#17 = $6f [phi:display_chip_led::@1->cputcxy#0] -- vbuxx=vbuc1 + ldx #$6f + // [2273] phi cputcxy::y#17 = 3 [phi:display_chip_led::@1->cputcxy#1] -- vbuaa=vbuc1 lda #3 - sta cputcxy.y - // [2147] phi cputcxy::x#15 = cputcxy::x#9 [phi:display_chip_led::@1->cputcxy#2] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#9 [phi:display_chip_led::@1->cputcxy#2] -- register_copy jsr cputcxy // display_chip_led::@4 // cputcxy(x, y+1, 0x77) - // [2734] cputcxy::x#10 = display_chip_led::x#4 -- vbum1=vbuz2 - lda.z x - sta cputcxy.x - // [2735] call cputcxy - // [2147] phi from display_chip_led::@4 to cputcxy [phi:display_chip_led::@4->cputcxy] - // [2147] phi cputcxy::c#15 = $77 [phi:display_chip_led::@4->cputcxy#0] -- vbum1=vbuc1 - lda #$77 - sta cputcxy.c - // [2147] phi cputcxy::y#15 = 3+1 [phi:display_chip_led::@4->cputcxy#1] -- vbum1=vbuc1 + // [3144] cputcxy::x#10 = display_chip_led::x#4 -- vbuyy=vbuz1 + ldy.z x + // [3145] call cputcxy + // [2273] phi from display_chip_led::@4 to cputcxy [phi:display_chip_led::@4->cputcxy] + // [2273] phi cputcxy::c#17 = $77 [phi:display_chip_led::@4->cputcxy#0] -- vbuxx=vbuc1 + ldx #$77 + // [2273] phi cputcxy::y#17 = 3+1 [phi:display_chip_led::@4->cputcxy#1] -- vbuaa=vbuc1 lda #3+1 - sta cputcxy.y - // [2147] phi cputcxy::x#15 = cputcxy::x#10 [phi:display_chip_led::@4->cputcxy#2] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#10 [phi:display_chip_led::@4->cputcxy#2] -- register_copy jsr cputcxy // display_chip_led::@5 // x++; - // [2736] display_chip_led::x#0 = ++ display_chip_led::x#4 -- vbuz1=_inc_vbuz1 + // [3146] display_chip_led::x#0 = ++ display_chip_led::x#4 -- vbuz1=_inc_vbuz1 inc.z x // while(--w) - // [2737] display_chip_led::w#0 = -- display_chip_led::w#4 -- vbuz1=_dec_vbuz1 + // [3147] display_chip_led::w#0 = -- display_chip_led::w#4 -- vbuz1=_dec_vbuz1 dec.z w - // [2738] if(0!=display_chip_led::w#0) goto display_chip_led::@1 -- 0_neq_vbuz1_then_la1 + // [3148] if(0!=display_chip_led::w#0) goto display_chip_led::@1 -- 0_neq_vbuz1_then_la1 lda.z w bne __b1 - // [2739] phi from display_chip_led::@5 to display_chip_led::@2 [phi:display_chip_led::@5->display_chip_led::@2] + // [3149] phi from display_chip_led::@5 to display_chip_led::@2 [phi:display_chip_led::@5->display_chip_led::@2] // display_chip_led::@2 // textcolor(WHITE) - // [2740] call textcolor - // [760] phi from display_chip_led::@2 to textcolor [phi:display_chip_led::@2->textcolor] - // [760] phi textcolor::color#23 = WHITE [phi:display_chip_led::@2->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color + // [3150] call textcolor + // [787] phi from display_chip_led::@2 to textcolor [phi:display_chip_led::@2->textcolor] + // [787] phi textcolor::color#23 = WHITE [phi:display_chip_led::@2->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor - // [2741] phi from display_chip_led::@2 to display_chip_led::@6 [phi:display_chip_led::@2->display_chip_led::@6] + // [3151] phi from display_chip_led::@2 to display_chip_led::@6 [phi:display_chip_led::@2->display_chip_led::@6] // display_chip_led::@6 // bgcolor(BLUE) - // [2742] call bgcolor - // [765] phi from display_chip_led::@6 to bgcolor [phi:display_chip_led::@6->bgcolor] - // [765] phi bgcolor::color#15 = BLUE [phi:display_chip_led::@6->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color + // [3152] call bgcolor + // [792] phi from display_chip_led::@6 to bgcolor [phi:display_chip_led::@6->bgcolor] + // [792] phi bgcolor::color#15 = BLUE [phi:display_chip_led::@6->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // display_chip_led::@return // } - // [2743] return + // [3153] return rts } // display_chip_line @@ -18364,162 +20500,150 @@ display_chip_led: { * @param w Width * @param c Fore color */ -// void display_chip_line(__zp($fa) char x, __mem() char y, __zp($de) char w, __zp($ef) char c) +// void display_chip_line(__zp($fb) char x, __mem() char y, __zp($cc) char w, __zp($eb) char c) display_chip_line: { - .label i = $be - .label x = $fa - .label w = $de - .label c = $ef + .label i = $7b + .label x = $fb + .label w = $cc + .label c = $eb // gotoxy(x, y) - // [2745] gotoxy::x#7 = display_chip_line::x#16 -- vbum1=vbuz2 - lda.z x - sta gotoxy.x - // [2746] gotoxy::y#7 = display_chip_line::y#16 -- vbum1=vbum2 + // [3155] gotoxy::x#7 = display_chip_line::x#16 -- vbuyy=vbuz1 + ldy.z x + // [3156] gotoxy::y#7 = display_chip_line::y#16 -- vbum1=vbum2 lda y sta gotoxy.y - // [2747] call gotoxy - // [778] phi from display_chip_line to gotoxy [phi:display_chip_line->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#7 [phi:display_chip_line->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = gotoxy::x#7 [phi:display_chip_line->gotoxy#1] -- register_copy + // [3157] call gotoxy + // [805] phi from display_chip_line to gotoxy [phi:display_chip_line->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#7 [phi:display_chip_line->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = gotoxy::x#7 [phi:display_chip_line->gotoxy#1] -- register_copy jsr gotoxy - // [2748] phi from display_chip_line to display_chip_line::@4 [phi:display_chip_line->display_chip_line::@4] + // [3158] phi from display_chip_line to display_chip_line::@4 [phi:display_chip_line->display_chip_line::@4] // display_chip_line::@4 // textcolor(GREY) - // [2749] call textcolor - // [760] phi from display_chip_line::@4 to textcolor [phi:display_chip_line::@4->textcolor] - // [760] phi textcolor::color#23 = GREY [phi:display_chip_line::@4->textcolor#0] -- vbum1=vbuc1 - lda #GREY - sta textcolor.color + // [3159] call textcolor + // [787] phi from display_chip_line::@4 to textcolor [phi:display_chip_line::@4->textcolor] + // [787] phi textcolor::color#23 = GREY [phi:display_chip_line::@4->textcolor#0] -- vbuxx=vbuc1 + ldx #GREY jsr textcolor - // [2750] phi from display_chip_line::@4 to display_chip_line::@5 [phi:display_chip_line::@4->display_chip_line::@5] + // [3160] phi from display_chip_line::@4 to display_chip_line::@5 [phi:display_chip_line::@4->display_chip_line::@5] // display_chip_line::@5 // bgcolor(BLUE) - // [2751] call bgcolor - // [765] phi from display_chip_line::@5 to bgcolor [phi:display_chip_line::@5->bgcolor] - // [765] phi bgcolor::color#15 = BLUE [phi:display_chip_line::@5->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color + // [3161] call bgcolor + // [792] phi from display_chip_line::@5 to bgcolor [phi:display_chip_line::@5->bgcolor] + // [792] phi bgcolor::color#15 = BLUE [phi:display_chip_line::@5->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // display_chip_line::@6 // cputc(VERA_CHR_UR) - // [2752] stackpush(char) = $7c -- _stackpushbyte_=vbuc1 + // [3162] stackpush(char) = $7c -- _stackpushbyte_=vbuc1 lda #$7c pha - // [2753] callexecute cputc -- call_vprc1 + // [3163] callexecute cputc -- call_vprc1 jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // textcolor(WHITE) - // [2755] call textcolor - // [760] phi from display_chip_line::@6 to textcolor [phi:display_chip_line::@6->textcolor] - // [760] phi textcolor::color#23 = WHITE [phi:display_chip_line::@6->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color + // [3165] call textcolor + // [787] phi from display_chip_line::@6 to textcolor [phi:display_chip_line::@6->textcolor] + // [787] phi textcolor::color#23 = WHITE [phi:display_chip_line::@6->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor - // [2756] phi from display_chip_line::@6 to display_chip_line::@7 [phi:display_chip_line::@6->display_chip_line::@7] + // [3166] phi from display_chip_line::@6 to display_chip_line::@7 [phi:display_chip_line::@6->display_chip_line::@7] // display_chip_line::@7 // bgcolor(BLACK) - // [2757] call bgcolor - // [765] phi from display_chip_line::@7 to bgcolor [phi:display_chip_line::@7->bgcolor] - // [765] phi bgcolor::color#15 = BLACK [phi:display_chip_line::@7->bgcolor#0] -- vbum1=vbuc1 - lda #BLACK - sta bgcolor.color + // [3167] call bgcolor + // [792] phi from display_chip_line::@7 to bgcolor [phi:display_chip_line::@7->bgcolor] + // [792] phi bgcolor::color#15 = BLACK [phi:display_chip_line::@7->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLACK jsr bgcolor - // [2758] phi from display_chip_line::@7 to display_chip_line::@1 [phi:display_chip_line::@7->display_chip_line::@1] - // [2758] phi display_chip_line::i#2 = 0 [phi:display_chip_line::@7->display_chip_line::@1#0] -- vbuz1=vbuc1 + // [3168] phi from display_chip_line::@7 to display_chip_line::@1 [phi:display_chip_line::@7->display_chip_line::@1] + // [3168] phi display_chip_line::i#2 = 0 [phi:display_chip_line::@7->display_chip_line::@1#0] -- vbuz1=vbuc1 lda #0 sta.z i // display_chip_line::@1 __b1: // for(char i=0; idisplay_chip_line::@3] + // [3170] phi from display_chip_line::@1 to display_chip_line::@3 [phi:display_chip_line::@1->display_chip_line::@3] // display_chip_line::@3 // textcolor(GREY) - // [2761] call textcolor - // [760] phi from display_chip_line::@3 to textcolor [phi:display_chip_line::@3->textcolor] - // [760] phi textcolor::color#23 = GREY [phi:display_chip_line::@3->textcolor#0] -- vbum1=vbuc1 - lda #GREY - sta textcolor.color + // [3171] call textcolor + // [787] phi from display_chip_line::@3 to textcolor [phi:display_chip_line::@3->textcolor] + // [787] phi textcolor::color#23 = GREY [phi:display_chip_line::@3->textcolor#0] -- vbuxx=vbuc1 + ldx #GREY jsr textcolor - // [2762] phi from display_chip_line::@3 to display_chip_line::@8 [phi:display_chip_line::@3->display_chip_line::@8] + // [3172] phi from display_chip_line::@3 to display_chip_line::@8 [phi:display_chip_line::@3->display_chip_line::@8] // display_chip_line::@8 // bgcolor(BLUE) - // [2763] call bgcolor - // [765] phi from display_chip_line::@8 to bgcolor [phi:display_chip_line::@8->bgcolor] - // [765] phi bgcolor::color#15 = BLUE [phi:display_chip_line::@8->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color + // [3173] call bgcolor + // [792] phi from display_chip_line::@8 to bgcolor [phi:display_chip_line::@8->bgcolor] + // [792] phi bgcolor::color#15 = BLUE [phi:display_chip_line::@8->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // display_chip_line::@9 // cputc(VERA_CHR_UL) - // [2764] stackpush(char) = $7e -- _stackpushbyte_=vbuc1 + // [3174] stackpush(char) = $7e -- _stackpushbyte_=vbuc1 lda #$7e pha - // [2765] callexecute cputc -- call_vprc1 + // [3175] callexecute cputc -- call_vprc1 jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // textcolor(WHITE) - // [2767] call textcolor - // [760] phi from display_chip_line::@9 to textcolor [phi:display_chip_line::@9->textcolor] - // [760] phi textcolor::color#23 = WHITE [phi:display_chip_line::@9->textcolor#0] -- vbum1=vbuc1 - lda #WHITE - sta textcolor.color + // [3177] call textcolor + // [787] phi from display_chip_line::@9 to textcolor [phi:display_chip_line::@9->textcolor] + // [787] phi textcolor::color#23 = WHITE [phi:display_chip_line::@9->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor - // [2768] phi from display_chip_line::@9 to display_chip_line::@10 [phi:display_chip_line::@9->display_chip_line::@10] + // [3178] phi from display_chip_line::@9 to display_chip_line::@10 [phi:display_chip_line::@9->display_chip_line::@10] // display_chip_line::@10 // bgcolor(BLACK) - // [2769] call bgcolor - // [765] phi from display_chip_line::@10 to bgcolor [phi:display_chip_line::@10->bgcolor] - // [765] phi bgcolor::color#15 = BLACK [phi:display_chip_line::@10->bgcolor#0] -- vbum1=vbuc1 - lda #BLACK - sta bgcolor.color + // [3179] call bgcolor + // [792] phi from display_chip_line::@10 to bgcolor [phi:display_chip_line::@10->bgcolor] + // [792] phi bgcolor::color#15 = BLACK [phi:display_chip_line::@10->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLACK jsr bgcolor // display_chip_line::@11 // cputcxy(x+2, y, c) - // [2770] cputcxy::x#8 = display_chip_line::x#16 + 2 -- vbum1=vbuz2_plus_2 - lda.z x - clc - adc #2 - sta cputcxy.x - // [2771] cputcxy::y#8 = display_chip_line::y#16 -- vbum1=vbum2 + // [3180] cputcxy::x#8 = display_chip_line::x#16 + 2 -- vbuyy=vbuz1_plus_2 + ldy.z x + iny + iny + // [3181] cputcxy::y#8 = display_chip_line::y#16 -- vbuaa=vbum1 lda y - sta cputcxy.y - // [2772] cputcxy::c#8 = display_chip_line::c#15 -- vbum1=vbuz2 - lda.z c - sta cputcxy.c - // [2773] call cputcxy - // [2147] phi from display_chip_line::@11 to cputcxy [phi:display_chip_line::@11->cputcxy] - // [2147] phi cputcxy::c#15 = cputcxy::c#8 [phi:display_chip_line::@11->cputcxy#0] -- register_copy - // [2147] phi cputcxy::y#15 = cputcxy::y#8 [phi:display_chip_line::@11->cputcxy#1] -- register_copy - // [2147] phi cputcxy::x#15 = cputcxy::x#8 [phi:display_chip_line::@11->cputcxy#2] -- register_copy + // [3182] cputcxy::c#8 = display_chip_line::c#15 -- vbuxx=vbuz1 + ldx.z c + // [3183] call cputcxy + // [2273] phi from display_chip_line::@11 to cputcxy [phi:display_chip_line::@11->cputcxy] + // [2273] phi cputcxy::c#17 = cputcxy::c#8 [phi:display_chip_line::@11->cputcxy#0] -- register_copy + // [2273] phi cputcxy::y#17 = cputcxy::y#8 [phi:display_chip_line::@11->cputcxy#1] -- register_copy + // [2273] phi cputcxy::x#17 = cputcxy::x#8 [phi:display_chip_line::@11->cputcxy#2] -- register_copy jsr cputcxy // display_chip_line::@return // } - // [2774] return + // [3184] return rts // display_chip_line::@2 __b2: // cputc(VERA_CHR_SPACE) - // [2775] stackpush(char) = $20 -- _stackpushbyte_=vbuc1 + // [3185] stackpush(char) = $20 -- _stackpushbyte_=vbuc1 lda #$20 pha - // [2776] callexecute cputc -- call_vprc1 + // [3186] callexecute cputc -- call_vprc1 jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // for(char i=0; idisplay_chip_line::@1] - // [2758] phi display_chip_line::i#2 = display_chip_line::i#1 [phi:display_chip_line::@2->display_chip_line::@1#0] -- register_copy + // [3168] phi from display_chip_line::@2 to display_chip_line::@1 [phi:display_chip_line::@2->display_chip_line::@1] + // [3168] phi display_chip_line::i#2 = display_chip_line::i#1 [phi:display_chip_line::@2->display_chip_line::@1#0] -- register_copy jmp __b1 .segment Data - .label y = main.check_status_vera6_main__0 + y: .byte 0 } .segment Code // display_chip_end @@ -18530,124 +20654,182 @@ display_chip_line: { * @param y Start Y * @param w Width */ -// void display_chip_end(__zp($cc) char x, char y, __zp($af) char w) +// void display_chip_end(__register(X) char x, char y, __zp($ce) char w) display_chip_end: { - .label i = $bd - .label x = $cc - .label w = $af + .label i = $7c + .label w = $ce // gotoxy(x, y) - // [2779] gotoxy::x#8 = display_chip_end::x#0 -- vbum1=vbuz2 - lda.z x - sta gotoxy.x - // [2780] call gotoxy - // [778] phi from display_chip_end to gotoxy [phi:display_chip_end->gotoxy] - // [778] phi gotoxy::y#33 = display_print_chip::y#21 [phi:display_chip_end->gotoxy#0] -- vbum1=vbuc1 + // [3189] gotoxy::x#8 = display_chip_end::x#0 -- vbuyy=vbuxx + txa + tay + // [3190] call gotoxy + // [805] phi from display_chip_end to gotoxy [phi:display_chip_end->gotoxy] + // [805] phi gotoxy::y#37 = display_print_chip::y#21 [phi:display_chip_end->gotoxy#0] -- vbum1=vbuc1 lda #display_print_chip.y sta gotoxy.y - // [778] phi gotoxy::x#33 = gotoxy::x#8 [phi:display_chip_end->gotoxy#1] -- register_copy + // [805] phi gotoxy::x#37 = gotoxy::x#8 [phi:display_chip_end->gotoxy#1] -- register_copy jsr gotoxy - // [2781] phi from display_chip_end to display_chip_end::@4 [phi:display_chip_end->display_chip_end::@4] + // [3191] phi from display_chip_end to display_chip_end::@4 [phi:display_chip_end->display_chip_end::@4] // display_chip_end::@4 // textcolor(GREY) - // [2782] call textcolor - // [760] phi from display_chip_end::@4 to textcolor [phi:display_chip_end::@4->textcolor] - // [760] phi textcolor::color#23 = GREY [phi:display_chip_end::@4->textcolor#0] -- vbum1=vbuc1 - lda #GREY - sta textcolor.color + // [3192] call textcolor + // [787] phi from display_chip_end::@4 to textcolor [phi:display_chip_end::@4->textcolor] + // [787] phi textcolor::color#23 = GREY [phi:display_chip_end::@4->textcolor#0] -- vbuxx=vbuc1 + ldx #GREY jsr textcolor - // [2783] phi from display_chip_end::@4 to display_chip_end::@5 [phi:display_chip_end::@4->display_chip_end::@5] + // [3193] phi from display_chip_end::@4 to display_chip_end::@5 [phi:display_chip_end::@4->display_chip_end::@5] // display_chip_end::@5 // bgcolor(BLUE) - // [2784] call bgcolor - // [765] phi from display_chip_end::@5 to bgcolor [phi:display_chip_end::@5->bgcolor] - // [765] phi bgcolor::color#15 = BLUE [phi:display_chip_end::@5->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color + // [3194] call bgcolor + // [792] phi from display_chip_end::@5 to bgcolor [phi:display_chip_end::@5->bgcolor] + // [792] phi bgcolor::color#15 = BLUE [phi:display_chip_end::@5->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // display_chip_end::@6 // cputc(VERA_CHR_UR) - // [2785] stackpush(char) = $7c -- _stackpushbyte_=vbuc1 + // [3195] stackpush(char) = $7c -- _stackpushbyte_=vbuc1 lda #$7c pha - // [2786] callexecute cputc -- call_vprc1 + // [3196] callexecute cputc -- call_vprc1 jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // textcolor(BLUE) - // [2788] call textcolor - // [760] phi from display_chip_end::@6 to textcolor [phi:display_chip_end::@6->textcolor] - // [760] phi textcolor::color#23 = BLUE [phi:display_chip_end::@6->textcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta textcolor.color + // [3198] call textcolor + // [787] phi from display_chip_end::@6 to textcolor [phi:display_chip_end::@6->textcolor] + // [787] phi textcolor::color#23 = BLUE [phi:display_chip_end::@6->textcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr textcolor - // [2789] phi from display_chip_end::@6 to display_chip_end::@7 [phi:display_chip_end::@6->display_chip_end::@7] + // [3199] phi from display_chip_end::@6 to display_chip_end::@7 [phi:display_chip_end::@6->display_chip_end::@7] // display_chip_end::@7 // bgcolor(BLACK) - // [2790] call bgcolor - // [765] phi from display_chip_end::@7 to bgcolor [phi:display_chip_end::@7->bgcolor] - // [765] phi bgcolor::color#15 = BLACK [phi:display_chip_end::@7->bgcolor#0] -- vbum1=vbuc1 - lda #BLACK - sta bgcolor.color + // [3200] call bgcolor + // [792] phi from display_chip_end::@7 to bgcolor [phi:display_chip_end::@7->bgcolor] + // [792] phi bgcolor::color#15 = BLACK [phi:display_chip_end::@7->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLACK jsr bgcolor - // [2791] phi from display_chip_end::@7 to display_chip_end::@1 [phi:display_chip_end::@7->display_chip_end::@1] - // [2791] phi display_chip_end::i#2 = 0 [phi:display_chip_end::@7->display_chip_end::@1#0] -- vbuz1=vbuc1 + // [3201] phi from display_chip_end::@7 to display_chip_end::@1 [phi:display_chip_end::@7->display_chip_end::@1] + // [3201] phi display_chip_end::i#2 = 0 [phi:display_chip_end::@7->display_chip_end::@1#0] -- vbuz1=vbuc1 lda #0 sta.z i // display_chip_end::@1 __b1: // for(char i=0; idisplay_chip_end::@3] + // [3203] phi from display_chip_end::@1 to display_chip_end::@3 [phi:display_chip_end::@1->display_chip_end::@3] // display_chip_end::@3 // textcolor(GREY) - // [2794] call textcolor - // [760] phi from display_chip_end::@3 to textcolor [phi:display_chip_end::@3->textcolor] - // [760] phi textcolor::color#23 = GREY [phi:display_chip_end::@3->textcolor#0] -- vbum1=vbuc1 - lda #GREY - sta textcolor.color + // [3204] call textcolor + // [787] phi from display_chip_end::@3 to textcolor [phi:display_chip_end::@3->textcolor] + // [787] phi textcolor::color#23 = GREY [phi:display_chip_end::@3->textcolor#0] -- vbuxx=vbuc1 + ldx #GREY jsr textcolor - // [2795] phi from display_chip_end::@3 to display_chip_end::@8 [phi:display_chip_end::@3->display_chip_end::@8] + // [3205] phi from display_chip_end::@3 to display_chip_end::@8 [phi:display_chip_end::@3->display_chip_end::@8] // display_chip_end::@8 // bgcolor(BLUE) - // [2796] call bgcolor - // [765] phi from display_chip_end::@8 to bgcolor [phi:display_chip_end::@8->bgcolor] - // [765] phi bgcolor::color#15 = BLUE [phi:display_chip_end::@8->bgcolor#0] -- vbum1=vbuc1 - lda #BLUE - sta bgcolor.color + // [3206] call bgcolor + // [792] phi from display_chip_end::@8 to bgcolor [phi:display_chip_end::@8->bgcolor] + // [792] phi bgcolor::color#15 = BLUE [phi:display_chip_end::@8->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // display_chip_end::@9 // cputc(VERA_CHR_UL) - // [2797] stackpush(char) = $7e -- _stackpushbyte_=vbuc1 + // [3207] stackpush(char) = $7e -- _stackpushbyte_=vbuc1 lda #$7e pha - // [2798] callexecute cputc -- call_vprc1 + // [3208] callexecute cputc -- call_vprc1 jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // display_chip_end::@return // } - // [2800] return + // [3210] return rts // display_chip_end::@2 __b2: // cputc(VERA_CHR_HL) - // [2801] stackpush(char) = $62 -- _stackpushbyte_=vbuc1 + // [3211] stackpush(char) = $62 -- _stackpushbyte_=vbuc1 lda #$62 pha - // [2802] callexecute cputc -- call_vprc1 + // [3212] callexecute cputc -- call_vprc1 jsr cputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // for(char i=0; idisplay_chip_end::@1] - // [2791] phi display_chip_end::i#2 = display_chip_end::i#1 [phi:display_chip_end::@2->display_chip_end::@1#0] -- register_copy + // [3201] phi from display_chip_end::@2 to display_chip_end::@1 [phi:display_chip_end::@2->display_chip_end::@1] + // [3201] phi display_chip_end::i#2 = display_chip_end::i#1 [phi:display_chip_end::@2->display_chip_end::@1#0] -- register_copy jmp __b1 } +.segment CodeVera + // spi_get_jedec +spi_get_jedec: { + // spi_fast() + // [3216] call spi_fast + /* +; Returns +; .X = Vendor ID +; .Y = Memory Type +; .A = Memory Capacity +.proc spi_get_jedec + jsr spi_fast + + jsr spi_select + lda #$9F + jsr spi_write + jsr spi_read + tax + jsr spi_read + tay + jsr spi_read + rts +.endproc + */ + jsr spi_fast + // [3217] phi from spi_get_jedec to spi_get_jedec::@1 [phi:spi_get_jedec->spi_get_jedec::@1] + // spi_get_jedec::@1 + // spi_select() + // [3218] call spi_select + // [3495] phi from spi_get_jedec::@1 to spi_select [phi:spi_get_jedec::@1->spi_select] + jsr spi_select + // spi_get_jedec::@2 + // spi_write(0x9F) + // [3219] spi_write::data = $9f -- vbuz1=vbuc1 + lda #$9f + sta.z spi_write.data + // [3220] call spi_write + jsr spi_write + // [3221] phi from spi_get_jedec::@2 to spi_get_jedec::@3 [phi:spi_get_jedec::@2->spi_get_jedec::@3] + // spi_get_jedec::@3 + // spi_read() + // [3222] call spi_read + jsr spi_read + // [3223] spi_read::return#0 = spi_read::return#12 + // spi_get_jedec::@4 + // [3224] spi_manufacturer#0 = spi_read::return#0 -- vbuxx=vbuaa + tax + // [3225] call spi_read + jsr spi_read + // [3226] spi_read::return#1 = spi_read::return#12 + // spi_get_jedec::@5 + // [3227] spi_memory_type#0 = spi_read::return#1 -- vbuyy=vbuaa + tay + // [3228] call spi_read + jsr spi_read + // [3229] spi_read::return#10 = spi_read::return#12 + // spi_get_jedec::@6 + // [3230] spi_memory_capacity#0 = spi_read::return#10 -- vbum1=vbuaa + sta spi_memory_capacity + // spi_get_jedec::@return + // } + // [3231] return + rts +} +.segment Code // rom_write_byte /** * @brief Write a byte to the ROM using the 22 bit address. @@ -18658,51 +20840,42 @@ display_chip_end: { * @param address The 22 bit ROM address. * @param value The byte value to be written. */ -// void rom_write_byte(__zp($49) unsigned long address, __zp($4d) char value) +// void rom_write_byte(__zp($36) unsigned long address, __register(Y) char value) rom_write_byte: { - .label rom_bank1_rom_write_byte__0 = $38 - .label rom_bank1_rom_write_byte__1 = $43 - .label rom_bank1_rom_write_byte__2 = $3b - .label rom_ptr1_rom_write_byte__0 = $39 - .label rom_ptr1_rom_write_byte__2 = $39 - .label rom_bank1_bank_unshifted = $3b - .label rom_bank1_return = $2a - .label rom_ptr1_return = $39 - .label address = $49 - .label value = $4d + .label rom_bank1_rom_write_byte__2 = $30 + .label rom_ptr1_rom_write_byte__0 = $2e + .label rom_ptr1_rom_write_byte__2 = $2e + .label rom_bank1_bank_unshifted = $30 + .label rom_ptr1_return = $2e + .label address = $36 // rom_write_byte::rom_bank1 // BYTE2(address) - // [2806] rom_write_byte::rom_bank1_$0 = byte2 rom_write_byte::address#4 -- vbuz1=_byte2_vduz2 + // [3233] rom_write_byte::rom_bank1_$0 = byte2 rom_write_byte::address#4 -- vbuaa=_byte2_vduz1 lda.z address+2 - sta.z rom_bank1_rom_write_byte__0 // BYTE1(address) - // [2807] rom_write_byte::rom_bank1_$1 = byte1 rom_write_byte::address#4 -- vbuz1=_byte1_vduz2 - lda.z address+1 - sta.z rom_bank1_rom_write_byte__1 + // [3234] rom_write_byte::rom_bank1_$1 = byte1 rom_write_byte::address#4 -- vbuxx=_byte1_vduz1 + ldx.z address+1 // MAKEWORD(BYTE2(address),BYTE1(address)) - // [2808] rom_write_byte::rom_bank1_$2 = rom_write_byte::rom_bank1_$0 w= rom_write_byte::rom_bank1_$1 -- vwuz1=vbuz2_word_vbuz3 - lda.z rom_bank1_rom_write_byte__0 + // [3235] rom_write_byte::rom_bank1_$2 = rom_write_byte::rom_bank1_$0 w= rom_write_byte::rom_bank1_$1 -- vwuz1=vbuaa_word_vbuxx sta.z rom_bank1_rom_write_byte__2+1 - lda.z rom_bank1_rom_write_byte__1 - sta.z rom_bank1_rom_write_byte__2 + stx.z rom_bank1_rom_write_byte__2 // unsigned int bank_unshifted = MAKEWORD(BYTE2(address),BYTE1(address)) << 2 - // [2809] rom_write_byte::rom_bank1_bank_unshifted#0 = rom_write_byte::rom_bank1_$2 << 2 -- vwuz1=vwuz1_rol_2 + // [3236] rom_write_byte::rom_bank1_bank_unshifted#0 = rom_write_byte::rom_bank1_$2 << 2 -- vwuz1=vwuz1_rol_2 asl.z rom_bank1_bank_unshifted rol.z rom_bank1_bank_unshifted+1 asl.z rom_bank1_bank_unshifted rol.z rom_bank1_bank_unshifted+1 // unsigned char bank = BYTE1(bank_unshifted) - // [2810] rom_write_byte::rom_bank1_return#0 = byte1 rom_write_byte::rom_bank1_bank_unshifted#0 -- vbuz1=_byte1_vwuz2 - lda.z rom_bank1_bank_unshifted+1 - sta.z rom_bank1_return + // [3237] rom_write_byte::rom_bank1_return#0 = byte1 rom_write_byte::rom_bank1_bank_unshifted#0 -- vbuxx=_byte1_vwuz1 + ldx.z rom_bank1_bank_unshifted+1 // rom_write_byte::rom_ptr1 // (unsigned int)(address) & ROM_PTR_MASK - // [2811] rom_write_byte::rom_ptr1_$2 = (unsigned int)rom_write_byte::address#4 -- vwuz1=_word_vduz2 + // [3238] rom_write_byte::rom_ptr1_$2 = (unsigned int)rom_write_byte::address#4 -- vwuz1=_word_vduz2 lda.z address sta.z rom_ptr1_rom_write_byte__2 lda.z address+1 sta.z rom_ptr1_rom_write_byte__2+1 - // [2812] rom_write_byte::rom_ptr1_$0 = rom_write_byte::rom_ptr1_$2 & $3fff -- vwuz1=vwuz1_band_vwuc1 + // [3239] rom_write_byte::rom_ptr1_$0 = rom_write_byte::rom_ptr1_$2 & $3fff -- vwuz1=vwuz1_band_vwuc1 lda.z rom_ptr1_rom_write_byte__0 and #<$3fff sta.z rom_ptr1_rom_write_byte__0 @@ -18710,7 +20883,7 @@ rom_write_byte: { and #>$3fff sta.z rom_ptr1_rom_write_byte__0+1 // ((unsigned int)(address) & ROM_PTR_MASK) + ROM_BASE - // [2813] rom_write_byte::rom_ptr1_return#0 = rom_write_byte::rom_ptr1_$0 + $c000 -- vwuz1=vwuz1_plus_vwuc1 + // [3240] rom_write_byte::rom_ptr1_return#0 = rom_write_byte::rom_ptr1_$0 + $c000 -- vwuz1=vwuz1_plus_vwuc1 lda.z rom_ptr1_return clc adc #<$c000 @@ -18720,18 +20893,17 @@ rom_write_byte: { sta.z rom_ptr1_return+1 // rom_write_byte::bank_set_brom1 // BROM = bank - // [2814] BROM = rom_write_byte::rom_bank1_return#0 -- vbuz1=vbuz2 - lda.z rom_bank1_return - sta.z BROM + // [3241] BROM = rom_write_byte::rom_bank1_return#0 -- vbuz1=vbuxx + stx.z BROM // rom_write_byte::@1 // *ptr_rom = value - // [2815] *((char *)rom_write_byte::rom_ptr1_return#0) = rom_write_byte::value#10 -- _deref_pbuz1=vbuz2 - lda.z value + // [3242] *((char *)rom_write_byte::rom_ptr1_return#0) = rom_write_byte::value#10 -- _deref_pbuz1=vbuyy + tya ldy #0 sta (rom_ptr1_return),y // rom_write_byte::@return // } - // [2816] return + // [3243] return rts } // uctoa_append @@ -18743,52 +20915,429 @@ rom_write_byte: { // - sub : the value of a '1' in the digit. Subtracted continually while the digit is increased. // (For decimal the subs used are 10000, 1000, 100, 10, 1) // returns : the value reduced by sub * digit so that it is less than sub. -// __mem() char uctoa_append(__zp($47) char *buffer, __mem() char value, __mem() char sub) +// __register(X) char uctoa_append(__zp($34) char *buffer, __register(X) char value, __mem() char sub) uctoa_append: { - .label buffer = $47 - // [2818] phi from uctoa_append to uctoa_append::@1 [phi:uctoa_append->uctoa_append::@1] - // [2818] phi uctoa_append::digit#2 = 0 [phi:uctoa_append->uctoa_append::@1#0] -- vbum1=vbuc1 - lda #0 - sta digit - // [2818] phi uctoa_append::value#2 = uctoa_append::value#0 [phi:uctoa_append->uctoa_append::@1#1] -- register_copy + .label buffer = $34 + // [3245] phi from uctoa_append to uctoa_append::@1 [phi:uctoa_append->uctoa_append::@1] + // [3245] phi uctoa_append::digit#2 = 0 [phi:uctoa_append->uctoa_append::@1#0] -- vbuyy=vbuc1 + ldy #0 + // [3245] phi uctoa_append::value#2 = uctoa_append::value#0 [phi:uctoa_append->uctoa_append::@1#1] -- register_copy // uctoa_append::@1 __b1: // while (value >= sub) - // [2819] if(uctoa_append::value#2>=uctoa_append::sub#0) goto uctoa_append::@2 -- vbum1_ge_vbum2_then_la1 - lda value - cmp sub + // [3246] if(uctoa_append::value#2>=uctoa_append::sub#0) goto uctoa_append::@2 -- vbuxx_ge_vbum1_then_la1 + cpx sub bcs __b2 // uctoa_append::@3 // *buffer = DIGITS[digit] - // [2820] *uctoa_append::buffer#0 = DIGITS[uctoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbum2 - ldy digit + // [3247] *uctoa_append::buffer#0 = DIGITS[uctoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbuyy lda DIGITS,y ldy #0 sta (buffer),y // uctoa_append::@return // } - // [2821] return + // [3248] return rts // uctoa_append::@2 __b2: // digit++; - // [2822] uctoa_append::digit#1 = ++ uctoa_append::digit#2 -- vbum1=_inc_vbum1 - inc digit + // [3249] uctoa_append::digit#1 = ++ uctoa_append::digit#2 -- vbuyy=_inc_vbuyy + iny // value -= sub - // [2823] uctoa_append::value#1 = uctoa_append::value#2 - uctoa_append::sub#0 -- vbum1=vbum1_minus_vbum2 - lda value + // [3250] uctoa_append::value#1 = uctoa_append::value#2 - uctoa_append::sub#0 -- vbuxx=vbuxx_minus_vbum1 + txa sec sbc sub - sta value - // [2818] phi from uctoa_append::@2 to uctoa_append::@1 [phi:uctoa_append::@2->uctoa_append::@1] - // [2818] phi uctoa_append::digit#2 = uctoa_append::digit#1 [phi:uctoa_append::@2->uctoa_append::@1#0] -- register_copy - // [2818] phi uctoa_append::value#2 = uctoa_append::value#1 [phi:uctoa_append::@2->uctoa_append::@1#1] -- register_copy + tax + // [3245] phi from uctoa_append::@2 to uctoa_append::@1 [phi:uctoa_append::@2->uctoa_append::@1] + // [3245] phi uctoa_append::digit#2 = uctoa_append::digit#1 [phi:uctoa_append::@2->uctoa_append::@1#0] -- register_copy + // [3245] phi uctoa_append::value#2 = uctoa_append::value#1 [phi:uctoa_append::@2->uctoa_append::@1#1] -- register_copy jmp __b1 .segment Data - .label value = printf_uchar.uvalue - .label sub = uctoa.digit_value - .label return = printf_uchar.uvalue - digit: .byte 0 + .label sub = uctoa.started +} +.segment CodeVera + // spi_read_flash +// void spi_read_flash(unsigned long spi_data) +spi_read_flash: { + // spi_select() + // [3252] call spi_select + /* +; .X [7:0] +; .Y [15:8] +; .A [23:16] +.proc spi_read_flash + pha + + jsr spi_select + lda #$03 + jsr spi_write + pla + jsr spi_write + tya + jsr spi_write + txa + jsr spi_write + + rts +.endproc + */ + // [3495] phi from spi_read_flash to spi_select [phi:spi_read_flash->spi_select] + jsr spi_select + // spi_read_flash::@1 + // spi_write(0x03) + // [3253] spi_write::data = 3 -- vbuz1=vbuc1 + lda #3 + sta.z spi_write.data + // [3254] call spi_write + jsr spi_write + // spi_read_flash::@2 + // spi_write(BYTE2(spi_data)) + // [3255] spi_write::data = 0 -- vbuz1=vbuc1 + lda #0 + sta.z spi_write.data + // [3256] call spi_write + jsr spi_write + // spi_read_flash::@3 + // spi_write(BYTE1(spi_data)) + // [3257] spi_write::data = 0 -- vbuz1=vbuc1 + lda #0 + sta.z spi_write.data + // [3258] call spi_write + jsr spi_write + // spi_read_flash::@4 + // spi_write(BYTE0(spi_data)) + // [3259] spi_write::data = 0 -- vbuz1=vbuc1 + lda #0 + sta.z spi_write.data + // [3260] call spi_write + jsr spi_write + // spi_read_flash::@return + // } + // [3261] return + rts +} + // spi_read +spi_read: { + // asm + // asm { stzvera_reg_SPIData !: bitvera_reg_SPICtrl bmi!- } + /* + .proc spi_read + stz Vera::Reg::SPIData +@1: bit Vera::Reg::SPICtrl + bmi @1 + lda Vera::Reg::SPIData + rts +.endproc +*/ + stz vera_reg_SPIData + !: + bit vera_reg_SPICtrl + bmi !- + // return *vera_reg_SPIData; + // [3263] spi_read::return#12 = *vera_reg_SPIData -- vbuaa=_deref_pbuc1 + lda vera_reg_SPIData + // spi_read::@return + // } + // [3264] return + rts +} + // spi_wait_non_busy +spi_wait_non_busy: { + /** +.proc spi_wait_non_busy + ldy #0 +top: + jsr spi_select + lda #$05 + jsr spi_write + + jsr spi_read + and #1 + bne wait_restart + clc + rts +fail: + sec + rts +wait_restart: + iny + beq fail + wai + bra top +.endproc + */ + .label y = $c2 + // [3266] phi from spi_wait_non_busy to spi_wait_non_busy::@1 [phi:spi_wait_non_busy->spi_wait_non_busy::@1] + // [3266] phi spi_wait_non_busy::y#2 = 0 [phi:spi_wait_non_busy->spi_wait_non_busy::@1#0] -- vbuz1=vbuc1 + lda #0 + sta.z y + // spi_wait_non_busy::@1 + // [3267] phi from spi_wait_non_busy::@1 to spi_wait_non_busy::@2 [phi:spi_wait_non_busy::@1->spi_wait_non_busy::@2] + // spi_wait_non_busy::@2 + __b2: + // spi_select() + // [3268] call spi_select + // [3495] phi from spi_wait_non_busy::@2 to spi_select [phi:spi_wait_non_busy::@2->spi_select] + jsr spi_select + // spi_wait_non_busy::@5 + // spi_write(0x05) + // [3269] spi_write::data = 5 -- vbuz1=vbuc1 + lda #5 + sta.z spi_write.data + // [3270] call spi_write + jsr spi_write + // [3271] phi from spi_wait_non_busy::@5 to spi_wait_non_busy::@6 [phi:spi_wait_non_busy::@5->spi_wait_non_busy::@6] + // spi_wait_non_busy::@6 + // unsigned char w = spi_read() + // [3272] call spi_read + jsr spi_read + // [3273] spi_read::return#11 = spi_read::return#12 + // spi_wait_non_busy::@7 + // [3274] spi_wait_non_busy::w#0 = spi_read::return#11 + // w &= 1 + // [3275] spi_wait_non_busy::w#1 = spi_wait_non_busy::w#0 & 1 -- vbuaa=vbuaa_band_vbuc1 + and #1 + // if(w == 0) + // [3276] if(spi_wait_non_busy::w#1==0) goto spi_wait_non_busy::@return -- vbuaa_eq_0_then_la1 + cmp #0 + beq __b1 + // spi_wait_non_busy::@4 + // y++; + // [3277] spi_wait_non_busy::y#1 = ++ spi_wait_non_busy::y#2 -- vbuz1=_inc_vbuz1 + inc.z y + // if(y == 0) + // [3278] if(spi_wait_non_busy::y#1!=0) goto spi_wait_non_busy::@3 -- vbuz1_neq_0_then_la1 + lda.z y + bne __b3 + // [3279] phi from spi_wait_non_busy::@4 to spi_wait_non_busy::@return [phi:spi_wait_non_busy::@4->spi_wait_non_busy::@return] + // [3279] phi spi_wait_non_busy::return#3 = 1 [phi:spi_wait_non_busy::@4->spi_wait_non_busy::@return#0] -- vbuaa=vbuc1 + lda #1 + rts + // [3279] phi from spi_wait_non_busy::@7 to spi_wait_non_busy::@return [phi:spi_wait_non_busy::@7->spi_wait_non_busy::@return] + __b1: + // [3279] phi spi_wait_non_busy::return#3 = 0 [phi:spi_wait_non_busy::@7->spi_wait_non_busy::@return#0] -- vbuaa=vbuc1 + lda #0 + // spi_wait_non_busy::@return + // } + // [3280] return + rts + // spi_wait_non_busy::@3 + __b3: + // asm + // asm { .byte$CB } + // WAI + .byte $cb + // [3266] phi from spi_wait_non_busy::@3 to spi_wait_non_busy::@1 [phi:spi_wait_non_busy::@3->spi_wait_non_busy::@1] + // [3266] phi spi_wait_non_busy::y#2 = spi_wait_non_busy::y#1 [phi:spi_wait_non_busy::@3->spi_wait_non_busy::@1#0] -- register_copy + jmp __b2 +} + // spi_block_erase +// void spi_block_erase(__zp($e7) unsigned long data) +spi_block_erase: { + .label data = $e7 + // spi_select() + // [3283] call spi_select + /** +; .X [7:0] +; .Y [15:8] +; .A [23:16] +.proc spi_block_erase ; 64k + pha + + ; write enable + jsr spi_select + lda #$06 + jsr spi_write + + jsr spi_select + lda #$d8 + jsr spi_write + + pla + jsr spi_write + tya + jsr spi_write + txa + jsr spi_write + + jsr spi_deselect + + rts +.endproc + */ + // [3495] phi from spi_block_erase to spi_select [phi:spi_block_erase->spi_select] + jsr spi_select + // spi_block_erase::@1 + // spi_write(0x06) + // [3284] spi_write::data = 6 -- vbuz1=vbuc1 + lda #6 + sta.z spi_write.data + // [3285] call spi_write + jsr spi_write + // [3286] phi from spi_block_erase::@1 to spi_block_erase::@2 [phi:spi_block_erase::@1->spi_block_erase::@2] + // spi_block_erase::@2 + // spi_select() + // [3287] call spi_select + // [3495] phi from spi_block_erase::@2 to spi_select [phi:spi_block_erase::@2->spi_select] + jsr spi_select + // spi_block_erase::@3 + // spi_write(0xD8) + // [3288] spi_write::data = $d8 -- vbuz1=vbuc1 + lda #$d8 + sta.z spi_write.data + // [3289] call spi_write + jsr spi_write + // spi_block_erase::@4 + // BYTE2(data) + // [3290] spi_block_erase::$4 = byte2 spi_block_erase::data#0 -- vbuaa=_byte2_vduz1 + lda.z data+2 + // spi_write(BYTE2(data)) + // [3291] spi_write::data = spi_block_erase::$4 -- vbuz1=vbuaa + sta.z spi_write.data + // [3292] call spi_write + jsr spi_write + // spi_block_erase::@5 + // BYTE1(data) + // [3293] spi_block_erase::$6 = byte1 spi_block_erase::data#0 -- vbuaa=_byte1_vduz1 + lda.z data+1 + // spi_write(BYTE1(data)) + // [3294] spi_write::data = spi_block_erase::$6 -- vbuz1=vbuaa + sta.z spi_write.data + // [3295] call spi_write + jsr spi_write + // spi_block_erase::@6 + // BYTE0(data) + // [3296] spi_block_erase::$8 = byte0 spi_block_erase::data#0 -- vbuaa=_byte0_vduz1 + lda.z data + // spi_write(BYTE0(data)) + // [3297] spi_write::data = spi_block_erase::$8 -- vbuz1=vbuaa + sta.z spi_write.data + // [3298] call spi_write + jsr spi_write + // [3299] phi from spi_block_erase::@6 to spi_block_erase::@7 [phi:spi_block_erase::@6->spi_block_erase::@7] + // spi_block_erase::@7 + // spi_deselect() + // [3300] call spi_deselect + jsr spi_deselect + // spi_block_erase::@return + // } + // [3301] return + rts +} + // spi_write_page_begin +// void spi_write_page_begin(__zp($ee) unsigned long data) +spi_write_page_begin: { + .label data = $ee + // spi_select() + // [3303] call spi_select + /** +; .X [7:0] +; .Y [15:8] +; .A [23:16] +.proc spi_write_page_begin + pha + + ; write enable + jsr spi_select + lda #$06 + jsr spi_write + + jsr spi_select + lda #$02 + jsr spi_write + pla + jsr spi_write + tya + jsr spi_write + txa + jsr spi_write + + rts +.endproc + */ + // [3495] phi from spi_write_page_begin to spi_select [phi:spi_write_page_begin->spi_select] + jsr spi_select + // spi_write_page_begin::@1 + // spi_write(0x06) + // [3304] spi_write::data = 6 -- vbuz1=vbuc1 + lda #6 + sta.z spi_write.data + // [3305] call spi_write + jsr spi_write + // [3306] phi from spi_write_page_begin::@1 to spi_write_page_begin::@2 [phi:spi_write_page_begin::@1->spi_write_page_begin::@2] + // spi_write_page_begin::@2 + // spi_select() + // [3307] call spi_select + // [3495] phi from spi_write_page_begin::@2 to spi_select [phi:spi_write_page_begin::@2->spi_select] + jsr spi_select + // spi_write_page_begin::@3 + // spi_write(0x02) + // [3308] spi_write::data = 2 -- vbuz1=vbuc1 + lda #2 + sta.z spi_write.data + // [3309] call spi_write + jsr spi_write + // spi_write_page_begin::@4 + // BYTE2(data) + // [3310] spi_write_page_begin::$4 = byte2 spi_write_page_begin::data#0 -- vbuaa=_byte2_vduz1 + lda.z data+2 + // spi_write(BYTE2(data)) + // [3311] spi_write::data = spi_write_page_begin::$4 -- vbuz1=vbuaa + sta.z spi_write.data + // [3312] call spi_write + jsr spi_write + // spi_write_page_begin::@5 + // BYTE1(data) + // [3313] spi_write_page_begin::$6 = byte1 spi_write_page_begin::data#0 -- vbuaa=_byte1_vduz1 + lda.z data+1 + // spi_write(BYTE1(data)) + // [3314] spi_write::data = spi_write_page_begin::$6 -- vbuz1=vbuaa + sta.z spi_write.data + // [3315] call spi_write + jsr spi_write + // spi_write_page_begin::@6 + // BYTE0(data) + // [3316] spi_write_page_begin::$8 = byte0 spi_write_page_begin::data#0 -- vbuaa=_byte0_vduz1 + lda.z data + // spi_write(BYTE0(data)) + // [3317] spi_write::data = spi_write_page_begin::$8 -- vbuz1=vbuaa + sta.z spi_write.data + // [3318] call spi_write + jsr spi_write + // spi_write_page_begin::@return + // } + // [3319] return + rts +} + // spi_write +/** + * @brief + * + * + */ +// void spi_write(__zp($c9) volatile char data) +spi_write: { + .label data = $c9 + // asm + // asm { ldadata stavera_reg_SPIData !: bitvera_reg_SPICtrl bmi!- } + /* +.proc spi_write + sta Vera::Reg::SPIData +@1: bit Vera::Reg::SPICtrl + bmi @1 + rts +.endproc +*/ + lda data + sta vera_reg_SPIData + !: + bit vera_reg_SPICtrl + bmi !- + // spi_write::@return + // } + // [3321] return + rts } .segment Code // cbm_k_setlfs @@ -18809,7 +21358,7 @@ cbm_k_setlfs: { jsr CBM_SETLFS // cbm_k_setlfs::@return // } - // [2825] return + // [3323] return rts .segment Data channel: .byte 0 @@ -18827,57 +21376,55 @@ cbm_k_setlfs: { * @param stream FILE* stream. * @return int Contains a non-zero value if there is an error. */ -// __mem() int ferror(__zp($47) struct $2 *stream) +// __mem() int ferror(__zp($46) struct $2 *stream) ferror: { - .label ferror__6 = $38 - .label ferror__15 = $43 - .label cbm_k_setnam1_ferror__0 = $3b - .label stream = $47 - .label errno_len = $dd + .label cbm_k_setnam1_ferror__0 = $48 + .label stream = $46 + .label errno_len = $cf // unsigned char sp = (unsigned char)stream - // [2826] ferror::sp#0 = (char)ferror::stream#0 -- vbum1=_byte_pssz2 + // [3324] ferror::sp#0 = (char)ferror::stream#0 -- vbum1=_byte_pssz2 lda.z stream sta sp // cbm_k_setlfs(15, 8, 15) - // [2827] cbm_k_setlfs::channel = $f -- vbum1=vbuc1 + // [3325] cbm_k_setlfs::channel = $f -- vbum1=vbuc1 lda #$f sta cbm_k_setlfs.channel - // [2828] cbm_k_setlfs::device = 8 -- vbum1=vbuc1 + // [3326] cbm_k_setlfs::device = 8 -- vbum1=vbuc1 lda #8 sta cbm_k_setlfs.device - // [2829] cbm_k_setlfs::command = $f -- vbum1=vbuc1 + // [3327] cbm_k_setlfs::command = $f -- vbum1=vbuc1 lda #$f sta cbm_k_setlfs.command - // [2830] call cbm_k_setlfs + // [3328] call cbm_k_setlfs jsr cbm_k_setlfs // ferror::@11 // cbm_k_setnam("") - // [2831] ferror::cbm_k_setnam1_filename = info_text8 -- pbum1=pbuc1 - lda #info_text8 + lda #>str sta cbm_k_setnam1_filename+1 // ferror::cbm_k_setnam1 // strlen(filename) - // [2832] strlen::str#5 = ferror::cbm_k_setnam1_filename -- pbuz1=pbum2 + // [3330] strlen::str#5 = ferror::cbm_k_setnam1_filename -- pbuz1=pbum2 lda cbm_k_setnam1_filename sta.z strlen.str lda cbm_k_setnam1_filename+1 sta.z strlen.str+1 - // [2833] call strlen - // [2155] phi from ferror::cbm_k_setnam1 to strlen [phi:ferror::cbm_k_setnam1->strlen] - // [2155] phi strlen::str#8 = strlen::str#5 [phi:ferror::cbm_k_setnam1->strlen#0] -- register_copy + // [3331] call strlen + // [2555] phi from ferror::cbm_k_setnam1 to strlen [phi:ferror::cbm_k_setnam1->strlen] + // [2555] phi strlen::str#8 = strlen::str#5 [phi:ferror::cbm_k_setnam1->strlen#0] -- register_copy jsr strlen // strlen(filename) - // [2834] strlen::return#12 = strlen::len#2 + // [3332] strlen::return#12 = strlen::len#2 // ferror::@12 - // [2835] ferror::cbm_k_setnam1_$0 = strlen::return#12 -- vwuz1=vwum2 + // [3333] ferror::cbm_k_setnam1_$0 = strlen::return#12 -- vwuz1=vwum2 lda strlen.return sta.z cbm_k_setnam1_ferror__0 lda strlen.return+1 sta.z cbm_k_setnam1_ferror__0+1 // char filename_len = (char)strlen(filename) - // [2836] ferror::cbm_k_setnam1_filename_len = (char)ferror::cbm_k_setnam1_$0 -- vbum1=_byte_vwuz2 + // [3334] ferror::cbm_k_setnam1_filename_len = (char)ferror::cbm_k_setnam1_$0 -- vbum1=_byte_vwuz2 lda.z cbm_k_setnam1_ferror__0 sta cbm_k_setnam1_filename_len // asm @@ -18890,12 +21437,12 @@ ferror: { jsr CBM_OPEN // ferror::@6 // cbm_k_chkin(15) - // [2839] ferror::cbm_k_chkin1_channel = $f -- vbum1=vbuc1 + // [3337] ferror::cbm_k_chkin1_channel = $f -- vbum1=vbuc1 lda #$f sta cbm_k_chkin1_channel // ferror::cbm_k_chkin1 // char status - // [2840] ferror::cbm_k_chkin1_status = 0 -- vbum1=vbuc1 + // [3338] ferror::cbm_k_chkin1_status = 0 -- vbum1=vbuc1 lda #0 sta cbm_k_chkin1_status // asm @@ -18905,7 +21452,7 @@ ferror: { sta cbm_k_chkin1_status // ferror::cbm_k_chrin1 // char ch - // [2842] ferror::cbm_k_chrin1_ch = 0 -- vbum1=vbuc1 + // [3340] ferror::cbm_k_chrin1_ch = 0 -- vbum1=vbuc1 lda #0 sta cbm_k_chrin1_ch // asm @@ -18913,26 +21460,26 @@ ferror: { jsr CBM_CHRIN sta cbm_k_chrin1_ch // return ch; - // [2844] ferror::cbm_k_chrin1_return#0 = ferror::cbm_k_chrin1_ch -- vbum1=vbum2 - sta cbm_k_chrin1_return + // [3342] ferror::cbm_k_chrin1_return#0 = ferror::cbm_k_chrin1_ch -- vbuaa=vbum1 // ferror::cbm_k_chrin1_@return // } - // [2845] ferror::cbm_k_chrin1_return#1 = ferror::cbm_k_chrin1_return#0 + // [3343] ferror::cbm_k_chrin1_return#1 = ferror::cbm_k_chrin1_return#0 // ferror::@7 // char ch = cbm_k_chrin() - // [2846] ferror::ch#0 = ferror::cbm_k_chrin1_return#1 - // [2847] phi from ferror::@7 to ferror::cbm_k_readst1 [phi:ferror::@7->ferror::cbm_k_readst1] - // [2847] phi __errno#18 = __errno#322 [phi:ferror::@7->ferror::cbm_k_readst1#0] -- register_copy - // [2847] phi ferror::errno_len#10 = 0 [phi:ferror::@7->ferror::cbm_k_readst1#1] -- vbuz1=vbuc1 + // [3344] ferror::ch#0 = ferror::cbm_k_chrin1_return#1 -- vbum1=vbuaa + sta ch + // [3345] phi from ferror::@7 to ferror::cbm_k_readst1 [phi:ferror::@7->ferror::cbm_k_readst1] + // [3345] phi __errno#123 = __errno#474 [phi:ferror::@7->ferror::cbm_k_readst1#0] -- register_copy + // [3345] phi ferror::errno_len#10 = 0 [phi:ferror::@7->ferror::cbm_k_readst1#1] -- vbuz1=vbuc1 lda #0 sta.z errno_len - // [2847] phi ferror::ch#10 = ferror::ch#0 [phi:ferror::@7->ferror::cbm_k_readst1#2] -- register_copy - // [2847] phi ferror::errno_parsed#2 = 0 [phi:ferror::@7->ferror::cbm_k_readst1#3] -- vbum1=vbuc1 + // [3345] phi ferror::ch#10 = ferror::ch#0 [phi:ferror::@7->ferror::cbm_k_readst1#2] -- register_copy + // [3345] phi ferror::errno_parsed#2 = 0 [phi:ferror::@7->ferror::cbm_k_readst1#3] -- vbum1=vbuc1 sta errno_parsed // ferror::cbm_k_readst1 cbm_k_readst1: // char status - // [2848] ferror::cbm_k_readst1_status = 0 -- vbum1=vbuc1 + // [3346] ferror::cbm_k_readst1_status = 0 -- vbum1=vbuc1 lda #0 sta cbm_k_readst1_status // asm @@ -18940,28 +21487,26 @@ ferror: { jsr CBM_READST sta cbm_k_readst1_status // return status; - // [2850] ferror::cbm_k_readst1_return#0 = ferror::cbm_k_readst1_status -- vbum1=vbum2 - sta cbm_k_readst1_return + // [3348] ferror::cbm_k_readst1_return#0 = ferror::cbm_k_readst1_status -- vbuaa=vbum1 // ferror::cbm_k_readst1_@return // } - // [2851] ferror::cbm_k_readst1_return#1 = ferror::cbm_k_readst1_return#0 + // [3349] ferror::cbm_k_readst1_return#1 = ferror::cbm_k_readst1_return#0 // ferror::@8 // cbm_k_readst() - // [2852] ferror::$6 = ferror::cbm_k_readst1_return#1 -- vbuz1=vbum2 - sta.z ferror__6 + // [3350] ferror::$6 = ferror::cbm_k_readst1_return#1 // st = cbm_k_readst() - // [2853] ferror::st#1 = ferror::$6 -- vbum1=vbuz2 - sta st + // [3351] ferror::st#1 = ferror::$6 // while (!(st = cbm_k_readst())) - // [2854] if(0==ferror::st#1) goto ferror::@1 -- 0_eq_vbum1_then_la1 + // [3352] if(0==ferror::st#1) goto ferror::@1 -- 0_eq_vbuaa_then_la1 + cmp #0 beq __b1 // ferror::@2 // __status = st - // [2855] ((char *)&__stdio_file+$46)[ferror::sp#0] = ferror::st#1 -- pbuc1_derefidx_vbum1=vbum2 + // [3353] ((char *)&__stdio_file+$46)[ferror::sp#0] = ferror::st#1 -- pbuc1_derefidx_vbum1=vbuaa ldy sp sta __stdio_file+$46,y // cbm_k_close(15) - // [2856] ferror::cbm_k_close1_channel = $f -- vbum1=vbuc1 + // [3354] ferror::cbm_k_close1_channel = $f -- vbum1=vbuc1 lda #$f sta cbm_k_close1_channel // ferror::cbm_k_close1 @@ -18970,33 +21515,33 @@ ferror: { jsr CBM_CLOSE // ferror::@9 // return __errno; - // [2858] ferror::return#1 = __errno#18 -- vwsm1=vwsm2 + // [3356] ferror::return#1 = __errno#123 -- vwsm1=vwsm2 lda __errno sta return lda __errno+1 sta return+1 // ferror::@return // } - // [2859] return + // [3357] return rts // ferror::@1 __b1: // if (!errno_parsed) - // [2860] if(0!=ferror::errno_parsed#2) goto ferror::@3 -- 0_neq_vbum1_then_la1 + // [3358] if(0!=ferror::errno_parsed#2) goto ferror::@3 -- 0_neq_vbum1_then_la1 lda errno_parsed bne __b3 // ferror::@4 // if (ch == ',') - // [2861] if(ferror::ch#10!=',') goto ferror::@3 -- vbum1_neq_vbuc1_then_la1 + // [3359] if(ferror::ch#10!=',') goto ferror::@3 -- vbum1_neq_vbuc1_then_la1 lda #',' cmp ch bne __b3 // ferror::@5 // errno_parsed++; - // [2862] ferror::errno_parsed#1 = ++ ferror::errno_parsed#2 -- vbum1=_inc_vbum1 + // [3360] ferror::errno_parsed#1 = ++ ferror::errno_parsed#2 -- vbum1=_inc_vbum1 inc errno_parsed // strncpy(temp, __errno_error, errno_len+1) - // [2863] strncpy::n#0 = ferror::errno_len#10 + 1 -- vwum1=vbuz2_plus_1 + // [3361] strncpy::n#0 = ferror::errno_len#10 + 1 -- vwum1=vbuz2_plus_1 lda.z errno_len clc adc #1 @@ -19004,56 +21549,56 @@ ferror: { lda #0 adc #0 sta strncpy.n+1 - // [2864] call strncpy - // [2506] phi from ferror::@5 to strncpy [phi:ferror::@5->strncpy] - // [2506] phi strncpy::dst#8 = ferror::temp [phi:ferror::@5->strncpy#0] -- pbuz1=pbuc1 + // [3362] call strncpy + // [2916] phi from ferror::@5 to strncpy [phi:ferror::@5->strncpy] + // [2916] phi strncpy::dst#8 = ferror::temp [phi:ferror::@5->strncpy#0] -- pbuz1=pbuc1 lda #temp sta.z strncpy.dst+1 - // [2506] phi strncpy::src#6 = __errno_error [phi:ferror::@5->strncpy#1] -- pbuz1=pbuc1 + // [2916] phi strncpy::src#6 = __errno_error [phi:ferror::@5->strncpy#1] -- pbuz1=pbuc1 lda #<__errno_error sta.z strncpy.src lda #>__errno_error sta.z strncpy.src+1 - // [2506] phi strncpy::n#3 = strncpy::n#0 [phi:ferror::@5->strncpy#2] -- register_copy + // [2916] phi strncpy::n#3 = strncpy::n#0 [phi:ferror::@5->strncpy#2] -- register_copy jsr strncpy - // [2865] phi from ferror::@5 to ferror::@13 [phi:ferror::@5->ferror::@13] + // [3363] phi from ferror::@5 to ferror::@13 [phi:ferror::@5->ferror::@13] // ferror::@13 // atoi(temp) - // [2866] call atoi - // [2878] phi from ferror::@13 to atoi [phi:ferror::@13->atoi] - // [2878] phi atoi::str#2 = ferror::temp [phi:ferror::@13->atoi#0] -- pbuz1=pbuc1 + // [3364] call atoi + // [3376] phi from ferror::@13 to atoi [phi:ferror::@13->atoi] + // [3376] phi atoi::str#2 = ferror::temp [phi:ferror::@13->atoi#0] -- pbuz1=pbuc1 lda #temp sta.z atoi.str+1 jsr atoi // atoi(temp) - // [2867] atoi::return#4 = atoi::return#2 + // [3365] atoi::return#4 = atoi::return#2 // ferror::@14 // __errno = atoi(temp) - // [2868] __errno#2 = atoi::return#4 -- vwsm1=vwsm2 + // [3366] __errno#2 = atoi::return#4 -- vwsm1=vwsm2 lda atoi.return sta __errno lda atoi.return+1 sta __errno+1 - // [2869] phi from ferror::@1 ferror::@14 ferror::@4 to ferror::@3 [phi:ferror::@1/ferror::@14/ferror::@4->ferror::@3] - // [2869] phi __errno#107 = __errno#18 [phi:ferror::@1/ferror::@14/ferror::@4->ferror::@3#0] -- register_copy - // [2869] phi ferror::errno_parsed#11 = ferror::errno_parsed#2 [phi:ferror::@1/ferror::@14/ferror::@4->ferror::@3#1] -- register_copy + // [3367] phi from ferror::@1 ferror::@14 ferror::@4 to ferror::@3 [phi:ferror::@1/ferror::@14/ferror::@4->ferror::@3] + // [3367] phi __errno#178 = __errno#123 [phi:ferror::@1/ferror::@14/ferror::@4->ferror::@3#0] -- register_copy + // [3367] phi ferror::errno_parsed#11 = ferror::errno_parsed#2 [phi:ferror::@1/ferror::@14/ferror::@4->ferror::@3#1] -- register_copy // ferror::@3 __b3: // __errno_error[errno_len] = ch - // [2870] __errno_error[ferror::errno_len#10] = ferror::ch#10 -- pbuc1_derefidx_vbuz1=vbum2 + // [3368] __errno_error[ferror::errno_len#10] = ferror::ch#10 -- pbuc1_derefidx_vbuz1=vbum2 lda ch ldy.z errno_len sta __errno_error,y // errno_len++; - // [2871] ferror::errno_len#1 = ++ ferror::errno_len#10 -- vbuz1=_inc_vbuz1 + // [3369] ferror::errno_len#1 = ++ ferror::errno_len#10 -- vbuz1=_inc_vbuz1 inc.z errno_len // ferror::cbm_k_chrin2 // char ch - // [2872] ferror::cbm_k_chrin2_ch = 0 -- vbum1=vbuc1 + // [3370] ferror::cbm_k_chrin2_ch = 0 -- vbum1=vbuc1 lda #0 sta cbm_k_chrin2_ch // asm @@ -19061,23 +21606,21 @@ ferror: { jsr CBM_CHRIN sta cbm_k_chrin2_ch // return ch; - // [2874] ferror::cbm_k_chrin2_return#0 = ferror::cbm_k_chrin2_ch -- vbum1=vbum2 - sta cbm_k_chrin2_return + // [3372] ferror::cbm_k_chrin2_return#0 = ferror::cbm_k_chrin2_ch -- vbuaa=vbum1 // ferror::cbm_k_chrin2_@return // } - // [2875] ferror::cbm_k_chrin2_return#1 = ferror::cbm_k_chrin2_return#0 + // [3373] ferror::cbm_k_chrin2_return#1 = ferror::cbm_k_chrin2_return#0 // ferror::@10 // cbm_k_chrin() - // [2876] ferror::$15 = ferror::cbm_k_chrin2_return#1 -- vbuz1=vbum2 - sta.z ferror__15 + // [3374] ferror::$15 = ferror::cbm_k_chrin2_return#1 // ch = cbm_k_chrin() - // [2877] ferror::ch#1 = ferror::$15 -- vbum1=vbuz2 + // [3375] ferror::ch#1 = ferror::$15 -- vbum1=vbuaa sta ch - // [2847] phi from ferror::@10 to ferror::cbm_k_readst1 [phi:ferror::@10->ferror::cbm_k_readst1] - // [2847] phi __errno#18 = __errno#107 [phi:ferror::@10->ferror::cbm_k_readst1#0] -- register_copy - // [2847] phi ferror::errno_len#10 = ferror::errno_len#1 [phi:ferror::@10->ferror::cbm_k_readst1#1] -- register_copy - // [2847] phi ferror::ch#10 = ferror::ch#1 [phi:ferror::@10->ferror::cbm_k_readst1#2] -- register_copy - // [2847] phi ferror::errno_parsed#2 = ferror::errno_parsed#11 [phi:ferror::@10->ferror::cbm_k_readst1#3] -- register_copy + // [3345] phi from ferror::@10 to ferror::cbm_k_readst1 [phi:ferror::@10->ferror::cbm_k_readst1] + // [3345] phi __errno#123 = __errno#178 [phi:ferror::@10->ferror::cbm_k_readst1#0] -- register_copy + // [3345] phi ferror::errno_len#10 = ferror::errno_len#1 [phi:ferror::@10->ferror::cbm_k_readst1#1] -- register_copy + // [3345] phi ferror::ch#10 = ferror::ch#1 [phi:ferror::@10->ferror::cbm_k_readst1#2] -- register_copy + // [3345] phi ferror::errno_parsed#2 = ferror::errno_parsed#11 [phi:ferror::@10->ferror::cbm_k_readst1#3] -- register_copy jmp cbm_k_readst1 .segment Data temp: .fill 4, 0 @@ -19089,66 +21632,59 @@ ferror: { cbm_k_readst1_status: .byte 0 cbm_k_close1_channel: .byte 0 cbm_k_chrin2_ch: .byte 0 - return: .word 0 - sp: .byte 0 - .label cbm_k_chrin1_return = ch - ch: .byte 0 - cbm_k_readst1_return: .byte 0 - st: .byte 0 - cbm_k_chrin2_return: .byte 0 - errno_parsed: .byte 0 + .label return = strncmp.n + .label sp = printf_padding.i + .label ch = uctoa.digit + .label errno_parsed = printf_string.format_justify_left } .segment Code // atoi // Converts the string argument str to an integer. -// __mem() int atoi(__zp($b0) const char *str) +// __mem() int atoi(__zp($6b) const char *str) atoi: { - .label atoi__6 = $39 - .label atoi__7 = $39 - .label str = $b0 - .label atoi__10 = $39 - .label atoi__11 = $39 + .label atoi__6 = $59 + .label atoi__7 = $59 + .label str = $6b + .label atoi__10 = $59 + .label atoi__11 = $59 // if (str[i] == '-') - // [2879] if(*atoi::str#2!='-') goto atoi::@3 -- _deref_pbuz1_neq_vbuc1_then_la1 + // [3377] if(*atoi::str#2!='-') goto atoi::@3 -- _deref_pbuz1_neq_vbuc1_then_la1 ldy #0 lda (str),y cmp #'-' bne __b2 - // [2880] phi from atoi to atoi::@2 [phi:atoi->atoi::@2] + // [3378] phi from atoi to atoi::@2 [phi:atoi->atoi::@2] // atoi::@2 - // [2881] phi from atoi::@2 to atoi::@3 [phi:atoi::@2->atoi::@3] - // [2881] phi atoi::negative#2 = 1 [phi:atoi::@2->atoi::@3#0] -- vbum1=vbuc1 - lda #1 - sta negative - // [2881] phi atoi::res#2 = 0 [phi:atoi::@2->atoi::@3#1] -- vwsm1=vwsc1 + // [3379] phi from atoi::@2 to atoi::@3 [phi:atoi::@2->atoi::@3] + // [3379] phi atoi::negative#2 = 1 [phi:atoi::@2->atoi::@3#0] -- vbuxx=vbuc1 + ldx #1 + // [3379] phi atoi::res#2 = 0 [phi:atoi::@2->atoi::@3#1] -- vwsm1=vwsc1 tya sta res sta res+1 - // [2881] phi atoi::i#4 = 1 [phi:atoi::@2->atoi::@3#2] -- vbum1=vbuc1 - lda #1 - sta i + // [3379] phi atoi::i#4 = 1 [phi:atoi::@2->atoi::@3#2] -- vbuyy=vbuc1 + ldy #1 jmp __b3 // Iterate through all digits and update the result - // [2881] phi from atoi to atoi::@3 [phi:atoi->atoi::@3] + // [3379] phi from atoi to atoi::@3 [phi:atoi->atoi::@3] __b2: - // [2881] phi atoi::negative#2 = 0 [phi:atoi->atoi::@3#0] -- vbum1=vbuc1 - lda #0 - sta negative - // [2881] phi atoi::res#2 = 0 [phi:atoi->atoi::@3#1] -- vwsm1=vwsc1 + // [3379] phi atoi::negative#2 = 0 [phi:atoi->atoi::@3#0] -- vbuxx=vbuc1 + ldx #0 + // [3379] phi atoi::res#2 = 0 [phi:atoi->atoi::@3#1] -- vwsm1=vwsc1 + txa sta res sta res+1 - // [2881] phi atoi::i#4 = 0 [phi:atoi->atoi::@3#2] -- vbum1=vbuc1 - sta i + // [3379] phi atoi::i#4 = 0 [phi:atoi->atoi::@3#2] -- vbuyy=vbuc1 + tay // atoi::@3 __b3: // for (; str[i]>='0' && str[i]<='9'; ++i) - // [2882] if(atoi::str#2[atoi::i#4]<'0') goto atoi::@5 -- pbuz1_derefidx_vbum2_lt_vbuc1_then_la1 - ldy i + // [3380] if(atoi::str#2[atoi::i#4]<'0') goto atoi::@5 -- pbuz1_derefidx_vbuyy_lt_vbuc1_then_la1 lda (str),y cmp #'0' bcc __b5 // atoi::@6 - // [2883] if(atoi::str#2[atoi::i#4]<='9') goto atoi::@4 -- pbuz1_derefidx_vbum2_le_vbuc1_then_la1 + // [3381] if(atoi::str#2[atoi::i#4]<='9') goto atoi::@4 -- pbuz1_derefidx_vbuyy_le_vbuc1_then_la1 lda (str),y cmp #'9' bcc __b4 @@ -19156,17 +21692,17 @@ atoi: { // atoi::@5 __b5: // if(negative) - // [2884] if(0!=atoi::negative#2) goto atoi::@1 -- 0_neq_vbum1_then_la1 + // [3382] if(0!=atoi::negative#2) goto atoi::@1 -- 0_neq_vbuxx_then_la1 // Return result with sign - lda negative + cpx #0 bne __b1 - // [2886] phi from atoi::@1 atoi::@5 to atoi::@return [phi:atoi::@1/atoi::@5->atoi::@return] - // [2886] phi atoi::return#2 = atoi::return#0 [phi:atoi::@1/atoi::@5->atoi::@return#0] -- register_copy + // [3384] phi from atoi::@1 atoi::@5 to atoi::@return [phi:atoi::@1/atoi::@5->atoi::@return] + // [3384] phi atoi::return#2 = atoi::return#0 [phi:atoi::@1/atoi::@5->atoi::@return#0] -- register_copy rts // atoi::@1 __b1: // return -res; - // [2885] atoi::return#0 = - atoi::res#2 -- vwsm1=_neg_vwsm1 + // [3383] atoi::return#0 = - atoi::res#2 -- vwsm1=_neg_vwsm1 lda #0 sec sbc return @@ -19176,12 +21712,12 @@ atoi: { sta return+1 // atoi::@return // } - // [2887] return + // [3385] return rts // atoi::@4 __b4: // res * 10 - // [2888] atoi::$10 = atoi::res#2 << 2 -- vwsz1=vwsm2_rol_2 + // [3386] atoi::$10 = atoi::res#2 << 2 -- vwsz1=vwsm2_rol_2 lda res asl sta.z atoi__10 @@ -19190,7 +21726,7 @@ atoi: { sta.z atoi__10+1 asl.z atoi__10 rol.z atoi__10+1 - // [2889] atoi::$11 = atoi::$10 + atoi::res#2 -- vwsz1=vwsz1_plus_vwsm2 + // [3387] atoi::$11 = atoi::$10 + atoi::res#2 -- vwsz1=vwsz1_plus_vwsm2 clc lda.z atoi__11 adc res @@ -19198,12 +21734,11 @@ atoi: { lda.z atoi__11+1 adc res+1 sta.z atoi__11+1 - // [2890] atoi::$6 = atoi::$11 << 1 -- vwsz1=vwsz1_rol_1 + // [3388] atoi::$6 = atoi::$11 << 1 -- vwsz1=vwsz1_rol_1 asl.z atoi__6 rol.z atoi__6+1 // res * 10 + str[i] - // [2891] atoi::$7 = atoi::$6 + atoi::str#2[atoi::i#4] -- vwsz1=vwsz1_plus_pbuz2_derefidx_vbum3 - ldy i + // [3389] atoi::$7 = atoi::$6 + atoi::str#2[atoi::i#4] -- vwsz1=vwsz1_plus_pbuz2_derefidx_vbuyy lda.z atoi__7 clc adc (str),y @@ -19212,7 +21747,7 @@ atoi: { inc.z atoi__7+1 !: // res = res * 10 + str[i] - '0' - // [2892] atoi::res#1 = atoi::$7 - '0' -- vwsm1=vwsz2_minus_vbuc1 + // [3390] atoi::res#1 = atoi::$7 - '0' -- vwsm1=vwsz2_minus_vbuc1 lda.z atoi__7 sec sbc #'0' @@ -19221,20 +21756,16 @@ atoi: { sbc #0 sta res+1 // for (; str[i]>='0' && str[i]<='9'; ++i) - // [2893] atoi::i#2 = ++ atoi::i#4 -- vbum1=_inc_vbum1 - inc i - // [2881] phi from atoi::@4 to atoi::@3 [phi:atoi::@4->atoi::@3] - // [2881] phi atoi::negative#2 = atoi::negative#2 [phi:atoi::@4->atoi::@3#0] -- register_copy - // [2881] phi atoi::res#2 = atoi::res#1 [phi:atoi::@4->atoi::@3#1] -- register_copy - // [2881] phi atoi::i#4 = atoi::i#2 [phi:atoi::@4->atoi::@3#2] -- register_copy + // [3391] atoi::i#2 = ++ atoi::i#4 -- vbuyy=_inc_vbuyy + iny + // [3379] phi from atoi::@4 to atoi::@3 [phi:atoi::@4->atoi::@3] + // [3379] phi atoi::negative#2 = atoi::negative#2 [phi:atoi::@4->atoi::@3#0] -- register_copy + // [3379] phi atoi::res#2 = atoi::res#1 [phi:atoi::@4->atoi::@3#1] -- register_copy + // [3379] phi atoi::i#4 = atoi::i#2 [phi:atoi::@4->atoi::@3#2] -- register_copy jmp __b3 .segment Data - .label res = return - // Initialize sign as positive - i: .byte 0 - return: .word 0 - // Initialize result - negative: .byte 0 + .label res = strncmp.n + .label return = strncmp.n } .segment Code // cx16_k_macptr @@ -19246,11 +21777,11 @@ atoi: { * @return y the size of bytes read * @return if carry is set there is an error */ -// __mem() unsigned int cx16_k_macptr(__mem() volatile char bytes, __zp($7c) void * volatile buffer) +// __mem() unsigned int cx16_k_macptr(__mem() volatile char bytes, __zp($63) void * volatile buffer) cx16_k_macptr: { - .label buffer = $7c + .label buffer = $63 // unsigned int bytes_read - // [2894] cx16_k_macptr::bytes_read = 0 -- vwum1=vwuc1 + // [3392] cx16_k_macptr::bytes_read = 0 -- vwum1=vwuc1 lda #<0 sta bytes_read sta bytes_read+1 @@ -19269,15 +21800,15 @@ cx16_k_macptr: { sta bytes_read+1 !: // return bytes_read; - // [2896] cx16_k_macptr::return#0 = cx16_k_macptr::bytes_read -- vwum1=vwum2 + // [3394] cx16_k_macptr::return#0 = cx16_k_macptr::bytes_read -- vwum1=vwum2 lda bytes_read sta return lda bytes_read+1 sta return+1 // cx16_k_macptr::@return // } - // [2897] cx16_k_macptr::return#1 = cx16_k_macptr::return#0 - // [2898] return + // [3395] cx16_k_macptr::return#1 = cx16_k_macptr::return#0 + // [3396] return rts .segment Data bytes: .byte 0 @@ -19295,33 +21826,28 @@ cx16_k_macptr: { * @param address The 22 bit ROM address. * @param value The byte value to be written. */ -// __zp($29) char rom_byte_compare(__zp($56) char *ptr_rom, __zp($51) char value) +// __register(A) char rom_byte_compare(__zp($40) char *ptr_rom, __register(A) char value) rom_byte_compare: { - .label return = $29 - .label ptr_rom = $56 - .label value = $51 + .label ptr_rom = $40 // if (*ptr_rom != value) - // [2899] if(*rom_byte_compare::ptr_rom#0==rom_byte_compare::value#0) goto rom_byte_compare::@1 -- _deref_pbuz1_eq_vbuz2_then_la1 - lda.z value + // [3397] if(*rom_byte_compare::ptr_rom#0==rom_byte_compare::value#0) goto rom_byte_compare::@1 -- _deref_pbuz1_eq_vbuaa_then_la1 ldy #0 cmp (ptr_rom),y beq __b2 - // [2900] phi from rom_byte_compare to rom_byte_compare::@2 [phi:rom_byte_compare->rom_byte_compare::@2] + // [3398] phi from rom_byte_compare to rom_byte_compare::@2 [phi:rom_byte_compare->rom_byte_compare::@2] // rom_byte_compare::@2 - // [2901] phi from rom_byte_compare::@2 to rom_byte_compare::@1 [phi:rom_byte_compare::@2->rom_byte_compare::@1] - // [2901] phi rom_byte_compare::return#0 = 0 [phi:rom_byte_compare::@2->rom_byte_compare::@1#0] -- vbuz1=vbuc1 + // [3399] phi from rom_byte_compare::@2 to rom_byte_compare::@1 [phi:rom_byte_compare::@2->rom_byte_compare::@1] + // [3399] phi rom_byte_compare::return#0 = 0 [phi:rom_byte_compare::@2->rom_byte_compare::@1#0] -- vbuaa=vbuc1 tya - sta.z return rts - // [2901] phi from rom_byte_compare to rom_byte_compare::@1 [phi:rom_byte_compare->rom_byte_compare::@1] + // [3399] phi from rom_byte_compare to rom_byte_compare::@1 [phi:rom_byte_compare->rom_byte_compare::@1] __b2: - // [2901] phi rom_byte_compare::return#0 = 1 [phi:rom_byte_compare->rom_byte_compare::@1#0] -- vbuz1=vbuc1 + // [3399] phi rom_byte_compare::return#0 = 1 [phi:rom_byte_compare->rom_byte_compare::@1#0] -- vbuaa=vbuc1 lda #1 - sta.z return // rom_byte_compare::@1 // rom_byte_compare::@return // } - // [2902] return + // [3400] return rts } // ultoa_append @@ -19333,18 +21859,17 @@ rom_byte_compare: { // - sub : the value of a '1' in the digit. Subtracted continually while the digit is increased. // (For decimal the subs used are 10000, 1000, 100, 10, 1) // returns : the value reduced by sub * digit so that it is less than sub. -// __mem() unsigned long ultoa_append(__zp($41) char *buffer, __mem() unsigned long value, __mem() unsigned long sub) +// __mem() unsigned long ultoa_append(__zp($32) char *buffer, __mem() unsigned long value, __mem() unsigned long sub) ultoa_append: { - .label buffer = $41 - // [2904] phi from ultoa_append to ultoa_append::@1 [phi:ultoa_append->ultoa_append::@1] - // [2904] phi ultoa_append::digit#2 = 0 [phi:ultoa_append->ultoa_append::@1#0] -- vbum1=vbuc1 - lda #0 - sta digit - // [2904] phi ultoa_append::value#2 = ultoa_append::value#0 [phi:ultoa_append->ultoa_append::@1#1] -- register_copy + .label buffer = $32 + // [3402] phi from ultoa_append to ultoa_append::@1 [phi:ultoa_append->ultoa_append::@1] + // [3402] phi ultoa_append::digit#2 = 0 [phi:ultoa_append->ultoa_append::@1#0] -- vbuxx=vbuc1 + ldx #0 + // [3402] phi ultoa_append::value#2 = ultoa_append::value#0 [phi:ultoa_append->ultoa_append::@1#1] -- register_copy // ultoa_append::@1 __b1: // while (value >= sub) - // [2905] if(ultoa_append::value#2>=ultoa_append::sub#0) goto ultoa_append::@2 -- vdum1_ge_vdum2_then_la1 + // [3403] if(ultoa_append::value#2>=ultoa_append::sub#0) goto ultoa_append::@2 -- vdum1_ge_vdum2_then_la1 lda value+3 cmp sub+3 bcc !+ @@ -19363,22 +21888,21 @@ ultoa_append: { !: // ultoa_append::@3 // *buffer = DIGITS[digit] - // [2906] *ultoa_append::buffer#0 = DIGITS[ultoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbum2 - ldy digit - lda DIGITS,y + // [3404] *ultoa_append::buffer#0 = DIGITS[ultoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbuxx + lda DIGITS,x ldy #0 sta (buffer),y // ultoa_append::@return // } - // [2907] return + // [3405] return rts // ultoa_append::@2 __b2: // digit++; - // [2908] ultoa_append::digit#1 = ++ ultoa_append::digit#2 -- vbum1=_inc_vbum1 - inc digit + // [3406] ultoa_append::digit#1 = ++ ultoa_append::digit#2 -- vbuxx=_inc_vbuxx + inx // value -= sub - // [2909] ultoa_append::value#1 = ultoa_append::value#2 - ultoa_append::sub#0 -- vdum1=vdum1_minus_vdum2 + // [3407] ultoa_append::value#1 = ultoa_append::value#2 - ultoa_append::sub#0 -- vdum1=vdum1_minus_vdum2 lda value sec sbc sub @@ -19392,15 +21916,14 @@ ultoa_append: { lda value+3 sbc sub+3 sta value+3 - // [2904] phi from ultoa_append::@2 to ultoa_append::@1 [phi:ultoa_append::@2->ultoa_append::@1] - // [2904] phi ultoa_append::digit#2 = ultoa_append::digit#1 [phi:ultoa_append::@2->ultoa_append::@1#0] -- register_copy - // [2904] phi ultoa_append::value#2 = ultoa_append::value#1 [phi:ultoa_append::@2->ultoa_append::@1#1] -- register_copy + // [3402] phi from ultoa_append::@2 to ultoa_append::@1 [phi:ultoa_append::@2->ultoa_append::@1] + // [3402] phi ultoa_append::digit#2 = ultoa_append::digit#1 [phi:ultoa_append::@2->ultoa_append::@1#0] -- register_copy + // [3402] phi ultoa_append::value#2 = ultoa_append::value#1 [phi:ultoa_append::@2->ultoa_append::@1#1] -- register_copy jmp __b1 .segment Data .label value = printf_ulong.uvalue .label sub = ultoa.digit_value .label return = printf_ulong.uvalue - digit: .byte 0 } .segment Code // rom_wait @@ -19417,42 +21940,37 @@ ultoa_append: { * @param ptr_rom The 16 bit pointer where the byte was written. This pointer is used for the sequence reads to verify bit 6. */ /* inline */ -// void rom_wait(__zp($2d) char *ptr_rom) +// void rom_wait(__zp($23) char *ptr_rom) rom_wait: { - .label rom_wait__0 = $2a - .label rom_wait__1 = $29 - .label test1 = $2a - .label test2 = $29 - .label ptr_rom = $2d + .label rom_wait__0 = $22 + .label ptr_rom = $23 // rom_wait::@1 __b1: // test1 = *((brom_ptr_t)ptr_rom) - // [2911] rom_wait::test1#1 = *rom_wait::ptr_rom#3 -- vbuz1=_deref_pbuz2 + // [3409] rom_wait::test1#1 = *rom_wait::ptr_rom#3 -- vbuxx=_deref_pbuz1 ldy #0 lda (ptr_rom),y - sta.z test1 + tax // test2 = *((brom_ptr_t)ptr_rom) - // [2912] rom_wait::test2#1 = *rom_wait::ptr_rom#3 -- vbuz1=_deref_pbuz2 + // [3410] rom_wait::test2#1 = *rom_wait::ptr_rom#3 -- vbuyy=_deref_pbuz1 lda (ptr_rom),y - sta.z test2 + tay // test1 & 0x40 - // [2913] rom_wait::$0 = rom_wait::test1#1 & $40 -- vbuz1=vbuz1_band_vbuc1 - lda #$40 - and.z rom_wait__0 + // [3411] rom_wait::$0 = rom_wait::test1#1 & $40 -- vbuz1=vbuxx_band_vbuc1 + txa + and #$40 sta.z rom_wait__0 // test2 & 0x40 - // [2914] rom_wait::$1 = rom_wait::test2#1 & $40 -- vbuz1=vbuz1_band_vbuc1 - lda #$40 - and.z rom_wait__1 - sta.z rom_wait__1 + // [3412] rom_wait::$1 = rom_wait::test2#1 & $40 -- vbuaa=vbuyy_band_vbuc1 + tya + and #$40 // while ((test1 & 0x40) != (test2 & 0x40)) - // [2915] if(rom_wait::$0!=rom_wait::$1) goto rom_wait::@1 -- vbuz1_neq_vbuz2_then_la1 - lda.z rom_wait__0 - cmp.z rom_wait__1 + // [3413] if(rom_wait::$0!=rom_wait::$1) goto rom_wait::@1 -- vbuz1_neq_vbuaa_then_la1 + cmp.z rom_wait__0 bne __b1 // rom_wait::@return // } - // [2916] return + // [3414] return rts } // rom_byte_program @@ -19463,21 +21981,20 @@ rom_wait: { * @param value The byte value to be written. */ /* inline */ -// void rom_byte_program(__zp($49) unsigned long address, __zp($4d) char value) +// void rom_byte_program(__zp($36) unsigned long address, __register(Y) char value) rom_byte_program: { - .label rom_ptr1_rom_byte_program__0 = $4e - .label rom_ptr1_rom_byte_program__2 = $4e - .label rom_ptr1_return = $4e - .label address = $49 - .label value = $4d + .label rom_ptr1_rom_byte_program__0 = $25 + .label rom_ptr1_rom_byte_program__2 = $25 + .label rom_ptr1_return = $25 + .label address = $36 // rom_byte_program::rom_ptr1 // (unsigned int)(address) & ROM_PTR_MASK - // [2918] rom_byte_program::rom_ptr1_$2 = (unsigned int)rom_byte_program::address#0 -- vwuz1=_word_vduz2 + // [3416] rom_byte_program::rom_ptr1_$2 = (unsigned int)rom_byte_program::address#0 -- vwuz1=_word_vduz2 lda.z address sta.z rom_ptr1_rom_byte_program__2 lda.z address+1 sta.z rom_ptr1_rom_byte_program__2+1 - // [2919] rom_byte_program::rom_ptr1_$0 = rom_byte_program::rom_ptr1_$2 & $3fff -- vwuz1=vwuz1_band_vwuc1 + // [3417] rom_byte_program::rom_ptr1_$0 = rom_byte_program::rom_ptr1_$2 & $3fff -- vwuz1=vwuz1_band_vwuc1 lda.z rom_ptr1_rom_byte_program__0 and #<$3fff sta.z rom_ptr1_rom_byte_program__0 @@ -19485,7 +22002,7 @@ rom_byte_program: { and #>$3fff sta.z rom_ptr1_rom_byte_program__0+1 // ((unsigned int)(address) & ROM_PTR_MASK) + ROM_BASE - // [2920] rom_byte_program::rom_ptr1_return#0 = rom_byte_program::rom_ptr1_$0 + $c000 -- vwuz1=vwuz1_plus_vwuc1 + // [3418] rom_byte_program::rom_ptr1_return#0 = rom_byte_program::rom_ptr1_$0 + $c000 -- vwuz1=vwuz1_plus_vwuc1 lda.z rom_ptr1_return clc adc #<$c000 @@ -19495,27 +22012,27 @@ rom_byte_program: { sta.z rom_ptr1_return+1 // rom_byte_program::@1 // rom_write_byte(address, value) - // [2921] rom_write_byte::address#3 = rom_byte_program::address#0 - // [2922] rom_write_byte::value#3 = rom_byte_program::value#0 - // [2923] call rom_write_byte - // [2805] phi from rom_byte_program::@1 to rom_write_byte [phi:rom_byte_program::@1->rom_write_byte] - // [2805] phi rom_write_byte::value#10 = rom_write_byte::value#3 [phi:rom_byte_program::@1->rom_write_byte#0] -- register_copy - // [2805] phi rom_write_byte::address#4 = rom_write_byte::address#3 [phi:rom_byte_program::@1->rom_write_byte#1] -- register_copy + // [3419] rom_write_byte::address#3 = rom_byte_program::address#0 + // [3420] rom_write_byte::value#3 = rom_byte_program::value#0 + // [3421] call rom_write_byte + // [3232] phi from rom_byte_program::@1 to rom_write_byte [phi:rom_byte_program::@1->rom_write_byte] + // [3232] phi rom_write_byte::value#10 = rom_write_byte::value#3 [phi:rom_byte_program::@1->rom_write_byte#0] -- register_copy + // [3232] phi rom_write_byte::address#4 = rom_write_byte::address#3 [phi:rom_byte_program::@1->rom_write_byte#1] -- register_copy jsr rom_write_byte // rom_byte_program::@2 // rom_wait(ptr_rom) - // [2924] rom_wait::ptr_rom#1 = (char *)rom_byte_program::rom_ptr1_return#0 -- pbuz1=pbuz2 + // [3422] rom_wait::ptr_rom#1 = (char *)rom_byte_program::rom_ptr1_return#0 -- pbuz1=pbuz2 lda.z rom_ptr1_return sta.z rom_wait.ptr_rom lda.z rom_ptr1_return+1 sta.z rom_wait.ptr_rom+1 - // [2925] call rom_wait - // [2910] phi from rom_byte_program::@2 to rom_wait [phi:rom_byte_program::@2->rom_wait] - // [2910] phi rom_wait::ptr_rom#3 = rom_wait::ptr_rom#1 [phi:rom_byte_program::@2->rom_wait#0] -- register_copy + // [3423] call rom_wait + // [3408] phi from rom_byte_program::@2 to rom_wait [phi:rom_byte_program::@2->rom_wait] + // [3408] phi rom_wait::ptr_rom#3 = rom_wait::ptr_rom#1 [phi:rom_byte_program::@2->rom_wait#0] -- register_copy jsr rom_wait // rom_byte_program::@return // } - // [2926] return + // [3424] return rts } // utoa_append @@ -19527,18 +22044,17 @@ rom_byte_program: { // - sub : the value of a '1' in the digit. Subtracted continually while the digit is increased. // (For decimal the subs used are 10000, 1000, 100, 10, 1) // returns : the value reduced by sub * digit so that it is less than sub. -// __mem() unsigned int utoa_append(__zp($41) char *buffer, __mem() unsigned int value, __mem() unsigned int sub) +// __mem() unsigned int utoa_append(__zp($2c) char *buffer, __mem() unsigned int value, __mem() unsigned int sub) utoa_append: { - .label buffer = $41 - // [2928] phi from utoa_append to utoa_append::@1 [phi:utoa_append->utoa_append::@1] - // [2928] phi utoa_append::digit#2 = 0 [phi:utoa_append->utoa_append::@1#0] -- vbum1=vbuc1 - lda #0 - sta digit - // [2928] phi utoa_append::value#2 = utoa_append::value#0 [phi:utoa_append->utoa_append::@1#1] -- register_copy + .label buffer = $2c + // [3426] phi from utoa_append to utoa_append::@1 [phi:utoa_append->utoa_append::@1] + // [3426] phi utoa_append::digit#2 = 0 [phi:utoa_append->utoa_append::@1#0] -- vbuxx=vbuc1 + ldx #0 + // [3426] phi utoa_append::value#2 = utoa_append::value#0 [phi:utoa_append->utoa_append::@1#1] -- register_copy // utoa_append::@1 __b1: // while (value >= sub) - // [2929] if(utoa_append::value#2>=utoa_append::sub#0) goto utoa_append::@2 -- vwum1_ge_vwum2_then_la1 + // [3427] if(utoa_append::value#2>=utoa_append::sub#0) goto utoa_append::@2 -- vwum1_ge_vwum2_then_la1 lda sub+1 cmp value+1 bne !+ @@ -19549,22 +22065,21 @@ utoa_append: { bcc __b2 // utoa_append::@3 // *buffer = DIGITS[digit] - // [2930] *utoa_append::buffer#0 = DIGITS[utoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbum2 - ldy digit - lda DIGITS,y + // [3428] *utoa_append::buffer#0 = DIGITS[utoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbuxx + lda DIGITS,x ldy #0 sta (buffer),y // utoa_append::@return // } - // [2931] return + // [3429] return rts // utoa_append::@2 __b2: // digit++; - // [2932] utoa_append::digit#1 = ++ utoa_append::digit#2 -- vbum1=_inc_vbum1 - inc digit + // [3430] utoa_append::digit#1 = ++ utoa_append::digit#2 -- vbuxx=_inc_vbuxx + inx // value -= sub - // [2933] utoa_append::value#1 = utoa_append::value#2 - utoa_append::sub#0 -- vwum1=vwum1_minus_vwum2 + // [3431] utoa_append::value#1 = utoa_append::value#2 - utoa_append::sub#0 -- vwum1=vwum1_minus_vwum2 lda value sec sbc sub @@ -19572,15 +22087,14 @@ utoa_append: { lda value+1 sbc sub+1 sta value+1 - // [2928] phi from utoa_append::@2 to utoa_append::@1 [phi:utoa_append::@2->utoa_append::@1] - // [2928] phi utoa_append::digit#2 = utoa_append::digit#1 [phi:utoa_append::@2->utoa_append::@1#0] -- register_copy - // [2928] phi utoa_append::value#2 = utoa_append::value#1 [phi:utoa_append::@2->utoa_append::@1#1] -- register_copy + // [3426] phi from utoa_append::@2 to utoa_append::@1 [phi:utoa_append::@2->utoa_append::@1] + // [3426] phi utoa_append::digit#2 = utoa_append::digit#1 [phi:utoa_append::@2->utoa_append::@1#0] -- register_copy + // [3426] phi utoa_append::value#2 = utoa_append::value#1 [phi:utoa_append::@2->utoa_append::@1#1] -- register_copy jmp __b1 .segment Data - .label value = printf_uint.uvalue - .label sub = utoa.digit_value - .label return = printf_uint.uvalue - digit: .byte 0 + .label value = strncmp.n + .label sub = fgets.remaining + .label return = strncmp.n } .segment Code // memcpy8_vram_vram @@ -19597,102 +22111,88 @@ utoa_append: { * @param soffset_vram Offset of the source location in vram. * @param num16 Specified the amount of bytes to be copied. */ -// void memcpy8_vram_vram(__mem() char dbank_vram, __mem() unsigned int doffset_vram, __mem() char sbank_vram, __mem() unsigned int soffset_vram, __mem() char num8) +// void memcpy8_vram_vram(__mem() char dbank_vram, __mem() unsigned int doffset_vram, __mem() char sbank_vram, __mem() unsigned int soffset_vram, __register(X) char num8) memcpy8_vram_vram: { - .label memcpy8_vram_vram__0 = $23 - .label memcpy8_vram_vram__1 = $24 - .label memcpy8_vram_vram__2 = $25 - .label memcpy8_vram_vram__3 = $26 - .label memcpy8_vram_vram__4 = $27 - .label memcpy8_vram_vram__5 = $28 // *VERA_CTRL &= ~VERA_ADDRSEL - // [2934] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [3432] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_ADDRSEL^$ff and VERA_CTRL sta VERA_CTRL // BYTE0(soffset_vram) - // [2935] memcpy8_vram_vram::$0 = byte0 memcpy8_vram_vram::soffset_vram#0 -- vbuz1=_byte0_vwum2 + // [3433] memcpy8_vram_vram::$0 = byte0 memcpy8_vram_vram::soffset_vram#0 -- vbuaa=_byte0_vwum1 lda soffset_vram - sta.z memcpy8_vram_vram__0 // *VERA_ADDRX_L = BYTE0(soffset_vram) - // [2936] *VERA_ADDRX_L = memcpy8_vram_vram::$0 -- _deref_pbuc1=vbuz1 + // [3434] *VERA_ADDRX_L = memcpy8_vram_vram::$0 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_L // BYTE1(soffset_vram) - // [2937] memcpy8_vram_vram::$1 = byte1 memcpy8_vram_vram::soffset_vram#0 -- vbuz1=_byte1_vwum2 + // [3435] memcpy8_vram_vram::$1 = byte1 memcpy8_vram_vram::soffset_vram#0 -- vbuaa=_byte1_vwum1 lda soffset_vram+1 - sta.z memcpy8_vram_vram__1 // *VERA_ADDRX_M = BYTE1(soffset_vram) - // [2938] *VERA_ADDRX_M = memcpy8_vram_vram::$1 -- _deref_pbuc1=vbuz1 + // [3436] *VERA_ADDRX_M = memcpy8_vram_vram::$1 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_M // sbank_vram | VERA_INC_1 - // [2939] memcpy8_vram_vram::$2 = memcpy8_vram_vram::sbank_vram#0 | VERA_INC_1 -- vbuz1=vbum2_bor_vbuc1 + // [3437] memcpy8_vram_vram::$2 = memcpy8_vram_vram::sbank_vram#0 | VERA_INC_1 -- vbuaa=vbum1_bor_vbuc1 lda #VERA_INC_1 ora sbank_vram - sta.z memcpy8_vram_vram__2 // *VERA_ADDRX_H = sbank_vram | VERA_INC_1 - // [2940] *VERA_ADDRX_H = memcpy8_vram_vram::$2 -- _deref_pbuc1=vbuz1 + // [3438] *VERA_ADDRX_H = memcpy8_vram_vram::$2 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_H // *VERA_CTRL |= VERA_ADDRSEL - // [2941] *VERA_CTRL = *VERA_CTRL | VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + // [3439] *VERA_CTRL = *VERA_CTRL | VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 lda #VERA_ADDRSEL ora VERA_CTRL sta VERA_CTRL // BYTE0(doffset_vram) - // [2942] memcpy8_vram_vram::$3 = byte0 memcpy8_vram_vram::doffset_vram#0 -- vbuz1=_byte0_vwum2 + // [3440] memcpy8_vram_vram::$3 = byte0 memcpy8_vram_vram::doffset_vram#0 -- vbuaa=_byte0_vwum1 lda doffset_vram - sta.z memcpy8_vram_vram__3 // *VERA_ADDRX_L = BYTE0(doffset_vram) - // [2943] *VERA_ADDRX_L = memcpy8_vram_vram::$3 -- _deref_pbuc1=vbuz1 + // [3441] *VERA_ADDRX_L = memcpy8_vram_vram::$3 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_L // BYTE1(doffset_vram) - // [2944] memcpy8_vram_vram::$4 = byte1 memcpy8_vram_vram::doffset_vram#0 -- vbuz1=_byte1_vwum2 + // [3442] memcpy8_vram_vram::$4 = byte1 memcpy8_vram_vram::doffset_vram#0 -- vbuaa=_byte1_vwum1 lda doffset_vram+1 - sta.z memcpy8_vram_vram__4 // *VERA_ADDRX_M = BYTE1(doffset_vram) - // [2945] *VERA_ADDRX_M = memcpy8_vram_vram::$4 -- _deref_pbuc1=vbuz1 + // [3443] *VERA_ADDRX_M = memcpy8_vram_vram::$4 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_M // dbank_vram | VERA_INC_1 - // [2946] memcpy8_vram_vram::$5 = memcpy8_vram_vram::dbank_vram#0 | VERA_INC_1 -- vbuz1=vbum2_bor_vbuc1 + // [3444] memcpy8_vram_vram::$5 = memcpy8_vram_vram::dbank_vram#0 | VERA_INC_1 -- vbuaa=vbum1_bor_vbuc1 lda #VERA_INC_1 ora dbank_vram - sta.z memcpy8_vram_vram__5 // *VERA_ADDRX_H = dbank_vram | VERA_INC_1 - // [2947] *VERA_ADDRX_H = memcpy8_vram_vram::$5 -- _deref_pbuc1=vbuz1 + // [3445] *VERA_ADDRX_H = memcpy8_vram_vram::$5 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_H - // [2948] phi from memcpy8_vram_vram memcpy8_vram_vram::@2 to memcpy8_vram_vram::@1 [phi:memcpy8_vram_vram/memcpy8_vram_vram::@2->memcpy8_vram_vram::@1] + // [3446] phi from memcpy8_vram_vram memcpy8_vram_vram::@2 to memcpy8_vram_vram::@1 [phi:memcpy8_vram_vram/memcpy8_vram_vram::@2->memcpy8_vram_vram::@1] __b1: - // [2948] phi memcpy8_vram_vram::num8#2 = memcpy8_vram_vram::num8#1 [phi:memcpy8_vram_vram/memcpy8_vram_vram::@2->memcpy8_vram_vram::@1#0] -- register_copy + // [3446] phi memcpy8_vram_vram::num8#2 = memcpy8_vram_vram::num8#1 [phi:memcpy8_vram_vram/memcpy8_vram_vram::@2->memcpy8_vram_vram::@1#0] -- register_copy // the size is only a byte, this is the fastest loop! // memcpy8_vram_vram::@1 // while (num8--) - // [2949] memcpy8_vram_vram::num8#0 = -- memcpy8_vram_vram::num8#2 -- vbum1=_dec_vbum2 - ldy num8_1 - dey - sty num8 - // [2950] if(0!=memcpy8_vram_vram::num8#2) goto memcpy8_vram_vram::@2 -- 0_neq_vbum1_then_la1 - lda num8_1 + // [3447] memcpy8_vram_vram::num8#0 = -- memcpy8_vram_vram::num8#2 -- vbuxx=_dec_vbuyy + tya + tax + dex + // [3448] if(0!=memcpy8_vram_vram::num8#2) goto memcpy8_vram_vram::@2 -- 0_neq_vbuyy_then_la1 + cpy #0 bne __b2 // memcpy8_vram_vram::@return // } - // [2951] return + // [3449] return rts // memcpy8_vram_vram::@2 __b2: // *VERA_DATA1 = *VERA_DATA0 - // [2952] *VERA_DATA1 = *VERA_DATA0 -- _deref_pbuc1=_deref_pbuc2 + // [3450] *VERA_DATA1 = *VERA_DATA0 -- _deref_pbuc1=_deref_pbuc2 lda VERA_DATA0 sta VERA_DATA1 - // [2953] memcpy8_vram_vram::num8#6 = memcpy8_vram_vram::num8#0 -- vbum1=vbum2 - lda num8 - sta num8_1 + // [3451] memcpy8_vram_vram::num8#6 = memcpy8_vram_vram::num8#0 -- vbuyy=vbuxx + txa + tay jmp __b1 .segment Data - num8: .byte 0 dbank_vram: .byte 0 doffset_vram: .word 0 sbank_vram: .byte 0 soffset_vram: .word 0 - num8_1: .byte 0 } .segment Code // display_frame_maskxy @@ -19703,231 +22203,176 @@ memcpy8_vram_vram: { * @param y * @return unsigned char */ -// __zp($e0) char display_frame_maskxy(__zp($fb) char x, __mem() char y) +// __register(A) char display_frame_maskxy(__register(Y) char x, __register(A) char y) display_frame_maskxy: { - .label cpeekcxy1_cpeekc1_display_frame_maskxy__0 = $29 - .label cpeekcxy1_cpeekc1_display_frame_maskxy__1 = $dd - .label cpeekcxy1_cpeekc1_display_frame_maskxy__2 = $ed - .label c = $af - // DR corner. - // DL corner. - // UR corner. - // UL corner. - // HL line. - // VL line. - // VR junction. - // VL junction. - // HD junction. - // HU junction. - // HV junction. - .label return = $e0 - .label x = $fb - .label y_1 = $f7 // display_frame_maskxy::cpeekcxy1 // gotoxy(x,y) - // [2955] gotoxy::x#5 = display_frame_maskxy::cpeekcxy1_x#0 -- vbum1=vbum2 - lda cpeekcxy1_x - sta gotoxy.x - // [2956] gotoxy::y#5 = display_frame_maskxy::cpeekcxy1_y#0 -- vbum1=vbum2 - lda cpeekcxy1_y + // [3453] gotoxy::x#5 = display_frame_maskxy::cpeekcxy1_x#0 + // [3454] gotoxy::y#5 = display_frame_maskxy::cpeekcxy1_y#0 -- vbum1=vbuaa sta gotoxy.y - // [2957] call gotoxy - // [778] phi from display_frame_maskxy::cpeekcxy1 to gotoxy [phi:display_frame_maskxy::cpeekcxy1->gotoxy] - // [778] phi gotoxy::y#33 = gotoxy::y#5 [phi:display_frame_maskxy::cpeekcxy1->gotoxy#0] -- register_copy - // [778] phi gotoxy::x#33 = gotoxy::x#5 [phi:display_frame_maskxy::cpeekcxy1->gotoxy#1] -- register_copy + // [3455] call gotoxy + // [805] phi from display_frame_maskxy::cpeekcxy1 to gotoxy [phi:display_frame_maskxy::cpeekcxy1->gotoxy] + // [805] phi gotoxy::y#37 = gotoxy::y#5 [phi:display_frame_maskxy::cpeekcxy1->gotoxy#0] -- register_copy + // [805] phi gotoxy::x#37 = gotoxy::x#5 [phi:display_frame_maskxy::cpeekcxy1->gotoxy#1] -- register_copy jsr gotoxy // display_frame_maskxy::cpeekcxy1_cpeekc1 // *VERA_CTRL &= ~VERA_ADDRSEL - // [2958] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [3456] *VERA_CTRL = *VERA_CTRL & ~VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 lda #VERA_ADDRSEL^$ff and VERA_CTRL sta VERA_CTRL // BYTE0(__conio.offset) - // [2959] display_frame_maskxy::cpeekcxy1_cpeekc1_$0 = byte0 *((unsigned int *)&__conio+$13) -- vbuz1=_byte0__deref_pwuc1 + // [3457] display_frame_maskxy::cpeekcxy1_cpeekc1_$0 = byte0 *((unsigned int *)&__conio+$13) -- vbuaa=_byte0__deref_pwuc1 lda __conio+$13 - sta.z cpeekcxy1_cpeekc1_display_frame_maskxy__0 // *VERA_ADDRX_L = BYTE0(__conio.offset) - // [2960] *VERA_ADDRX_L = display_frame_maskxy::cpeekcxy1_cpeekc1_$0 -- _deref_pbuc1=vbuz1 + // [3458] *VERA_ADDRX_L = display_frame_maskxy::cpeekcxy1_cpeekc1_$0 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_L // BYTE1(__conio.offset) - // [2961] display_frame_maskxy::cpeekcxy1_cpeekc1_$1 = byte1 *((unsigned int *)&__conio+$13) -- vbuz1=_byte1__deref_pwuc1 + // [3459] display_frame_maskxy::cpeekcxy1_cpeekc1_$1 = byte1 *((unsigned int *)&__conio+$13) -- vbuaa=_byte1__deref_pwuc1 lda __conio+$13+1 - sta.z cpeekcxy1_cpeekc1_display_frame_maskxy__1 // *VERA_ADDRX_M = BYTE1(__conio.offset) - // [2962] *VERA_ADDRX_M = display_frame_maskxy::cpeekcxy1_cpeekc1_$1 -- _deref_pbuc1=vbuz1 + // [3460] *VERA_ADDRX_M = display_frame_maskxy::cpeekcxy1_cpeekc1_$1 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_M // __conio.mapbase_bank | VERA_INC_0 - // [2963] display_frame_maskxy::cpeekcxy1_cpeekc1_$2 = *((char *)&__conio+5) -- vbuz1=_deref_pbuc1 + // [3461] display_frame_maskxy::cpeekcxy1_cpeekc1_$2 = *((char *)&__conio+5) -- vbuaa=_deref_pbuc1 lda __conio+5 - sta.z cpeekcxy1_cpeekc1_display_frame_maskxy__2 // *VERA_ADDRX_H = __conio.mapbase_bank | VERA_INC_0 - // [2964] *VERA_ADDRX_H = display_frame_maskxy::cpeekcxy1_cpeekc1_$2 -- _deref_pbuc1=vbuz1 + // [3462] *VERA_ADDRX_H = display_frame_maskxy::cpeekcxy1_cpeekc1_$2 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_H // return *VERA_DATA0; - // [2965] display_frame_maskxy::c#0 = *VERA_DATA0 -- vbuz1=_deref_pbuc1 + // [3463] display_frame_maskxy::c#0 = *VERA_DATA0 -- vbuaa=_deref_pbuc1 lda VERA_DATA0 - sta.z c // display_frame_maskxy::@12 // case 0x70: // DR corner. // return 0b0110; - // [2966] if(display_frame_maskxy::c#0==$70) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$70 - cmp.z c + // [3464] if(display_frame_maskxy::c#0==$70) goto display_frame_maskxy::@return -- vbuaa_eq_vbuc1_then_la1 + cmp #$70 beq __b2 // display_frame_maskxy::@1 // case 0x6E: // DL corner. // return 0b0011; - // [2967] if(display_frame_maskxy::c#0==$6e) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$6e - cmp.z c + // [3465] if(display_frame_maskxy::c#0==$6e) goto display_frame_maskxy::@return -- vbuaa_eq_vbuc1_then_la1 + cmp #$6e beq __b1 // display_frame_maskxy::@2 // case 0x6D: // UR corner. // return 0b1100; - // [2968] if(display_frame_maskxy::c#0==$6d) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$6d - cmp.z c + // [3466] if(display_frame_maskxy::c#0==$6d) goto display_frame_maskxy::@return -- vbuaa_eq_vbuc1_then_la1 + cmp #$6d beq __b3 // display_frame_maskxy::@3 // case 0x7D: // UL corner. // return 0b1001; - // [2969] if(display_frame_maskxy::c#0==$7d) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$7d - cmp.z c + // [3467] if(display_frame_maskxy::c#0==$7d) goto display_frame_maskxy::@return -- vbuaa_eq_vbuc1_then_la1 + cmp #$7d beq __b4 // display_frame_maskxy::@4 // case 0x40: // HL line. // return 0b0101; - // [2970] if(display_frame_maskxy::c#0==$40) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$40 - cmp.z c + // [3468] if(display_frame_maskxy::c#0==$40) goto display_frame_maskxy::@return -- vbuaa_eq_vbuc1_then_la1 + cmp #$40 beq __b5 // display_frame_maskxy::@5 // case 0x5D: // VL line. // return 0b1010; - // [2971] if(display_frame_maskxy::c#0==$5d) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$5d - cmp.z c + // [3469] if(display_frame_maskxy::c#0==$5d) goto display_frame_maskxy::@return -- vbuaa_eq_vbuc1_then_la1 + cmp #$5d beq __b6 // display_frame_maskxy::@6 // case 0x6B: // VR junction. // return 0b1110; - // [2972] if(display_frame_maskxy::c#0==$6b) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$6b - cmp.z c + // [3470] if(display_frame_maskxy::c#0==$6b) goto display_frame_maskxy::@return -- vbuaa_eq_vbuc1_then_la1 + cmp #$6b beq __b7 // display_frame_maskxy::@7 // case 0x73: // VL junction. // return 0b1011; - // [2973] if(display_frame_maskxy::c#0==$73) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$73 - cmp.z c + // [3471] if(display_frame_maskxy::c#0==$73) goto display_frame_maskxy::@return -- vbuaa_eq_vbuc1_then_la1 + cmp #$73 beq __b8 // display_frame_maskxy::@8 // case 0x72: // HD junction. // return 0b0111; - // [2974] if(display_frame_maskxy::c#0==$72) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$72 - cmp.z c + // [3472] if(display_frame_maskxy::c#0==$72) goto display_frame_maskxy::@return -- vbuaa_eq_vbuc1_then_la1 + cmp #$72 beq __b9 // display_frame_maskxy::@9 // case 0x71: // HU junction. // return 0b1101; - // [2975] if(display_frame_maskxy::c#0==$71) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$71 - cmp.z c + // [3473] if(display_frame_maskxy::c#0==$71) goto display_frame_maskxy::@return -- vbuaa_eq_vbuc1_then_la1 + cmp #$71 beq __b10 // display_frame_maskxy::@10 // case 0x5B: // HV junction. // return 0b1111; - // [2976] if(display_frame_maskxy::c#0==$5b) goto display_frame_maskxy::@11 -- vbuz1_eq_vbuc1_then_la1 - lda #$5b - cmp.z c + // [3474] if(display_frame_maskxy::c#0==$5b) goto display_frame_maskxy::@11 -- vbuaa_eq_vbuc1_then_la1 + cmp #$5b beq __b11 - // [2978] phi from display_frame_maskxy::@10 to display_frame_maskxy::@return [phi:display_frame_maskxy::@10->display_frame_maskxy::@return] - // [2978] phi display_frame_maskxy::return#12 = 0 [phi:display_frame_maskxy::@10->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [3476] phi from display_frame_maskxy::@10 to display_frame_maskxy::@return [phi:display_frame_maskxy::@10->display_frame_maskxy::@return] + // [3476] phi display_frame_maskxy::return#12 = 0 [phi:display_frame_maskxy::@10->display_frame_maskxy::@return#0] -- vbuaa=vbuc1 lda #0 - sta.z return rts - // [2977] phi from display_frame_maskxy::@10 to display_frame_maskxy::@11 [phi:display_frame_maskxy::@10->display_frame_maskxy::@11] + // [3475] phi from display_frame_maskxy::@10 to display_frame_maskxy::@11 [phi:display_frame_maskxy::@10->display_frame_maskxy::@11] // display_frame_maskxy::@11 __b11: - // [2978] phi from display_frame_maskxy::@11 to display_frame_maskxy::@return [phi:display_frame_maskxy::@11->display_frame_maskxy::@return] - // [2978] phi display_frame_maskxy::return#12 = $f [phi:display_frame_maskxy::@11->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [3476] phi from display_frame_maskxy::@11 to display_frame_maskxy::@return [phi:display_frame_maskxy::@11->display_frame_maskxy::@return] + // [3476] phi display_frame_maskxy::return#12 = $f [phi:display_frame_maskxy::@11->display_frame_maskxy::@return#0] -- vbuaa=vbuc1 lda #$f - sta.z return rts - // [2978] phi from display_frame_maskxy::@1 to display_frame_maskxy::@return [phi:display_frame_maskxy::@1->display_frame_maskxy::@return] + // [3476] phi from display_frame_maskxy::@1 to display_frame_maskxy::@return [phi:display_frame_maskxy::@1->display_frame_maskxy::@return] __b1: - // [2978] phi display_frame_maskxy::return#12 = 3 [phi:display_frame_maskxy::@1->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [3476] phi display_frame_maskxy::return#12 = 3 [phi:display_frame_maskxy::@1->display_frame_maskxy::@return#0] -- vbuaa=vbuc1 lda #3 - sta.z return rts - // [2978] phi from display_frame_maskxy::@12 to display_frame_maskxy::@return [phi:display_frame_maskxy::@12->display_frame_maskxy::@return] + // [3476] phi from display_frame_maskxy::@12 to display_frame_maskxy::@return [phi:display_frame_maskxy::@12->display_frame_maskxy::@return] __b2: - // [2978] phi display_frame_maskxy::return#12 = 6 [phi:display_frame_maskxy::@12->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [3476] phi display_frame_maskxy::return#12 = 6 [phi:display_frame_maskxy::@12->display_frame_maskxy::@return#0] -- vbuaa=vbuc1 lda #6 - sta.z return rts - // [2978] phi from display_frame_maskxy::@2 to display_frame_maskxy::@return [phi:display_frame_maskxy::@2->display_frame_maskxy::@return] + // [3476] phi from display_frame_maskxy::@2 to display_frame_maskxy::@return [phi:display_frame_maskxy::@2->display_frame_maskxy::@return] __b3: - // [2978] phi display_frame_maskxy::return#12 = $c [phi:display_frame_maskxy::@2->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [3476] phi display_frame_maskxy::return#12 = $c [phi:display_frame_maskxy::@2->display_frame_maskxy::@return#0] -- vbuaa=vbuc1 lda #$c - sta.z return rts - // [2978] phi from display_frame_maskxy::@3 to display_frame_maskxy::@return [phi:display_frame_maskxy::@3->display_frame_maskxy::@return] + // [3476] phi from display_frame_maskxy::@3 to display_frame_maskxy::@return [phi:display_frame_maskxy::@3->display_frame_maskxy::@return] __b4: - // [2978] phi display_frame_maskxy::return#12 = 9 [phi:display_frame_maskxy::@3->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [3476] phi display_frame_maskxy::return#12 = 9 [phi:display_frame_maskxy::@3->display_frame_maskxy::@return#0] -- vbuaa=vbuc1 lda #9 - sta.z return rts - // [2978] phi from display_frame_maskxy::@4 to display_frame_maskxy::@return [phi:display_frame_maskxy::@4->display_frame_maskxy::@return] + // [3476] phi from display_frame_maskxy::@4 to display_frame_maskxy::@return [phi:display_frame_maskxy::@4->display_frame_maskxy::@return] __b5: - // [2978] phi display_frame_maskxy::return#12 = 5 [phi:display_frame_maskxy::@4->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [3476] phi display_frame_maskxy::return#12 = 5 [phi:display_frame_maskxy::@4->display_frame_maskxy::@return#0] -- vbuaa=vbuc1 lda #5 - sta.z return rts - // [2978] phi from display_frame_maskxy::@5 to display_frame_maskxy::@return [phi:display_frame_maskxy::@5->display_frame_maskxy::@return] + // [3476] phi from display_frame_maskxy::@5 to display_frame_maskxy::@return [phi:display_frame_maskxy::@5->display_frame_maskxy::@return] __b6: - // [2978] phi display_frame_maskxy::return#12 = $a [phi:display_frame_maskxy::@5->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [3476] phi display_frame_maskxy::return#12 = $a [phi:display_frame_maskxy::@5->display_frame_maskxy::@return#0] -- vbuaa=vbuc1 lda #$a - sta.z return rts - // [2978] phi from display_frame_maskxy::@6 to display_frame_maskxy::@return [phi:display_frame_maskxy::@6->display_frame_maskxy::@return] + // [3476] phi from display_frame_maskxy::@6 to display_frame_maskxy::@return [phi:display_frame_maskxy::@6->display_frame_maskxy::@return] __b7: - // [2978] phi display_frame_maskxy::return#12 = $e [phi:display_frame_maskxy::@6->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [3476] phi display_frame_maskxy::return#12 = $e [phi:display_frame_maskxy::@6->display_frame_maskxy::@return#0] -- vbuaa=vbuc1 lda #$e - sta.z return rts - // [2978] phi from display_frame_maskxy::@7 to display_frame_maskxy::@return [phi:display_frame_maskxy::@7->display_frame_maskxy::@return] + // [3476] phi from display_frame_maskxy::@7 to display_frame_maskxy::@return [phi:display_frame_maskxy::@7->display_frame_maskxy::@return] __b8: - // [2978] phi display_frame_maskxy::return#12 = $b [phi:display_frame_maskxy::@7->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [3476] phi display_frame_maskxy::return#12 = $b [phi:display_frame_maskxy::@7->display_frame_maskxy::@return#0] -- vbuaa=vbuc1 lda #$b - sta.z return rts - // [2978] phi from display_frame_maskxy::@8 to display_frame_maskxy::@return [phi:display_frame_maskxy::@8->display_frame_maskxy::@return] + // [3476] phi from display_frame_maskxy::@8 to display_frame_maskxy::@return [phi:display_frame_maskxy::@8->display_frame_maskxy::@return] __b9: - // [2978] phi display_frame_maskxy::return#12 = 7 [phi:display_frame_maskxy::@8->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [3476] phi display_frame_maskxy::return#12 = 7 [phi:display_frame_maskxy::@8->display_frame_maskxy::@return#0] -- vbuaa=vbuc1 lda #7 - sta.z return rts - // [2978] phi from display_frame_maskxy::@9 to display_frame_maskxy::@return [phi:display_frame_maskxy::@9->display_frame_maskxy::@return] + // [3476] phi from display_frame_maskxy::@9 to display_frame_maskxy::@return [phi:display_frame_maskxy::@9->display_frame_maskxy::@return] __b10: - // [2978] phi display_frame_maskxy::return#12 = $d [phi:display_frame_maskxy::@9->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [3476] phi display_frame_maskxy::return#12 = $d [phi:display_frame_maskxy::@9->display_frame_maskxy::@return#0] -- vbuaa=vbuc1 lda #$d - sta.z return // display_frame_maskxy::@return // } - // [2979] return + // [3477] return rts - .segment Data - cpeekcxy1_x: .byte 0 - cpeekcxy1_y: .byte 0 - .label y = main.main__52 - .label x_1 = main.check_status_smc9_main__0 - .label x_2 = main.check_status_smc8_main__0 } -.segment Code // display_frame_char /** * @brief @@ -19935,171 +22380,193 @@ display_frame_maskxy: { * @param mask * @return unsigned char */ -// __zp($dc) char display_frame_char(__zp($e0) char mask) +// __register(A) char display_frame_char(__register(A) char mask) display_frame_char: { - .label return = $dc - .label mask = $e0 // case 0b0110: // return 0x70; - // [2981] if(display_frame_char::mask#10==6) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 - lda #6 - cmp.z mask + // [3479] if(display_frame_char::mask#10==6) goto display_frame_char::@return -- vbuaa_eq_vbuc1_then_la1 + cmp #6 beq __b1 // display_frame_char::@1 // case 0b0011: // return 0x6E; - // [2982] if(display_frame_char::mask#10==3) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [3480] if(display_frame_char::mask#10==3) goto display_frame_char::@return -- vbuaa_eq_vbuc1_then_la1 // DR corner. - lda #3 - cmp.z mask + cmp #3 beq __b2 // display_frame_char::@2 // case 0b1100: // return 0x6D; - // [2983] if(display_frame_char::mask#10==$c) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [3481] if(display_frame_char::mask#10==$c) goto display_frame_char::@return -- vbuaa_eq_vbuc1_then_la1 // DL corner. - lda #$c - cmp.z mask + cmp #$c beq __b3 // display_frame_char::@3 // case 0b1001: // return 0x7D; - // [2984] if(display_frame_char::mask#10==9) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [3482] if(display_frame_char::mask#10==9) goto display_frame_char::@return -- vbuaa_eq_vbuc1_then_la1 // UR corner. - lda #9 - cmp.z mask + cmp #9 beq __b4 // display_frame_char::@4 // case 0b0101: // return 0x40; - // [2985] if(display_frame_char::mask#10==5) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [3483] if(display_frame_char::mask#10==5) goto display_frame_char::@return -- vbuaa_eq_vbuc1_then_la1 // UL corner. - lda #5 - cmp.z mask + cmp #5 beq __b5 // display_frame_char::@5 // case 0b1010: // return 0x5D; - // [2986] if(display_frame_char::mask#10==$a) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [3484] if(display_frame_char::mask#10==$a) goto display_frame_char::@return -- vbuaa_eq_vbuc1_then_la1 // HL line. - lda #$a - cmp.z mask + cmp #$a beq __b6 // display_frame_char::@6 // case 0b1110: // return 0x6B; - // [2987] if(display_frame_char::mask#10==$e) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [3485] if(display_frame_char::mask#10==$e) goto display_frame_char::@return -- vbuaa_eq_vbuc1_then_la1 // VL line. - lda #$e - cmp.z mask + cmp #$e beq __b7 // display_frame_char::@7 // case 0b1011: // return 0x73; - // [2988] if(display_frame_char::mask#10==$b) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [3486] if(display_frame_char::mask#10==$b) goto display_frame_char::@return -- vbuaa_eq_vbuc1_then_la1 // VR junction. - lda #$b - cmp.z mask + cmp #$b beq __b8 // display_frame_char::@8 // case 0b0111: // return 0x72; - // [2989] if(display_frame_char::mask#10==7) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [3487] if(display_frame_char::mask#10==7) goto display_frame_char::@return -- vbuaa_eq_vbuc1_then_la1 // VL junction. - lda #7 - cmp.z mask + cmp #7 beq __b9 // display_frame_char::@9 // case 0b1101: // return 0x71; - // [2990] if(display_frame_char::mask#10==$d) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [3488] if(display_frame_char::mask#10==$d) goto display_frame_char::@return -- vbuaa_eq_vbuc1_then_la1 // HD junction. - lda #$d - cmp.z mask + cmp #$d beq __b10 // display_frame_char::@10 // case 0b1111: // return 0x5B; - // [2991] if(display_frame_char::mask#10==$f) goto display_frame_char::@11 -- vbuz1_eq_vbuc1_then_la1 + // [3489] if(display_frame_char::mask#10==$f) goto display_frame_char::@11 -- vbuaa_eq_vbuc1_then_la1 // HU junction. - lda #$f - cmp.z mask + cmp #$f beq __b11 - // [2993] phi from display_frame_char::@10 to display_frame_char::@return [phi:display_frame_char::@10->display_frame_char::@return] - // [2993] phi display_frame_char::return#12 = $20 [phi:display_frame_char::@10->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [3491] phi from display_frame_char::@10 to display_frame_char::@return [phi:display_frame_char::@10->display_frame_char::@return] + // [3491] phi display_frame_char::return#12 = $20 [phi:display_frame_char::@10->display_frame_char::@return#0] -- vbuaa=vbuc1 lda #$20 - sta.z return rts - // [2992] phi from display_frame_char::@10 to display_frame_char::@11 [phi:display_frame_char::@10->display_frame_char::@11] + // [3490] phi from display_frame_char::@10 to display_frame_char::@11 [phi:display_frame_char::@10->display_frame_char::@11] // display_frame_char::@11 __b11: - // [2993] phi from display_frame_char::@11 to display_frame_char::@return [phi:display_frame_char::@11->display_frame_char::@return] - // [2993] phi display_frame_char::return#12 = $5b [phi:display_frame_char::@11->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [3491] phi from display_frame_char::@11 to display_frame_char::@return [phi:display_frame_char::@11->display_frame_char::@return] + // [3491] phi display_frame_char::return#12 = $5b [phi:display_frame_char::@11->display_frame_char::@return#0] -- vbuaa=vbuc1 lda #$5b - sta.z return rts - // [2993] phi from display_frame_char to display_frame_char::@return [phi:display_frame_char->display_frame_char::@return] + // [3491] phi from display_frame_char to display_frame_char::@return [phi:display_frame_char->display_frame_char::@return] __b1: - // [2993] phi display_frame_char::return#12 = $70 [phi:display_frame_char->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [3491] phi display_frame_char::return#12 = $70 [phi:display_frame_char->display_frame_char::@return#0] -- vbuaa=vbuc1 lda #$70 - sta.z return rts - // [2993] phi from display_frame_char::@1 to display_frame_char::@return [phi:display_frame_char::@1->display_frame_char::@return] + // [3491] phi from display_frame_char::@1 to display_frame_char::@return [phi:display_frame_char::@1->display_frame_char::@return] __b2: - // [2993] phi display_frame_char::return#12 = $6e [phi:display_frame_char::@1->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [3491] phi display_frame_char::return#12 = $6e [phi:display_frame_char::@1->display_frame_char::@return#0] -- vbuaa=vbuc1 lda #$6e - sta.z return rts - // [2993] phi from display_frame_char::@2 to display_frame_char::@return [phi:display_frame_char::@2->display_frame_char::@return] + // [3491] phi from display_frame_char::@2 to display_frame_char::@return [phi:display_frame_char::@2->display_frame_char::@return] __b3: - // [2993] phi display_frame_char::return#12 = $6d [phi:display_frame_char::@2->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [3491] phi display_frame_char::return#12 = $6d [phi:display_frame_char::@2->display_frame_char::@return#0] -- vbuaa=vbuc1 lda #$6d - sta.z return rts - // [2993] phi from display_frame_char::@3 to display_frame_char::@return [phi:display_frame_char::@3->display_frame_char::@return] + // [3491] phi from display_frame_char::@3 to display_frame_char::@return [phi:display_frame_char::@3->display_frame_char::@return] __b4: - // [2993] phi display_frame_char::return#12 = $7d [phi:display_frame_char::@3->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [3491] phi display_frame_char::return#12 = $7d [phi:display_frame_char::@3->display_frame_char::@return#0] -- vbuaa=vbuc1 lda #$7d - sta.z return rts - // [2993] phi from display_frame_char::@4 to display_frame_char::@return [phi:display_frame_char::@4->display_frame_char::@return] + // [3491] phi from display_frame_char::@4 to display_frame_char::@return [phi:display_frame_char::@4->display_frame_char::@return] __b5: - // [2993] phi display_frame_char::return#12 = $40 [phi:display_frame_char::@4->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [3491] phi display_frame_char::return#12 = $40 [phi:display_frame_char::@4->display_frame_char::@return#0] -- vbuaa=vbuc1 lda #$40 - sta.z return rts - // [2993] phi from display_frame_char::@5 to display_frame_char::@return [phi:display_frame_char::@5->display_frame_char::@return] + // [3491] phi from display_frame_char::@5 to display_frame_char::@return [phi:display_frame_char::@5->display_frame_char::@return] __b6: - // [2993] phi display_frame_char::return#12 = $5d [phi:display_frame_char::@5->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [3491] phi display_frame_char::return#12 = $5d [phi:display_frame_char::@5->display_frame_char::@return#0] -- vbuaa=vbuc1 lda #$5d - sta.z return rts - // [2993] phi from display_frame_char::@6 to display_frame_char::@return [phi:display_frame_char::@6->display_frame_char::@return] + // [3491] phi from display_frame_char::@6 to display_frame_char::@return [phi:display_frame_char::@6->display_frame_char::@return] __b7: - // [2993] phi display_frame_char::return#12 = $6b [phi:display_frame_char::@6->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [3491] phi display_frame_char::return#12 = $6b [phi:display_frame_char::@6->display_frame_char::@return#0] -- vbuaa=vbuc1 lda #$6b - sta.z return rts - // [2993] phi from display_frame_char::@7 to display_frame_char::@return [phi:display_frame_char::@7->display_frame_char::@return] + // [3491] phi from display_frame_char::@7 to display_frame_char::@return [phi:display_frame_char::@7->display_frame_char::@return] __b8: - // [2993] phi display_frame_char::return#12 = $73 [phi:display_frame_char::@7->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [3491] phi display_frame_char::return#12 = $73 [phi:display_frame_char::@7->display_frame_char::@return#0] -- vbuaa=vbuc1 lda #$73 - sta.z return rts - // [2993] phi from display_frame_char::@8 to display_frame_char::@return [phi:display_frame_char::@8->display_frame_char::@return] + // [3491] phi from display_frame_char::@8 to display_frame_char::@return [phi:display_frame_char::@8->display_frame_char::@return] __b9: - // [2993] phi display_frame_char::return#12 = $72 [phi:display_frame_char::@8->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [3491] phi display_frame_char::return#12 = $72 [phi:display_frame_char::@8->display_frame_char::@return#0] -- vbuaa=vbuc1 lda #$72 - sta.z return rts - // [2993] phi from display_frame_char::@9 to display_frame_char::@return [phi:display_frame_char::@9->display_frame_char::@return] + // [3491] phi from display_frame_char::@9 to display_frame_char::@return [phi:display_frame_char::@9->display_frame_char::@return] __b10: - // [2993] phi display_frame_char::return#12 = $71 [phi:display_frame_char::@9->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [3491] phi display_frame_char::return#12 = $71 [phi:display_frame_char::@9->display_frame_char::@return#0] -- vbuaa=vbuc1 lda #$71 - sta.z return // display_frame_char::@return // } - // [2994] return + // [3492] return + rts +} +.segment CodeVera + // spi_fast +spi_fast: { + // asm + // asm { ldavera_reg_SPICtrl and#%11111101 stavera_reg_SPICtrl } + /* +.proc spi_fast + lda Vera::Reg::SPICtrl + and #%11111101 + sta Vera::Reg::SPICtrl + rts +.endproc +*/ + lda vera_reg_SPICtrl + and #$fd + sta vera_reg_SPICtrl + // spi_fast::@return + // } + // [3494] return + rts +} + // spi_select +spi_select: { + // spi_deselect() + // [3496] call spi_deselect + /* +.proc spi_select + jsr spi_deselect + + lda Vera::Reg::SPICtrl + ora #$01 + sta Vera::Reg::SPICtrl + rts +.endproc +*/ + jsr spi_deselect + // spi_select::@1 + // *vera_reg_SPICtrl |= 1 + // [3497] *vera_reg_SPICtrl = *vera_reg_SPICtrl | 1 -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 + lda #1 + ora vera_reg_SPICtrl + sta vera_reg_SPICtrl + // spi_select::@return + // } + // [3498] return rts } // File Data @@ -20141,20 +22608,22 @@ display_frame_char: { RADIX_DECIMAL_VALUES_LONG: .dword $3b9aca00, $5f5e100, $989680, $f4240, $186a0, $2710, $3e8, $64, $a // Values of hexadecimal digits RADIX_HEXADECIMAL_VALUES_LONG: .dword $10000000, $1000000, $100000, $10000, $1000, $100, $10 - info_text: .fill $100, 0 + info_text: .fill $50, 0 status_text: .word __3, __4, __5, smc_action_text_1, smc_action_text, __8, __9, __10, __11, __12, __13, __14 status_color: .byte BLACK, GREY, WHITE, CYAN, PURPLE, CYAN, PURPLE, PURPLE, GREEN, YELLOW, RED, PINK status_rom: .byte 0 .fill 7, 0 .segment DataIntro - display_into_briefing_text: .word __15, __16, info_text8, __18, __19, __20, __21, __22, __23, info_text8, __25, __26, info_text8, __28, __29 - display_into_colors_text: .word __30, __31, info_text8, __33, __34, __35, __36, __37, __38, __39, __40, __41, __42, __43, info_text8, __45 + display_into_briefing_text: .word __15, __16, str, __18, __19, __20, __21, __22, __23, str, __25, __26, str, __28, __29 + display_into_colors_text: .word __30, __31, str, __33, __34, __35, __36, __37, __38, __39, __40, __41, __42, __43, str, __45 +.segment DataVera + display_jp1_spi_vera_text: .word __46, str, __48, __49, __50, __51, __52, str, __54, __55, str, __57, __58, __59, str, __61 + display_no_valid_smc_bootloader_text: .word __62, str, __64, __65, str, __67, __68, __69, __70 + display_smc_rom_issue_text: .word __71, str, __81, __74, str, __76, __77, __78 + display_smc_unsupported_rom_text: .word __79, str, __81, __82, str, __84, __85 .segment Data - display_no_valid_smc_bootloader_text: .word __46, info_text8, __48, __49, info_text8, __51, __52, __53, __54 - display_smc_rom_issue_text: .word __55, info_text8, __65, __58, info_text8, __60, __61, __62 - display_smc_unsupported_rom_text: .word __63, info_text8, __65, __66, info_text8, __68, __69 - display_debriefing_text_smc: .word __84, info_text8, main.text, info_text8, __74, __75, __76, info_text8, __78, info_text8, __80, __81, __82, __83 - display_debriefing_text_rom: .word __84, info_text8, info_text8, info_text8, __88, __89 + display_debriefing_smc_text: .word __100, str, main.text, str, __90, __91, __92, str, __94, str, __96, __97, __98, __99 + display_debriefing_text_rom: .word __100, str, str, str, __104, __105 smc_file_header: .fill $20, 0 smc_version_text: .fill $10, 0 // Globals @@ -20176,6 +22645,8 @@ display_frame_char: { .fill 4*7, 0 rom_file_github: .fill 8*8, 0 rom_file_release: .fill 8, 0 + TEXT_PROGRESS_FLASHING: .text "Flashing ... (-) equal, (+) flashed, (!) error." + .byte 0 __3: .text "None" .byte 0 __4: .text "Skip" @@ -20248,61 +22719,85 @@ display_frame_char: { .byte 0 __45: .text "Errors can indicate J1 jumpers are not closed!" .byte 0 - __46: .text "The SMC chip in your CX16 doesn't have a valid bootloader." + __46: .text "The following steps are IMPORTANT to update the VERA:" + .byte 0 + __48: .text "1. In the next step you will be asked to close the JP1 jumper" + .byte 0 + __49: .text " pins on the VERA board." + .byte 0 + __50: .text " The closure of the JP1 jumper pins is required" + .byte 0 + __51: .text " to allow the program to access VERA flash memory" + .byte 0 + __52: .text " instead of the SDCard!" + .byte 0 + __54: .text "2. Once the VERA has been updated, you will be asked to open" .byte 0 - __48: .text "A valid bootloader is needed to update the SMC chip." + __55: .text " the JP1 jumper pins!" .byte 0 - __49: .text "Unfortunately, your SMC chip cannot be updated using this tool!" + __57: .text "Reminder:" .byte 0 - __51: .text "A bootloader can be installed onto the SMC chip using an" + __58: .text " - DON'T CLOSE THE JP1 JUMPER PINS BEFORE BEING ASKED!" .byte 0 - __52: .text "an Arduino or an AVR ISP device." + __59: .text " - DON'T OPEN THE JP1 JUMPER PINS WHILE VERA IS BEING UPDATED!" .byte 0 - __53: .text "Alternatively a new SMC chip with a valid bootloader can be" + __61: .text "The program continues once the JP1 pins are opened/closed." .byte 0 - __54: .text "ordered from TexElec." + __62: .text "The SMC chip in your CX16 doesn't have a valid bootloader." .byte 0 - __55: .text "There is an issue with the CX16 SMC or ROM flash readiness." + __64: .text "A valid bootloader is needed to update the SMC chip." .byte 0 - __58: .text "to avoid possible conflicts of firmware, bricking your CX16." + __65: .text "Unfortunately, your SMC chip cannot be updated using this tool!" .byte 0 - __60: .text "Therefore, ensure you have the correct SMC.BIN and ROM.BIN" + __67: .text "A bootloader can be installed onto the SMC chip using an" .byte 0 - __61: .text "files placed on your SDcard. Also ensure that the" + __68: .text "an Arduino or an AVR ISP device." .byte 0 - __62: .text "J1 jumper pins on the CX16 board are closed." + __69: .text "Alternatively a new SMC chip with a valid bootloader can be" .byte 0 - __63: .text "There is an issue with the CX16 SMC or ROM flash versions." + __70: .text "ordered from TexElec." .byte 0 - __65: .text "Both the SMC and the main ROM must be updated together," + __71: .text "There is an issue with the CX16 SMC or ROM flash readiness." .byte 0 - __66: .text "to avoid possible conflicts, risking bricking your CX16." + __74: .text "to avoid possible conflicts of firmware, bricking your CX16." .byte 0 - __68: .text "The SMC.BIN and ROM.BIN found on your SDCard may not be" + __76: .text "Therefore, ensure you have the correct SMC.BIN and ROM.BIN" .byte 0 - __69: .text "mutually compatible. Update the CX16 at your own risk!" + __77: .text "files placed on your SDcard. Also ensure that the" .byte 0 - __74: .text "Because your SMC chipset has been updated," + __78: .text "J1 jumper pins on the CX16 board are closed." .byte 0 - __75: .text "the restart process differs, depending on the" + __79: .text "There is an issue with the CX16 SMC or ROM flash versions." .byte 0 - __76: .text "SMC boootloader version installed on your CX16 board:" + __81: .text "Both the SMC and the main ROM must be updated together," .byte 0 - __78: .text "- SMC bootloader v2.0: your CX16 will automatically shut down." + __82: .text "to avoid possible conflicts, risking bricking your CX16." .byte 0 - __80: .text "- SMC bootloader v1.0: you need to " + __84: .text "The SMC.BIN and ROM.BIN found on your SDCard may not be" .byte 0 - __81: .text " COMPLETELY DISCONNECT your CX16 from the power source!" + __85: .text "mutually compatible. Update the CX16 at your own risk!" .byte 0 - __82: .text " The power-off button won't work!" + __90: .text "Because your SMC chipset has been updated," .byte 0 - __83: .text " Then, reconnect and start the CX16 normally." + __91: .text "the restart process differs, depending on the" .byte 0 - __84: .text "Your CX16 system has been successfully updated!" + __92: .text "SMC boootloader version installed on your CX16 board:" .byte 0 - __88: .text "Since your CX16 system SMC chip has not been updated" + __94: .text "- SMC bootloader v2.0: your CX16 will automatically shut down." .byte 0 - __89: .text "your CX16 will just reset automatically after count down." + __96: .text "- SMC bootloader v1.0: you need to " + .byte 0 + __97: .text " COMPLETELY DISCONNECT your CX16 from the power source!" + .byte 0 + __98: .text " The power-off button won't work!" + .byte 0 + __99: .text " Then, reconnect and start the CX16 normally." + .byte 0 + __100: .text "Your CX16 system has been successfully updated!" + .byte 0 + __104: .text "Since your CX16 system SMC chip has not been updated" + .byte 0 + __105: .text "your CX16 will just reset automatically after count down." .byte 0 s: .text " " .byte 0 @@ -20316,11 +22811,15 @@ display_frame_char: { .byte 0 s1: .text "[" .byte 0 + info_text6: .text "No update required" + .byte 0 + s11: .text " differences!" + .byte 0 smc_action_text: .text "Reading" .byte 0 smc_action_text_1: .text "Checking" .byte 0 - info_text8: .text "" + str: .text "" .byte 0 isr_vsync: .word $314 __conio: .fill SIZEOF_STRUCT___1, 0 @@ -20335,12 +22834,14 @@ display_frame_char: { __stdio_file: .fill SIZEOF_STRUCT___2, 0 __stdio_filecount: .byte 0 __errno: .word 0 + spi_memory_capacity: .byte 0 + vera_file_size: .dword 0 // Globals (to save zeropage and code overhead with parameter passing.) smc_bootloader: .word 0 smc_release: .byte 0 smc_major: .byte 0 smc_minor: .byte 0 - smc_file_size: .word 0 + .label smc_file_size = smc_bootloader_1 smc_file_release: .byte 0 smc_file_major: .byte 0 smc_file_minor: .byte 0 diff --git a/target/src/cx16-update.klog b/target/src/cx16-update.klog index f4d054b..39b3472 100644 --- a/target/src/cx16-update.klog +++ b/target/src/cx16-update.klog @@ -15,20 +15,22 @@ Basic-segment: $0801-$080c Basic Code-segment: - $080d-$56d7 Code + $080d-$50ba Code Data-segment: - $56d8-$7388 Data + $50bb-$7142 Data CodeIntro-segment: - $7389-$73db CodeIntro + $7143-$7232 CodeIntro CodeVera-segment: + $7233-$7efe CodeVera DataIntro-segment: - $73dc-$741a DataIntro + $7eff-$7f3c DataIntro DataVera-segment: + $7f3d-$7f8c DataVera Writing Vice symbol file: cx16-update.vs Writing Symbol file: cx16-update.sym