diff --git a/bin/SMC-HEADER-R43.0.0.BIN b/bin/SMC-HEADER-R43.0.0.BIN index 533808a..1a17c39 100644 Binary files a/bin/SMC-HEADER-R43.0.0.BIN and b/bin/SMC-HEADER-R43.0.0.BIN differ diff --git a/bin/SMC-HEADER-R45.1.0.BIN b/bin/SMC-HEADER-R45.1.0.BIN index a08f4e3..c74dc79 100644 Binary files a/bin/SMC-HEADER-R45.1.0.BIN and b/bin/SMC-HEADER-R45.1.0.BIN differ diff --git a/bin/SMC-R43.0.0.BIN b/bin/SMC-R43.0.0.BIN index 03d8d5f..8d5a325 100644 Binary files a/bin/SMC-R43.0.0.BIN and b/bin/SMC-R43.0.0.BIN differ diff --git a/bin/SMC-R45.1.0.BIN b/bin/SMC-R45.1.0.BIN index 4bec1b2..8cfaeaa 100644 Binary files a/bin/SMC-R45.1.0.BIN and b/bin/SMC-R45.1.0.BIN differ diff --git a/bin/x16-smc-header-R43.0.0.hex b/bin/x16-smc-header-R43.0.0.hex index b858a56..4b7c36f 100644 --- a/bin/x16-smc-header-R43.0.0.hex +++ b/bin/x16-smc-header-R43.0.0.hex @@ -1,3 +1,3 @@ :100000002B000000000000000000000000000000C5 -:100010000000000000000000000000000000002BB5 +:10001000000000000000000000000000002D2C2B5C :00000001FF \ No newline at end of file diff --git a/bin/x16-smc-header-R45.1.0.hex b/bin/x16-smc-header-R45.1.0.hex index 6e6e579..676b0a4 100644 --- a/bin/x16-smc-header-R45.1.0.hex +++ b/bin/x16-smc-header-R45.1.0.hex @@ -1,3 +1,3 @@ :100000002D010000000000000000000000000000C2 -:1000100000000000000000000000000000002C2B89 +:10001000000000000000000000000000002D2C2B5C :00000001FF \ No newline at end of file diff --git a/src/cx16-defines.h b/src/cx16-defines.h index 5d481cb..da582c0 100644 --- a/src/cx16-defines.h +++ b/src/cx16-defines.h @@ -33,8 +33,8 @@ #define __INTRO #define __SMC_CHIP_PROCESS #define __ROM_CHIP_PROCESS -#define __ROM_CHIP_DETECT #define __SMC_CHIP_DETECT +#define __ROM_CHIP_DETECT #define __SMC_CHIP_CHECK #define __ROM_CHIP_CHECK #define __SMC_CHIP_FLASH diff --git a/src/cx16-display-text.h b/src/cx16-display-text.h index 765eb2f..adbd5f7 100644 --- a/src/cx16-display-text.h +++ b/src/cx16-display-text.h @@ -24,7 +24,7 @@ const char* display_into_briefing_text[14] = { " Ensure your J1 jumpers are properly enabled on the CX16!", "", "Please read carefully the step by step instructions at ", - "https://flightcontrol-user.github.io/x16-flash", + "https://flightcontrol-user.github.io/x16-flash" }; const char display_intro_colors_count = 16; @@ -44,18 +44,18 @@ const char* display_into_colors_text[16] = { " - Issue Problem identified during update.", " - Error Error found during update.", "", - "Errors indicate your J1 jumpers are not properly set!", + "Errors indicate your J1 jumpers are not properly set!" }; const char display_no_valid_smc_bootloader_count = 9; const char* display_no_valid_smc_bootloader_text[9] = { - "The SMC chip in your CX16 system does not contain a valid bootloader.", + "The SMC chip in your CX16 doesn't have a valid bootloader.", "", "A valid bootloader is needed to update the SMC chip.", "Unfortunately, your SMC chip cannot be updated using this tool!", "", - "You will either need to install or downgrade the bootloader onto", - "the SMC chip on your CX16 using an arduino device,", + "You will either need to install or downgrade the bootloader", + "onto the SMC chip on your CX16 using an arduino device,", "or alternatively to order a new SMC chip from TexElec or", "a CX16 community friend containing a valid bootloader!" }; diff --git a/src/cx16-update.c b/src/cx16-update.c index 10fbbb2..42f6205 100644 --- a/src/cx16-update.c +++ b/src/cx16-update.c @@ -74,6 +74,26 @@ void main() { display_info_rom(rom_chip, STATUS_NONE, NULL); } +#ifdef __INTRO + + bank_set_brom(4); + CLI(); + + display_progress_text(display_into_briefing_text, display_intro_briefing_count); + util_wait_space(); + + display_progress_text(display_into_colors_text, display_intro_colors_count); + for(unsigned char intro_status=0; intro_status<11; intro_status++) { + display_info_led(PROGRESS_X + 3, PROGRESS_Y + 3 + intro_status, status_color[intro_status], BLUE); + } + util_wait_space(); + display_progress_clear(); + + SEI(); + bank_set_brom(0); + +#endif + #ifdef __SMC_CHIP_PROCESS @@ -140,26 +160,6 @@ void main() { #endif -#ifdef __INTRO - - bank_set_brom(4); - CLI(); - - display_progress_text(display_into_briefing_text, display_intro_briefing_count); - util_wait_space(); - - display_progress_text(display_into_colors_text, display_intro_colors_count); - for(unsigned char intro_status=0; intro_status<11; intro_status++) { - display_info_led(PROGRESS_X + 3, PROGRESS_Y + 3 + intro_status, status_color[intro_status], BLUE); - } - util_wait_space(); - display_progress_clear(); - - SEI(); - bank_set_brom(0); - -#endif - #ifdef __SMC_CHIP_PROCESS #ifdef __SMC_CHIP_CHECK @@ -443,13 +443,13 @@ void main() { } } + display_progress_clear(); + #endif #endif } - display_progress_clear(); - 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)) { diff --git a/target/src/cx16-update.asm b/target/src/cx16-update.asm index ead9f43..e501cc4 100644 --- a/target/src/cx16-update.asm +++ b/target/src/cx16-update.asm @@ -172,7 +172,10 @@ .label VERA_L1_MAPBASE = $9f35 .label BRAM = 0 .label BROM = 1 - .label __errno = $f1 + /// Current position in the buffer being filled ( initially *s passed to snprintf() + /// Used to hold state while printing + .label __snprintf_buffer = $f4 + .label __errno = $cc .segment Code // __start __start: { @@ -186,10 +189,10 @@ __start: { lda #4 sta.z BROM // char * __snprintf_buffer - // [3] __snprintf_buffer = (char *) 0 -- pbum1=pbuc1 + // [3] __snprintf_buffer = (char *) 0 -- pbuz1=pbuc1 lda #<0 - sta __snprintf_buffer - sta __snprintf_buffer+1 + sta.z __snprintf_buffer + sta.z __snprintf_buffer+1 // volatile unsigned char __stdio_filecount = 0 // [4] __stdio_filecount = 0 -- vbum1=vbuc1 sta __stdio_filecount @@ -212,14 +215,13 @@ __start: { /// Print a character into snprintf buffer /// Used by snprintf() /// @param c The character to print -// void snputc(__zp($e5) char c) +// void snputc(__register(X) char c) snputc: { .const OFFSET_STACK_C = 0 - .label c = $e5 - // [10] snputc::c#0 = stackidx(char,snputc::OFFSET_STACK_C) -- vbuz1=_stackidxbyte_vbuc1 + // [10] snputc::c#0 = stackidx(char,snputc::OFFSET_STACK_C) -- vbuxx=_stackidxbyte_vbuc1 tsx lda STACK_BASE+OFFSET_STACK_C,x - sta.z c + tax // ++__snprintf_size; // [11] __snprintf_size = ++ __snprintf_size -- vwum1=_inc_vwum1 inc __snprintf_size @@ -251,9 +253,8 @@ snputc: { cmp __snprintf_capacity bne __b2 // [16] phi from snputc::@1 to snputc::@2 [phi:snputc::@1->snputc::@2] - // [16] phi snputc::c#2 = 0 [phi:snputc::@1->snputc::@2#0] -- vbuz1=vbuc1 - lda #0 - sta.z c + // [16] phi snputc::c#2 = 0 [phi:snputc::@1->snputc::@2#0] -- vbuxx=vbuc1 + ldx #0 // [15] phi from snputc::@1 to snputc::@3 [phi:snputc::@1->snputc::@3] // snputc::@3 // [16] phi from snputc::@3 to snputc::@2 [phi:snputc::@3->snputc::@2] @@ -261,27 +262,22 @@ snputc: { // snputc::@2 __b2: // *(__snprintf_buffer++) = c - // [17] *__snprintf_buffer = snputc::c#2 -- _deref_pbum1=vbuz2 + // [17] *__snprintf_buffer = snputc::c#2 -- _deref_pbuz1=vbuxx // Append char - lda.z c - ldy __snprintf_buffer - sty.z $fe - ldy __snprintf_buffer+1 - sty.z $ff + txa ldy #0 - sta ($fe),y + sta (__snprintf_buffer),y // *(__snprintf_buffer++) = c; - // [18] __snprintf_buffer = ++ __snprintf_buffer -- pbum1=_inc_pbum1 - inc __snprintf_buffer + // [18] __snprintf_buffer = ++ __snprintf_buffer -- pbuz1=_inc_pbuz1 + inc.z __snprintf_buffer bne !+ - inc __snprintf_buffer+1 + inc.z __snprintf_buffer+1 !: rts } // conio_x16_init /// Set initial screen values. conio_x16_init: { - .label conio_x16_init__5 = $db // screenlayer1() // [20] call screenlayer1 jsr screenlayer1 @@ -290,18 +286,16 @@ conio_x16_init: { // textcolor(CONIO_TEXTCOLOR_DEFAULT) // [22] call textcolor // [733] phi from conio_x16_init::@1 to textcolor [phi:conio_x16_init::@1->textcolor] - // [733] phi textcolor::color#18 = WHITE [phi:conio_x16_init::@1->textcolor#0] -- vbuz1=vbuc1 - lda #WHITE - sta.z textcolor.color + // [733] phi textcolor::color#18 = WHITE [phi:conio_x16_init::@1->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor // [23] 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) // [24] call bgcolor // [738] phi from conio_x16_init::@2 to bgcolor [phi:conio_x16_init::@2->bgcolor] - // [738] phi bgcolor::color#14 = BLUE [phi:conio_x16_init::@2->bgcolor#0] -- vbuz1=vbuc1 - lda #BLUE - sta.z bgcolor.color + // [738] phi bgcolor::color#14 = BLUE [phi:conio_x16_init::@2->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // [25] phi from conio_x16_init::@2 to conio_x16_init::@3 [phi:conio_x16_init::@2->conio_x16_init::@3] // conio_x16_init::@3 @@ -317,11 +311,10 @@ conio_x16_init: { // conio_x16_init::@5 // [30] conio_x16_init::$4 = cbm_k_plot_get::return#2 // BYTE1(cbm_k_plot_get()) - // [31] conio_x16_init::$5 = byte1 conio_x16_init::$4 -- vbuz1=_byte1_vwum2 + // [31] conio_x16_init::$5 = byte1 conio_x16_init::$4 -- vbuaa=_byte1_vwum1 lda conio_x16_init__4+1 - sta.z conio_x16_init__5 // __conio.cursor_x = BYTE1(cbm_k_plot_get()) - // [32] *((char *)&__conio) = conio_x16_init::$5 -- _deref_pbuc1=vbuz1 + // [32] *((char *)&__conio) = conio_x16_init::$5 -- _deref_pbuc1=vbuaa sta __conio // cbm_k_plot_get() // [33] call cbm_k_plot_get @@ -330,19 +323,16 @@ conio_x16_init: { // conio_x16_init::@6 // [35] conio_x16_init::$6 = cbm_k_plot_get::return#3 // BYTE0(cbm_k_plot_get()) - // [36] conio_x16_init::$7 = byte0 conio_x16_init::$6 -- vbum1=_byte0_vwum2 + // [36] 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()) - // [37] *((char *)&__conio+1) = conio_x16_init::$7 -- _deref_pbuc1=vbum1 + // [37] *((char *)&__conio+1) = conio_x16_init::$7 -- _deref_pbuc1=vbuaa sta __conio+1 // gotoxy(__conio.cursor_x, __conio.cursor_y) - // [38] gotoxy::x#2 = *((char *)&__conio) -- vbuz1=_deref_pbuc1 - lda __conio - sta.z gotoxy.x - // [39] gotoxy::y#2 = *((char *)&__conio+1) -- vbuz1=_deref_pbuc1 - lda __conio+1 - sta.z gotoxy.y + // [38] gotoxy::x#2 = *((char *)&__conio) -- vbuxx=_deref_pbuc1 + ldx __conio + // [39] gotoxy::y#2 = *((char *)&__conio+1) -- vbuyy=_deref_pbuc1 + tay // [40] call gotoxy // [751] phi from conio_x16_init::@6 to gotoxy [phi:conio_x16_init::@6->gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#2 [phi:conio_x16_init::@6->gotoxy#0] -- register_copy @@ -363,27 +353,21 @@ conio_x16_init: { .segment Data .label conio_x16_init__4 = cbm_k_plot_get.return .label conio_x16_init__6 = cbm_k_plot_get.return - conio_x16_init__7: .byte 0 } .segment Code // cputc // Output one character at the current cursor position // Moves the cursor forward. Scrolls the entire screen if needed -// void cputc(__zp($35) char c) +// void cputc(__register(X) char c) cputc: { .const OFFSET_STACK_C = 0 - .label cputc__1 = $22 - .label cputc__2 = $7b - .label cputc__3 = $7c - .label c = $35 - // [44] cputc::c#0 = stackidx(char,cputc::OFFSET_STACK_C) -- vbuz1=_stackidxbyte_vbuc1 + // [44] cputc::c#0 = stackidx(char,cputc::OFFSET_STACK_C) -- vbuxx=_stackidxbyte_vbuc1 tsx lda STACK_BASE+OFFSET_STACK_C,x - sta.z c + tax // if(c=='\n') - // [45] if(cputc::c#0==' ') goto cputc::@1 -- vbuz1_eq_vbuc1_then_la1 - lda #'\n' - cmp.z c + // [45] if(cputc::c#0==' ') goto cputc::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #'\n' beq __b1 // cputc::@2 // *VERA_CTRL &= ~VERA_ADDRSEL @@ -392,31 +376,27 @@ cputc: { and VERA_CTRL sta VERA_CTRL // BYTE0(__conio.offset) - // [47] cputc::$1 = byte0 *((unsigned int *)&__conio+$13) -- vbuz1=_byte0__deref_pwuc1 + // [47] cputc::$1 = byte0 *((unsigned int *)&__conio+$13) -- vbuaa=_byte0__deref_pwuc1 lda __conio+$13 - sta.z cputc__1 // *VERA_ADDRX_L = BYTE0(__conio.offset) - // [48] *VERA_ADDRX_L = cputc::$1 -- _deref_pbuc1=vbuz1 + // [48] *VERA_ADDRX_L = cputc::$1 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_L // BYTE1(__conio.offset) - // [49] cputc::$2 = byte1 *((unsigned int *)&__conio+$13) -- vbuz1=_byte1__deref_pwuc1 + // [49] 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) - // [50] *VERA_ADDRX_M = cputc::$2 -- _deref_pbuc1=vbuz1 + // [50] *VERA_ADDRX_M = cputc::$2 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_M // __conio.mapbase_bank | VERA_INC_1 - // [51] cputc::$3 = *((char *)&__conio+5) | VERA_INC_1 -- vbuz1=_deref_pbuc1_bor_vbuc2 + // [51] 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 - // [52] *VERA_ADDRX_H = cputc::$3 -- _deref_pbuc1=vbuz1 + // [52] *VERA_ADDRX_H = cputc::$3 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_H // *VERA_DATA0 = c - // [53] *VERA_DATA0 = cputc::c#0 -- _deref_pbuc1=vbuz1 - lda.z c - sta VERA_DATA0 + // [53] *VERA_DATA0 = cputc::c#0 -- _deref_pbuc1=vbuxx + stx VERA_DATA0 // *VERA_DATA0 = __conio.color // [54] *VERA_DATA0 = *((char *)&__conio+$d) -- _deref_pbuc1=_deref_pbuc2 lda __conio+$d @@ -504,63 +484,27 @@ main: { .const bank_set_bram1_bank = 0 .const bank_set_brom1_bank = 0 .const bank_set_brom2_bank = 4 - .const bank_set_brom4_bank = 0 + .const bank_set_brom3_bank = 0 .const bank_set_brom5_bank = 0 .const bank_set_brom6_bank = 4 .const bank_push_set_bram1_bank = 1 .const bank_set_bram2_bank = 0 .const bank_set_brom7_bank = 0 - .label main__91 = $d4 - .label main__115 = $df - .label main__119 = $ca - .label main__192 = $e2 - .label main__197 = $ec - .label check_status_smc1_main__0 = $30 - .label check_status_cx16_rom1_check_status_rom1_main__0 = $e1 - .label check_status_cx16_rom4_check_status_rom1_main__0 = $bc - .label check_status_smc6_main__0 = $c6 - .label check_status_smc7_main__0 = $e0 - .label check_status_smc8_main__0 = $7d - .label check_status_smc10_main__0 = $f0 - .label check_status_vera3_main__0 = $68 - .label check_status_vera4_main__0 = $52 - .label check_status_smc11_main__0 = $e9 - .label check_status_cx16_rom5_check_status_rom1_main__0 = $b7 - .label check_status_smc12_main__0 = $63 - .label check_status_cx16_rom6_check_status_rom1_main__0 = $6a - .label check_status_smc13_main__0 = $5a - .label check_status_smc14_main__0 = $cc - .label check_status_smc15_main__0 = $b3 - .label check_status_vera5_main__0 = $62 - .label check_status_smc16_main__0 = $69 - .label check_status_vera6_main__0 = $cb - .label check_status_smc17_main__0 = $da - .label bank_set_brom3_bank = $ea - .label check_status_smc1_return = $30 - .label check_status_cx16_rom1_check_status_rom1_return = $e1 - .label rom_file_release = $df - .label check_status_cx16_rom4_check_status_rom1_return = $bc - .label check_status_smc6_return = $c6 - .label check_status_smc7_return = $e0 - .label check_status_smc8_return = $7d - .label check_status_smc10_return = $f0 - .label check_status_vera3_return = $68 - .label check_status_vera4_return = $52 - .label check_status_smc11_return = $e9 - .label check_status_cx16_rom5_check_status_rom1_return = $b7 - .label check_status_smc12_return = $63 - .label check_status_cx16_rom6_check_status_rom1_return = $6a - .label check_status_smc13_return = $5a - .label check_status_smc14_return = $cc - .label rom_differences = $31 - .label check_status_smc15_return = $b3 - .label check_status_vera5_return = $62 - .label check_status_smc16_return = $69 - .label check_status_vera6_return = $cb - .label check_status_smc17_return = $da - .label main__338 = $d4 - .label main__339 = $d4 - .label main__340 = $d4 + .label main__67 = $f9 + .label main__196 = $c4 + .label rom_bytes_read = $7a + .label check_status_cx16_rom4_check_status_rom1_return = $ea + .label check_status_smc7_return = $f0 + .label check_status_vera1_return = $f8 + .label check_status_smc8_return = $ce + .label check_status_smc10_return = $dd + .label check_status_vera3_return = $df + .label check_status_smc11_return = $fa + .label rom_bytes_read1 = $7a + .label rom_differences = $27 + .label rom_flash_errors = $34 + .label check_status_smc15_return = $af + .label check_status_vera5_return = $ae // main::SEI1 // asm // asm { sei } @@ -575,8 +519,8 @@ main: { // [74] BROM = main::bank_set_brom1_bank#0 -- vbuz1=vbuc1 lda #bank_set_brom1_bank sta.z BROM - // [75] phi from main::bank_set_brom1 to main::@66 [phi:main::bank_set_brom1->main::@66] - // main::@66 + // [75] phi from main::bank_set_brom1 to main::@65 [phi:main::bank_set_brom1->main::@65] + // main::@65 // display_frame_init_64() // [76] call display_frame_init_64 // Get the current screen mode ... @@ -596,9 +540,9 @@ main: { } } */ - // [772] phi from main::@66 to display_frame_init_64 [phi:main::@66->display_frame_init_64] + // [772] phi from main::@65 to display_frame_init_64 [phi:main::@65->display_frame_init_64] jsr display_frame_init_64 - // [77] phi from main::@66 to main::@95 [phi:main::@66->main::@95] + // [77] phi from main::@65 to main::@95 [phi:main::@65->main::@95] // main::@95 // display_frame_draw() // [78] call display_frame_draw @@ -620,12 +564,10 @@ main: { sta.z cputsxy.s lda #>s sta.z cputsxy.s+1 - // [838] phi cputsxy::y#4 = $11-2 [phi:main::display_info_title1->cputsxy#1] -- vbuz1=vbuc1 - lda #$11-2 - sta.z cputsxy.y - // [838] phi cputsxy::x#4 = 4-2 [phi:main::display_info_title1->cputsxy#2] -- vbuz1=vbuc1 - lda #4-2 - sta.z cputsxy.x + // [838] phi cputsxy::y#4 = $11-2 [phi:main::display_info_title1->cputsxy#1] -- vbuyy=vbuc1 + ldy #$11-2 + // [838] phi cputsxy::x#4 = 4-2 [phi:main::display_info_title1->cputsxy#2] -- vbuxx=vbuc1 + ldx #4-2 jsr cputsxy // [83] phi from main::display_info_title1 to main::@97 [phi:main::display_info_title1->main::@97] // main::@97 @@ -637,25 +579,23 @@ main: { sta.z cputsxy.s lda #>s1 sta.z cputsxy.s+1 - // [838] phi cputsxy::y#4 = $11-1 [phi:main::@97->cputsxy#1] -- vbuz1=vbuc1 - lda #$11-1 - sta.z cputsxy.y - // [838] phi cputsxy::x#4 = 4-2 [phi:main::@97->cputsxy#2] -- vbuz1=vbuc1 - lda #4-2 - sta.z cputsxy.x + // [838] phi cputsxy::y#4 = $11-1 [phi:main::@97->cputsxy#1] -- vbuyy=vbuc1 + ldy #$11-1 + // [838] phi cputsxy::x#4 = 4-2 [phi:main::@97->cputsxy#2] -- vbuxx=vbuc1 + ldx #4-2 jsr cputsxy - // [85] phi from main::@97 to main::@67 [phi:main::@97->main::@67] - // main::@67 + // [85] phi from main::@97 to main::@66 [phi:main::@97->main::@66] + // main::@66 // display_action_progress("Introduction ...") // [86] call display_action_progress - // [845] phi from main::@67 to display_action_progress [phi:main::@67->display_action_progress] - // [845] phi display_action_progress::info_text#19 = main::info_text [phi:main::@67->display_action_progress#0] -- pbuz1=pbuc1 + // [845] phi from main::@66 to display_action_progress [phi:main::@66->display_action_progress] + // [845] phi display_action_progress::info_text#19 = main::info_text [phi:main::@66->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text sta.z display_action_progress.info_text+1 jsr display_action_progress - // [87] phi from main::@67 to main::@98 [phi:main::@67->main::@98] + // [87] phi from main::@66 to main::@98 [phi:main::@66->main::@98] // main::@98 // display_progress_clear() // [88] call display_progress_clear @@ -691,9 +631,9 @@ main: { // [903] phi smc_bootloader#13 = 0 [phi:main::@102->display_info_smc#1] -- vwum1=vwuc1 sta smc_bootloader_1 sta smc_bootloader_1+1 - // [903] phi display_info_smc::info_status#18 = BLACK [phi:main::@102->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi display_info_smc::info_status#18 = BLACK [phi:main::@102->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 // [97] phi from main::@102 to main::@103 [phi:main::@102->main::@103] // main::@103 @@ -708,55 +648,132 @@ main: { lda #STATUS_NONE sta.z display_info_vera.info_status jsr display_info_vera - // [99] phi from main::@103 to main::@12 [phi:main::@103->main::@12] - // [99] phi main::rom_chip#2 = 0 [phi:main::@103->main::@12#0] -- vbum1=vbuc1 + // [99] phi from main::@103 to main::@11 [phi:main::@103->main::@11] + // [99] phi main::rom_chip#2 = 0 [phi:main::@103->main::@11#0] -- vbum1=vbuc1 lda #0 sta rom_chip - // main::@12 - __b12: + // main::@11 + __b11: // for(unsigned char rom_chip=0; rom_chip<8; rom_chip++) - // [100] if(main::rom_chip#2<8) goto main::@13 -- vbum1_lt_vbuc1_then_la1 + // [100] if(main::rom_chip#2<8) goto main::@12 -- vbum1_lt_vbuc1_then_la1 lda rom_chip cmp #8 - bcs !__b13+ - jmp __b13 - !__b13: - // [101] phi from main::@12 to main::@14 [phi:main::@12->main::@14] - // main::@14 + bcs !__b12+ + jmp __b12 + !__b12: + // main::bank_set_brom2 + // BROM = bank + // [101] BROM = main::bank_set_brom2_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom2_bank + sta.z BROM + // main::CLI1 + // asm + // asm { cli } + cli + // [103] phi from main::CLI1 to main::@67 [phi:main::CLI1->main::@67] + // main::@67 + // display_progress_text(display_into_briefing_text, display_intro_briefing_count) + // [104] call display_progress_text + // [963] phi from main::@67 to display_progress_text [phi:main::@67->display_progress_text] + // [963] phi display_progress_text::text#12 = display_into_briefing_text [phi:main::@67->display_progress_text#0] -- qbuz1=qbuc1 + lda #display_into_briefing_text + sta.z display_progress_text.text+1 + // [963] phi display_progress_text::lines#11 = display_intro_briefing_count [phi:main::@67->display_progress_text#1] -- vbuz1=vbuc1 + lda #display_intro_briefing_count + sta.z display_progress_text.lines + jsr display_progress_text + // [105] phi from main::@67 to main::@106 [phi:main::@67->main::@106] + // main::@106 + // util_wait_space() + // [106] call util_wait_space + // [973] phi from main::@106 to util_wait_space [phi:main::@106->util_wait_space] + jsr util_wait_space + // [107] phi from main::@106 to main::@107 [phi:main::@106->main::@107] + // main::@107 + // display_progress_text(display_into_colors_text, display_intro_colors_count) + // [108] call display_progress_text + // [963] phi from main::@107 to display_progress_text [phi:main::@107->display_progress_text] + // [963] phi display_progress_text::text#12 = display_into_colors_text [phi:main::@107->display_progress_text#0] -- qbuz1=qbuc1 + lda #display_into_colors_text + sta.z display_progress_text.text+1 + // [963] phi display_progress_text::lines#11 = display_intro_colors_count [phi:main::@107->display_progress_text#1] -- vbuz1=vbuc1 + lda #display_intro_colors_count + sta.z display_progress_text.lines + jsr display_progress_text + // [109] phi from main::@107 to main::@13 [phi:main::@107->main::@13] + // [109] phi main::intro_status#2 = 0 [phi:main::@107->main::@13#0] -- vbum1=vbuc1 + lda #0 + sta intro_status + // main::@13 + __b13: + // for(unsigned char intro_status=0; intro_status<11; intro_status++) + // [110] if(main::intro_status#2<$b) goto main::@14 -- vbum1_lt_vbuc1_then_la1 + lda intro_status + cmp #$b + bcs !__b14+ + jmp __b14 + !__b14: + // [111] phi from main::@13 to main::@15 [phi:main::@13->main::@15] + // main::@15 + // util_wait_space() + // [112] call util_wait_space + // [973] phi from main::@15 to util_wait_space [phi:main::@15->util_wait_space] + jsr util_wait_space + // [113] phi from main::@15 to main::@109 [phi:main::@15->main::@109] + // main::@109 + // display_progress_clear() + // [114] call display_progress_clear + // [859] phi from main::@109 to display_progress_clear [phi:main::@109->display_progress_clear] + jsr display_progress_clear + // main::SEI2 + // asm + // asm { sei } + sei + // main::bank_set_brom3 + // BROM = bank + // [116] BROM = main::bank_set_brom3_bank#0 -- vbuz1=vbuc1 + lda #bank_set_brom3_bank + sta.z BROM + // [117] phi from main::bank_set_brom3 to main::@68 [phi:main::bank_set_brom3->main::@68] + // main::@68 // smc_detect() - // [102] call smc_detect + // [118] call smc_detect jsr smc_detect - // [103] smc_detect::return#2 = smc_detect::return#0 - // main::@106 + // [119] smc_detect::return#2 = smc_detect::return#0 + // main::@110 // smc_bootloader = smc_detect() - // [104] smc_bootloader#0 = smc_detect::return#2 -- vwum1=vwuz2 + // [120] smc_bootloader#0 = smc_detect::return#2 -- vwum1=vwuz2 lda.z smc_detect.return sta smc_bootloader lda.z smc_detect.return+1 sta smc_bootloader+1 // strcpy(smc_version_text, "0.0.0") - // [105] call strcpy - // [974] phi from main::@106 to strcpy [phi:main::@106->strcpy] - // [974] phi strcpy::dst#0 = smc_version_text [phi:main::@106->strcpy#0] -- pbuz1=pbuc1 + // [121] call strcpy + // [987] phi from main::@110 to strcpy [phi:main::@110->strcpy] + // [987] phi strcpy::dst#0 = smc_version_text [phi:main::@110->strcpy#0] -- pbuz1=pbuc1 lda #smc_version_text sta.z strcpy.dst+1 - // [974] phi strcpy::src#0 = main::source1 [phi:main::@106->strcpy#1] -- pbuz1=pbuc1 + // [987] phi strcpy::src#0 = main::source1 [phi:main::@110->strcpy#1] -- pbuz1=pbuc1 lda #source1 sta.z strcpy.src+1 jsr strcpy - // [106] phi from main::@106 to main::@107 [phi:main::@106->main::@107] - // main::@107 + // [122] phi from main::@110 to main::@111 [phi:main::@110->main::@111] + // main::@111 // display_chip_smc() - // [107] call display_chip_smc - // [874] phi from main::@107 to display_chip_smc [phi:main::@107->display_chip_smc] + // [123] call display_chip_smc + // [874] phi from main::@111 to display_chip_smc [phi:main::@111->display_chip_smc] jsr display_chip_smc - // main::@108 + // main::@112 // if(smc_bootloader == 0x0100) - // [108] if(smc_bootloader#0==$100) goto main::@1 -- vwum1_eq_vwuc1_then_la1 + // [124] if(smc_bootloader#0==$100) goto main::@1 -- vwum1_eq_vwuc1_then_la1 lda smc_bootloader cmp #<$100 bne !+ @@ -766,279 +783,200 @@ main: { jmp __b1 !__b1: !: - // main::@15 + // main::@16 // if(smc_bootloader == 0x0200) - // [109] if(smc_bootloader#0==$200) goto main::@18 -- vwum1_eq_vwuc1_then_la1 + // [125] 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 !__b18+ - jmp __b18 - !__b18: + bne !__b19+ + jmp __b19 + !__b19: !: - // main::@16 + // main::@17 // if(smc_bootloader > 0x2) - // [110] if(smc_bootloader#0>=2+1) goto main::@19 -- vwum1_ge_vbuc1_then_la1 + // [126] if(smc_bootloader#0>=2+1) goto main::@20 -- vwum1_ge_vbuc1_then_la1 lda smc_bootloader+1 - beq !__b19+ - jmp __b19 - !__b19: + beq !__b20+ + jmp __b20 + !__b20: lda smc_bootloader cmp #2+1 - bcc !__b19+ - jmp __b19 - !__b19: + bcc !__b20+ + jmp __b20 + !__b20: !: - // main::@17 + // main::@18 // cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_VERSION) - // [111] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 + // [127] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 lda #$42 sta cx16_k_i2c_read_byte.device - // [112] cx16_k_i2c_read_byte::offset = $30 -- vbum1=vbuc1 + // [128] cx16_k_i2c_read_byte::offset = $30 -- vbum1=vbuc1 lda #$30 sta cx16_k_i2c_read_byte.offset - // [113] call cx16_k_i2c_read_byte + // [129] call cx16_k_i2c_read_byte jsr cx16_k_i2c_read_byte - // [114] cx16_k_i2c_read_byte::return#14 = cx16_k_i2c_read_byte::return#1 - // main::@115 + // [130] cx16_k_i2c_read_byte::return#14 = cx16_k_i2c_read_byte::return#1 + // main::@119 // smc_release = cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_VERSION) - // [115] smc_release#0 = cx16_k_i2c_read_byte::return#14 -- vbum1=vwuz2 + // [131] smc_release#0 = cx16_k_i2c_read_byte::return#14 -- vbum1=vwuz2 lda.z cx16_k_i2c_read_byte.return sta smc_release // cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_MAJOR) - // [116] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 + // [132] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 lda #$42 sta cx16_k_i2c_read_byte.device - // [117] cx16_k_i2c_read_byte::offset = $31 -- vbum1=vbuc1 + // [133] cx16_k_i2c_read_byte::offset = $31 -- vbum1=vbuc1 lda #$31 sta cx16_k_i2c_read_byte.offset - // [118] call cx16_k_i2c_read_byte + // [134] call cx16_k_i2c_read_byte jsr cx16_k_i2c_read_byte - // [119] cx16_k_i2c_read_byte::return#15 = cx16_k_i2c_read_byte::return#1 - // main::@116 + // [135] cx16_k_i2c_read_byte::return#15 = cx16_k_i2c_read_byte::return#1 + // main::@120 // smc_major = cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_MAJOR) - // [120] smc_major#0 = cx16_k_i2c_read_byte::return#15 -- vbum1=vwuz2 + // [136] smc_major#0 = cx16_k_i2c_read_byte::return#15 -- vbum1=vwuz2 lda.z cx16_k_i2c_read_byte.return sta smc_major // cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_MINOR) - // [121] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 + // [137] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 lda #$42 sta cx16_k_i2c_read_byte.device - // [122] cx16_k_i2c_read_byte::offset = $32 -- vbum1=vbuc1 + // [138] cx16_k_i2c_read_byte::offset = $32 -- vbum1=vbuc1 lda #$32 sta cx16_k_i2c_read_byte.offset - // [123] call cx16_k_i2c_read_byte + // [139] call cx16_k_i2c_read_byte jsr cx16_k_i2c_read_byte - // [124] cx16_k_i2c_read_byte::return#16 = cx16_k_i2c_read_byte::return#1 - // main::@117 + // [140] cx16_k_i2c_read_byte::return#16 = cx16_k_i2c_read_byte::return#1 + // main::@121 // smc_minor = cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_MINOR) - // [125] smc_minor#0 = cx16_k_i2c_read_byte::return#16 -- vbum1=vwuz2 + // [141] smc_minor#0 = cx16_k_i2c_read_byte::return#16 -- vbum1=vwuz2 lda.z cx16_k_i2c_read_byte.return sta smc_minor // smc_get_version_text(smc_version_text, smc_release, smc_major, smc_minor) - // [126] smc_get_version_text::release#0 = smc_release#0 -- vbuz1=vbum2 - lda smc_release - sta.z smc_get_version_text.release - // [127] smc_get_version_text::major#0 = smc_major#0 -- vbuz1=vbum2 + // [142] smc_get_version_text::release#0 = smc_release#0 -- vbuyy=vbum1 + ldy smc_release + // [143] smc_get_version_text::major#0 = smc_major#0 -- vbum1=vbum2 lda smc_major - sta.z smc_get_version_text.major - // [128] smc_get_version_text::minor#0 = smc_minor#0 -- vbuz1=vbum2 + sta smc_get_version_text.major + // [144] smc_get_version_text::minor#0 = smc_minor#0 -- vbuz1=vbum2 lda smc_minor sta.z smc_get_version_text.minor - // [129] call smc_get_version_text - // [987] phi from main::@117 to smc_get_version_text [phi:main::@117->smc_get_version_text] - // [987] phi smc_get_version_text::minor#2 = smc_get_version_text::minor#0 [phi:main::@117->smc_get_version_text#0] -- register_copy - // [987] phi smc_get_version_text::major#2 = smc_get_version_text::major#0 [phi:main::@117->smc_get_version_text#1] -- register_copy - // [987] phi smc_get_version_text::release#2 = smc_get_version_text::release#0 [phi:main::@117->smc_get_version_text#2] -- register_copy - // [987] phi smc_get_version_text::version_string#2 = smc_version_text [phi:main::@117->smc_get_version_text#3] -- pbuz1=pbuc1 + // [145] call smc_get_version_text + // [1000] phi from main::@121 to smc_get_version_text [phi:main::@121->smc_get_version_text] + // [1000] phi smc_get_version_text::minor#2 = smc_get_version_text::minor#0 [phi:main::@121->smc_get_version_text#0] -- register_copy + // [1000] phi smc_get_version_text::major#2 = smc_get_version_text::major#0 [phi:main::@121->smc_get_version_text#1] -- register_copy + // [1000] phi smc_get_version_text::release#2 = smc_get_version_text::release#0 [phi:main::@121->smc_get_version_text#2] -- register_copy + // [1000] phi smc_get_version_text::version_string#2 = smc_version_text [phi:main::@121->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::@118 - // [130] smc_bootloader#430 = smc_bootloader#0 -- vwum1=vwum2 + // main::@122 + // [146] smc_bootloader#415 = 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) - // [131] call display_info_smc - // [903] phi from main::@118 to display_info_smc [phi:main::@118->display_info_smc] - // [903] phi display_info_smc::info_text#18 = 0 [phi:main::@118->display_info_smc#0] -- pbuz1=vbuc1 + // [147] call display_info_smc + // [903] phi from main::@122 to display_info_smc [phi:main::@122->display_info_smc] + // [903] phi display_info_smc::info_text#18 = 0 [phi:main::@122->display_info_smc#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_smc.info_text sta.z display_info_smc.info_text+1 - // [903] phi smc_bootloader#13 = smc_bootloader#430 [phi:main::@118->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_DETECTED [phi:main::@118->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#415 [phi:main::@122->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = STATUS_DETECTED [phi:main::@122->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 - // [132] phi from main::@118 to main::@2 [phi:main::@118->main::@2] - // [132] phi smc_minor#361 = smc_minor#0 [phi:main::@118->main::@2#0] -- register_copy - // [132] phi smc_major#362 = smc_major#0 [phi:main::@118->main::@2#1] -- register_copy - // [132] phi smc_release#363 = smc_release#0 [phi:main::@118->main::@2#2] -- register_copy + // [148] phi from main::@122 to main::@2 [phi:main::@122->main::@2] + // [148] phi smc_minor#338 = smc_minor#0 [phi:main::@122->main::@2#0] -- register_copy + // [148] phi smc_major#339 = smc_major#0 [phi:main::@122->main::@2#1] -- register_copy + // [148] phi smc_release#340 = smc_release#0 [phi:main::@122->main::@2#2] -- register_copy // main::@2 __b2: // display_chip_vera() - // [133] call display_chip_vera + // [149] call display_chip_vera // Detecting VERA FPGA. // [879] phi from main::@2 to display_chip_vera [phi:main::@2->display_chip_vera] jsr display_chip_vera - // [134] phi from main::@2 to main::@119 [phi:main::@2->main::@119] - // main::@119 + // [150] phi from main::@2 to main::@123 [phi:main::@2->main::@123] + // main::@123 // display_info_vera(STATUS_DETECTED, "VERA installed, OK") - // [135] call display_info_vera - // [937] phi from main::@119 to display_info_vera [phi:main::@119->display_info_vera] - // [937] phi display_info_vera::info_text#10 = main::info_text3 [phi:main::@119->display_info_vera#0] -- pbuz1=pbuc1 + // [151] call display_info_vera + // [937] phi from main::@123 to display_info_vera [phi:main::@123->display_info_vera] + // [937] phi display_info_vera::info_text#10 = main::info_text3 [phi:main::@123->display_info_vera#0] -- pbuz1=pbuc1 lda #info_text3 sta.z display_info_vera.info_text+1 - // [937] phi display_info_vera::info_status#4 = STATUS_DETECTED [phi:main::@119->display_info_vera#1] -- vbuz1=vbuc1 + // [937] phi display_info_vera::info_status#4 = STATUS_DETECTED [phi:main::@123->display_info_vera#1] -- vbuz1=vbuc1 lda #STATUS_DETECTED sta.z display_info_vera.info_status jsr display_info_vera - // [136] phi from main::@119 to main::@120 [phi:main::@119->main::@120] - // main::@120 + // [152] phi from main::@123 to main::@124 [phi:main::@123->main::@124] + // main::@124 // rom_detect() - // [137] call rom_detect + // [153] call rom_detect // Detecting ROM chips - // [1004] phi from main::@120 to rom_detect [phi:main::@120->rom_detect] + // [1017] phi from main::@124 to rom_detect [phi:main::@124->rom_detect] jsr rom_detect - // [138] phi from main::@120 to main::@121 [phi:main::@120->main::@121] - // main::@121 + // [154] phi from main::@124 to main::@125 [phi:main::@124->main::@125] + // main::@125 // display_chip_rom() - // [139] call display_chip_rom - // [884] phi from main::@121 to display_chip_rom [phi:main::@121->display_chip_rom] + // [155] call display_chip_rom + // [884] phi from main::@125 to display_chip_rom [phi:main::@125->display_chip_rom] jsr display_chip_rom - // [140] phi from main::@121 to main::@20 [phi:main::@121->main::@20] - // [140] phi main::rom_chip1#10 = 0 [phi:main::@121->main::@20#0] -- vbum1=vbuc1 + // [156] phi from main::@125 to main::@21 [phi:main::@125->main::@21] + // [156] phi main::rom_chip1#10 = 0 [phi:main::@125->main::@21#0] -- vbum1=vbuc1 lda #0 sta rom_chip1 - // main::@20 - __b20: + // main::@21 + __b21: // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [141] if(main::rom_chip1#10<8) goto main::@21 -- vbum1_lt_vbuc1_then_la1 + // [157] if(main::rom_chip1#10<8) goto main::@22 -- vbum1_lt_vbuc1_then_la1 lda rom_chip1 cmp #8 - bcs !__b21+ - jmp __b21 - !__b21: - // main::bank_set_brom2 - // BROM = bank - // [142] BROM = main::bank_set_brom2_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom2_bank - sta.z BROM - // main::CLI1 - // asm - // asm { cli } - cli - // [144] phi from main::CLI1 to main::@68 [phi:main::CLI1->main::@68] - // main::@68 - // display_progress_text(display_into_briefing_text, display_intro_briefing_count) - // [145] call display_progress_text - // [1054] phi from main::@68 to display_progress_text [phi:main::@68->display_progress_text] - // [1054] phi display_progress_text::text#12 = display_into_briefing_text [phi:main::@68->display_progress_text#0] -- qbuz1=qbuc1 - lda #display_into_briefing_text - sta.z display_progress_text.text+1 - // [1054] phi display_progress_text::lines#11 = display_intro_briefing_count [phi:main::@68->display_progress_text#1] -- vbuz1=vbuc1 - lda #display_intro_briefing_count - sta.z display_progress_text.lines - jsr display_progress_text - // [146] phi from main::@68 to main::@122 [phi:main::@68->main::@122] - // main::@122 - // util_wait_space() - // [147] call util_wait_space - // [1064] phi from main::@122 to util_wait_space [phi:main::@122->util_wait_space] - jsr util_wait_space - // [148] phi from main::@122 to main::@123 [phi:main::@122->main::@123] - // main::@123 - // display_progress_text(display_into_colors_text, display_intro_colors_count) - // [149] call display_progress_text - // [1054] phi from main::@123 to display_progress_text [phi:main::@123->display_progress_text] - // [1054] phi display_progress_text::text#12 = display_into_colors_text [phi:main::@123->display_progress_text#0] -- qbuz1=qbuc1 - lda #display_into_colors_text - sta.z display_progress_text.text+1 - // [1054] phi display_progress_text::lines#11 = display_intro_colors_count [phi:main::@123->display_progress_text#1] -- vbuz1=vbuc1 - lda #display_intro_colors_count - sta.z display_progress_text.lines - jsr display_progress_text - // [150] phi from main::@123 to main::@24 [phi:main::@123->main::@24] - // [150] phi main::intro_status#2 = 0 [phi:main::@123->main::@24#0] -- vbum1=vbuc1 - lda #0 - sta intro_status - // main::@24 - __b24: - // for(unsigned char intro_status=0; intro_status<11; intro_status++) - // [151] if(main::intro_status#2<$b) goto main::@25 -- vbum1_lt_vbuc1_then_la1 - lda intro_status - cmp #$b - bcs !__b25+ - jmp __b25 - !__b25: - // [152] phi from main::@24 to main::@26 [phi:main::@24->main::@26] - // main::@26 - // util_wait_space() - // [153] call util_wait_space - // [1064] phi from main::@26 to util_wait_space [phi:main::@26->util_wait_space] - jsr util_wait_space - // [154] phi from main::@26 to main::@129 [phi:main::@26->main::@129] - // main::@129 - // display_progress_clear() - // [155] call display_progress_clear - // [859] phi from main::@129 to display_progress_clear [phi:main::@129->display_progress_clear] - jsr display_progress_clear - // main::SEI2 - // asm - // asm { sei } - sei - // main::bank_set_brom4 - // BROM = bank - // [157] BROM = main::bank_set_brom4_bank#0 -- vbuz1=vbuc1 - lda #bank_set_brom4_bank - sta.z BROM + bcs !__b22+ + jmp __b22 + !__b22: // main::SEI3 // asm // asm { sei } sei // main::check_status_smc1 // status_smc == status - // [159] main::check_status_smc1_$0 = status_smc#0 == STATUS_DETECTED -- vboz1=vbum2_eq_vbuc1 + // [159] main::check_status_smc1_$0 = status_smc#0 == 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); // [160] main::check_status_smc1_return#0 = (char)main::check_status_smc1_$0 - // main::@70 + // main::@69 // if(check_status_smc(STATUS_DETECTED)) - // [161] if(0==main::check_status_smc1_return#0) goto main::CLI2 -- 0_eq_vbuz1_then_la1 - lda.z check_status_smc1_return - bne !__b7+ - jmp __b7 - !__b7: - // [162] phi from main::@70 to main::@27 [phi:main::@70->main::@27] - // main::@27 + // [161] if(0==main::check_status_smc1_return#0) goto main::CLI2 -- 0_eq_vbuaa_then_la1 + cmp #0 + bne !__b6+ + jmp __b6 + !__b6: + // [162] phi from main::@69 to main::@25 [phi:main::@69->main::@25] + // main::@25 // display_action_progress("Checking SMC.BIN ...") // [163] call display_action_progress - // [845] phi from main::@27 to display_action_progress [phi:main::@27->display_action_progress] - // [845] phi display_action_progress::info_text#19 = main::info_text6 [phi:main::@27->display_action_progress#0] -- pbuz1=pbuc1 + // [845] phi from main::@25 to display_action_progress [phi:main::@25->display_action_progress] + // [845] phi display_action_progress::info_text#19 = main::info_text6 [phi:main::@25->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text6 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [164] phi from main::@27 to main::@130 [phi:main::@27->main::@130] + // [164] phi from main::@25 to main::@130 [phi:main::@25->main::@130] // main::@130 // smc_read(STATUS_CHECKING) // [165] call smc_read @@ -1047,9 +985,9 @@ main: { lda #<0 sta.z __errno sta.z __errno+1 - // [1067] phi smc_read::info_status#2 = STATUS_CHECKING [phi:main::@130->smc_read#1] -- vbum1=vbuc1 + // [1067] phi smc_read::info_status#2 = STATUS_CHECKING [phi:main::@130->smc_read#1] -- vbuz1=vbuc1 lda #STATUS_CHECKING - sta smc_read.info_status + sta.z smc_read.info_status jsr smc_read // smc_read(STATUS_CHECKING) // [166] smc_read::return#2 = smc_read::return#0 @@ -1061,28 +999,28 @@ main: { lda.z smc_read.return+1 sta smc_file_size+1 // if (!smc_file_size) - // [168] if(0==smc_file_size#0) goto main::@30 -- 0_eq_vwum1_then_la1 + // [168] if(0==smc_file_size#0) goto main::@28 -- 0_eq_vwum1_then_la1 lda smc_file_size ora smc_file_size+1 - bne !__b30+ - jmp __b30 - !__b30: - // main::@28 + bne !__b28+ + jmp __b28 + !__b28: + // main::@26 // if(smc_file_size > 0x1E00) - // [169] if(smc_file_size#0>$1e00) goto main::@31 -- vwum1_gt_vwuc1_then_la1 + // [169] if(smc_file_size#0>$1e00) goto main::@29 -- vwum1_gt_vwuc1_then_la1 lda #>$1e00 cmp smc_file_size+1 - bcs !__b31+ - jmp __b31 - !__b31: + bcs !__b29+ + jmp __b29 + !__b29: bne !+ lda #<$1e00 cmp smc_file_size - bcs !__b31+ - jmp __b31 - !__b31: + bcs !__b29+ + jmp __b29 + !__b29: !: - // main::@29 + // main::@27 // smc_file_release = smc_file_header[0] // [170] 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 @@ -1098,27 +1036,26 @@ main: { 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) - // [173] smc_get_version_text::release#1 = smc_file_release#0 -- vbuz1=vbum2 - lda smc_file_release - sta.z smc_get_version_text.release - // [174] smc_get_version_text::major#1 = smc_file_major#0 -- vbuz1=vbum2 + // [173] smc_get_version_text::release#1 = smc_file_release#0 -- vbuyy=vbum1 + ldy smc_file_release + // [174] smc_get_version_text::major#1 = smc_file_major#0 -- vbum1=vbum2 lda smc_file_major - sta.z smc_get_version_text.major + sta smc_get_version_text.major // [175] smc_get_version_text::minor#1 = smc_file_minor#0 -- vbuz1=vbum2 lda smc_file_minor sta.z smc_get_version_text.minor // [176] call smc_get_version_text - // [987] phi from main::@29 to smc_get_version_text [phi:main::@29->smc_get_version_text] - // [987] phi smc_get_version_text::minor#2 = smc_get_version_text::minor#1 [phi:main::@29->smc_get_version_text#0] -- register_copy - // [987] phi smc_get_version_text::major#2 = smc_get_version_text::major#1 [phi:main::@29->smc_get_version_text#1] -- register_copy - // [987] phi smc_get_version_text::release#2 = smc_get_version_text::release#1 [phi:main::@29->smc_get_version_text#2] -- register_copy - // [987] phi smc_get_version_text::version_string#2 = main::smc_file_version_text [phi:main::@29->smc_get_version_text#3] -- pbuz1=pbuc1 + // [1000] phi from main::@27 to smc_get_version_text [phi:main::@27->smc_get_version_text] + // [1000] phi smc_get_version_text::minor#2 = smc_get_version_text::minor#1 [phi:main::@27->smc_get_version_text#0] -- register_copy + // [1000] phi smc_get_version_text::major#2 = smc_get_version_text::major#1 [phi:main::@27->smc_get_version_text#1] -- register_copy + // [1000] phi smc_get_version_text::release#2 = smc_get_version_text::release#1 [phi:main::@27->smc_get_version_text#2] -- register_copy + // [1000] 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 - // [177] phi from main::@29 to main::@132 [phi:main::@29->main::@132] + // [177] phi from main::@27 to main::@132 [phi:main::@27->main::@132] // main::@132 // sprintf(info_text, "SMC.BIN:%s", smc_file_version_text) // [178] call snprintf_init @@ -1175,7 +1112,7 @@ main: { jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla - // [186] smc_bootloader#432 = smc_bootloader#0 -- vwum1=vwum2 + // [186] smc_bootloader#417 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 @@ -1189,27 +1126,27 @@ main: { sta.z display_info_smc.info_text lda #>@info_text sta.z display_info_smc.info_text+1 - // [903] phi smc_bootloader#13 = smc_bootloader#432 [phi:main::@135->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_FLASH [phi:main::@135->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#417 [phi:main::@135->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = STATUS_FLASH [phi:main::@135->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 // [188] phi from main::@135 to main::CLI2 [phi:main::@135->main::CLI2] - // [188] phi smc_file_minor#277 = smc_file_minor#0 [phi:main::@135->main::CLI2#0] -- register_copy - // [188] phi smc_file_major#277 = smc_file_major#0 [phi:main::@135->main::CLI2#1] -- register_copy - // [188] phi smc_file_release#277 = smc_file_release#0 [phi:main::@135->main::CLI2#2] -- register_copy - // [188] phi __errno#240 = __errno#18 [phi:main::@135->main::CLI2#3] -- register_copy + // [188] phi smc_file_minor#276 = smc_file_minor#0 [phi:main::@135->main::CLI2#0] -- register_copy + // [188] phi smc_file_major#276 = smc_file_major#0 [phi:main::@135->main::CLI2#1] -- register_copy + // [188] phi smc_file_release#276 = smc_file_release#0 [phi:main::@135->main::CLI2#2] -- register_copy + // [188] phi __errno#246 = __errno#18 [phi:main::@135->main::CLI2#3] -- register_copy jmp CLI2 - // [188] phi from main::@70 to main::CLI2 [phi:main::@70->main::CLI2] - __b7: - // [188] phi smc_file_minor#277 = 0 [phi:main::@70->main::CLI2#0] -- vbum1=vbuc1 + // [188] phi from main::@69 to main::CLI2 [phi:main::@69->main::CLI2] + __b6: + // [188] phi smc_file_minor#276 = 0 [phi:main::@69->main::CLI2#0] -- vbum1=vbuc1 lda #0 sta smc_file_minor - // [188] phi smc_file_major#277 = 0 [phi:main::@70->main::CLI2#1] -- vbum1=vbuc1 + // [188] phi smc_file_major#276 = 0 [phi:main::@69->main::CLI2#1] -- vbum1=vbuc1 sta smc_file_major - // [188] phi smc_file_release#277 = 0 [phi:main::@70->main::CLI2#2] -- vbum1=vbuc1 + // [188] phi smc_file_release#276 = 0 [phi:main::@69->main::CLI2#2] -- vbum1=vbuc1 sta smc_file_release - // [188] phi __errno#240 = 0 [phi:main::@70->main::CLI2#3] -- vwsz1=vwsc1 + // [188] phi __errno#246 = 0 [phi:main::@69->main::CLI2#3] -- vwsz1=vwsc1 sta.z __errno sta.z __errno+1 // main::CLI2 @@ -1219,7 +1156,7 @@ main: { cli // [190] phi from main::CLI2 to main::@71 [phi:main::CLI2->main::@71] // main::@71 - // display_info_vera(STATUS_SKIP, "VERA not yet supported.") + // display_info_vera(STATUS_SKIP, "VERA not yet supported") // [191] call display_info_vera // [937] phi from main::@71 to display_info_vera [phi:main::@71->display_info_vera] // [937] phi display_info_vera::info_text#10 = main::info_text5 [phi:main::@71->display_info_vera#0] -- pbuz1=pbuc1 @@ -1235,17 +1172,17 @@ main: { // asm // asm { sei } sei - // [193] phi from main::SEI4 to main::@32 [phi:main::SEI4->main::@32] - // [193] phi __errno#116 = __errno#240 [phi:main::SEI4->main::@32#0] -- register_copy - // [193] phi main::rom_chip2#10 = 0 [phi:main::SEI4->main::@32#1] -- vbum1=vbuc1 + // [193] phi from main::SEI4 to main::@30 [phi:main::SEI4->main::@30] + // [193] phi __errno#116 = __errno#246 [phi:main::SEI4->main::@30#0] -- register_copy + // [193] phi main::rom_chip2#10 = 0 [phi:main::SEI4->main::@30#1] -- vbum1=vbuc1 lda #0 sta rom_chip2 // 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::@32 - __b32: + // main::@30 + __b30: // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) // [194] if(main::rom_chip2#10<8) goto main::bank_set_brom5 -- vbum1_lt_vbuc1_then_la1 lda rom_chip2 @@ -1264,157 +1201,157 @@ main: { cli // main::check_status_smc2 // status_smc == status - // [197] main::check_status_smc2_$0 = status_smc#0 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [197] main::check_status_smc2_$0 = status_smc#0 == STATUS_FLASH -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta check_status_smc2_main__0 // return (unsigned char)(status_smc == status); - // [198] main::check_status_smc2_return#0 = (char)main::check_status_smc2_$0 + // [198] main::check_status_smc2_return#0 = (char)main::check_status_smc2_$0 -- vbuyy=vbuaa + tay // [199] phi from main::check_status_smc2 to main::check_status_cx16_rom1 [phi:main::check_status_smc2->main::check_status_cx16_rom1] // main::check_status_cx16_rom1 // main::check_status_cx16_rom1_check_status_rom1 // status_rom[rom_chip] == status - // [200] main::check_status_cx16_rom1_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vboz1=_deref_pbuc1_eq_vbuc2 + // [200] 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.z check_status_cx16_rom1_check_status_rom1_main__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [201] main::check_status_cx16_rom1_check_status_rom1_return#0 = (char)main::check_status_cx16_rom1_check_status_rom1_$0 + // [201] main::check_status_cx16_rom1_check_status_rom1_return#0 = (char)main::check_status_cx16_rom1_check_status_rom1_$0 -- vbuxx=vbuaa + tax // main::@73 // if(!check_status_smc(STATUS_FLASH) && check_status_cx16_rom(STATUS_FLASH)) - // [202] if(0!=main::check_status_smc2_return#0) goto main::check_status_smc3 -- 0_neq_vbum1_then_la1 - lda check_status_smc2_return + // [202] if(0!=main::check_status_smc2_return#0) goto main::check_status_smc3 -- 0_neq_vbuyy_then_la1 + cpy #0 bne check_status_smc3 // main::@229 - // [203] if(0!=main::check_status_cx16_rom1_check_status_rom1_return#0) goto main::@39 -- 0_neq_vbuz1_then_la1 - lda.z check_status_cx16_rom1_check_status_rom1_return - beq !__b39+ - jmp __b39 - !__b39: + // [203] 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_smc3 check_status_smc3: // status_smc == status - // [204] main::check_status_smc3_$0 = status_smc#0 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [204] main::check_status_smc3_$0 = status_smc#0 == 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); - // [205] main::check_status_smc3_return#0 = (char)main::check_status_smc3_$0 + // [205] main::check_status_smc3_return#0 = (char)main::check_status_smc3_$0 -- vbuyy=vbuaa + tay // [206] phi from main::check_status_smc3 to main::check_status_cx16_rom2 [phi:main::check_status_smc3->main::check_status_cx16_rom2] // main::check_status_cx16_rom2 // main::check_status_cx16_rom2_check_status_rom1 // status_rom[rom_chip] == status - // [207] main::check_status_cx16_rom2_check_status_rom1_$0 = *status_rom == STATUS_NONE -- vbom1=_deref_pbuc1_eq_vbuc2 + // [207] 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); - // [208] main::check_status_cx16_rom2_check_status_rom1_return#0 = (char)main::check_status_cx16_rom2_check_status_rom1_$0 + // [208] main::check_status_cx16_rom2_check_status_rom1_return#0 = (char)main::check_status_cx16_rom2_check_status_rom1_$0 -- vbuxx=vbuaa + tax // main::@76 // if(check_status_smc(STATUS_FLASH) && check_status_cx16_rom(STATUS_NONE)) - // [209] if(0==main::check_status_smc3_return#0) goto main::check_status_smc4 -- 0_eq_vbum1_then_la1 + // [209] if(0==main::check_status_smc3_return#0) goto main::check_status_smc4 -- 0_eq_vbuyy_then_la1 // VA3 | SMC.BIN and CX16 ROM not Detected | Display issue and don't flash. Ask to close the J1 jumper pins on the CX16 main board. | Issue - lda check_status_smc3_return + cpy #0 beq check_status_smc4 // main::@230 - // [210] if(0!=main::check_status_cx16_rom2_check_status_rom1_return#0) goto main::@3 -- 0_neq_vbum1_then_la1 - lda check_status_cx16_rom2_check_status_rom1_return + // [210] if(0!=main::check_status_cx16_rom2_check_status_rom1_return#0) goto main::@3 -- 0_neq_vbuxx_then_la1 + cpx #0 beq !__b3+ jmp __b3 !__b3: // main::check_status_smc4 check_status_smc4: // status_smc == status - // [211] main::check_status_smc4_$0 = status_smc#0 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [211] main::check_status_smc4_$0 = status_smc#0 == 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); - // [212] main::check_status_smc4_return#0 = (char)main::check_status_smc4_$0 + // [212] main::check_status_smc4_return#0 = (char)main::check_status_smc4_$0 -- vbuyy=vbuaa + tay // [213] phi from main::check_status_smc4 to main::check_status_cx16_rom3 [phi:main::check_status_smc4->main::check_status_cx16_rom3] // main::check_status_cx16_rom3 // main::check_status_cx16_rom3_check_status_rom1 // status_rom[rom_chip] == status - // [214] main::check_status_cx16_rom3_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vbom1=_deref_pbuc1_eq_vbuc2 + // [214] 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); - // [215] main::check_status_cx16_rom3_check_status_rom1_return#0 = (char)main::check_status_cx16_rom3_check_status_rom1_$0 + // [215] main::check_status_cx16_rom3_check_status_rom1_return#0 = (char)main::check_status_cx16_rom3_check_status_rom1_$0 -- vbuxx=vbuaa + tax // main::@77 // if(check_status_smc(STATUS_FLASH) && !check_status_cx16_rom(STATUS_FLASH)) - // [216] if(0==main::check_status_smc4_return#0) goto main::check_status_smc5 -- 0_eq_vbum1_then_la1 - lda check_status_smc4_return + // [216] if(0==main::check_status_smc4_return#0) goto main::check_status_smc5 -- 0_eq_vbuyy_then_la1 + cpy #0 beq check_status_smc5 // main::@231 - // [217] if(0==main::check_status_cx16_rom3_check_status_rom1_return#0) goto main::@5 -- 0_eq_vbum1_then_la1 - lda check_status_cx16_rom3_check_status_rom1_return - bne !__b5+ - jmp __b5 - !__b5: + // [217] if(0==main::check_status_cx16_rom3_check_status_rom1_return#0) goto main::@4 -- 0_eq_vbuxx_then_la1 + cpx #0 + bne !__b4+ + jmp __b4 + !__b4: // main::check_status_smc5 check_status_smc5: // status_smc == status - // [218] main::check_status_smc5_$0 = status_smc#0 == STATUS_FLASH -- vbom1=vbum2_eq_vbuc1 + // [218] main::check_status_smc5_$0 = status_smc#0 == 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); - // [219] main::check_status_smc5_return#0 = (char)main::check_status_smc5_$0 + // [219] main::check_status_smc5_return#0 = (char)main::check_status_smc5_$0 -- vbum1=vbuaa + sta check_status_smc5_return // [220] phi from main::check_status_smc5 to main::check_status_cx16_rom4 [phi:main::check_status_smc5->main::check_status_cx16_rom4] // main::check_status_cx16_rom4 // main::check_status_cx16_rom4_check_status_rom1 // status_rom[rom_chip] == status - // [221] main::check_status_cx16_rom4_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vboz1=_deref_pbuc1_eq_vbuc2 + // [221] 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); - // [222] main::check_status_cx16_rom4_check_status_rom1_return#0 = (char)main::check_status_cx16_rom4_check_status_rom1_$0 + // [222] 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::@78 // smc_supported_rom(rom_release[0]) - // [223] smc_supported_rom::rom_release#0 = *rom_release -- vbuz1=_deref_pbuc1 + // [223] smc_supported_rom::rom_release#0 = *rom_release -- vbuaa=_deref_pbuc1 lda rom_release - sta.z smc_supported_rom.rom_release // [224] call smc_supported_rom // [1172] phi from main::@78 to smc_supported_rom [phi:main::@78->smc_supported_rom] jsr smc_supported_rom // smc_supported_rom(rom_release[0]) // [225] smc_supported_rom::return#3 = smc_supported_rom::return#2 // main::@170 - // [226] main::$50 = smc_supported_rom::return#3 + // [226] main::$50 = smc_supported_rom::return#3 -- vbuxx=vbuaa + tax // if(check_status_smc(STATUS_FLASH) && check_status_cx16_rom(STATUS_FLASH) && !smc_supported_rom(rom_release[0])) // [227] if(0==main::check_status_smc5_return#0) goto main::check_status_smc6 -- 0_eq_vbum1_then_la1 lda check_status_smc5_return @@ -1424,31 +1361,30 @@ main: { lda.z check_status_cx16_rom4_check_status_rom1_return beq check_status_smc6 // main::@232 - // [229] if(0==main::$50) goto main::@6 -- 0_eq_vbum1_then_la1 - lda main__50 - bne !__b6+ - jmp __b6 - !__b6: + // [229] if(0==main::$50) goto main::@5 -- 0_eq_vbuxx_then_la1 + cpx #0 + bne !__b5+ + jmp __b5 + !__b5: // main::check_status_smc6 check_status_smc6: // status_smc == status - // [230] main::check_status_smc6_$0 = status_smc#0 == STATUS_FLASH -- vboz1=vbum2_eq_vbuc1 + // [230] main::check_status_smc6_$0 = status_smc#0 == STATUS_FLASH -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta.z check_status_smc6_main__0 // return (unsigned char)(status_smc == status); // [231] main::check_status_smc6_return#0 = (char)main::check_status_smc6_$0 // main::@79 // if(check_status_smc(STATUS_FLASH) && smc_release == smc_file_release && smc_major == smc_file_major && smc_minor == smc_file_minor) - // [232] if(0==main::check_status_smc6_return#0) goto main::check_status_smc7 -- 0_eq_vbuz1_then_la1 - lda.z check_status_smc6_return + // [232] if(0==main::check_status_smc6_return#0) goto main::check_status_smc7 -- 0_eq_vbuaa_then_la1 + cmp #0 beq check_status_smc7 // main::@236 - // [233] if(smc_release#363==smc_file_release#277) goto main::@235 -- vbum1_eq_vbum2_then_la1 + // [233] if(smc_release#340==smc_file_release#276) goto main::@235 -- vbum1_eq_vbum2_then_la1 lda smc_release cmp smc_file_release bne !__b235+ @@ -1457,166 +1393,159 @@ main: { // main::check_status_smc7 check_status_smc7: // status_smc == status - // [234] main::check_status_smc7_$0 = status_smc#0 == STATUS_ISSUE -- vboz1=vbum2_eq_vbuc1 + // [234] main::check_status_smc7_$0 = status_smc#0 == STATUS_ISSUE -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_ISSUE beq !+ lda #1 !: eor #1 - sta.z check_status_smc7_main__0 // return (unsigned char)(status_smc == status); - // [235] main::check_status_smc7_return#0 = (char)main::check_status_smc7_$0 + // [235] main::check_status_smc7_return#0 = (char)main::check_status_smc7_$0 -- vbuz1=vbuaa + sta.z check_status_smc7_return // main::check_status_vera1 // status_vera == status - // [236] main::check_status_vera1_$0 = status_vera#0 == STATUS_ISSUE -- vbom1=vbum2_eq_vbuc1 + // [236] main::check_status_vera1_$0 = status_vera#0 == 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); - // [237] main::check_status_vera1_return#0 = (char)main::check_status_vera1_$0 + // [237] main::check_status_vera1_return#0 = (char)main::check_status_vera1_$0 -- vbuz1=vbuaa + sta.z check_status_vera1_return // [238] phi from main::check_status_vera1 to main::@80 [phi:main::check_status_vera1->main::@80] // main::@80 // check_status_roms(STATUS_ISSUE) // [239] call check_status_roms // [1179] phi from main::@80 to check_status_roms [phi:main::@80->check_status_roms] - // [1179] phi check_status_roms::status#6 = STATUS_ISSUE [phi:main::@80->check_status_roms#0] -- vbuz1=vbuc1 - lda #STATUS_ISSUE - sta.z check_status_roms.status + // [1179] 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) // [240] check_status_roms::return#3 = check_status_roms::return#2 // main::@175 - // [241] main::$67 = check_status_roms::return#3 -- vbum1=vbum2 - lda check_status_roms.return - sta main__67 + // [241] main::$67 = check_status_roms::return#3 -- vbuz1=vbuaa + sta.z main__67 // main::check_status_smc8 // status_smc == status - // [242] main::check_status_smc8_$0 = status_smc#0 == STATUS_ERROR -- vboz1=vbum2_eq_vbuc1 + // [242] main::check_status_smc8_$0 = status_smc#0 == STATUS_ERROR -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_ERROR beq !+ lda #1 !: eor #1 - sta.z check_status_smc8_main__0 // return (unsigned char)(status_smc == status); - // [243] main::check_status_smc8_return#0 = (char)main::check_status_smc8_$0 + // [243] main::check_status_smc8_return#0 = (char)main::check_status_smc8_$0 -- vbuz1=vbuaa + sta.z check_status_smc8_return // main::check_status_vera2 // status_vera == status - // [244] main::check_status_vera2_$0 = status_vera#0 == STATUS_ERROR -- vbom1=vbum2_eq_vbuc1 + // [244] main::check_status_vera2_$0 = status_vera#0 == STATUS_ERROR -- vboaa=vbum1_eq_vbuc1 lda status_vera eor #STATUS_ERROR beq !+ lda #1 !: eor #1 - sta check_status_vera2_main__0 // return (unsigned char)(status_vera == status); - // [245] main::check_status_vera2_return#0 = (char)main::check_status_vera2_$0 + // [245] main::check_status_vera2_return#0 = (char)main::check_status_vera2_$0 -- vbum1=vbuaa + sta check_status_vera2_return // [246] phi from main::check_status_vera2 to main::@81 [phi:main::check_status_vera2->main::@81] // main::@81 // check_status_roms(STATUS_ERROR) // [247] call check_status_roms // [1179] phi from main::@81 to check_status_roms [phi:main::@81->check_status_roms] - // [1179] phi check_status_roms::status#6 = STATUS_ERROR [phi:main::@81->check_status_roms#0] -- vbuz1=vbuc1 - lda #STATUS_ERROR - sta.z check_status_roms.status + // [1179] 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) // [248] check_status_roms::return#4 = check_status_roms::return#2 // main::@176 - // [249] main::$76 = check_status_roms::return#4 + // [249] main::$76 = 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)) - // [250] if(0!=main::check_status_smc7_return#0) goto main::@4 -- 0_neq_vbuz1_then_la1 + // [250] if(0!=main::check_status_smc7_return#0) goto main::check_status_smc9 -- 0_neq_vbuz1_then_la1 lda.z check_status_smc7_return - bne __b4 + bne check_status_smc9 // main::@241 - // [251] if(0==main::check_status_vera1_return#0) goto main::@240 -- 0_eq_vbum1_then_la1 - lda check_status_vera1_return + // [251] if(0==main::check_status_vera1_return#0) goto main::@240 -- 0_eq_vbuz1_then_la1 + lda.z check_status_vera1_return bne !__b240+ jmp __b240 !__b240: - // [252] phi from main::@176 main::@237 main::@238 main::@239 main::@240 main::@241 main::@46 to main::@4 [phi:main::@176/main::@237/main::@238/main::@239/main::@240/main::@241/main::@46->main::@4] - // main::@4 - __b4: - // display_progress_clear() - // [253] call display_progress_clear - // [859] phi from main::@4 to display_progress_clear [phi:main::@4->display_progress_clear] - jsr display_progress_clear // main::check_status_smc9 + check_status_smc9: // status_smc == status - // [254] main::check_status_smc9_$0 = status_smc#0 == STATUS_SKIP -- vbom1=vbum2_eq_vbuc1 + // [252] main::check_status_smc9_$0 = status_smc#0 == STATUS_SKIP -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_SKIP beq !+ lda #1 !: eor #1 - sta check_status_smc9_main__0 // return (unsigned char)(status_smc == status); - // [255] main::check_status_smc9_return#0 = (char)main::check_status_smc9_$0 + // [253] main::check_status_smc9_return#0 = (char)main::check_status_smc9_$0 -- vbum1=vbuaa + sta check_status_smc9_return // main::check_status_smc10 // status_smc == status - // [256] main::check_status_smc10_$0 = status_smc#0 == STATUS_NONE -- vboz1=vbum2_eq_vbuc1 + // [254] main::check_status_smc10_$0 = status_smc#0 == STATUS_NONE -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_NONE beq !+ lda #1 !: eor #1 - sta.z check_status_smc10_main__0 // return (unsigned char)(status_smc == status); - // [257] main::check_status_smc10_return#0 = (char)main::check_status_smc10_$0 + // [255] main::check_status_smc10_return#0 = (char)main::check_status_smc10_$0 -- vbuz1=vbuaa + sta.z check_status_smc10_return // main::check_status_vera3 // status_vera == status - // [258] main::check_status_vera3_$0 = status_vera#0 == STATUS_SKIP -- vboz1=vbum2_eq_vbuc1 + // [256] main::check_status_vera3_$0 = status_vera#0 == STATUS_SKIP -- vboaa=vbum1_eq_vbuc1 lda status_vera eor #STATUS_SKIP beq !+ lda #1 !: eor #1 - sta.z check_status_vera3_main__0 // return (unsigned char)(status_vera == status); - // [259] main::check_status_vera3_return#0 = (char)main::check_status_vera3_$0 + // [257] main::check_status_vera3_return#0 = (char)main::check_status_vera3_$0 -- vbuz1=vbuaa + sta.z check_status_vera3_return // main::check_status_vera4 // status_vera == status - // [260] main::check_status_vera4_$0 = status_vera#0 == STATUS_NONE -- vboz1=vbum2_eq_vbuc1 + // [258] main::check_status_vera4_$0 = status_vera#0 == STATUS_NONE -- vboaa=vbum1_eq_vbuc1 lda status_vera eor #STATUS_NONE beq !+ lda #1 !: eor #1 - sta.z check_status_vera4_main__0 // return (unsigned char)(status_vera == status); - // [261] main::check_status_vera4_return#0 = (char)main::check_status_vera4_$0 - // [262] phi from main::check_status_vera4 to main::@82 [phi:main::check_status_vera4->main::@82] + // [259] main::check_status_vera4_return#0 = (char)main::check_status_vera4_$0 -- vbuyy=vbuaa + tay + // [260] phi from main::check_status_vera4 to main::@82 [phi:main::check_status_vera4->main::@82] // main::@82 // check_status_roms_less(STATUS_SKIP) - // [263] call check_status_roms_less + // [261] call check_status_roms_less // [1188] phi from main::@82 to check_status_roms_less [phi:main::@82->check_status_roms_less] jsr check_status_roms_less // check_status_roms_less(STATUS_SKIP) - // [264] check_status_roms_less::return#3 = check_status_roms_less::return#2 + // [262] check_status_roms_less::return#3 = check_status_roms_less::return#2 // main::@179 - // [265] main::$88 = check_status_roms_less::return#3 + // [263] main::$87 = 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)) - // [266] if(0!=main::check_status_smc9_return#0) goto main::@243 -- 0_neq_vbum1_then_la1 + // [264] if(0!=main::check_status_smc9_return#0) goto main::@243 -- 0_neq_vbum1_then_la1 lda check_status_smc9_return beq !__b243+ jmp __b243 !__b243: // main::@244 - // [267] if(0!=main::check_status_smc10_return#0) goto main::@243 -- 0_neq_vbuz1_then_la1 + // [265] if(0!=main::check_status_smc10_return#0) goto main::@243 -- 0_neq_vbuz1_then_la1 lda.z check_status_smc10_return beq !__b243+ jmp __b243 @@ -1624,201 +1553,198 @@ main: { // main::check_status_smc15 check_status_smc15: // status_smc == status - // [268] main::check_status_smc15_$0 = status_smc#0 == STATUS_ERROR -- vboz1=vbum2_eq_vbuc1 + // [266] main::check_status_smc15_$0 = status_smc#0 == STATUS_ERROR -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_ERROR beq !+ lda #1 !: eor #1 - sta.z check_status_smc15_main__0 // return (unsigned char)(status_smc == status); - // [269] main::check_status_smc15_return#0 = (char)main::check_status_smc15_$0 + // [267] main::check_status_smc15_return#0 = (char)main::check_status_smc15_$0 -- vbuz1=vbuaa + sta.z check_status_smc15_return // main::check_status_vera5 // status_vera == status - // [270] main::check_status_vera5_$0 = status_vera#0 == STATUS_ERROR -- vboz1=vbum2_eq_vbuc1 + // [268] main::check_status_vera5_$0 = status_vera#0 == STATUS_ERROR -- vboaa=vbum1_eq_vbuc1 lda status_vera eor #STATUS_ERROR beq !+ lda #1 !: eor #1 - sta.z check_status_vera5_main__0 // return (unsigned char)(status_vera == status); - // [271] main::check_status_vera5_return#0 = (char)main::check_status_vera5_$0 - // [272] phi from main::check_status_vera5 to main::@89 [phi:main::check_status_vera5->main::@89] + // [269] main::check_status_vera5_return#0 = (char)main::check_status_vera5_$0 -- vbuz1=vbuaa + sta.z check_status_vera5_return + // [270] phi from main::check_status_vera5 to main::@89 [phi:main::check_status_vera5->main::@89] // main::@89 // check_status_roms(STATUS_ERROR) - // [273] call check_status_roms + // [271] call check_status_roms // [1179] phi from main::@89 to check_status_roms [phi:main::@89->check_status_roms] - // [1179] phi check_status_roms::status#6 = STATUS_ERROR [phi:main::@89->check_status_roms#0] -- vbuz1=vbuc1 - lda #STATUS_ERROR - sta.z check_status_roms.status + // [1179] phi check_status_roms::status#6 = STATUS_ERROR [phi:main::@89->check_status_roms#0] -- vbuxx=vbuc1 + ldx #STATUS_ERROR jsr check_status_roms // check_status_roms(STATUS_ERROR) - // [274] check_status_roms::return#10 = check_status_roms::return#2 + // [272] check_status_roms::return#10 = check_status_roms::return#2 // main::@211 - // [275] main::$254 = check_status_roms::return#10 + // [273] main::$254 = check_status_roms::return#10 -- vbuxx=vbuaa + tax // if(check_status_smc(STATUS_ERROR) || check_status_vera(STATUS_ERROR) || check_status_roms(STATUS_ERROR)) - // [276] if(0!=main::check_status_smc15_return#0) goto main::vera_display_set_border_color2 -- 0_neq_vbuz1_then_la1 + // [274] if(0!=main::check_status_smc15_return#0) goto main::vera_display_set_border_color2 -- 0_neq_vbuz1_then_la1 lda.z check_status_smc15_return beq !vera_display_set_border_color2+ jmp vera_display_set_border_color2 !vera_display_set_border_color2: // main::@251 - // [277] if(0!=main::check_status_vera5_return#0) goto main::vera_display_set_border_color2 -- 0_neq_vbuz1_then_la1 + // [275] if(0!=main::check_status_vera5_return#0) goto main::vera_display_set_border_color2 -- 0_neq_vbuz1_then_la1 lda.z check_status_vera5_return beq !vera_display_set_border_color2+ jmp vera_display_set_border_color2 !vera_display_set_border_color2: // main::@250 - // [278] if(0!=main::$254) goto main::vera_display_set_border_color2 -- 0_neq_vbum1_then_la1 - lda main__254 + // [276] if(0!=main::$254) goto main::vera_display_set_border_color2 -- 0_neq_vbuxx_then_la1 + cpx #0 beq !vera_display_set_border_color2+ jmp vera_display_set_border_color2 !vera_display_set_border_color2: // main::check_status_smc16 // status_smc == status - // [279] main::check_status_smc16_$0 = status_smc#0 == STATUS_ISSUE -- vboz1=vbum2_eq_vbuc1 + // [277] main::check_status_smc16_$0 = status_smc#0 == STATUS_ISSUE -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_ISSUE beq !+ lda #1 !: eor #1 - sta.z check_status_smc16_main__0 // return (unsigned char)(status_smc == status); - // [280] main::check_status_smc16_return#0 = (char)main::check_status_smc16_$0 + // [278] main::check_status_smc16_return#0 = (char)main::check_status_smc16_$0 -- vbum1=vbuaa + sta check_status_smc16_return // main::check_status_vera6 // status_vera == status - // [281] main::check_status_vera6_$0 = status_vera#0 == STATUS_ISSUE -- vboz1=vbum2_eq_vbuc1 + // [279] main::check_status_vera6_$0 = status_vera#0 == STATUS_ISSUE -- vboaa=vbum1_eq_vbuc1 lda status_vera eor #STATUS_ISSUE beq !+ lda #1 !: eor #1 - sta.z check_status_vera6_main__0 // return (unsigned char)(status_vera == status); - // [282] main::check_status_vera6_return#0 = (char)main::check_status_vera6_$0 - // [283] phi from main::check_status_vera6 to main::@91 [phi:main::check_status_vera6->main::@91] + // [280] main::check_status_vera6_return#0 = (char)main::check_status_vera6_$0 -- vbum1=vbuaa + sta check_status_vera6_return + // [281] phi from main::check_status_vera6 to main::@91 [phi:main::check_status_vera6->main::@91] // main::@91 // check_status_roms(STATUS_ISSUE) - // [284] call check_status_roms + // [282] call check_status_roms // [1179] phi from main::@91 to check_status_roms [phi:main::@91->check_status_roms] - // [1179] phi check_status_roms::status#6 = STATUS_ISSUE [phi:main::@91->check_status_roms#0] -- vbuz1=vbuc1 - lda #STATUS_ISSUE - sta.z check_status_roms.status + // [1179] phi check_status_roms::status#6 = STATUS_ISSUE [phi:main::@91->check_status_roms#0] -- vbuxx=vbuc1 + ldx #STATUS_ISSUE jsr check_status_roms // check_status_roms(STATUS_ISSUE) - // [285] check_status_roms::return#11 = check_status_roms::return#2 + // [283] check_status_roms::return#11 = check_status_roms::return#2 // main::@213 - // [286] main::$259 = check_status_roms::return#11 + // [284] main::$259 = check_status_roms::return#11 -- vbuxx=vbuaa + tax // if(check_status_smc(STATUS_ISSUE) || check_status_vera(STATUS_ISSUE) || check_status_roms(STATUS_ISSUE)) - // [287] 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 + // [285] 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::@253 - // [288] if(0!=main::check_status_vera6_return#0) goto main::vera_display_set_border_color3 -- 0_neq_vbuz1_then_la1 - lda.z check_status_vera6_return + // [286] if(0!=main::check_status_vera6_return#0) goto main::vera_display_set_border_color3 -- 0_neq_vbum1_then_la1 + lda check_status_vera6_return beq !vera_display_set_border_color3+ jmp vera_display_set_border_color3 !vera_display_set_border_color3: // main::@252 - // [289] if(0!=main::$259) goto main::vera_display_set_border_color3 -- 0_neq_vbum1_then_la1 - lda main__259 + // [287] if(0!=main::$259) 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::vera_display_set_border_color4 // *VERA_CTRL &= ~VERA_DCSEL - // [290] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [288] *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 - // [291] *VERA_DC_BORDER = GREEN -- _deref_pbuc1=vbuc2 + // [289] *VERA_DC_BORDER = GREEN -- _deref_pbuc1=vbuc2 lda #GREEN sta VERA_DC_BORDER - // [292] phi from main::vera_display_set_border_color4 to main::@93 [phi:main::vera_display_set_border_color4->main::@93] + // [290] phi from main::vera_display_set_border_color4 to main::@93 [phi:main::vera_display_set_border_color4->main::@93] // main::@93 // display_action_progress("Your CX16 update is a success!") - // [293] call display_action_progress + // [291] call display_action_progress // [845] phi from main::@93 to display_action_progress [phi:main::@93->display_action_progress] - // [845] phi display_action_progress::info_text#19 = main::info_text41 [phi:main::@93->display_action_progress#0] -- pbuz1=pbuc1 - lda #display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text41 + lda #>info_text40 sta.z display_action_progress.info_text+1 jsr display_action_progress // main::check_status_smc17 // status_smc == status - // [294] main::check_status_smc17_$0 = status_smc#0 == STATUS_FLASHED -- vboz1=vbum2_eq_vbuc1 + // [292] main::check_status_smc17_$0 = status_smc#0 == STATUS_FLASHED -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_FLASHED beq !+ lda #1 !: eor #1 - sta.z check_status_smc17_main__0 // return (unsigned char)(status_smc == status); - // [295] main::check_status_smc17_return#0 = (char)main::check_status_smc17_$0 + // [293] main::check_status_smc17_return#0 = (char)main::check_status_smc17_$0 // main::@94 // if(check_status_smc(STATUS_FLASHED)) - // [296] if(0!=main::check_status_smc17_return#0) goto main::@58 -- 0_neq_vbuz1_then_la1 - lda.z check_status_smc17_return - beq !__b58+ - jmp __b58 - !__b58: - // [297] phi from main::@94 to main::@11 [phi:main::@94->main::@11] - // main::@11 + // [294] if(0!=main::check_status_smc17_return#0) goto main::@57 -- 0_neq_vbuaa_then_la1 + cmp #0 + bne __b57 + // [295] phi from main::@94 to main::@10 [phi:main::@94->main::@10] + // main::@10 // display_progress_text(display_debriefing_text_rom, display_debriefing_count_rom) - // [298] call display_progress_text - // [1054] phi from main::@11 to display_progress_text [phi:main::@11->display_progress_text] - // [1054] phi display_progress_text::text#12 = display_debriefing_text_rom [phi:main::@11->display_progress_text#0] -- qbuz1=qbuc1 + // [296] call display_progress_text + // [963] phi from main::@10 to display_progress_text [phi:main::@10->display_progress_text] + // [963] phi display_progress_text::text#12 = display_debriefing_text_rom [phi:main::@10->display_progress_text#0] -- qbuz1=qbuc1 lda #display_debriefing_text_rom sta.z display_progress_text.text+1 - // [1054] phi display_progress_text::lines#11 = display_debriefing_count_rom [phi:main::@11->display_progress_text#1] -- vbuz1=vbuc1 + // [963] phi display_progress_text::lines#11 = display_debriefing_count_rom [phi:main::@10->display_progress_text#1] -- vbuz1=vbuc1 lda #display_debriefing_count_rom sta.z display_progress_text.lines jsr display_progress_text - // [299] phi from main::@11 main::@222 main::@88 main::@92 to main::@63 [phi:main::@11/main::@222/main::@88/main::@92->main::@63] - __b10: - // [299] phi main::w1#2 = $c8 [phi:main::@11/main::@222/main::@88/main::@92->main::@63#0] -- vbum1=vbuc1 + // [297] phi from main::@10 main::@222 main::@88 main::@92 to main::@62 [phi:main::@10/main::@222/main::@88/main::@92->main::@62] + __b9: + // [297] phi main::w1#2 = $c8 [phi:main::@10/main::@222/main::@88/main::@92->main::@62#0] -- vbum1=vbuc1 lda #$c8 sta w1 // DE6 | Wait until reset - // main::@63 - __b63: + // main::@62 + __b62: // for (unsigned char w=200; w>0; w--) - // [300] if(main::w1#2>0) goto main::@64 -- vbum1_gt_0_then_la1 + // [298] if(main::w1#2>0) goto main::@63 -- vbum1_gt_0_then_la1 lda w1 - bne __b64 - // [301] phi from main::@63 to main::@65 [phi:main::@63->main::@65] - // main::@65 + bne __b63 + // [299] phi from main::@62 to main::@64 [phi:main::@62->main::@64] + // main::@64 // system_reset() - // [302] call system_reset - // [1197] phi from main::@65 to system_reset [phi:main::@65->system_reset] + // [300] call system_reset + // [1197] phi from main::@64 to system_reset [phi:main::@64->system_reset] jsr system_reset // main::@return // } - // [303] return + // [301] return rts - // [304] phi from main::@63 to main::@64 [phi:main::@63->main::@64] - // main::@64 - __b64: + // [302] phi from main::@62 to main::@63 [phi:main::@62->main::@63] + // main::@63 + __b63: // wait_moment() - // [305] call wait_moment - // [1202] phi from main::@64 to wait_moment [phi:main::@64->wait_moment] + // [303] call wait_moment + // [1202] phi from main::@63 to wait_moment [phi:main::@63->wait_moment] jsr wait_moment - // [306] phi from main::@64 to main::@223 [phi:main::@64->main::@223] + // [304] phi from main::@63 to main::@223 [phi:main::@63->main::@223] // main::@223 // sprintf(info_text, "(%u) Your CX16 will reset ...", w) - // [307] call snprintf_init + // [305] call snprintf_init // [1133] phi from main::@223 to snprintf_init [phi:main::@223->snprintf_init] // [1133] phi snprintf_init::s#26 = info_text [phi:main::@223->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text @@ -1826,10 +1752,10 @@ main: { lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [308] phi from main::@223 to main::@224 [phi:main::@223->main::@224] + // [306] phi from main::@223 to main::@224 [phi:main::@223->main::@224] // main::@224 // sprintf(info_text, "(%u) Your CX16 will reset ...", w) - // [309] call printf_str + // [307] call printf_str // [1138] phi from main::@224 to printf_str [phi:main::@224->printf_str] // [1138] phi printf_str::putc#71 = &snputc [phi:main::@224->printf_str#0] -- pprz1=pprc1 lda #printf_uchar] // [1207] phi printf_uchar::format_zero_padding#14 = 0 [phi:main::@225->printf_uchar#0] -- vbuz1=vbuc1 lda #0 @@ -1859,15 +1784,14 @@ main: { sta.z printf_uchar.putc lda #>snputc sta.z printf_uchar.putc+1 - // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:main::@225->printf_uchar#3] -- vbuz1=vbuc1 - lda #DECIMAL - sta.z printf_uchar.format_radix + // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:main::@225->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL // [1207] phi printf_uchar::uvalue#14 = printf_uchar::uvalue#13 [phi:main::@225->printf_uchar#4] -- register_copy jsr printf_uchar - // [312] phi from main::@225 to main::@226 [phi:main::@225->main::@226] + // [310] phi from main::@225 to main::@226 [phi:main::@225->main::@226] // main::@226 // sprintf(info_text, "(%u) Your CX16 will reset ...", w) - // [313] call printf_str + // [311] call printf_str // [1138] phi from main::@226 to printf_str [phi:main::@226->printf_str] // [1138] phi printf_str::putc#71 = &snputc [phi:main::@226->printf_str#0] -- pprz1=pprc1 lda #display_action_text] // [1218] phi display_action_text::info_text#19 = info_text [phi:main::@227->display_action_text#0] -- pbuz1=pbuc1 lda #<@info_text @@ -1900,51 +1824,51 @@ main: { jsr display_action_text // main::@228 // for (unsigned char w=200; w>0; w--) - // [318] main::w1#1 = -- main::w1#2 -- vbum1=_dec_vbum1 + // [316] main::w1#1 = -- main::w1#2 -- vbum1=_dec_vbum1 dec w1 - // [299] phi from main::@228 to main::@63 [phi:main::@228->main::@63] - // [299] phi main::w1#2 = main::w1#1 [phi:main::@228->main::@63#0] -- register_copy - jmp __b63 - // [319] phi from main::@94 to main::@58 [phi:main::@94->main::@58] - // main::@58 - __b58: + // [297] phi from main::@228 to main::@62 [phi:main::@228->main::@62] + // [297] phi main::w1#2 = main::w1#1 [phi:main::@228->main::@62#0] -- register_copy + jmp __b62 + // [317] phi from main::@94 to main::@57 [phi:main::@94->main::@57] + // main::@57 + __b57: // display_progress_text(display_debriefing_text_smc, display_debriefing_count_smc) - // [320] call display_progress_text - // [1054] phi from main::@58 to display_progress_text [phi:main::@58->display_progress_text] - // [1054] phi display_progress_text::text#12 = display_debriefing_text_smc [phi:main::@58->display_progress_text#0] -- qbuz1=qbuc1 + // [318] call display_progress_text + // [963] phi from main::@57 to display_progress_text [phi:main::@57->display_progress_text] + // [963] phi display_progress_text::text#12 = display_debriefing_text_smc [phi:main::@57->display_progress_text#0] -- qbuz1=qbuc1 lda #display_debriefing_text_smc sta.z display_progress_text.text+1 - // [1054] phi display_progress_text::lines#11 = display_debriefing_count_smc [phi:main::@58->display_progress_text#1] -- vbuz1=vbuc1 + // [963] phi display_progress_text::lines#11 = display_debriefing_count_smc [phi:main::@57->display_progress_text#1] -- vbuz1=vbuc1 lda #display_debriefing_count_smc sta.z display_progress_text.lines jsr display_progress_text - // [321] phi from main::@58 to main::@59 [phi:main::@58->main::@59] - // [321] phi main::w#2 = $f0 [phi:main::@58->main::@59#0] -- vbum1=vbuc1 + // [319] phi from main::@57 to main::@58 [phi:main::@57->main::@58] + // [319] phi main::w#2 = $f0 [phi:main::@57->main::@58#0] -- vbum1=vbuc1 lda #$f0 sta w - // main::@59 - __b59: + // main::@58 + __b58: // for (unsigned char w=240; w>0; w--) - // [322] if(main::w#2>0) goto main::@60 -- vbum1_gt_0_then_la1 + // [320] if(main::w#2>0) goto main::@59 -- vbum1_gt_0_then_la1 lda w - bne __b60 - // [323] phi from main::@59 to main::@61 [phi:main::@59->main::@61] - // main::@61 + bne __b59 + // [321] phi from main::@58 to main::@60 [phi:main::@58->main::@60] + // main::@60 // sprintf(info_text, "Please disconnect your CX16 from power source ...") - // [324] call snprintf_init - // [1133] phi from main::@61 to snprintf_init [phi:main::@61->snprintf_init] - // [1133] phi snprintf_init::s#26 = info_text [phi:main::@61->snprintf_init#0] -- pbuz1=pbuc1 + // [322] call snprintf_init + // [1133] phi from main::@60 to snprintf_init [phi:main::@60->snprintf_init] + // [1133] phi snprintf_init::s#26 = info_text [phi:main::@60->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 - // [325] phi from main::@61 to main::@220 [phi:main::@61->main::@220] + // [323] phi from main::@60 to main::@220 [phi:main::@60->main::@220] // main::@220 // sprintf(info_text, "Please disconnect your CX16 from power source ...") - // [326] call printf_str + // [324] call printf_str // [1138] phi from main::@220 to printf_str [phi:main::@220->printf_str] // [1138] phi printf_str::putc#71 = &snputc [phi:main::@220->printf_str#0] -- pprz1=pprc1 lda #display_action_text] // [1218] phi display_action_text::info_text#19 = info_text [phi:main::@221->display_action_text#0] -- pbuz1=pbuc1 lda #<@info_text @@ -1975,27 +1899,27 @@ main: { lda #>@info_text sta.z display_action_text.info_text+1 jsr display_action_text - // [331] phi from main::@221 to main::@222 [phi:main::@221->main::@222] + // [329] phi from main::@221 to main::@222 [phi:main::@221->main::@222] // main::@222 // smc_reset() - // [332] call smc_reset + // [330] 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. // [1232] phi from main::@222 to smc_reset [phi:main::@222->smc_reset] jsr smc_reset - jmp __b10 - // [333] phi from main::@59 to main::@60 [phi:main::@59->main::@60] - // main::@60 - __b60: + jmp __b9 + // [331] phi from main::@58 to main::@59 [phi:main::@58->main::@59] + // main::@59 + __b59: // wait_moment() - // [334] call wait_moment - // [1202] phi from main::@60 to wait_moment [phi:main::@60->wait_moment] + // [332] call wait_moment + // [1202] phi from main::@59 to wait_moment [phi:main::@59->wait_moment] jsr wait_moment - // [335] phi from main::@60 to main::@214 [phi:main::@60->main::@214] + // [333] phi from main::@59 to main::@214 [phi:main::@59->main::@214] // main::@214 // sprintf(info_text, "(%u) Please read carefully the below ...", w) - // [336] call snprintf_init + // [334] call snprintf_init // [1133] phi from main::@214 to snprintf_init [phi:main::@214->snprintf_init] // [1133] phi snprintf_init::s#26 = info_text [phi:main::@214->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text @@ -2003,10 +1927,10 @@ main: { lda #>@info_text sta.z snprintf_init.s+1 jsr snprintf_init - // [337] phi from main::@214 to main::@215 [phi:main::@214->main::@215] + // [335] phi from main::@214 to main::@215 [phi:main::@214->main::@215] // main::@215 // sprintf(info_text, "(%u) Please read carefully the below ...", w) - // [338] call printf_str + // [336] call printf_str // [1138] phi from main::@215 to printf_str [phi:main::@215->printf_str] // [1138] phi printf_str::putc#71 = &snputc [phi:main::@215->printf_str#0] -- pprz1=pprc1 lda #printf_uchar] // [1207] phi printf_uchar::format_zero_padding#14 = 0 [phi:main::@216->printf_uchar#0] -- vbuz1=vbuc1 lda #0 @@ -2036,15 +1959,14 @@ main: { sta.z printf_uchar.putc lda #>snputc sta.z printf_uchar.putc+1 - // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:main::@216->printf_uchar#3] -- vbuz1=vbuc1 - lda #DECIMAL - sta.z printf_uchar.format_radix + // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:main::@216->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL // [1207] phi printf_uchar::uvalue#14 = printf_uchar::uvalue#12 [phi:main::@216->printf_uchar#4] -- register_copy jsr printf_uchar - // [341] phi from main::@216 to main::@217 [phi:main::@216->main::@217] + // [339] phi from main::@216 to main::@217 [phi:main::@216->main::@217] // main::@217 // sprintf(info_text, "(%u) Please read carefully the below ...", w) - // [342] call printf_str + // [340] call printf_str // [1138] phi from main::@217 to printf_str [phi:main::@217->printf_str] // [1138] phi printf_str::putc#71 = &snputc [phi:main::@217->printf_str#0] -- pprz1=pprc1 lda #display_action_text] // [1218] phi display_action_text::info_text#19 = info_text [phi:main::@218->display_action_text#0] -- pbuz1=pbuc1 lda #<@info_text @@ -2077,199 +1999,200 @@ main: { jsr display_action_text // main::@219 // for (unsigned char w=240; w>0; w--) - // [347] main::w#1 = -- main::w#2 -- vbum1=_dec_vbum1 + // [345] main::w#1 = -- main::w#2 -- vbum1=_dec_vbum1 dec w - // [321] phi from main::@219 to main::@59 [phi:main::@219->main::@59] - // [321] phi main::w#2 = main::w#1 [phi:main::@219->main::@59#0] -- register_copy - jmp __b59 + // [319] phi from main::@219 to main::@58 [phi:main::@219->main::@58] + // [319] phi main::w#2 = main::w#1 [phi:main::@219->main::@58#0] -- register_copy + jmp __b58 // main::vera_display_set_border_color3 vera_display_set_border_color3: // *VERA_CTRL &= ~VERA_DCSEL - // [348] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [346] *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 - // [349] *VERA_DC_BORDER = YELLOW -- _deref_pbuc1=vbuc2 + // [347] *VERA_DC_BORDER = YELLOW -- _deref_pbuc1=vbuc2 lda #YELLOW sta VERA_DC_BORDER - // [350] phi from main::vera_display_set_border_color3 to main::@92 [phi:main::vera_display_set_border_color3->main::@92] + // [348] phi from main::vera_display_set_border_color3 to main::@92 [phi:main::vera_display_set_border_color3->main::@92] // main::@92 // display_action_progress("Update issues, your CX16 is not updated!") - // [351] call display_action_progress + // [349] call display_action_progress // [845] phi from main::@92 to display_action_progress [phi:main::@92->display_action_progress] - // [845] phi display_action_progress::info_text#19 = main::info_text40 [phi:main::@92->display_action_progress#0] -- pbuz1=pbuc1 - lda #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 __b10 + jmp __b9 // main::vera_display_set_border_color2 vera_display_set_border_color2: // *VERA_CTRL &= ~VERA_DCSEL - // [352] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [350] *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 - // [353] *VERA_DC_BORDER = RED -- _deref_pbuc1=vbuc2 + // [351] *VERA_DC_BORDER = RED -- _deref_pbuc1=vbuc2 lda #RED sta VERA_DC_BORDER - // [354] phi from main::vera_display_set_border_color2 to main::@90 [phi:main::vera_display_set_border_color2->main::@90] + // [352] phi from main::vera_display_set_border_color2 to main::@90 [phi:main::vera_display_set_border_color2->main::@90] // main::@90 // display_action_progress("Update Failure! Your CX16 may be bricked!") - // [355] call display_action_progress + // [353] call display_action_progress // [845] phi from main::@90 to display_action_progress [phi:main::@90->display_action_progress] - // [845] phi display_action_progress::info_text#19 = main::info_text38 [phi:main::@90->display_action_progress#0] -- pbuz1=pbuc1 - lda #display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text38 + lda #>info_text37 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [356] phi from main::@90 to main::@212 [phi:main::@90->main::@212] + // [354] phi from main::@90 to main::@212 [phi:main::@90->main::@212] // main::@212 // display_action_text("Take a foto of this screen, shut down power and retry!") - // [357] call display_action_text + // [355] call display_action_text // [1218] phi from main::@212 to display_action_text [phi:main::@212->display_action_text] - // [1218] phi display_action_text::info_text#19 = main::info_text39 [phi:main::@212->display_action_text#0] -- pbuz1=pbuc1 - lda #display_action_text#0] -- pbuz1=pbuc1 + lda #info_text39 + lda #>info_text38 sta.z display_action_text.info_text+1 jsr display_action_text - // [358] phi from main::@212 main::@62 to main::@62 [phi:main::@212/main::@62->main::@62] - // main::@62 - __b62: - jmp __b62 + // [356] phi from main::@212 main::@61 to main::@61 [phi:main::@212/main::@61->main::@61] + // main::@61 + __b61: + jmp __b61 // main::@243 __b243: // 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)) - // [359] if(0!=main::check_status_vera3_return#0) goto main::@242 -- 0_neq_vbuz1_then_la1 + // [357] if(0!=main::check_status_vera3_return#0) goto main::@242 -- 0_neq_vbuz1_then_la1 lda.z check_status_vera3_return bne __b242 // main::@254 - // [360] if(0==main::check_status_vera4_return#0) goto main::check_status_smc15 -- 0_eq_vbuz1_then_la1 - lda.z check_status_vera4_return + // [358] if(0==main::check_status_vera4_return#0) goto main::check_status_smc15 -- 0_eq_vbuyy_then_la1 + cpy #0 bne !check_status_smc15+ jmp check_status_smc15 !check_status_smc15: // main::@242 __b242: - // [361] if(0!=main::$88) goto main::vera_display_set_border_color1 -- 0_neq_vbum1_then_la1 - lda main__88 + // [359] if(0!=main::$87) goto main::vera_display_set_border_color1 -- 0_neq_vbuxx_then_la1 + cpx #0 bne vera_display_set_border_color1 jmp check_status_smc15 // main::vera_display_set_border_color1 vera_display_set_border_color1: // *VERA_CTRL &= ~VERA_DCSEL - // [362] *VERA_CTRL = *VERA_CTRL & ~VERA_DCSEL -- _deref_pbuc1=_deref_pbuc1_band_vbuc2 + // [360] *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 - // [363] *VERA_DC_BORDER = BLACK -- _deref_pbuc1=vbuc2 + // [361] *VERA_DC_BORDER = BLACK -- _deref_pbuc1=vbuc2 lda #BLACK sta VERA_DC_BORDER - // [364] phi from main::vera_display_set_border_color1 to main::@88 [phi:main::vera_display_set_border_color1->main::@88] + // [362] phi from main::vera_display_set_border_color1 to main::@88 [phi:main::vera_display_set_border_color1->main::@88] // main::@88 // display_action_progress("No CX16 component has been updated with new firmware!") - // [365] call display_action_progress + // [363] call display_action_progress // [845] phi from main::@88 to display_action_progress [phi:main::@88->display_action_progress] - // [845] phi display_action_progress::info_text#19 = main::info_text37 [phi:main::@88->display_action_progress#0] -- pbuz1=pbuc1 - lda #display_action_progress#0] -- pbuz1=pbuc1 + lda #info_text37 + lda #>info_text36 sta.z display_action_progress.info_text+1 jsr display_action_progress - jmp __b10 + jmp __b9 // main::@240 __b240: // 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)) - // [366] if(0!=main::$67) goto main::@4 -- 0_neq_vbum1_then_la1 - lda main__67 - beq !__b4+ - jmp __b4 - !__b4: + // [364] if(0!=main::$67) goto main::check_status_smc9 -- 0_neq_vbuz1_then_la1 + lda.z main__67 + beq !check_status_smc9+ + jmp check_status_smc9 + !check_status_smc9: // main::@239 - // [367] if(0==main::check_status_smc8_return#0) goto main::@238 -- 0_eq_vbuz1_then_la1 + // [365] if(0==main::check_status_smc8_return#0) goto main::@238 -- 0_eq_vbuz1_then_la1 lda.z check_status_smc8_return beq __b238 - jmp __b4 + jmp check_status_smc9 // main::@238 __b238: - // [368] if(0!=main::check_status_vera2_return#0) goto main::@4 -- 0_neq_vbum1_then_la1 + // [366] if(0!=main::check_status_vera2_return#0) goto main::check_status_smc9 -- 0_neq_vbum1_then_la1 lda check_status_vera2_return - beq !__b4+ - jmp __b4 - !__b4: + beq !check_status_smc9+ + jmp check_status_smc9 + !check_status_smc9: // main::@237 - // [369] if(0==main::$76) goto main::check_status_smc11 -- 0_eq_vbum1_then_la1 - lda main__76 + // [367] if(0==main::$76) goto main::check_status_smc11 -- 0_eq_vbuxx_then_la1 + cpx #0 beq check_status_smc11 - jmp __b4 + jmp check_status_smc9 // main::check_status_smc11 check_status_smc11: // status_smc == status - // [370] main::check_status_smc11_$0 = status_smc#0 == STATUS_FLASH -- vboz1=vbum2_eq_vbuc1 + // [368] main::check_status_smc11_$0 = status_smc#0 == STATUS_FLASH -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta.z check_status_smc11_main__0 // return (unsigned char)(status_smc == status); - // [371] main::check_status_smc11_return#0 = (char)main::check_status_smc11_$0 - // [372] phi from main::check_status_smc11 to main::check_status_cx16_rom5 [phi:main::check_status_smc11->main::check_status_cx16_rom5] + // [369] main::check_status_smc11_return#0 = (char)main::check_status_smc11_$0 -- vbuz1=vbuaa + sta.z check_status_smc11_return + // [370] phi from main::check_status_smc11 to main::check_status_cx16_rom5 [phi:main::check_status_smc11->main::check_status_cx16_rom5] // main::check_status_cx16_rom5 // main::check_status_cx16_rom5_check_status_rom1 // status_rom[rom_chip] == status - // [373] main::check_status_cx16_rom5_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vboz1=_deref_pbuc1_eq_vbuc2 + // [371] 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.z check_status_cx16_rom5_check_status_rom1_main__0 // return (unsigned char)(status_rom[rom_chip] == status); - // [374] main::check_status_cx16_rom5_check_status_rom1_return#0 = (char)main::check_status_cx16_rom5_check_status_rom1_$0 - // [375] phi from main::check_status_cx16_rom5_check_status_rom1 to main::@83 [phi:main::check_status_cx16_rom5_check_status_rom1->main::@83] + // [372] main::check_status_cx16_rom5_check_status_rom1_return#0 = (char)main::check_status_cx16_rom5_check_status_rom1_$0 -- vbuyy=vbuaa + tay + // [373] phi from main::check_status_cx16_rom5_check_status_rom1 to main::@83 [phi:main::check_status_cx16_rom5_check_status_rom1->main::@83] // main::@83 // check_status_card_roms(STATUS_FLASH) - // [376] call check_status_card_roms + // [374] call check_status_card_roms // [1241] 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) - // [377] check_status_card_roms::return#3 = check_status_card_roms::return#2 + // [375] check_status_card_roms::return#3 = check_status_card_roms::return#2 // main::@180 - // [378] main::$192 = check_status_card_roms::return#3 + // [376] main::$191 = check_status_card_roms::return#3 -- vbuxx=vbuaa + tax // if(check_status_smc(STATUS_FLASH) || check_status_cx16_rom(STATUS_FLASH) || check_status_card_roms(STATUS_FLASH)) - // [379] if(0!=main::check_status_smc11_return#0) goto main::@9 -- 0_neq_vbuz1_then_la1 + // [377] if(0!=main::check_status_smc11_return#0) goto main::@8 -- 0_neq_vbuz1_then_la1 lda.z check_status_smc11_return - beq !__b9+ - jmp __b9 - !__b9: + beq !__b8+ + jmp __b8 + !__b8: // main::@246 - // [380] if(0!=main::check_status_cx16_rom5_check_status_rom1_return#0) goto main::@9 -- 0_neq_vbuz1_then_la1 - lda.z check_status_cx16_rom5_check_status_rom1_return - beq !__b9+ - jmp __b9 - !__b9: + // [378] if(0!=main::check_status_cx16_rom5_check_status_rom1_return#0) goto main::@8 -- 0_neq_vbuyy_then_la1 + cpy #0 + beq !__b8+ + jmp __b8 + !__b8: // main::@245 - // [381] if(0!=main::$192) goto main::@9 -- 0_neq_vbuz1_then_la1 - lda.z main__192 - beq !__b9+ - jmp __b9 - !__b9: + // [379] if(0!=main::$191) goto main::@8 -- 0_neq_vbuxx_then_la1 + cpx #0 + beq !__b8+ + jmp __b8 + !__b8: // main::bank_set_bram2 bank_set_bram2: // BRAM = bank - // [382] BRAM = main::bank_set_bram2_bank#0 -- vbuz1=vbuc1 + // [380] BRAM = main::bank_set_bram2_bank#0 -- vbuz1=vbuc1 lda #bank_set_bram2_bank sta.z BRAM // main::SEI5 @@ -2278,49 +2201,49 @@ main: { sei // main::check_status_smc12 // status_smc == status - // [384] main::check_status_smc12_$0 = status_smc#0 == STATUS_FLASH -- vboz1=vbum2_eq_vbuc1 + // [382] main::check_status_smc12_$0 = status_smc#0 == STATUS_FLASH -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_FLASH beq !+ lda #1 !: eor #1 - sta.z check_status_smc12_main__0 // return (unsigned char)(status_smc == status); - // [385] main::check_status_smc12_return#0 = (char)main::check_status_smc12_$0 - // [386] phi from main::check_status_smc12 to main::check_status_cx16_rom6 [phi:main::check_status_smc12->main::check_status_cx16_rom6] + // [383] main::check_status_smc12_return#0 = (char)main::check_status_smc12_$0 -- vbuyy=vbuaa + tay + // [384] phi from main::check_status_smc12 to main::check_status_cx16_rom6 [phi:main::check_status_smc12->main::check_status_cx16_rom6] // main::check_status_cx16_rom6 // main::check_status_cx16_rom6_check_status_rom1 // status_rom[rom_chip] == status - // [387] main::check_status_cx16_rom6_check_status_rom1_$0 = *status_rom == STATUS_FLASH -- vboz1=_deref_pbuc1_eq_vbuc2 + // [385] 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); - // [388] main::check_status_cx16_rom6_check_status_rom1_return#0 = (char)main::check_status_cx16_rom6_check_status_rom1_$0 + // [386] main::check_status_cx16_rom6_check_status_rom1_return#0 = (char)main::check_status_cx16_rom6_check_status_rom1_$0 -- vbuxx=vbuaa + tax // main::@84 // if (check_status_smc(STATUS_FLASH) && check_status_cx16_rom(STATUS_FLASH)) - // [389] if(0==main::check_status_smc12_return#0) goto main::@43 -- 0_eq_vbuz1_then_la1 - lda.z check_status_smc12_return - beq __b43 + // [387] if(0==main::check_status_smc12_return#0) goto main::@41 -- 0_eq_vbuyy_then_la1 + cpy #0 + beq __b41 // main::@247 - // [390] if(0!=main::check_status_cx16_rom6_check_status_rom1_return#0) goto main::@54 -- 0_neq_vbuz1_then_la1 - lda.z check_status_cx16_rom6_check_status_rom1_return - beq !__b54+ - jmp __b54 - !__b54: - // [391] phi from main::@247 to main::@43 [phi:main::@247->main::@43] - // [391] phi from main::@188 main::@44 main::@45 main::@57 main::@84 to main::@43 [phi:main::@188/main::@44/main::@45/main::@57/main::@84->main::@43] - // [391] phi __errno#389 = __errno#18 [phi:main::@188/main::@44/main::@45/main::@57/main::@84->main::@43#0] -- register_copy - // main::@43 - __b43: - // [392] phi from main::@43 to main::@46 [phi:main::@43->main::@46] - // [392] phi __errno#118 = __errno#389 [phi:main::@43->main::@46#0] -- register_copy - // [392] phi main::rom_chip4#10 = 7 [phi:main::@43->main::@46#1] -- vbum1=vbuc1 + // [388] if(0!=main::check_status_cx16_rom6_check_status_rom1_return#0) goto main::@53 -- 0_neq_vbuxx_then_la1 + cpx #0 + beq !__b53+ + jmp __b53 + !__b53: + // [389] phi from main::@247 to main::@41 [phi:main::@247->main::@41] + // [389] phi from main::@188 main::@42 main::@43 main::@56 main::@84 to main::@41 [phi:main::@188/main::@42/main::@43/main::@56/main::@84->main::@41] + // [389] phi __errno#414 = __errno#18 [phi:main::@188/main::@42/main::@43/main::@56/main::@84->main::@41#0] -- register_copy + // main::@41 + __b41: + // [390] phi from main::@41 to main::@44 [phi:main::@41->main::@44] + // [390] phi __errno#118 = __errno#414 [phi:main::@41->main::@44#0] -- register_copy + // [390] phi main::rom_chip4#10 = 7 [phi:main::@41->main::@44#1] -- vbum1=vbuc1 lda #7 sta rom_chip4 // Flash the ROM chips. @@ -2329,18 +2252,24 @@ 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::@46 - __b46: + // main::@44 + __b44: // for(unsigned char rom_chip = 7; rom_chip != 255; rom_chip--) - // [393] if(main::rom_chip4#10!=$ff) goto main::check_status_rom1 -- vbum1_neq_vbuc1_then_la1 + // [391] if(main::rom_chip4#10!=$ff) goto main::check_status_rom1 -- vbum1_neq_vbuc1_then_la1 lda #$ff cmp rom_chip4 bne check_status_rom1 - jmp __b4 + // [392] phi from main::@44 to main::@45 [phi:main::@44->main::@45] + // main::@45 + // display_progress_clear() + // [393] call display_progress_clear + // [859] phi from main::@45 to display_progress_clear [phi:main::@45->display_progress_clear] + jsr display_progress_clear + jmp check_status_smc9 // main::check_status_rom1 check_status_rom1: // status_rom[rom_chip] == status - // [394] main::check_status_rom1_$0 = status_rom[main::rom_chip4#10] == STATUS_FLASH -- vbom1=pbuc1_derefidx_vbum2_eq_vbuc2 + // [394] main::check_status_rom1_$0 = status_rom[main::rom_chip4#10] == STATUS_FLASH -- vboaa=pbuc1_derefidx_vbum1_eq_vbuc2 lda #STATUS_FLASH ldy rom_chip4 eor status_rom,y @@ -2348,38 +2277,37 @@ main: { lda #1 !: eor #1 - sta check_status_rom1_main__0 // return (unsigned char)(status_rom[rom_chip] == status); // [395] main::check_status_rom1_return#0 = (char)main::check_status_rom1_$0 // main::@85 // if(check_status_rom(rom_chip, STATUS_FLASH)) - // [396] if(0==main::check_status_rom1_return#0) goto main::@47 -- 0_eq_vbum1_then_la1 - lda check_status_rom1_return - beq __b47 + // [396] if(0==main::check_status_rom1_return#0) goto main::@46 -- 0_eq_vbuaa_then_la1 + cmp #0 + beq __b46 // main::check_status_smc13 // status_smc == status - // [397] main::check_status_smc13_$0 = status_smc#0 == STATUS_FLASHED -- vboz1=vbum2_eq_vbuc1 + // [397] main::check_status_smc13_$0 = status_smc#0 == STATUS_FLASHED -- vboaa=vbum1_eq_vbuc1 lda status_smc eor #STATUS_FLASHED beq !+ lda #1 !: eor #1 - sta.z check_status_smc13_main__0 // return (unsigned char)(status_smc == status); - // [398] main::check_status_smc13_return#0 = (char)main::check_status_smc13_$0 + // [398] main::check_status_smc13_return#0 = (char)main::check_status_smc13_$0 -- vbuyy=vbuaa + tay // main::check_status_smc14 // status_smc == status - // [399] main::check_status_smc14_$0 = status_smc#0 == STATUS_SKIP -- vboz1=vbum2_eq_vbuc1 + // [399] main::check_status_smc14_$0 = status_smc#0 == 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); - // [400] main::check_status_smc14_return#0 = (char)main::check_status_smc14_$0 + // [400] main::check_status_smc14_return#0 = (char)main::check_status_smc14_$0 -- vbuxx=vbuaa + tax // main::@86 // if((rom_chip == 0 && (check_status_smc(STATUS_FLASHED) || check_status_smc(STATUS_SKIP))) || (rom_chip != 0)) // [401] if(main::rom_chip4#10==0) goto main::@249 -- vbum1_eq_0_then_la1 @@ -2393,33 +2321,33 @@ main: { // [402] if(main::rom_chip4#10!=0) goto main::bank_set_brom7 -- vbum1_neq_0_then_la1 lda rom_chip4 bne bank_set_brom7 - // main::@53 + // main::@52 // display_info_rom(rom_chip, STATUS_ISSUE, "Update SMC failed!") // [403] display_info_rom::rom_chip#10 = main::rom_chip4#10 -- vbuz1=vbum2 sta.z display_info_rom.rom_chip // [404] call display_info_rom - // [1250] phi from main::@53 to display_info_rom [phi:main::@53->display_info_rom] - // [1250] phi display_info_rom::info_text#16 = main::info_text32 [phi:main::@53->display_info_rom#0] -- pbuz1=pbuc1 + // [1250] phi from main::@52 to display_info_rom [phi:main::@52->display_info_rom] + // [1250] phi display_info_rom::info_text#16 = main::info_text32 [phi:main::@52->display_info_rom#0] -- pbuz1=pbuc1 lda #info_text32 sta.z display_info_rom.info_text+1 - // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#10 [phi:main::@53->display_info_rom#1] -- register_copy - // [1250] phi display_info_rom::info_status#16 = STATUS_ISSUE [phi:main::@53->display_info_rom#2] -- vbuz1=vbuc1 + // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#10 [phi:main::@52->display_info_rom#1] -- register_copy + // [1250] 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 - // [405] phi from main::@199 main::@210 main::@48 main::@52 main::@53 main::@85 to main::@47 [phi:main::@199/main::@210/main::@48/main::@52/main::@53/main::@85->main::@47] - // [405] phi __errno#390 = __errno#18 [phi:main::@199/main::@210/main::@48/main::@52/main::@53/main::@85->main::@47#0] -- register_copy - // main::@47 - __b47: + // [405] phi from main::@199 main::@210 main::@47 main::@51 main::@52 main::@85 to main::@46 [phi:main::@199/main::@210/main::@47/main::@51/main::@52/main::@85->main::@46] + // [405] phi __errno#415 = __errno#18 [phi:main::@199/main::@210/main::@47/main::@51/main::@52/main::@85->main::@46#0] -- register_copy + // main::@46 + __b46: // for(unsigned char rom_chip = 7; rom_chip != 255; rom_chip--) // [406] main::rom_chip4#1 = -- main::rom_chip4#10 -- vbum1=_dec_vbum1 dec rom_chip4 - // [392] phi from main::@47 to main::@46 [phi:main::@47->main::@46] - // [392] phi __errno#118 = __errno#390 [phi:main::@47->main::@46#0] -- register_copy - // [392] phi main::rom_chip4#10 = main::rom_chip4#1 [phi:main::@47->main::@46#1] -- register_copy - jmp __b46 + // [390] phi from main::@46 to main::@44 [phi:main::@46->main::@44] + // [390] phi __errno#118 = __errno#415 [phi:main::@46->main::@44#0] -- register_copy + // [390] phi main::rom_chip4#10 = main::rom_chip4#1 [phi:main::@46->main::@44#1] -- register_copy + jmp __b44 // main::bank_set_brom7 bank_set_brom7: // BROM = bank @@ -2443,9 +2371,8 @@ main: { asl sta rom_bank1 // unsigned char* file = rom_file(rom_chip) - // [411] rom_file::rom_chip#1 = main::rom_chip4#10 -- vbuz1=vbum2 + // [411] rom_file::rom_chip#1 = main::rom_chip4#10 -- vbuaa=vbum1 lda rom_chip4 - sta.z rom_file.rom_chip // [412] call rom_file // [1293] phi from main::@192 to rom_file [phi:main::@192->rom_file] // [1293] phi rom_file::rom_chip#2 = rom_file::rom_chip#1 [phi:main::@192->rom_file#0] -- register_copy @@ -2546,9 +2473,9 @@ main: { sta.z rom_read.file lda file1+1 sta.z rom_read.file+1 - // [428] rom_read::brom_bank_start#2 = main::rom_bank1#0 -- vbum1=vbum2 + // [428] rom_read::brom_bank_start#2 = main::rom_bank1#0 -- vbuz1=vbum2 lda rom_bank1 - sta rom_read.brom_bank_start + sta.z rom_read.brom_bank_start // [429] rom_read::rom_size#1 = rom_sizes[main::$288] -- vduz1=pduc1_derefidx_vbum2 ldy main__288 lda rom_sizes,y @@ -2574,21 +2501,21 @@ main: { // main::@199 // [432] main::rom_bytes_read1#0 = rom_read::return#3 // if(rom_bytes_read) - // [433] if(0==main::rom_bytes_read1#0) goto main::@47 -- 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 !__b47+ - jmp __b47 - !__b47: - // [434] phi from main::@199 to main::@50 [phi:main::@199->main::@50] - // main::@50 + // [433] if(0==main::rom_bytes_read1#0) goto main::@46 -- 0_eq_vduz1_then_la1 + lda.z rom_bytes_read1 + ora.z rom_bytes_read1+1 + ora.z rom_bytes_read1+2 + ora.z rom_bytes_read1+3 + bne !__b46+ + jmp __b46 + !__b46: + // [434] phi from main::@199 to main::@49 [phi:main::@199->main::@49] + // main::@49 // display_action_progress("Comparing ... (.) same, (*) different.") // [435] call display_action_progress // Now we compare the RAM with the actual ROM contents. - // [845] phi from main::@50 to display_action_progress [phi:main::@50->display_action_progress] - // [845] phi display_action_progress::info_text#19 = main::info_text33 [phi:main::@50->display_action_progress#0] -- pbuz1=pbuc1 + // [845] phi from main::@49 to display_action_progress [phi:main::@49->display_action_progress] + // [845] phi display_action_progress::info_text#19 = main::info_text33 [phi:main::@49->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text33 @@ -2607,9 +2534,9 @@ main: { lda #>info_text4 sta.z display_info_rom.info_text+1 // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#11 [phi:main::@200->display_info_rom#1] -- register_copy - // [1250] phi display_info_rom::info_status#16 = STATUS_COMPARING [phi:main::@200->display_info_rom#2] -- vbuz1=vbuc1 + // [1250] phi display_info_rom::info_status#16 = STATUS_COMPARING [phi:main::@200->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::@201 // unsigned long rom_differences = rom_verify( @@ -2617,9 +2544,8 @@ main: { // [438] rom_verify::rom_chip#0 = main::rom_chip4#10 -- vbuz1=vbum2 lda rom_chip4 sta.z rom_verify.rom_chip - // [439] rom_verify::rom_bank_start#0 = main::rom_bank1#0 -- vbum1=vbum2 - lda rom_bank1 - sta rom_verify.rom_bank_start + // [439] rom_verify::rom_bank_start#0 = main::rom_bank1#0 -- vbuxx=vbum1 + ldx rom_bank1 // [440] rom_verify::file_size#0 = file_sizes[main::$288] -- vdum1=pduc1_derefidx_vbum2 ldy main__288 lda file_sizes,y @@ -2645,20 +2571,20 @@ main: { lda.z rom_verify.return+3 sta.z rom_differences+3 // if (!rom_differences) - // [444] if(0==main::rom_differences#0) goto main::@48 -- 0_eq_vduz1_then_la1 + // [444] if(0==main::rom_differences#0) goto main::@47 -- 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 !__b48+ - jmp __b48 - !__b48: - // [445] phi from main::@202 to main::@51 [phi:main::@202->main::@51] - // main::@51 + bne !__b47+ + jmp __b47 + !__b47: + // [445] phi from main::@202 to main::@50 [phi:main::@202->main::@50] + // main::@50 // sprintf(info_text, "%05x differences!", rom_differences) // [446] call snprintf_init - // [1133] phi from main::@51 to snprintf_init [phi:main::@51->snprintf_init] - // [1133] phi snprintf_init::s#26 = info_text [phi:main::@51->snprintf_init#0] -- pbuz1=pbuc1 + // [1133] phi from main::@50 to snprintf_init [phi:main::@50->snprintf_init] + // [1133] phi snprintf_init::s#26 = info_text [phi:main::@50->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text @@ -2675,9 +2601,8 @@ main: { // [1454] phi printf_ulong::format_min_length#10 = 5 [phi:main::@203->printf_ulong#1] -- vbuz1=vbuc1 lda #5 sta.z printf_ulong.format_min_length - // [1454] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:main::@203->printf_ulong#2] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_ulong.format_radix + // [1454] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:main::@203->printf_ulong#2] -- vbuxx=vbuc1 + ldx #HEXADECIMAL // [1454] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#7 [phi:main::@203->printf_ulong#3] -- register_copy jsr printf_ulong // [449] phi from main::@203 to main::@204 [phi:main::@203->main::@204] @@ -2717,9 +2642,9 @@ main: { lda #>@info_text sta.z display_info_rom.info_text+1 // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#13 [phi:main::@205->display_info_rom#1] -- register_copy - // [1250] phi display_info_rom::info_status#16 = STATUS_FLASH [phi:main::@205->display_info_rom#2] -- vbuz1=vbuc1 + // [1250] phi display_info_rom::info_status#16 = STATUS_FLASH [phi:main::@205->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::@206 // unsigned long rom_flash_errors = rom_flash( @@ -2730,16 +2655,16 @@ main: { // [457] rom_flash::rom_bank_start#0 = main::rom_bank1#0 -- vbum1=vbum2 lda rom_bank1 sta rom_flash.rom_bank_start - // [458] rom_flash::file_size#0 = file_sizes[main::$288] -- vdum1=pduc1_derefidx_vbum2 + // [458] rom_flash::file_size#0 = file_sizes[main::$288] -- vduz1=pduc1_derefidx_vbum2 ldy main__288 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 + sta.z rom_flash.file_size+3 // [459] call rom_flash // [1464] phi from main::@206 to rom_flash [phi:main::@206->rom_flash] jsr rom_flash @@ -2747,48 +2672,47 @@ main: { // rom_chip, rom_bank, file_sizes[rom_chip]) // [460] rom_flash::return#2 = rom_flash::flash_errors#10 // main::@207 - // [461] main::rom_flash_errors#0 = rom_flash::return#2 -- vdum1=vdum2 - lda rom_flash.return - sta rom_flash_errors - lda rom_flash.return+1 - sta rom_flash_errors+1 - lda rom_flash.return+2 - sta rom_flash_errors+2 - lda rom_flash.return+3 - sta rom_flash_errors+3 + // [461] main::rom_flash_errors#0 = rom_flash::return#2 -- vduz1=vduz2 + lda.z rom_flash.return + sta.z rom_flash_errors + lda.z rom_flash.return+1 + sta.z rom_flash_errors+1 + lda.z rom_flash.return+2 + sta.z rom_flash_errors+2 + lda.z rom_flash.return+3 + sta.z rom_flash_errors+3 // if(rom_flash_errors) - // [462] if(0!=main::rom_flash_errors#0) goto main::@49 -- 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 __b49 - // main::@52 - // display_info_rom(rom_chip, STATUS_FLASHED, "OK!") + // [462] if(0!=main::rom_flash_errors#0) goto main::@48 -- 0_neq_vduz1_then_la1 + lda.z rom_flash_errors + ora.z rom_flash_errors+1 + ora.z rom_flash_errors+2 + ora.z rom_flash_errors+3 + bne __b48 + // main::@51 + // display_info_rom(rom_chip, STATUS_FLASHED, NULL) // [463] display_info_rom::rom_chip#15 = main::rom_chip4#10 -- vbuz1=vbum2 lda rom_chip4 sta.z display_info_rom.rom_chip // [464] call display_info_rom // RFL3 | Flash ROM and all ok - // [1250] phi from main::@52 to display_info_rom [phi:main::@52->display_info_rom] - // [1250] phi display_info_rom::info_text#16 = main::info_text36 [phi:main::@52->display_info_rom#0] -- pbuz1=pbuc1 - lda #display_info_rom] + // [1250] 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 - lda #>info_text36 sta.z display_info_rom.info_text+1 - // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#15 [phi:main::@52->display_info_rom#1] -- register_copy - // [1250] phi display_info_rom::info_status#16 = STATUS_FLASHED [phi:main::@52->display_info_rom#2] -- vbuz1=vbuc1 + // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#15 [phi:main::@51->display_info_rom#1] -- register_copy + // [1250] 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 __b47 - // [465] phi from main::@207 to main::@49 [phi:main::@207->main::@49] - // main::@49 - __b49: + jmp __b46 + // [465] phi from main::@207 to main::@48 [phi:main::@207->main::@48] + // main::@48 + __b48: // sprintf(info_text, "%u flash errors!", rom_flash_errors) // [466] call snprintf_init - // [1133] phi from main::@49 to snprintf_init [phi:main::@49->snprintf_init] - // [1133] phi snprintf_init::s#26 = info_text [phi:main::@49->snprintf_init#0] -- pbuz1=pbuc1 + // [1133] phi from main::@48 to snprintf_init [phi:main::@48->snprintf_init] + // [1133] phi snprintf_init::s#26 = info_text [phi:main::@48->snprintf_init#0] -- pbuz1=pbuc1 lda #<@info_text sta.z snprintf_init.s lda #>@info_text @@ -2796,14 +2720,14 @@ main: { jsr snprintf_init // main::@208 // sprintf(info_text, "%u flash errors!", rom_flash_errors) - // [467] printf_ulong::uvalue#8 = main::rom_flash_errors#0 -- vduz1=vdum2 - lda rom_flash_errors + // [467] printf_ulong::uvalue#8 = main::rom_flash_errors#0 -- vduz1=vduz2 + lda.z rom_flash_errors sta.z printf_ulong.uvalue - lda rom_flash_errors+1 + lda.z rom_flash_errors+1 sta.z printf_ulong.uvalue+1 - lda rom_flash_errors+2 + lda.z rom_flash_errors+2 sta.z printf_ulong.uvalue+2 - lda rom_flash_errors+3 + lda.z rom_flash_errors+3 sta.z printf_ulong.uvalue+3 // [468] call printf_ulong // [1454] phi from main::@208 to printf_ulong [phi:main::@208->printf_ulong] @@ -2812,9 +2736,8 @@ main: { sta.z printf_ulong.format_zero_padding // [1454] phi printf_ulong::format_min_length#10 = 0 [phi:main::@208->printf_ulong#1] -- vbuz1=vbuc1 sta.z printf_ulong.format_min_length - // [1454] phi printf_ulong::format_radix#10 = DECIMAL [phi:main::@208->printf_ulong#2] -- vbuz1=vbuc1 - lda #DECIMAL - sta.z printf_ulong.format_radix + // [1454] phi printf_ulong::format_radix#10 = DECIMAL [phi:main::@208->printf_ulong#2] -- vbuxx=vbuc1 + ldx #DECIMAL // [1454] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#8 [phi:main::@208->printf_ulong#3] -- register_copy jsr printf_ulong // [469] phi from main::@208 to main::@209 [phi:main::@208->main::@209] @@ -2854,59 +2777,59 @@ main: { lda #>@info_text sta.z display_info_rom.info_text+1 // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#14 [phi:main::@210->display_info_rom#1] -- register_copy - // [1250] phi display_info_rom::info_status#16 = STATUS_ERROR [phi:main::@210->display_info_rom#2] -- vbuz1=vbuc1 + // [1250] phi display_info_rom::info_status#16 = STATUS_ERROR [phi:main::@210->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 __b47 - // main::@48 - __b48: + jmp __b46 + // main::@47 + __b47: // display_info_rom(rom_chip, STATUS_SKIP, "No update required") // [476] display_info_rom::rom_chip#12 = main::rom_chip4#10 -- vbuz1=vbum2 lda rom_chip4 sta.z display_info_rom.rom_chip // [477] 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 - // [1250] phi from main::@48 to display_info_rom [phi:main::@48->display_info_rom] - // [1250] phi display_info_rom::info_text#16 = main::info_text35 [phi:main::@48->display_info_rom#0] -- pbuz1=pbuc1 + // [1250] phi from main::@47 to display_info_rom [phi:main::@47->display_info_rom] + // [1250] phi display_info_rom::info_text#16 = main::info_text35 [phi:main::@47->display_info_rom#0] -- pbuz1=pbuc1 lda #info_text35 sta.z display_info_rom.info_text+1 - // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#12 [phi:main::@48->display_info_rom#1] -- register_copy - // [1250] phi display_info_rom::info_status#16 = STATUS_SKIP [phi:main::@48->display_info_rom#2] -- vbuz1=vbuc1 + // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#12 [phi:main::@47->display_info_rom#1] -- register_copy + // [1250] 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 __b47 + jmp __b46 // main::@249 __b249: // if((rom_chip == 0 && (check_status_smc(STATUS_FLASHED) || check_status_smc(STATUS_SKIP))) || (rom_chip != 0)) - // [478] if(0!=main::check_status_smc13_return#0) goto main::bank_set_brom7 -- 0_neq_vbuz1_then_la1 - lda.z check_status_smc13_return + // [478] if(0!=main::check_status_smc13_return#0) goto main::bank_set_brom7 -- 0_neq_vbuyy_then_la1 + cpy #0 beq !bank_set_brom7+ jmp bank_set_brom7 !bank_set_brom7: // main::@255 - // [479] if(0!=main::check_status_smc14_return#0) goto main::bank_set_brom7 -- 0_neq_vbuz1_then_la1 - lda.z check_status_smc14_return + // [479] if(0!=main::check_status_smc14_return#0) goto main::bank_set_brom7 -- 0_neq_vbuxx_then_la1 + cpx #0 beq !bank_set_brom7+ jmp bank_set_brom7 !bank_set_brom7: jmp __b248 - // [480] phi from main::@247 to main::@54 [phi:main::@247->main::@54] - // main::@54 - __b54: + // [480] phi from main::@247 to main::@53 [phi:main::@247->main::@53] + // main::@53 + __b53: // display_action_progress("Reading SMC.BIN ... (.) data, ( ) empty") // [481] call display_action_progress - // [845] phi from main::@54 to display_action_progress [phi:main::@54->display_action_progress] - // [845] phi display_action_progress::info_text#19 = main::info_text26 [phi:main::@54->display_action_progress#0] -- pbuz1=pbuc1 + // [845] phi from main::@53 to display_action_progress [phi:main::@53->display_action_progress] + // [845] phi display_action_progress::info_text#19 = main::info_text26 [phi:main::@53->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text26 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [482] phi from main::@54 to main::@186 [phi:main::@54->main::@186] + // [482] phi from main::@53 to main::@186 [phi:main::@53->main::@186] // main::@186 // display_progress_clear() // [483] call display_progress_clear @@ -2918,9 +2841,9 @@ main: { // [485] call smc_read // [1067] phi from main::@187 to smc_read [phi:main::@187->smc_read] // [1067] phi __errno#35 = __errno#116 [phi:main::@187->smc_read#0] -- register_copy - // [1067] phi smc_read::info_status#2 = STATUS_READING [phi:main::@187->smc_read#1] -- vbum1=vbuc1 + // [1067] phi smc_read::info_status#2 = STATUS_READING [phi:main::@187->smc_read#1] -- vbuz1=vbuc1 lda #STATUS_READING - sta smc_read.info_status + sta.z smc_read.info_status jsr smc_read // smc_read(STATUS_READING) // [486] smc_read::return#3 = smc_read::return#0 @@ -2932,26 +2855,26 @@ main: { lda.z smc_read.return+1 sta smc_file_size_1+1 // if(smc_file_size) - // [488] if(0==smc_file_size#1) goto main::@43 -- 0_eq_vwum1_then_la1 + // [488] if(0==smc_file_size#1) goto main::@41 -- 0_eq_vwum1_then_la1 lda smc_file_size_1 ora smc_file_size_1+1 - bne !__b43+ - jmp __b43 - !__b43: - // [489] phi from main::@188 to main::@55 [phi:main::@188->main::@55] - // main::@55 + bne !__b41+ + jmp __b41 + !__b41: + // [489] phi from main::@188 to main::@54 [phi:main::@188->main::@54] + // main::@54 // display_action_text("Press both POWER/RESET buttons on the CX16 board!") // [490] call display_action_text // Flash the SMC chip. - // [1218] phi from main::@55 to display_action_text [phi:main::@55->display_action_text] - // [1218] phi display_action_text::info_text#19 = main::info_text27 [phi:main::@55->display_action_text#0] -- pbuz1=pbuc1 + // [1218] phi from main::@54 to display_action_text [phi:main::@54->display_action_text] + // [1218] phi display_action_text::info_text#19 = main::info_text27 [phi:main::@54->display_action_text#0] -- pbuz1=pbuc1 lda #info_text27 sta.z display_action_text.info_text+1 jsr display_action_text // main::@189 - // [491] smc_bootloader#437 = smc_bootloader#0 -- vwum1=vwum2 + // [491] smc_bootloader#422 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 @@ -2964,10 +2887,10 @@ main: { sta.z display_info_smc.info_text lda #>info_text28 sta.z display_info_smc.info_text+1 - // [903] phi smc_bootloader#13 = smc_bootloader#437 [phi:main::@189->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_FLASHING [phi:main::@189->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#422 [phi:main::@189->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = STATUS_FLASHING [phi:main::@189->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::@190 // unsigned int flashed_bytes = smc_flash(smc_file_size) @@ -2984,22 +2907,22 @@ main: { // main::@191 // [496] main::flashed_bytes#0 = smc_flash::return#5 // if(flashed_bytes) - // [497] if(0!=main::flashed_bytes#0) goto main::@44 -- 0_neq_vwum1_then_la1 + // [497] if(0!=main::flashed_bytes#0) goto main::@42 -- 0_neq_vwum1_then_la1 lda flashed_bytes ora flashed_bytes+1 - bne __b44 - // main::@56 + bne __b42 + // main::@55 // if(flashed_bytes == (unsigned int)0xFFFF) - // [498] if(main::flashed_bytes#0==$ffff) goto main::@45 -- vwum1_eq_vwuc1_then_la1 + // [498] 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 __b45 + beq __b43 !: - // main::@57 - // [499] smc_bootloader#443 = smc_bootloader#0 -- vwum1=vwum2 + // main::@56 + // [499] smc_bootloader#428 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 @@ -3007,21 +2930,21 @@ main: { // display_info_smc(STATUS_ISSUE, "POWER/RESET not pressed!") // [500] call display_info_smc // SFL2 | no action on POWER/RESET press request - // [903] phi from main::@57 to display_info_smc [phi:main::@57->display_info_smc] - // [903] phi display_info_smc::info_text#18 = main::info_text31 [phi:main::@57->display_info_smc#0] -- pbuz1=pbuc1 + // [903] phi from main::@56 to display_info_smc [phi:main::@56->display_info_smc] + // [903] phi display_info_smc::info_text#18 = main::info_text31 [phi:main::@56->display_info_smc#0] -- pbuz1=pbuc1 lda #info_text31 sta.z display_info_smc.info_text+1 - // [903] phi smc_bootloader#13 = smc_bootloader#443 [phi:main::@57->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_ISSUE [phi:main::@57->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#428 [phi:main::@56->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = STATUS_ISSUE [phi:main::@56->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 __b43 - // main::@45 - __b45: - // [501] smc_bootloader#442 = smc_bootloader#0 -- vwum1=vwum2 + jmp __b41 + // main::@43 + __b43: + // [501] smc_bootloader#427 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 @@ -3029,21 +2952,21 @@ main: { // display_info_smc(STATUS_ERROR, "SMC has errors!") // [502] call display_info_smc // SFL3 | errors during flash - // [903] phi from main::@45 to display_info_smc [phi:main::@45->display_info_smc] - // [903] phi display_info_smc::info_text#18 = main::info_text30 [phi:main::@45->display_info_smc#0] -- pbuz1=pbuc1 + // [903] phi from main::@43 to display_info_smc [phi:main::@43->display_info_smc] + // [903] phi display_info_smc::info_text#18 = main::info_text30 [phi:main::@43->display_info_smc#0] -- pbuz1=pbuc1 lda #info_text30 sta.z display_info_smc.info_text+1 - // [903] phi smc_bootloader#13 = smc_bootloader#442 [phi:main::@45->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_ERROR [phi:main::@45->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#427 [phi:main::@43->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = 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 __b43 - // main::@44 - __b44: - // [503] smc_bootloader#441 = smc_bootloader#0 -- vwum1=vwum2 + jmp __b41 + // main::@42 + __b42: + // [503] smc_bootloader#426 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 @@ -3051,31 +2974,31 @@ main: { // display_info_smc(STATUS_FLASHED, "") // [504] call display_info_smc // SFL1 | and POWER/RESET pressed - // [903] phi from main::@44 to display_info_smc [phi:main::@44->display_info_smc] - // [903] phi display_info_smc::info_text#18 = info_text4 [phi:main::@44->display_info_smc#0] -- pbuz1=pbuc1 + // [903] phi from main::@42 to display_info_smc [phi:main::@42->display_info_smc] + // [903] phi display_info_smc::info_text#18 = info_text4 [phi:main::@42->display_info_smc#0] -- pbuz1=pbuc1 lda #info_text4 sta.z display_info_smc.info_text+1 - // [903] phi smc_bootloader#13 = smc_bootloader#441 [phi:main::@44->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_FLASHED [phi:main::@44->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#426 [phi:main::@42->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = 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 __b43 - // [505] phi from main::@180 main::@245 main::@246 to main::@9 [phi:main::@180/main::@245/main::@246->main::@9] - // main::@9 - __b9: + jmp __b41 + // [505] phi from main::@180 main::@245 main::@246 to main::@8 [phi:main::@180/main::@245/main::@246->main::@8] + // main::@8 + __b8: // display_action_progress("Chipsets have been detected and update files validated!") // [506] call display_action_progress - // [845] phi from main::@9 to display_action_progress [phi:main::@9->display_action_progress] - // [845] phi display_action_progress::info_text#19 = main::info_text20 [phi:main::@9->display_action_progress#0] -- pbuz1=pbuc1 + // [845] phi from main::@8 to display_action_progress [phi:main::@8->display_action_progress] + // [845] phi display_action_progress::info_text#19 = main::info_text20 [phi:main::@8->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text20 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [507] phi from main::@9 to main::@181 [phi:main::@9->main::@181] + // [507] phi from main::@8 to main::@181 [phi:main::@8->main::@181] // main::@181 // unsigned char ch = util_wait_key("Continue with update of highlighted chipsets? [Y/N]", "nyNY") // [508] call util_wait_key @@ -3092,13 +3015,13 @@ main: { 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") - // [509] util_wait_key::return#4 = util_wait_key::ch#4 -- vbum1=vwum2 + // [509] util_wait_key::return#4 = util_wait_key::ch#4 -- vbuaa=vwum1 lda util_wait_key.ch - sta util_wait_key.return_1 // main::@182 // [510] main::ch1#0 = util_wait_key::return#4 // strchr("nN", ch) - // [511] strchr::c#1 = main::ch1#0 + // [511] strchr::c#1 = main::ch1#0 -- vbuz1=vbuaa + sta.z strchr.c // [512] call strchr // [1765] phi from main::@182 to strchr [phi:main::@182->strchr] // [1765] phi strchr::c#4 = strchr::c#1 [phi:main::@182->strchr#0] -- register_copy @@ -3111,20 +3034,20 @@ main: { // strchr("nN", ch) // [513] strchr::return#4 = strchr::return#2 // main::@183 - // [514] main::$197 = strchr::return#4 + // [514] main::$196 = strchr::return#4 // if(strchr("nN", ch)) - // [515] if((void *)0==main::$197) goto main::bank_set_bram2 -- pvoc1_eq_pvoz1_then_la1 - lda.z main__197 + // [515] if((void *)0==main::$196) goto main::bank_set_bram2 -- pvoc1_eq_pvoz1_then_la1 + lda.z main__196 cmp #<0 bne !+ - lda.z main__197+1 + lda.z main__196+1 cmp #>0 bne !bank_set_bram2+ jmp bank_set_bram2 !bank_set_bram2: !: - // main::@10 - // [516] smc_bootloader#431 = smc_bootloader#0 -- vwum1=vwum2 + // main::@9 + // [516] smc_bootloader#416 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 @@ -3132,18 +3055,18 @@ main: { // display_info_smc(STATUS_SKIP, "Cancelled") // [517] call display_info_smc // We cancel all updates, the updates are skipped. - // [903] phi from main::@10 to display_info_smc [phi:main::@10->display_info_smc] - // [903] phi display_info_smc::info_text#18 = main::info_text22 [phi:main::@10->display_info_smc#0] -- pbuz1=pbuc1 + // [903] phi from main::@9 to display_info_smc [phi:main::@9->display_info_smc] + // [903] phi display_info_smc::info_text#18 = main::info_text22 [phi:main::@9->display_info_smc#0] -- pbuz1=pbuc1 lda #info_text22 sta.z display_info_smc.info_text+1 - // [903] phi smc_bootloader#13 = smc_bootloader#431 [phi:main::@10->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_SKIP [phi:main::@10->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#416 [phi:main::@9->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = STATUS_SKIP [phi:main::@9->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 - // [518] phi from main::@10 to main::@184 [phi:main::@10->main::@184] + // [518] phi from main::@9 to main::@184 [phi:main::@9->main::@184] // main::@184 // display_info_vera(STATUS_SKIP, "Cancelled") // [519] call display_info_vera @@ -3157,89 +3080,89 @@ main: { lda #STATUS_SKIP sta.z display_info_vera.info_status jsr display_info_vera - // [520] phi from main::@184 to main::@40 [phi:main::@184->main::@40] - // [520] phi main::rom_chip3#2 = 0 [phi:main::@184->main::@40#0] -- vbum1=vbuc1 + // [520] phi from main::@184 to main::@38 [phi:main::@184->main::@38] + // [520] phi main::rom_chip3#2 = 0 [phi:main::@184->main::@38#0] -- vbum1=vbuc1 lda #0 sta rom_chip3 - // main::@40 - __b40: + // main::@38 + __b38: // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [521] if(main::rom_chip3#2<8) goto main::@41 -- vbum1_lt_vbuc1_then_la1 + // [521] if(main::rom_chip3#2<8) goto main::@39 -- vbum1_lt_vbuc1_then_la1 lda rom_chip3 cmp #8 - bcc __b41 - // [522] phi from main::@40 to main::@42 [phi:main::@40->main::@42] - // main::@42 + bcc __b39 + // [522] phi from main::@38 to main::@40 [phi:main::@38->main::@40] + // main::@40 // display_action_text("You have selected not to cancel the update ... ") // [523] call display_action_text - // [1218] phi from main::@42 to display_action_text [phi:main::@42->display_action_text] - // [1218] phi display_action_text::info_text#19 = main::info_text25 [phi:main::@42->display_action_text#0] -- pbuz1=pbuc1 + // [1218] phi from main::@40 to display_action_text [phi:main::@40->display_action_text] + // [1218] phi display_action_text::info_text#19 = main::info_text25 [phi:main::@40->display_action_text#0] -- pbuz1=pbuc1 lda #info_text25 sta.z display_action_text.info_text+1 jsr display_action_text jmp bank_set_bram2 - // main::@41 - __b41: + // main::@39 + __b39: // display_info_rom(rom_chip, STATUS_SKIP, "Cancelled") // [524] display_info_rom::rom_chip#9 = main::rom_chip3#2 -- vbuz1=vbum2 lda rom_chip3 sta.z display_info_rom.rom_chip // [525] call display_info_rom - // [1250] phi from main::@41 to display_info_rom [phi:main::@41->display_info_rom] - // [1250] phi display_info_rom::info_text#16 = main::info_text22 [phi:main::@41->display_info_rom#0] -- pbuz1=pbuc1 + // [1250] phi from main::@39 to display_info_rom [phi:main::@39->display_info_rom] + // [1250] phi display_info_rom::info_text#16 = main::info_text22 [phi:main::@39->display_info_rom#0] -- pbuz1=pbuc1 lda #info_text22 sta.z display_info_rom.info_text+1 - // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#9 [phi:main::@41->display_info_rom#1] -- register_copy - // [1250] phi display_info_rom::info_status#16 = STATUS_SKIP [phi:main::@41->display_info_rom#2] -- vbuz1=vbuc1 + // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#9 [phi:main::@39->display_info_rom#1] -- register_copy + // [1250] phi display_info_rom::info_status#16 = STATUS_SKIP [phi:main::@39->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::@185 // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) // [526] main::rom_chip3#1 = ++ main::rom_chip3#2 -- vbum1=_inc_vbum1 inc rom_chip3 - // [520] phi from main::@185 to main::@40 [phi:main::@185->main::@40] - // [520] phi main::rom_chip3#2 = main::rom_chip3#1 [phi:main::@185->main::@40#0] -- register_copy - jmp __b40 + // [520] phi from main::@185 to main::@38 [phi:main::@185->main::@38] + // [520] phi main::rom_chip3#2 = main::rom_chip3#1 [phi:main::@185->main::@38#0] -- register_copy + jmp __b38 // main::@235 __b235: // if(check_status_smc(STATUS_FLASH) && smc_release == smc_file_release && smc_major == smc_file_major && smc_minor == smc_file_minor) - // [527] if(smc_major#362!=smc_file_major#277) goto main::check_status_smc7 -- vbum1_neq_vbum2_then_la1 + // [527] if(smc_major#339!=smc_file_major#276) goto main::check_status_smc7 -- vbum1_neq_vbum2_then_la1 lda smc_major cmp smc_file_major beq !check_status_smc7+ jmp check_status_smc7 !check_status_smc7: // main::@234 - // [528] if(smc_minor#361==smc_file_minor#277) goto main::@8 -- vbum1_eq_vbum2_then_la1 + // [528] if(smc_minor#338==smc_file_minor#276) goto main::@7 -- vbum1_eq_vbum2_then_la1 lda smc_minor cmp smc_file_minor - beq __b8 + beq __b7 jmp check_status_smc7 - // [529] phi from main::@234 to main::@8 [phi:main::@234->main::@8] - // main::@8 - __b8: + // [529] phi from main::@234 to main::@7 [phi:main::@234->main::@7] + // main::@7 + __b7: // display_action_progress("The SMC chip and SMC.BIN versions are equal, no flash required!") // [530] call display_action_progress - // [845] phi from main::@8 to display_action_progress [phi:main::@8->display_action_progress] - // [845] phi display_action_progress::info_text#19 = main::info_text18 [phi:main::@8->display_action_progress#0] -- pbuz1=pbuc1 + // [845] phi from main::@7 to display_action_progress [phi:main::@7->display_action_progress] + // [845] phi display_action_progress::info_text#19 = main::info_text18 [phi:main::@7->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text18 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [531] phi from main::@8 to main::@177 [phi:main::@8->main::@177] + // [531] phi from main::@7 to main::@177 [phi:main::@7->main::@177] // main::@177 // util_wait_space() // [532] call util_wait_space - // [1064] phi from main::@177 to util_wait_space [phi:main::@177->util_wait_space] + // [973] phi from main::@177 to util_wait_space [phi:main::@177->util_wait_space] jsr util_wait_space // main::@178 - // [533] smc_bootloader#436 = smc_bootloader#0 -- vwum1=vwum2 + // [533] smc_bootloader#421 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 @@ -3252,35 +3175,35 @@ main: { sta.z display_info_smc.info_text lda #>info_text19 sta.z display_info_smc.info_text+1 - // [903] phi smc_bootloader#13 = smc_bootloader#436 [phi:main::@178->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_SKIP [phi:main::@178->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#421 [phi:main::@178->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = STATUS_SKIP [phi:main::@178->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_smc7 - // [535] phi from main::@232 to main::@6 [phi:main::@232->main::@6] - // main::@6 - __b6: + // [535] phi from main::@232 to main::@5 [phi:main::@232->main::@5] + // main::@5 + __b5: // display_action_progress("The ROM.BIN isn't compatible with SMC.BIN, no flash allowed!") // [536] call display_action_progress - // [845] phi from main::@6 to display_action_progress [phi:main::@6->display_action_progress] - // [845] phi display_action_progress::info_text#19 = main::info_text16 [phi:main::@6->display_action_progress#0] -- pbuz1=pbuc1 + // [845] phi from main::@5 to display_action_progress [phi:main::@5->display_action_progress] + // [845] phi display_action_progress::info_text#19 = main::info_text16 [phi:main::@5->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text16 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [537] phi from main::@6 to main::@171 [phi:main::@6->main::@171] + // [537] phi from main::@5 to main::@171 [phi:main::@5->main::@171] // main::@171 // display_progress_text(display_smc_unsupported_rom_text, display_smc_unsupported_rom_count) // [538] call display_progress_text - // [1054] phi from main::@171 to display_progress_text [phi:main::@171->display_progress_text] - // [1054] phi display_progress_text::text#12 = display_smc_unsupported_rom_text [phi:main::@171->display_progress_text#0] -- qbuz1=qbuc1 + // [963] phi from main::@171 to display_progress_text [phi:main::@171->display_progress_text] + // [963] phi display_progress_text::text#12 = display_smc_unsupported_rom_text [phi:main::@171->display_progress_text#0] -- qbuz1=qbuc1 lda #display_smc_unsupported_rom_text sta.z display_progress_text.text+1 - // [1054] phi display_progress_text::lines#11 = display_smc_unsupported_rom_count [phi:main::@171->display_progress_text#1] -- vbuz1=vbuc1 + // [963] phi display_progress_text::lines#11 = display_smc_unsupported_rom_count [phi:main::@171->display_progress_text#1] -- vbuz1=vbuc1 lda #display_smc_unsupported_rom_count sta.z display_progress_text.lines jsr display_progress_text @@ -3301,20 +3224,18 @@ main: { sta.z util_wait_key.info_text+1 jsr util_wait_key // unsigned char ch = util_wait_key("You still want to continue with flashing? [YN]", "YN") - // [541] util_wait_key::return#3 = util_wait_key::ch#4 -- vbum1=vwum2 + // [541] util_wait_key::return#3 = util_wait_key::ch#4 -- vbuaa=vwum1 lda util_wait_key.ch - sta util_wait_key.return // main::@173 // [542] main::ch#0 = util_wait_key::return#3 // if(ch == 'N') - // [543] if(main::ch#0!='N') goto main::check_status_smc6 -- vbum1_neq_vbuc1_then_la1 - lda #'N' - cmp ch + // [543] if(main::ch#0!='N') goto main::check_status_smc6 -- vbuaa_neq_vbuc1_then_la1 + cmp #'N' beq !check_status_smc6+ jmp check_status_smc6 !check_status_smc6: - // main::@7 - // [544] smc_bootloader#428 = smc_bootloader#0 -- vwum1=vwum2 + // main::@6 + // [544] smc_bootloader#413 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 @@ -3322,17 +3243,17 @@ main: { // display_info_smc(STATUS_ISSUE, NULL) // [545] call display_info_smc // Cancel flash - // [903] phi from main::@7 to display_info_smc [phi:main::@7->display_info_smc] - // [903] phi display_info_smc::info_text#18 = 0 [phi:main::@7->display_info_smc#0] -- pbuz1=vbuc1 + // [903] phi from main::@6 to display_info_smc [phi:main::@6->display_info_smc] + // [903] phi display_info_smc::info_text#18 = 0 [phi:main::@6->display_info_smc#0] -- pbuz1=vbuc1 lda #<0 sta.z display_info_smc.info_text sta.z display_info_smc.info_text+1 - // [903] phi smc_bootloader#13 = smc_bootloader#428 [phi:main::@7->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_ISSUE [phi:main::@7->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#413 [phi:main::@6->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = STATUS_ISSUE [phi:main::@6->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 - // [546] phi from main::@7 to main::@174 [phi:main::@7->main::@174] + // [546] phi from main::@6 to main::@174 [phi:main::@6->main::@174] // main::@174 // display_info_cx16_rom(STATUS_ISSUE, NULL) // [547] call display_info_cx16_rom @@ -3341,39 +3262,38 @@ main: { lda #<0 sta.z display_info_cx16_rom.info_text sta.z display_info_cx16_rom.info_text+1 - // [1774] phi display_info_cx16_rom::info_status#4 = STATUS_ISSUE [phi:main::@174->display_info_cx16_rom#1] -- vbuz1=vbuc1 - lda #STATUS_ISSUE - sta.z display_info_cx16_rom.info_status + // [1774] phi display_info_cx16_rom::info_status#4 = STATUS_ISSUE [phi:main::@174->display_info_cx16_rom#1] -- vbuxx=vbuc1 + ldx #STATUS_ISSUE jsr display_info_cx16_rom jmp check_status_smc6 - // [548] phi from main::@231 to main::@5 [phi:main::@231->main::@5] - // main::@5 - __b5: + // [548] phi from main::@231 to main::@4 [phi:main::@231->main::@4] + // main::@4 + __b4: // display_action_progress("CX16 ROM update issue!") // [549] call display_action_progress - // [845] phi from main::@5 to display_action_progress [phi:main::@5->display_action_progress] - // [845] phi display_action_progress::info_text#19 = main::info_text14 [phi:main::@5->display_action_progress#0] -- pbuz1=pbuc1 + // [845] phi from main::@4 to display_action_progress [phi:main::@4->display_action_progress] + // [845] phi display_action_progress::info_text#19 = main::info_text14 [phi:main::@4->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text14 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [550] phi from main::@5 to main::@166 [phi:main::@5->main::@166] + // [550] phi from main::@4 to main::@166 [phi:main::@4->main::@166] // main::@166 // display_progress_text(display_smc_rom_issue_text, display_smc_rom_issue_count) // [551] call display_progress_text - // [1054] phi from main::@166 to display_progress_text [phi:main::@166->display_progress_text] - // [1054] phi display_progress_text::text#12 = display_smc_rom_issue_text [phi:main::@166->display_progress_text#0] -- qbuz1=qbuc1 + // [963] phi from main::@166 to display_progress_text [phi:main::@166->display_progress_text] + // [963] phi display_progress_text::text#12 = display_smc_rom_issue_text [phi:main::@166->display_progress_text#0] -- qbuz1=qbuc1 lda #display_smc_rom_issue_text sta.z display_progress_text.text+1 - // [1054] phi display_progress_text::lines#11 = display_smc_rom_issue_count [phi:main::@166->display_progress_text#1] -- vbuz1=vbuc1 + // [963] phi display_progress_text::lines#11 = display_smc_rom_issue_count [phi:main::@166->display_progress_text#1] -- vbuz1=vbuc1 lda #display_smc_rom_issue_count sta.z display_progress_text.lines jsr display_progress_text // main::@167 - // [552] smc_bootloader#435 = smc_bootloader#0 -- vwum1=vwum2 + // [552] smc_bootloader#420 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 @@ -3386,10 +3306,10 @@ main: { sta.z display_info_smc.info_text lda #>info_text12 sta.z display_info_smc.info_text+1 - // [903] phi smc_bootloader#13 = smc_bootloader#435 [phi:main::@167->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_SKIP [phi:main::@167->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#420 [phi:main::@167->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = STATUS_SKIP [phi:main::@167->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 // [554] phi from main::@167 to main::@168 [phi:main::@167->main::@168] // main::@168 @@ -3400,15 +3320,14 @@ main: { lda #<0 sta.z display_info_cx16_rom.info_text sta.z display_info_cx16_rom.info_text+1 - // [1774] phi display_info_cx16_rom::info_status#4 = STATUS_ISSUE [phi:main::@168->display_info_cx16_rom#1] -- vbuz1=vbuc1 - lda #STATUS_ISSUE - sta.z display_info_cx16_rom.info_status + // [1774] phi display_info_cx16_rom::info_status#4 = STATUS_ISSUE [phi:main::@168->display_info_cx16_rom#1] -- vbuxx=vbuc1 + ldx #STATUS_ISSUE jsr display_info_cx16_rom // [556] phi from main::@168 to main::@169 [phi:main::@168->main::@169] // main::@169 // util_wait_space() // [557] call util_wait_space - // [1064] phi from main::@169 to util_wait_space [phi:main::@169->util_wait_space] + // [973] phi from main::@169 to util_wait_space [phi:main::@169->util_wait_space] jsr util_wait_space jmp check_status_smc5 // [558] phi from main::@230 to main::@3 [phi:main::@230->main::@3] @@ -3427,18 +3346,18 @@ main: { // main::@162 // display_progress_text(display_smc_rom_issue_text, display_smc_rom_issue_count) // [561] call display_progress_text - // [1054] phi from main::@162 to display_progress_text [phi:main::@162->display_progress_text] - // [1054] phi display_progress_text::text#12 = display_smc_rom_issue_text [phi:main::@162->display_progress_text#0] -- qbuz1=qbuc1 + // [963] phi from main::@162 to display_progress_text [phi:main::@162->display_progress_text] + // [963] phi display_progress_text::text#12 = display_smc_rom_issue_text [phi:main::@162->display_progress_text#0] -- qbuz1=qbuc1 lda #display_smc_rom_issue_text sta.z display_progress_text.text+1 - // [1054] phi display_progress_text::lines#11 = display_smc_rom_issue_count [phi:main::@162->display_progress_text#1] -- vbuz1=vbuc1 + // [963] phi display_progress_text::lines#11 = display_smc_rom_issue_count [phi:main::@162->display_progress_text#1] -- vbuz1=vbuc1 lda #display_smc_rom_issue_count sta.z display_progress_text.lines jsr display_progress_text // main::@163 - // [562] smc_bootloader#434 = smc_bootloader#0 -- vwum1=vwum2 + // [562] smc_bootloader#419 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 @@ -3451,10 +3370,10 @@ main: { sta.z display_info_smc.info_text lda #>info_text12 sta.z display_info_smc.info_text+1 - // [903] phi smc_bootloader#13 = smc_bootloader#434 [phi:main::@163->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_SKIP [phi:main::@163->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#419 [phi:main::@163->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = STATUS_SKIP [phi:main::@163->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::@163 to main::@164 [phi:main::@163->main::@164] // main::@164 @@ -3466,40 +3385,39 @@ main: { sta.z display_info_cx16_rom.info_text lda #>info_text13 sta.z display_info_cx16_rom.info_text+1 - // [1774] phi display_info_cx16_rom::info_status#4 = STATUS_ISSUE [phi:main::@164->display_info_cx16_rom#1] -- vbuz1=vbuc1 - lda #STATUS_ISSUE - sta.z display_info_cx16_rom.info_status + // [1774] phi display_info_cx16_rom::info_status#4 = STATUS_ISSUE [phi:main::@164->display_info_cx16_rom#1] -- vbuxx=vbuc1 + ldx #STATUS_ISSUE jsr display_info_cx16_rom // [566] phi from main::@164 to main::@165 [phi:main::@164->main::@165] // main::@165 // util_wait_space() // [567] call util_wait_space - // [1064] phi from main::@165 to util_wait_space [phi:main::@165->util_wait_space] + // [973] phi from main::@165 to util_wait_space [phi:main::@165->util_wait_space] jsr util_wait_space jmp check_status_smc5 - // [568] phi from main::@229 to main::@39 [phi:main::@229->main::@39] - // main::@39 - __b39: + // [568] phi from main::@229 to main::@37 [phi:main::@229->main::@37] + // main::@37 + __b37: // display_action_progress("SMC update issue!") // [569] call display_action_progress - // [845] phi from main::@39 to display_action_progress [phi:main::@39->display_action_progress] - // [845] phi display_action_progress::info_text#19 = main::info_text9 [phi:main::@39->display_action_progress#0] -- pbuz1=pbuc1 + // [845] phi from main::@37 to display_action_progress [phi:main::@37->display_action_progress] + // [845] phi display_action_progress::info_text#19 = main::info_text9 [phi:main::@37->display_action_progress#0] -- pbuz1=pbuc1 lda #info_text9 sta.z display_action_progress.info_text+1 jsr display_action_progress - // [570] phi from main::@39 to main::@158 [phi:main::@39->main::@158] + // [570] phi from main::@37 to main::@158 [phi:main::@37->main::@158] // main::@158 // display_progress_text(display_smc_rom_issue_text, display_smc_rom_issue_count) // [571] call display_progress_text - // [1054] phi from main::@158 to display_progress_text [phi:main::@158->display_progress_text] - // [1054] phi display_progress_text::text#12 = display_smc_rom_issue_text [phi:main::@158->display_progress_text#0] -- qbuz1=qbuc1 + // [963] phi from main::@158 to display_progress_text [phi:main::@158->display_progress_text] + // [963] phi display_progress_text::text#12 = display_smc_rom_issue_text [phi:main::@158->display_progress_text#0] -- qbuz1=qbuc1 lda #display_smc_rom_issue_text sta.z display_progress_text.text+1 - // [1054] phi display_progress_text::lines#11 = display_smc_rom_issue_count [phi:main::@158->display_progress_text#1] -- vbuz1=vbuc1 + // [963] phi display_progress_text::lines#11 = display_smc_rom_issue_count [phi:main::@158->display_progress_text#1] -- vbuz1=vbuc1 lda #display_smc_rom_issue_count sta.z display_progress_text.lines jsr display_progress_text @@ -3513,12 +3431,11 @@ main: { sta.z display_info_cx16_rom.info_text lda #>info_text10 sta.z display_info_cx16_rom.info_text+1 - // [1774] phi display_info_cx16_rom::info_status#4 = STATUS_SKIP [phi:main::@159->display_info_cx16_rom#1] -- vbuz1=vbuc1 - lda #STATUS_SKIP - sta.z display_info_cx16_rom.info_status + // [1774] phi display_info_cx16_rom::info_status#4 = STATUS_SKIP [phi:main::@159->display_info_cx16_rom#1] -- vbuxx=vbuc1 + ldx #STATUS_SKIP jsr display_info_cx16_rom // main::@160 - // [574] smc_bootloader#433 = smc_bootloader#0 -- vwum1=vwum2 + // [574] smc_bootloader#418 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 @@ -3530,16 +3447,16 @@ main: { lda #<0 sta.z display_info_smc.info_text sta.z display_info_smc.info_text+1 - // [903] phi smc_bootloader#13 = smc_bootloader#433 [phi:main::@160->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_ISSUE [phi:main::@160->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#418 [phi:main::@160->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = STATUS_ISSUE [phi:main::@160->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 // [576] phi from main::@160 to main::@161 [phi:main::@160->main::@161] // main::@161 // util_wait_space() // [577] call util_wait_space - // [1064] phi from main::@161 to util_wait_space [phi:main::@161->util_wait_space] + // [973] phi from main::@161 to util_wait_space [phi:main::@161->util_wait_space] jsr util_wait_space jmp check_status_smc3 // main::bank_set_brom5 @@ -3550,18 +3467,18 @@ main: { sta.z BROM // main::@72 // if(rom_device_ids[rom_chip] != UNKNOWN) - // [579] if(rom_device_ids[main::rom_chip2#10]==$55) goto main::@33 -- pbuc1_derefidx_vbum1_eq_vbuc2_then_la1 + // [579] if(rom_device_ids[main::rom_chip2#10]==$55) goto main::@31 -- pbuc1_derefidx_vbum1_eq_vbuc2_then_la1 ldy rom_chip2 lda rom_device_ids,y cmp #$55 - bne !__b33+ - jmp __b33 - !__b33: - // [580] phi from main::@72 to main::@36 [phi:main::@72->main::@36] - // main::@36 + bne !__b31+ + jmp __b31 + !__b31: + // [580] phi from main::@72 to main::@34 [phi:main::@72->main::@34] + // main::@34 // display_progress_clear() // [581] call display_progress_clear - // [859] phi from main::@36 to display_progress_clear [phi:main::@36->display_progress_clear] + // [859] phi from main::@34 to display_progress_clear [phi:main::@34->display_progress_clear] jsr display_progress_clear // main::@136 // unsigned char rom_bank = rom_chip * 32 @@ -3574,9 +3491,8 @@ main: { asl sta rom_bank // unsigned char* file = rom_file(rom_chip) - // [583] rom_file::rom_chip#0 = main::rom_chip2#10 -- vbuz1=vbum2 + // [583] rom_file::rom_chip#0 = main::rom_chip2#10 -- vbuaa=vbum1 lda rom_chip2 - sta.z rom_file.rom_chip // [584] call rom_file // [1293] phi from main::@136 to rom_file [phi:main::@136->rom_file] // [1293] phi rom_file::rom_chip#2 = rom_file::rom_chip#0 [phi:main::@136->rom_file#0] -- register_copy @@ -3681,9 +3597,9 @@ main: { sta.z rom_read.file lda file+1 sta.z rom_read.file+1 - // [600] rom_read::brom_bank_start#1 = main::rom_bank#0 -- vbum1=vbum2 + // [600] rom_read::brom_bank_start#1 = main::rom_bank#0 -- vbuz1=vbum2 lda rom_bank - sta rom_read.brom_bank_start + sta.z rom_read.brom_bank_start // [601] rom_read::rom_size#0 = rom_sizes[main::$286] -- vduz1=pduc1_derefidx_vbum2 ldy main__286 lda rom_sizes,y @@ -3710,62 +3626,62 @@ main: { // main::@143 // [604] main::rom_bytes_read#0 = rom_read::return#2 // if (!rom_bytes_read) - // [605] if(0==main::rom_bytes_read#0) goto main::@34 -- 0_eq_vdum1_then_la1 + // [605] if(0==main::rom_bytes_read#0) goto main::@32 -- 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 rom_bytes_read - ora rom_bytes_read+1 - ora rom_bytes_read+2 - ora rom_bytes_read+3 - bne !__b34+ - jmp __b34 - !__b34: - // main::@37 + lda.z rom_bytes_read + ora.z rom_bytes_read+1 + ora.z rom_bytes_read+2 + ora.z rom_bytes_read+3 + bne !__b32+ + jmp __b32 + !__b32: + // main::@35 // unsigned long rom_file_modulo = rom_bytes_read % 0x4000 - // [606] main::rom_file_modulo#0 = main::rom_bytes_read#0 & $4000-1 -- vdum1=vdum2_band_vduc1 - lda rom_bytes_read + // [606] main::rom_file_modulo#0 = main::rom_bytes_read#0 & $4000-1 -- vdum1=vduz2_band_vduc1 + lda.z rom_bytes_read and #<$4000-1 sta rom_file_modulo - lda rom_bytes_read+1 + lda.z rom_bytes_read+1 and #>$4000-1 sta rom_file_modulo+1 - lda rom_bytes_read+2 + lda.z rom_bytes_read+2 and #<$4000-1>>$10 sta rom_file_modulo+2 - lda rom_bytes_read+3 + lda.z rom_bytes_read+3 and #>$4000-1>>$10 sta rom_file_modulo+3 // if(rom_file_modulo) - // [607] if(0!=main::rom_file_modulo#0) goto main::@35 -- 0_neq_vdum1_then_la1 + // [607] 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 !__b35+ - jmp __b35 - !__b35: - // main::@38 + beq !__b33+ + jmp __b33 + !__b33: + // main::@36 // file_sizes[rom_chip] = rom_bytes_read - // [608] file_sizes[main::$286] = main::rom_bytes_read#0 -- pduc1_derefidx_vbum1=vdum2 + // [608] file_sizes[main::$286] = main::rom_bytes_read#0 -- pduc1_derefidx_vbum1=vduz2 // 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__286 - lda rom_bytes_read + lda.z rom_bytes_read sta file_sizes,y - lda rom_bytes_read+1 + lda.z rom_bytes_read+1 sta file_sizes+1,y - lda rom_bytes_read+2 + lda.z rom_bytes_read+2 sta file_sizes+2,y - lda rom_bytes_read+3 + lda.z rom_bytes_read+3 sta file_sizes+3,y // rom_get_github_commit_id(rom_file_github, (char*)RAM_BASE) // [609] call rom_get_github_commit_id - // [1779] phi from main::@38 to rom_get_github_commit_id [phi:main::@38->rom_get_github_commit_id] - // [1779] phi rom_get_github_commit_id::commit_id#6 = main::rom_file_github [phi:main::@38->rom_get_github_commit_id#0] -- pbuz1=pbuc1 + // [1779] phi from main::@36 to rom_get_github_commit_id [phi:main::@36->rom_get_github_commit_id] + // [1779] phi rom_get_github_commit_id::commit_id#6 = main::rom_file_github [phi:main::@36->rom_get_github_commit_id#0] -- pbuz1=pbuc1 lda #rom_file_github sta.z rom_get_github_commit_id.commit_id+1 - // [1779] phi rom_get_github_commit_id::from#6 = (char *)$7800 [phi:main::@38->rom_get_github_commit_id#1] -- pbuz1=pbuc1 + // [1779] phi rom_get_github_commit_id::from#6 = (char *)$7800 [phi:main::@36->rom_get_github_commit_id#1] -- pbuz1=pbuc1 lda #<$7800 sta.z rom_get_github_commit_id.from lda #>$7800 @@ -3782,9 +3698,8 @@ main: { sta.z BRAM // main::@74 // unsigned char rom_file_release = rom_get_release(*((char*)0xBF80)) - // [612] rom_get_release::release#2 = *((char *) 49024) -- vbuz1=_deref_pbuc1 - lda $bf80 - sta.z rom_get_release.release + // [612] rom_get_release::release#2 = *((char *) 49024) -- vbuxx=_deref_pbuc1 + ldx $bf80 // [613] call rom_get_release // [1796] phi from main::@74 to rom_get_release [phi:main::@74->rom_get_release] // [1796] phi rom_get_release::release#3 = rom_get_release::release#2 [phi:main::@74->rom_get_release#0] -- register_copy @@ -3792,19 +3707,22 @@ main: { // unsigned char rom_file_release = rom_get_release(*((char*)0xBF80)) // [614] rom_get_release::return#3 = rom_get_release::return#0 // main::@151 - // [615] main::rom_file_release#0 = rom_get_release::return#3 + // [615] main::rom_file_release#0 = rom_get_release::return#3 -- vbuyy=vbuxx + txa + tay // unsigned char rom_file_prefix = rom_get_prefix(*((char*)0xBF80)) - // [616] rom_get_prefix::release#1 = *((char *) 49024) -- vbum1=_deref_pbuc1 + // [616] rom_get_prefix::release#1 = *((char *) 49024) -- vbuaa=_deref_pbuc1 lda $bf80 - sta rom_get_prefix.release // [617] call rom_get_prefix // [1803] phi from main::@151 to rom_get_prefix [phi:main::@151->rom_get_prefix] // [1803] phi rom_get_prefix::release#2 = rom_get_prefix::release#1 [phi:main::@151->rom_get_prefix#0] -- register_copy jsr rom_get_prefix // unsigned char rom_file_prefix = rom_get_prefix(*((char*)0xBF80)) - // [618] rom_get_prefix::return#3 = rom_get_prefix::return#0 + // [618] rom_get_prefix::return#3 = rom_get_prefix::return#0 -- vbuaa=vbuxx + txa // main::@152 - // [619] main::rom_file_prefix#0 = rom_get_prefix::return#3 + // [619] main::rom_file_prefix#0 = rom_get_prefix::return#3 -- vbuxx=vbuaa + tax // main::bank_pull_bram1 // asm // asm { pla sta$00 } @@ -3813,7 +3731,8 @@ main: { // main::@75 // rom_get_version_text(rom_file_release_text, rom_file_prefix, rom_file_release, rom_file_github) // [621] rom_get_version_text::prefix#1 = main::rom_file_prefix#0 - // [622] rom_get_version_text::release#1 = main::rom_file_release#0 + // [622] rom_get_version_text::release#1 = main::rom_file_release#0 -- vbum1=vbuyy + sty rom_get_version_text.release // [623] call rom_get_version_text // [1812] phi from main::@75 to rom_get_version_text [phi:main::@75->rom_get_version_text] // [1812] phi rom_get_version_text::github#2 = main::rom_file_github [phi:main::@75->rom_get_version_text#0] -- pbuz1=pbuc1 @@ -3919,34 +3838,34 @@ main: { lda #>@info_text sta.z display_info_rom.info_text+1 // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#8 [phi:main::@157->display_info_rom#1] -- register_copy - // [1250] phi display_info_rom::info_status#16 = STATUS_FLASH [phi:main::@157->display_info_rom#2] -- vbuz1=vbuc1 + // [1250] phi display_info_rom::info_status#16 = STATUS_FLASH [phi:main::@157->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 - // [637] phi from main::@146 main::@150 main::@157 main::@72 to main::@33 [phi:main::@146/main::@150/main::@157/main::@72->main::@33] - // [637] phi __errno#239 = __errno#18 [phi:main::@146/main::@150/main::@157/main::@72->main::@33#0] -- register_copy - // main::@33 - __b33: + // [637] phi from main::@146 main::@150 main::@157 main::@72 to main::@31 [phi:main::@146/main::@150/main::@157/main::@72->main::@31] + // [637] phi __errno#245 = __errno#18 [phi:main::@146/main::@150/main::@157/main::@72->main::@31#0] -- register_copy + // main::@31 + __b31: // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) // [638] main::rom_chip2#1 = ++ main::rom_chip2#10 -- vbum1=_inc_vbum1 inc rom_chip2 - // [193] phi from main::@33 to main::@32 [phi:main::@33->main::@32] - // [193] phi __errno#116 = __errno#239 [phi:main::@33->main::@32#0] -- register_copy - // [193] phi main::rom_chip2#10 = main::rom_chip2#1 [phi:main::@33->main::@32#1] -- register_copy - jmp __b32 - // [639] phi from main::@37 to main::@35 [phi:main::@37->main::@35] - // main::@35 - __b35: + // [193] phi from main::@31 to main::@30 [phi:main::@31->main::@30] + // [193] phi __errno#116 = __errno#245 [phi:main::@31->main::@30#0] -- register_copy + // [193] phi main::rom_chip2#10 = main::rom_chip2#1 [phi:main::@31->main::@30#1] -- register_copy + jmp __b30 + // [639] phi from main::@35 to main::@33 [phi:main::@35->main::@33] + // main::@33 + __b33: // sprintf(info_text, "File %s size error!", file) // [640] call snprintf_init - // [1133] phi from main::@35 to snprintf_init [phi:main::@35->snprintf_init] - // [1133] phi snprintf_init::s#26 = info_text [phi:main::@35->snprintf_init#0] -- pbuz1=pbuc1 + // [1133] phi from main::@33 to snprintf_init [phi:main::@33->snprintf_init] + // [1133] phi snprintf_init::s#26 = 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 - // [641] phi from main::@35 to main::@147 [phi:main::@35->main::@147] + // [641] phi from main::@33 to main::@147 [phi:main::@33->main::@147] // main::@147 // sprintf(info_text, "File %s size error!", file) // [642] call printf_str @@ -4020,24 +3939,24 @@ main: { lda #>@info_text sta.z display_info_rom.info_text+1 // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#7 [phi:main::@150->display_info_rom#1] -- register_copy - // [1250] phi display_info_rom::info_status#16 = STATUS_ISSUE [phi:main::@150->display_info_rom#2] -- vbuz1=vbuc1 + // [1250] phi display_info_rom::info_status#16 = STATUS_ISSUE [phi:main::@150->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 __b33 - // [652] phi from main::@143 to main::@34 [phi:main::@143->main::@34] - // main::@34 - __b34: + jmp __b31 + // [652] phi from main::@143 to main::@32 [phi:main::@143->main::@32] + // main::@32 + __b32: // sprintf(info_text, "No %s", file) // [653] call snprintf_init - // [1133] phi from main::@34 to snprintf_init [phi:main::@34->snprintf_init] - // [1133] phi snprintf_init::s#26 = info_text [phi:main::@34->snprintf_init#0] -- pbuz1=pbuc1 + // [1133] phi from main::@32 to snprintf_init [phi:main::@32->snprintf_init] + // [1133] phi snprintf_init::s#26 = 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 - // [654] phi from main::@34 to main::@144 [phi:main::@34->main::@144] + // [654] phi from main::@32 to main::@144 [phi:main::@32->main::@144] // main::@144 // sprintf(info_text, "No %s", file) // [655] call printf_str @@ -4095,14 +4014,14 @@ main: { lda #>@info_text sta.z display_info_rom.info_text+1 // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#6 [phi:main::@146->display_info_rom#1] -- register_copy - // [1250] phi display_info_rom::info_status#16 = STATUS_SKIP [phi:main::@146->display_info_rom#2] -- vbuz1=vbuc1 + // [1250] phi display_info_rom::info_status#16 = STATUS_SKIP [phi:main::@146->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 __b33 - // main::@31 - __b31: - // [663] smc_bootloader#440 = smc_bootloader#0 -- vwum1=vwum2 + jmp __b31 + // main::@29 + __b29: + // [663] smc_bootloader#425 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 @@ -4110,31 +4029,31 @@ main: { // display_info_smc(STATUS_ISSUE, "SMC.BIN too large!") // [664] 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 - // [903] phi from main::@31 to display_info_smc [phi:main::@31->display_info_smc] - // [903] phi display_info_smc::info_text#18 = main::info_text8 [phi:main::@31->display_info_smc#0] -- pbuz1=pbuc1 + // [903] phi from main::@29 to display_info_smc [phi:main::@29->display_info_smc] + // [903] phi display_info_smc::info_text#18 = main::info_text8 [phi:main::@29->display_info_smc#0] -- pbuz1=pbuc1 lda #info_text8 sta.z display_info_smc.info_text+1 - // [903] phi smc_bootloader#13 = smc_bootloader#440 [phi:main::@31->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_ISSUE [phi:main::@31->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#425 [phi:main::@29->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = 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 - // [188] phi from main::@30 main::@31 to main::CLI2 [phi:main::@30/main::@31->main::CLI2] - __b11: - // [188] phi smc_file_minor#277 = 0 [phi:main::@30/main::@31->main::CLI2#0] -- vbum1=vbuc1 + // [188] phi from main::@28 main::@29 to main::CLI2 [phi:main::@28/main::@29->main::CLI2] + __b10: + // [188] phi smc_file_minor#276 = 0 [phi:main::@28/main::@29->main::CLI2#0] -- vbum1=vbuc1 lda #0 sta smc_file_minor - // [188] phi smc_file_major#277 = 0 [phi:main::@30/main::@31->main::CLI2#1] -- vbum1=vbuc1 + // [188] phi smc_file_major#276 = 0 [phi:main::@28/main::@29->main::CLI2#1] -- vbum1=vbuc1 sta smc_file_major - // [188] phi smc_file_release#277 = 0 [phi:main::@30/main::@31->main::CLI2#2] -- vbum1=vbuc1 + // [188] phi smc_file_release#276 = 0 [phi:main::@28/main::@29->main::CLI2#2] -- vbum1=vbuc1 sta smc_file_release - // [188] phi __errno#240 = __errno#18 [phi:main::@30/main::@31->main::CLI2#3] -- register_copy + // [188] phi __errno#246 = __errno#18 [phi:main::@28/main::@29->main::CLI2#3] -- register_copy jmp CLI2 - // main::@30 - __b30: - // [665] smc_bootloader#439 = smc_bootloader#0 -- vwum1=vwum2 + // main::@28 + __b28: + // [665] smc_bootloader#424 = smc_bootloader#0 -- vwum1=vwum2 lda smc_bootloader sta smc_bootloader_1 lda smc_bootloader+1 @@ -4143,355 +4062,316 @@ main: { // [666] 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 - // [903] phi from main::@30 to display_info_smc [phi:main::@30->display_info_smc] - // [903] phi display_info_smc::info_text#18 = main::info_text7 [phi:main::@30->display_info_smc#0] -- pbuz1=pbuc1 + // [903] phi from main::@28 to display_info_smc [phi:main::@28->display_info_smc] + // [903] phi display_info_smc::info_text#18 = main::info_text7 [phi:main::@28->display_info_smc#0] -- pbuz1=pbuc1 lda #info_text7 sta.z display_info_smc.info_text+1 - // [903] phi smc_bootloader#13 = smc_bootloader#439 [phi:main::@30->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_SKIP [phi:main::@30->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#424 [phi:main::@28->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = 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 __b11 - // main::@25 - __b25: - // display_info_led(PROGRESS_X + 3, PROGRESS_Y + 3 + intro_status, status_color[intro_status], BLUE) - // [667] display_info_led::y#3 = PROGRESS_Y+3 + main::intro_status#2 -- vbuz1=vbuc1_plus_vbum2 - lda #PROGRESS_Y+3 - clc - adc intro_status - sta.z display_info_led.y - // [668] display_info_led::tc#3 = status_color[main::intro_status#2] -- vbuz1=pbuc1_derefidx_vbum2 - ldy intro_status - lda status_color,y - sta.z display_info_led.tc - // [669] call display_info_led - // [1828] phi from main::@25 to display_info_led [phi:main::@25->display_info_led] - // [1828] phi display_info_led::y#4 = display_info_led::y#3 [phi:main::@25->display_info_led#0] -- register_copy - // [1828] phi display_info_led::x#4 = PROGRESS_X+3 [phi:main::@25->display_info_led#1] -- vbuz1=vbuc1 - lda #PROGRESS_X+3 - sta.z display_info_led.x - // [1828] phi display_info_led::tc#4 = display_info_led::tc#3 [phi:main::@25->display_info_led#2] -- register_copy - jsr display_info_led - // main::@128 - // for(unsigned char intro_status=0; intro_status<11; intro_status++) - // [670] main::intro_status#1 = ++ main::intro_status#2 -- vbum1=_inc_vbum1 - inc intro_status - // [150] phi from main::@128 to main::@24 [phi:main::@128->main::@24] - // [150] phi main::intro_status#2 = main::intro_status#1 [phi:main::@128->main::@24#0] -- register_copy - jmp __b24 - // main::@21 - __b21: + jmp __b10 + // main::@22 + __b22: // if(rom_device_ids[rom_chip] != UNKNOWN) - // [671] if(rom_device_ids[main::rom_chip1#10]!=$55) goto main::@22 -- pbuc1_derefidx_vbum1_neq_vbuc2_then_la1 + // [667] if(rom_device_ids[main::rom_chip1#10]!=$55) goto main::@23 -- pbuc1_derefidx_vbum1_neq_vbuc2_then_la1 lda #$55 ldy rom_chip1 cmp rom_device_ids,y - bne __b22 - // main::@23 - __b23: + bne __b23 + // main::@24 + __b24: // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [672] main::rom_chip1#1 = ++ main::rom_chip1#10 -- vbum1=_inc_vbum1 + // [668] main::rom_chip1#1 = ++ main::rom_chip1#10 -- vbum1=_inc_vbum1 inc rom_chip1 - // [140] phi from main::@23 to main::@20 [phi:main::@23->main::@20] - // [140] phi main::rom_chip1#10 = main::rom_chip1#1 [phi:main::@23->main::@20#0] -- register_copy - jmp __b20 - // main::@22 - __b22: + // [156] phi from main::@24 to main::@21 [phi:main::@24->main::@21] + // [156] phi main::rom_chip1#10 = main::rom_chip1#1 [phi:main::@24->main::@21#0] -- register_copy + jmp __b21 + // main::@23 + __b23: // bank_set_brom(rom_chip*32) - // [673] main::bank_set_brom3_bank#0 = main::rom_chip1#10 << 5 -- vbuz1=vbum2_rol_5 + // [669] main::bank_set_brom4_bank#0 = main::rom_chip1#10 << 5 -- vbuaa=vbum1_rol_5 lda rom_chip1 asl asl asl asl asl - sta.z bank_set_brom3_bank - // main::bank_set_brom3 + // main::bank_set_brom4 // BROM = bank - // [674] BROM = main::bank_set_brom3_bank#0 -- vbuz1=vbuz2 + // [670] BROM = main::bank_set_brom4_bank#0 -- vbuz1=vbuaa sta.z BROM - // main::@69 + // main::@70 // rom_chip*8 - // [675] main::$119 = main::rom_chip1#10 << 3 -- vbuz1=vbum2_rol_3 + // [671] main::$121 = main::rom_chip1#10 << 3 -- vbum1=vbum2_rol_3 lda rom_chip1 asl asl asl - sta.z main__119 + sta main__121 // rom_get_github_commit_id(&rom_github[rom_chip*8], (char*)0xC000) - // [676] rom_get_github_commit_id::commit_id#0 = rom_github + main::$119 -- pbuz1=pbuc1_plus_vbuz2 + // [672] rom_get_github_commit_id::commit_id#0 = rom_github + main::$121 -- pbuz1=pbuc1_plus_vbum2 clc adc #rom_github adc #0 sta.z rom_get_github_commit_id.commit_id+1 - // [677] call rom_get_github_commit_id - // [1779] phi from main::@69 to rom_get_github_commit_id [phi:main::@69->rom_get_github_commit_id] - // [1779] phi rom_get_github_commit_id::commit_id#6 = rom_get_github_commit_id::commit_id#0 [phi:main::@69->rom_get_github_commit_id#0] -- register_copy - // [1779] phi rom_get_github_commit_id::from#6 = (char *) 49152 [phi:main::@69->rom_get_github_commit_id#1] -- pbuz1=pbuc1 + // [673] call rom_get_github_commit_id + // [1779] phi from main::@70 to rom_get_github_commit_id [phi:main::@70->rom_get_github_commit_id] + // [1779] phi rom_get_github_commit_id::commit_id#6 = rom_get_github_commit_id::commit_id#0 [phi:main::@70->rom_get_github_commit_id#0] -- register_copy + // [1779] phi rom_get_github_commit_id::from#6 = (char *) 49152 [phi:main::@70->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::@124 + // main::@126 // rom_get_release(*((char*)0xFF80)) - // [678] rom_get_release::release#1 = *((char *) 65408) -- vbuz1=_deref_pbuc1 - lda $ff80 - sta.z rom_get_release.release - // [679] call rom_get_release - // [1796] phi from main::@124 to rom_get_release [phi:main::@124->rom_get_release] - // [1796] phi rom_get_release::release#3 = rom_get_release::release#1 [phi:main::@124->rom_get_release#0] -- register_copy + // [674] rom_get_release::release#1 = *((char *) 65408) -- vbuxx=_deref_pbuc1 + ldx $ff80 + // [675] call rom_get_release + // [1796] phi from main::@126 to rom_get_release [phi:main::@126->rom_get_release] + // [1796] phi rom_get_release::release#3 = rom_get_release::release#1 [phi:main::@126->rom_get_release#0] -- register_copy jsr rom_get_release // rom_get_release(*((char*)0xFF80)) - // [680] rom_get_release::return#2 = rom_get_release::return#0 - // main::@125 - // [681] main::$115 = rom_get_release::return#2 + // [676] rom_get_release::return#2 = rom_get_release::return#0 + // main::@127 + // [677] main::$117 = rom_get_release::return#2 -- vbuaa=vbuxx + txa // rom_release[rom_chip] = rom_get_release(*((char*)0xFF80)) - // [682] rom_release[main::rom_chip1#10] = main::$115 -- pbuc1_derefidx_vbum1=vbuz2 - lda.z main__115 + // [678] rom_release[main::rom_chip1#10] = main::$117 -- pbuc1_derefidx_vbum1=vbuaa ldy rom_chip1 sta rom_release,y // rom_get_prefix(*((char*)0xFF80)) - // [683] rom_get_prefix::release#0 = *((char *) 65408) -- vbum1=_deref_pbuc1 + // [679] rom_get_prefix::release#0 = *((char *) 65408) -- vbuaa=_deref_pbuc1 lda $ff80 - sta rom_get_prefix.release - // [684] call rom_get_prefix - // [1803] phi from main::@125 to rom_get_prefix [phi:main::@125->rom_get_prefix] - // [1803] phi rom_get_prefix::release#2 = rom_get_prefix::release#0 [phi:main::@125->rom_get_prefix#0] -- register_copy + // [680] call rom_get_prefix + // [1803] phi from main::@127 to rom_get_prefix [phi:main::@127->rom_get_prefix] + // [1803] phi rom_get_prefix::release#2 = rom_get_prefix::release#0 [phi:main::@127->rom_get_prefix#0] -- register_copy jsr rom_get_prefix // rom_get_prefix(*((char*)0xFF80)) - // [685] rom_get_prefix::return#2 = rom_get_prefix::return#0 - // main::@126 - // [686] main::$116 = rom_get_prefix::return#2 + // [681] rom_get_prefix::return#2 = rom_get_prefix::return#0 + // main::@128 + // [682] main::$118 = rom_get_prefix::return#2 -- vbuaa=vbuxx + txa // rom_prefix[rom_chip] = rom_get_prefix(*((char*)0xFF80)) - // [687] rom_prefix[main::rom_chip1#10] = main::$116 -- pbuc1_derefidx_vbum1=vbum2 - lda main__116 + // [683] rom_prefix[main::rom_chip1#10] = main::$118 -- pbuc1_derefidx_vbum1=vbuaa ldy rom_chip1 sta rom_prefix,y // rom_chip*13 - // [688] main::$342 = main::rom_chip1#10 << 1 -- vbum1=vbum2_rol_1 + // [684] main::$342 = main::rom_chip1#10 << 1 -- vbuaa=vbum1_rol_1 tya asl - sta main__342 - // [689] main::$343 = main::$342 + main::rom_chip1#10 -- vbum1=vbum1_plus_vbum2 - lda main__343 + // [685] main::$343 = main::$342 + main::rom_chip1#10 -- vbuaa=vbuaa_plus_vbum1 clc adc rom_chip1 - sta main__343 - // [690] main::$344 = main::$343 << 2 -- vbum1=vbum1_rol_2 - lda main__344 + // [686] main::$344 = main::$343 << 2 -- vbuaa=vbuaa_rol_2 asl asl - sta main__344 - // [691] main::$117 = main::$344 + main::rom_chip1#10 -- vbum1=vbum1_plus_vbum2 - lda main__117 + // [687] main::$119 = main::$344 + main::rom_chip1#10 -- vbuaa=vbuaa_plus_vbum1 clc adc rom_chip1 - sta main__117 // rom_get_version_text(&rom_release_text[rom_chip*13], rom_prefix[rom_chip], rom_release[rom_chip], &rom_github[rom_chip*8]) - // [692] rom_get_version_text::release_info#0 = rom_release_text + main::$117 -- pbuz1=pbuc1_plus_vbum2 + // [688] rom_get_version_text::release_info#0 = rom_release_text + main::$119 -- pbuz1=pbuc1_plus_vbuaa clc adc #rom_release_text adc #0 sta.z rom_get_version_text.release_info+1 - // [693] rom_get_version_text::github#0 = rom_github + main::$119 -- pbuz1=pbuc1_plus_vbuz2 - lda.z main__119 + // [689] rom_get_version_text::github#0 = rom_github + main::$121 -- pbuz1=pbuc1_plus_vbum2 + lda main__121 clc adc #rom_github adc #0 sta.z rom_get_version_text.github+1 - // [694] rom_get_version_text::prefix#0 = rom_prefix[main::rom_chip1#10] -- vbum1=pbuc1_derefidx_vbum2 - lda rom_prefix,y - sta rom_get_version_text.prefix - // [695] rom_get_version_text::release#0 = rom_release[main::rom_chip1#10] -- vbuz1=pbuc1_derefidx_vbum2 + // [690] rom_get_version_text::prefix#0 = rom_prefix[main::rom_chip1#10] -- vbuxx=pbuc1_derefidx_vbum1 + ldx rom_prefix,y + // [691] rom_get_version_text::release#0 = rom_release[main::rom_chip1#10] -- vbum1=pbuc1_derefidx_vbum2 lda rom_release,y - sta.z rom_get_version_text.release - // [696] call rom_get_version_text - // [1812] phi from main::@126 to rom_get_version_text [phi:main::@126->rom_get_version_text] - // [1812] phi rom_get_version_text::github#2 = rom_get_version_text::github#0 [phi:main::@126->rom_get_version_text#0] -- register_copy - // [1812] phi rom_get_version_text::release#2 = rom_get_version_text::release#0 [phi:main::@126->rom_get_version_text#1] -- register_copy - // [1812] phi rom_get_version_text::prefix#2 = rom_get_version_text::prefix#0 [phi:main::@126->rom_get_version_text#2] -- register_copy - // [1812] phi rom_get_version_text::release_info#2 = rom_get_version_text::release_info#0 [phi:main::@126->rom_get_version_text#3] -- register_copy + sta rom_get_version_text.release + // [692] call rom_get_version_text + // [1812] phi from main::@128 to rom_get_version_text [phi:main::@128->rom_get_version_text] + // [1812] phi rom_get_version_text::github#2 = rom_get_version_text::github#0 [phi:main::@128->rom_get_version_text#0] -- register_copy + // [1812] phi rom_get_version_text::release#2 = rom_get_version_text::release#0 [phi:main::@128->rom_get_version_text#1] -- register_copy + // [1812] phi rom_get_version_text::prefix#2 = rom_get_version_text::prefix#0 [phi:main::@128->rom_get_version_text#2] -- register_copy + // [1812] phi rom_get_version_text::release_info#2 = rom_get_version_text::release_info#0 [phi:main::@128->rom_get_version_text#3] -- register_copy jsr rom_get_version_text - // main::@127 + // main::@129 // display_info_rom(rom_chip, STATUS_DETECTED, "") - // [697] display_info_rom::rom_chip#5 = main::rom_chip1#10 -- vbuz1=vbum2 + // [693] display_info_rom::rom_chip#5 = main::rom_chip1#10 -- vbuz1=vbum2 lda rom_chip1 sta.z display_info_rom.rom_chip - // [698] call display_info_rom - // [1250] phi from main::@127 to display_info_rom [phi:main::@127->display_info_rom] - // [1250] phi display_info_rom::info_text#16 = info_text4 [phi:main::@127->display_info_rom#0] -- pbuz1=pbuc1 + // [694] call display_info_rom + // [1250] phi from main::@129 to display_info_rom [phi:main::@129->display_info_rom] + // [1250] phi display_info_rom::info_text#16 = info_text4 [phi:main::@129->display_info_rom#0] -- pbuz1=pbuc1 lda #info_text4 sta.z display_info_rom.info_text+1 - // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#5 [phi:main::@127->display_info_rom#1] -- register_copy - // [1250] phi display_info_rom::info_status#16 = STATUS_DETECTED [phi:main::@127->display_info_rom#2] -- vbuz1=vbuc1 + // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#5 [phi:main::@129->display_info_rom#1] -- register_copy + // [1250] phi display_info_rom::info_status#16 = STATUS_DETECTED [phi:main::@129->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 __b23 - // [699] phi from main::@16 to main::@19 [phi:main::@16->main::@19] - // main::@19 - __b19: + jmp __b24 + // [695] phi from main::@17 to main::@20 [phi:main::@17->main::@20] + // main::@20 + __b20: // sprintf(info_text, "Bootloader v%02x invalid! !", smc_bootloader) - // [700] call snprintf_init - // [1133] phi from main::@19 to snprintf_init [phi:main::@19->snprintf_init] - // [1133] phi snprintf_init::s#26 = info_text [phi:main::@19->snprintf_init#0] -- pbuz1=pbuc1 + // [696] call snprintf_init + // [1133] phi from main::@20 to snprintf_init [phi:main::@20->snprintf_init] + // [1133] phi snprintf_init::s#26 = 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 - // [701] phi from main::@19 to main::@110 [phi:main::@19->main::@110] - // main::@110 + // [697] phi from main::@20 to main::@114 [phi:main::@20->main::@114] + // main::@114 // sprintf(info_text, "Bootloader v%02x invalid! !", smc_bootloader) - // [702] call printf_str - // [1138] phi from main::@110 to printf_str [phi:main::@110->printf_str] - // [1138] phi printf_str::putc#71 = &snputc [phi:main::@110->printf_str#0] -- pprz1=pprc1 + // [698] call printf_str + // [1138] phi from main::@114 to printf_str [phi:main::@114->printf_str] + // [1138] phi printf_str::putc#71 = &snputc [phi:main::@114->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1138] phi printf_str::s#71 = main::s2 [phi:main::@110->printf_str#1] -- pbuz1=pbuc1 + // [1138] phi printf_str::s#71 = main::s2 [phi:main::@114->printf_str#1] -- pbuz1=pbuc1 lda #s2 sta.z printf_str.s+1 jsr printf_str - // main::@111 + // main::@115 // sprintf(info_text, "Bootloader v%02x invalid! !", smc_bootloader) - // [703] printf_uint::uvalue#13 = smc_bootloader#0 -- vwuz1=vwum2 + // [699] printf_uint::uvalue#13 = smc_bootloader#0 -- vwuz1=vwum2 lda smc_bootloader sta.z printf_uint.uvalue lda smc_bootloader+1 sta.z printf_uint.uvalue+1 - // [704] call printf_uint - // [1839] phi from main::@111 to printf_uint [phi:main::@111->printf_uint] - // [1839] phi printf_uint::format_zero_padding#14 = 1 [phi:main::@111->printf_uint#0] -- vbuz1=vbuc1 + // [700] call printf_uint + // [1828] phi from main::@115 to printf_uint [phi:main::@115->printf_uint] + // [1828] phi printf_uint::format_zero_padding#14 = 1 [phi:main::@115->printf_uint#0] -- vbuz1=vbuc1 lda #1 sta.z printf_uint.format_zero_padding - // [1839] phi printf_uint::format_min_length#14 = 2 [phi:main::@111->printf_uint#1] -- vbuz1=vbuc1 + // [1828] phi printf_uint::format_min_length#14 = 2 [phi:main::@115->printf_uint#1] -- vbuz1=vbuc1 lda #2 sta.z printf_uint.format_min_length - // [1839] phi printf_uint::putc#14 = &snputc [phi:main::@111->printf_uint#2] -- pprz1=pprc1 + // [1828] phi printf_uint::putc#14 = &snputc [phi:main::@115->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1839] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:main::@111->printf_uint#3] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_uint.format_radix - // [1839] phi printf_uint::uvalue#14 = printf_uint::uvalue#13 [phi:main::@111->printf_uint#4] -- register_copy + // [1828] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:main::@115->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1828] phi printf_uint::uvalue#14 = printf_uint::uvalue#13 [phi:main::@115->printf_uint#4] -- register_copy jsr printf_uint - // [705] phi from main::@111 to main::@112 [phi:main::@111->main::@112] - // main::@112 + // [701] phi from main::@115 to main::@116 [phi:main::@115->main::@116] + // main::@116 // sprintf(info_text, "Bootloader v%02x invalid! !", smc_bootloader) - // [706] call printf_str - // [1138] phi from main::@112 to printf_str [phi:main::@112->printf_str] - // [1138] phi printf_str::putc#71 = &snputc [phi:main::@112->printf_str#0] -- pprz1=pprc1 + // [702] call printf_str + // [1138] phi from main::@116 to printf_str [phi:main::@116->printf_str] + // [1138] phi printf_str::putc#71 = &snputc [phi:main::@116->printf_str#0] -- pprz1=pprc1 lda #snputc sta.z printf_str.putc+1 - // [1138] phi printf_str::s#71 = main::s3 [phi:main::@112->printf_str#1] -- pbuz1=pbuc1 + // [1138] phi printf_str::s#71 = main::s3 [phi:main::@116->printf_str#1] -- pbuz1=pbuc1 lda #s3 sta.z printf_str.s+1 jsr printf_str - // main::@113 + // main::@117 // sprintf(info_text, "Bootloader v%02x invalid! !", smc_bootloader) - // [707] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [703] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [708] callexecute snputc -- call_vprc1 + // [704] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla - // [710] smc_bootloader#429 = smc_bootloader#0 -- vwum1=vwum2 + // [706] smc_bootloader#414 = 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) - // [711] call display_info_smc - // [903] phi from main::@113 to display_info_smc [phi:main::@113->display_info_smc] - // [903] phi display_info_smc::info_text#18 = info_text [phi:main::@113->display_info_smc#0] -- pbuz1=pbuc1 + // [707] call display_info_smc + // [903] phi from main::@117 to display_info_smc [phi:main::@117->display_info_smc] + // [903] phi display_info_smc::info_text#18 = info_text [phi:main::@117->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 - // [903] phi smc_bootloader#13 = smc_bootloader#429 [phi:main::@113->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_ISSUE [phi:main::@113->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#414 [phi:main::@117->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = STATUS_ISSUE [phi:main::@117->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 - // [712] phi from main::@113 to main::@114 [phi:main::@113->main::@114] - // main::@114 + // [708] phi from main::@117 to main::@118 [phi:main::@117->main::@118] + // main::@118 // display_progress_text(display_no_valid_smc_bootloader_text, display_no_valid_smc_bootloader_count) - // [713] call display_progress_text + // [709] call display_progress_text // Bootloader is not supported by this utility, but is not error. - // [1054] phi from main::@114 to display_progress_text [phi:main::@114->display_progress_text] - // [1054] phi display_progress_text::text#12 = display_no_valid_smc_bootloader_text [phi:main::@114->display_progress_text#0] -- qbuz1=qbuc1 + // [963] phi from main::@118 to display_progress_text [phi:main::@118->display_progress_text] + // [963] phi display_progress_text::text#12 = display_no_valid_smc_bootloader_text [phi:main::@118->display_progress_text#0] -- qbuz1=qbuc1 lda #display_no_valid_smc_bootloader_text sta.z display_progress_text.text+1 - // [1054] phi display_progress_text::lines#11 = display_no_valid_smc_bootloader_count [phi:main::@114->display_progress_text#1] -- vbuz1=vbuc1 + // [963] phi display_progress_text::lines#11 = display_no_valid_smc_bootloader_count [phi:main::@118->display_progress_text#1] -- vbuz1=vbuc1 lda #display_no_valid_smc_bootloader_count sta.z display_progress_text.lines jsr display_progress_text - // [132] phi from main::@109 main::@114 main::@18 to main::@2 [phi:main::@109/main::@114/main::@18->main::@2] - __b14: - // [132] phi smc_minor#361 = 0 [phi:main::@109/main::@114/main::@18->main::@2#0] -- vbum1=vbuc1 + // [148] phi from main::@113 main::@118 main::@19 to main::@2 [phi:main::@113/main::@118/main::@19->main::@2] + __b15: + // [148] phi smc_minor#338 = 0 [phi:main::@113/main::@118/main::@19->main::@2#0] -- vbum1=vbuc1 lda #0 sta smc_minor - // [132] phi smc_major#362 = 0 [phi:main::@109/main::@114/main::@18->main::@2#1] -- vbum1=vbuc1 + // [148] phi smc_major#339 = 0 [phi:main::@113/main::@118/main::@19->main::@2#1] -- vbum1=vbuc1 sta smc_major - // [132] phi smc_release#363 = 0 [phi:main::@109/main::@114/main::@18->main::@2#2] -- vbum1=vbuc1 + // [148] phi smc_release#340 = 0 [phi:main::@113/main::@118/main::@19->main::@2#2] -- vbum1=vbuc1 sta smc_release jmp __b2 - // main::@18 - __b18: - // [714] smc_bootloader#438 = smc_bootloader#0 -- vwum1=vwum2 + // main::@19 + __b19: + // [710] smc_bootloader#423 = 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!") - // [715] call display_info_smc + // [711] call display_info_smc // SD2 | SMC chip not detected | Display that the SMC chip is not detected and set SMC to Error. | Error - // [903] phi from main::@18 to display_info_smc [phi:main::@18->display_info_smc] - // [903] phi display_info_smc::info_text#18 = main::info_text2 [phi:main::@18->display_info_smc#0] -- pbuz1=pbuc1 + // [903] phi from main::@19 to display_info_smc [phi:main::@19->display_info_smc] + // [903] phi display_info_smc::info_text#18 = main::info_text2 [phi:main::@19->display_info_smc#0] -- pbuz1=pbuc1 lda #info_text2 sta.z display_info_smc.info_text+1 - // [903] phi smc_bootloader#13 = smc_bootloader#438 [phi:main::@18->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_ERROR [phi:main::@18->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#423 [phi:main::@19->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = 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 __b14 + jmp __b15 // main::@1 __b1: - // [716] smc_bootloader#427 = smc_bootloader#0 -- vwum1=vwum2 + // [712] smc_bootloader#412 = 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!") - // [717] call display_info_smc + // [713] call display_info_smc // SD1 | No Bootloader | Display that there is no bootloader and set SMC to Issue. | Issue // [903] phi from main::@1 to display_info_smc [phi:main::@1->display_info_smc] // [903] phi display_info_smc::info_text#18 = main::info_text1 [phi:main::@1->display_info_smc#0] -- pbuz1=pbuc1 @@ -4499,51 +4379,69 @@ main: { sta.z display_info_smc.info_text lda #>info_text1 sta.z display_info_smc.info_text+1 - // [903] phi smc_bootloader#13 = smc_bootloader#427 [phi:main::@1->display_info_smc#1] -- register_copy - // [903] phi display_info_smc::info_status#18 = STATUS_ISSUE [phi:main::@1->display_info_smc#2] -- vbum1=vbuc1 + // [903] phi smc_bootloader#13 = smc_bootloader#412 [phi:main::@1->display_info_smc#1] -- register_copy + // [903] phi display_info_smc::info_status#18 = 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 - // [718] phi from main::@1 to main::@109 [phi:main::@1->main::@109] - // main::@109 + // [714] phi from main::@1 to main::@113 [phi:main::@1->main::@113] + // main::@113 // display_progress_text(display_no_valid_smc_bootloader_text, display_no_valid_smc_bootloader_count) - // [719] call display_progress_text + // [715] call display_progress_text // If the CX16 board does not have a bootloader, display info how to flash bootloader. - // [1054] phi from main::@109 to display_progress_text [phi:main::@109->display_progress_text] - // [1054] phi display_progress_text::text#12 = display_no_valid_smc_bootloader_text [phi:main::@109->display_progress_text#0] -- qbuz1=qbuc1 + // [963] phi from main::@113 to display_progress_text [phi:main::@113->display_progress_text] + // [963] phi display_progress_text::text#12 = display_no_valid_smc_bootloader_text [phi:main::@113->display_progress_text#0] -- qbuz1=qbuc1 lda #display_no_valid_smc_bootloader_text sta.z display_progress_text.text+1 - // [1054] phi display_progress_text::lines#11 = display_no_valid_smc_bootloader_count [phi:main::@109->display_progress_text#1] -- vbuz1=vbuc1 + // [963] phi display_progress_text::lines#11 = display_no_valid_smc_bootloader_count [phi:main::@113->display_progress_text#1] -- vbuz1=vbuc1 lda #display_no_valid_smc_bootloader_count sta.z display_progress_text.lines jsr display_progress_text - jmp __b14 - // main::@13 - __b13: + jmp __b15 + // main::@14 + __b14: + // display_info_led(PROGRESS_X + 3, PROGRESS_Y + 3 + intro_status, status_color[intro_status], BLUE) + // [716] display_info_led::y#3 = PROGRESS_Y+3 + main::intro_status#2 -- vbuz1=vbuc1_plus_vbum2 + lda #PROGRESS_Y+3 + clc + adc intro_status + sta.z display_info_led.y + // [717] display_info_led::tc#3 = status_color[main::intro_status#2] -- vbuxx=pbuc1_derefidx_vbum1 + ldy intro_status + ldx status_color,y + // [718] call display_info_led + // [1839] phi from main::@14 to display_info_led [phi:main::@14->display_info_led] + // [1839] phi display_info_led::y#4 = display_info_led::y#3 [phi:main::@14->display_info_led#0] -- register_copy + // [1839] phi display_info_led::x#4 = PROGRESS_X+3 [phi:main::@14->display_info_led#1] -- vbuyy=vbuc1 + ldy #PROGRESS_X+3 + // [1839] phi display_info_led::tc#4 = display_info_led::tc#3 [phi:main::@14->display_info_led#2] -- register_copy + jsr display_info_led + // main::@108 + // for(unsigned char intro_status=0; intro_status<11; intro_status++) + // [719] main::intro_status#1 = ++ main::intro_status#2 -- vbum1=_inc_vbum1 + inc intro_status + // [109] phi from main::@108 to main::@13 [phi:main::@108->main::@13] + // [109] phi main::intro_status#2 = main::intro_status#1 [phi:main::@108->main::@13#0] -- register_copy + jmp __b13 + // main::@12 + __b12: // rom_chip*13 - // [720] main::$338 = main::rom_chip#2 << 1 -- vbuz1=vbum2_rol_1 + // [720] main::$338 = main::rom_chip#2 << 1 -- vbuaa=vbum1_rol_1 lda rom_chip asl - sta.z main__338 - // [721] main::$339 = main::$338 + main::rom_chip#2 -- vbuz1=vbuz1_plus_vbum2 - lda rom_chip + // [721] main::$339 = main::$338 + main::rom_chip#2 -- vbuaa=vbuaa_plus_vbum1 clc - adc.z main__339 - sta.z main__339 - // [722] main::$340 = main::$339 << 2 -- vbuz1=vbuz1_rol_2 - lda.z main__340 + adc rom_chip + // [722] main::$340 = main::$339 << 2 -- vbuaa=vbuaa_rol_2 asl asl - sta.z main__340 - // [723] main::$91 = main::$340 + main::rom_chip#2 -- vbuz1=vbuz1_plus_vbum2 - lda rom_chip + // [723] main::$90 = main::$340 + main::rom_chip#2 -- vbuaa=vbuaa_plus_vbum1 clc - adc.z main__91 - sta.z main__91 + adc rom_chip // strcpy(&rom_release_text[rom_chip*13], " " ) - // [724] strcpy::destination#1 = rom_release_text + main::$91 -- pbuz1=pbuc1_plus_vbuz2 + // [724] strcpy::destination#1 = rom_release_text + main::$90 -- pbuz1=pbuc1_plus_vbuaa clc adc #strcpy] - // [974] phi strcpy::dst#0 = strcpy::destination#1 [phi:main::@13->strcpy#0] -- register_copy - // [974] phi strcpy::src#0 = main::source [phi:main::@13->strcpy#1] -- pbuz1=pbuc1 + // [987] phi from main::@12 to strcpy [phi:main::@12->strcpy] + // [987] phi strcpy::dst#0 = strcpy::destination#1 [phi:main::@12->strcpy#0] -- register_copy + // [987] phi strcpy::src#0 = main::source [phi:main::@12->strcpy#1] -- pbuz1=pbuc1 lda #source @@ -4571,17 +4469,17 @@ main: { sta.z display_info_rom.info_text sta.z display_info_rom.info_text+1 // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#4 [phi:main::@104->display_info_rom#1] -- register_copy - // [1250] phi display_info_rom::info_status#16 = STATUS_NONE [phi:main::@104->display_info_rom#2] -- vbuz1=vbuc1 + // [1250] phi display_info_rom::info_status#16 = STATUS_NONE [phi:main::@104->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 // main::@105 // for(unsigned char rom_chip=0; rom_chip<8; rom_chip++) // [728] main::rom_chip#1 = ++ main::rom_chip#2 -- vbum1=_inc_vbum1 inc rom_chip - // [99] phi from main::@105 to main::@12 [phi:main::@105->main::@12] - // [99] phi main::rom_chip#2 = main::rom_chip#1 [phi:main::@105->main::@12#0] -- register_copy - jmp __b12 + // [99] phi from main::@105 to main::@11 [phi:main::@105->main::@11] + // [99] phi main::rom_chip#2 = main::rom_chip#1 [phi:main::@105->main::@11#0] -- register_copy + jmp __b11 .segment Data smc_file_version_text: .fill $d, 0 // Fill the version data ... @@ -4609,7 +4507,7 @@ main: { .byte 0 info_text3: .text "VERA installed, OK" .byte 0 - info_text5: .text "VERA not yet supported." + info_text5: .text "VERA not yet supported" .byte 0 info_text6: .text "Checking SMC.BIN ..." .byte 0 @@ -4685,17 +4583,15 @@ main: { .byte 0 s14: .text " flash errors!" .byte 0 - info_text36: .text "OK!" + info_text36: .text "No CX16 component has been updated with new firmware!" .byte 0 - info_text37: .text "No CX16 component has been updated with new firmware!" + info_text37: .text "Update Failure! Your CX16 may be bricked!" .byte 0 - info_text38: .text "Update Failure! Your CX16 may be bricked!" + info_text38: .text "Take a foto of this screen, shut down power and retry!" .byte 0 - info_text39: .text "Take a foto of this screen, shut down power and retry!" + info_text39: .text "Update issues, your CX16 is not updated!" .byte 0 - info_text40: .text "Update issues, your CX16 is not updated!" - .byte 0 - info_text41: .text "Your CX16 update is a success!" + info_text40: .text "Your CX16 update is a success!" .byte 0 s15: .text "(" .byte 0 @@ -4705,68 +4601,36 @@ main: { .byte 0 s19: .text ") Your CX16 will reset ..." .byte 0 - .label main__50 = smc_supported_rom.return - main__67: .byte 0 - .label main__76 = check_status_roms.return - .label main__88 = check_status_roms_less.return - .label main__116 = rom_get_prefix.return - .label main__117 = main__342 - .label main__254 = check_status_roms.return - .label main__259 = check_status_roms.return + main__121: .byte 0 main__286: .byte 0 main__288: .byte 0 - check_status_smc2_main__0: .byte 0 - check_status_smc3_main__0: .byte 0 - check_status_cx16_rom2_check_status_rom1_main__0: .byte 0 - check_status_smc4_main__0: .byte 0 - check_status_cx16_rom3_check_status_rom1_main__0: .byte 0 - check_status_smc5_main__0: .byte 0 - check_status_vera1_main__0: .byte 0 - check_status_vera2_main__0: .byte 0 - check_status_smc9_main__0: .byte 0 - check_status_rom1_main__0: .byte 0 rom_chip: .byte 0 - rom_chip1: .byte 0 intro_status: .byte 0 - .label check_status_smc2_return = check_status_smc2_main__0 + rom_chip1: .byte 0 rom_chip2: .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 = rom_get_prefix.return - .label check_status_smc3_return = check_status_smc3_main__0 - .label check_status_cx16_rom2_check_status_rom1_return = check_status_cx16_rom2_check_status_rom1_main__0 - .label check_status_smc4_return = check_status_smc4_main__0 - .label check_status_cx16_rom3_check_status_rom1_return = check_status_cx16_rom3_check_status_rom1_main__0 - .label check_status_smc5_return = check_status_smc5_main__0 - .label ch = util_wait_key.return - .label check_status_vera1_return = check_status_vera1_main__0 - .label check_status_vera2_return = check_status_vera2_main__0 - .label check_status_smc9_return = check_status_smc9_main__0 - .label ch1 = strchr.c + check_status_smc5_return: .byte 0 + check_status_vera2_return: .byte 0 + check_status_smc9_return: .byte 0 rom_chip3: .byte 0 .label flashed_bytes = smc_flash.return - .label check_status_rom1_return = check_status_rom1_main__0 rom_chip4: .byte 0 rom_bank1: .byte 0 .label file1 = rom_file.return - .label rom_bytes_read1 = rom_read.return - rom_flash_errors: .dword 0 + check_status_smc16_return: .byte 0 + check_status_vera6_return: .byte 0 w: .byte 0 w1: .byte 0 - main__342: .byte 0 - .label main__343 = main__342 - .label main__344 = main__342 } .segment Code // screenlayer1 // Set the layer with which the conio will interact. screenlayer1: { // screenlayer(1, *VERA_L1_MAPBASE, *VERA_L1_CONFIG) - // [729] screenlayer::mapbase#0 = *VERA_L1_MAPBASE -- vbuz1=_deref_pbuc1 - lda VERA_L1_MAPBASE - sta.z screenlayer.mapbase + // [729] screenlayer::mapbase#0 = *VERA_L1_MAPBASE -- vbuxx=_deref_pbuc1 + ldx VERA_L1_MAPBASE // [730] screenlayer::config#0 = *VERA_L1_CONFIG -- vbuz1=_deref_pbuc1 lda VERA_L1_CONFIG sta.z screenlayer.config @@ -4782,23 +4646,18 @@ 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(__zp($db) char color) +// char textcolor(__register(X) char color) textcolor: { - .label textcolor__0 = $de - .label textcolor__1 = $db - .label color = $db // __conio.color & 0xF0 - // [734] textcolor::$0 = *((char *)&__conio+$d) & $f0 -- vbuz1=_deref_pbuc1_band_vbuc2 + // [734] textcolor::$0 = *((char *)&__conio+$d) & $f0 -- vbuaa=_deref_pbuc1_band_vbuc2 lda #$f0 and __conio+$d - sta.z textcolor__0 // __conio.color & 0xF0 | color - // [735] textcolor::$1 = textcolor::$0 | textcolor::color#18 -- vbuz1=vbuz2_bor_vbuz1 - lda.z textcolor__1 - ora.z textcolor__0 - sta.z textcolor__1 + // [735] textcolor::$1 = textcolor::$0 | textcolor::color#18 -- vbuaa=vbuaa_bor_vbuxx + stx.z $ff + ora.z $ff // __conio.color = __conio.color & 0xF0 | color - // [736] *((char *)&__conio+$d) = textcolor::$1 -- _deref_pbuc1=vbuz1 + // [736] *((char *)&__conio+$d) = textcolor::$1 -- _deref_pbuc1=vbuaa sta __conio+$d // textcolor::@return // } @@ -4810,32 +4669,26 @@ textcolor: { // - 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(__zp($db) char color) +// char bgcolor(__register(X) char color) bgcolor: { - .label bgcolor__0 = $dc - .label bgcolor__1 = $db - .label bgcolor__2 = $dc - .label color = $db + .label bgcolor__0 = $bd // __conio.color & 0x0F // [739] bgcolor::$0 = *((char *)&__conio+$d) & $f -- vbuz1=_deref_pbuc1_band_vbuc2 lda #$f and __conio+$d sta.z bgcolor__0 // color << 4 - // [740] bgcolor::$1 = bgcolor::color#14 << 4 -- vbuz1=vbuz1_rol_4 - lda.z bgcolor__1 + // [740] bgcolor::$1 = bgcolor::color#14 << 4 -- vbuaa=vbuxx_rol_4 + txa asl asl asl asl - sta.z bgcolor__1 // __conio.color & 0x0F | color << 4 - // [741] bgcolor::$2 = bgcolor::$0 | bgcolor::$1 -- vbuz1=vbuz1_bor_vbuz2 - lda.z bgcolor__2 - ora.z bgcolor__1 - sta.z bgcolor__2 + // [741] bgcolor::$2 = bgcolor::$0 | bgcolor::$1 -- vbuaa=vbuz1_bor_vbuaa + ora.z bgcolor__0 // __conio.color = __conio.color & 0x0F | color << 4 - // [742] *((char *)&__conio+$d) = bgcolor::$2 -- _deref_pbuc1=vbuz1 + // [742] *((char *)&__conio+$d) = bgcolor::$2 -- _deref_pbuc1=vbuaa sta __conio+$d // bgcolor::@return // } @@ -4896,63 +4749,51 @@ cbm_k_plot_get: { .segment Code // gotoxy // Set the cursor to the specified position -// void gotoxy(__zp($47) char x, __zp($48) char y) +// void gotoxy(__register(X) char x, __register(Y) char y) gotoxy: { - .label gotoxy__2 = $47 - .label gotoxy__3 = $47 - .label gotoxy__6 = $46 - .label gotoxy__7 = $46 - .label gotoxy__8 = $4b - .label gotoxy__9 = $49 - .label gotoxy__10 = $48 - .label x = $47 - .label y = $48 - .label gotoxy__14 = $46 + .label gotoxy__9 = $3a // (x>=__conio.width)?__conio.width:x - // [752] if(gotoxy::x#30>=*((char *)&__conio+6)) goto gotoxy::@1 -- vbuz1_ge__deref_pbuc1_then_la1 - lda.z x - cmp __conio+6 + // [752] if(gotoxy::x#30>=*((char *)&__conio+6)) goto gotoxy::@1 -- vbuxx_ge__deref_pbuc1_then_la1 + cpx __conio+6 bcs __b1 // [754] phi from gotoxy gotoxy::@1 to gotoxy::@2 [phi:gotoxy/gotoxy::@1->gotoxy::@2] // [754] phi gotoxy::$3 = gotoxy::x#30 [phi:gotoxy/gotoxy::@1->gotoxy::@2#0] -- register_copy jmp __b2 // gotoxy::@1 __b1: - // [753] gotoxy::$2 = *((char *)&__conio+6) -- vbuz1=_deref_pbuc1 - lda __conio+6 - sta.z gotoxy__2 + // [753] gotoxy::$2 = *((char *)&__conio+6) -- vbuxx=_deref_pbuc1 + ldx __conio+6 // gotoxy::@2 __b2: // __conio.cursor_x = (x>=__conio.width)?__conio.width:x - // [755] *((char *)&__conio) = gotoxy::$3 -- _deref_pbuc1=vbuz1 - lda.z gotoxy__3 - sta __conio + // [755] *((char *)&__conio) = gotoxy::$3 -- _deref_pbuc1=vbuxx + stx __conio // (y>=__conio.height)?__conio.height:y - // [756] if(gotoxy::y#30>=*((char *)&__conio+7)) goto gotoxy::@3 -- vbuz1_ge__deref_pbuc1_then_la1 - lda.z y - cmp __conio+7 + // [756] if(gotoxy::y#30>=*((char *)&__conio+7)) goto gotoxy::@3 -- vbuyy_ge__deref_pbuc1_then_la1 + cpy __conio+7 bcs __b3 // gotoxy::@4 - // [757] gotoxy::$14 = gotoxy::y#30 -- vbuz1=vbuz2 - sta.z gotoxy__14 + // [757] gotoxy::$14 = gotoxy::y#30 -- vbuaa=vbuyy + tya // [758] phi from gotoxy::@3 gotoxy::@4 to gotoxy::@5 [phi:gotoxy::@3/gotoxy::@4->gotoxy::@5] // [758] 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 - // [759] *((char *)&__conio+1) = gotoxy::$7 -- _deref_pbuc1=vbuz1 - lda.z gotoxy__7 + // [759] *((char *)&__conio+1) = gotoxy::$7 -- _deref_pbuc1=vbuaa sta __conio+1 // __conio.cursor_x << 1 - // [760] gotoxy::$8 = *((char *)&__conio) << 1 -- vbuz1=_deref_pbuc1_rol_1 + // [760] gotoxy::$8 = *((char *)&__conio) << 1 -- vbuxx=_deref_pbuc1_rol_1 lda __conio asl - sta.z gotoxy__8 + tax // __conio.offsets[y] + __conio.cursor_x << 1 - // [761] gotoxy::$10 = gotoxy::y#30 << 1 -- vbuz1=vbuz1_rol_1 - asl.z gotoxy__10 - // [762] gotoxy::$9 = ((unsigned int *)&__conio+$15)[gotoxy::$10] + gotoxy::$8 -- vwuz1=pwuc1_derefidx_vbuz2_plus_vbuz3 - ldy.z gotoxy__10 + // [761] gotoxy::$10 = gotoxy::y#30 << 1 -- vbuaa=vbuyy_rol_1 + tya + asl + // [762] gotoxy::$9 = ((unsigned int *)&__conio+$15)[gotoxy::$10] + gotoxy::$8 -- vwuz1=pwuc1_derefidx_vbuaa_plus_vbuxx + tay + txa clc adc __conio+$15,y sta.z gotoxy__9 @@ -4972,15 +4813,13 @@ gotoxy: { // gotoxy::@3 __b3: // (y>=__conio.height)?__conio.height:y - // [765] gotoxy::$6 = *((char *)&__conio+7) -- vbuz1=_deref_pbuc1 + // [765] gotoxy::$6 = *((char *)&__conio+7) -- vbuaa=_deref_pbuc1 lda __conio+7 - sta.z gotoxy__6 jmp __b5 } // cputln // Print a newline cputln: { - .label cputln__2 = $67 // __conio.cursor_x = 0 // [766] *((char *)&__conio) = 0 -- _deref_pbuc1=vbuc2 lda #0 @@ -4989,11 +4828,10 @@ cputln: { // [767] *((char *)&__conio+1) = ++ *((char *)&__conio+1) -- _deref_pbuc1=_inc__deref_pbuc1 inc __conio+1 // __conio.offset = __conio.offsets[__conio.cursor_y] - // [768] cputln::$2 = *((char *)&__conio+1) << 1 -- vbuz1=_deref_pbuc1_rol_1 + // [768] cputln::$2 = *((char *)&__conio+1) << 1 -- vbuaa=_deref_pbuc1_rol_1 lda __conio+1 asl - sta.z cputln__2 - // [769] *((unsigned int *)&__conio+$13) = ((unsigned int *)&__conio+$15)[cputln::$2] -- _deref_pwuc1=pwuc2_derefidx_vbuz1 + // [769] *((unsigned int *)&__conio+$13) = ((unsigned int *)&__conio+$15)[cputln::$2] -- _deref_pwuc1=pwuc2_derefidx_vbuaa tay lda __conio+$15,y sta __conio+$13 @@ -5021,18 +4859,16 @@ display_frame_init_64: { // Set the charset to lower case. // screenlayer1(); // [733] phi from display_frame_init_64 to textcolor [phi:display_frame_init_64->textcolor] - // [733] phi textcolor::color#18 = WHITE [phi:display_frame_init_64->textcolor#0] -- vbuz1=vbuc1 - lda #WHITE - sta.z textcolor.color + // [733] phi textcolor::color#18 = WHITE [phi:display_frame_init_64->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor // [774] 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 // bgcolor(BLUE) // [775] call bgcolor // [738] phi from display_frame_init_64::@2 to bgcolor [phi:display_frame_init_64::@2->bgcolor] - // [738] phi bgcolor::color#14 = BLUE [phi:display_frame_init_64::@2->bgcolor#0] -- vbuz1=vbuc1 - lda #BLUE - sta.z bgcolor.color + // [738] phi bgcolor::color#14 = BLUE [phi:display_frame_init_64::@2->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // [776] phi from display_frame_init_64::@2 to display_frame_init_64::@3 [phi:display_frame_init_64::@2->display_frame_init_64::@3] // display_frame_init_64::@3 @@ -5117,18 +4953,16 @@ display_frame_draw: { // textcolor(LIGHT_BLUE) // [793] call textcolor // [733] phi from display_frame_draw to textcolor [phi:display_frame_draw->textcolor] - // [733] phi textcolor::color#18 = LIGHT_BLUE [phi:display_frame_draw->textcolor#0] -- vbuz1=vbuc1 - lda #LIGHT_BLUE - sta.z textcolor.color + // [733] phi textcolor::color#18 = LIGHT_BLUE [phi:display_frame_draw->textcolor#0] -- vbuxx=vbuc1 + ldx #LIGHT_BLUE jsr textcolor // [794] phi from display_frame_draw to display_frame_draw::@1 [phi:display_frame_draw->display_frame_draw::@1] // display_frame_draw::@1 // bgcolor(BLUE) // [795] call bgcolor // [738] phi from display_frame_draw::@1 to bgcolor [phi:display_frame_draw::@1->bgcolor] - // [738] phi bgcolor::color#14 = BLUE [phi:display_frame_draw::@1->bgcolor#0] -- vbuz1=vbuc1 - lda #BLUE - sta.z bgcolor.color + // [738] phi bgcolor::color#14 = BLUE [phi:display_frame_draw::@1->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // [796] phi from display_frame_draw::@1 to display_frame_draw::@2 [phi:display_frame_draw::@1->display_frame_draw::@2] // display_frame_draw::@2 @@ -5430,9 +5264,8 @@ display_frame_draw: { // textcolor(WHITE) // [831] call textcolor // [733] phi from display_frame_draw::@19 to textcolor [phi:display_frame_draw::@19->textcolor] - // [733] phi textcolor::color#18 = WHITE [phi:display_frame_draw::@19->textcolor#0] -- vbuz1=vbuc1 - lda #WHITE - sta.z textcolor.color + // [733] phi textcolor::color#18 = WHITE [phi:display_frame_draw::@19->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor // display_frame_draw::@return // } @@ -5450,12 +5283,10 @@ display_frame_title: { // gotoxy(2, 1) // [834] call gotoxy // [751] phi from display_frame_title to gotoxy [phi:display_frame_title->gotoxy] - // [751] phi gotoxy::y#30 = 1 [phi:display_frame_title->gotoxy#0] -- vbuz1=vbuc1 - lda #1 - sta.z gotoxy.y - // [751] phi gotoxy::x#30 = 2 [phi:display_frame_title->gotoxy#1] -- vbuz1=vbuc1 - lda #2 - sta.z gotoxy.x + // [751] phi gotoxy::y#30 = 1 [phi:display_frame_title->gotoxy#0] -- vbuyy=vbuc1 + ldy #1 + // [751] phi gotoxy::x#30 = 2 [phi:display_frame_title->gotoxy#1] -- vbuxx=vbuc1 + ldx #2 jsr gotoxy // [835] phi from display_frame_title to display_frame_title::@1 [phi:display_frame_title->display_frame_title::@1] // display_frame_title::@1 @@ -5487,18 +5318,12 @@ display_frame_title: { // cputsxy // Move cursor and output a NUL-terminated string // Same as "gotoxy (x, y); puts (s);" -// void cputsxy(__zp($61) char x, __zp($36) char y, __zp($2e) const char *s) +// void cputsxy(__register(X) char x, __register(Y) char y, __zp($25) const char *s) cputsxy: { - .label y = $36 - .label s = $2e - .label x = $61 + .label s = $25 // gotoxy(x, y) - // [839] gotoxy::x#1 = cputsxy::x#4 -- vbuz1=vbuz2 - lda.z x - sta.z gotoxy.x - // [840] gotoxy::y#1 = cputsxy::y#4 -- vbuz1=vbuz2 - lda.z y - sta.z gotoxy.y + // [839] gotoxy::x#1 = cputsxy::x#4 + // [840] gotoxy::y#1 = cputsxy::y#4 // [841] call gotoxy // [751] phi from cputsxy to gotoxy [phi:cputsxy->gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#1 [phi:cputsxy->gotoxy#0] -- register_copy @@ -5525,32 +5350,30 @@ cputsxy: { * * @param info_text The progress text to be displayed. */ -// void display_action_progress(__zp($af) char *info_text) +// void display_action_progress(__zp($6e) char *info_text) display_action_progress: { - .label x = $e8 - .label y = $e7 - .label info_text = $af + .label info_text = $6e // unsigned char x = wherex() // [846] call wherex jsr wherex // [847] wherex::return#2 = wherex::return#0 // display_action_progress::@1 - // [848] display_action_progress::x#0 = wherex::return#2 + // [848] display_action_progress::x#0 = wherex::return#2 -- vbum1=vbuaa + sta x // unsigned char y = wherey() // [849] call wherey jsr wherey // [850] wherey::return#2 = wherey::return#0 // display_action_progress::@2 - // [851] display_action_progress::y#0 = wherey::return#2 + // [851] display_action_progress::y#0 = wherey::return#2 -- vbum1=vbuaa + sta y // gotoxy(2, PROGRESS_Y-4) // [852] call gotoxy // [751] phi from display_action_progress::@2 to gotoxy [phi:display_action_progress::@2->gotoxy] - // [751] phi gotoxy::y#30 = PROGRESS_Y-4 [phi:display_action_progress::@2->gotoxy#0] -- vbuz1=vbuc1 - lda #PROGRESS_Y-4 - sta.z gotoxy.y - // [751] phi gotoxy::x#30 = 2 [phi:display_action_progress::@2->gotoxy#1] -- vbuz1=vbuc1 - lda #2 - sta.z gotoxy.x + // [751] phi gotoxy::y#30 = PROGRESS_Y-4 [phi:display_action_progress::@2->gotoxy#0] -- vbuyy=vbuc1 + ldy #PROGRESS_Y-4 + // [751] phi gotoxy::x#30 = 2 [phi:display_action_progress::@2->gotoxy#1] -- vbuxx=vbuc1 + ldx #2 jsr gotoxy // display_action_progress::@3 // printf("%-65s", info_text) @@ -5572,12 +5395,10 @@ display_action_progress: { jsr printf_string // display_action_progress::@4 // gotoxy(x, y) - // [855] gotoxy::x#10 = display_action_progress::x#0 -- vbuz1=vbuz2 - lda.z x - sta.z gotoxy.x - // [856] gotoxy::y#10 = display_action_progress::y#0 -- vbuz1=vbuz2 - lda.z y - sta.z gotoxy.y + // [855] gotoxy::x#10 = display_action_progress::x#0 -- vbuxx=vbum1 + ldx x + // [856] gotoxy::y#10 = display_action_progress::y#0 -- vbuyy=vbum1 + ldy y // [857] call gotoxy // [751] phi from display_action_progress::@4 to gotoxy [phi:display_action_progress::@4->gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#10 [phi:display_action_progress::@4->gotoxy#0] -- register_copy @@ -5587,41 +5408,42 @@ display_action_progress: { // } // [858] return rts + .segment Data + .label x = fopen.pathpos + .label y = fopen.pathcmp } +.segment Code // display_progress_clear /** * @brief Clean the progress area for the flashing. */ display_progress_clear: { .const h = PROGRESS_Y+PROGRESS_H - .label x = $2d - .label i = $36 - .label y = $61 + .label x = $bb + .label i = $eb // textcolor(WHITE) // [860] call textcolor // [733] phi from display_progress_clear to textcolor [phi:display_progress_clear->textcolor] - // [733] phi textcolor::color#18 = WHITE [phi:display_progress_clear->textcolor#0] -- vbuz1=vbuc1 - lda #WHITE - sta.z textcolor.color + // [733] phi textcolor::color#18 = WHITE [phi:display_progress_clear->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor // [861] phi from display_progress_clear to display_progress_clear::@5 [phi:display_progress_clear->display_progress_clear::@5] // display_progress_clear::@5 // bgcolor(BLUE) // [862] call bgcolor // [738] phi from display_progress_clear::@5 to bgcolor [phi:display_progress_clear::@5->bgcolor] - // [738] phi bgcolor::color#14 = BLUE [phi:display_progress_clear::@5->bgcolor#0] -- vbuz1=vbuc1 - lda #BLUE - sta.z bgcolor.color + // [738] phi bgcolor::color#14 = BLUE [phi:display_progress_clear::@5->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // [863] phi from display_progress_clear::@5 to display_progress_clear::@1 [phi:display_progress_clear::@5->display_progress_clear::@1] - // [863] phi display_progress_clear::y#2 = PROGRESS_Y [phi:display_progress_clear::@5->display_progress_clear::@1#0] -- vbuz1=vbuc1 + // [863] phi display_progress_clear::y#2 = PROGRESS_Y [phi:display_progress_clear::@5->display_progress_clear::@1#0] -- vbum1=vbuc1 lda #PROGRESS_Y - sta.z y + sta y // display_progress_clear::@1 __b1: // while (y < h) - // [864] if(display_progress_clear::y#2display_progress_clear::@1] // [863] 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 // display_progress_clear::@3 __b3: // cputcxy(x, y, ' ') - // [869] cputcxy::x#12 = display_progress_clear::x#2 -- vbuz1=vbuz2 - lda.z x - sta.z cputcxy.x - // [870] cputcxy::y#12 = display_progress_clear::y#2 -- vbuz1=vbuz2 - lda.z y - sta.z cputcxy.y + // [869] cputcxy::x#12 = display_progress_clear::x#2 -- vbuxx=vbuz1 + ldx.z x + // [870] cputcxy::y#12 = display_progress_clear::y#2 -- vbuyy=vbum1 + ldy y // [871] call cputcxy // [2068] phi from display_progress_clear::@3 to cputcxy [phi:display_progress_clear::@3->cputcxy] // [2068] phi cputcxy::c#15 = ' ' [phi:display_progress_clear::@3->cputcxy#0] -- vbuz1=vbuc1 @@ -5678,7 +5498,10 @@ display_progress_clear: { // [866] phi display_progress_clear::x#2 = display_progress_clear::x#1 [phi:display_progress_clear::@6->display_progress_clear::@2#0] -- register_copy // [866] 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 Data + .label y = smc_get_version_text.major } +.segment Code // display_chip_smc display_chip_smc: { // display_smc_led(GREY) @@ -5693,11 +5516,11 @@ display_chip_smc: { // display_print_chip(CHIP_SMC_X, CHIP_SMC_Y+2, CHIP_SMC_W, "SMC ") // [877] call display_print_chip // [2082] phi from display_chip_smc::@1 to display_print_chip [phi:display_chip_smc::@1->display_print_chip] - // [2082] phi display_print_chip::text#11 = display_chip_smc::text [phi:display_chip_smc::@1->display_print_chip#0] -- pbum1=pbuc1 + // [2082] phi display_print_chip::text#11 = display_chip_smc::text [phi:display_chip_smc::@1->display_print_chip#0] -- pbuz1=pbuc1 lda #text - sta display_print_chip.text_2+1 + sta.z display_print_chip.text_2+1 // [2082] phi display_print_chip::w#10 = 5 [phi:display_chip_smc::@1->display_print_chip#1] -- vbuz1=vbuc1 lda #5 sta.z display_print_chip.w @@ -5728,11 +5551,11 @@ display_chip_vera: { // display_print_chip(CHIP_VERA_X, CHIP_VERA_Y+2, CHIP_VERA_W, "VERA ") // [882] call display_print_chip // [2082] phi from display_chip_vera::@1 to display_print_chip [phi:display_chip_vera::@1->display_print_chip] - // [2082] phi display_print_chip::text#11 = display_chip_vera::text [phi:display_chip_vera::@1->display_print_chip#0] -- pbum1=pbuc1 + // [2082] phi display_print_chip::text#11 = display_chip_vera::text [phi:display_chip_vera::@1->display_print_chip#0] -- pbuz1=pbuc1 lda #text - sta display_print_chip.text_2+1 + sta.z display_print_chip.text_2+1 // [2082] phi display_print_chip::w#10 = 8 [phi:display_chip_vera::@1->display_print_chip#1] -- vbuz1=vbuc1 lda #8 sta.z display_print_chip.w @@ -5755,19 +5578,16 @@ display_chip_vera: { * */ display_chip_rom: { - .label display_chip_rom__4 = $e8 - .label display_chip_rom__6 = $da - .label display_chip_rom__11 = $fb - .label display_chip_rom__12 = $fb + .label r = $d1 // [885] phi from display_chip_rom to display_chip_rom::@1 [phi:display_chip_rom->display_chip_rom::@1] - // [885] phi display_chip_rom::r#2 = 0 [phi:display_chip_rom->display_chip_rom::@1#0] -- vbum1=vbuc1 + // [885] phi display_chip_rom::r#2 = 0 [phi:display_chip_rom->display_chip_rom::@1#0] -- vbuz1=vbuc1 lda #0 - sta r + sta.z r // display_chip_rom::@1 __b1: // for (unsigned char r = 0; r < 8; r++) - // [886] if(display_chip_rom::r#2<8) goto display_chip_rom::@2 -- vbum1_lt_vbuc1_then_la1 - lda r + // [886] if(display_chip_rom::r#2<8) goto display_chip_rom::@2 -- vbuz1_lt_vbuc1_then_la1 + lda.z r cmp #8 bcc __b2 // display_chip_rom::@return @@ -5779,13 +5599,13 @@ display_chip_rom: { __b2: // strcpy(rom, "ROM ") // [889] call strcpy - // [974] phi from display_chip_rom::@2 to strcpy [phi:display_chip_rom::@2->strcpy] - // [974] phi strcpy::dst#0 = display_chip_rom::rom [phi:display_chip_rom::@2->strcpy#0] -- pbuz1=pbuc1 + // [987] phi from display_chip_rom::@2 to strcpy [phi:display_chip_rom::@2->strcpy] + // [987] phi strcpy::dst#0 = display_chip_rom::rom [phi:display_chip_rom::@2->strcpy#0] -- pbuz1=pbuc1 lda #rom sta.z strcpy.dst+1 - // [974] phi strcpy::src#0 = display_chip_rom::source [phi:display_chip_rom::@2->strcpy#1] -- pbuz1=pbuc1 + // [987] phi strcpy::src#0 = display_chip_rom::source [phi:display_chip_rom::@2->strcpy#1] -- pbuz1=pbuc1 lda #source @@ -5793,39 +5613,38 @@ display_chip_rom: { jsr strcpy // display_chip_rom::@5 // strcat(rom, rom_size_strings[r]) - // [890] display_chip_rom::$11 = display_chip_rom::r#2 << 1 -- vbuz1=vbum2_rol_1 - lda r + // [890] display_chip_rom::$11 = display_chip_rom::r#2 << 1 -- vbum1=vbuz2_rol_1 + lda.z r asl - sta.z display_chip_rom__11 - // [891] strcat::source#0 = rom_size_strings[display_chip_rom::$11] -- pbum1=qbuc1_derefidx_vbuz2 + sta display_chip_rom__11 + // [891] strcat::source#0 = rom_size_strings[display_chip_rom::$11] -- pbuz1=qbuc1_derefidx_vbum2 tay lda rom_size_strings,y - sta strcat.source + sta.z strcat.source lda rom_size_strings+1,y - sta strcat.source+1 + sta.z strcat.source+1 // [892] call strcat // [2132] phi from display_chip_rom::@5 to strcat [phi:display_chip_rom::@5->strcat] jsr strcat // display_chip_rom::@6 // if(r) - // [893] if(0==display_chip_rom::r#2) goto display_chip_rom::@3 -- 0_eq_vbum1_then_la1 - lda r + // [893] if(0==display_chip_rom::r#2) goto display_chip_rom::@3 -- 0_eq_vbuz1_then_la1 + lda.z r beq __b3 // display_chip_rom::@4 // r+'0' - // [894] display_chip_rom::$4 = display_chip_rom::r#2 + '0' -- vbuz1=vbum2_plus_vbuc1 + // [894] display_chip_rom::$4 = display_chip_rom::r#2 + '0' -- vbuaa=vbuz1_plus_vbuc1 lda #'0' clc - adc r - sta.z display_chip_rom__4 + adc.z r // *(rom+3) = r+'0' - // [895] *(display_chip_rom::rom+3) = display_chip_rom::$4 -- _deref_pbuc1=vbuz1 + // [895] *(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) - // [896] display_rom_led::chip#0 = display_chip_rom::r#2 -- vbuz1=vbum2 - lda r + // [896] display_rom_led::chip#0 = display_chip_rom::r#2 -- vbuz1=vbuz2 + lda.z r sta.z display_rom_led.chip // [897] call display_rom_led // [2144] phi from display_chip_rom::@3 to display_rom_led [phi:display_chip_rom::@3->display_rom_led] @@ -5836,27 +5655,24 @@ display_chip_rom: { jsr display_rom_led // display_chip_rom::@7 // r*6 - // [898] display_chip_rom::$12 = display_chip_rom::$11 + display_chip_rom::r#2 -- vbuz1=vbuz1_plus_vbum2 - lda r + // [898] display_chip_rom::$12 = display_chip_rom::$11 + display_chip_rom::r#2 -- vbuaa=vbum1_plus_vbuz2 + lda display_chip_rom__11 clc - adc.z display_chip_rom__12 - sta.z display_chip_rom__12 - // [899] display_chip_rom::$6 = display_chip_rom::$12 << 1 -- vbuz1=vbuz2_rol_1 + adc.z r + // [899] 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) - // [900] display_print_chip::x#2 = $14 + display_chip_rom::$6 -- vbuz1=vbuc1_plus_vbuz1 - lda #$14 + // [900] 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 // [901] call display_print_chip // [2082] phi from display_chip_rom::@7 to display_print_chip [phi:display_chip_rom::@7->display_print_chip] - // [2082] phi display_print_chip::text#11 = display_chip_rom::rom [phi:display_chip_rom::@7->display_print_chip#0] -- pbum1=pbuc1 + // [2082] phi display_print_chip::text#11 = display_chip_rom::rom [phi:display_chip_rom::@7->display_print_chip#0] -- pbuz1=pbuc1 lda #rom - sta display_print_chip.text_2+1 + sta.z display_print_chip.text_2+1 // [2082] phi display_print_chip::w#10 = 3 [phi:display_chip_rom::@7->display_print_chip#1] -- vbuz1=vbuc1 lda #3 sta.z display_print_chip.w @@ -5864,8 +5680,8 @@ display_chip_rom: { jsr display_print_chip // display_chip_rom::@8 // for (unsigned char r = 0; r < 8; r++) - // [902] display_chip_rom::r#1 = ++ display_chip_rom::r#2 -- vbum1=_inc_vbum1 - inc r + // [902] display_chip_rom::r#1 = ++ display_chip_rom::r#2 -- vbuz1=_inc_vbuz1 + inc.z r // [885] phi from display_chip_rom::@8 to display_chip_rom::@1 [phi:display_chip_rom::@8->display_chip_rom::@1] // [885] 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 @@ -5873,7 +5689,7 @@ display_chip_rom: { rom: .fill $10, 0 source: .text "ROM " .byte 0 - .label r = rom_get_prefix.return + .label display_chip_rom__11 = smc_flash.smc_bootloader_start } .segment Code // display_info_smc @@ -5884,34 +5700,32 @@ display_chip_rom: { * * @remark The smc_booloader is a global variable. */ -// void display_info_smc(__mem() char info_status, __zp($4c) char *info_text) +// void display_info_smc(__zp($d0) char info_status, __zp($3c) char *info_text) display_info_smc: { - .label x = $d9 - .label y = $cd - .label info_text = $4c + .label x = $b0 + .label info_status = $d0 + .label info_text = $3c // unsigned char x = wherex() // [904] call wherex jsr wherex - // [905] wherex::return#10 = wherex::return#0 -- vbuz1=vbuz2 - lda.z wherex.return - sta.z wherex.return_2 + // [905] wherex::return#10 = wherex::return#0 // display_info_smc::@3 - // [906] display_info_smc::x#0 = wherex::return#10 + // [906] display_info_smc::x#0 = wherex::return#10 -- vbuz1=vbuaa + sta.z x // unsigned char y = wherey() // [907] call wherey jsr wherey - // [908] wherey::return#10 = wherey::return#0 -- vbuz1=vbuz2 - lda.z wherey.return - sta.z wherey.return_2 + // [908] wherey::return#10 = wherey::return#0 // display_info_smc::@4 - // [909] display_info_smc::y#0 = wherey::return#10 + // [909] display_info_smc::y#0 = wherey::return#10 -- vbum1=vbuaa + sta y // status_smc = info_status - // [910] status_smc#0 = display_info_smc::info_status#18 -- vbum1=vbum2 - lda info_status + // [910] status_smc#0 = display_info_smc::info_status#18 -- vbum1=vbuz2 + lda.z info_status sta status_smc // display_smc_led(status_color[info_status]) - // [911] display_smc_led::c#1 = status_color[display_info_smc::info_status#18] -- vbuz1=pbuc1_derefidx_vbum2 - ldy info_status + // [911] display_smc_led::c#1 = status_color[display_info_smc::info_status#18] -- vbuz1=pbuc1_derefidx_vbuz2 + ldy.z info_status lda status_color,y sta.z display_smc_led.c // [912] call display_smc_led @@ -5923,12 +5737,10 @@ display_info_smc: { // gotoxy(INFO_X, INFO_Y) // [914] call gotoxy // [751] phi from display_info_smc::@5 to gotoxy [phi:display_info_smc::@5->gotoxy] - // [751] phi gotoxy::y#30 = $11 [phi:display_info_smc::@5->gotoxy#0] -- vbuz1=vbuc1 - lda #$11 - sta.z gotoxy.y - // [751] phi gotoxy::x#30 = 4 [phi:display_info_smc::@5->gotoxy#1] -- vbuz1=vbuc1 - lda #4 - sta.z gotoxy.x + // [751] phi gotoxy::y#30 = $11 [phi:display_info_smc::@5->gotoxy#0] -- vbuyy=vbuc1 + ldy #$11 + // [751] phi gotoxy::x#30 = 4 [phi:display_info_smc::@5->gotoxy#1] -- vbuxx=vbuc1 + ldx #4 jsr gotoxy // [915] phi from display_info_smc::@5 to display_info_smc::@6 [phi:display_info_smc::@5->display_info_smc::@6] // display_info_smc::@6 @@ -5948,10 +5760,11 @@ 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) - // [917] display_info_smc::$8 = display_info_smc::info_status#18 << 1 -- vbum1=vbum1_rol_1 - asl display_info_smc__8 - // [918] printf_string::str#3 = status_text[display_info_smc::$8] -- pbuz1=qbuc1_derefidx_vbum2 - ldy display_info_smc__8 + // [917] display_info_smc::$8 = display_info_smc::info_status#18 << 1 -- vbuaa=vbuz1_rol_1 + lda.z info_status + asl + // [918] printf_string::str#3 = status_text[display_info_smc::$8] -- pbuz1=qbuc1_derefidx_vbuaa + tay lda status_text,y sta.z printf_string.str lda status_text+1,y @@ -6033,21 +5846,20 @@ display_info_smc: { lda smc_bootloader_1+1 sta.z printf_uint.uvalue+1 // [927] call printf_uint - // [1839] phi from display_info_smc::@11 to printf_uint [phi:display_info_smc::@11->printf_uint] - // [1839] phi printf_uint::format_zero_padding#14 = 0 [phi:display_info_smc::@11->printf_uint#0] -- vbuz1=vbuc1 + // [1828] phi from display_info_smc::@11 to printf_uint [phi:display_info_smc::@11->printf_uint] + // [1828] phi printf_uint::format_zero_padding#14 = 0 [phi:display_info_smc::@11->printf_uint#0] -- vbuz1=vbuc1 lda #0 sta.z printf_uint.format_zero_padding - // [1839] phi printf_uint::format_min_length#14 = 0 [phi:display_info_smc::@11->printf_uint#1] -- vbuz1=vbuc1 + // [1828] phi printf_uint::format_min_length#14 = 0 [phi:display_info_smc::@11->printf_uint#1] -- vbuz1=vbuc1 sta.z printf_uint.format_min_length - // [1839] phi printf_uint::putc#14 = &cputc [phi:display_info_smc::@11->printf_uint#2] -- pprz1=pprc1 + // [1828] phi printf_uint::putc#14 = &cputc [phi:display_info_smc::@11->printf_uint#2] -- pprz1=pprc1 lda #cputc sta.z printf_uint.putc+1 - // [1839] phi printf_uint::format_radix#14 = DECIMAL [phi:display_info_smc::@11->printf_uint#3] -- vbuz1=vbuc1 - lda #DECIMAL - sta.z printf_uint.format_radix - // [1839] phi printf_uint::uvalue#14 = printf_uint::uvalue#0 [phi:display_info_smc::@11->printf_uint#4] -- register_copy + // [1828] phi printf_uint::format_radix#14 = DECIMAL [phi:display_info_smc::@11->printf_uint#3] -- vbuxx=vbuc1 + ldx #DECIMAL + // [1828] phi printf_uint::uvalue#14 = printf_uint::uvalue#0 [phi:display_info_smc::@11->printf_uint#4] -- register_copy jsr printf_uint // [928] phi from display_info_smc::@11 to display_info_smc::@12 [phi:display_info_smc::@11->display_info_smc::@12] // display_info_smc::@12 @@ -6100,12 +5912,10 @@ display_info_smc: { // display_info_smc::@1 __b1: // gotoxy(x, y) - // [933] gotoxy::x#14 = display_info_smc::x#0 -- vbuz1=vbuz2 - lda.z x - sta.z gotoxy.x - // [934] gotoxy::y#14 = display_info_smc::y#0 -- vbuz1=vbuz2 - lda.z y - sta.z gotoxy.y + // [933] gotoxy::x#14 = display_info_smc::x#0 -- vbuxx=vbuz1 + ldx.z x + // [934] gotoxy::y#14 = display_info_smc::y#0 -- vbuyy=vbum1 + ldy y // [935] call gotoxy // [751] phi from display_info_smc::@1 to gotoxy [phi:display_info_smc::@1->gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#14 [phi:display_info_smc::@1->gotoxy#0] -- register_copy @@ -6122,8 +5932,7 @@ display_info_smc: { .byte 0 s2: .text " BL:" .byte 0 - .label display_info_smc__8 = smc_supported_rom.return - .label info_status = smc_supported_rom.return + .label y = fclose.sp } .segment Code // display_info_vera @@ -6132,29 +5941,26 @@ display_info_smc: { * * @param info_status The STATUS_ */ -// void display_info_vera(__zp($e2) char info_status, __zp($5d) char *info_text) +// void display_info_vera(__zp($be) char info_status, __zp($4b) char *info_text) display_info_vera: { - .label display_info_vera__8 = $e2 - .label x = $eb - .label y = $b6 - .label info_status = $e2 - .label info_text = $5d + .label x = $38 + .label y = $2e + .label info_status = $be + .label info_text = $4b // unsigned char x = wherex() // [938] call wherex jsr wherex - // [939] wherex::return#11 = wherex::return#0 -- vbuz1=vbuz2 - lda.z wherex.return - sta.z wherex.return_3 + // [939] wherex::return#11 = wherex::return#0 // display_info_vera::@3 - // [940] display_info_vera::x#0 = wherex::return#11 + // [940] display_info_vera::x#0 = wherex::return#11 -- vbuz1=vbuaa + sta.z x // unsigned char y = wherey() // [941] call wherey jsr wherey - // [942] wherey::return#11 = wherey::return#0 -- vbuz1=vbuz2 - lda.z wherey.return - sta.z wherey.return_3 + // [942] wherey::return#11 = wherey::return#0 // display_info_vera::@4 - // [943] display_info_vera::y#0 = wherey::return#11 + // [943] display_info_vera::y#0 = wherey::return#11 -- vbuz1=vbuaa + sta.z y // status_vera = info_status // [944] status_vera#0 = display_info_vera::info_status#4 -- vbum1=vbuz2 lda.z info_status @@ -6173,12 +5979,10 @@ display_info_vera: { // gotoxy(INFO_X, INFO_Y+1) // [948] call gotoxy // [751] phi from display_info_vera::@5 to gotoxy [phi:display_info_vera::@5->gotoxy] - // [751] phi gotoxy::y#30 = $11+1 [phi:display_info_vera::@5->gotoxy#0] -- vbuz1=vbuc1 - lda #$11+1 - sta.z gotoxy.y - // [751] phi gotoxy::x#30 = 4 [phi:display_info_vera::@5->gotoxy#1] -- vbuz1=vbuc1 - lda #4 - sta.z gotoxy.x + // [751] phi gotoxy::y#30 = $11+1 [phi:display_info_vera::@5->gotoxy#0] -- vbuyy=vbuc1 + ldy #$11+1 + // [751] phi gotoxy::x#30 = 4 [phi:display_info_vera::@5->gotoxy#1] -- vbuxx=vbuc1 + ldx #4 jsr gotoxy // [949] phi from display_info_vera::@5 to display_info_vera::@6 [phi:display_info_vera::@5->display_info_vera::@6] // display_info_vera::@6 @@ -6198,10 +6002,11 @@ display_info_vera: { jsr printf_str // display_info_vera::@7 // printf("VERA %-9s FPGA ", status_text[info_status]) - // [951] display_info_vera::$8 = display_info_vera::info_status#4 << 1 -- vbuz1=vbuz1_rol_1 - asl.z display_info_vera__8 - // [952] printf_string::str#6 = status_text[display_info_vera::$8] -- pbuz1=qbuc1_derefidx_vbuz2 - ldy.z display_info_vera__8 + // [951] display_info_vera::$8 = display_info_vera::info_status#4 << 1 -- vbuaa=vbuz1_rol_1 + lda.z info_status + asl + // [952] printf_string::str#6 = status_text[display_info_vera::$8] -- pbuz1=qbuc1_derefidx_vbuaa + tay lda status_text,y sta.z printf_string.str lda status_text+1,y @@ -6271,26 +6076,107 @@ display_info_vera: { jsr printf_string // display_info_vera::@1 __b1: - // gotoxy(x, y) - // [959] gotoxy::x#16 = display_info_vera::x#0 -- vbuz1=vbuz2 - lda.z x - sta.z gotoxy.x - // [960] gotoxy::y#16 = display_info_vera::y#0 -- vbuz1=vbuz2 - lda.z y - sta.z gotoxy.y - // [961] call gotoxy - // [751] phi from display_info_vera::@1 to gotoxy [phi:display_info_vera::@1->gotoxy] - // [751] phi gotoxy::y#30 = gotoxy::y#16 [phi:display_info_vera::@1->gotoxy#0] -- register_copy - // [751] phi gotoxy::x#30 = gotoxy::x#16 [phi:display_info_vera::@1->gotoxy#1] -- register_copy - jsr gotoxy - // display_info_vera::@return + // gotoxy(x, y) + // [959] gotoxy::x#16 = display_info_vera::x#0 -- vbuxx=vbuz1 + ldx.z x + // [960] gotoxy::y#16 = display_info_vera::y#0 -- vbuyy=vbuz1 + ldy.z y + // [961] call gotoxy + // [751] phi from display_info_vera::@1 to gotoxy [phi:display_info_vera::@1->gotoxy] + // [751] phi gotoxy::y#30 = gotoxy::y#16 [phi:display_info_vera::@1->gotoxy#0] -- register_copy + // [751] phi gotoxy::x#30 = gotoxy::x#16 [phi:display_info_vera::@1->gotoxy#1] -- register_copy + jsr gotoxy + // display_info_vera::@return + // } + // [962] return + rts + .segment Data + s: .text "VERA " + .byte 0 + s1: .text " FPGA " + .byte 0 +} +.segment Code + // display_progress_text +/** + * @brief Print a block of text within the progress frame with a count of lines. + * + * @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($49) char **text, __zp($c2) char lines) +display_progress_text: { + .label lines = $c2 + .label text = $49 + // display_progress_clear() + // [964] call display_progress_clear + // [859] phi from display_progress_text to display_progress_clear [phi:display_progress_text->display_progress_clear] + jsr display_progress_clear + // [965] phi from display_progress_text to display_progress_text::@1 [phi:display_progress_text->display_progress_text::@1] + // [965] phi display_progress_text::l#2 = 0 [phi:display_progress_text->display_progress_text::@1#0] -- vbum1=vbuc1 + lda #0 + sta l + // display_progress_text::@1 + __b1: + // for(unsigned char l=0; ldisplay_progress_text::@1] + // [965] 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 - s: .text "VERA " - .byte 0 - s1: .text " FPGA " + .label l = smc_flash.smc_package_committed +} +.segment Code + // util_wait_space +util_wait_space: { + // util_wait_key("Press [SPACE] to continue ...", " ") + // [974] call util_wait_key + // [1741] phi from util_wait_space to util_wait_key [phi:util_wait_space->util_wait_key] + // [1741] phi util_wait_key::filter#13 = s [phi:util_wait_space->util_wait_key#0] -- pbuz1=pbuc1 + lda #s + sta.z util_wait_key.filter+1 + // [1741] phi util_wait_key::info_text#3 = util_wait_space::info_text [phi:util_wait_space->util_wait_key#1] -- pbuz1=pbuc1 + lda #info_text + sta.z util_wait_key.info_text+1 + jsr util_wait_key + // util_wait_space::@return + // } + // [975] return + rts + .segment Data + info_text: .text "Press [SPACE] to continue ..." .byte 0 } .segment Code @@ -6303,32 +6189,31 @@ display_info_vera: { * @return unsigned int 0x0200 if there is a technical error reading or detecting the SMC chip. */ smc_detect: { - .label smc_detect__1 = $e7 // When the bootloader is not present, 0xFF is returned. - .label smc_bootloader_version = $2e - .label return = $2e + .label smc_bootloader_version = $25 + .label return = $25 // cx16_k_i2c_read_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_OFFSET) - // [963] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 + // [976] cx16_k_i2c_read_byte::device = $42 -- vbum1=vbuc1 lda #$42 sta cx16_k_i2c_read_byte.device - // [964] cx16_k_i2c_read_byte::offset = $8e -- vbum1=vbuc1 + // [977] cx16_k_i2c_read_byte::offset = $8e -- vbum1=vbuc1 lda #$8e sta cx16_k_i2c_read_byte.offset - // [965] call cx16_k_i2c_read_byte + // [978] call cx16_k_i2c_read_byte jsr cx16_k_i2c_read_byte - // [966] cx16_k_i2c_read_byte::return#10 = cx16_k_i2c_read_byte::return#1 + // [979] 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) - // [967] smc_detect::smc_bootloader_version#1 = cx16_k_i2c_read_byte::return#10 + // [980] smc_detect::smc_bootloader_version#1 = cx16_k_i2c_read_byte::return#10 // BYTE1(smc_bootloader_version) - // [968] smc_detect::$1 = byte1 smc_detect::smc_bootloader_version#1 -- vbuz1=_byte1_vwuz2 + // [981] smc_detect::$1 = byte1 smc_detect::smc_bootloader_version#1 -- vbuaa=_byte1_vwuz1 lda.z smc_bootloader_version+1 - sta.z smc_detect__1 // if(!BYTE1(smc_bootloader_version)) - // [969] if(0==smc_detect::$1) goto smc_detect::@1 -- 0_eq_vbuz1_then_la1 + // [982] if(0==smc_detect::$1) goto smc_detect::@1 -- 0_eq_vbuaa_then_la1 + cmp #0 beq __b1 - // [972] phi from smc_detect::@3 to smc_detect::@2 [phi:smc_detect::@3->smc_detect::@2] - // [972] phi smc_detect::return#0 = $200 [phi:smc_detect::@3->smc_detect::@2#0] -- vwuz1=vwuc1 + // [985] phi from smc_detect::@3 to smc_detect::@2 [phi:smc_detect::@3->smc_detect::@2] + // [985] phi smc_detect::return#0 = $200 [phi:smc_detect::@3->smc_detect::@2#0] -- vwuz1=vwuc1 lda #<$200 sta.z return lda #>$200 @@ -6337,72 +6222,72 @@ smc_detect: { // smc_detect::@1 __b1: // if(smc_bootloader_version == 0xFF) - // [970] if(smc_detect::smc_bootloader_version#1!=$ff) goto smc_detect::@4 -- vwuz1_neq_vbuc1_then_la1 + // [983] 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 - // [972] phi from smc_detect::@1 to smc_detect::@2 [phi:smc_detect::@1->smc_detect::@2] - // [972] phi smc_detect::return#0 = $100 [phi:smc_detect::@1->smc_detect::@2#0] -- vwuz1=vwuc1 + // [985] phi from smc_detect::@1 to smc_detect::@2 [phi:smc_detect::@1->smc_detect::@2] + // [985] 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 - // [971] phi from smc_detect::@1 to smc_detect::@4 [phi:smc_detect::@1->smc_detect::@4] + // [984] phi from smc_detect::@1 to smc_detect::@4 [phi:smc_detect::@1->smc_detect::@4] // smc_detect::@4 - // [972] phi from smc_detect::@4 to smc_detect::@2 [phi:smc_detect::@4->smc_detect::@2] - // [972] phi smc_detect::return#0 = smc_detect::smc_bootloader_version#1 [phi:smc_detect::@4->smc_detect::@2#0] -- register_copy + // [985] phi from smc_detect::@4 to smc_detect::@2 [phi:smc_detect::@4->smc_detect::@2] + // [985] 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 // } - // [973] return + // [986] 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($4c) char *destination, char *source) +// char * strcpy(__zp($3c) char *destination, char *source) strcpy: { - .label src = $af - .label dst = $4c - .label destination = $4c - // [975] phi from strcpy strcpy::@2 to strcpy::@1 [phi:strcpy/strcpy::@2->strcpy::@1] - // [975] phi strcpy::dst#2 = strcpy::dst#0 [phi:strcpy/strcpy::@2->strcpy::@1#0] -- register_copy - // [975] phi strcpy::src#2 = strcpy::src#0 [phi:strcpy/strcpy::@2->strcpy::@1#1] -- register_copy + .label src = $6e + .label dst = $3c + .label destination = $3c + // [988] phi from strcpy strcpy::@2 to strcpy::@1 [phi:strcpy/strcpy::@2->strcpy::@1] + // [988] phi strcpy::dst#2 = strcpy::dst#0 [phi:strcpy/strcpy::@2->strcpy::@1#0] -- register_copy + // [988] phi strcpy::src#2 = strcpy::src#0 [phi:strcpy/strcpy::@2->strcpy::@1#1] -- register_copy // strcpy::@1 __b1: // while(*src) - // [976] if(0!=*strcpy::src#2) goto strcpy::@2 -- 0_neq__deref_pbuz1_then_la1 + // [989] 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 - // [977] *strcpy::dst#2 = 0 -- _deref_pbuz1=vbuc1 + // [990] *strcpy::dst#2 = 0 -- _deref_pbuz1=vbuc1 tya tay sta (dst),y // strcpy::@return // } - // [978] return + // [991] return rts // strcpy::@2 __b2: // *dst++ = *src++ - // [979] *strcpy::dst#2 = *strcpy::src#2 -- _deref_pbuz1=_deref_pbuz2 + // [992] *strcpy::dst#2 = *strcpy::src#2 -- _deref_pbuz1=_deref_pbuz2 ldy #0 lda (src),y sta (dst),y // *dst++ = *src++; - // [980] strcpy::dst#1 = ++ strcpy::dst#2 -- pbuz1=_inc_pbuz1 + // [993] strcpy::dst#1 = ++ strcpy::dst#2 -- pbuz1=_inc_pbuz1 inc.z dst bne !+ inc.z dst+1 !: - // [981] strcpy::src#1 = ++ strcpy::src#2 -- pbuz1=_inc_pbuz1 + // [994] strcpy::src#1 = ++ strcpy::src#2 -- pbuz1=_inc_pbuz1 inc.z src bne !+ inc.z src+1 @@ -6420,11 +6305,11 @@ strcpy: { * LDY #$20 ; start of NVRAM inside RTC * JSR i2c_read_byte ; read first byte of NVRAM */ -// __zp($2e) unsigned int cx16_k_i2c_read_byte(__mem() volatile char device, __mem() volatile char offset) +// __zp($25) unsigned int cx16_k_i2c_read_byte(__mem() volatile char device, __mem() volatile char offset) cx16_k_i2c_read_byte: { - .label return = $2e + .label return = $25 // unsigned int result - // [982] cx16_k_i2c_read_byte::result = 0 -- vwum1=vwuc1 + // [995] cx16_k_i2c_read_byte::result = 0 -- vwum1=vwuc1 lda #<0 sta result sta result+1 @@ -6437,14 +6322,14 @@ cx16_k_i2c_read_byte: { sta result rol result+1 // return result; - // [984] cx16_k_i2c_read_byte::return#0 = cx16_k_i2c_read_byte::result -- vwuz1=vwum2 + // [997] cx16_k_i2c_read_byte::return#0 = cx16_k_i2c_read_byte::result -- vwuz1=vwum2 sta.z return lda result+1 sta.z return+1 // cx16_k_i2c_read_byte::@return // } - // [985] cx16_k_i2c_read_byte::return#1 = cx16_k_i2c_read_byte::return#0 - // [986] return + // [998] cx16_k_i2c_read_byte::return#1 = cx16_k_i2c_read_byte::return#0 + // [999] return rts .segment Data device: .byte 0 @@ -6458,22 +6343,22 @@ cx16_k_i2c_read_byte: { * * @param version_string The string containing the SMC version filled upon return. */ -// unsigned long smc_get_version_text(__zp($5d) char *version_string, __zp($30) char release, __zp($2d) char major, __zp($64) char minor) +// unsigned long smc_get_version_text(__zp($4b) char *version_string, __register(Y) char release, __mem() char major, __zp($eb) char minor) smc_get_version_text: { - .label release = $30 - .label major = $2d - .label minor = $64 - .label version_string = $5d + .label minor = $eb + .label version_string = $4b // sprintf(version_string, "%u.%u.%u", release, major, minor) - // [988] snprintf_init::s#0 = smc_get_version_text::version_string#2 - // [989] call snprintf_init + // [1001] snprintf_init::s#0 = smc_get_version_text::version_string#2 + // [1002] call snprintf_init // [1133] phi from smc_get_version_text to snprintf_init [phi:smc_get_version_text->snprintf_init] // [1133] phi snprintf_init::s#26 = snprintf_init::s#0 [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) - // [990] printf_uchar::uvalue#1 = smc_get_version_text::release#2 - // [991] call printf_uchar + // [1003] printf_uchar::uvalue#1 = smc_get_version_text::release#2 -- vbuxx=vbuyy + tya + tax + // [1004] call printf_uchar // [1207] phi from smc_get_version_text::@1 to printf_uchar [phi:smc_get_version_text::@1->printf_uchar] // [1207] phi printf_uchar::format_zero_padding#14 = 0 [phi:smc_get_version_text::@1->printf_uchar#0] -- vbuz1=vbuc1 lda #0 @@ -6485,15 +6370,14 @@ smc_get_version_text: { sta.z printf_uchar.putc lda #>snputc sta.z printf_uchar.putc+1 - // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:smc_get_version_text::@1->printf_uchar#3] -- vbuz1=vbuc1 - lda #DECIMAL - sta.z printf_uchar.format_radix + // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:smc_get_version_text::@1->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL // [1207] phi printf_uchar::uvalue#14 = printf_uchar::uvalue#1 [phi:smc_get_version_text::@1->printf_uchar#4] -- register_copy jsr printf_uchar - // [992] phi from smc_get_version_text::@1 to smc_get_version_text::@2 [phi:smc_get_version_text::@1->smc_get_version_text::@2] + // [1005] 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) - // [993] call printf_str + // [1006] call printf_str // [1138] phi from smc_get_version_text::@2 to printf_str [phi:smc_get_version_text::@2->printf_str] // [1138] phi printf_str::putc#71 = &snputc [phi:smc_get_version_text::@2->printf_str#0] -- pprz1=pprc1 lda #printf_uchar] // [1207] phi printf_uchar::format_zero_padding#14 = 0 [phi:smc_get_version_text::@3->printf_uchar#0] -- vbuz1=vbuc1 lda #0 @@ -6523,15 +6406,14 @@ smc_get_version_text: { sta.z printf_uchar.putc lda #>snputc sta.z printf_uchar.putc+1 - // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:smc_get_version_text::@3->printf_uchar#3] -- vbuz1=vbuc1 - lda #DECIMAL - sta.z printf_uchar.format_radix + // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:smc_get_version_text::@3->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL // [1207] phi printf_uchar::uvalue#14 = printf_uchar::uvalue#2 [phi:smc_get_version_text::@3->printf_uchar#4] -- register_copy jsr printf_uchar - // [996] phi from smc_get_version_text::@3 to smc_get_version_text::@4 [phi:smc_get_version_text::@3->smc_get_version_text::@4] + // [1009] 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) - // [997] call printf_str + // [1010] call printf_str // [1138] phi from smc_get_version_text::@4 to printf_str [phi:smc_get_version_text::@4->printf_str] // [1138] phi printf_str::putc#71 = &snputc [phi:smc_get_version_text::@4->printf_str#0] -- pprz1=pprc1 lda #printf_uchar] // [1207] phi printf_uchar::format_zero_padding#14 = 0 [phi:smc_get_version_text::@5->printf_uchar#0] -- vbuz1=vbuc1 lda #0 @@ -6561,46 +6442,39 @@ smc_get_version_text: { sta.z printf_uchar.putc lda #>snputc sta.z printf_uchar.putc+1 - // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:smc_get_version_text::@5->printf_uchar#3] -- vbuz1=vbuc1 - lda #DECIMAL - sta.z printf_uchar.format_radix + // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:smc_get_version_text::@5->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL // [1207] phi printf_uchar::uvalue#14 = printf_uchar::uvalue#3 [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) - // [1000] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 + // [1013] stackpush(char) = 0 -- _stackpushbyte_=vbuc1 lda #0 pha - // [1001] callexecute snputc -- call_vprc1 + // [1014] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla // smc_get_version_text::@return // } - // [1003] return + // [1016] return rts .segment Data s: .text "." .byte 0 + major: .byte 0 } .segment Code // rom_detect rom_detect: { .const bank_set_brom1_bank = 4 - .label rom_detect__3 = $fb - .label rom_detect__5 = $fb - .label rom_detect__9 = $d9 - .label rom_detect__14 = $bb - .label rom_detect__15 = $37 - .label rom_detect__18 = $b6 - .label rom_detect__21 = $eb - .label rom_detect__24 = $cd - .label rom_detect_address = $31 - // [1005] phi from rom_detect to rom_detect::@1 [phi:rom_detect->rom_detect::@1] - // [1005] phi rom_detect::rom_chip#10 = 0 [phi:rom_detect->rom_detect::@1#0] -- vbum1=vbuc1 + .label rom_detect__24 = $cb + .label rom_detect_address = $27 + // [1018] phi from rom_detect to rom_detect::@1 [phi:rom_detect->rom_detect::@1] + // [1018] phi rom_detect::rom_chip#10 = 0 [phi:rom_detect->rom_detect::@1#0] -- vbum1=vbuc1 lda #0 sta rom_chip - // [1005] phi rom_detect::rom_detect_address#10 = 0 [phi:rom_detect->rom_detect::@1#1] -- vduz1=vduc1 + // [1018] 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 lda #<0>>$10 @@ -6612,7 +6486,7 @@ rom_detect: { // rom_detect::@1 __b1: // for (unsigned long rom_detect_address = 0; rom_detect_address < 8 * 0x80000; rom_detect_address += 0x80000) - // [1006] if(rom_detect::rom_detect_address#10<8*$80000) goto rom_detect::@2 -- vduz1_lt_vduc1_then_la1 + // [1019] if(rom_detect::rom_detect_address#10<8*$80000) goto rom_detect::@2 -- vduz1_lt_vduc1_then_la1 lda.z rom_detect_address+3 cmp #>8*$80000>>$10 bcc __b2 @@ -6631,20 +6505,20 @@ rom_detect: { !: // rom_detect::@return // } - // [1007] return + // [1020] return rts // rom_detect::@2 __b2: // rom_manufacturer_ids[rom_chip] = 0 - // [1008] rom_manufacturer_ids[rom_detect::rom_chip#10] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + // [1021] 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 - // [1009] rom_device_ids[rom_detect::rom_chip#10] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + // [1022] 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) - // [1010] rom_unlock::address#2 = rom_detect::rom_detect_address#10 + $5555 -- vduz1=vduz2_plus_vwuc1 + // [1023] rom_unlock::address#2 = rom_detect::rom_detect_address#10 + $5555 -- vduz1=vduz2_plus_vwuc1 clc lda.z rom_detect_address adc #<$5555 @@ -6658,16 +6532,16 @@ rom_detect: { lda.z rom_detect_address+3 adc #0 sta.z rom_unlock.address+3 - // [1011] call rom_unlock - // [2155] phi from rom_detect::@2 to rom_unlock [phi:rom_detect::@2->rom_unlock] - // [2155] phi rom_unlock::unlock_code#5 = $90 [phi:rom_detect::@2->rom_unlock#0] -- vbuz1=vbuc1 + // [1024] call rom_unlock + // [2159] phi from rom_detect::@2 to rom_unlock [phi:rom_detect::@2->rom_unlock] + // [2159] phi rom_unlock::unlock_code#5 = $90 [phi:rom_detect::@2->rom_unlock#0] -- vbuz1=vbuc1 lda #$90 sta.z rom_unlock.unlock_code - // [2155] phi rom_unlock::address#5 = rom_unlock::address#2 [phi:rom_detect::@2->rom_unlock#1] -- register_copy + // [2159] 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) - // [1012] rom_read_byte::address#0 = rom_detect::rom_detect_address#10 -- vduz1=vduz2 + // [1025] rom_read_byte::address#0 = rom_detect::rom_detect_address#10 -- vduz1=vduz2 lda.z rom_detect_address sta.z rom_read_byte.address lda.z rom_detect_address+1 @@ -6676,21 +6550,20 @@ rom_detect: { sta.z rom_read_byte.address+2 lda.z rom_detect_address+3 sta.z rom_read_byte.address+3 - // [1013] call rom_read_byte - // [2165] phi from rom_detect::@12 to rom_read_byte [phi:rom_detect::@12->rom_read_byte] - // [2165] phi rom_read_byte::address#2 = rom_read_byte::address#0 [phi:rom_detect::@12->rom_read_byte#0] -- register_copy + // [1026] call rom_read_byte + // [2169] phi from rom_detect::@12 to rom_read_byte [phi:rom_detect::@12->rom_read_byte] + // [2169] 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) - // [1014] rom_read_byte::return#2 = rom_read_byte::return#0 + // [1027] rom_read_byte::return#2 = rom_read_byte::return#0 // rom_detect::@13 - // [1015] rom_detect::$3 = rom_read_byte::return#2 + // [1028] rom_detect::$3 = rom_read_byte::return#2 // rom_manufacturer_ids[rom_chip] = rom_read_byte(rom_detect_address) - // [1016] rom_manufacturer_ids[rom_detect::rom_chip#10] = rom_detect::$3 -- pbuc1_derefidx_vbum1=vbuz2 - lda.z rom_detect__3 + // [1029] 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) - // [1017] rom_read_byte::address#1 = rom_detect::rom_detect_address#10 + 1 -- vduz1=vduz2_plus_1 + // [1030] rom_read_byte::address#1 = rom_detect::rom_detect_address#10 + 1 -- vduz1=vduz2_plus_1 lda.z rom_detect_address clc adc #1 @@ -6704,21 +6577,20 @@ rom_detect: { lda.z rom_detect_address+3 adc #0 sta.z rom_read_byte.address+3 - // [1018] call rom_read_byte - // [2165] phi from rom_detect::@13 to rom_read_byte [phi:rom_detect::@13->rom_read_byte] - // [2165] phi rom_read_byte::address#2 = rom_read_byte::address#1 [phi:rom_detect::@13->rom_read_byte#0] -- register_copy + // [1031] call rom_read_byte + // [2169] phi from rom_detect::@13 to rom_read_byte [phi:rom_detect::@13->rom_read_byte] + // [2169] 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) - // [1019] rom_read_byte::return#3 = rom_read_byte::return#0 + // [1032] rom_read_byte::return#3 = rom_read_byte::return#0 // rom_detect::@14 - // [1020] rom_detect::$5 = rom_read_byte::return#3 + // [1033] rom_detect::$5 = rom_read_byte::return#3 // rom_device_ids[rom_chip] = rom_read_byte(rom_detect_address + 1) - // [1021] rom_device_ids[rom_detect::rom_chip#10] = rom_detect::$5 -- pbuc1_derefidx_vbum1=vbuz2 - lda.z rom_detect__5 + // [1034] 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) - // [1022] rom_unlock::address#3 = rom_detect::rom_detect_address#10 + $5555 -- vduz1=vduz2_plus_vwuc1 + // [1035] rom_unlock::address#3 = rom_detect::rom_detect_address#10 + $5555 -- vduz1=vduz2_plus_vwuc1 clc lda.z rom_detect_address adc #<$5555 @@ -6732,49 +6604,44 @@ rom_detect: { lda.z rom_detect_address+3 adc #0 sta.z rom_unlock.address+3 - // [1023] call rom_unlock - // [2155] phi from rom_detect::@14 to rom_unlock [phi:rom_detect::@14->rom_unlock] - // [2155] phi rom_unlock::unlock_code#5 = $f0 [phi:rom_detect::@14->rom_unlock#0] -- vbuz1=vbuc1 + // [1036] call rom_unlock + // [2159] phi from rom_detect::@14 to rom_unlock [phi:rom_detect::@14->rom_unlock] + // [2159] phi rom_unlock::unlock_code#5 = $f0 [phi:rom_detect::@14->rom_unlock#0] -- vbuz1=vbuc1 lda #$f0 sta.z rom_unlock.unlock_code - // [2155] phi rom_unlock::address#5 = rom_unlock::address#3 [phi:rom_detect::@14->rom_unlock#1] -- register_copy + // [2159] 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 - // [1024] BROM = rom_detect::bank_set_brom1_bank#0 -- vbuz1=vbuc1 + // [1037] BROM = rom_detect::bank_set_brom1_bank#0 -- vbuz1=vbuc1 lda #bank_set_brom1_bank sta.z BROM // rom_detect::@11 // rom_chip*3 - // [1025] rom_detect::$14 = rom_detect::rom_chip#10 << 1 -- vbuz1=vbum2_rol_1 + // [1038] rom_detect::$14 = rom_detect::rom_chip#10 << 1 -- vbum1=vbum2_rol_1 lda rom_chip asl - sta.z rom_detect__14 - // [1026] rom_detect::$9 = rom_detect::$14 + rom_detect::rom_chip#10 -- vbuz1=vbuz2_plus_vbum3 - lda rom_chip + sta rom_detect__14 + // [1039] 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) - // [1027] gotoxy::x#23 = rom_detect::$9 + $28 -- vbuz1=vbuz2_plus_vbuc1 - lda #$28 + // [1040] gotoxy::x#23 = rom_detect::$9 + $28 -- vbuxx=vbuaa_plus_vbuc1 clc - adc.z rom_detect__9 - sta.z gotoxy.x - // [1028] call gotoxy + adc #$28 + tax + // [1041] call gotoxy // [751] phi from rom_detect::@11 to gotoxy [phi:rom_detect::@11->gotoxy] - // [751] phi gotoxy::y#30 = 1 [phi:rom_detect::@11->gotoxy#0] -- vbuz1=vbuc1 - lda #1 - sta.z gotoxy.y + // [751] phi gotoxy::y#30 = 1 [phi:rom_detect::@11->gotoxy#0] -- vbuyy=vbuc1 + ldy #1 // [751] phi gotoxy::x#30 = gotoxy::x#23 [phi:rom_detect::@11->gotoxy#1] -- register_copy jsr gotoxy // rom_detect::@15 // printf("%02x", rom_device_ids[rom_chip]) - // [1029] printf_uchar::uvalue#8 = rom_device_ids[rom_detect::rom_chip#10] -- vbuz1=pbuc1_derefidx_vbum2 + // [1042] printf_uchar::uvalue#8 = rom_device_ids[rom_detect::rom_chip#10] -- vbuxx=pbuc1_derefidx_vbum1 ldy rom_chip - lda rom_device_ids,y - sta.z printf_uchar.uvalue - // [1030] call printf_uchar + ldx rom_device_ids,y + // [1043] call printf_uchar // [1207] phi from rom_detect::@15 to printf_uchar [phi:rom_detect::@15->printf_uchar] // [1207] phi printf_uchar::format_zero_padding#14 = 1 [phi:rom_detect::@15->printf_uchar#0] -- vbuz1=vbuc1 lda #1 @@ -6787,9 +6654,8 @@ rom_detect: { sta.z printf_uchar.putc lda #>cputc sta.z printf_uchar.putc+1 - // [1207] phi printf_uchar::format_radix#14 = HEXADECIMAL [phi:rom_detect::@15->printf_uchar#3] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_uchar.format_radix + // [1207] phi printf_uchar::format_radix#14 = HEXADECIMAL [phi:rom_detect::@15->printf_uchar#3] -- vbuyy=vbuc1 + ldy #HEXADECIMAL // [1207] phi printf_uchar::uvalue#14 = printf_uchar::uvalue#8 [phi:rom_detect::@15->printf_uchar#4] -- register_copy jsr printf_uchar // rom_detect::@16 @@ -6798,7 +6664,7 @@ rom_detect: { // rom_size_strings[rom_chip] = "128"; // rom_sizes[rom_chip] = 128 * 1024; // break; - // [1031] if(rom_device_ids[rom_detect::rom_chip#10]==$b5) goto rom_detect::@3 -- pbuc1_derefidx_vbum1_eq_vbuc2_then_la1 + // [1044] 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 @@ -6811,7 +6677,7 @@ rom_detect: { // rom_size_strings[rom_chip] = "256"; // rom_sizes[rom_chip] = 256 * 1024; // break; - // [1032] if(rom_device_ids[rom_detect::rom_chip#10]==$b6) goto rom_detect::@4 -- pbuc1_derefidx_vbum1_eq_vbuc2_then_la1 + // [1045] 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+ @@ -6823,35 +6689,35 @@ rom_detect: { // rom_size_strings[rom_chip] = "512"; // rom_sizes[rom_chip] = 512 * 1024; // break; - // [1033] if(rom_device_ids[rom_detect::rom_chip#10]==$b7) goto rom_detect::@5 -- pbuc1_derefidx_vbum1_eq_vbuc2_then_la1 + // [1046] 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 - // [1034] rom_manufacturer_ids[rom_detect::rom_chip#10] = 0 -- pbuc1_derefidx_vbum1=vbuc2 + // [1047] 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] = "----" - // [1035] rom_device_names[rom_detect::$14] = rom_detect::$31 -- qbuc1_derefidx_vbuz1=pbuc2 - ldy.z rom_detect__14 + // [1048] 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" - // [1036] rom_size_strings[rom_detect::$14] = rom_detect::$32 -- qbuc1_derefidx_vbuz1=pbuc2 + // [1049] 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 - // [1037] rom_detect::$24 = rom_detect::rom_chip#10 << 2 -- vbuz1=vbum2_rol_2 + // [1050] rom_detect::$24 = rom_detect::rom_chip#10 << 2 -- vbuz1=vbum2_rol_2 lda rom_chip asl asl sta.z rom_detect__24 - // [1038] rom_sizes[rom_detect::$24] = 0 -- pduc1_derefidx_vbuz1=vbuc2 + // [1051] rom_sizes[rom_detect::$24] = 0 -- pduc1_derefidx_vbuz1=vbuc2 tay lda #0 sta rom_sizes,y @@ -6859,18 +6725,18 @@ rom_detect: { sta rom_sizes+2,y sta rom_sizes+3,y // rom_device_ids[rom_chip] = UNKNOWN - // [1039] rom_device_ids[rom_detect::rom_chip#10] = $55 -- pbuc1_derefidx_vbum1=vbuc2 + // [1052] 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++; - // [1040] rom_detect::rom_chip#1 = ++ rom_detect::rom_chip#10 -- vbum1=_inc_vbum1 + // [1053] rom_detect::rom_chip#1 = ++ rom_detect::rom_chip#10 -- vbum1=_inc_vbum1 inc rom_chip // rom_detect::@8 // rom_detect_address += 0x80000 - // [1041] rom_detect::rom_detect_address#1 = rom_detect::rom_detect_address#10 + $80000 -- vduz1=vduz1_plus_vduc1 + // [1054] rom_detect::rom_detect_address#1 = rom_detect::rom_detect_address#10 + $80000 -- vduz1=vduz1_plus_vduc1 clc lda.z rom_detect_address adc #<$80000 @@ -6884,32 +6750,31 @@ rom_detect: { lda.z rom_detect_address+3 adc #>$80000>>$10 sta.z rom_detect_address+3 - // [1005] phi from rom_detect::@8 to rom_detect::@1 [phi:rom_detect::@8->rom_detect::@1] - // [1005] phi rom_detect::rom_chip#10 = rom_detect::rom_chip#1 [phi:rom_detect::@8->rom_detect::@1#0] -- register_copy - // [1005] phi rom_detect::rom_detect_address#10 = rom_detect::rom_detect_address#1 [phi:rom_detect::@8->rom_detect::@1#1] -- register_copy + // [1018] phi from rom_detect::@8 to rom_detect::@1 [phi:rom_detect::@8->rom_detect::@1] + // [1018] phi rom_detect::rom_chip#10 = rom_detect::rom_chip#1 [phi:rom_detect::@8->rom_detect::@1#0] -- register_copy + // [1018] 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" - // [1042] rom_device_names[rom_detect::$14] = rom_detect::$29 -- qbuc1_derefidx_vbuz1=pbuc2 - ldy.z rom_detect__14 + // [1055] 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" - // [1043] rom_size_strings[rom_detect::$14] = rom_detect::$30 -- qbuc1_derefidx_vbuz1=pbuc2 + // [1056] 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 - // [1044] rom_detect::$21 = rom_detect::rom_chip#10 << 2 -- vbuz1=vbum2_rol_2 + // [1057] rom_detect::$21 = rom_detect::rom_chip#10 << 2 -- vbuaa=vbum1_rol_2 lda rom_chip asl asl - sta.z rom_detect__21 - // [1045] rom_sizes[rom_detect::$21] = (unsigned long)$200*$400 -- pduc1_derefidx_vbuz1=vduc2 + // [1058] rom_sizes[rom_detect::$21] = (unsigned long)$200*$400 -- pduc1_derefidx_vbuaa=vduc2 tay lda #<$200*$400 sta rom_sizes,y @@ -6923,25 +6788,24 @@ rom_detect: { // rom_detect::@4 __b4: // rom_device_names[rom_chip] = "f020a" - // [1046] rom_device_names[rom_detect::$14] = rom_detect::$27 -- qbuc1_derefidx_vbuz1=pbuc2 - ldy.z rom_detect__14 + // [1059] 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" - // [1047] rom_size_strings[rom_detect::$14] = rom_detect::$28 -- qbuc1_derefidx_vbuz1=pbuc2 + // [1060] 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 - // [1048] rom_detect::$18 = rom_detect::rom_chip#10 << 2 -- vbuz1=vbum2_rol_2 + // [1061] rom_detect::$18 = rom_detect::rom_chip#10 << 2 -- vbuaa=vbum1_rol_2 lda rom_chip asl asl - sta.z rom_detect__18 - // [1049] rom_sizes[rom_detect::$18] = (unsigned long)$100*$400 -- pduc1_derefidx_vbuz1=vduc2 + // [1062] rom_sizes[rom_detect::$18] = (unsigned long)$100*$400 -- pduc1_derefidx_vbuaa=vduc2 tay lda #<$100*$400 sta rom_sizes,y @@ -6955,25 +6819,24 @@ rom_detect: { // rom_detect::@3 __b3: // rom_device_names[rom_chip] = "f010a" - // [1050] rom_device_names[rom_detect::$14] = rom_detect::$25 -- qbuc1_derefidx_vbuz1=pbuc2 - ldy.z rom_detect__14 + // [1063] 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" - // [1051] rom_size_strings[rom_detect::$14] = rom_detect::$26 -- qbuc1_derefidx_vbuz1=pbuc2 + // [1064] 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 - // [1052] rom_detect::$15 = rom_detect::rom_chip#10 << 2 -- vbuz1=vbum2_rol_2 + // [1065] rom_detect::$15 = rom_detect::rom_chip#10 << 2 -- vbuaa=vbum1_rol_2 lda rom_chip asl asl - sta.z rom_detect__15 - // [1053] rom_sizes[rom_detect::$15] = (unsigned long)$80*$400 -- pduc1_derefidx_vbuz1=vduc2 + // [1066] rom_sizes[rom_detect::$15] = (unsigned long)$80*$400 -- pduc1_derefidx_vbuaa=vduc2 tay lda #<$80*$400 sta rom_sizes,y @@ -7001,91 +6864,8 @@ rom_detect: { .byte 0 rom_detect__32: .text "000" .byte 0 - .label rom_chip = check_status_roms.return -} -.segment Code - // display_progress_text -/** - * @brief Print a block of text within the progress frame with a count of lines. - * - * @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($5b) char **text, __zp($64) char lines) -display_progress_text: { - .label display_progress_text__3 = $bb - .label l = $df - .label lines = $64 - .label text = $5b - // display_progress_clear() - // [1055] call display_progress_clear - // [859] phi from display_progress_text to display_progress_clear [phi:display_progress_text->display_progress_clear] - jsr display_progress_clear - // [1056] phi from display_progress_text to display_progress_text::@1 [phi:display_progress_text->display_progress_text::@1] - // [1056] phi display_progress_text::l#2 = 0 [phi:display_progress_text->display_progress_text::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z l - // display_progress_text::@1 - __b1: - // for(unsigned char l=0; ldisplay_progress_text::@1] - // [1056] 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 -} - // util_wait_space -util_wait_space: { - // util_wait_key("Press [SPACE] to continue ...", " ") - // [1065] call util_wait_key - // [1741] phi from util_wait_space to util_wait_key [phi:util_wait_space->util_wait_key] - // [1741] phi util_wait_key::filter#13 = s [phi:util_wait_space->util_wait_key#0] -- pbuz1=pbuc1 - lda #s - sta.z util_wait_key.filter+1 - // [1741] phi util_wait_key::info_text#3 = util_wait_space::info_text [phi:util_wait_space->util_wait_key#1] -- pbuz1=pbuc1 - lda #info_text - sta.z util_wait_key.info_text+1 - jsr util_wait_key - // util_wait_space::@return - // } - // [1066] return - rts - .segment Data - info_text: .text "Press [SPACE] to continue ..." - .byte 0 + rom_detect__14: .byte 0 + .label rom_chip = smc_flash.smc_bytes_checksum } .segment Code // smc_read @@ -7095,61 +6875,61 @@ util_wait_space: { * * @return unsigned int The amount of bytes read from SMC.BIN to be flashed. */ -// __zp($ec) unsigned int smc_read(__mem() char info_status) +// __zp($c4) unsigned int smc_read(__zp($f3) char info_status) smc_read: { - .label fp = $5f - .label return = $ec - .label smc_file_read = $b1 - .label smc_file_size = $ec + .label fp = $4d + .label return = $c4 + .label smc_file_read = $70 + .label y = $c9 + .label smc_file_size = $c4 + .label info_status = $f3 + .label smc_action_text = $e5 // if(info_status == STATUS_READING) - // [1068] if(smc_read::info_status#2==STATUS_READING) goto smc_read::@1 -- vbum1_eq_vbuc1_then_la1 + // [1068] if(smc_read::info_status#2==STATUS_READING) goto smc_read::@1 -- vbuz1_eq_vbuc1_then_la1 lda #STATUS_READING - cmp info_status + cmp.z info_status beq __b1 // [1070] phi from smc_read to smc_read::@2 [phi:smc_read->smc_read::@2] - // [1070] phi smc_read::smc_action_text#12 = smc_action_text#2 [phi:smc_read->smc_read::@2#0] -- pbum1=pbuc1 + // [1070] 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 smc_action_text+1 + sta.z smc_action_text+1 jmp __b2 // [1069] phi from smc_read to smc_read::@1 [phi:smc_read->smc_read::@1] // smc_read::@1 __b1: // [1070] phi from smc_read::@1 to smc_read::@2 [phi:smc_read::@1->smc_read::@2] - // [1070] phi smc_read::smc_action_text#12 = smc_action_text#1 [phi:smc_read::@1->smc_read::@2#0] -- pbum1=pbuc1 + // [1070] 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 - sta smc_action_text+1 + sta.z smc_action_text+1 // smc_read::@2 __b2: // textcolor(WHITE) // [1071] call textcolor // It is assume that one RAM bank is 0X2000 bytes. // [733] phi from smc_read::@2 to textcolor [phi:smc_read::@2->textcolor] - // [733] phi textcolor::color#18 = WHITE [phi:smc_read::@2->textcolor#0] -- vbuz1=vbuc1 - lda #WHITE - sta.z textcolor.color + // [733] phi textcolor::color#18 = WHITE [phi:smc_read::@2->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor // [1072] phi from smc_read::@2 to smc_read::@12 [phi:smc_read::@2->smc_read::@12] // smc_read::@12 // gotoxy(x, y) // [1073] call gotoxy // [751] phi from smc_read::@12 to gotoxy [phi:smc_read::@12->gotoxy] - // [751] phi gotoxy::y#30 = PROGRESS_Y [phi:smc_read::@12->gotoxy#0] -- vbuz1=vbuc1 - lda #PROGRESS_Y - sta.z gotoxy.y - // [751] phi gotoxy::x#30 = PROGRESS_X [phi:smc_read::@12->gotoxy#1] -- vbuz1=vbuc1 - lda #PROGRESS_X - sta.z gotoxy.x + // [751] phi gotoxy::y#30 = PROGRESS_Y [phi:smc_read::@12->gotoxy#0] -- vbuyy=vbuc1 + ldy #PROGRESS_Y + // [751] phi gotoxy::x#30 = PROGRESS_X [phi:smc_read::@12->gotoxy#1] -- vbuxx=vbuc1 + ldx #PROGRESS_X jsr gotoxy // [1074] phi from smc_read::@12 to smc_read::@13 [phi:smc_read::@12->smc_read::@13] // smc_read::@13 // FILE *fp = fopen("SMC.BIN", "r") // [1075] call fopen // [2181] phi from smc_read::@13 to fopen [phi:smc_read::@13->fopen] - // [2181] phi __errno#302 = __errno#35 [phi:smc_read::@13->fopen#0] -- register_copy + // [2181] phi __errno#318 = __errno#35 [phi:smc_read::@13->fopen#0] -- register_copy // [2181] phi fopen::pathtoken#0 = smc_read::path [phi:smc_read::@13->fopen#1] -- pbuz1=pbuc1 lda #smc_read::@5] - // [1084] phi smc_read::y#10 = PROGRESS_Y [phi:smc_read::@15->smc_read::@5#0] -- vbum1=vbuc1 + // [1084] phi smc_read::y#10 = PROGRESS_Y [phi:smc_read::@15->smc_read::@5#0] -- vbuz1=vbuc1 lda #PROGRESS_Y - sta y + sta.z y // [1084] phi smc_read::progress_row_bytes#10 = 0 [phi:smc_read::@15->smc_read::@5#1] -- vwum1=vwuc1 lda #<0 sta progress_row_bytes @@ -7290,10 +7070,10 @@ smc_read: { jsr snprintf_init // smc_read::@17 // sprintf(info_text, "%s SMC.BIN:%05x/%05x -> RAM:%02x:%04p ...", smc_action_text, smc_file_read, smc_file_size, 0, ram_ptr) - // [1097] printf_string::str#12 = smc_read::smc_action_text#12 -- pbuz1=pbum2 - lda smc_action_text + // [1097] printf_string::str#12 = smc_read::smc_action_text#12 -- pbuz1=pbuz2 + lda.z smc_action_text sta.z printf_string.str - lda smc_action_text+1 + lda.z smc_action_text+1 sta.z printf_string.str+1 // [1098] call printf_string // [1147] phi from smc_read::@17 to printf_string [phi:smc_read::@17->printf_string] @@ -7333,22 +7113,21 @@ smc_read: { lda.z smc_file_read+1 sta.z printf_uint.uvalue+1 // [1102] call printf_uint - // [1839] phi from smc_read::@19 to printf_uint [phi:smc_read::@19->printf_uint] - // [1839] phi printf_uint::format_zero_padding#14 = 1 [phi:smc_read::@19->printf_uint#0] -- vbuz1=vbuc1 + // [1828] phi from smc_read::@19 to printf_uint [phi:smc_read::@19->printf_uint] + // [1828] phi printf_uint::format_zero_padding#14 = 1 [phi:smc_read::@19->printf_uint#0] -- vbuz1=vbuc1 lda #1 sta.z printf_uint.format_zero_padding - // [1839] phi printf_uint::format_min_length#14 = 5 [phi:smc_read::@19->printf_uint#1] -- vbuz1=vbuc1 + // [1828] phi printf_uint::format_min_length#14 = 5 [phi:smc_read::@19->printf_uint#1] -- vbuz1=vbuc1 lda #5 sta.z printf_uint.format_min_length - // [1839] phi printf_uint::putc#14 = &snputc [phi:smc_read::@19->printf_uint#2] -- pprz1=pprc1 + // [1828] phi printf_uint::putc#14 = &snputc [phi:smc_read::@19->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1839] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:smc_read::@19->printf_uint#3] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_uint.format_radix - // [1839] phi printf_uint::uvalue#14 = printf_uint::uvalue#1 [phi:smc_read::@19->printf_uint#4] -- register_copy + // [1828] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:smc_read::@19->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1828] phi printf_uint::uvalue#14 = printf_uint::uvalue#1 [phi:smc_read::@19->printf_uint#4] -- register_copy jsr printf_uint // [1103] phi from smc_read::@19 to smc_read::@20 [phi:smc_read::@19->smc_read::@20] // smc_read::@20 @@ -7374,22 +7153,21 @@ smc_read: { lda.z smc_file_size+1 sta.z printf_uint.uvalue+1 // [1106] call printf_uint - // [1839] phi from smc_read::@21 to printf_uint [phi:smc_read::@21->printf_uint] - // [1839] phi printf_uint::format_zero_padding#14 = 1 [phi:smc_read::@21->printf_uint#0] -- vbuz1=vbuc1 + // [1828] phi from smc_read::@21 to printf_uint [phi:smc_read::@21->printf_uint] + // [1828] phi printf_uint::format_zero_padding#14 = 1 [phi:smc_read::@21->printf_uint#0] -- vbuz1=vbuc1 lda #1 sta.z printf_uint.format_zero_padding - // [1839] phi printf_uint::format_min_length#14 = 5 [phi:smc_read::@21->printf_uint#1] -- vbuz1=vbuc1 + // [1828] phi printf_uint::format_min_length#14 = 5 [phi:smc_read::@21->printf_uint#1] -- vbuz1=vbuc1 lda #5 sta.z printf_uint.format_min_length - // [1839] phi printf_uint::putc#14 = &snputc [phi:smc_read::@21->printf_uint#2] -- pprz1=pprc1 + // [1828] phi printf_uint::putc#14 = &snputc [phi:smc_read::@21->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1839] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:smc_read::@21->printf_uint#3] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_uint.format_radix - // [1839] phi printf_uint::uvalue#14 = printf_uint::uvalue#2 [phi:smc_read::@21->printf_uint#4] -- register_copy + // [1828] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:smc_read::@21->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1828] phi printf_uint::uvalue#14 = printf_uint::uvalue#2 [phi:smc_read::@21->printf_uint#4] -- register_copy jsr printf_uint // [1107] phi from smc_read::@21 to smc_read::@22 [phi:smc_read::@21->smc_read::@22] // smc_read::@22 @@ -7411,22 +7189,21 @@ smc_read: { // smc_read::@23 // sprintf(info_text, "%s SMC.BIN:%05x/%05x -> RAM:%02x:%04p ...", smc_action_text, smc_file_read, smc_file_size, 0, ram_ptr) // [1110] call printf_uint - // [1839] phi from smc_read::@23 to printf_uint [phi:smc_read::@23->printf_uint] - // [1839] phi printf_uint::format_zero_padding#14 = 1 [phi:smc_read::@23->printf_uint#0] -- vbuz1=vbuc1 + // [1828] phi from smc_read::@23 to printf_uint [phi:smc_read::@23->printf_uint] + // [1828] phi printf_uint::format_zero_padding#14 = 1 [phi:smc_read::@23->printf_uint#0] -- vbuz1=vbuc1 lda #1 sta.z printf_uint.format_zero_padding - // [1839] phi printf_uint::format_min_length#14 = 2 [phi:smc_read::@23->printf_uint#1] -- vbuz1=vbuc1 + // [1828] phi printf_uint::format_min_length#14 = 2 [phi:smc_read::@23->printf_uint#1] -- vbuz1=vbuc1 lda #2 sta.z printf_uint.format_min_length - // [1839] phi printf_uint::putc#14 = &snputc [phi:smc_read::@23->printf_uint#2] -- pprz1=pprc1 + // [1828] phi printf_uint::putc#14 = &snputc [phi:smc_read::@23->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1839] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:smc_read::@23->printf_uint#3] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_uint.format_radix - // [1839] phi printf_uint::uvalue#14 = 0 [phi:smc_read::@23->printf_uint#4] -- vwuz1=vbuc1 + // [1828] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:smc_read::@23->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1828] phi printf_uint::uvalue#14 = 0 [phi:smc_read::@23->printf_uint#4] -- vwuz1=vbuc1 lda #<0 sta.z printf_uint.uvalue sta.z printf_uint.uvalue+1 @@ -7455,22 +7232,21 @@ smc_read: { lda ram_ptr+1 sta.z printf_uint.uvalue+1 // [1114] call printf_uint - // [1839] phi from smc_read::@25 to printf_uint [phi:smc_read::@25->printf_uint] - // [1839] phi printf_uint::format_zero_padding#14 = 1 [phi:smc_read::@25->printf_uint#0] -- vbuz1=vbuc1 + // [1828] phi from smc_read::@25 to printf_uint [phi:smc_read::@25->printf_uint] + // [1828] phi printf_uint::format_zero_padding#14 = 1 [phi:smc_read::@25->printf_uint#0] -- vbuz1=vbuc1 lda #1 sta.z printf_uint.format_zero_padding - // [1839] phi printf_uint::format_min_length#14 = 4 [phi:smc_read::@25->printf_uint#1] -- vbuz1=vbuc1 + // [1828] phi printf_uint::format_min_length#14 = 4 [phi:smc_read::@25->printf_uint#1] -- vbuz1=vbuc1 lda #4 sta.z printf_uint.format_min_length - // [1839] phi printf_uint::putc#14 = &snputc [phi:smc_read::@25->printf_uint#2] -- pprz1=pprc1 + // [1828] phi printf_uint::putc#14 = &snputc [phi:smc_read::@25->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1839] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:smc_read::@25->printf_uint#3] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_uint.format_radix - // [1839] phi printf_uint::uvalue#14 = printf_uint::uvalue#4 [phi:smc_read::@25->printf_uint#4] -- register_copy + // [1828] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:smc_read::@25->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1828] phi printf_uint::uvalue#14 = printf_uint::uvalue#4 [phi:smc_read::@25->printf_uint#4] -- register_copy jsr printf_uint // [1115] phi from smc_read::@25 to smc_read::@26 [phi:smc_read::@25->smc_read::@26] // smc_read::@26 @@ -7517,18 +7293,16 @@ smc_read: { bne __b8 // smc_read::@10 // gotoxy(x, ++y); - // [1122] smc_read::y#1 = ++ smc_read::y#10 -- vbum1=_inc_vbum1 - inc y + // [1122] smc_read::y#1 = ++ smc_read::y#10 -- vbuz1=_inc_vbuz1 + inc.z y // gotoxy(x, ++y) - // [1123] gotoxy::y#20 = smc_read::y#1 -- vbuz1=vbum2 - lda y - sta.z gotoxy.y + // [1123] gotoxy::y#20 = smc_read::y#1 -- vbuyy=vbuz1 + ldy.z y // [1124] call gotoxy // [751] phi from smc_read::@10 to gotoxy [phi:smc_read::@10->gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#20 [phi:smc_read::@10->gotoxy#0] -- register_copy - // [751] phi gotoxy::x#30 = PROGRESS_X [phi:smc_read::@10->gotoxy#1] -- vbuz1=vbuc1 - lda #PROGRESS_X - sta.z gotoxy.x + // [751] phi gotoxy::x#30 = PROGRESS_X [phi:smc_read::@10->gotoxy#1] -- vbuxx=vbuc1 + ldx #PROGRESS_X jsr gotoxy // [1125] phi from smc_read::@10 to smc_read::@8 [phi:smc_read::@10->smc_read::@8] // [1125] phi smc_read::y#22 = smc_read::y#1 [phi:smc_read::@10->smc_read::@8#0] -- register_copy @@ -7542,9 +7316,9 @@ smc_read: { // smc_read::@8 __b8: // if(info_status == STATUS_READING) - // [1126] if(smc_read::info_status#2!=STATUS_READING) goto smc_read::@9 -- vbum1_neq_vbuc1_then_la1 + // [1126] if(smc_read::info_status#2!=STATUS_READING) goto smc_read::@9 -- vbuz1_neq_vbuc1_then_la1 lda #STATUS_READING - cmp info_status + cmp.z info_status bne __b9 // smc_read::@11 // cputc('.') @@ -7595,19 +7369,16 @@ smc_read: { .byte 0 s: .text " SMC.BIN:" .byte 0 - .label y = check_status_roms_less.return .label ram_ptr = smc_flash.smc_package_flashed /// Holds the amount of bytes actually read in the memory to be flashed. .label progress_row_bytes = clrscr.ch - .label info_status = main.check_status_smc2_main__0 - .label smc_action_text = wait_moment.i } .segment Code // snprintf_init /// Initialize the snprintf() state -// void snprintf_init(__zp($5d) char *s, unsigned int n) +// void snprintf_init(__zp($4b) char *s, unsigned int n) snprintf_init: { - .label s = $5d + .label s = $4b // __snprintf_capacity = n // [1134] __snprintf_capacity = $ffff -- vwum1=vwuc1 lda #<$ffff @@ -7620,11 +7391,11 @@ snprintf_init: { sta __snprintf_size sta __snprintf_size+1 // __snprintf_buffer = s - // [1136] __snprintf_buffer = snprintf_init::s#26 -- pbum1=pbuz2 + // [1136] __snprintf_buffer = snprintf_init::s#26 -- pbuz1=pbuz2 lda.z s - sta __snprintf_buffer + sta.z __snprintf_buffer lda.z s+1 - sta __snprintf_buffer+1 + sta.z __snprintf_buffer+1 // snprintf_init::@return // } // [1137] return @@ -7632,27 +7403,25 @@ snprintf_init: { } // printf_str /// Print a NUL-terminated string -// void printf_str(__zp($5b) void (*putc)(char), __zp($af) const char *s) +// void printf_str(__zp($49) void (*putc)(char), __zp($6e) const char *s) printf_str: { - .label c = $53 - .label s = $af - .label putc = $5b + .label s = $6e + .label putc = $49 // [1139] phi from printf_str printf_str::@2 to printf_str::@1 [phi:printf_str/printf_str::@2->printf_str::@1] // [1139] phi printf_str::s#70 = printf_str::s#71 [phi:printf_str/printf_str::@2->printf_str::@1#0] -- register_copy // printf_str::@1 __b1: // while(c=*s++) - // [1140] printf_str::c#1 = *printf_str::s#70 -- vbuz1=_deref_pbuz2 + // [1140] printf_str::c#1 = *printf_str::s#70 -- vbuaa=_deref_pbuz1 ldy #0 lda (s),y - sta.z c // [1141] printf_str::s#0 = ++ printf_str::s#70 -- pbuz1=_inc_pbuz1 inc.z s bne !+ inc.z s+1 !: - // [1142] if(0!=printf_str::c#1) goto printf_str::@2 -- 0_neq_vbuz1_then_la1 - lda.z c + // [1142] if(0!=printf_str::c#1) goto printf_str::@2 -- 0_neq_vbuaa_then_la1 + cmp #0 bne __b2 // printf_str::@return // } @@ -7661,8 +7430,7 @@ printf_str: { // printf_str::@2 __b2: // putc(c) - // [1144] stackpush(char) = printf_str::c#1 -- _stackpushbyte_=vbuz1 - lda.z c + // [1144] stackpush(char) = printf_str::c#1 -- _stackpushbyte_=vbuaa pha // [1145] callexecute *printf_str::putc#71 -- call__deref_pprz1 jsr icall16 @@ -7676,15 +7444,14 @@ printf_str: { // printf_string // Print a string value using a specific format // Handles justification and min length -// void printf_string(__zp($3f) void (*putc)(char), __zp($af) char *str, __zp($df) char format_min_length, __zp($61) char format_justify_left) +// void printf_string(__zp($32) void (*putc)(char), __zp($6e) char *str, __zp($bb) char format_min_length, __zp($c2) char format_justify_left) printf_string: { - .label printf_string__9 = $54 - .label len = $37 - .label padding = $df - .label str = $af - .label format_min_length = $df - .label format_justify_left = $61 - .label putc = $3f + .label printf_string__9 = $43 + .label padding = $bb + .label str = $6e + .label format_min_length = $bb + .label format_justify_left = $c2 + .label putc = $32 // if(format.min_length) // [1148] if(0==printf_string::format_min_length#24) goto printf_string::@1 -- 0_eq_vbuz1_then_la1 lda.z format_min_length @@ -7705,14 +7472,13 @@ printf_string: { // printf_string::@6 // [1152] printf_string::$9 = strlen::return#10 // signed char len = (signed char)strlen(str) - // [1153] printf_string::len#0 = (signed char)printf_string::$9 -- vbsz1=_sbyte_vwuz2 + // [1153] printf_string::len#0 = (signed char)printf_string::$9 -- vbsaa=_sbyte_vwuz1 lda.z printf_string__9 - sta.z len // padding = (signed char)format.min_length - len - // [1154] printf_string::padding#1 = (signed char)printf_string::format_min_length#24 - printf_string::len#0 -- vbsz1=vbsz1_minus_vbsz2 - lda.z padding + // [1154] printf_string::padding#1 = (signed char)printf_string::format_min_length#24 - printf_string::len#0 -- vbsz1=vbsz1_minus_vbsaa + eor #$ff sec - sbc.z len + adc.z padding sta.z padding // if(padding<0) // [1155] if(printf_string::padding#1>=0) goto printf_string::@10 -- vbsz1_ge_0_then_la1 @@ -7819,37 +7585,30 @@ printf_string: { * @param rom_release The ROM release to search for. * @return unsigned char true if found. */ -// __mem() char smc_supported_rom(__zp($c6) char rom_release) +// __register(A) char smc_supported_rom(__register(A) char rom_release) smc_supported_rom: { - .label rom_release = $c6 // [1173] phi from smc_supported_rom to smc_supported_rom::@1 [phi:smc_supported_rom->smc_supported_rom::@1] - // [1173] phi smc_supported_rom::i#2 = $1f [phi:smc_supported_rom->smc_supported_rom::@1#0] -- vbum1=vbuc1 - lda #$1f - sta i + // [1173] 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--) - // [1174] if(smc_supported_rom::i#2>=3+1) goto smc_supported_rom::@2 -- vbum1_ge_vbuc1_then_la1 - lda i - cmp #3+1 + // [1174] if(smc_supported_rom::i#2>=3+1) goto smc_supported_rom::@2 -- vbuyy_ge_vbuc1_then_la1 + cpy #3+1 bcs __b2 // [1176] phi from smc_supported_rom::@1 to smc_supported_rom::@return [phi:smc_supported_rom::@1->smc_supported_rom::@return] - // [1176] phi smc_supported_rom::return#2 = 0 [phi:smc_supported_rom::@1->smc_supported_rom::@return#0] -- vbum1=vbuc1 + // [1176] phi smc_supported_rom::return#2 = 0 [phi:smc_supported_rom::@1->smc_supported_rom::@return#0] -- vbuaa=vbuc1 lda #0 - sta return rts // smc_supported_rom::@2 __b2: // if(smc_file_header[i] == rom_release) - // [1175] if(smc_file_header[smc_supported_rom::i#2]!=smc_supported_rom::rom_release#0) goto smc_supported_rom::@3 -- pbuc1_derefidx_vbum1_neq_vbuz2_then_la1 - lda.z rom_release - ldy i + // [1175] 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 // [1176] phi from smc_supported_rom::@2 to smc_supported_rom::@return [phi:smc_supported_rom::@2->smc_supported_rom::@return] - // [1176] phi smc_supported_rom::return#2 = 1 [phi:smc_supported_rom::@2->smc_supported_rom::@return#0] -- vbum1=vbuc1 + // [1176] phi smc_supported_rom::return#2 = 1 [phi:smc_supported_rom::@2->smc_supported_rom::@return#0] -- vbuaa=vbuc1 lda #1 - sta return // smc_supported_rom::@return // } // [1177] return @@ -7857,16 +7616,12 @@ smc_supported_rom: { // smc_supported_rom::@3 __b3: // for(unsigned char i=31; i>3; i--) - // [1178] smc_supported_rom::i#1 = -- smc_supported_rom::i#2 -- vbum1=_dec_vbum1 - dec i + // [1178] smc_supported_rom::i#1 = -- smc_supported_rom::i#2 -- vbuyy=_dec_vbuyy + dey // [1173] phi from smc_supported_rom::@3 to smc_supported_rom::@1 [phi:smc_supported_rom::@3->smc_supported_rom::@1] // [1173] 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 - .segment Data - .label i = rom_get_prefix.return - return: .byte 0 } -.segment Code // check_status_roms /** * @brief Check the status of all the ROMs. @@ -7874,27 +7629,20 @@ smc_supported_rom: { * @param status The status to be checked. * @return unsigned char true if one chip is equal to the status. */ -// __mem() char check_status_roms(__zp($e2) char status) +// __register(A) char check_status_roms(__register(X) char status) check_status_roms: { - .label check_status_rom1_check_status_roms__0 = $53 - .label check_status_rom1_return = $53 - .label rom_chip = $30 - .label status = $e2 // [1180] phi from check_status_roms to check_status_roms::@1 [phi:check_status_roms->check_status_roms::@1] - // [1180] phi check_status_roms::rom_chip#2 = 0 [phi:check_status_roms->check_status_roms::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z rom_chip + // [1180] 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++) - // [1181] if(check_status_roms::rom_chip#2<8) goto check_status_roms::check_status_rom1 -- vbuz1_lt_vbuc1_then_la1 - lda.z rom_chip - cmp #8 + // [1181] 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 // [1182] phi from check_status_roms::@1 to check_status_roms::@return [phi:check_status_roms::@1->check_status_roms::@return] - // [1182] phi check_status_roms::return#2 = 0 [phi:check_status_roms::@1->check_status_roms::@return#0] -- vbum1=vbuc1 + // [1182] 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 // } // [1183] return @@ -7902,39 +7650,33 @@ check_status_roms: { // check_status_roms::check_status_rom1 check_status_rom1: // status_rom[rom_chip] == status - // [1184] check_status_roms::check_status_rom1_$0 = status_rom[check_status_roms::rom_chip#2] == check_status_roms::status#6 -- vboz1=pbuc1_derefidx_vbuz2_eq_vbuz3 - lda.z status - ldy.z rom_chip + // [1184] 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); // [1185] 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)) - // [1186] 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 + // [1186] if(0==check_status_roms::check_status_rom1_return#0) goto check_status_roms::@2 -- 0_eq_vbuaa_then_la1 + cmp #0 beq __b2 // [1182] phi from check_status_roms::@3 to check_status_roms::@return [phi:check_status_roms::@3->check_status_roms::@return] - // [1182] phi check_status_roms::return#2 = 1 [phi:check_status_roms::@3->check_status_roms::@return#0] -- vbum1=vbuc1 + // [1182] 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++) - // [1187] check_status_roms::rom_chip#1 = ++ check_status_roms::rom_chip#2 -- vbuz1=_inc_vbuz1 - inc.z rom_chip + // [1187] check_status_roms::rom_chip#1 = ++ check_status_roms::rom_chip#2 -- vbuyy=_inc_vbuyy + iny // [1180] phi from check_status_roms::@2 to check_status_roms::@1 [phi:check_status_roms::@2->check_status_roms::@1] // [1180] 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 - return: .byte 0 } -.segment Code // check_status_roms_less /** * @brief Check the status of all the ROMs mutually. @@ -7942,25 +7684,20 @@ check_status_roms: { * @param status The status to be checked. * @return unsigned char true if all chips are equal to the status. */ -// __mem() char check_status_roms_less(char status) +// __register(A) char check_status_roms_less(char status) check_status_roms_less: { - .label check_status_rom1_check_status_roms_less__0 = $e6 - .label check_status_rom1_return = $e6 // [1189] phi from check_status_roms_less to check_status_roms_less::@1 [phi:check_status_roms_less->check_status_roms_less::@1] - // [1189] 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 + // [1189] 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++) - // [1190] if(check_status_roms_less::rom_chip#2<8) goto check_status_roms_less::check_status_rom1 -- vbum1_lt_vbuc1_then_la1 - lda rom_chip - cmp #8 + // [1190] if(check_status_roms_less::rom_chip#2<8) goto check_status_roms_less::check_status_rom1 -- vbuxx_lt_vbuc1_then_la1 + cpx #8 bcc check_status_rom1 // [1191] phi from check_status_roms_less::@1 to check_status_roms_less::@return [phi:check_status_roms_less::@1->check_status_roms_less::@return] - // [1191] phi check_status_roms_less::return#2 = 1 [phi:check_status_roms_less::@1->check_status_roms_less::@return#0] -- vbum1=vbuc1 + // [1191] 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 return // check_status_roms_less::@return // } // [1192] return @@ -7968,41 +7705,33 @@ check_status_roms_less: { // check_status_roms_less::check_status_rom1 check_status_rom1: // status_rom[rom_chip] == status - // [1193] check_status_roms_less::check_status_rom1_$0 = status_rom[check_status_roms_less::rom_chip#2] == STATUS_SKIP -- vboz1=pbuc1_derefidx_vbum2_eq_vbuc2 + // [1193] check_status_roms_less::check_status_rom1_$0 = status_rom[check_status_roms_less::rom_chip#2] == STATUS_SKIP -- vboaa=pbuc1_derefidx_vbuxx_eq_vbuc2 lda #STATUS_SKIP - ldy rom_chip - eor status_rom,y + eor status_rom,x beq !+ lda #1 !: eor #1 - sta.z check_status_rom1_check_status_roms_less__0 // return (unsigned char)(status_rom[rom_chip] == status); // [1194] check_status_roms_less::check_status_rom1_return#0 = (char)check_status_roms_less::check_status_rom1_$0 // check_status_roms_less::@3 // if(check_status_rom(rom_chip, status) > status) - // [1195] if(check_status_roms_less::check_status_rom1_return#0check_status_roms_less::@return] - // [1191] phi check_status_roms_less::return#2 = 0 [phi:check_status_roms_less::@3->check_status_roms_less::@return#0] -- vbum1=vbuc1 + // [1191] phi check_status_roms_less::return#2 = 0 [phi:check_status_roms_less::@3->check_status_roms_less::@return#0] -- vbuaa=vbuc1 lda #0 - sta return rts // check_status_roms_less::@2 __b2: // for(unsigned char rom_chip = 0; rom_chip < 8; rom_chip++) - // [1196] check_status_roms_less::rom_chip#1 = ++ check_status_roms_less::rom_chip#2 -- vbum1=_inc_vbum1 - inc rom_chip + // [1196] check_status_roms_less::rom_chip#1 = ++ check_status_roms_less::rom_chip#2 -- vbuxx=_inc_vbuxx + inx // [1189] phi from check_status_roms_less::@2 to check_status_roms_less::@1 [phi:check_status_roms_less::@2->check_status_roms_less::@1] // [1189] phi check_status_roms_less::rom_chip#2 = check_status_roms_less::rom_chip#1 [phi:check_status_roms_less::@2->check_status_roms_less::@1#0] -- register_copy jmp __b1 - .segment Data - .label rom_chip = main.check_status_smc2_main__0 - return: .byte 0 } -.segment Code // system_reset /** * @brief @@ -8036,19 +7765,20 @@ system_reset: { * */ wait_moment: { + .label i = $e5 // [1203] phi from wait_moment to wait_moment::@1 [phi:wait_moment->wait_moment::@1] - // [1203] phi wait_moment::i#2 = $ffff [phi:wait_moment->wait_moment::@1#0] -- vwum1=vwuc1 + // [1203] phi wait_moment::i#2 = $ffff [phi:wait_moment->wait_moment::@1#0] -- vwuz1=vwuc1 lda #<$ffff - sta i + sta.z i lda #>$ffff - sta i+1 + sta.z i+1 // wait_moment::@1 __b1: // for(unsigned int i=65535; i>0; i--) - // [1204] if(wait_moment::i#2>0) goto wait_moment::@2 -- vwum1_gt_0_then_la1 - lda i+1 + // [1204] if(wait_moment::i#2>0) goto wait_moment::@2 -- vwuz1_gt_0_then_la1 + lda.z i+1 bne __b2 - lda i + lda.z i bne __b2 !: // wait_moment::@return @@ -8058,28 +7788,23 @@ wait_moment: { // wait_moment::@2 __b2: // for(unsigned int i=65535; i>0; i--) - // [1206] wait_moment::i#1 = -- wait_moment::i#2 -- vwum1=_dec_vwum1 - lda i + // [1206] wait_moment::i#1 = -- wait_moment::i#2 -- vwuz1=_dec_vwuz1 + lda.z i bne !+ - dec i+1 + dec.z i+1 !: - dec i + dec.z i // [1203] phi from wait_moment::@2 to wait_moment::@1 [phi:wait_moment::@2->wait_moment::@1] // [1203] phi wait_moment::i#2 = wait_moment::i#1 [phi:wait_moment::@2->wait_moment::@1#0] -- register_copy jmp __b1 - .segment Data - i: .word 0 } -.segment Code // printf_uchar // Print an unsigned char using a specific format -// void printf_uchar(__zp($5b) void (*putc)(char), __zp($30) char uvalue, __zp($36) char format_min_length, char format_justify_left, char format_sign_always, __zp($e2) char format_zero_padding, char format_upper_case, __zp($61) char format_radix) +// void printf_uchar(__zp($49) void (*putc)(char), __register(X) char uvalue, __zp($d1) char format_min_length, char format_justify_left, char format_sign_always, __zp($be) char format_zero_padding, char format_upper_case, __register(Y) char format_radix) printf_uchar: { - .label uvalue = $30 - .label format_radix = $61 - .label putc = $5b - .label format_min_length = $36 - .label format_zero_padding = $e2 + .label putc = $49 + .label format_min_length = $d1 + .label format_zero_padding = $be // printf_uchar::@1 // printf_buffer.sign = format.sign_always?'+':0 // [1208] *((char *)&printf_buffer) = 0 -- _deref_pbuc1=vbuc2 @@ -8098,7 +7823,8 @@ printf_uchar: { // [1213] printf_number_buffer::buffer_sign#2 = *((char *)&printf_buffer) -- vbuz1=_deref_pbuc1 lda printf_buffer sta.z printf_number_buffer.buffer_sign - // [1214] printf_number_buffer::format_min_length#2 = printf_uchar::format_min_length#14 + // [1214] printf_number_buffer::format_min_length#2 = printf_uchar::format_min_length#14 -- vbuxx=vbuz1 + ldx.z format_min_length // [1215] printf_number_buffer::format_zero_padding#2 = printf_uchar::format_zero_padding#14 // [1216] call printf_number_buffer // Print using format @@ -8119,36 +7845,32 @@ printf_uchar: { * * @param info_text The info text to be displayed. */ -// void display_action_text(__zp($3f) char *info_text) +// void display_action_text(__zp($32) char *info_text) display_action_text: { - .label info_text = $3f - .label x = $e6 - .label y = $ba + .label info_text = $32 + .label x = $c8 + .label y = $c3 // unsigned char x = wherex() // [1219] call wherex jsr wherex - // [1220] wherex::return#3 = wherex::return#0 -- vbuz1=vbuz2 - lda.z wherex.return - sta.z wherex.return_1 + // [1220] wherex::return#3 = wherex::return#0 // display_action_text::@1 - // [1221] display_action_text::x#0 = wherex::return#3 + // [1221] display_action_text::x#0 = wherex::return#3 -- vbuz1=vbuaa + sta.z x // unsigned char y = wherey() // [1222] call wherey jsr wherey - // [1223] wherey::return#3 = wherey::return#0 -- vbuz1=vbuz2 - lda.z wherey.return - sta.z wherey.return_1 + // [1223] wherey::return#3 = wherey::return#0 // display_action_text::@2 - // [1224] display_action_text::y#0 = wherey::return#3 + // [1224] display_action_text::y#0 = wherey::return#3 -- vbuz1=vbuaa + sta.z y // gotoxy(2, PROGRESS_Y-3) // [1225] call gotoxy // [751] phi from display_action_text::@2 to gotoxy [phi:display_action_text::@2->gotoxy] - // [751] phi gotoxy::y#30 = PROGRESS_Y-3 [phi:display_action_text::@2->gotoxy#0] -- vbuz1=vbuc1 - lda #PROGRESS_Y-3 - sta.z gotoxy.y - // [751] phi gotoxy::x#30 = 2 [phi:display_action_text::@2->gotoxy#1] -- vbuz1=vbuc1 - lda #2 - sta.z gotoxy.x + // [751] phi gotoxy::y#30 = PROGRESS_Y-3 [phi:display_action_text::@2->gotoxy#0] -- vbuyy=vbuc1 + ldy #PROGRESS_Y-3 + // [751] phi gotoxy::x#30 = 2 [phi:display_action_text::@2->gotoxy#1] -- vbuxx=vbuc1 + ldx #2 jsr gotoxy // display_action_text::@3 // printf("%-65s", info_text) @@ -8174,12 +7896,10 @@ display_action_text: { jsr printf_string // display_action_text::@4 // gotoxy(x, y) - // [1228] gotoxy::x#12 = display_action_text::x#0 -- vbuz1=vbuz2 - lda.z x - sta.z gotoxy.x - // [1229] gotoxy::y#12 = display_action_text::y#0 -- vbuz1=vbuz2 - lda.z y - sta.z gotoxy.y + // [1228] gotoxy::x#12 = display_action_text::x#0 -- vbuxx=vbuz1 + ldx.z x + // [1229] gotoxy::y#12 = display_action_text::y#0 -- vbuyy=vbuz1 + ldy.z y // [1230] call gotoxy // [751] phi from display_action_text::@4 to gotoxy [phi:display_action_text::@4->gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#12 [phi:display_action_text::@4->gotoxy#0] -- register_copy @@ -8252,27 +7972,20 @@ smc_reset: { * @param status The status to be checked. * @return unsigned char true if one chip is equal to the status. */ -// __zp($e2) 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 = $ba - .label check_status_rom1_return = $ba - .label rom_chip = $36 - .label return = $e2 // [1242] phi from check_status_card_roms to check_status_card_roms::@1 [phi:check_status_card_roms->check_status_card_roms::@1] - // [1242] phi check_status_card_roms::rom_chip#2 = 1 [phi:check_status_card_roms->check_status_card_roms::@1#0] -- vbuz1=vbuc1 - lda #1 - sta.z rom_chip + // [1242] 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++) - // [1243] if(check_status_card_roms::rom_chip#2<8) goto check_status_card_roms::check_status_rom1 -- vbuz1_lt_vbuc1_then_la1 - lda.z rom_chip - cmp #8 + // [1243] 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 // [1244] phi from check_status_card_roms::@1 to check_status_card_roms::@return [phi:check_status_card_roms::@1->check_status_card_roms::@return] - // [1244] phi check_status_card_roms::return#2 = 0 [phi:check_status_card_roms::@1->check_status_card_roms::@return#0] -- vbuz1=vbuc1 + // [1244] 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.z return // check_status_card_roms::@return // } // [1245] return @@ -8280,32 +7993,29 @@ check_status_card_roms: { // check_status_card_roms::check_status_rom1 check_status_rom1: // status_rom[rom_chip] == status - // [1246] check_status_card_roms::check_status_rom1_$0 = status_rom[check_status_card_roms::rom_chip#2] == STATUS_FLASH -- vboz1=pbuc1_derefidx_vbuz2_eq_vbuc2 + // [1246] 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.z 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); // [1247] 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)) - // [1248] 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 + // [1248] 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 // [1244] phi from check_status_card_roms::@3 to check_status_card_roms::@return [phi:check_status_card_roms::@3->check_status_card_roms::@return] - // [1244] phi check_status_card_roms::return#2 = 1 [phi:check_status_card_roms::@3->check_status_card_roms::@return#0] -- vbuz1=vbuc1 + // [1244] 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.z return rts // check_status_card_roms::@2 __b2: // for(unsigned char rom_chip = 1; rom_chip < 8; rom_chip++) - // [1249] check_status_card_roms::rom_chip#1 = ++ check_status_card_roms::rom_chip#2 -- vbuz1=_inc_vbuz1 - inc.z rom_chip + // [1249] check_status_card_roms::rom_chip#1 = ++ check_status_card_roms::rom_chip#2 -- vbuxx=_inc_vbuxx + inx // [1242] phi from check_status_card_roms::@2 to check_status_card_roms::@1 [phi:check_status_card_roms::@2->check_status_card_roms::@1] // [1242] 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 @@ -8318,44 +8028,36 @@ check_status_card_roms: { * @param info_status The status. * @param info_text The status text. */ -// void display_info_rom(__zp($30) char rom_chip, __zp($2c) char info_status, __zp($4e) char *info_text) +// void display_info_rom(__zp($65) char rom_chip, __mem() char info_status, __zp($3e) char *info_text) display_info_rom: { - .label display_info_rom__6 = $fb - .label display_info_rom__12 = $2c - .label x = $65 - .label y = $dd - .label info_status = $2c - .label info_text = $4e - .label rom_chip = $30 - .label display_info_rom__16 = $fb - .label display_info_rom__17 = $fb + .label display_info_rom__13 = $ca + .label info_text = $3e + .label rom_chip = $65 // unsigned char x = wherex() // [1251] call wherex jsr wherex - // [1252] wherex::return#12 = wherex::return#0 -- vbuz1=vbuz2 - lda.z wherex.return - sta.z wherex.return_4 + // [1252] wherex::return#12 = wherex::return#0 // display_info_rom::@3 - // [1253] display_info_rom::x#0 = wherex::return#12 + // [1253] display_info_rom::x#0 = wherex::return#12 -- vbum1=vbuaa + sta x // unsigned char y = wherey() // [1254] call wherey jsr wherey - // [1255] wherey::return#12 = wherey::return#0 -- vbuz1=vbuz2 - lda.z wherey.return - sta.z wherey.return_4 + // [1255] wherey::return#12 = wherey::return#0 // display_info_rom::@4 - // [1256] display_info_rom::y#0 = wherey::return#12 + // [1256] display_info_rom::y#0 = wherey::return#12 -- vbum1=vbuaa + sta y // status_rom[rom_chip] = info_status - // [1257] status_rom[display_info_rom::rom_chip#16] = display_info_rom::info_status#16 -- pbuc1_derefidx_vbuz1=vbuz2 - lda.z info_status + // [1257] status_rom[display_info_rom::rom_chip#16] = display_info_rom::info_status#16 -- pbuc1_derefidx_vbuz1=vbum2 + lda info_status ldy.z rom_chip sta status_rom,y // display_rom_led(rom_chip, status_color[info_status]) // [1258] display_rom_led::chip#1 = display_info_rom::rom_chip#16 -- vbuz1=vbuz2 tya sta.z display_rom_led.chip - // [1259] display_rom_led::c#1 = status_color[display_info_rom::info_status#16] -- vbuz1=pbuc1_derefidx_vbuz2 - ldy.z info_status + // [1259] 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 // [1260] call display_rom_led @@ -8365,41 +8067,35 @@ display_info_rom: { jsr display_rom_led // display_info_rom::@5 // gotoxy(INFO_X, INFO_Y+rom_chip+2) - // [1261] gotoxy::y#17 = display_info_rom::rom_chip#16 + $11+2 -- vbuz1=vbuz2_plus_vbuc1 + // [1261] gotoxy::y#17 = display_info_rom::rom_chip#16 + $11+2 -- vbuyy=vbuz1_plus_vbuc1 lda #$11+2 clc adc.z rom_chip - sta.z gotoxy.y + tay // [1262] call gotoxy // [751] phi from display_info_rom::@5 to gotoxy [phi:display_info_rom::@5->gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#17 [phi:display_info_rom::@5->gotoxy#0] -- register_copy - // [751] phi gotoxy::x#30 = 4 [phi:display_info_rom::@5->gotoxy#1] -- vbuz1=vbuc1 - lda #4 - sta.z gotoxy.x + // [751] phi gotoxy::x#30 = 4 [phi:display_info_rom::@5->gotoxy#1] -- vbuxx=vbuc1 + ldx #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]) - // [1263] display_info_rom::$13 = display_info_rom::rom_chip#16 << 1 -- vbum1=vbuz2_rol_1 + // [1263] display_info_rom::$13 = display_info_rom::rom_chip#16 << 1 -- vbuz1=vbuz2_rol_1 lda.z rom_chip asl - sta display_info_rom__13 + sta.z display_info_rom__13 // rom_chip*13 - // [1264] display_info_rom::$16 = display_info_rom::$13 + display_info_rom::rom_chip#16 -- vbuz1=vbum2_plus_vbuz3 + // [1264] display_info_rom::$16 = display_info_rom::$13 + display_info_rom::rom_chip#16 -- vbuaa=vbuz1_plus_vbuz2 clc adc.z rom_chip - sta.z display_info_rom__16 - // [1265] display_info_rom::$17 = display_info_rom::$16 << 2 -- vbuz1=vbuz1_rol_2 - lda.z display_info_rom__17 + // [1265] display_info_rom::$17 = display_info_rom::$16 << 2 -- vbuaa=vbuaa_rol_2 asl asl - sta.z display_info_rom__17 - // [1266] display_info_rom::$6 = display_info_rom::$17 + display_info_rom::rom_chip#16 -- vbuz1=vbuz1_plus_vbuz2 - lda.z display_info_rom__6 + // [1266] display_info_rom::$6 = display_info_rom::$17 + display_info_rom::rom_chip#16 -- vbuaa=vbuaa_plus_vbuz1 clc adc.z rom_chip - sta.z 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]) - // [1267] printf_string::str#10 = rom_release_text + display_info_rom::$6 -- pbum1=pbuc1_plus_vbuz2 + // [1267] printf_string::str#10 = rom_release_text + display_info_rom::$6 -- pbum1=pbuc1_plus_vbuaa clc adc #printf_uchar] // [1207] phi printf_uchar::format_zero_padding#14 = 0 [phi:display_info_rom::@7->printf_uchar#0] -- vbuz1=vbuc1 @@ -8434,9 +8131,8 @@ display_info_rom: { sta.z printf_uchar.putc lda #>cputc sta.z printf_uchar.putc+1 - // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:display_info_rom::@7->printf_uchar#3] -- vbuz1=vbuc1 - lda #DECIMAL - sta.z printf_uchar.format_radix + // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:display_info_rom::@7->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL // [1207] phi printf_uchar::uvalue#14 = printf_uchar::uvalue#0 [phi:display_info_rom::@7->printf_uchar#4] -- register_copy jsr printf_uchar // [1271] phi from display_info_rom::@7 to display_info_rom::@8 [phi:display_info_rom::@7->display_info_rom::@8] @@ -8457,10 +8153,11 @@ 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]) - // [1273] display_info_rom::$12 = display_info_rom::info_status#16 << 1 -- vbuz1=vbuz1_rol_1 - asl.z display_info_rom__12 - // [1274] printf_string::str#8 = status_text[display_info_rom::$12] -- pbuz1=qbuc1_derefidx_vbuz2 - ldy.z display_info_rom__12 + // [1273] display_info_rom::$12 = display_info_rom::info_status#16 << 1 -- vbuaa=vbum1_rol_1 + lda info_status + asl + // [1274] printf_string::str#8 = status_text[display_info_rom::$12] -- pbuz1=qbuc1_derefidx_vbuaa + tay lda status_text,y sta.z printf_string.str lda status_text+1,y @@ -8498,8 +8195,8 @@ 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]) - // [1278] printf_string::str#9 = rom_device_names[display_info_rom::$13] -- pbuz1=qbuc1_derefidx_vbum2 - ldy display_info_rom__13 + // [1278] printf_string::str#9 = rom_device_names[display_info_rom::$13] -- pbuz1=qbuc1_derefidx_vbuz2 + ldy.z display_info_rom__13 lda rom_device_names,y sta.z printf_string.str lda rom_device_names+1,y @@ -8608,12 +8305,10 @@ display_info_rom: { // display_info_rom::@1 __b1: // gotoxy(x,y) - // [1289] gotoxy::x#18 = display_info_rom::x#0 -- vbuz1=vbuz2 - lda.z x - sta.z gotoxy.x - // [1290] gotoxy::y#18 = display_info_rom::y#0 -- vbuz1=vbuz2 - lda.z y - sta.z gotoxy.y + // [1289] gotoxy::x#18 = display_info_rom::x#0 -- vbuxx=vbum1 + ldx x + // [1290] gotoxy::y#18 = display_info_rom::y#0 -- vbuyy=vbum1 + ldy y // [1291] call gotoxy // [751] phi from display_info_rom::@1 to gotoxy [phi:display_info_rom::@1->gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#18 [phi:display_info_rom::@1->gotoxy#0] -- register_copy @@ -8626,17 +8321,17 @@ display_info_rom: { .segment Data s: .text "ROM" .byte 0 - .label display_info_rom__13 = display_frame.w + x: .byte 0 + y: .byte 0 + .label info_status = rom_get_version_text.release } .segment Code // rom_file -// __mem() char * rom_file(__zp($2c) char rom_chip) +// __mem() char * rom_file(__register(A) char rom_chip) rom_file: { - .label rom_file__0 = $2c - .label rom_chip = $2c // if(rom_chip) - // [1294] if(0!=rom_file::rom_chip#2) goto rom_file::@1 -- 0_neq_vbuz1_then_la1 - lda.z rom_chip + // [1294] if(0!=rom_file::rom_chip#2) goto rom_file::@1 -- 0_neq_vbuaa_then_la1 + cmp #0 bne __b1 // [1297] phi from rom_file to rom_file::@return [phi:rom_file->rom_file::@return] // [1297] phi rom_file::return#2 = rom_file::file_rom_cx16 [phi:rom_file->rom_file::@return#0] -- pbum1=pbuc1 @@ -8648,13 +8343,11 @@ rom_file: { // rom_file::@1 __b1: // '0'+rom_chip - // [1295] rom_file::$0 = '0' + rom_file::rom_chip#2 -- vbuz1=vbuc1_plus_vbuz1 - lda #'0' + // [1295] 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 - // [1296] *(rom_file::file_rom_card+3) = rom_file::$0 -- _deref_pbuc1=vbuz1 + // [1296] *(rom_file::file_rom_card+3) = rom_file::$0 -- _deref_pbuc1=vbuaa sta file_rom_card+3 // [1297] phi from rom_file::@1 to rom_file::@return [phi:rom_file::@1->rom_file::@return] // [1297] phi rom_file::return#2 = rom_file::file_rom_card [phi:rom_file::@1->rom_file::@return#0] -- pbum1=pbuc1 @@ -8675,19 +8368,24 @@ rom_file: { } .segment Code // rom_read -// __mem() unsigned long rom_read(char rom_chip, __zp($c8) char *file, __mem() char info_status, __mem() char brom_bank_start, __zp($6f) unsigned long rom_size) +// __zp($7a) unsigned long rom_read(char rom_chip, __zp($ac) char *file, __mem() char info_status, __zp($f0) char brom_bank_start, __zp($59) unsigned long rom_size) rom_read: { .const bank_set_brom1_bank = 0 - .label rom_address = $56 - .label ram_address = $6d - .label rom_row_current = $7e - .label file = $c8 - .label rom_size = $6f - .label rom_action_text = $79 + .label rom_read__12 = $ec + .label rom_address = $45 + .label return = $7a + .label brom_bank_start = $f0 + .label y = $f8 + .label ram_address = $57 + .label rom_file_size = $7a + .label rom_row_current = $66 + .label bram_bank = $ea + .label file = $ac + .label rom_size = $59 + .label rom_action_text = $63 // unsigned long rom_address = rom_address_from_bank(brom_bank_start) - // [1300] rom_address_from_bank::rom_bank#0 = rom_read::brom_bank_start#23 -- vbum1=vbum2 - lda brom_bank_start - sta rom_address_from_bank.rom_bank + // [1300] rom_address_from_bank::rom_bank#0 = rom_read::brom_bank_start#23 -- vbuaa=vbuz1 + lda.z brom_bank_start // [1301] call rom_address_from_bank // [2417] phi from rom_read to rom_address_from_bank [phi:rom_read->rom_address_from_bank] // [2417] phi rom_address_from_bank::rom_bank#3 = rom_address_from_bank::rom_bank#0 [phi:rom_read->rom_address_from_bank#0] -- register_copy @@ -8819,7 +8517,7 @@ rom_read: { sta.z fopen.path+1 // [1321] call fopen // [2181] phi from rom_read::@24 to fopen [phi:rom_read::@24->fopen] - // [2181] phi __errno#302 = __errno#110 [phi:rom_read::@24->fopen#0] -- register_copy + // [2181] phi __errno#318 = __errno#110 [phi:rom_read::@24->fopen#0] -- register_copy // [2181] phi fopen::pathtoken#0 = fopen::path#3 [phi:rom_read::@24->fopen#1] -- register_copy jsr fopen // FILE *fp = fopen(file, "r") @@ -8844,17 +8542,15 @@ rom_read: { // gotoxy(x, y) // [1326] call gotoxy // [751] phi from rom_read::@4 to gotoxy [phi:rom_read::@4->gotoxy] - // [751] phi gotoxy::y#30 = PROGRESS_Y [phi:rom_read::@4->gotoxy#0] -- vbuz1=vbuc1 - lda #PROGRESS_Y - sta.z gotoxy.y - // [751] phi gotoxy::x#30 = PROGRESS_X [phi:rom_read::@4->gotoxy#1] -- vbuz1=vbuc1 - lda #PROGRESS_X - sta.z gotoxy.x + // [751] phi gotoxy::y#30 = PROGRESS_Y [phi:rom_read::@4->gotoxy#0] -- vbuyy=vbuc1 + ldy #PROGRESS_Y + // [751] phi gotoxy::x#30 = PROGRESS_X [phi:rom_read::@4->gotoxy#1] -- vbuxx=vbuc1 + ldx #PROGRESS_X jsr gotoxy // [1327] phi from rom_read::@4 to rom_read::@5 [phi:rom_read::@4->rom_read::@5] - // [1327] phi rom_read::y#11 = PROGRESS_Y [phi:rom_read::@4->rom_read::@5#0] -- vbum1=vbuc1 + // [1327] phi rom_read::y#11 = PROGRESS_Y [phi:rom_read::@4->rom_read::@5#0] -- vbuz1=vbuc1 lda #PROGRESS_Y - sta y + sta.z y // [1327] 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 @@ -8866,33 +8562,33 @@ rom_read: { sta.z ram_address lda #>$7800 sta.z ram_address+1 - // [1327] phi rom_read::bram_bank#10 = 0 [phi:rom_read::@4->rom_read::@5#5] -- vbum1=vbuc1 + // [1327] phi rom_read::bram_bank#10 = 0 [phi:rom_read::@4->rom_read::@5#5] -- vbuz1=vbuc1 lda #0 - sta bram_bank - // [1327] phi rom_read::rom_file_size#11 = 0 [phi:rom_read::@4->rom_read::@5#6] -- vdum1=vduc1 - sta rom_file_size - sta rom_file_size+1 + sta.z bram_bank + // [1327] phi rom_read::rom_file_size#11 = 0 [phi:rom_read::@4->rom_read::@5#6] -- vduz1=vduc1 + sta.z rom_file_size + sta.z rom_file_size+1 lda #<0>>$10 - sta rom_file_size+2 + sta.z rom_file_size+2 lda #>0>>$10 - sta rom_file_size+3 + sta.z rom_file_size+3 // rom_read::@5 __b5: // while (rom_file_size < rom_size) - // [1328] if(rom_read::rom_file_size#11rom_read::@3] __b4: - // [1331] phi rom_read::return#0 = 0 [phi:rom_read::@25->rom_read::@3#0] -- vdum1=vduc1 + // [1331] phi rom_read::return#0 = 0 [phi:rom_read::@25->rom_read::@3#0] -- vduz1=vduc1 lda #<0 - sta return - sta return+1 + sta.z return + sta.z return+1 lda #<0>>$10 - sta return+2 + sta.z return+2 lda #>0>>$10 - sta return+3 + sta.z return+3 // rom_read::@3 // rom_read::@return // } @@ -9014,14 +8710,14 @@ rom_read: { jsr printf_str // rom_read::@30 // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", rom_action_text, file, rom_file_size, rom_size, bram_bank, ram_address) - // [1343] printf_ulong::uvalue#0 = rom_read::rom_file_size#11 -- vduz1=vdum2 - lda rom_file_size + // [1343] printf_ulong::uvalue#0 = rom_read::rom_file_size#11 -- vduz1=vduz2 + lda.z rom_file_size sta.z printf_ulong.uvalue - lda rom_file_size+1 + lda.z rom_file_size+1 sta.z printf_ulong.uvalue+1 - lda rom_file_size+2 + lda.z rom_file_size+2 sta.z printf_ulong.uvalue+2 - lda rom_file_size+3 + lda.z rom_file_size+3 sta.z printf_ulong.uvalue+3 // [1344] call printf_ulong // [1454] phi from rom_read::@30 to printf_ulong [phi:rom_read::@30->printf_ulong] @@ -9031,9 +8727,8 @@ rom_read: { // [1454] phi printf_ulong::format_min_length#10 = 5 [phi:rom_read::@30->printf_ulong#1] -- vbuz1=vbuc1 lda #5 sta.z printf_ulong.format_min_length - // [1454] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:rom_read::@30->printf_ulong#2] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_ulong.format_radix + // [1454] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:rom_read::@30->printf_ulong#2] -- vbuxx=vbuc1 + ldx #HEXADECIMAL // [1454] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#0 [phi:rom_read::@30->printf_ulong#3] -- register_copy jsr printf_ulong // [1345] phi from rom_read::@30 to rom_read::@31 [phi:rom_read::@30->rom_read::@31] @@ -9071,9 +8766,8 @@ rom_read: { // [1454] phi printf_ulong::format_min_length#10 = 5 [phi:rom_read::@32->printf_ulong#1] -- vbuz1=vbuc1 lda #5 sta.z printf_ulong.format_min_length - // [1454] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:rom_read::@32->printf_ulong#2] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_ulong.format_radix + // [1454] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:rom_read::@32->printf_ulong#2] -- vbuxx=vbuc1 + ldx #HEXADECIMAL // [1454] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#1 [phi:rom_read::@32->printf_ulong#3] -- register_copy jsr printf_ulong // [1349] phi from rom_read::@32 to rom_read::@33 [phi:rom_read::@32->rom_read::@33] @@ -9094,9 +8788,8 @@ rom_read: { jsr printf_str // rom_read::@34 // sprintf(info_text, "%s %s:%05x/%05x -> RAM:%02x:%04p ...", rom_action_text, file, rom_file_size, rom_size, bram_bank, ram_address) - // [1351] printf_uchar::uvalue#9 = rom_read::bram_bank#10 -- vbuz1=vbum2 - lda bram_bank - sta.z printf_uchar.uvalue + // [1351] printf_uchar::uvalue#9 = rom_read::bram_bank#10 -- vbuxx=vbuz1 + ldx.z bram_bank // [1352] call printf_uchar // [1207] phi from rom_read::@34 to printf_uchar [phi:rom_read::@34->printf_uchar] // [1207] phi printf_uchar::format_zero_padding#14 = 1 [phi:rom_read::@34->printf_uchar#0] -- vbuz1=vbuc1 @@ -9110,9 +8803,8 @@ rom_read: { sta.z printf_uchar.putc lda #>snputc sta.z printf_uchar.putc+1 - // [1207] phi printf_uchar::format_radix#14 = HEXADECIMAL [phi:rom_read::@34->printf_uchar#3] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_uchar.format_radix + // [1207] phi printf_uchar::format_radix#14 = HEXADECIMAL [phi:rom_read::@34->printf_uchar#3] -- vbuyy=vbuc1 + ldy #HEXADECIMAL // [1207] phi printf_uchar::uvalue#14 = printf_uchar::uvalue#9 [phi:rom_read::@34->printf_uchar#4] -- register_copy jsr printf_uchar // [1353] phi from rom_read::@34 to rom_read::@35 [phi:rom_read::@34->rom_read::@35] @@ -9139,22 +8831,21 @@ rom_read: { lda.z ram_address+1 sta.z printf_uint.uvalue+1 // [1356] call printf_uint - // [1839] phi from rom_read::@36 to printf_uint [phi:rom_read::@36->printf_uint] - // [1839] phi printf_uint::format_zero_padding#14 = 1 [phi:rom_read::@36->printf_uint#0] -- vbuz1=vbuc1 + // [1828] phi from rom_read::@36 to printf_uint [phi:rom_read::@36->printf_uint] + // [1828] phi printf_uint::format_zero_padding#14 = 1 [phi:rom_read::@36->printf_uint#0] -- vbuz1=vbuc1 lda #1 sta.z printf_uint.format_zero_padding - // [1839] phi printf_uint::format_min_length#14 = 4 [phi:rom_read::@36->printf_uint#1] -- vbuz1=vbuc1 + // [1828] phi printf_uint::format_min_length#14 = 4 [phi:rom_read::@36->printf_uint#1] -- vbuz1=vbuc1 lda #4 sta.z printf_uint.format_min_length - // [1839] phi printf_uint::putc#14 = &snputc [phi:rom_read::@36->printf_uint#2] -- pprz1=pprc1 + // [1828] phi printf_uint::putc#14 = &snputc [phi:rom_read::@36->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1839] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:rom_read::@36->printf_uint#3] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_uint.format_radix - // [1839] phi printf_uint::uvalue#14 = printf_uint::uvalue#10 [phi:rom_read::@36->printf_uint#4] -- register_copy + // [1828] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:rom_read::@36->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1828] phi printf_uint::uvalue#14 = printf_uint::uvalue#10 [phi:rom_read::@36->printf_uint#4] -- register_copy jsr printf_uint // [1357] phi from rom_read::@36 to rom_read::@37 [phi:rom_read::@36->rom_read::@37] // rom_read::@37 @@ -9192,38 +8883,38 @@ rom_read: { jsr display_action_text // rom_read::@39 // rom_address % 0x04000 - // [1363] rom_read::$12 = rom_read::rom_address#10 & $4000-1 -- vdum1=vduz2_band_vduc1 + // [1363] rom_read::$12 = rom_read::rom_address#10 & $4000-1 -- vduz1=vduz2_band_vduc1 lda.z rom_address and #<$4000-1 - sta rom_read__12 + sta.z rom_read__12 lda.z rom_address+1 and #>$4000-1 - sta rom_read__12+1 + sta.z rom_read__12+1 lda.z rom_address+2 and #<$4000-1>>$10 - sta rom_read__12+2 + sta.z rom_read__12+2 lda.z rom_address+3 and #>$4000-1>>$10 - sta rom_read__12+3 + sta.z rom_read__12+3 // if (!(rom_address % 0x04000)) - // [1364] if(0!=rom_read::$12) goto rom_read::@7 -- 0_neq_vdum1_then_la1 - lda rom_read__12 - ora rom_read__12+1 - ora rom_read__12+2 - ora rom_read__12+3 + // [1364] if(0!=rom_read::$12) goto rom_read::@7 -- 0_neq_vduz1_then_la1 + lda.z rom_read__12 + ora.z rom_read__12+1 + ora.z rom_read__12+2 + ora.z rom_read__12+3 bne __b7 // rom_read::@13 // brom_bank_start++; - // [1365] rom_read::brom_bank_start#0 = ++ rom_read::brom_bank_start#10 -- vbum1=_inc_vbum1 - inc brom_bank_start + // [1365] rom_read::brom_bank_start#0 = ++ rom_read::brom_bank_start#10 -- vbuz1=_inc_vbuz1 + inc.z brom_bank_start // [1366] phi from rom_read::@13 rom_read::@39 to rom_read::@7 [phi:rom_read::@13/rom_read::@39->rom_read::@7] // [1366] phi rom_read::brom_bank_start#21 = rom_read::brom_bank_start#0 [phi:rom_read::@13/rom_read::@39->rom_read::@7#0] -- register_copy // rom_read::@7 __b7: // rom_read::bank_set_bram2 // BRAM = bank - // [1367] BRAM = rom_read::bram_bank#10 -- vbuz1=vbum2 - lda bram_bank + // [1367] BRAM = rom_read::bram_bank#10 -- vbuz1=vbuz2 + lda.z bram_bank sta.z BRAM // rom_read::@18 // unsigned int rom_package_read = fgets(ram_address, ROM_PROGRESS_CELL, fp) @@ -9273,18 +8964,16 @@ rom_read: { bne __b10 // rom_read::@14 // gotoxy(x, ++y); - // [1375] rom_read::y#1 = ++ rom_read::y#11 -- vbum1=_inc_vbum1 - inc y + // [1375] rom_read::y#1 = ++ rom_read::y#11 -- vbuz1=_inc_vbuz1 + inc.z y // gotoxy(x, ++y) - // [1376] gotoxy::y#25 = rom_read::y#1 -- vbuz1=vbum2 - lda y - sta.z gotoxy.y + // [1376] gotoxy::y#25 = rom_read::y#1 -- vbuyy=vbuz1 + ldy.z y // [1377] call gotoxy // [751] phi from rom_read::@14 to gotoxy [phi:rom_read::@14->gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#25 [phi:rom_read::@14->gotoxy#0] -- register_copy - // [751] phi gotoxy::x#30 = PROGRESS_X [phi:rom_read::@14->gotoxy#1] -- vbuz1=vbuc1 - lda #PROGRESS_X - sta.z gotoxy.x + // [751] phi gotoxy::x#30 = PROGRESS_X [phi:rom_read::@14->gotoxy#1] -- vbuxx=vbuc1 + ldx #PROGRESS_X jsr gotoxy // [1378] phi from rom_read::@14 to rom_read::@10 [phi:rom_read::@14->rom_read::@10] // [1378] phi rom_read::y#40 = rom_read::y#1 [phi:rom_read::@14->rom_read::@10#0] -- register_copy @@ -9338,20 +9027,20 @@ rom_read: { adc #0 sta.z rom_address+3 // rom_file_size += rom_package_read - // [1385] rom_read::rom_file_size#1 = rom_read::rom_file_size#11 + rom_read::rom_package_read#0 -- vdum1=vdum1_plus_vwum2 - lda rom_file_size + // [1385] rom_read::rom_file_size#1 = rom_read::rom_file_size#11 + rom_read::rom_package_read#0 -- vduz1=vduz1_plus_vwum2 + lda.z rom_file_size clc adc rom_package_read - sta rom_file_size - lda rom_file_size+1 + sta.z rom_file_size + lda.z rom_file_size+1 adc rom_package_read+1 - sta rom_file_size+1 - lda rom_file_size+2 + sta.z rom_file_size+1 + lda.z rom_file_size+2 adc #0 - sta rom_file_size+2 - lda rom_file_size+3 + sta.z rom_file_size+2 + lda.z rom_file_size+3 adc #0 - sta rom_file_size+3 + sta.z rom_file_size+3 // rom_row_current += rom_package_read // [1386] rom_read::rom_row_current#2 = rom_read::rom_row_current#4 + rom_read::rom_package_read#0 -- vwuz1=vwuz1_plus_vwum2 clc @@ -9371,8 +9060,8 @@ rom_read: { bne __b12 // rom_read::@16 // bram_bank++; - // [1388] rom_read::bram_bank#1 = ++ rom_read::bram_bank#10 -- vbum1=_inc_vbum1 - inc bram_bank + // [1388] rom_read::bram_bank#1 = ++ rom_read::bram_bank#10 -- vbuz1=_inc_vbuz1 + inc.z bram_bank // [1389] phi from rom_read::@16 to rom_read::@12 [phi:rom_read::@16->rom_read::@12] // [1389] phi rom_read::bram_bank#32 = rom_read::bram_bank#1 [phi:rom_read::@16->rom_read::@12#0] -- register_copy // [1389] phi rom_read::ram_address#7 = (char *)$a000 [phi:rom_read::@16->rom_read::@12#1] -- pbuz1=pbuc1 @@ -9407,9 +9096,9 @@ rom_read: { sta.z ram_address lda #>$a000 sta.z ram_address+1 - // [1327] phi rom_read::bram_bank#10 = 1 [phi:rom_read::@12->rom_read::@5#5] -- vbum1=vbuc1 + // [1327] phi rom_read::bram_bank#10 = 1 [phi:rom_read::@12->rom_read::@5#5] -- vbuz1=vbuc1 lda #1 - sta bram_bank + sta.z bram_bank // [1327] phi rom_read::rom_file_size#11 = rom_read::rom_file_size#1 [phi:rom_read::@12->rom_read::@5#6] -- register_copy jmp __b5 // [1391] phi from rom_read::@12 to rom_read::@41 [phi:rom_read::@12->rom_read::@41] @@ -9427,29 +9116,27 @@ rom_read: { .byte 0 s1: .text " from SD card ..." .byte 0 - rom_read__12: .dword 0 .label fp = util_wait_key.ch - return: .dword 0 rom_package_read: .word 0 - .label brom_bank_start = strchr.c - .label y = main.check_status_smc4_main__0 - .label rom_file_size = return - .label bram_bank = main.check_status_cx16_rom2_check_status_rom1_main__0 - .label info_status = main.check_status_smc3_main__0 + .label info_status = main.check_status_smc5_return } .segment Code // rom_verify -// __zp($a9) unsigned long rom_verify(__zp($30) char rom_chip, __mem() char rom_bank_start, __mem() unsigned long file_size) +// __zp($68) unsigned long rom_verify(__zp($65) char rom_chip, __register(X) char rom_bank_start, __mem() unsigned long file_size) rom_verify: { - .label rom_verify__16 = $50 - .label rom_address = $75 - .label equal_bytes = $50 - .label ram_address = $d7 - .label rom_different_bytes = $a9 - .label rom_chip = $30 - .label return = $a9 + .label rom_verify__16 = $40 + .label rom_address = $5f + .label equal_bytes = $40 + .label y = $e7 + .label ram_address = $b9 + .label bram_bank = $e4 + .label rom_different_bytes = $68 + .label rom_chip = $65 + .label return = $68 + .label progress_row_current = $f6 // unsigned long rom_address = rom_address_from_bank(rom_bank_start) - // [1392] rom_address_from_bank::rom_bank#1 = rom_verify::rom_bank_start#0 + // [1392] rom_address_from_bank::rom_bank#1 = rom_verify::rom_bank_start#0 -- vbuaa=vbuxx + txa // [1393] call rom_address_from_bank // [2417] phi from rom_verify to rom_address_from_bank [phi:rom_verify->rom_address_from_bank] // [2417] phi rom_address_from_bank::rom_bank#3 = rom_address_from_bank::rom_bank#1 [phi:rom_verify->rom_address_from_bank#0] -- register_copy @@ -9491,30 +9178,28 @@ rom_verify: { lda #>info_text sta.z display_info_rom.info_text+1 // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#1 [phi:rom_verify::@11->display_info_rom#1] -- register_copy - // [1250] phi display_info_rom::info_status#16 = STATUS_COMPARING [phi:rom_verify::@11->display_info_rom#2] -- vbuz1=vbuc1 + // [1250] phi display_info_rom::info_status#16 = STATUS_COMPARING [phi:rom_verify::@11->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 // [1399] phi from rom_verify::@11 to rom_verify::@12 [phi:rom_verify::@11->rom_verify::@12] // rom_verify::@12 // gotoxy(x, y) // [1400] call gotoxy // [751] phi from rom_verify::@12 to gotoxy [phi:rom_verify::@12->gotoxy] - // [751] phi gotoxy::y#30 = PROGRESS_Y [phi:rom_verify::@12->gotoxy#0] -- vbuz1=vbuc1 - lda #PROGRESS_Y - sta.z gotoxy.y - // [751] phi gotoxy::x#30 = PROGRESS_X [phi:rom_verify::@12->gotoxy#1] -- vbuz1=vbuc1 - lda #PROGRESS_X - sta.z gotoxy.x + // [751] phi gotoxy::y#30 = PROGRESS_Y [phi:rom_verify::@12->gotoxy#0] -- vbuyy=vbuc1 + ldy #PROGRESS_Y + // [751] phi gotoxy::x#30 = PROGRESS_X [phi:rom_verify::@12->gotoxy#1] -- vbuxx=vbuc1 + ldx #PROGRESS_X jsr gotoxy // [1401] phi from rom_verify::@12 to rom_verify::@1 [phi:rom_verify::@12->rom_verify::@1] - // [1401] phi rom_verify::y#3 = PROGRESS_Y [phi:rom_verify::@12->rom_verify::@1#0] -- vbum1=vbuc1 + // [1401] phi rom_verify::y#3 = PROGRESS_Y [phi:rom_verify::@12->rom_verify::@1#0] -- vbuz1=vbuc1 lda #PROGRESS_Y - sta y - // [1401] phi rom_verify::progress_row_current#3 = 0 [phi:rom_verify::@12->rom_verify::@1#1] -- vwum1=vwuc1 + sta.z y + // [1401] phi rom_verify::progress_row_current#3 = 0 [phi:rom_verify::@12->rom_verify::@1#1] -- vwuz1=vwuc1 lda #<0 - sta progress_row_current - sta progress_row_current+1 + sta.z progress_row_current + sta.z progress_row_current+1 // [1401] phi rom_verify::rom_different_bytes#11 = 0 [phi:rom_verify::@12->rom_verify::@1#2] -- vduz1=vduc1 sta.z rom_different_bytes sta.z rom_different_bytes+1 @@ -9527,9 +9212,9 @@ rom_verify: { sta.z ram_address lda #>$7800 sta.z ram_address+1 - // [1401] phi rom_verify::bram_bank#11 = 0 [phi:rom_verify::@12->rom_verify::@1#4] -- vbum1=vbuc1 + // [1401] phi rom_verify::bram_bank#11 = 0 [phi:rom_verify::@12->rom_verify::@1#4] -- vbuz1=vbuc1 lda #0 - sta bram_bank + sta.z bram_bank // [1401] phi rom_verify::rom_address#12 = rom_verify::rom_address#0 [phi:rom_verify::@12->rom_verify::@1#5] -- register_copy // rom_verify::@1 __b1: @@ -9558,9 +9243,8 @@ rom_verify: { // rom_verify::@2 __b2: // unsigned int equal_bytes = rom_compare(bram_bank, (ram_ptr_t)ram_address, rom_address, ROM_PROGRESS_CELL) - // [1404] rom_compare::bank_ram#0 = rom_verify::bram_bank#11 -- vbuz1=vbum2 - lda bram_bank - sta.z rom_compare.bank_ram + // [1404] rom_compare::bank_ram#0 = rom_verify::bram_bank#11 -- vbuxx=vbuz1 + ldx.z bram_bank // [1405] rom_compare::ptr_ram#1 = rom_verify::ram_address#10 -- pbuz1=pbuz2 lda.z ram_address sta.z rom_compare.ptr_ram @@ -9592,34 +9276,32 @@ rom_verify: { // rom_verify::@13 // [1409] rom_verify::equal_bytes#0 = rom_compare::return#2 // if (progress_row_current == ROM_PROGRESS_ROW) - // [1410] if(rom_verify::progress_row_current#3!=ROM_PROGRESS_ROW) goto rom_verify::@3 -- vwum1_neq_vwuc1_then_la1 - lda progress_row_current+1 + // [1410] 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 - lda progress_row_current + lda.z progress_row_current cmp #gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#27 [phi:rom_verify::@8->gotoxy#0] -- register_copy - // [751] phi gotoxy::x#30 = PROGRESS_X [phi:rom_verify::@8->gotoxy#1] -- vbuz1=vbuc1 - lda #PROGRESS_X - sta.z gotoxy.x + // [751] phi gotoxy::x#30 = PROGRESS_X [phi:rom_verify::@8->gotoxy#1] -- vbuxx=vbuc1 + ldx #PROGRESS_X jsr gotoxy // [1414] phi from rom_verify::@8 to rom_verify::@3 [phi:rom_verify::@8->rom_verify::@3] // [1414] phi rom_verify::y#10 = rom_verify::y#1 [phi:rom_verify::@8->rom_verify::@3#0] -- register_copy - // [1414] phi rom_verify::progress_row_current#4 = 0 [phi:rom_verify::@8->rom_verify::@3#1] -- vwum1=vbuc1 + // [1414] phi rom_verify::progress_row_current#4 = 0 [phi:rom_verify::@8->rom_verify::@3#1] -- vwuz1=vbuc1 lda #<0 - sta progress_row_current - sta progress_row_current+1 + sta.z progress_row_current + sta.z progress_row_current+1 // [1414] phi from rom_verify::@13 to rom_verify::@3 [phi:rom_verify::@13->rom_verify::@3] // [1414] phi rom_verify::y#10 = rom_verify::y#3 [phi:rom_verify::@13->rom_verify::@3#0] -- register_copy // [1414] phi rom_verify::progress_row_current#4 = rom_verify::progress_row_current#3 [phi:rom_verify::@13->rom_verify::@3#1] -- register_copy @@ -9673,14 +9355,14 @@ rom_verify: { adc #0 sta.z rom_address+3 // progress_row_current += ROM_PROGRESS_CELL - // [1421] rom_verify::progress_row_current#11 = rom_verify::progress_row_current#4 + ROM_PROGRESS_CELL -- vwum1=vwum1_plus_vwuc1 - lda progress_row_current + // [1421] rom_verify::progress_row_current#11 = rom_verify::progress_row_current#4 + ROM_PROGRESS_CELL -- vwuz1=vwuz1_plus_vwuc1 + lda.z progress_row_current clc adc #ROM_PROGRESS_CELL - sta progress_row_current+1 + sta.z progress_row_current+1 // if (ram_address == BRAM_HIGH) // [1422] if(rom_verify::ram_address#1!=$c000) goto rom_verify::@6 -- pbuz1_neq_vwuc1_then_la1 lda.z ram_address+1 @@ -9691,8 +9373,8 @@ rom_verify: { bne __b6 // rom_verify::@10 // bram_bank++; - // [1423] rom_verify::bram_bank#1 = ++ rom_verify::bram_bank#11 -- vbum1=_inc_vbum1 - inc bram_bank + // [1423] rom_verify::bram_bank#1 = ++ rom_verify::bram_bank#11 -- vbuz1=_inc_vbuz1 + inc.z bram_bank // [1424] phi from rom_verify::@10 to rom_verify::@6 [phi:rom_verify::@10->rom_verify::@6] // [1424] phi rom_verify::bram_bank#24 = rom_verify::bram_bank#1 [phi:rom_verify::@10->rom_verify::@6#0] -- register_copy // [1424] phi rom_verify::ram_address#6 = (char *)$a000 [phi:rom_verify::@10->rom_verify::@6#1] -- pbuz1=pbuc1 @@ -9719,9 +9401,9 @@ rom_verify: { sta.z ram_address lda #>$a000 sta.z ram_address+1 - // [1427] phi rom_verify::bram_bank#10 = 1 [phi:rom_verify::@6->rom_verify::@7#1] -- vbum1=vbuc1 + // [1427] phi rom_verify::bram_bank#10 = 1 [phi:rom_verify::@6->rom_verify::@7#1] -- vbuz1=vbuc1 lda #1 - sta bram_bank + sta.z bram_bank // [1426] phi from rom_verify::@6 to rom_verify::@23 [phi:rom_verify::@6->rom_verify::@23] // rom_verify::@23 // [1427] phi from rom_verify::@23 to rom_verify::@7 [phi:rom_verify::@23->rom_verify::@7] @@ -9797,9 +9479,8 @@ rom_verify: { // [1454] phi printf_ulong::format_min_length#10 = 5 [phi:rom_verify::@15->printf_ulong#1] -- vbuz1=vbuc1 lda #5 sta.z printf_ulong.format_min_length - // [1454] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:rom_verify::@15->printf_ulong#2] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_ulong.format_radix + // [1454] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:rom_verify::@15->printf_ulong#2] -- vbuxx=vbuc1 + ldx #HEXADECIMAL // [1454] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#2 [phi:rom_verify::@15->printf_ulong#3] -- register_copy jsr printf_ulong // [1435] phi from rom_verify::@15 to rom_verify::@16 [phi:rom_verify::@15->rom_verify::@16] @@ -9820,9 +9501,8 @@ rom_verify: { jsr printf_str // rom_verify::@17 // sprintf(info_text, "Comparing: %05x differences between RAM:%02x:%04p <-> ROM:%05x", rom_different_bytes, bram_bank, ram_address, rom_address) - // [1437] printf_uchar::uvalue#10 = rom_verify::bram_bank#10 -- vbuz1=vbum2 - lda bram_bank - sta.z printf_uchar.uvalue + // [1437] printf_uchar::uvalue#10 = rom_verify::bram_bank#10 -- vbuxx=vbuz1 + ldx.z bram_bank // [1438] call printf_uchar // [1207] phi from rom_verify::@17 to printf_uchar [phi:rom_verify::@17->printf_uchar] // [1207] phi printf_uchar::format_zero_padding#14 = 1 [phi:rom_verify::@17->printf_uchar#0] -- vbuz1=vbuc1 @@ -9836,9 +9516,8 @@ rom_verify: { sta.z printf_uchar.putc lda #>snputc sta.z printf_uchar.putc+1 - // [1207] phi printf_uchar::format_radix#14 = HEXADECIMAL [phi:rom_verify::@17->printf_uchar#3] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_uchar.format_radix + // [1207] phi printf_uchar::format_radix#14 = HEXADECIMAL [phi:rom_verify::@17->printf_uchar#3] -- vbuyy=vbuc1 + ldy #HEXADECIMAL // [1207] phi printf_uchar::uvalue#14 = printf_uchar::uvalue#10 [phi:rom_verify::@17->printf_uchar#4] -- register_copy jsr printf_uchar // [1439] phi from rom_verify::@17 to rom_verify::@18 [phi:rom_verify::@17->rom_verify::@18] @@ -9865,22 +9544,21 @@ rom_verify: { lda.z ram_address+1 sta.z printf_uint.uvalue+1 // [1442] call printf_uint - // [1839] phi from rom_verify::@19 to printf_uint [phi:rom_verify::@19->printf_uint] - // [1839] phi printf_uint::format_zero_padding#14 = 1 [phi:rom_verify::@19->printf_uint#0] -- vbuz1=vbuc1 + // [1828] phi from rom_verify::@19 to printf_uint [phi:rom_verify::@19->printf_uint] + // [1828] phi printf_uint::format_zero_padding#14 = 1 [phi:rom_verify::@19->printf_uint#0] -- vbuz1=vbuc1 lda #1 sta.z printf_uint.format_zero_padding - // [1839] phi printf_uint::format_min_length#14 = 4 [phi:rom_verify::@19->printf_uint#1] -- vbuz1=vbuc1 + // [1828] phi printf_uint::format_min_length#14 = 4 [phi:rom_verify::@19->printf_uint#1] -- vbuz1=vbuc1 lda #4 sta.z printf_uint.format_min_length - // [1839] phi printf_uint::putc#14 = &snputc [phi:rom_verify::@19->printf_uint#2] -- pprz1=pprc1 + // [1828] phi printf_uint::putc#14 = &snputc [phi:rom_verify::@19->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1839] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:rom_verify::@19->printf_uint#3] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_uint.format_radix - // [1839] phi printf_uint::uvalue#14 = printf_uint::uvalue#11 [phi:rom_verify::@19->printf_uint#4] -- register_copy + // [1828] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:rom_verify::@19->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1828] phi printf_uint::uvalue#14 = printf_uint::uvalue#11 [phi:rom_verify::@19->printf_uint#4] -- register_copy jsr printf_uint // [1443] phi from rom_verify::@19 to rom_verify::@20 [phi:rom_verify::@19->rom_verify::@20] // rom_verify::@20 @@ -9917,9 +9595,8 @@ rom_verify: { // [1454] phi printf_ulong::format_min_length#10 = 5 [phi:rom_verify::@21->printf_ulong#1] -- vbuz1=vbuc1 lda #5 sta.z printf_ulong.format_min_length - // [1454] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:rom_verify::@21->printf_ulong#2] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_ulong.format_radix + // [1454] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:rom_verify::@21->printf_ulong#2] -- vbuxx=vbuc1 + ldx #HEXADECIMAL // [1454] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#3 [phi:rom_verify::@21->printf_ulong#3] -- register_copy jsr printf_ulong // rom_verify::@22 @@ -9969,21 +9646,17 @@ rom_verify: { s3: .text " <-> ROM:" .byte 0 .label rom_boundary = rom_flash.rom_flash__29 - .label y = main.check_status_cx16_rom3_check_status_rom1_main__0 - .label bram_bank = main.check_status_smc5_main__0 - .label rom_bank_start = main.check_status_rom1_main__0 .label file_size = rom_flash.rom_flash__29 - .label progress_row_current = fopen.pathtoken_1 } .segment Code // printf_ulong // Print an unsigned int using a specific format -// void printf_ulong(void (*putc)(char), __zp($31) unsigned long uvalue, __zp($36) char format_min_length, char format_justify_left, char format_sign_always, __zp($e2) char format_zero_padding, char format_upper_case, __zp($e1) char format_radix) +// void printf_ulong(void (*putc)(char), __zp($27) unsigned long uvalue, __zp($d0) char format_min_length, char format_justify_left, char format_sign_always, __zp($be) char format_zero_padding, char format_upper_case, __register(X) char format_radix) printf_ulong: { - .label uvalue = $31 - .label format_radix = $e1 - .label format_min_length = $36 - .label format_zero_padding = $e2 + .label uvalue = $27 + .label uvalue_1 = $e0 + .label format_min_length = $d0 + .label format_zero_padding = $be // printf_ulong::@1 // printf_buffer.sign = format.sign_always?'+':0 // [1455] *((char *)&printf_buffer) = 0 -- _deref_pbuc1=vbuc2 @@ -10001,7 +9674,8 @@ printf_ulong: { // [1459] printf_number_buffer::buffer_sign#0 = *((char *)&printf_buffer) -- vbuz1=_deref_pbuc1 lda printf_buffer sta.z printf_number_buffer.buffer_sign - // [1460] printf_number_buffer::format_min_length#0 = printf_ulong::format_min_length#10 + // [1460] printf_number_buffer::format_min_length#0 = printf_ulong::format_min_length#10 -- vbuxx=vbuz1 + ldx.z format_min_length // [1461] printf_number_buffer::format_zero_padding#0 = printf_ulong::format_zero_padding#10 // [1462] call printf_number_buffer // Print using format @@ -10019,20 +9693,24 @@ printf_ulong: { // } // [1463] return rts - .segment Data - uvalue_1: .dword 0 } -.segment Code // rom_flash -// __mem() unsigned long rom_flash(__mem() char rom_chip, __mem() char rom_bank_start, __mem() unsigned long file_size) +// __zp($ec) unsigned long rom_flash(__mem() char rom_chip, __mem() char rom_bank_start, __zp($34) unsigned long file_size) rom_flash: { - .label equal_bytes = $50 - .label ram_address_sector = $d2 - .label equal_bytes_1 = $ce - .label flash_errors_sector = $ee - .label ram_address = $d0 - .label rom_address = $f3 - .label x = $f0 + .label equal_bytes = $40 + .label ram_address_sector = $b5 + .label equal_bytes_1 = $b1 + .label retries = $f9 + .label flash_errors_sector = $c6 + .label ram_address = $b3 + .label rom_address = $d4 + .label x = $ce + .label flash_errors = $ec + .label bram_bank_sector = $dc + .label x_sector = $d3 + .label y_sector = $cf + .label file_size = $34 + .label return = $ec // display_action_progress("Flashing ... (-) equal, (+) flashed, (!) error.") // [1465] call display_action_progress // Now we compare the RAM with the actual ROM contents. @@ -10045,7 +9723,8 @@ rom_flash: { jsr display_action_progress // rom_flash::@19 // unsigned long rom_address_sector = rom_address_from_bank(rom_bank_start) - // [1466] rom_address_from_bank::rom_bank#2 = rom_flash::rom_bank_start#0 + // [1466] rom_address_from_bank::rom_bank#2 = rom_flash::rom_bank_start#0 -- vbuaa=vbum1 + lda rom_bank_start // [1467] call rom_address_from_bank // [2417] phi from rom_flash::@19 to rom_address_from_bank [phi:rom_flash::@19->rom_address_from_bank] // [2417] phi rom_address_from_bank::rom_bank#3 = rom_address_from_bank::rom_bank#2 [phi:rom_flash::@19->rom_address_from_bank#0] -- register_copy @@ -10063,19 +9742,19 @@ rom_flash: { // rom_flash::@20 // [1469] rom_flash::rom_address_sector#0 = rom_address_from_bank::return#4 // unsigned long rom_boundary = rom_address_sector + file_size - // [1470] rom_flash::rom_boundary#0 = rom_flash::rom_address_sector#0 + rom_flash::file_size#0 -- vdum1=vdum2_plus_vdum3 + // [1470] 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 ...") // [1471] display_info_rom::rom_chip#2 = rom_flash::rom_chip#0 -- vbuz1=vbum2 @@ -10089,33 +9768,33 @@ rom_flash: { lda #>info_text1 sta.z display_info_rom.info_text+1 // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#2 [phi:rom_flash::@20->display_info_rom#1] -- register_copy - // [1250] phi display_info_rom::info_status#16 = STATUS_FLASHING [phi:rom_flash::@20->display_info_rom#2] -- vbuz1=vbuc1 + // [1250] phi display_info_rom::info_status#16 = STATUS_FLASHING [phi:rom_flash::@20->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 // [1473] phi from rom_flash::@20 to rom_flash::@1 [phi:rom_flash::@20->rom_flash::@1] - // [1473] phi rom_flash::y_sector#13 = PROGRESS_Y [phi:rom_flash::@20->rom_flash::@1#0] -- vbum1=vbuc1 + // [1473] phi rom_flash::y_sector#13 = PROGRESS_Y [phi:rom_flash::@20->rom_flash::@1#0] -- vbuz1=vbuc1 lda #PROGRESS_Y - sta y_sector - // [1473] phi rom_flash::x_sector#10 = PROGRESS_X [phi:rom_flash::@20->rom_flash::@1#1] -- vbum1=vbuc1 + sta.z y_sector + // [1473] phi rom_flash::x_sector#10 = PROGRESS_X [phi:rom_flash::@20->rom_flash::@1#1] -- vbuz1=vbuc1 lda #PROGRESS_X - sta x_sector - // [1473] phi rom_flash::flash_errors#10 = 0 [phi:rom_flash::@20->rom_flash::@1#2] -- vdum1=vduc1 + sta.z x_sector + // [1473] phi rom_flash::flash_errors#10 = 0 [phi:rom_flash::@20->rom_flash::@1#2] -- vduz1=vduc1 lda #<0 - sta flash_errors - sta flash_errors+1 + sta.z flash_errors + sta.z flash_errors+1 lda #<0>>$10 - sta flash_errors+2 + sta.z flash_errors+2 lda #>0>>$10 - sta flash_errors+3 + sta.z flash_errors+3 // [1473] phi rom_flash::ram_address_sector#11 = (char *)$7800 [phi:rom_flash::@20->rom_flash::@1#3] -- pbuz1=pbuc1 lda #<$7800 sta.z ram_address_sector lda #>$7800 sta.z ram_address_sector+1 - // [1473] phi rom_flash::bram_bank_sector#14 = 0 [phi:rom_flash::@20->rom_flash::@1#4] -- vbum1=vbuc1 + // [1473] phi rom_flash::bram_bank_sector#14 = 0 [phi:rom_flash::@20->rom_flash::@1#4] -- vbuz1=vbuc1 lda #0 - sta bram_bank_sector + sta.z bram_bank_sector // [1473] phi rom_flash::rom_address_sector#12 = rom_flash::rom_address_sector#0 [phi:rom_flash::@20->rom_flash::@1#5] -- register_copy // rom_flash::@1 __b1: @@ -10155,9 +9834,8 @@ rom_flash: { // rom_flash::@2 __b2: // unsigned int equal_bytes = rom_compare(bram_bank_sector, (ram_ptr_t)ram_address_sector, rom_address_sector, ROM_SECTOR) - // [1478] rom_compare::bank_ram#1 = rom_flash::bram_bank_sector#14 -- vbuz1=vbum2 - lda bram_bank_sector - sta.z rom_compare.bank_ram + // [1478] rom_compare::bank_ram#1 = rom_flash::bram_bank_sector#14 -- vbuxx=vbuz1 + ldx.z bram_bank_sector // [1479] rom_compare::ptr_ram#2 = rom_flash::ram_address_sector#11 -- pbuz1=pbuz2 lda.z ram_address_sector sta.z rom_compare.ptr_ram @@ -10202,12 +9880,10 @@ rom_flash: { !__b3: // rom_flash::@16 // cputsxy(x_sector, y_sector, "--------") - // [1485] cputsxy::x#1 = rom_flash::x_sector#10 -- vbuz1=vbum2 - lda x_sector - sta.z cputsxy.x - // [1486] cputsxy::y#1 = rom_flash::y_sector#13 -- vbuz1=vbum2 - lda y_sector - sta.z cputsxy.y + // [1485] cputsxy::x#1 = rom_flash::x_sector#10 -- vbuxx=vbuz1 + ldx.z x_sector + // [1486] cputsxy::y#1 = rom_flash::y_sector#13 -- vbuyy=vbuz1 + ldy.z y_sector // [1487] call cputsxy // [838] phi from rom_flash::@16 to cputsxy [phi:rom_flash::@16->cputsxy] // [838] phi cputsxy::s#4 = rom_flash::s [phi:rom_flash::@16->cputsxy#0] -- pbuz1=pbuc1 @@ -10256,8 +9932,8 @@ rom_flash: { bne __b13 // rom_flash::@17 // bram_bank_sector++; - // [1492] rom_flash::bram_bank_sector#1 = ++ rom_flash::bram_bank_sector#14 -- vbum1=_inc_vbum1 - inc bram_bank_sector + // [1492] rom_flash::bram_bank_sector#1 = ++ rom_flash::bram_bank_sector#14 -- vbuz1=_inc_vbuz1 + inc.z bram_bank_sector // [1493] phi from rom_flash::@17 to rom_flash::@13 [phi:rom_flash::@17->rom_flash::@13] // [1493] phi rom_flash::bram_bank_sector#38 = rom_flash::bram_bank_sector#1 [phi:rom_flash::@17->rom_flash::@13#0] -- register_copy // [1493] phi rom_flash::ram_address_sector#8 = (char *)$a000 [phi:rom_flash::@17->rom_flash::@13#1] -- pbuz1=pbuc1 @@ -10284,9 +9960,9 @@ rom_flash: { sta.z ram_address_sector lda #>$a000 sta.z ram_address_sector+1 - // [1496] phi rom_flash::bram_bank_sector#12 = 1 [phi:rom_flash::@13->rom_flash::@14#1] -- vbum1=vbuc1 + // [1496] phi rom_flash::bram_bank_sector#12 = 1 [phi:rom_flash::@13->rom_flash::@14#1] -- vbuz1=vbuc1 lda #1 - sta bram_bank_sector + sta.z bram_bank_sector // [1495] phi from rom_flash::@13 to rom_flash::@44 [phi:rom_flash::@13->rom_flash::@44] // rom_flash::@44 // [1496] phi from rom_flash::@44 to rom_flash::@14 [phi:rom_flash::@44->rom_flash::@14] @@ -10295,11 +9971,11 @@ rom_flash: { // rom_flash::@14 __b14: // x_sector += 8 - // [1497] rom_flash::x_sector#1 = rom_flash::x_sector#10 + 8 -- vbum1=vbum1_plus_vbuc1 + // [1497] rom_flash::x_sector#1 = rom_flash::x_sector#10 + 8 -- vbuz1=vbuz1_plus_vbuc1 lda #8 clc - adc x_sector - sta x_sector + adc.z x_sector + sta.z x_sector // rom_address_sector % ROM_PROGRESS_ROW // [1498] rom_flash::$29 = rom_flash::rom_address_sector#1 & ROM_PROGRESS_ROW-1 -- vdum1=vdum2_band_vduc1 lda rom_address_sector @@ -10323,13 +9999,13 @@ rom_flash: { bne __b15 // rom_flash::@18 // y_sector++; - // [1500] rom_flash::y_sector#1 = ++ rom_flash::y_sector#13 -- vbum1=_inc_vbum1 - inc y_sector + // [1500] rom_flash::y_sector#1 = ++ rom_flash::y_sector#13 -- vbuz1=_inc_vbuz1 + inc.z y_sector // [1501] phi from rom_flash::@18 to rom_flash::@15 [phi:rom_flash::@18->rom_flash::@15] // [1501] phi rom_flash::y_sector#18 = rom_flash::y_sector#1 [phi:rom_flash::@18->rom_flash::@15#0] -- register_copy - // [1501] phi rom_flash::x_sector#20 = PROGRESS_X [phi:rom_flash::@18->rom_flash::@15#1] -- vbum1=vbuc1 + // [1501] phi rom_flash::x_sector#20 = PROGRESS_X [phi:rom_flash::@18->rom_flash::@15#1] -- vbuz1=vbuc1 lda #PROGRESS_X - sta x_sector + sta.z x_sector // [1501] phi from rom_flash::@14 to rom_flash::@15 [phi:rom_flash::@14->rom_flash::@15] // [1501] phi rom_flash::y_sector#18 = rom_flash::y_sector#13 [phi:rom_flash::@14->rom_flash::@15#0] -- register_copy // [1501] phi rom_flash::x_sector#20 = rom_flash::x_sector#1 [phi:rom_flash::@14->rom_flash::@15#1] -- register_copy @@ -10346,14 +10022,14 @@ rom_flash: { jsr snprintf_init // rom_flash::@40 // sprintf(info_text, "%u flash errors ...", flash_errors) - // [1503] printf_ulong::uvalue#6 = rom_flash::flash_errors#13 -- vduz1=vdum2 - lda flash_errors + // [1503] printf_ulong::uvalue#6 = rom_flash::flash_errors#13 -- vduz1=vduz2 + lda.z flash_errors sta.z printf_ulong.uvalue - lda flash_errors+1 + lda.z flash_errors+1 sta.z printf_ulong.uvalue+1 - lda flash_errors+2 + lda.z flash_errors+2 sta.z printf_ulong.uvalue+2 - lda flash_errors+3 + lda.z flash_errors+3 sta.z printf_ulong.uvalue+3 // [1504] call printf_ulong // [1454] phi from rom_flash::@40 to printf_ulong [phi:rom_flash::@40->printf_ulong] @@ -10362,9 +10038,8 @@ rom_flash: { sta.z printf_ulong.format_zero_padding // [1454] phi printf_ulong::format_min_length#10 = 0 [phi:rom_flash::@40->printf_ulong#1] -- vbuz1=vbuc1 sta.z printf_ulong.format_min_length - // [1454] phi printf_ulong::format_radix#10 = DECIMAL [phi:rom_flash::@40->printf_ulong#2] -- vbuz1=vbuc1 - lda #DECIMAL - sta.z printf_ulong.format_radix + // [1454] phi printf_ulong::format_radix#10 = DECIMAL [phi:rom_flash::@40->printf_ulong#2] -- vbuxx=vbuc1 + ldx #DECIMAL // [1454] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#6 [phi:rom_flash::@40->printf_ulong#3] -- register_copy jsr printf_ulong // [1505] phi from rom_flash::@40 to rom_flash::@41 [phi:rom_flash::@40->rom_flash::@41] @@ -10404,9 +10079,9 @@ rom_flash: { lda #>@info_text sta.z display_info_rom.info_text+1 // [1250] phi display_info_rom::rom_chip#16 = display_info_rom::rom_chip#3 [phi:rom_flash::@42->display_info_rom#1] -- register_copy - // [1250] phi display_info_rom::info_status#16 = STATUS_FLASHING [phi:rom_flash::@42->display_info_rom#2] -- vbuz1=vbuc1 + // [1250] phi display_info_rom::info_status#16 = STATUS_FLASHING [phi:rom_flash::@42->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 // [1473] phi from rom_flash::@42 to rom_flash::@1 [phi:rom_flash::@42->rom_flash::@1] // [1473] phi rom_flash::y_sector#13 = rom_flash::y_sector#18 [phi:rom_flash::@42->rom_flash::@1#0] -- register_copy @@ -10418,9 +10093,9 @@ rom_flash: { jmp __b1 // [1512] phi from rom_flash::@21 to rom_flash::@5 [phi:rom_flash::@21->rom_flash::@5] __b3: - // [1512] phi rom_flash::retries#12 = 0 [phi:rom_flash::@21->rom_flash::@5#0] -- vbum1=vbuc1 + // [1512] phi rom_flash::retries#12 = 0 [phi:rom_flash::@21->rom_flash::@5#0] -- vbuz1=vbuc1 lda #0 - sta retries + sta.z retries // [1512] phi rom_flash::flash_errors_sector#11 = 0 [phi:rom_flash::@21->rom_flash::@5#1] -- vwuz1=vwuc1 sta.z flash_errors_sector sta.z flash_errors_sector+1 @@ -10430,15 +10105,15 @@ rom_flash: { // rom_flash::@5 __b5: // rom_sector_erase(rom_address_sector) - // [1513] rom_sector_erase::address#0 = rom_flash::rom_address_sector#12 -- vdum1=vdum2 + // [1513] rom_sector_erase::address#0 = rom_flash::rom_address_sector#12 -- vduz1=vdum2 lda rom_address_sector - sta rom_sector_erase.address + sta.z rom_sector_erase.address lda rom_address_sector+1 - sta rom_sector_erase.address+1 + sta.z rom_sector_erase.address+1 lda rom_address_sector+2 - sta rom_sector_erase.address+2 + sta.z rom_sector_erase.address+2 lda rom_address_sector+3 - sta rom_sector_erase.address+3 + sta.z rom_sector_erase.address+3 // [1514] call rom_sector_erase // [2477] phi from rom_flash::@5 to rom_sector_erase [phi:rom_flash::@5->rom_sector_erase] jsr rom_sector_erase @@ -10459,12 +10134,10 @@ rom_flash: { adc #0 sta rom_sector_boundary+3 // gotoxy(x, y) - // [1516] gotoxy::x#28 = rom_flash::x_sector#10 -- vbuz1=vbum2 - lda x_sector - sta.z gotoxy.x - // [1517] gotoxy::y#28 = rom_flash::y_sector#13 -- vbuz1=vbum2 - lda y_sector - sta.z gotoxy.y + // [1516] gotoxy::x#28 = rom_flash::x_sector#10 -- vbuxx=vbuz1 + ldx.z x_sector + // [1517] gotoxy::y#28 = rom_flash::y_sector#13 -- vbuyy=vbuz1 + ldy.z y_sector // [1518] call gotoxy // [751] phi from rom_flash::@22 to gotoxy [phi:rom_flash::@22->gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#28 [phi:rom_flash::@22->gotoxy#0] -- register_copy @@ -10501,8 +10174,8 @@ rom_flash: { sta.z ram_address lda.z ram_address_sector+1 sta.z ram_address+1 - // [1523] rom_flash::x#26 = rom_flash::x_sector#10 -- vbuz1=vbum2 - lda x_sector + // [1523] rom_flash::x#26 = rom_flash::x_sector#10 -- vbuz1=vbuz2 + lda.z x_sector sta.z x // [1524] phi from rom_flash::@10 rom_flash::@24 to rom_flash::@6 [phi:rom_flash::@10/rom_flash::@24->rom_flash::@6] // [1524] phi rom_flash::x#10 = rom_flash::x#1 [phi:rom_flash::@10/rom_flash::@24->rom_flash::@6#0] -- register_copy @@ -10531,16 +10204,16 @@ rom_flash: { !: // rom_flash::@8 // retries++; - // [1526] rom_flash::retries#1 = ++ rom_flash::retries#12 -- vbum1=_inc_vbum1 - inc retries + // [1526] rom_flash::retries#1 = ++ rom_flash::retries#12 -- vbuz1=_inc_vbuz1 + inc.z retries // while (flash_errors_sector && retries <= 3) // [1527] if(0==rom_flash::flash_errors_sector#10) goto rom_flash::@12 -- 0_eq_vwuz1_then_la1 lda.z flash_errors_sector ora.z flash_errors_sector+1 beq __b12 // rom_flash::@43 - // [1528] if(rom_flash::retries#1<3+1) goto rom_flash::@5 -- vbum1_lt_vbuc1_then_la1 - lda retries + // [1528] if(rom_flash::retries#1<3+1) goto rom_flash::@5 -- vbuz1_lt_vbuc1_then_la1 + lda.z retries cmp #3+1 bcs !__b5+ jmp __b5 @@ -10548,38 +10221,38 @@ rom_flash: { // rom_flash::@12 __b12: // flash_errors += flash_errors_sector - // [1529] rom_flash::flash_errors#1 = rom_flash::flash_errors#10 + rom_flash::flash_errors_sector#10 -- vdum1=vdum1_plus_vwuz2 - lda flash_errors + // [1529] rom_flash::flash_errors#1 = rom_flash::flash_errors#10 + rom_flash::flash_errors_sector#10 -- vduz1=vduz1_plus_vwuz2 + lda.z flash_errors clc adc.z flash_errors_sector - sta flash_errors - lda flash_errors+1 + sta.z flash_errors + lda.z flash_errors+1 adc.z flash_errors_sector+1 - sta flash_errors+1 - lda flash_errors+2 + sta.z flash_errors+1 + lda.z flash_errors+2 adc #0 - sta flash_errors+2 - lda flash_errors+3 + sta.z flash_errors+2 + lda.z flash_errors+3 adc #0 - sta flash_errors+3 + sta.z flash_errors+3 jmp __b4 // rom_flash::@7 __b7: // sprintf(info_text, "Flashing ... RAM:%02x:%04p -> ROM:%05x ... %u flash errors ...", bram_bank_sector, ram_address_sector, rom_address_sector, flash_errors_sector + flash_errors) - // [1530] printf_ulong::uvalue#5 = rom_flash::flash_errors_sector#10 + rom_flash::flash_errors#10 -- vdum1=vwuz2_plus_vdum3 - lda flash_errors + // [1530] printf_ulong::uvalue#5 = rom_flash::flash_errors_sector#10 + rom_flash::flash_errors#10 -- vduz1=vwuz2_plus_vduz3 + lda.z flash_errors clc adc.z flash_errors_sector - sta printf_ulong.uvalue_1 - lda flash_errors+1 + sta.z printf_ulong.uvalue_1 + lda.z flash_errors+1 adc.z flash_errors_sector+1 - sta printf_ulong.uvalue_1+1 - lda flash_errors+2 + sta.z printf_ulong.uvalue_1+1 + lda.z flash_errors+2 adc #0 - sta printf_ulong.uvalue_1+2 - lda flash_errors+3 + sta.z printf_ulong.uvalue_1+2 + lda.z flash_errors+3 adc #0 - sta printf_ulong.uvalue_1+3 + sta.z printf_ulong.uvalue_1+3 // [1531] call snprintf_init // [1133] phi from rom_flash::@7 to snprintf_init [phi:rom_flash::@7->snprintf_init] // [1133] phi snprintf_init::s#26 = info_text [phi:rom_flash::@7->snprintf_init#0] -- pbuz1=pbuc1 @@ -10606,9 +10279,8 @@ rom_flash: { jsr printf_str // rom_flash::@26 // sprintf(info_text, "Flashing ... RAM:%02x:%04p -> ROM:%05x ... %u flash errors ...", bram_bank_sector, ram_address_sector, rom_address_sector, flash_errors_sector + flash_errors) - // [1534] printf_uchar::uvalue#11 = rom_flash::bram_bank_sector#14 -- vbuz1=vbum2 - lda bram_bank_sector - sta.z printf_uchar.uvalue + // [1534] printf_uchar::uvalue#11 = rom_flash::bram_bank_sector#14 -- vbuxx=vbuz1 + ldx.z bram_bank_sector // [1535] call printf_uchar // [1207] phi from rom_flash::@26 to printf_uchar [phi:rom_flash::@26->printf_uchar] // [1207] phi printf_uchar::format_zero_padding#14 = 1 [phi:rom_flash::@26->printf_uchar#0] -- vbuz1=vbuc1 @@ -10622,9 +10294,8 @@ rom_flash: { sta.z printf_uchar.putc lda #>snputc sta.z printf_uchar.putc+1 - // [1207] phi printf_uchar::format_radix#14 = HEXADECIMAL [phi:rom_flash::@26->printf_uchar#3] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_uchar.format_radix + // [1207] phi printf_uchar::format_radix#14 = HEXADECIMAL [phi:rom_flash::@26->printf_uchar#3] -- vbuyy=vbuc1 + ldy #HEXADECIMAL // [1207] phi printf_uchar::uvalue#14 = printf_uchar::uvalue#11 [phi:rom_flash::@26->printf_uchar#4] -- register_copy jsr printf_uchar // [1536] phi from rom_flash::@26 to rom_flash::@27 [phi:rom_flash::@26->rom_flash::@27] @@ -10651,22 +10322,21 @@ rom_flash: { lda.z ram_address_sector+1 sta.z printf_uint.uvalue+1 // [1539] call printf_uint - // [1839] phi from rom_flash::@28 to printf_uint [phi:rom_flash::@28->printf_uint] - // [1839] phi printf_uint::format_zero_padding#14 = 1 [phi:rom_flash::@28->printf_uint#0] -- vbuz1=vbuc1 + // [1828] phi from rom_flash::@28 to printf_uint [phi:rom_flash::@28->printf_uint] + // [1828] phi printf_uint::format_zero_padding#14 = 1 [phi:rom_flash::@28->printf_uint#0] -- vbuz1=vbuc1 lda #1 sta.z printf_uint.format_zero_padding - // [1839] phi printf_uint::format_min_length#14 = 4 [phi:rom_flash::@28->printf_uint#1] -- vbuz1=vbuc1 + // [1828] phi printf_uint::format_min_length#14 = 4 [phi:rom_flash::@28->printf_uint#1] -- vbuz1=vbuc1 lda #4 sta.z printf_uint.format_min_length - // [1839] phi printf_uint::putc#14 = &snputc [phi:rom_flash::@28->printf_uint#2] -- pprz1=pprc1 + // [1828] phi printf_uint::putc#14 = &snputc [phi:rom_flash::@28->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1839] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:rom_flash::@28->printf_uint#3] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_uint.format_radix - // [1839] phi printf_uint::uvalue#14 = printf_uint::uvalue#12 [phi:rom_flash::@28->printf_uint#4] -- register_copy + // [1828] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:rom_flash::@28->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1828] phi printf_uint::uvalue#14 = printf_uint::uvalue#12 [phi:rom_flash::@28->printf_uint#4] -- register_copy jsr printf_uint // [1540] phi from rom_flash::@28 to rom_flash::@29 [phi:rom_flash::@28->rom_flash::@29] // rom_flash::@29 @@ -10703,9 +10373,8 @@ rom_flash: { // [1454] phi printf_ulong::format_min_length#10 = 5 [phi:rom_flash::@30->printf_ulong#1] -- vbuz1=vbuc1 lda #5 sta.z printf_ulong.format_min_length - // [1454] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:rom_flash::@30->printf_ulong#2] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_ulong.format_radix + // [1454] phi printf_ulong::format_radix#10 = HEXADECIMAL [phi:rom_flash::@30->printf_ulong#2] -- vbuxx=vbuc1 + ldx #HEXADECIMAL // [1454] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#4 [phi:rom_flash::@30->printf_ulong#3] -- register_copy jsr printf_ulong // [1544] phi from rom_flash::@30 to rom_flash::@31 [phi:rom_flash::@30->rom_flash::@31] @@ -10725,14 +10394,14 @@ rom_flash: { sta.z printf_str.s+1 jsr printf_str // rom_flash::@32 - // [1546] printf_ulong::uvalue#16 = printf_ulong::uvalue#5 -- vduz1=vdum2 - lda printf_ulong.uvalue_1 + // [1546] printf_ulong::uvalue#16 = printf_ulong::uvalue#5 -- vduz1=vduz2 + lda.z printf_ulong.uvalue_1 sta.z printf_ulong.uvalue - lda printf_ulong.uvalue_1+1 + lda.z printf_ulong.uvalue_1+1 sta.z printf_ulong.uvalue+1 - lda printf_ulong.uvalue_1+2 + lda.z printf_ulong.uvalue_1+2 sta.z printf_ulong.uvalue+2 - lda printf_ulong.uvalue_1+3 + lda.z printf_ulong.uvalue_1+3 sta.z printf_ulong.uvalue+3 // sprintf(info_text, "Flashing ... RAM:%02x:%04p -> ROM:%05x ... %u flash errors ...", bram_bank_sector, ram_address_sector, rom_address_sector, flash_errors_sector + flash_errors) // [1547] call printf_ulong @@ -10742,9 +10411,8 @@ rom_flash: { sta.z printf_ulong.format_zero_padding // [1454] phi printf_ulong::format_min_length#10 = 0 [phi:rom_flash::@32->printf_ulong#1] -- vbuz1=vbuc1 sta.z printf_ulong.format_min_length - // [1454] phi printf_ulong::format_radix#10 = DECIMAL [phi:rom_flash::@32->printf_ulong#2] -- vbuz1=vbuc1 - lda #DECIMAL - sta.z printf_ulong.format_radix + // [1454] phi printf_ulong::format_radix#10 = DECIMAL [phi:rom_flash::@32->printf_ulong#2] -- vbuxx=vbuc1 + ldx #DECIMAL // [1454] phi printf_ulong::uvalue#10 = printf_ulong::uvalue#16 [phi:rom_flash::@32->printf_ulong#3] -- register_copy jsr printf_ulong // [1548] phi from rom_flash::@32 to rom_flash::@33 [phi:rom_flash::@32->rom_flash::@33] @@ -10783,9 +10451,8 @@ rom_flash: { jsr display_action_text // rom_flash::@35 // unsigned long written_bytes = rom_write(bram_bank, (ram_ptr_t)ram_address, rom_address, ROM_PROGRESS_CELL) - // [1554] rom_write::flash_ram_bank#0 = rom_flash::bram_bank_sector#14 -- vbuz1=vbum2 - lda bram_bank_sector - sta.z rom_write.flash_ram_bank + // [1554] rom_write::flash_ram_bank#0 = rom_flash::bram_bank_sector#14 -- vbuxx=vbuz1 + ldx.z bram_bank_sector // [1555] rom_write::flash_ram_address#1 = rom_flash::ram_address#10 -- pbuz1=pbuz2 lda.z ram_address sta.z rom_write.flash_ram_address @@ -10804,9 +10471,8 @@ rom_flash: { jsr rom_write // rom_flash::@36 // rom_compare(bram_bank, (ram_ptr_t)ram_address, rom_address, ROM_PROGRESS_CELL) - // [1558] rom_compare::bank_ram#2 = rom_flash::bram_bank_sector#14 -- vbuz1=vbum2 - lda bram_bank_sector - sta.z rom_compare.bank_ram + // [1558] rom_compare::bank_ram#2 = rom_flash::bram_bank_sector#14 -- vbuxx=vbuz1 + ldx.z bram_bank_sector // [1559] rom_compare::ptr_ram#3 = rom_flash::ram_address#10 -- pbuz1=pbuz2 lda.z ram_address sta.z rom_compare.ptr_ram @@ -10842,12 +10508,10 @@ rom_flash: { lda.z rom_compare.return+1 sta.z equal_bytes_1+1 // gotoxy(x, y) - // [1564] gotoxy::x#29 = rom_flash::x#10 -- vbuz1=vbuz2 - lda.z x - sta.z gotoxy.x - // [1565] gotoxy::y#29 = rom_flash::y_sector#13 -- vbuz1=vbum2 - lda y_sector - sta.z gotoxy.y + // [1564] gotoxy::x#29 = rom_flash::x#10 -- vbuxx=vbuz1 + ldx.z x + // [1565] gotoxy::y#29 = rom_flash::y_sector#13 -- vbuyy=vbuz1 + ldy.z y_sector // [1566] call gotoxy // [751] phi from rom_flash::@37 to gotoxy [phi:rom_flash::@37->gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#29 [phi:rom_flash::@37->gotoxy#0] -- register_copy @@ -10864,12 +10528,10 @@ rom_flash: { bne __b9 // rom_flash::@11 // cputcxy(x,y,'+') - // [1568] cputcxy::x#14 = rom_flash::x#10 -- vbuz1=vbuz2 - lda.z x - sta.z cputcxy.x - // [1569] cputcxy::y#14 = rom_flash::y_sector#13 -- vbuz1=vbum2 - lda y_sector - sta.z cputcxy.y + // [1568] cputcxy::x#14 = rom_flash::x#10 -- vbuxx=vbuz1 + ldx.z x + // [1569] cputcxy::y#14 = rom_flash::y_sector#13 -- vbuyy=vbuz1 + ldy.z y_sector // [1570] call cputcxy // [2068] phi from rom_flash::@11 to cputcxy [phi:rom_flash::@11->cputcxy] // [2068] phi cputcxy::c#15 = '+' [phi:rom_flash::@11->cputcxy#0] -- vbuz1=vbuc1 @@ -10913,12 +10575,10 @@ rom_flash: { // rom_flash::@9 __b9: // cputcxy(x,y,'!') - // [1575] cputcxy::x#13 = rom_flash::x#10 -- vbuz1=vbuz2 - lda.z x - sta.z cputcxy.x - // [1576] cputcxy::y#13 = rom_flash::y_sector#13 -- vbuz1=vbum2 - lda y_sector - sta.z cputcxy.y + // [1575] cputcxy::x#13 = rom_flash::x#10 -- vbuxx=vbuz1 + ldx.z x + // [1576] cputcxy::y#13 = rom_flash::y_sector#13 -- vbuyy=vbuz1 + ldy.z y_sector // [1577] call cputcxy // [2068] phi from rom_flash::@9 to cputcxy [phi:rom_flash::@9->cputcxy] // [2068] phi cputcxy::c#15 = '!' [phi:rom_flash::@9->cputcxy#0] -- vbuz1=vbuc1 @@ -10958,15 +10618,8 @@ rom_flash: { .label rom_address_sector = main.rom_file_modulo rom_boundary: .dword 0 rom_sector_boundary: .dword 0 - .label retries = main.check_status_smc9_main__0 - .label flash_errors = rom_read.rom_read__12 - .label bram_bank_sector = main.check_status_vera2_main__0 - .label x_sector = main.check_status_vera1_main__0 - .label y_sector = main.main__67 - .label rom_chip = util_wait_key.return - .label rom_bank_start = main.check_status_rom1_main__0 - .label file_size = main.rom_flash_errors - .label return = rom_read.rom_read__12 + .label rom_chip = util_wait_key.bram + .label rom_bank_start = util_wait_key.bank_get_brom1_return } .segment Code // smc_flash @@ -10978,24 +10631,19 @@ rom_flash: { * @param smc_bytes_total Total bytes to flash the SMC from RAM. * @return unsigned int Total bytes flashed, 0 if there is an error. */ -// __mem() unsigned int smc_flash(__zp($3d) unsigned int smc_bytes_total) +// __mem() unsigned int smc_flash(__zp($30) unsigned int smc_bytes_total) smc_flash: { - .label cx16_k_i2c_write_byte1_return = $fb - .label smc_bootloader_start = $fb - .label smc_bootloader_not_activated1 = $2e + .label smc_bootloader_not_activated1 = $25 // Waiting a bit to ensure the bootloader is activated. - .label smc_bootloader_activation_countdown = $e1 + .label smc_bootloader_activation_countdown = $76 // Waiting a bit to ensure the bootloader is activated. - .label smc_bootloader_activation_countdown_1 = $bc - .label smc_bootloader_not_activated = $2e - .label smc_byte_upload = $dd - .label smc_ram_ptr = $b8 - .label smc_commit_result = $2e - .label smc_attempts_flashed = $7d - .label smc_row_bytes = $73 - .label smc_attempts_total = $c4 - .label y = $c6 - .label smc_bytes_total = $3d + .label smc_bootloader_activation_countdown_1 = $50 + .label smc_bootloader_not_activated = $25 + .label smc_ram_ptr = $77 + .label smc_commit_result = $25 + .label smc_row_bytes = $5d + .label smc_attempts_total = $a9 + .label smc_bytes_total = $30 // display_action_progress("To start the SMC update, do the below action ...") // [1580] call display_action_progress // [845] phi from smc_flash to display_action_progress [phi:smc_flash->display_action_progress] @@ -11030,18 +10678,17 @@ smc_flash: { jsr CX16_I2C_WRITE_BYTE rol cx16_k_i2c_write_byte1_result // return result; - // [1586] smc_flash::cx16_k_i2c_write_byte1_return#0 = smc_flash::cx16_k_i2c_write_byte1_result -- vbuz1=vbum2 + // [1586] 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.z cx16_k_i2c_write_byte1_return // smc_flash::cx16_k_i2c_write_byte1_@return // } // [1587] smc_flash::cx16_k_i2c_write_byte1_return#1 = smc_flash::cx16_k_i2c_write_byte1_return#0 // smc_flash::@22 // unsigned char smc_bootloader_start = cx16_k_i2c_write_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_BOOTLOADER_RESET, 0x31) - // [1588] smc_flash::smc_bootloader_start#0 = smc_flash::cx16_k_i2c_write_byte1_return#1 + // [1588] smc_flash::smc_bootloader_start#0 = smc_flash::cx16_k_i2c_write_byte1_return#1 -- vbum1=vbuaa + sta smc_bootloader_start // if(smc_bootloader_start) - // [1589] if(0==smc_flash::smc_bootloader_start#0) goto smc_flash::@3 -- 0_eq_vbuz1_then_la1 - lda.z smc_bootloader_start + // [1589] if(0==smc_flash::smc_bootloader_start#0) goto smc_flash::@3 -- 0_eq_vbum1_then_la1 beq __b6 // [1590] phi from smc_flash::@22 to smc_flash::@2 [phi:smc_flash::@22->smc_flash::@2] // smc_flash::@2 @@ -11072,9 +10719,8 @@ smc_flash: { jsr printf_str // smc_flash::@27 // sprintf(info_text, "There was a problem starting the SMC bootloader: %x", smc_bootloader_start) - // [1594] printf_uchar::uvalue#4 = smc_flash::smc_bootloader_start#0 -- vbuz1=vbuz2 - lda.z smc_bootloader_start - sta.z printf_uchar.uvalue + // [1594] printf_uchar::uvalue#4 = smc_flash::smc_bootloader_start#0 -- vbuxx=vbum1 + ldx smc_bootloader_start // [1595] call printf_uchar // [1207] phi from smc_flash::@27 to printf_uchar [phi:smc_flash::@27->printf_uchar] // [1207] phi printf_uchar::format_zero_padding#14 = 0 [phi:smc_flash::@27->printf_uchar#0] -- vbuz1=vbuc1 @@ -11087,9 +10733,8 @@ smc_flash: { sta.z printf_uchar.putc lda #>snputc sta.z printf_uchar.putc+1 - // [1207] phi printf_uchar::format_radix#14 = HEXADECIMAL [phi:smc_flash::@27->printf_uchar#3] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_uchar.format_radix + // [1207] phi printf_uchar::format_radix#14 = HEXADECIMAL [phi:smc_flash::@27->printf_uchar#3] -- vbuyy=vbuc1 + ldy #HEXADECIMAL // [1207] phi printf_uchar::uvalue#14 = printf_uchar::uvalue#4 [phi:smc_flash::@27->printf_uchar#4] -- register_copy jsr printf_uchar // smc_flash::@28 @@ -11219,21 +10864,20 @@ smc_flash: { // sprintf(info_text, "There was a problem activating the SMC bootloader: %x", smc_bootloader_not_activated) // [1621] printf_uint::uvalue#5 = smc_flash::smc_bootloader_not_activated#1 // [1622] call printf_uint - // [1839] phi from smc_flash::@46 to printf_uint [phi:smc_flash::@46->printf_uint] - // [1839] phi printf_uint::format_zero_padding#14 = 0 [phi:smc_flash::@46->printf_uint#0] -- vbuz1=vbuc1 + // [1828] phi from smc_flash::@46 to printf_uint [phi:smc_flash::@46->printf_uint] + // [1828] phi printf_uint::format_zero_padding#14 = 0 [phi:smc_flash::@46->printf_uint#0] -- vbuz1=vbuc1 lda #0 sta.z printf_uint.format_zero_padding - // [1839] phi printf_uint::format_min_length#14 = 0 [phi:smc_flash::@46->printf_uint#1] -- vbuz1=vbuc1 + // [1828] phi printf_uint::format_min_length#14 = 0 [phi:smc_flash::@46->printf_uint#1] -- vbuz1=vbuc1 sta.z printf_uint.format_min_length - // [1839] phi printf_uint::putc#14 = &snputc [phi:smc_flash::@46->printf_uint#2] -- pprz1=pprc1 + // [1828] phi printf_uint::putc#14 = &snputc [phi:smc_flash::@46->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1839] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:smc_flash::@46->printf_uint#3] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_uint.format_radix - // [1839] phi printf_uint::uvalue#14 = printf_uint::uvalue#5 [phi:smc_flash::@46->printf_uint#4] -- register_copy + // [1828] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:smc_flash::@46->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1828] phi printf_uint::uvalue#14 = printf_uint::uvalue#5 [phi:smc_flash::@46->printf_uint#4] -- register_copy jsr printf_uint // smc_flash::@47 // sprintf(info_text, "There was a problem activating the SMC bootloader: %x", smc_bootloader_not_activated) @@ -11271,26 +10915,23 @@ smc_flash: { // textcolor(WHITE) // [1630] call textcolor // [733] phi from smc_flash::@43 to textcolor [phi:smc_flash::@43->textcolor] - // [733] phi textcolor::color#18 = WHITE [phi:smc_flash::@43->textcolor#0] -- vbuz1=vbuc1 - lda #WHITE - sta.z textcolor.color + // [733] phi textcolor::color#18 = WHITE [phi:smc_flash::@43->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor // [1631] phi from smc_flash::@43 to smc_flash::@44 [phi:smc_flash::@43->smc_flash::@44] // smc_flash::@44 // gotoxy(x, y) // [1632] call gotoxy // [751] phi from smc_flash::@44 to gotoxy [phi:smc_flash::@44->gotoxy] - // [751] phi gotoxy::y#30 = PROGRESS_Y [phi:smc_flash::@44->gotoxy#0] -- vbuz1=vbuc1 - lda #PROGRESS_Y - sta.z gotoxy.y - // [751] phi gotoxy::x#30 = PROGRESS_X [phi:smc_flash::@44->gotoxy#1] -- vbuz1=vbuc1 - lda #PROGRESS_X - sta.z gotoxy.x + // [751] phi gotoxy::y#30 = PROGRESS_Y [phi:smc_flash::@44->gotoxy#0] -- vbuyy=vbuc1 + ldy #PROGRESS_Y + // [751] phi gotoxy::x#30 = PROGRESS_X [phi:smc_flash::@44->gotoxy#1] -- vbuxx=vbuc1 + ldx #PROGRESS_X jsr gotoxy // [1633] phi from smc_flash::@44 to smc_flash::@11 [phi:smc_flash::@44->smc_flash::@11] - // [1633] phi smc_flash::y#31 = PROGRESS_Y [phi:smc_flash::@44->smc_flash::@11#0] -- vbuz1=vbuc1 + // [1633] phi smc_flash::y#31 = PROGRESS_Y [phi:smc_flash::@44->smc_flash::@11#0] -- vbum1=vbuc1 lda #PROGRESS_Y - sta.z y + sta y // [1633] phi smc_flash::smc_attempts_total#21 = 0 [phi:smc_flash::@44->smc_flash::@11#1] -- vwuz1=vwuc1 lda #<0 sta.z smc_attempts_total @@ -11335,9 +10976,9 @@ smc_flash: { // [1635] phi smc_flash::smc_row_bytes#10 = smc_flash::smc_row_bytes#14 [phi:smc_flash::@11->smc_flash::@12#2] -- register_copy // [1635] phi smc_flash::smc_ram_ptr#10 = smc_flash::smc_ram_ptr#13 [phi:smc_flash::@11->smc_flash::@12#3] -- register_copy // [1635] phi smc_flash::smc_bytes_flashed#11 = smc_flash::smc_bytes_flashed#16 [phi:smc_flash::@11->smc_flash::@12#4] -- register_copy - // [1635] phi smc_flash::smc_attempts_flashed#19 = 0 [phi:smc_flash::@11->smc_flash::@12#5] -- vbuz1=vbuc1 + // [1635] phi smc_flash::smc_attempts_flashed#19 = 0 [phi:smc_flash::@11->smc_flash::@12#5] -- vbum1=vbuc1 lda #0 - sta.z smc_attempts_flashed + sta smc_attempts_flashed // [1635] phi smc_flash::smc_package_committed#2 = 0 [phi:smc_flash::@11->smc_flash::@12#6] -- vbum1=vbuc1 sta smc_package_committed // smc_flash::@12 @@ -11347,15 +10988,15 @@ smc_flash: { lda smc_package_committed bne __b13 // smc_flash::@60 - // [1637] if(smc_flash::smc_attempts_flashed#19<$a) goto smc_flash::@14 -- vbuz1_lt_vbuc1_then_la1 - lda.z smc_attempts_flashed + // [1637] if(smc_flash::smc_attempts_flashed#19<$a) goto smc_flash::@14 -- vbum1_lt_vbuc1_then_la1 + lda smc_attempts_flashed cmp #$a bcc __b16 // smc_flash::@13 __b13: // if(smc_attempts_flashed >= 10) - // [1638] if(smc_flash::smc_attempts_flashed#19<$a) goto smc_flash::@11 -- vbuz1_lt_vbuc1_then_la1 - lda.z smc_attempts_flashed + // [1638] if(smc_flash::smc_attempts_flashed#19<$a) goto smc_flash::@11 -- vbum1_lt_vbuc1_then_la1 + lda smc_attempts_flashed cmp #$a bcc __b11 // [1639] phi from smc_flash::@13 to smc_flash::@21 [phi:smc_flash::@13->smc_flash::@21] @@ -11393,22 +11034,21 @@ smc_flash: { lda smc_bytes_flashed+1 sta.z printf_uint.uvalue+1 // [1644] call printf_uint - // [1839] phi from smc_flash::@58 to printf_uint [phi:smc_flash::@58->printf_uint] - // [1839] phi printf_uint::format_zero_padding#14 = 1 [phi:smc_flash::@58->printf_uint#0] -- vbuz1=vbuc1 + // [1828] phi from smc_flash::@58 to printf_uint [phi:smc_flash::@58->printf_uint] + // [1828] phi printf_uint::format_zero_padding#14 = 1 [phi:smc_flash::@58->printf_uint#0] -- vbuz1=vbuc1 lda #1 sta.z printf_uint.format_zero_padding - // [1839] phi printf_uint::format_min_length#14 = 4 [phi:smc_flash::@58->printf_uint#1] -- vbuz1=vbuc1 + // [1828] phi printf_uint::format_min_length#14 = 4 [phi:smc_flash::@58->printf_uint#1] -- vbuz1=vbuc1 lda #4 sta.z printf_uint.format_min_length - // [1839] phi printf_uint::putc#14 = &snputc [phi:smc_flash::@58->printf_uint#2] -- pprz1=pprc1 + // [1828] phi printf_uint::putc#14 = &snputc [phi:smc_flash::@58->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1839] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:smc_flash::@58->printf_uint#3] -- vbuz1=vbuc1 - lda #HEXADECIMAL - sta.z printf_uint.format_radix - // [1839] phi printf_uint::uvalue#14 = printf_uint::uvalue#9 [phi:smc_flash::@58->printf_uint#4] -- register_copy + // [1828] phi printf_uint::format_radix#14 = HEXADECIMAL [phi:smc_flash::@58->printf_uint#3] -- vbuxx=vbuc1 + ldx #HEXADECIMAL + // [1828] phi printf_uint::uvalue#14 = printf_uint::uvalue#9 [phi:smc_flash::@58->printf_uint#4] -- register_copy jsr printf_uint // smc_flash::@59 // sprintf(info_text, "There were too many attempts trying to flash the SMC at location %04x", smc_bytes_flashed) @@ -11458,13 +11098,13 @@ smc_flash: { !: // smc_flash::@16 // smc_bytes_checksum ^ 0xFF - // [1651] smc_flash::$26 = smc_flash::smc_bytes_checksum#2 ^ $ff -- vbum1=vbum1_bxor_vbuc1 + // [1651] smc_flash::$26 = smc_flash::smc_bytes_checksum#2 ^ $ff -- vbuaa=vbum1_bxor_vbuc1 lda #$ff - eor smc_flash__26 - sta smc_flash__26 + eor smc_bytes_checksum // (smc_bytes_checksum ^ 0xFF)+1 - // [1652] smc_flash::$27 = smc_flash::$26 + 1 -- vbum1=vbum1_plus_1 - inc smc_flash__27 + // [1652] smc_flash::$27 = smc_flash::$26 + 1 -- vbuxx=vbuaa_plus_1 + tax + inx // unsigned char smc_checksum_result = cx16_k_i2c_write_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_UPLOAD, (smc_bytes_checksum ^ 0xFF)+1) // [1653] smc_flash::cx16_k_i2c_write_byte4_device = $42 -- vbum1=vbuc1 lda #$42 @@ -11472,9 +11112,8 @@ smc_flash: { // [1654] smc_flash::cx16_k_i2c_write_byte4_offset = $80 -- vbum1=vbuc1 lda #$80 sta cx16_k_i2c_write_byte4_offset - // [1655] smc_flash::cx16_k_i2c_write_byte4_value = smc_flash::$27 -- vbum1=vbum2 - lda smc_flash__27 - sta cx16_k_i2c_write_byte4_value + // [1655] smc_flash::cx16_k_i2c_write_byte4_value = smc_flash::$27 -- vbum1=vbuxx + stx cx16_k_i2c_write_byte4_value // smc_flash::cx16_k_i2c_write_byte4 // unsigned char result // [1656] smc_flash::cx16_k_i2c_write_byte4_result = 0 -- vbum1=vbuc1 @@ -11521,8 +11160,8 @@ smc_flash: { sbc #0 sta.z smc_ram_ptr+1 // smc_attempts_flashed++; - // [1665] smc_flash::smc_attempts_flashed#1 = ++ smc_flash::smc_attempts_flashed#19 -- vbuz1=_inc_vbuz1 - inc.z smc_attempts_flashed + // [1665] smc_flash::smc_attempts_flashed#1 = ++ smc_flash::smc_attempts_flashed#19 -- vbum1=_inc_vbum1 + inc smc_attempts_flashed // [1635] phi from smc_flash::@17 to smc_flash::@12 [phi:smc_flash::@17->smc_flash::@12] // [1635] phi smc_flash::y#20 = smc_flash::y#20 [phi:smc_flash::@17->smc_flash::@12#0] -- register_copy // [1635] phi smc_flash::smc_attempts_total#17 = smc_flash::smc_attempts_total#17 [phi:smc_flash::@17->smc_flash::@12#1] -- register_copy @@ -11544,18 +11183,16 @@ smc_flash: { bne __b19 // smc_flash::@20 // gotoxy(x, ++y); - // [1667] smc_flash::y#1 = ++ smc_flash::y#20 -- vbuz1=_inc_vbuz1 - inc.z y + // [1667] smc_flash::y#1 = ++ smc_flash::y#20 -- vbum1=_inc_vbum1 + inc y // gotoxy(x, ++y) - // [1668] gotoxy::y#22 = smc_flash::y#1 -- vbuz1=vbuz2 - lda.z y - sta.z gotoxy.y + // [1668] gotoxy::y#22 = smc_flash::y#1 -- vbuyy=vbum1 + ldy y // [1669] call gotoxy // [751] phi from smc_flash::@20 to gotoxy [phi:smc_flash::@20->gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#22 [phi:smc_flash::@20->gotoxy#0] -- register_copy - // [751] phi gotoxy::x#30 = PROGRESS_X [phi:smc_flash::@20->gotoxy#1] -- vbuz1=vbuc1 - lda #PROGRESS_X - sta.z gotoxy.x + // [751] phi gotoxy::x#30 = PROGRESS_X [phi:smc_flash::@20->gotoxy#1] -- vbuxx=vbuc1 + ldx #PROGRESS_X jsr gotoxy // [1670] phi from smc_flash::@20 to smc_flash::@19 [phi:smc_flash::@20->smc_flash::@19] // [1670] phi smc_flash::y#33 = smc_flash::y#1 [phi:smc_flash::@20->smc_flash::@19#0] -- register_copy @@ -11595,8 +11232,8 @@ smc_flash: { inc.z smc_row_bytes+1 !: // smc_attempts_total += smc_attempts_flashed - // [1676] smc_flash::smc_attempts_total#1 = smc_flash::smc_attempts_total#17 + smc_flash::smc_attempts_flashed#19 -- vwuz1=vwuz1_plus_vbuz2 - lda.z smc_attempts_flashed + // [1676] smc_flash::smc_attempts_total#1 = smc_flash::smc_attempts_total#17 + smc_flash::smc_attempts_flashed#19 -- vwuz1=vwuz1_plus_vbum2 + lda smc_attempts_flashed clc adc.z smc_attempts_total sta.z smc_attempts_total @@ -11636,22 +11273,21 @@ smc_flash: { lda smc_bytes_flashed+1 sta.z printf_uint.uvalue+1 // [1681] call printf_uint - // [1839] phi from smc_flash::@50 to printf_uint [phi:smc_flash::@50->printf_uint] - // [1839] phi printf_uint::format_zero_padding#14 = 1 [phi:smc_flash::@50->printf_uint#0] -- vbuz1=vbuc1 + // [1828] phi from smc_flash::@50 to printf_uint [phi:smc_flash::@50->printf_uint] + // [1828] phi printf_uint::format_zero_padding#14 = 1 [phi:smc_flash::@50->printf_uint#0] -- vbuz1=vbuc1 lda #1 sta.z printf_uint.format_zero_padding - // [1839] phi printf_uint::format_min_length#14 = 5 [phi:smc_flash::@50->printf_uint#1] -- vbuz1=vbuc1 + // [1828] phi printf_uint::format_min_length#14 = 5 [phi:smc_flash::@50->printf_uint#1] -- vbuz1=vbuc1 lda #5 sta.z printf_uint.format_min_length - // [1839] phi printf_uint::putc#14 = &snputc [phi:smc_flash::@50->printf_uint#2] -- pprz1=pprc1 + // [1828] phi printf_uint::putc#14 = &snputc [phi:smc_flash::@50->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1839] phi printf_uint::format_radix#14 = DECIMAL [phi:smc_flash::@50->printf_uint#3] -- vbuz1=vbuc1 - lda #DECIMAL - sta.z printf_uint.format_radix - // [1839] phi printf_uint::uvalue#14 = printf_uint::uvalue#6 [phi:smc_flash::@50->printf_uint#4] -- register_copy + // [1828] phi printf_uint::format_radix#14 = DECIMAL [phi:smc_flash::@50->printf_uint#3] -- vbuxx=vbuc1 + ldx #DECIMAL + // [1828] phi printf_uint::uvalue#14 = printf_uint::uvalue#6 [phi:smc_flash::@50->printf_uint#4] -- register_copy jsr printf_uint // [1682] phi from smc_flash::@50 to smc_flash::@51 [phi:smc_flash::@50->smc_flash::@51] // smc_flash::@51 @@ -11677,22 +11313,21 @@ smc_flash: { lda.z smc_bytes_total+1 sta.z printf_uint.uvalue+1 // [1685] call printf_uint - // [1839] phi from smc_flash::@52 to printf_uint [phi:smc_flash::@52->printf_uint] - // [1839] phi printf_uint::format_zero_padding#14 = 1 [phi:smc_flash::@52->printf_uint#0] -- vbuz1=vbuc1 + // [1828] phi from smc_flash::@52 to printf_uint [phi:smc_flash::@52->printf_uint] + // [1828] phi printf_uint::format_zero_padding#14 = 1 [phi:smc_flash::@52->printf_uint#0] -- vbuz1=vbuc1 lda #1 sta.z printf_uint.format_zero_padding - // [1839] phi printf_uint::format_min_length#14 = 5 [phi:smc_flash::@52->printf_uint#1] -- vbuz1=vbuc1 + // [1828] phi printf_uint::format_min_length#14 = 5 [phi:smc_flash::@52->printf_uint#1] -- vbuz1=vbuc1 lda #5 sta.z printf_uint.format_min_length - // [1839] phi printf_uint::putc#14 = &snputc [phi:smc_flash::@52->printf_uint#2] -- pprz1=pprc1 + // [1828] phi printf_uint::putc#14 = &snputc [phi:smc_flash::@52->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1839] phi printf_uint::format_radix#14 = DECIMAL [phi:smc_flash::@52->printf_uint#3] -- vbuz1=vbuc1 - lda #DECIMAL - sta.z printf_uint.format_radix - // [1839] phi printf_uint::uvalue#14 = printf_uint::uvalue#7 [phi:smc_flash::@52->printf_uint#4] -- register_copy + // [1828] phi printf_uint::format_radix#14 = DECIMAL [phi:smc_flash::@52->printf_uint#3] -- vbuxx=vbuc1 + ldx #DECIMAL + // [1828] phi printf_uint::uvalue#14 = printf_uint::uvalue#7 [phi:smc_flash::@52->printf_uint#4] -- register_copy jsr printf_uint // [1686] phi from smc_flash::@52 to smc_flash::@53 [phi:smc_flash::@52->smc_flash::@53] // smc_flash::@53 @@ -11718,22 +11353,21 @@ smc_flash: { lda.z smc_attempts_total+1 sta.z printf_uint.uvalue+1 // [1689] call printf_uint - // [1839] phi from smc_flash::@54 to printf_uint [phi:smc_flash::@54->printf_uint] - // [1839] phi printf_uint::format_zero_padding#14 = 1 [phi:smc_flash::@54->printf_uint#0] -- vbuz1=vbuc1 + // [1828] phi from smc_flash::@54 to printf_uint [phi:smc_flash::@54->printf_uint] + // [1828] phi printf_uint::format_zero_padding#14 = 1 [phi:smc_flash::@54->printf_uint#0] -- vbuz1=vbuc1 lda #1 sta.z printf_uint.format_zero_padding - // [1839] phi printf_uint::format_min_length#14 = 2 [phi:smc_flash::@54->printf_uint#1] -- vbuz1=vbuc1 + // [1828] phi printf_uint::format_min_length#14 = 2 [phi:smc_flash::@54->printf_uint#1] -- vbuz1=vbuc1 lda #2 sta.z printf_uint.format_min_length - // [1839] phi printf_uint::putc#14 = &snputc [phi:smc_flash::@54->printf_uint#2] -- pprz1=pprc1 + // [1828] phi printf_uint::putc#14 = &snputc [phi:smc_flash::@54->printf_uint#2] -- pprz1=pprc1 lda #snputc sta.z printf_uint.putc+1 - // [1839] phi printf_uint::format_radix#14 = DECIMAL [phi:smc_flash::@54->printf_uint#3] -- vbuz1=vbuc1 - lda #DECIMAL - sta.z printf_uint.format_radix - // [1839] phi printf_uint::uvalue#14 = printf_uint::uvalue#8 [phi:smc_flash::@54->printf_uint#4] -- register_copy + // [1828] phi printf_uint::format_radix#14 = DECIMAL [phi:smc_flash::@54->printf_uint#3] -- vbuxx=vbuc1 + ldx #DECIMAL + // [1828] phi printf_uint::uvalue#14 = printf_uint::uvalue#8 [phi:smc_flash::@54->printf_uint#4] -- register_copy jsr printf_uint // [1690] phi from smc_flash::@54 to smc_flash::@55 [phi:smc_flash::@54->smc_flash::@55] // smc_flash::@55 @@ -11783,10 +11417,10 @@ smc_flash: { // smc_flash::@15 __b15: // unsigned char smc_byte_upload = *smc_ram_ptr - // [1696] smc_flash::smc_byte_upload#0 = *smc_flash::smc_ram_ptr#12 -- vbuz1=_deref_pbuz2 + // [1696] smc_flash::smc_byte_upload#0 = *smc_flash::smc_ram_ptr#12 -- vbuxx=_deref_pbuz1 ldy #0 lda (smc_ram_ptr),y - sta.z smc_byte_upload + tax // smc_ram_ptr++; // [1697] smc_flash::smc_ram_ptr#1 = ++ smc_flash::smc_ram_ptr#12 -- pbuz1=_inc_pbuz1 inc.z smc_ram_ptr @@ -11794,10 +11428,10 @@ smc_flash: { inc.z smc_ram_ptr+1 !: // smc_bytes_checksum += smc_byte_upload - // [1698] smc_flash::smc_bytes_checksum#1 = smc_flash::smc_bytes_checksum#2 + smc_flash::smc_byte_upload#0 -- vbum1=vbum1_plus_vbuz2 - lda smc_bytes_checksum + // [1698] smc_flash::smc_bytes_checksum#1 = smc_flash::smc_bytes_checksum#2 + smc_flash::smc_byte_upload#0 -- vbum1=vbum1_plus_vbuxx + txa clc - adc.z smc_byte_upload + adc smc_bytes_checksum sta smc_bytes_checksum // unsigned char smc_upload_result = cx16_k_i2c_write_byte(FLASH_I2C_SMC_DEVICE, FLASH_I2C_SMC_UPLOAD, smc_byte_upload) // [1699] smc_flash::cx16_k_i2c_write_byte3_device = $42 -- vbum1=vbuc1 @@ -11806,9 +11440,8 @@ smc_flash: { // [1700] smc_flash::cx16_k_i2c_write_byte3_offset = $80 -- vbum1=vbuc1 lda #$80 sta cx16_k_i2c_write_byte3_offset - // [1701] 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 + // [1701] 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 // [1702] smc_flash::cx16_k_i2c_write_byte3_result = 0 -- vbum1=vbuc1 @@ -11870,9 +11503,8 @@ smc_flash: { jsr printf_str // smc_flash::@38 // sprintf(info_text, "Updating SMC in %u ...", smc_bootloader_activation_countdown) - // [1711] printf_uchar::uvalue#6 = smc_flash::smc_bootloader_activation_countdown#12 -- vbuz1=vbuz2 - lda.z smc_bootloader_activation_countdown_1 - sta.z printf_uchar.uvalue + // [1711] printf_uchar::uvalue#6 = smc_flash::smc_bootloader_activation_countdown#12 -- vbuxx=vbuz1 + ldx.z smc_bootloader_activation_countdown_1 // [1712] call printf_uchar // [1207] phi from smc_flash::@38 to printf_uchar [phi:smc_flash::@38->printf_uchar] // [1207] phi printf_uchar::format_zero_padding#14 = 0 [phi:smc_flash::@38->printf_uchar#0] -- vbuz1=vbuc1 @@ -11885,9 +11517,8 @@ smc_flash: { sta.z printf_uchar.putc lda #>snputc sta.z printf_uchar.putc+1 - // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:smc_flash::@38->printf_uchar#3] -- vbuz1=vbuc1 - lda #DECIMAL - sta.z printf_uchar.format_radix + // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:smc_flash::@38->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL // [1207] phi printf_uchar::uvalue#14 = printf_uchar::uvalue#6 [phi:smc_flash::@38->printf_uchar#4] -- register_copy jsr printf_uchar // [1713] phi from smc_flash::@38 to smc_flash::@39 [phi:smc_flash::@38->smc_flash::@39] @@ -11987,9 +11618,8 @@ smc_flash: { jsr printf_str // smc_flash::@33 // sprintf(info_text, "[%03u] Press POWER and RESET on the CX16 to start the SMC update!", smc_bootloader_activation_countdown) - // [1732] printf_uchar::uvalue#5 = smc_flash::smc_bootloader_activation_countdown#10 -- vbuz1=vbuz2 - lda.z smc_bootloader_activation_countdown - sta.z printf_uchar.uvalue + // [1732] printf_uchar::uvalue#5 = smc_flash::smc_bootloader_activation_countdown#10 -- vbuxx=vbuz1 + ldx.z smc_bootloader_activation_countdown // [1733] call printf_uchar // [1207] phi from smc_flash::@33 to printf_uchar [phi:smc_flash::@33->printf_uchar] // [1207] phi printf_uchar::format_zero_padding#14 = 1 [phi:smc_flash::@33->printf_uchar#0] -- vbuz1=vbuc1 @@ -12003,9 +11633,8 @@ smc_flash: { sta.z printf_uchar.putc lda #>snputc sta.z printf_uchar.putc+1 - // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:smc_flash::@33->printf_uchar#3] -- vbuz1=vbuc1 - lda #DECIMAL - sta.z printf_uchar.format_radix + // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:smc_flash::@33->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL // [1207] phi printf_uchar::uvalue#14 = printf_uchar::uvalue#5 [phi:smc_flash::@33->printf_uchar#4] -- register_copy jsr printf_uchar // [1734] phi from smc_flash::@33 to smc_flash::@34 [phi:smc_flash::@33->smc_flash::@34] @@ -12074,8 +11703,6 @@ smc_flash: { .byte 0 s10: .text "There were too many attempts trying to flash the SMC at location " .byte 0 - .label smc_flash__26 = main.check_status_cx16_rom2_check_status_rom1_main__0 - .label smc_flash__27 = main.check_status_cx16_rom2_check_status_rom1_main__0 cx16_k_i2c_write_byte1_device: .byte 0 cx16_k_i2c_write_byte1_offset: .byte 0 cx16_k_i2c_write_byte1_value: .byte 0 @@ -12092,11 +11719,14 @@ 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 + smc_bootloader_start: .byte 0 return: .word 0 - .label smc_bytes_checksum = main.check_status_cx16_rom2_check_status_rom1_main__0 + smc_bytes_checksum: .byte 0 smc_package_flashed: .word 0 + .label smc_attempts_flashed = main.check_status_smc9_return .label smc_bytes_flashed = return - .label smc_package_committed = main.check_status_smc3_main__0 + .label y = main.check_status_vera2_return + smc_package_committed: .byte 0 } .segment Code // util_wait_key @@ -12107,14 +11737,13 @@ smc_flash: { * @param filter * @return unsigned char */ -// __mem() char util_wait_key(__zp($3f) char *info_text, __zp($b4) char *filter) +// __register(A) char util_wait_key(__zp($32) char *info_text, __zp($73) char *filter) util_wait_key: { .const bank_set_bram1_bank = 0 .const bank_set_brom1_bank = 4 - .label util_wait_key__9 = $ec - .label bank_get_brom1_return = $e8 - .label info_text = $3f - .label filter = $b4 + .label util_wait_key__9 = $c4 + .label info_text = $32 + .label filter = $73 // display_action_text(info_text) // [1742] display_action_text::info_text#0 = util_wait_key::info_text#3 // [1743] call display_action_text @@ -12128,9 +11757,9 @@ util_wait_key: { sta bram // util_wait_key::bank_get_brom1 // return BROM; - // [1745] util_wait_key::bank_get_brom1_return#0 = BROM -- vbuz1=vbuz2 + // [1745] util_wait_key::bank_get_brom1_return#0 = BROM -- vbum1=vbuz2 lda.z BROM - sta.z bank_get_brom1_return + sta bank_get_brom1_return // util_wait_key::bank_set_bram1 // BRAM = bank // [1746] BRAM = util_wait_key::bank_set_bram1_bank#0 -- vbuz1=vbuc1 @@ -12155,8 +11784,7 @@ util_wait_key: { jsr cbm_k_getin // [1752] cbm_k_getin::return#2 = cbm_k_getin::return#1 // util_wait_key::@4 - // [1753] util_wait_key::ch#4 = cbm_k_getin::return#2 -- vwum1=vbuz2 - lda.z cbm_k_getin.return + // [1753] util_wait_key::ch#4 = cbm_k_getin::return#2 -- vwum1=vbuaa sta ch lda #0 sta ch+1 @@ -12185,8 +11813,8 @@ util_wait_key: { sta.z BRAM // util_wait_key::bank_set_brom2 // BROM = bank - // [1757] BROM = util_wait_key::bank_get_brom1_return#0 -- vbuz1=vbuz2 - lda.z bank_get_brom1_return + // [1757] BROM = util_wait_key::bank_get_brom1_return#0 -- vbuz1=vbum2 + lda bank_get_brom1_return sta.z BROM // util_wait_key::@return // } @@ -12200,9 +11828,9 @@ util_wait_key: { sta.z strchr.str lda.z filter+1 sta.z strchr.str+1 - // [1760] strchr::c#0 = util_wait_key::ch#4 -- vbum1=vwum2 + // [1760] strchr::c#0 = util_wait_key::ch#4 -- vbuz1=vwum2 lda ch - sta strchr.c + sta.z strchr.c // [1761] call strchr // [1765] phi from util_wait_key::@1 to strchr [phi:util_wait_key::@1->strchr] // [1765] phi strchr::c#4 = strchr::c#0 [phi:util_wait_key::@1->strchr#0] -- register_copy @@ -12219,9 +11847,8 @@ util_wait_key: { bne bank_set_bram2 jmp kbhit1 .segment Data - .label bram = display_frame.w - return: .byte 0 - .label return_1 = strchr.c + bram: .byte 0 + bank_get_brom1_return: .byte 0 ch: .word 0 } .segment Code @@ -12230,11 +11857,12 @@ 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($ec) void * strchr(__zp($ec) const void *str, __mem() char c) +// __zp($c4) void * strchr(__zp($c4) const void *str, __zp($f3) char c) strchr: { - .label ptr = $ec - .label return = $ec - .label str = $ec + .label ptr = $c4 + .label return = $c4 + .label str = $c4 + .label c = $f3 // [1766] strchr::ptr#6 = (char *)strchr::str#2 // [1767] phi from strchr strchr::@3 to strchr::@1 [phi:strchr/strchr::@3->strchr::@1] // [1767] phi strchr::ptr#2 = strchr::ptr#6 [phi:strchr/strchr::@3->strchr::@1#0] -- register_copy @@ -12258,10 +11886,10 @@ strchr: { // strchr::@2 __b2: // if(*ptr==c) - // [1771] if(*strchr::ptr#2!=strchr::c#4) goto strchr::@3 -- _deref_pbuz1_neq_vbum2_then_la1 + // [1771] if(*strchr::ptr#2!=strchr::c#4) goto strchr::@3 -- _deref_pbuz1_neq_vbuz2_then_la1 ldy #0 lda (ptr),y - cmp c + cmp.z c bne __b3 // strchr::@4 // [1772] strchr::return#8 = (void *)strchr::ptr#2 @@ -12277,10 +11905,7 @@ strchr: { inc.z ptr+1 !: jmp __b1 - .segment Data - c: .byte 0 } -.segment Code // display_info_cx16_rom /** * @brief Display the ROM status of the main CX16 ROM chip. @@ -12288,12 +11913,12 @@ strchr: { * @param info_status The status. * @param info_text The status text. */ -// void display_info_cx16_rom(__zp($2c) char info_status, __zp($4e) char *info_text) +// void display_info_cx16_rom(__register(X) char info_status, __zp($3e) char *info_text) display_info_cx16_rom: { - .label info_status = $2c - .label info_text = $4e + .label info_text = $3e // display_info_rom(0, info_status, info_text) - // [1775] display_info_rom::info_status#0 = display_info_cx16_rom::info_status#4 + // [1775] display_info_rom::info_status#0 = display_info_cx16_rom::info_status#4 -- vbum1=vbuxx + stx display_info_rom.info_status // [1776] display_info_rom::info_text#0 = display_info_cx16_rom::info_text#4 // [1777] call display_info_rom // [1250] phi from display_info_cx16_rom to display_info_rom [phi:display_info_cx16_rom->display_info_rom] @@ -12315,30 +11940,26 @@ display_info_cx16_rom: { * @param commit_id The target commit_id. * @param from The source ptr in ROM or RAM. */ -// void rom_get_github_commit_id(__zp($d7) char *commit_id, __zp($4e) char *from) +// void rom_get_github_commit_id(__zp($b9) char *commit_id, __zp($3e) char *from) rom_get_github_commit_id: { - .label ch = $e8 - .label commit_id = $d7 - .label from = $4e + .label commit_id = $b9 + .label from = $3e // [1780] 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] - // [1780] phi rom_get_github_commit_id::commit_id_ok#2 = true [phi:rom_get_github_commit_id->rom_get_github_commit_id::@2#0] -- vbom1=vboc1 + // [1780] 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 commit_id_ok - // [1780] phi rom_get_github_commit_id::c#2 = 0 [phi:rom_get_github_commit_id->rom_get_github_commit_id::@2#1] -- vbum1=vbuc1 - lda #0 - sta c + tax + // [1780] 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++) - // [1781] if(rom_get_github_commit_id::c#2<7) goto rom_get_github_commit_id::@3 -- vbum1_lt_vbuc1_then_la1 - lda c - cmp #7 + // [1781] 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) - // [1782] if(rom_get_github_commit_id::commit_id_ok#2) goto rom_get_github_commit_id::@1 -- vbom1_then_la1 - lda commit_id_ok - cmp #0 + // [1782] 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' @@ -12369,33 +11990,30 @@ rom_get_github_commit_id: { // rom_get_github_commit_id::@3 __b3: // unsigned char ch = from[c] - // [1788] rom_get_github_commit_id::ch#0 = rom_get_github_commit_id::from#6[rom_get_github_commit_id::c#2] -- vbuz1=pbuz2_derefidx_vbum3 - ldy c + // [1788] 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)) - // [1789] if(rom_get_github_commit_id::ch#0<$30) goto rom_get_github_commit_id::@7 -- vbuz1_lt_vbuc1_then_la1 + // [1789] 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 - // [1790] if(rom_get_github_commit_id::ch#0<$30+9+1) goto rom_get_github_commit_id::@5 -- vbuz1_lt_vbuc1_then_la1 + // [1790] 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: - // [1791] if(rom_get_github_commit_id::ch#0<$41) goto rom_get_github_commit_id::@5 -- vbuz1_lt_vbuc1_then_la1 - lda.z ch + // [1791] 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 - // [1792] if(rom_get_github_commit_id::ch#0<$41+$1a+1) goto rom_get_github_commit_id::@10 -- vbuz1_lt_vbuc1_then_la1 + // [1792] 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 // [1794] 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: - // [1794] 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] -- vbom1=vboc1 + // [1794] 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 commit_id_ok + tax // [1793] 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 // [1794] 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] @@ -12403,17 +12021,13 @@ rom_get_github_commit_id: { // rom_get_github_commit_id::@5 __b5: // for(unsigned char c=0; c<7; c++) - // [1795] rom_get_github_commit_id::c#1 = ++ rom_get_github_commit_id::c#2 -- vbum1=_inc_vbum1 - inc c + // [1795] rom_get_github_commit_id::c#1 = ++ rom_get_github_commit_id::c#2 -- vbuyy=_inc_vbuyy + iny // [1780] 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] // [1780] 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 // [1780] 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 - .segment Data - .label c = main.check_status_smc4_main__0 - .label commit_id_ok = main.check_status_cx16_rom3_check_status_rom1_main__0 } -.segment Code // rom_get_release /** * @brief Calculate the correct ROM release number. @@ -12422,29 +12036,25 @@ rom_get_github_commit_id: { * @param release The raw release number. * @return unsigned char The release potentially taken 2's complement. */ -// __zp($df) char rom_get_release(__zp($df) char release) +// __register(X) char rom_get_release(__register(X) char release) rom_get_release: { - .label rom_get_release__0 = $e7 - .label rom_get_release__2 = $df - .label return = $df - .label release = $df // release & 0x80 - // [1797] 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 + // [1797] rom_get_release::$0 = rom_get_release::release#3 & $80 -- vbuaa=vbuxx_band_vbuc1 + txa + and #$80 // if(release & 0x80) - // [1798] if(0==rom_get_release::$0) goto rom_get_release::@1 -- 0_eq_vbuz1_then_la1 + // [1798] 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 - // [1799] rom_get_release::$2 = ~ rom_get_release::release#3 -- vbuz1=_bnot_vbuz1 - lda.z rom_get_release__2 + // [1799] rom_get_release::$2 = ~ rom_get_release::release#3 -- vbuaa=_bnot_vbuxx + txa eor #$ff - sta.z rom_get_release__2 // release = ~release + 1 - // [1800] rom_get_release::release#0 = rom_get_release::$2 + 1 -- vbuz1=vbuz1_plus_1 - inc.z release + // [1800] rom_get_release::release#0 = rom_get_release::$2 + 1 -- vbuxx=vbuaa_plus_1 + tax + inx // [1801] 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] // [1801] 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 @@ -12463,39 +12073,34 @@ 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) - // [1804] if(rom_get_prefix::release#2!=$ff) goto rom_get_prefix::@1 -- vbum1_neq_vbuc1_then_la1 - lda #$ff - cmp release + // [1804] if(rom_get_prefix::release#2!=$ff) goto rom_get_prefix::@1 -- vbuaa_neq_vbuc1_then_la1 + cmp #$ff bne __b3 // [1805] phi from rom_get_prefix to rom_get_prefix::@3 [phi:rom_get_prefix->rom_get_prefix::@3] // rom_get_prefix::@3 // [1806] phi from rom_get_prefix::@3 to rom_get_prefix::@1 [phi:rom_get_prefix::@3->rom_get_prefix::@1] - // [1806] phi rom_get_prefix::prefix#4 = 'p' [phi:rom_get_prefix::@3->rom_get_prefix::@1#0] -- vbum1=vbuc1 - lda #'p' - sta prefix + // [1806] phi rom_get_prefix::prefix#4 = 'p' [phi:rom_get_prefix::@3->rom_get_prefix::@1#0] -- vbuxx=vbuc1 + ldx #'p' jmp __b1 // [1806] phi from rom_get_prefix to rom_get_prefix::@1 [phi:rom_get_prefix->rom_get_prefix::@1] __b3: - // [1806] phi rom_get_prefix::prefix#4 = 'r' [phi:rom_get_prefix->rom_get_prefix::@1#0] -- vbum1=vbuc1 - lda #'r' - sta prefix + // [1806] 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 - // [1807] 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 + // [1807] rom_get_prefix::$2 = rom_get_prefix::release#2 & $80 -- vbuaa=vbuaa_band_vbuc1 + and #$80 // if(release & 0x80) - // [1808] if(0==rom_get_prefix::$2) goto rom_get_prefix::@4 -- 0_eq_vbum1_then_la1 + // [1808] if(0==rom_get_prefix::$2) goto rom_get_prefix::@4 -- 0_eq_vbuaa_then_la1 + cmp #0 beq __b2 // [1810] phi from rom_get_prefix::@1 to rom_get_prefix::@2 [phi:rom_get_prefix::@1->rom_get_prefix::@2] - // [1810] phi rom_get_prefix::return#0 = 'p' [phi:rom_get_prefix::@1->rom_get_prefix::@2#0] -- vbum1=vbuc1 - lda #'p' - sta return + // [1810] phi rom_get_prefix::return#0 = 'p' [phi:rom_get_prefix::@1->rom_get_prefix::@2#0] -- vbuxx=vbuc1 + ldx #'p' rts // [1809] phi from rom_get_prefix::@1 to rom_get_prefix::@4 [phi:rom_get_prefix::@1->rom_get_prefix::@4] // rom_get_prefix::@4 @@ -12507,21 +12112,12 @@ rom_get_prefix: { // } // [1811] return rts - .segment Data - .label rom_get_prefix__2 = main.check_status_smc5_main__0 - return: .byte 0 - .label release = main.check_status_smc5_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($5d) char *release_info, __mem() char prefix, __zp($df) char release, __zp($d5) char *github) +// void rom_get_version_text(__zp($4b) char *release_info, __register(X) char prefix, __mem() char release, __zp($b7) char *github) rom_get_version_text: { - .label release_info = $5d - .label release = $df - .label github = $d5 + .label release_info = $4b + .label github = $b7 // sprintf(release_info, "%c%u %s", prefix, release, github) // [1813] snprintf_init::s#8 = rom_get_version_text::release_info#2 // [1814] call snprintf_init @@ -12530,16 +12126,15 @@ rom_get_version_text: { jsr snprintf_init // rom_get_version_text::@1 // sprintf(release_info, "%c%u %s", prefix, release, github) - // [1815] stackpush(char) = rom_get_version_text::prefix#2 -- _stackpushbyte_=vbum1 - lda prefix + // [1815] stackpush(char) = rom_get_version_text::prefix#2 -- _stackpushbyte_=vbuxx + txa pha // [1816] callexecute snputc -- call_vprc1 jsr snputc // sideeffect stackpullpadding(1) -- _stackpullpadding_1 pla - // [1818] printf_uchar::uvalue#7 = rom_get_version_text::release#2 -- vbuz1=vbuz2 - lda.z release - sta.z printf_uchar.uvalue + // [1818] printf_uchar::uvalue#7 = rom_get_version_text::release#2 -- vbuxx=vbum1 + ldx release // [1819] call printf_uchar // [1207] phi from rom_get_version_text::@1 to printf_uchar [phi:rom_get_version_text::@1->printf_uchar] // [1207] phi printf_uchar::format_zero_padding#14 = 0 [phi:rom_get_version_text::@1->printf_uchar#0] -- vbuz1=vbuc1 @@ -12552,9 +12147,8 @@ rom_get_version_text: { sta.z printf_uchar.putc lda #>snputc sta.z printf_uchar.putc+1 - // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:rom_get_version_text::@1->printf_uchar#3] -- vbuz1=vbuc1 - lda #DECIMAL - sta.z printf_uchar.format_radix + // [1207] phi printf_uchar::format_radix#14 = DECIMAL [phi:rom_get_version_text::@1->printf_uchar#3] -- vbuyy=vbuc1 + ldy #DECIMAL // [1207] phi printf_uchar::uvalue#14 = printf_uchar::uvalue#7 [phi:rom_get_version_text::@1->printf_uchar#4] -- register_copy jsr printf_uchar // [1820] phi from rom_get_version_text::@1 to rom_get_version_text::@2 [phi:rom_get_version_text::@1->rom_get_version_text::@2] @@ -12608,9 +12202,51 @@ rom_get_version_text: { // [1827] return rts .segment Data - .label prefix = rom_get_prefix.return + release: .byte 0 } .segment Code + // printf_uint +// Print an unsigned int using a specific format +// void printf_uint(__zp($49) void (*putc)(char), __zp($25) unsigned int uvalue, __zp($d2) char format_min_length, char format_justify_left, char format_sign_always, __zp($be) char format_zero_padding, char format_upper_case, __register(X) char format_radix) +printf_uint: { + .label uvalue = $25 + .label putc = $49 + .label format_min_length = $d2 + .label format_zero_padding = $be + // printf_uint::@1 + // printf_buffer.sign = format.sign_always?'+':0 + // [1829] *((char *)&printf_buffer) = 0 -- _deref_pbuc1=vbuc2 + // Handle any sign + lda #0 + sta printf_buffer + // utoa(uvalue, printf_buffer.digits, format.radix) + // [1830] utoa::value#1 = printf_uint::uvalue#14 + // [1831] utoa::radix#0 = printf_uint::format_radix#14 + // [1832] call utoa + // Format number into buffer + jsr utoa + // printf_uint::@2 + // printf_number_buffer(putc, printf_buffer, format) + // [1833] printf_number_buffer::putc#1 = printf_uint::putc#14 + // [1834] printf_number_buffer::buffer_sign#1 = *((char *)&printf_buffer) -- vbuz1=_deref_pbuc1 + lda printf_buffer + sta.z printf_number_buffer.buffer_sign + // [1835] printf_number_buffer::format_min_length#1 = printf_uint::format_min_length#14 -- vbuxx=vbuz1 + ldx.z format_min_length + // [1836] printf_number_buffer::format_zero_padding#1 = printf_uint::format_zero_padding#14 + // [1837] call printf_number_buffer + // Print using format + // [2386] phi from printf_uint::@2 to printf_number_buffer [phi:printf_uint::@2->printf_number_buffer] + // [2386] phi printf_number_buffer::putc#10 = printf_number_buffer::putc#1 [phi:printf_uint::@2->printf_number_buffer#0] -- register_copy + // [2386] phi printf_number_buffer::buffer_sign#10 = printf_number_buffer::buffer_sign#1 [phi:printf_uint::@2->printf_number_buffer#1] -- register_copy + // [2386] 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 + // [2386] 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 + // } + // [1838] return + rts +} // display_info_led /** * @brief Print the colored led of an info line in the info frame. @@ -12620,33 +12256,31 @@ rom_get_version_text: { * @param tc Fore color * @param bc Back color */ -// void display_info_led(__zp($bc) char x, __zp($c6) char y, __zp($e0) char tc, char bc) +// void display_info_led(__register(Y) char x, __zp($c9) char y, __register(X) char tc, char bc) display_info_led: { - .label tc = $e0 - .label y = $c6 - .label x = $bc + .label y = $c9 // textcolor(tc) - // [1829] textcolor::color#13 = display_info_led::tc#4 -- vbuz1=vbuz2 - lda.z tc - sta.z textcolor.color - // [1830] call textcolor + // [1840] textcolor::color#13 = display_info_led::tc#4 + // [1841] call textcolor // [733] phi from display_info_led to textcolor [phi:display_info_led->textcolor] // [733] phi textcolor::color#18 = textcolor::color#13 [phi:display_info_led->textcolor#0] -- register_copy jsr textcolor - // [1831] phi from display_info_led to display_info_led::@1 [phi:display_info_led->display_info_led::@1] + // [1842] phi from display_info_led to display_info_led::@1 [phi:display_info_led->display_info_led::@1] // display_info_led::@1 // bgcolor(bc) - // [1832] call bgcolor + // [1843] call bgcolor // [738] phi from display_info_led::@1 to bgcolor [phi:display_info_led::@1->bgcolor] - // [738] phi bgcolor::color#14 = BLUE [phi:display_info_led::@1->bgcolor#0] -- vbuz1=vbuc1 - lda #BLUE - sta.z bgcolor.color + // [738] phi bgcolor::color#14 = BLUE [phi:display_info_led::@1->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // display_info_led::@2 // cputcxy(x, y, VERA_CHR_UR) - // [1833] cputcxy::x#11 = display_info_led::x#4 - // [1834] cputcxy::y#11 = display_info_led::y#4 - // [1835] call cputcxy + // [1844] cputcxy::x#11 = display_info_led::x#4 -- vbuxx=vbuyy + tya + tax + // [1845] cputcxy::y#11 = display_info_led::y#4 -- vbuyy=vbuz1 + ldy.z y + // [1846] call cputcxy // [2068] phi from display_info_led::@2 to cputcxy [phi:display_info_led::@2->cputcxy] // [2068] phi cputcxy::c#15 = $7c [phi:display_info_led::@2->cputcxy#0] -- vbuz1=vbuc1 lda #$7c @@ -12654,72 +12288,24 @@ display_info_led: { // [2068] phi cputcxy::y#15 = cputcxy::y#11 [phi:display_info_led::@2->cputcxy#1] -- register_copy // [2068] phi cputcxy::x#15 = cputcxy::x#11 [phi:display_info_led::@2->cputcxy#2] -- register_copy jsr cputcxy - // [1836] phi from display_info_led::@2 to display_info_led::@3 [phi:display_info_led::@2->display_info_led::@3] + // [1847] 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) - // [1837] call textcolor + // [1848] call textcolor // [733] phi from display_info_led::@3 to textcolor [phi:display_info_led::@3->textcolor] - // [733] phi textcolor::color#18 = WHITE [phi:display_info_led::@3->textcolor#0] -- vbuz1=vbuc1 - lda #WHITE - sta.z textcolor.color + // [733] phi textcolor::color#18 = WHITE [phi:display_info_led::@3->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor // display_info_led::@return // } - // [1838] return - rts -} - // printf_uint -// Print an unsigned int using a specific format -// void printf_uint(__zp($5b) void (*putc)(char), __zp($2e) unsigned int uvalue, __zp($36) char format_min_length, char format_justify_left, char format_sign_always, __zp($e2) char format_zero_padding, char format_upper_case, __zp($e0) char format_radix) -printf_uint: { - .label uvalue = $2e - .label format_radix = $e0 - .label putc = $5b - .label format_min_length = $36 - .label format_zero_padding = $e2 - // printf_uint::@1 - // printf_buffer.sign = format.sign_always?'+':0 - // [1840] *((char *)&printf_buffer) = 0 -- _deref_pbuc1=vbuc2 - // Handle any sign - lda #0 - sta printf_buffer - // utoa(uvalue, printf_buffer.digits, format.radix) - // [1841] utoa::value#1 = printf_uint::uvalue#14 - // [1842] utoa::radix#0 = printf_uint::format_radix#14 - // [1843] call utoa - // Format number into buffer - jsr utoa - // printf_uint::@2 - // printf_number_buffer(putc, printf_buffer, format) - // [1844] printf_number_buffer::putc#1 = printf_uint::putc#14 - // [1845] printf_number_buffer::buffer_sign#1 = *((char *)&printf_buffer) -- vbuz1=_deref_pbuc1 - lda printf_buffer - sta.z printf_number_buffer.buffer_sign - // [1846] printf_number_buffer::format_min_length#1 = printf_uint::format_min_length#14 - // [1847] printf_number_buffer::format_zero_padding#1 = printf_uint::format_zero_padding#14 - // [1848] call printf_number_buffer - // Print using format - // [2386] phi from printf_uint::@2 to printf_number_buffer [phi:printf_uint::@2->printf_number_buffer] - // [2386] phi printf_number_buffer::putc#10 = printf_number_buffer::putc#1 [phi:printf_uint::@2->printf_number_buffer#0] -- register_copy - // [2386] phi printf_number_buffer::buffer_sign#10 = printf_number_buffer::buffer_sign#1 [phi:printf_uint::@2->printf_number_buffer#1] -- register_copy - // [2386] 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 - // [2386] 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 - // } // [1849] return rts } // screenlayer // --- layer management in VERA --- -// void screenlayer(char layer, __zp($de) char mapbase, __zp($dc) char config) +// void screenlayer(char layer, __register(X) char mapbase, __zp($bd) char config) screenlayer: { - .label screenlayer__1 = $de - .label screenlayer__5 = $dc - .label screenlayer__6 = $dc - .label mapbase = $de - .label config = $dc - .label y = $db + .label config = $bd // __mem char vera_dc_hscale_temp = *VERA_DC_HSCALE // [1850] screenlayer::vera_dc_hscale_temp#0 = *VERA_DC_HSCALE -- vbum1=_deref_pbuc1 lda VERA_DC_HSCALE @@ -12733,132 +12319,123 @@ screenlayer: { lda #0 sta __conio+2 // mapbase >> 7 - // [1853] screenlayer::$0 = screenlayer::mapbase#0 >> 7 -- vbum1=vbuz2_ror_7 - lda.z mapbase + // [1853] screenlayer::$0 = screenlayer::mapbase#0 >> 7 -- vbuaa=vbuxx_ror_7 + txa rol rol and #1 - sta screenlayer__0 // __conio.mapbase_bank = mapbase >> 7 - // [1854] *((char *)&__conio+5) = screenlayer::$0 -- _deref_pbuc1=vbum1 + // [1854] *((char *)&__conio+5) = screenlayer::$0 -- _deref_pbuc1=vbuaa sta __conio+5 // (mapbase)<<1 - // [1855] screenlayer::$1 = screenlayer::mapbase#0 << 1 -- vbuz1=vbuz1_rol_1 - asl.z screenlayer__1 + // [1855] screenlayer::$1 = screenlayer::mapbase#0 << 1 -- vbuaa=vbuxx_rol_1 + txa + asl // MAKEWORD((mapbase)<<1,0) - // [1856] screenlayer::$2 = screenlayer::$1 w= 0 -- vwum1=vbuz2_word_vbuc1 - lda #0 - ldy.z screenlayer__1 - sty screenlayer__2+1 - sta screenlayer__2 + // [1856] 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) // [1857] *((unsigned int *)&__conio+3) = screenlayer::$2 -- _deref_pwuc1=vwum1 - sta __conio+3 tya + sta __conio+3 + lda screenlayer__2+1 sta __conio+3+1 // config & VERA_LAYER_WIDTH_MASK - // [1858] screenlayer::$7 = screenlayer::config#0 & VERA_LAYER_WIDTH_MASK -- vbum1=vbuz2_band_vbuc1 + // [1858] screenlayer::$7 = screenlayer::config#0 & VERA_LAYER_WIDTH_MASK -- vbuaa=vbuz1_band_vbuc1 lda #VERA_LAYER_WIDTH_MASK and.z config - sta screenlayer__7 // (config & VERA_LAYER_WIDTH_MASK) >> 4 - // [1859] screenlayer::$8 = screenlayer::$7 >> 4 -- vbum1=vbum1_ror_4 - lda screenlayer__8 + // [1859] 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] - // [1860] *((char *)&__conio+8) = screenlayer::VERA_LAYER_DIM[screenlayer::$8] -- _deref_pbuc1=pbuc2_derefidx_vbum1 - tay - lda VERA_LAYER_DIM,y + // [1860] *((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 - // [1861] screenlayer::$5 = screenlayer::config#0 & VERA_LAYER_HEIGHT_MASK -- vbuz1=vbuz1_band_vbuc1 + // [1861] screenlayer::$5 = screenlayer::config#0 & VERA_LAYER_HEIGHT_MASK -- vbuaa=vbuz1_band_vbuc1 lda #VERA_LAYER_HEIGHT_MASK - and.z screenlayer__5 - sta.z screenlayer__5 + and.z config // (config & VERA_LAYER_HEIGHT_MASK) >> 6 - // [1862] screenlayer::$6 = screenlayer::$5 >> 6 -- vbuz1=vbuz1_ror_6 - lda.z screenlayer__6 + // [1862] screenlayer::$6 = screenlayer::$5 >> 6 -- vbuaa=vbuaa_ror_6 rol rol rol and #3 - sta.z screenlayer__6 // __conio.mapheight = VERA_LAYER_DIM[ (config & VERA_LAYER_HEIGHT_MASK) >> 6] - // [1863] *((char *)&__conio+9) = screenlayer::VERA_LAYER_DIM[screenlayer::$6] -- _deref_pbuc1=pbuc2_derefidx_vbuz1 + // [1863] *((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] - // [1864] screenlayer::$16 = screenlayer::$8 << 1 -- vbum1=vbum1_rol_1 - asl screenlayer__16 - // [1865] *((unsigned int *)&__conio+$a) = screenlayer::VERA_LAYER_SKIP[screenlayer::$16] -- _deref_pwuc1=pwuc2_derefidx_vbum1 + // [1864] screenlayer::$16 = screenlayer::$8 << 1 -- vbuaa=vbuxx_rol_1 + txa + asl + // [1865] *((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 - // [1866] screenlayer::$9 = screenlayer::vera_dc_hscale_temp#0 == $80 -- vbom1=vbum2_eq_vbuc1 + // [1866] 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 screenlayer__9 // 40 << (char)(vera_dc_hscale_temp == 0x80) - // [1867] screenlayer::$18 = (char)screenlayer::$9 - // [1868] screenlayer::$10 = $28 << screenlayer::$18 -- vbum1=vbuc1_rol_vbum1 + // [1867] screenlayer::$18 = (char)screenlayer::$9 -- vbuxx=vbuaa + tax + // [1868] screenlayer::$10 = $28 << screenlayer::$18 -- vbuaa=vbuc1_rol_vbuxx lda #$28 - ldy screenlayer__10 - cpy #0 + cpx #0 beq !e+ !: asl - dey + dex bne !- !e: - sta screenlayer__10 // (40 << (char)(vera_dc_hscale_temp == 0x80))-1 - // [1869] screenlayer::$11 = screenlayer::$10 - 1 -- vbum1=vbum1_minus_1 - dec screenlayer__11 + // [1869] screenlayer::$11 = screenlayer::$10 - 1 -- vbuaa=vbuaa_minus_1 + sec + sbc #1 // __conio.width = (40 << (char)(vera_dc_hscale_temp == 0x80))-1 - // [1870] *((char *)&__conio+6) = screenlayer::$11 -- _deref_pbuc1=vbum1 - lda screenlayer__11 + // [1870] *((char *)&__conio+6) = screenlayer::$11 -- _deref_pbuc1=vbuaa sta __conio+6 // vera_dc_vscale_temp == 0x80 - // [1871] screenlayer::$12 = screenlayer::vera_dc_vscale_temp#0 == $80 -- vbom1=vbum2_eq_vbuc1 + // [1871] 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 screenlayer__12 // 30 << (char)(vera_dc_vscale_temp == 0x80) - // [1872] screenlayer::$19 = (char)screenlayer::$12 - // [1873] screenlayer::$13 = $1e << screenlayer::$19 -- vbum1=vbuc1_rol_vbum1 + // [1872] screenlayer::$19 = (char)screenlayer::$12 -- vbuxx=vbuaa + tax + // [1873] screenlayer::$13 = $1e << screenlayer::$19 -- vbuaa=vbuc1_rol_vbuxx lda #$1e - ldy screenlayer__13 - cpy #0 + cpx #0 beq !e+ !: asl - dey + dex bne !- !e: - sta screenlayer__13 // (30 << (char)(vera_dc_vscale_temp == 0x80))-1 - // [1874] screenlayer::$14 = screenlayer::$13 - 1 -- vbum1=vbum1_minus_1 - dec screenlayer__14 + // [1874] screenlayer::$14 = screenlayer::$13 - 1 -- vbuaa=vbuaa_minus_1 + sec + sbc #1 // __conio.height = (30 << (char)(vera_dc_vscale_temp == 0x80))-1 - // [1875] *((char *)&__conio+7) = screenlayer::$14 -- _deref_pbuc1=vbum1 - lda screenlayer__14 + // [1875] *((char *)&__conio+7) = screenlayer::$14 -- _deref_pbuc1=vbuaa sta __conio+7 // unsigned int mapbase_offset = __conio.mapbase_offset // [1876] screenlayer::mapbase_offset#0 = *((unsigned int *)&__conio+3) -- vwum1=_deref_pwuc1 @@ -12868,15 +12445,15 @@ screenlayer: { sta mapbase_offset+1 // [1877] phi from screenlayer to screenlayer::@1 [phi:screenlayer->screenlayer::@1] // [1877] phi screenlayer::mapbase_offset#2 = screenlayer::mapbase_offset#0 [phi:screenlayer->screenlayer::@1#0] -- register_copy - // [1877] phi screenlayer::y#2 = 0 [phi:screenlayer->screenlayer::@1#1] -- vbuz1=vbuc1 - lda #0 - sta.z y + // [1877] 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++) - // [1878] if(screenlayer::y#2<=*((char *)&__conio+7)) goto screenlayer::@2 -- vbuz1_le__deref_pbuc1_then_la1 + // [1878] 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 // } @@ -12885,11 +12462,10 @@ screenlayer: { // screenlayer::@2 __b2: // __conio.offsets[y] = mapbase_offset - // [1880] screenlayer::$17 = screenlayer::y#2 << 1 -- vbum1=vbuz2_rol_1 - lda.z y + // [1880] screenlayer::$17 = screenlayer::y#2 << 1 -- vbuaa=vbuxx_rol_1 + txa asl - sta screenlayer__17 - // [1881] ((unsigned int *)&__conio+$15)[screenlayer::$17] = screenlayer::mapbase_offset#2 -- pwuc1_derefidx_vbum1=vwum2 + // [1881] ((unsigned int *)&__conio+$15)[screenlayer::$17] = screenlayer::mapbase_offset#2 -- pwuc1_derefidx_vbuaa=vwum1 tay lda mapbase_offset sta __conio+$15,y @@ -12905,8 +12481,8 @@ screenlayer: { adc __conio+$a+1 sta mapbase_offset+1 // for(register char y=0; y<=__conio.height; y++) - // [1883] screenlayer::y#1 = ++ screenlayer::y#2 -- vbuz1=_inc_vbuz1 - inc.z y + // [1883] screenlayer::y#1 = ++ screenlayer::y#2 -- vbuxx=_inc_vbuxx + inx // [1877] phi from screenlayer::@2 to screenlayer::@1 [phi:screenlayer::@2->screenlayer::@1] // [1877] phi screenlayer::mapbase_offset#2 = screenlayer::mapbase_offset#1 [phi:screenlayer::@2->screenlayer::@1#0] -- register_copy // [1877] phi screenlayer::y#2 = screenlayer::y#1 [phi:screenlayer::@2->screenlayer::@1#1] -- register_copy @@ -12914,20 +12490,7 @@ screenlayer: { .segment Data VERA_LAYER_DIM: .byte $1f, $3f, $7f, $ff VERA_LAYER_SKIP: .word $40, $80, $100, $200 - screenlayer__0: .byte 0 - screenlayer__2: .word 0 - screenlayer__7: .byte 0 - .label screenlayer__8 = screenlayer__7 - screenlayer__9: .byte 0 - .label screenlayer__10 = screenlayer__9 - .label screenlayer__11 = screenlayer__9 - screenlayer__12: .byte 0 - .label screenlayer__13 = screenlayer__12 - .label screenlayer__14 = screenlayer__12 - .label screenlayer__16 = screenlayer__7 - screenlayer__17: .byte 0 - .label screenlayer__18 = screenlayer__9 - .label screenlayer__19 = screenlayer__12 + .label screenlayer__2 = cbm_k_plot_get.return vera_dc_hscale_temp: .byte 0 vera_dc_vscale_temp: .byte 0 .label mapbase_offset = cbm_k_plot_get.return @@ -12959,11 +12522,10 @@ cscroll: { // gotoxy(0,0) // [1888] call gotoxy // [751] phi from cscroll::@3 to gotoxy [phi:cscroll::@3->gotoxy] - // [751] phi gotoxy::y#30 = 0 [phi:cscroll::@3->gotoxy#0] -- vbuz1=vbuc1 - lda #0 - sta.z gotoxy.y - // [751] phi gotoxy::x#30 = 0 [phi:cscroll::@3->gotoxy#1] -- vbuz1=vbuc1 - sta.z gotoxy.x + // [751] phi gotoxy::y#30 = 0 [phi:cscroll::@3->gotoxy#0] -- vbuyy=vbuc1 + ldy #0 + // [751] phi gotoxy::x#30 = 0 [phi:cscroll::@3->gotoxy#1] -- vbuxx=vbuc1 + ldx #0 jsr gotoxy // cscroll::@return __breturn: @@ -12978,15 +12540,13 @@ cscroll: { jsr insertup // cscroll::@5 // gotoxy( 0, __conio.height) - // [1892] gotoxy::y#3 = *((char *)&__conio+7) -- vbuz1=_deref_pbuc1 - lda __conio+7 - sta.z gotoxy.y + // [1892] gotoxy::y#3 = *((char *)&__conio+7) -- vbuyy=_deref_pbuc1 + ldy __conio+7 // [1893] call gotoxy // [751] phi from cscroll::@5 to gotoxy [phi:cscroll::@5->gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#3 [phi:cscroll::@5->gotoxy#0] -- register_copy - // [751] phi gotoxy::x#30 = 0 [phi:cscroll::@5->gotoxy#1] -- vbuz1=vbuc1 - lda #0 - sta.z gotoxy.x + // [751] phi gotoxy::x#30 = 0 [phi:cscroll::@5->gotoxy#1] -- vbuxx=vbuc1 + ldx #0 jsr gotoxy // [1894] phi from cscroll::@5 to cscroll::@6 [phi:cscroll::@5->cscroll::@6] // cscroll::@6 @@ -13015,7 +12575,6 @@ scroll: { // clrscr // clears the screen and moves the cursor to the upper left-hand corner of the screen. clrscr: { - .label clrscr__2 = $d9 // unsigned int line_text = __conio.mapbase_offset // [1898] clrscr::line_text#0 = *((unsigned int *)&__conio+3) -- vwum1=_deref_pwuc1 lda __conio+3 @@ -13028,42 +12587,37 @@ clrscr: { and VERA_CTRL sta VERA_CTRL // __conio.mapbase_bank | VERA_INC_1 - // [1900] clrscr::$0 = *((char *)&__conio+5) | VERA_INC_1 -- vbum1=_deref_pbuc1_bor_vbuc2 + // [1900] clrscr::$0 = *((char *)&__conio+5) | VERA_INC_1 -- vbuaa=_deref_pbuc1_bor_vbuc2 lda #VERA_INC_1 ora __conio+5 - sta clrscr__0 // *VERA_ADDRX_H = __conio.mapbase_bank | VERA_INC_1 - // [1901] *VERA_ADDRX_H = clrscr::$0 -- _deref_pbuc1=vbum1 + // [1901] *VERA_ADDRX_H = clrscr::$0 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_H // unsigned char l = __conio.mapheight - // [1902] clrscr::l#0 = *((char *)&__conio+9) -- vbum1=_deref_pbuc1 - lda __conio+9 - sta l + // [1902] clrscr::l#0 = *((char *)&__conio+9) -- vbuxx=_deref_pbuc1 + ldx __conio+9 // [1903] phi from clrscr clrscr::@3 to clrscr::@1 [phi:clrscr/clrscr::@3->clrscr::@1] // [1903] phi clrscr::l#4 = clrscr::l#0 [phi:clrscr/clrscr::@3->clrscr::@1#0] -- register_copy // [1903] phi clrscr::ch#0 = clrscr::line_text#0 [phi:clrscr/clrscr::@3->clrscr::@1#1] -- register_copy // clrscr::@1 __b1: // BYTE0(ch) - // [1904] clrscr::$1 = byte0 clrscr::ch#0 -- vbum1=_byte0_vwum2 + // [1904] clrscr::$1 = byte0 clrscr::ch#0 -- vbuaa=_byte0_vwum1 lda ch - sta clrscr__1 // *VERA_ADDRX_L = BYTE0(ch) - // [1905] *VERA_ADDRX_L = clrscr::$1 -- _deref_pbuc1=vbum1 + // [1905] *VERA_ADDRX_L = clrscr::$1 -- _deref_pbuc1=vbuaa // Set address sta VERA_ADDRX_L // BYTE1(ch) - // [1906] clrscr::$2 = byte1 clrscr::ch#0 -- vbuz1=_byte1_vwum2 + // [1906] clrscr::$2 = byte1 clrscr::ch#0 -- vbuaa=_byte1_vwum1 lda ch+1 - sta.z clrscr__2 // *VERA_ADDRX_M = BYTE1(ch) - // [1907] *VERA_ADDRX_M = clrscr::$2 -- _deref_pbuc1=vbuz1 + // [1907] *VERA_ADDRX_M = clrscr::$2 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_M // unsigned char c = __conio.mapwidth+1 - // [1908] clrscr::c#0 = *((char *)&__conio+8) + 1 -- vbum1=_deref_pbuc1_plus_1 - lda __conio+8 - inc - sta c + // [1908] clrscr::c#0 = *((char *)&__conio+8) + 1 -- vbuyy=_deref_pbuc1_plus_1 + ldy __conio+8 + iny // [1909] phi from clrscr::@1 clrscr::@2 to clrscr::@2 [phi:clrscr::@1/clrscr::@2->clrscr::@2] // [1909] phi clrscr::c#2 = clrscr::c#0 [phi:clrscr::@1/clrscr::@2->clrscr::@2#0] -- register_copy // clrscr::@2 @@ -13077,11 +12631,11 @@ clrscr: { lda __conio+$d sta VERA_DATA0 // c--; - // [1912] clrscr::c#1 = -- clrscr::c#2 -- vbum1=_dec_vbum1 - dec c + // [1912] clrscr::c#1 = -- clrscr::c#2 -- vbuyy=_dec_vbuyy + dey // while(c) - // [1913] if(0!=clrscr::c#1) goto clrscr::@2 -- 0_neq_vbum1_then_la1 - lda c + // [1913] if(0!=clrscr::c#1) goto clrscr::@2 -- 0_neq_vbuyy_then_la1 + cpy #0 bne __b2 // clrscr::@3 // line_text += __conio.rowskip @@ -13094,11 +12648,11 @@ clrscr: { adc __conio+$a+1 sta line_text+1 // l--; - // [1915] clrscr::l#1 = -- clrscr::l#4 -- vbum1=_dec_vbum1 - dec l + // [1915] clrscr::l#1 = -- clrscr::l#4 -- vbuxx=_dec_vbuxx + dex // while(l) - // [1916] if(0!=clrscr::l#1) goto clrscr::@1 -- 0_neq_vbum1_then_la1 - lda l + // [1916] if(0!=clrscr::l#1) goto clrscr::@1 -- 0_neq_vbuxx_then_la1 + cpx #0 bne __b1 // clrscr::@4 // __conio.cursor_x = 0 @@ -13119,12 +12673,8 @@ clrscr: { // [1920] return rts .segment Data - .label clrscr__0 = display_frame.w - .label clrscr__1 = fopen.sp .label line_text = ch - .label l = main.check_status_vera1_main__0 ch: .word 0 - .label c = main.main__67 } .segment Code // display_frame @@ -13140,16 +12690,14 @@ clrscr: { * @param x1 Right down X position, counting from 0. * @param y1 Right down Y position, counting from 0. */ -// void display_frame(char x0, char y0, __zp($3c) char x1, __zp($68) char y1) +// void display_frame(char x0, char y0, __zp($d2) char x1, __zp($52) char y1) display_frame: { - .label x = $69 - .label y = $52 - .label mask = $64 - .label c = $cb - .label x_1 = $b3 - .label y_1 = $62 - .label x1 = $3c - .label y1 = $68 + .label x = $4f + .label y = $53 + .label x_1 = $42 + .label y_1 = $72 + .label x1 = $d2 + .label y1 = $52 // unsigned char w = x1 - x0 // [1922] display_frame::w#0 = display_frame::x1#16 - display_frame::x#0 -- vbum1=vbuz2_minus_vbuz3 lda.z x1 @@ -13163,12 +12711,10 @@ display_frame: { sbc.z y sta h // unsigned char mask = display_frame_maskxy(x, y) - // [1924] display_frame_maskxy::x#0 = display_frame::x#0 -- vbum1=vbuz2 - lda.z x - sta display_frame_maskxy.x - // [1925] display_frame_maskxy::y#0 = display_frame::y#0 -- vbuz1=vbuz2 - lda.z y - sta.z display_frame_maskxy.y + // [1924] display_frame_maskxy::x#0 = display_frame::x#0 -- vbuxx=vbuz1 + ldx.z x + // [1925] display_frame_maskxy::y#0 = display_frame::y#0 -- vbuyy=vbuz1 + ldy.z y // [1926] call display_frame_maskxy // [2581] phi from display_frame to display_frame_maskxy [phi:display_frame->display_frame_maskxy] // [2581] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#0 [phi:display_frame->display_frame_maskxy#0] -- register_copy @@ -13179,10 +12725,8 @@ display_frame: { // display_frame::@13 // [1928] display_frame::mask#0 = display_frame_maskxy::return#13 // mask |= 0b0110 - // [1929] display_frame::mask#1 = display_frame::mask#0 | 6 -- vbuz1=vbuz1_bor_vbuc1 - lda #6 - ora.z mask - sta.z mask + // [1929] display_frame::mask#1 = display_frame::mask#0 | 6 -- vbuaa=vbuaa_bor_vbuc1 + ora #6 // unsigned char c = display_frame_char(mask) // [1930] display_frame_char::mask#0 = display_frame::mask#1 // [1931] call display_frame_char @@ -13195,13 +12739,12 @@ display_frame: { // display_frame::@14 // [1933] display_frame::c#0 = display_frame_char::return#13 // cputcxy(x, y, c) - // [1934] cputcxy::x#0 = display_frame::x#0 -- vbuz1=vbuz2 - lda.z x - sta.z cputcxy.x - // [1935] cputcxy::y#0 = display_frame::y#0 -- vbuz1=vbuz2 - lda.z y - sta.z cputcxy.y - // [1936] cputcxy::c#0 = display_frame::c#0 + // [1934] cputcxy::x#0 = display_frame::x#0 -- vbuxx=vbuz1 + ldx.z x + // [1935] cputcxy::y#0 = display_frame::y#0 -- vbuyy=vbuz1 + ldy.z y + // [1936] cputcxy::c#0 = display_frame::c#0 -- vbuz1=vbuaa + sta.z cputcxy.c // [1937] call cputcxy // [2068] phi from display_frame::@14 to cputcxy [phi:display_frame::@14->cputcxy] // [2068] phi cputcxy::c#15 = cputcxy::c#0 [phi:display_frame::@14->cputcxy#0] -- register_copy @@ -13238,12 +12781,10 @@ display_frame: { // display_frame::@1 __b1: // display_frame_maskxy(x, y) - // [1943] display_frame_maskxy::x#1 = display_frame::x#24 -- vbum1=vbuz2 - lda.z x_1 - sta display_frame_maskxy.x - // [1944] display_frame_maskxy::y#1 = display_frame::y#0 -- vbuz1=vbuz2 - lda.z y - sta.z display_frame_maskxy.y + // [1943] display_frame_maskxy::x#1 = display_frame::x#24 -- vbuxx=vbuz1 + ldx.z x_1 + // [1944] display_frame_maskxy::y#1 = display_frame::y#0 -- vbuyy=vbuz1 + ldy.z y // [1945] call display_frame_maskxy // [2581] phi from display_frame::@1 to display_frame_maskxy [phi:display_frame::@1->display_frame_maskxy] // [2581] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#1 [phi:display_frame::@1->display_frame_maskxy#0] -- register_copy @@ -13255,10 +12796,8 @@ display_frame: { // mask = display_frame_maskxy(x, y) // [1947] display_frame::mask#2 = display_frame_maskxy::return#14 // mask |= 0b0011 - // [1948] display_frame::mask#3 = display_frame::mask#2 | 3 -- vbuz1=vbuz1_bor_vbuc1 - lda #3 - ora.z mask - sta.z mask + // [1948] display_frame::mask#3 = display_frame::mask#2 | 3 -- vbuaa=vbuaa_bor_vbuc1 + ora #3 // display_frame_char(mask) // [1949] display_frame_char::mask#1 = display_frame::mask#3 // [1950] call display_frame_char @@ -13271,13 +12810,12 @@ display_frame: { // c = display_frame_char(mask) // [1952] display_frame::c#1 = display_frame_char::return#14 // cputcxy(x, y, c) - // [1953] cputcxy::x#1 = display_frame::x#24 -- vbuz1=vbuz2 - lda.z x_1 - sta.z cputcxy.x - // [1954] cputcxy::y#1 = display_frame::y#0 -- vbuz1=vbuz2 - lda.z y - sta.z cputcxy.y - // [1955] cputcxy::c#1 = display_frame::c#1 + // [1953] cputcxy::x#1 = display_frame::x#24 -- vbuxx=vbuz1 + ldx.z x_1 + // [1954] cputcxy::y#1 = display_frame::y#0 -- vbuyy=vbuz1 + ldy.z y + // [1955] cputcxy::c#1 = display_frame::c#1 -- vbuz1=vbuaa + sta.z cputcxy.c // [1956] call cputcxy // [2068] phi from display_frame::@17 to cputcxy [phi:display_frame::@17->cputcxy] // [2068] phi cputcxy::c#15 = cputcxy::c#1 [phi:display_frame::@17->cputcxy#0] -- register_copy @@ -13307,12 +12845,10 @@ display_frame: { bcc __b7 // display_frame::@8 // display_frame_maskxy(x, y) - // [1961] display_frame_maskxy::x#5 = display_frame::x#0 -- vbum1=vbuz2 - lda.z x - sta display_frame_maskxy.x - // [1962] display_frame_maskxy::y#5 = display_frame::y#10 -- vbuz1=vbuz2 - lda.z y_1 - sta.z display_frame_maskxy.y + // [1961] display_frame_maskxy::x#5 = display_frame::x#0 -- vbuxx=vbuz1 + ldx.z x + // [1962] display_frame_maskxy::y#5 = display_frame::y#10 -- vbuyy=vbuz1 + tay // [1963] call display_frame_maskxy // [2581] phi from display_frame::@8 to display_frame_maskxy [phi:display_frame::@8->display_frame_maskxy] // [2581] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#5 [phi:display_frame::@8->display_frame_maskxy#0] -- register_copy @@ -13324,10 +12860,8 @@ display_frame: { // mask = display_frame_maskxy(x, y) // [1965] display_frame::mask#10 = display_frame_maskxy::return#18 // mask |= 0b1100 - // [1966] display_frame::mask#11 = display_frame::mask#10 | $c -- vbuz1=vbuz1_bor_vbuc1 - lda #$c - ora.z mask - sta.z mask + // [1966] display_frame::mask#11 = display_frame::mask#10 | $c -- vbuaa=vbuaa_bor_vbuc1 + ora #$c // display_frame_char(mask) // [1967] display_frame_char::mask#5 = display_frame::mask#11 // [1968] call display_frame_char @@ -13340,13 +12874,12 @@ display_frame: { // c = display_frame_char(mask) // [1970] display_frame::c#5 = display_frame_char::return#18 // cputcxy(x, y, c) - // [1971] cputcxy::x#5 = display_frame::x#0 -- vbuz1=vbuz2 - lda.z x - sta.z cputcxy.x - // [1972] cputcxy::y#5 = display_frame::y#10 -- vbuz1=vbuz2 - lda.z y_1 - sta.z cputcxy.y - // [1973] cputcxy::c#5 = display_frame::c#5 + // [1971] cputcxy::x#5 = display_frame::x#0 -- vbuxx=vbuz1 + ldx.z x + // [1972] cputcxy::y#5 = display_frame::y#10 -- vbuyy=vbuz1 + ldy.z y_1 + // [1973] cputcxy::c#5 = display_frame::c#5 -- vbuz1=vbuaa + sta.z cputcxy.c // [1974] call cputcxy // [2068] phi from display_frame::@29 to cputcxy [phi:display_frame::@29->cputcxy] // [2068] phi cputcxy::c#15 = cputcxy::c#5 [phi:display_frame::@29->cputcxy#0] -- register_copy @@ -13377,12 +12910,10 @@ display_frame: { // display_frame::@10 __b10: // display_frame_maskxy(x, y) - // [1980] display_frame_maskxy::x#6 = display_frame::x#15 -- vbum1=vbuz2 - lda.z x - sta display_frame_maskxy.x - // [1981] display_frame_maskxy::y#6 = display_frame::y#10 -- vbuz1=vbuz2 - lda.z y_1 - sta.z display_frame_maskxy.y + // [1980] display_frame_maskxy::x#6 = display_frame::x#15 -- vbuxx=vbuz1 + ldx.z x + // [1981] display_frame_maskxy::y#6 = display_frame::y#10 -- vbuyy=vbuz1 + ldy.z y_1 // [1982] call display_frame_maskxy // [2581] phi from display_frame::@10 to display_frame_maskxy [phi:display_frame::@10->display_frame_maskxy] // [2581] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#6 [phi:display_frame::@10->display_frame_maskxy#0] -- register_copy @@ -13394,10 +12925,8 @@ display_frame: { // mask = display_frame_maskxy(x, y) // [1984] display_frame::mask#12 = display_frame_maskxy::return#19 // mask |= 0b1001 - // [1985] display_frame::mask#13 = display_frame::mask#12 | 9 -- vbuz1=vbuz1_bor_vbuc1 - lda #9 - ora.z mask - sta.z mask + // [1985] display_frame::mask#13 = display_frame::mask#12 | 9 -- vbuaa=vbuaa_bor_vbuc1 + ora #9 // display_frame_char(mask) // [1986] display_frame_char::mask#6 = display_frame::mask#13 // [1987] call display_frame_char @@ -13410,13 +12939,12 @@ display_frame: { // c = display_frame_char(mask) // [1989] display_frame::c#6 = display_frame_char::return#19 // cputcxy(x, y, c) - // [1990] cputcxy::x#6 = display_frame::x#15 -- vbuz1=vbuz2 - lda.z x - sta.z cputcxy.x - // [1991] cputcxy::y#6 = display_frame::y#10 -- vbuz1=vbuz2 - lda.z y_1 - sta.z cputcxy.y - // [1992] cputcxy::c#6 = display_frame::c#6 + // [1990] cputcxy::x#6 = display_frame::x#15 -- vbuxx=vbuz1 + ldx.z x + // [1991] cputcxy::y#6 = display_frame::y#10 -- vbuyy=vbuz1 + ldy.z y_1 + // [1992] cputcxy::c#6 = display_frame::c#6 -- vbuz1=vbuaa + sta.z cputcxy.c // [1993] call cputcxy // [2068] phi from display_frame::@32 to cputcxy [phi:display_frame::@32->cputcxy] // [2068] phi cputcxy::c#15 = cputcxy::c#6 [phi:display_frame::@32->cputcxy#0] -- register_copy @@ -13431,12 +12959,10 @@ display_frame: { // display_frame::@12 __b12: // display_frame_maskxy(x, y) - // [1995] display_frame_maskxy::x#7 = display_frame::x#18 -- vbum1=vbuz2 - lda.z x - sta display_frame_maskxy.x - // [1996] display_frame_maskxy::y#7 = display_frame::y#10 -- vbuz1=vbuz2 - lda.z y_1 - sta.z display_frame_maskxy.y + // [1995] display_frame_maskxy::x#7 = display_frame::x#18 -- vbuxx=vbuz1 + ldx.z x + // [1996] display_frame_maskxy::y#7 = display_frame::y#10 -- vbuyy=vbuz1 + ldy.z y_1 // [1997] call display_frame_maskxy // [2581] phi from display_frame::@12 to display_frame_maskxy [phi:display_frame::@12->display_frame_maskxy] // [2581] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#7 [phi:display_frame::@12->display_frame_maskxy#0] -- register_copy @@ -13448,10 +12974,8 @@ display_frame: { // mask = display_frame_maskxy(x, y) // [1999] display_frame::mask#14 = display_frame_maskxy::return#20 // mask |= 0b0101 - // [2000] display_frame::mask#15 = display_frame::mask#14 | 5 -- vbuz1=vbuz1_bor_vbuc1 - lda #5 - ora.z mask - sta.z mask + // [2000] display_frame::mask#15 = display_frame::mask#14 | 5 -- vbuaa=vbuaa_bor_vbuc1 + ora #5 // display_frame_char(mask) // [2001] display_frame_char::mask#7 = display_frame::mask#15 // [2002] call display_frame_char @@ -13464,13 +12988,12 @@ display_frame: { // c = display_frame_char(mask) // [2004] display_frame::c#7 = display_frame_char::return#20 // cputcxy(x, y, c) - // [2005] cputcxy::x#7 = display_frame::x#18 -- vbuz1=vbuz2 - lda.z x - sta.z cputcxy.x - // [2006] cputcxy::y#7 = display_frame::y#10 -- vbuz1=vbuz2 - lda.z y_1 - sta.z cputcxy.y - // [2007] cputcxy::c#7 = display_frame::c#7 + // [2005] cputcxy::x#7 = display_frame::x#18 -- vbuxx=vbuz1 + ldx.z x + // [2006] cputcxy::y#7 = display_frame::y#10 -- vbuyy=vbuz1 + ldy.z y_1 + // [2007] cputcxy::c#7 = display_frame::c#7 -- vbuz1=vbuaa + sta.z cputcxy.c // [2008] call cputcxy // [2068] phi from display_frame::@34 to cputcxy [phi:display_frame::@34->cputcxy] // [2068] phi cputcxy::c#15 = cputcxy::c#7 [phi:display_frame::@34->cputcxy#0] -- register_copy @@ -13485,12 +13008,10 @@ display_frame: { // display_frame::@7 __b7: // display_frame_maskxy(x0, y) - // [2010] display_frame_maskxy::x#3 = display_frame::x#0 -- vbum1=vbuz2 - lda.z x - sta display_frame_maskxy.x - // [2011] display_frame_maskxy::y#3 = display_frame::y#10 -- vbuz1=vbuz2 - lda.z y_1 - sta.z display_frame_maskxy.y + // [2010] display_frame_maskxy::x#3 = display_frame::x#0 -- vbuxx=vbuz1 + ldx.z x + // [2011] display_frame_maskxy::y#3 = display_frame::y#10 -- vbuyy=vbuz1 + ldy.z y_1 // [2012] call display_frame_maskxy // [2581] phi from display_frame::@7 to display_frame_maskxy [phi:display_frame::@7->display_frame_maskxy] // [2581] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#3 [phi:display_frame::@7->display_frame_maskxy#0] -- register_copy @@ -13502,10 +13023,8 @@ display_frame: { // mask = display_frame_maskxy(x0, y) // [2014] display_frame::mask#6 = display_frame_maskxy::return#16 // mask |= 0b1010 - // [2015] display_frame::mask#7 = display_frame::mask#6 | $a -- vbuz1=vbuz1_bor_vbuc1 - lda #$a - ora.z mask - sta.z mask + // [2015] display_frame::mask#7 = display_frame::mask#6 | $a -- vbuaa=vbuaa_bor_vbuc1 + ora #$a // display_frame_char(mask) // [2016] display_frame_char::mask#3 = display_frame::mask#7 // [2017] call display_frame_char @@ -13518,13 +13037,12 @@ display_frame: { // c = display_frame_char(mask) // [2019] display_frame::c#3 = display_frame_char::return#16 // cputcxy(x0, y, c) - // [2020] cputcxy::x#3 = display_frame::x#0 -- vbuz1=vbuz2 - lda.z x - sta.z cputcxy.x - // [2021] cputcxy::y#3 = display_frame::y#10 -- vbuz1=vbuz2 - lda.z y_1 - sta.z cputcxy.y - // [2022] cputcxy::c#3 = display_frame::c#3 + // [2020] cputcxy::x#3 = display_frame::x#0 -- vbuxx=vbuz1 + ldx.z x + // [2021] cputcxy::y#3 = display_frame::y#10 -- vbuyy=vbuz1 + ldy.z y_1 + // [2022] cputcxy::c#3 = display_frame::c#3 -- vbuz1=vbuaa + sta.z cputcxy.c // [2023] call cputcxy // [2068] phi from display_frame::@23 to cputcxy [phi:display_frame::@23->cputcxy] // [2068] phi cputcxy::c#15 = cputcxy::c#3 [phi:display_frame::@23->cputcxy#0] -- register_copy @@ -13533,12 +13051,10 @@ display_frame: { jsr cputcxy // display_frame::@24 // display_frame_maskxy(x1, y) - // [2024] display_frame_maskxy::x#4 = display_frame::x1#16 -- vbum1=vbuz2 - lda.z x1 - sta display_frame_maskxy.x - // [2025] display_frame_maskxy::y#4 = display_frame::y#10 -- vbuz1=vbuz2 - lda.z y_1 - sta.z display_frame_maskxy.y + // [2024] display_frame_maskxy::x#4 = display_frame::x1#16 -- vbuxx=vbuz1 + ldx.z x1 + // [2025] display_frame_maskxy::y#4 = display_frame::y#10 -- vbuyy=vbuz1 + ldy.z y_1 // [2026] call display_frame_maskxy // [2581] phi from display_frame::@24 to display_frame_maskxy [phi:display_frame::@24->display_frame_maskxy] // [2581] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#4 [phi:display_frame::@24->display_frame_maskxy#0] -- register_copy @@ -13550,10 +13066,8 @@ display_frame: { // mask = display_frame_maskxy(x1, y) // [2028] display_frame::mask#8 = display_frame_maskxy::return#17 // mask |= 0b1010 - // [2029] display_frame::mask#9 = display_frame::mask#8 | $a -- vbuz1=vbuz1_bor_vbuc1 - lda #$a - ora.z mask - sta.z mask + // [2029] display_frame::mask#9 = display_frame::mask#8 | $a -- vbuaa=vbuaa_bor_vbuc1 + ora #$a // display_frame_char(mask) // [2030] display_frame_char::mask#4 = display_frame::mask#9 // [2031] call display_frame_char @@ -13566,13 +13080,12 @@ display_frame: { // c = display_frame_char(mask) // [2033] display_frame::c#4 = display_frame_char::return#17 // cputcxy(x1, y, c) - // [2034] cputcxy::x#4 = display_frame::x1#16 -- vbuz1=vbuz2 - lda.z x1 - sta.z cputcxy.x - // [2035] cputcxy::y#4 = display_frame::y#10 -- vbuz1=vbuz2 - lda.z y_1 - sta.z cputcxy.y - // [2036] cputcxy::c#4 = display_frame::c#4 + // [2034] cputcxy::x#4 = display_frame::x1#16 -- vbuxx=vbuz1 + ldx.z x1 + // [2035] cputcxy::y#4 = display_frame::y#10 -- vbuyy=vbuz1 + ldy.z y_1 + // [2036] cputcxy::c#4 = display_frame::c#4 -- vbuz1=vbuaa + sta.z cputcxy.c // [2037] call cputcxy // [2068] phi from display_frame::@26 to cputcxy [phi:display_frame::@26->cputcxy] // [2068] phi cputcxy::c#15 = cputcxy::c#4 [phi:display_frame::@26->cputcxy#0] -- register_copy @@ -13587,12 +13100,10 @@ display_frame: { // display_frame::@5 __b5: // display_frame_maskxy(x, y) - // [2039] display_frame_maskxy::x#2 = display_frame::x#10 -- vbum1=vbuz2 - lda.z x_1 - sta display_frame_maskxy.x - // [2040] display_frame_maskxy::y#2 = display_frame::y#0 -- vbuz1=vbuz2 - lda.z y - sta.z display_frame_maskxy.y + // [2039] display_frame_maskxy::x#2 = display_frame::x#10 -- vbuxx=vbuz1 + ldx.z x_1 + // [2040] display_frame_maskxy::y#2 = display_frame::y#0 -- vbuyy=vbuz1 + ldy.z y // [2041] call display_frame_maskxy // [2581] phi from display_frame::@5 to display_frame_maskxy [phi:display_frame::@5->display_frame_maskxy] // [2581] phi display_frame_maskxy::cpeekcxy1_y#0 = display_frame_maskxy::y#2 [phi:display_frame::@5->display_frame_maskxy#0] -- register_copy @@ -13604,10 +13115,8 @@ display_frame: { // mask = display_frame_maskxy(x, y) // [2043] display_frame::mask#4 = display_frame_maskxy::return#15 // mask |= 0b0101 - // [2044] display_frame::mask#5 = display_frame::mask#4 | 5 -- vbuz1=vbuz1_bor_vbuc1 - lda #5 - ora.z mask - sta.z mask + // [2044] display_frame::mask#5 = display_frame::mask#4 | 5 -- vbuaa=vbuaa_bor_vbuc1 + ora #5 // display_frame_char(mask) // [2045] display_frame_char::mask#2 = display_frame::mask#5 // [2046] call display_frame_char @@ -13620,13 +13129,12 @@ display_frame: { // c = display_frame_char(mask) // [2048] display_frame::c#2 = display_frame_char::return#15 // cputcxy(x, y, c) - // [2049] cputcxy::x#2 = display_frame::x#10 -- vbuz1=vbuz2 - lda.z x_1 - sta.z cputcxy.x - // [2050] cputcxy::y#2 = display_frame::y#0 -- vbuz1=vbuz2 - lda.z y - sta.z cputcxy.y - // [2051] cputcxy::c#2 = display_frame::c#2 + // [2049] cputcxy::x#2 = display_frame::x#10 -- vbuxx=vbuz1 + ldx.z x_1 + // [2050] cputcxy::y#2 = display_frame::y#0 -- vbuyy=vbuz1 + ldy.z y + // [2051] cputcxy::c#2 = display_frame::c#2 -- vbuz1=vbuaa + sta.z cputcxy.c // [2052] call cputcxy // [2068] phi from display_frame::@20 to cputcxy [phi:display_frame::@20->cputcxy] // [2068] phi cputcxy::c#15 = cputcxy::c#2 [phi:display_frame::@20->cputcxy#0] -- register_copy @@ -13645,32 +13153,30 @@ display_frame: { sta.z x_1 jmp __b1 .segment Data - w: .byte 0 - .label h = fopen.sp + .label w = fopen.sp + .label h = ferror.sp } .segment Code // cputs // Output a NUL-terminated string at the current cursor position -// void cputs(__zp($d5) const char *s) +// void cputs(__zp($b7) const char *s) cputs: { - .label c = $d9 - .label s = $d5 + .label s = $b7 // [2056] phi from cputs cputs::@2 to cputs::@1 [phi:cputs/cputs::@2->cputs::@1] // [2056] phi cputs::s#2 = cputs::s#1 [phi:cputs/cputs::@2->cputs::@1#0] -- register_copy // cputs::@1 __b1: // while(c=*s++) - // [2057] cputs::c#1 = *cputs::s#2 -- vbuz1=_deref_pbuz2 + // [2057] cputs::c#1 = *cputs::s#2 -- vbuaa=_deref_pbuz1 ldy #0 lda (s),y - sta.z c // [2058] cputs::s#0 = ++ cputs::s#2 -- pbuz1=_inc_pbuz1 inc.z s bne !+ inc.z s+1 !: - // [2059] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuz1_then_la1 - lda.z c + // [2059] if(0!=cputs::c#1) goto cputs::@2 -- 0_neq_vbuaa_then_la1 + cmp #0 bne __b2 // cputs::@return // } @@ -13679,8 +13185,7 @@ cputs: { // cputs::@2 __b2: // cputc(c) - // [2061] stackpush(char) = cputs::c#1 -- _stackpushbyte_=vbuz1 - lda.z c + // [2061] stackpush(char) = cputs::c#1 -- _stackpushbyte_=vbuaa pha // [2062] callexecute cputc -- call_vprc1 jsr cputc @@ -13691,15 +13196,9 @@ cputs: { // wherex // Return the x position of the cursor wherex: { - .label return = $e8 - .label return_1 = $e6 - .label return_2 = $d9 - .label return_3 = $eb - .label return_4 = $65 // return __conio.cursor_x; - // [2064] wherex::return#0 = *((char *)&__conio) -- vbuz1=_deref_pbuc1 + // [2064] wherex::return#0 = *((char *)&__conio) -- vbuaa=_deref_pbuc1 lda __conio - sta.z return // wherex::@return // } // [2065] return @@ -13708,15 +13207,9 @@ wherex: { // wherey // Return the y position of the cursor wherey: { - .label return = $e7 - .label return_1 = $ba - .label return_2 = $cd - .label return_3 = $b6 - .label return_4 = $dd // return __conio.cursor_y; - // [2066] wherey::return#0 = *((char *)&__conio+1) -- vbuz1=_deref_pbuc1 + // [2066] wherey::return#0 = *((char *)&__conio+1) -- vbuaa=_deref_pbuc1 lda __conio+1 - sta.z return // wherey::@return // } // [2067] return @@ -13725,18 +13218,12 @@ wherey: { // cputcxy // Move cursor and output one character // Same as "gotoxy (x, y); cputc (c);" -// void cputcxy(__zp($bc) char x, __zp($c6) char y, __zp($cb) char c) +// void cputcxy(__register(X) char x, __register(Y) char y, __zp($54) char c) cputcxy: { - .label x = $bc - .label y = $c6 - .label c = $cb + .label c = $54 // gotoxy(x, y) - // [2069] gotoxy::x#0 = cputcxy::x#15 -- vbuz1=vbuz2 - lda.z x - sta.z gotoxy.x - // [2070] gotoxy::y#0 = cputcxy::y#15 -- vbuz1=vbuz2 - lda.z y - sta.z gotoxy.y + // [2069] gotoxy::x#0 = cputcxy::x#15 + // [2070] gotoxy::y#0 = cputcxy::y#15 // [2071] call gotoxy // [751] phi from cputcxy to gotoxy [phi:cputcxy->gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#0 [phi:cputcxy->gotoxy#0] -- register_copy @@ -13762,13 +13249,12 @@ cputcxy: { * * @param c Led color */ -// void display_smc_led(__zp($e0) char c) +// void display_smc_led(__zp($c1) char c) display_smc_led: { - .label c = $e0 + .label c = $c1 // display_chip_led(CHIP_SMC_X+1, CHIP_SMC_Y, CHIP_SMC_W, c, BLUE) - // [2077] display_chip_led::tc#0 = display_smc_led::c#2 -- vbuz1=vbuz2 - lda.z c - sta.z display_chip_led.tc + // [2077] display_chip_led::tc#0 = display_smc_led::c#2 -- vbuxx=vbuz1 + ldx.z c // [2078] call display_chip_led // [2622] phi from display_smc_led to display_chip_led [phi:display_smc_led->display_chip_led] // [2622] phi display_chip_led::w#7 = 5 [phi:display_smc_led->display_chip_led#0] -- vbuz1=vbuc1 @@ -13781,16 +13267,16 @@ display_smc_led: { jsr display_chip_led // display_smc_led::@1 // display_info_led(INFO_X-2, INFO_Y, c, BLUE) - // [2079] display_info_led::tc#0 = display_smc_led::c#2 + // [2079] display_info_led::tc#0 = display_smc_led::c#2 -- vbuxx=vbuz1 + ldx.z c // [2080] call display_info_led - // [1828] phi from display_smc_led::@1 to display_info_led [phi:display_smc_led::@1->display_info_led] - // [1828] phi display_info_led::y#4 = $11 [phi:display_smc_led::@1->display_info_led#0] -- vbuz1=vbuc1 + // [1839] phi from display_smc_led::@1 to display_info_led [phi:display_smc_led::@1->display_info_led] + // [1839] 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 - // [1828] 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 - // [1828] phi display_info_led::tc#4 = display_info_led::tc#0 [phi:display_smc_led::@1->display_info_led#2] -- register_copy + // [1839] phi display_info_led::x#4 = 4-2 [phi:display_smc_led::@1->display_info_led#1] -- vbuyy=vbuc1 + ldy #4-2 + // [1839] 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 // } @@ -13806,29 +13292,27 @@ 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($da) char x, char y, __zp($e9) char w, __zp($54) char *text) +// void display_print_chip(__zp($bc) char x, char y, __zp($75) char w, __zp($43) char *text) display_print_chip: { .label y = 3+2+1+1+1+1+1+1+1+1 - .label text = $54 - .label x = $da - .label text_5 = $6b - .label text_6 = $e3 - .label w = $e9 + .label text = $43 + .label text_1 = $f1 + .label x = $bc + .label text_2 = $e8 + .label text_5 = $55 + .label text_6 = $bf + .label w = $75 // display_chip_line(x, y++, w, *text++) - // [2083] display_chip_line::x#0 = display_print_chip::x#10 -- vbuz1=vbuz2 + // [2083] display_chip_line::x#0 = display_print_chip::x#10 -- vbum1=vbuz2 lda.z x - sta.z display_chip_line.x + sta display_chip_line.x // [2084] display_chip_line::w#0 = display_print_chip::w#10 -- vbuz1=vbuz2 lda.z w sta.z display_chip_line.w - // [2085] display_chip_line::c#0 = *display_print_chip::text#11 -- vbuz1=_deref_pbum2 - ldy text_2 - sty.z $fe - ldy text_2+1 - sty.z $ff + // [2085] display_chip_line::c#0 = *display_print_chip::text#11 -- vbum1=_deref_pbuz2 ldy #0 - lda ($fe),y - sta.z display_chip_line.c + lda (text_2),y + sta display_chip_line.c // [2086] call display_chip_line // [2640] phi from display_print_chip to display_chip_line [phi:display_print_chip->display_chip_line] // [2640] phi display_chip_line::c#15 = display_chip_line::c#0 [phi:display_print_chip->display_chip_line#0] -- register_copy @@ -13840,25 +13324,25 @@ display_print_chip: { jsr display_chip_line // display_print_chip::@1 // display_chip_line(x, y++, w, *text++); - // [2087] display_print_chip::text#0 = ++ display_print_chip::text#11 -- pbuz1=_inc_pbum2 + // [2087] display_print_chip::text#0 = ++ display_print_chip::text#11 -- pbuz1=_inc_pbuz2 clc - lda text_2 + lda.z text_2 adc #1 sta.z text - lda text_2+1 + lda.z text_2+1 adc #0 sta.z text+1 // display_chip_line(x, y++, w, *text++) - // [2088] display_chip_line::x#1 = display_print_chip::x#10 -- vbuz1=vbuz2 + // [2088] display_chip_line::x#1 = display_print_chip::x#10 -- vbum1=vbuz2 lda.z x - sta.z display_chip_line.x + sta display_chip_line.x // [2089] display_chip_line::w#1 = display_print_chip::w#10 -- vbuz1=vbuz2 lda.z w sta.z display_chip_line.w - // [2090] display_chip_line::c#1 = *display_print_chip::text#0 -- vbuz1=_deref_pbuz2 + // [2090] display_chip_line::c#1 = *display_print_chip::text#0 -- vbum1=_deref_pbuz2 ldy #0 lda (text),y - sta.z display_chip_line.c + sta display_chip_line.c // [2091] call display_chip_line // [2640] phi from display_print_chip::@1 to display_chip_line [phi:display_print_chip::@1->display_chip_line] // [2640] phi display_chip_line::c#15 = display_chip_line::c#1 [phi:display_print_chip::@1->display_chip_line#0] -- register_copy @@ -13870,29 +13354,25 @@ display_print_chip: { jsr display_chip_line // display_print_chip::@2 // display_chip_line(x, y++, w, *text++); - // [2092] display_print_chip::text#1 = ++ display_print_chip::text#0 -- pbum1=_inc_pbuz2 + // [2092] display_print_chip::text#1 = ++ display_print_chip::text#0 -- pbuz1=_inc_pbuz2 clc lda.z text adc #1 - sta text_1 + sta.z text_1 lda.z text+1 adc #0 - sta text_1+1 + sta.z text_1+1 // display_chip_line(x, y++, w, *text++) - // [2093] display_chip_line::x#2 = display_print_chip::x#10 -- vbuz1=vbuz2 + // [2093] display_chip_line::x#2 = display_print_chip::x#10 -- vbum1=vbuz2 lda.z x - sta.z display_chip_line.x + sta display_chip_line.x // [2094] display_chip_line::w#2 = display_print_chip::w#10 -- vbuz1=vbuz2 lda.z w sta.z display_chip_line.w - // [2095] display_chip_line::c#2 = *display_print_chip::text#1 -- vbuz1=_deref_pbum2 - ldy text_1 - sty.z $fe - ldy text_1+1 - sty.z $ff + // [2095] display_chip_line::c#2 = *display_print_chip::text#1 -- vbum1=_deref_pbuz2 ldy #0 - lda ($fe),y - sta.z display_chip_line.c + lda (text_1),y + sta display_chip_line.c // [2096] call display_chip_line // [2640] phi from display_print_chip::@2 to display_chip_line [phi:display_print_chip::@2->display_chip_line] // [2640] phi display_chip_line::c#15 = display_chip_line::c#2 [phi:display_print_chip::@2->display_chip_line#0] -- register_copy @@ -13904,29 +13384,29 @@ display_print_chip: { jsr display_chip_line // display_print_chip::@3 // display_chip_line(x, y++, w, *text++); - // [2097] display_print_chip::text#15 = ++ display_print_chip::text#1 -- pbum1=_inc_pbum2 + // [2097] display_print_chip::text#15 = ++ display_print_chip::text#1 -- pbum1=_inc_pbuz2 clc - lda text_1 + lda.z text_1 adc #1 sta text_3 - lda text_1+1 + lda.z text_1+1 adc #0 sta text_3+1 // display_chip_line(x, y++, w, *text++) - // [2098] display_chip_line::x#3 = display_print_chip::x#10 -- vbuz1=vbuz2 + // [2098] display_chip_line::x#3 = display_print_chip::x#10 -- vbum1=vbuz2 lda.z x - sta.z display_chip_line.x + sta display_chip_line.x // [2099] display_chip_line::w#3 = display_print_chip::w#10 -- vbuz1=vbuz2 lda.z w sta.z display_chip_line.w - // [2100] display_chip_line::c#3 = *display_print_chip::text#15 -- vbuz1=_deref_pbum2 + // [2100] display_chip_line::c#3 = *display_print_chip::text#15 -- vbum1=_deref_pbum2 ldy text_3 sty.z $fe ldy text_3+1 sty.z $ff ldy #0 lda ($fe),y - sta.z display_chip_line.c + sta display_chip_line.c // [2101] call display_chip_line // [2640] phi from display_print_chip::@3 to display_chip_line [phi:display_print_chip::@3->display_chip_line] // [2640] phi display_chip_line::c#15 = display_chip_line::c#3 [phi:display_print_chip::@3->display_chip_line#0] -- register_copy @@ -13947,20 +13427,20 @@ display_print_chip: { adc #0 sta text_4+1 // display_chip_line(x, y++, w, *text++) - // [2103] display_chip_line::x#4 = display_print_chip::x#10 -- vbuz1=vbuz2 + // [2103] display_chip_line::x#4 = display_print_chip::x#10 -- vbum1=vbuz2 lda.z x - sta.z display_chip_line.x + sta display_chip_line.x // [2104] display_chip_line::w#4 = display_print_chip::w#10 -- vbuz1=vbuz2 lda.z w sta.z display_chip_line.w - // [2105] display_chip_line::c#4 = *display_print_chip::text#16 -- vbuz1=_deref_pbum2 + // [2105] display_chip_line::c#4 = *display_print_chip::text#16 -- vbum1=_deref_pbum2 ldy text_4 sty.z $fe ldy text_4+1 sty.z $ff ldy #0 lda ($fe),y - sta.z display_chip_line.c + sta display_chip_line.c // [2106] call display_chip_line // [2640] phi from display_print_chip::@4 to display_chip_line [phi:display_print_chip::@4->display_chip_line] // [2640] phi display_chip_line::c#15 = display_chip_line::c#4 [phi:display_print_chip::@4->display_chip_line#0] -- register_copy @@ -13981,16 +13461,16 @@ display_print_chip: { adc #0 sta.z text_5+1 // display_chip_line(x, y++, w, *text++) - // [2108] display_chip_line::x#5 = display_print_chip::x#10 -- vbuz1=vbuz2 + // [2108] display_chip_line::x#5 = display_print_chip::x#10 -- vbum1=vbuz2 lda.z x - sta.z display_chip_line.x + sta display_chip_line.x // [2109] display_chip_line::w#5 = display_print_chip::w#10 -- vbuz1=vbuz2 lda.z w sta.z display_chip_line.w - // [2110] display_chip_line::c#5 = *display_print_chip::text#17 -- vbuz1=_deref_pbuz2 + // [2110] display_chip_line::c#5 = *display_print_chip::text#17 -- vbum1=_deref_pbuz2 ldy #0 lda (text_5),y - sta.z display_chip_line.c + sta display_chip_line.c // [2111] call display_chip_line // [2640] phi from display_print_chip::@5 to display_chip_line [phi:display_print_chip::@5->display_chip_line] // [2640] phi display_chip_line::c#15 = display_chip_line::c#5 [phi:display_print_chip::@5->display_chip_line#0] -- register_copy @@ -14011,16 +13491,16 @@ display_print_chip: { adc #0 sta.z text_6+1 // display_chip_line(x, y++, w, *text++) - // [2113] display_chip_line::x#6 = display_print_chip::x#10 -- vbuz1=vbuz2 + // [2113] display_chip_line::x#6 = display_print_chip::x#10 -- vbum1=vbuz2 lda.z x - sta.z display_chip_line.x + sta display_chip_line.x // [2114] display_chip_line::w#6 = display_print_chip::w#10 -- vbuz1=vbuz2 lda.z w sta.z display_chip_line.w - // [2115] display_chip_line::c#6 = *display_print_chip::text#18 -- vbuz1=_deref_pbuz2 + // [2115] display_chip_line::c#6 = *display_print_chip::text#18 -- vbum1=_deref_pbuz2 ldy #0 lda (text_6),y - sta.z display_chip_line.c + sta display_chip_line.c // [2116] call display_chip_line // [2640] phi from display_print_chip::@6 to display_chip_line [phi:display_print_chip::@6->display_chip_line] // [2640] phi display_chip_line::c#15 = display_chip_line::c#6 [phi:display_print_chip::@6->display_chip_line#0] -- register_copy @@ -14038,16 +13518,16 @@ display_print_chip: { inc.z text_6+1 !: // display_chip_line(x, y++, w, *text++) - // [2118] display_chip_line::x#7 = display_print_chip::x#10 -- vbuz1=vbuz2 + // [2118] display_chip_line::x#7 = display_print_chip::x#10 -- vbum1=vbuz2 lda.z x - sta.z display_chip_line.x + sta display_chip_line.x // [2119] display_chip_line::w#7 = display_print_chip::w#10 -- vbuz1=vbuz2 lda.z w sta.z display_chip_line.w - // [2120] display_chip_line::c#7 = *display_print_chip::text#19 -- vbuz1=_deref_pbuz2 + // [2120] display_chip_line::c#7 = *display_print_chip::text#19 -- vbum1=_deref_pbuz2 ldy #0 lda (text_6),y - sta.z display_chip_line.c + sta display_chip_line.c // [2121] call display_chip_line // [2640] phi from display_print_chip::@7 to display_chip_line [phi:display_print_chip::@7->display_chip_line] // [2640] phi display_chip_line::c#15 = display_chip_line::c#7 [phi:display_print_chip::@7->display_chip_line#0] -- register_copy @@ -14059,10 +13539,11 @@ display_print_chip: { jsr display_chip_line // display_print_chip::@8 // display_chip_end(x, y++, w) - // [2122] display_chip_end::x#0 = display_print_chip::x#10 - // [2123] display_chip_end::w#0 = display_print_chip::w#10 -- vbuz1=vbuz2 + // [2122] display_chip_end::x#0 = display_print_chip::x#10 -- vbuxx=vbuz1 + ldx.z x + // [2123] display_chip_end::w#0 = display_print_chip::w#10 -- vbum1=vbuz2 lda.z w - sta.z display_chip_end.w + sta display_chip_end.w // [2124] call display_chip_end jsr display_chip_end // display_print_chip::@return @@ -14070,8 +13551,6 @@ display_print_chip: { // [2125] return rts .segment Data - .label text_1 = fopen.fopen__28 - .label text_2 = strcat.src .label text_3 = fopen.fopen__11 .label text_4 = ferror.return } @@ -14082,13 +13561,12 @@ display_print_chip: { * * @param c Led color */ -// void display_vera_led(__zp($b7) char c) +// void display_vera_led(__zp($51) char c) display_vera_led: { - .label c = $b7 + .label c = $51 // display_chip_led(CHIP_VERA_X+1, CHIP_VERA_Y, CHIP_VERA_W, c, BLUE) - // [2127] display_chip_led::tc#1 = display_vera_led::c#2 -- vbuz1=vbuz2 - lda.z c - sta.z display_chip_led.tc + // [2127] display_chip_led::tc#1 = display_vera_led::c#2 -- vbuxx=vbuz1 + ldx.z c // [2128] call display_chip_led // [2622] phi from display_vera_led to display_chip_led [phi:display_vera_led->display_chip_led] // [2622] phi display_chip_led::w#7 = 8 [phi:display_vera_led->display_chip_led#0] -- vbuz1=vbuc1 @@ -14101,18 +13579,16 @@ display_vera_led: { jsr display_chip_led // display_vera_led::@1 // display_info_led(INFO_X-2, INFO_Y+1, c, BLUE) - // [2129] display_info_led::tc#1 = display_vera_led::c#2 -- vbuz1=vbuz2 - lda.z c - sta.z display_info_led.tc + // [2129] display_info_led::tc#1 = display_vera_led::c#2 -- vbuxx=vbuz1 + ldx.z c // [2130] call display_info_led - // [1828] phi from display_vera_led::@1 to display_info_led [phi:display_vera_led::@1->display_info_led] - // [1828] phi display_info_led::y#4 = $11+1 [phi:display_vera_led::@1->display_info_led#0] -- vbuz1=vbuc1 + // [1839] phi from display_vera_led::@1 to display_info_led [phi:display_vera_led::@1->display_info_led] + // [1839] 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 - // [1828] 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 - // [1828] phi display_info_led::tc#4 = display_info_led::tc#1 [phi:display_vera_led::@1->display_info_led#2] -- register_copy + // [1839] phi display_info_led::x#4 = 4-2 [phi:display_vera_led::@1->display_info_led#1] -- vbuyy=vbuc1 + ldy #4-2 + // [1839] 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 // } @@ -14121,10 +13597,12 @@ display_vera_led: { } // 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, __mem() char *source) +// char * strcat(char *destination, __zp($e8) char *source) strcat: { - .label strcat__0 = $54 - .label dst = $54 + .label strcat__0 = $43 + .label dst = $43 + .label src = $e8 + .label source = $e8 // strlen(destination) // [2133] call strlen // [2344] phi from strcat to strlen [phi:strcat->strlen] @@ -14153,13 +13631,9 @@ strcat: { // strcat::@1 __b1: // while(*src) - // [2138] if(0!=*strcat::src#2) goto strcat::@2 -- 0_neq__deref_pbum1_then_la1 - ldy src - sty.z $fe - ldy src+1 - sty.z $ff + // [2138] if(0!=*strcat::src#2) goto strcat::@2 -- 0_neq__deref_pbuz1_then_la1 ldy #0 - lda ($fe),y + lda (src),y cmp #0 bne __b2 // strcat::@3 @@ -14175,13 +13649,9 @@ strcat: { // strcat::@2 __b2: // *dst++ = *src++ - // [2141] *strcat::dst#2 = *strcat::src#2 -- _deref_pbuz1=_deref_pbum2 - ldy src - sty.z $fe - ldy src+1 - sty.z $ff + // [2141] *strcat::dst#2 = *strcat::src#2 -- _deref_pbuz1=_deref_pbuz2 ldy #0 - lda ($fe),y + lda (src),y sta (dst),y // *dst++ = *src++; // [2142] strcat::dst#1 = ++ strcat::dst#2 -- pbuz1=_inc_pbuz1 @@ -14189,17 +13659,13 @@ strcat: { bne !+ inc.z dst+1 !: - // [2143] strcat::src#1 = ++ strcat::src#2 -- pbum1=_inc_pbum1 - inc src + // [2143] strcat::src#1 = ++ strcat::src#2 -- pbuz1=_inc_pbuz1 + inc.z src bne !+ - inc src+1 + inc.z src+1 !: jmp __b1 - .segment Data - src: .word 0 - .label source = src } -.segment Code // display_rom_led /** * @brief Print ROM led above the ROM chip. @@ -14207,35 +13673,27 @@ strcat: { * @param chip ROM chip number (0 is main rom chip of CX16) * @param c Led color */ -// void display_rom_led(__zp($63) char chip, __zp($6a) char c) +// void display_rom_led(__zp($dd) char chip, __zp($df) char c) display_rom_led: { - .label display_rom_led__0 = $5a - .label chip = $63 - .label c = $6a - .label display_rom_led__7 = $5a - .label display_rom_led__8 = $5a + .label chip = $dd + .label c = $df // chip*6 - // [2145] display_rom_led::$7 = display_rom_led::chip#2 << 1 -- vbuz1=vbuz2_rol_1 + // [2145] display_rom_led::$7 = display_rom_led::chip#2 << 1 -- vbuaa=vbuz1_rol_1 lda.z chip asl - sta.z display_rom_led__7 - // [2146] display_rom_led::$8 = display_rom_led::$7 + display_rom_led::chip#2 -- vbuz1=vbuz1_plus_vbuz2 - lda.z display_rom_led__8 + // [2146] 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 - // [2147] display_rom_led::$0 = display_rom_led::$8 << 1 -- vbuz1=vbuz1_rol_1 - asl.z display_rom_led__0 + // [2147] 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) - // [2148] display_chip_led::x#3 = display_rom_led::$0 + $14+1 -- vbuz1=vbuz1_plus_vbuc1 - lda #$14+1 + // [2148] 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 - // [2149] display_chip_led::tc#2 = display_rom_led::c#2 -- vbuz1=vbuz2 - lda.z c - sta.z display_chip_led.tc + // [2149] display_chip_led::tc#2 = display_rom_led::c#2 -- vbuxx=vbuz1 + ldx.z c // [2150] call display_chip_led // [2622] phi from display_rom_led to display_chip_led [phi:display_rom_led->display_chip_led] // [2622] phi display_chip_led::w#7 = 3 [phi:display_rom_led->display_chip_led#0] -- vbuz1=vbuc1 @@ -14251,21 +13709,48 @@ display_rom_led: { clc adc.z chip sta.z display_info_led.y - // [2152] display_info_led::tc#2 = display_rom_led::c#2 -- vbuz1=vbuz2 - lda.z c - sta.z display_info_led.tc + // [2152] display_info_led::tc#2 = display_rom_led::c#2 -- vbuxx=vbuz1 + ldx.z c // [2153] call display_info_led - // [1828] phi from display_rom_led::@1 to display_info_led [phi:display_rom_led::@1->display_info_led] - // [1828] phi display_info_led::y#4 = display_info_led::y#2 [phi:display_rom_led::@1->display_info_led#0] -- register_copy - // [1828] 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 - // [1828] phi display_info_led::tc#4 = display_info_led::tc#2 [phi:display_rom_led::@1->display_info_led#2] -- register_copy + // [1839] phi from display_rom_led::@1 to display_info_led [phi:display_rom_led::@1->display_info_led] + // [1839] phi display_info_led::y#4 = display_info_led::y#2 [phi:display_rom_led::@1->display_info_led#0] -- register_copy + // [1839] phi display_info_led::x#4 = 4-2 [phi:display_rom_led::@1->display_info_led#1] -- vbuyy=vbuc1 + ldy #4-2 + // [1839] 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 // } // [2154] return rts +} + // display_progress_line +/** + * @brief Print one line of text in the progress frame at a line position. + * + * @param line The start line, counting from 0. + * @param text The text to be displayed. + */ +// void display_progress_line(__register(X) char line, __zp($25) char *text) +display_progress_line: { + .label text = $25 + // cputsxy(PROGRESS_X, PROGRESS_Y+line, text) + // [2155] cputsxy::y#0 = PROGRESS_Y + display_progress_line::line#0 -- vbuyy=vbuc1_plus_vbuxx + txa + clc + adc #PROGRESS_Y + tay + // [2156] cputsxy::s#0 = display_progress_line::text#0 + // [2157] call cputsxy + // [838] phi from display_progress_line to cputsxy [phi:display_progress_line->cputsxy] + // [838] phi cputsxy::s#4 = cputsxy::s#0 [phi:display_progress_line->cputsxy#0] -- register_copy + // [838] phi cputsxy::y#4 = cputsxy::y#0 [phi:display_progress_line->cputsxy#1] -- register_copy + // [838] phi cputsxy::x#4 = PROGRESS_X [phi:display_progress_line->cputsxy#2] -- vbuxx=vbuc1 + ldx #PROGRESS_X + jsr cputsxy + // display_progress_line::@return + // } + // [2158] return + rts } // rom_unlock /** @@ -14277,13 +13762,13 @@ display_rom_led: { * @param unlock_code The 3rd write to model the specific unlock sequence. */ /* inline */ -// void rom_unlock(__zp($6f) unsigned long address, __zp($7d) char unlock_code) +// void rom_unlock(__zp($59) unsigned long address, __zp($65) char unlock_code) rom_unlock: { - .label chip_address = $41 - .label address = $6f - .label unlock_code = $7d + .label chip_address = $34 + .label address = $59 + .label unlock_code = $65 // unsigned long chip_address = address & ROM_CHIP_MASK - // [2156] rom_unlock::chip_address#0 = rom_unlock::address#5 & $380000 -- vduz1=vduz2_band_vduc1 + // [2160] rom_unlock::chip_address#0 = rom_unlock::address#5 & $380000 -- vduz1=vduz2_band_vduc1 lda.z address and #<$380000 sta.z chip_address @@ -14297,7 +13782,7 @@ rom_unlock: { and #>$380000>>$10 sta.z chip_address+3 // rom_write_byte(chip_address + 0x05555, 0xAA) - // [2157] rom_write_byte::address#0 = rom_unlock::chip_address#0 + $5555 -- vduz1=vduz2_plus_vwuc1 + // [2161] rom_write_byte::address#0 = rom_unlock::chip_address#0 + $5555 -- vduz1=vduz2_plus_vwuc1 clc lda.z chip_address adc #<$5555 @@ -14311,17 +13796,16 @@ rom_unlock: { lda.z chip_address+3 adc #0 sta.z rom_write_byte.address+3 - // [2158] call rom_write_byte + // [2162] call rom_write_byte // This is a very important operation... // [2701] phi from rom_unlock to rom_write_byte [phi:rom_unlock->rom_write_byte] - // [2701] phi rom_write_byte::value#10 = $aa [phi:rom_unlock->rom_write_byte#0] -- vbuz1=vbuc1 - lda #$aa - sta.z rom_write_byte.value + // [2701] phi rom_write_byte::value#10 = $aa [phi:rom_unlock->rom_write_byte#0] -- vbuyy=vbuc1 + ldy #$aa // [2701] 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) - // [2159] rom_write_byte::address#1 = rom_unlock::chip_address#0 + $2aaa -- vduz1=vduz2_plus_vwuc1 + // [2163] rom_write_byte::address#1 = rom_unlock::chip_address#0 + $2aaa -- vduz1=vduz2_plus_vwuc1 clc lda.z chip_address adc #<$2aaa @@ -14335,16 +13819,15 @@ rom_unlock: { lda.z chip_address+3 adc #0 sta.z rom_write_byte.address+3 - // [2160] call rom_write_byte + // [2164] call rom_write_byte // [2701] phi from rom_unlock::@1 to rom_write_byte [phi:rom_unlock::@1->rom_write_byte] - // [2701] 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 + // [2701] phi rom_write_byte::value#10 = $55 [phi:rom_unlock::@1->rom_write_byte#0] -- vbuyy=vbuc1 + ldy #$55 // [2701] 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) - // [2161] rom_write_byte::address#2 = rom_unlock::address#5 -- vduz1=vduz2 + // [2165] rom_write_byte::address#2 = rom_unlock::address#5 -- vduz1=vduz2 lda.z address sta.z rom_write_byte.address lda.z address+1 @@ -14353,17 +13836,16 @@ rom_unlock: { sta.z rom_write_byte.address+2 lda.z address+3 sta.z rom_write_byte.address+3 - // [2162] rom_write_byte::value#2 = rom_unlock::unlock_code#5 -- vbuz1=vbuz2 - lda.z unlock_code - sta.z rom_write_byte.value - // [2163] call rom_write_byte + // [2166] rom_write_byte::value#2 = rom_unlock::unlock_code#5 -- vbuyy=vbuz1 + ldy.z unlock_code + // [2167] call rom_write_byte // [2701] phi from rom_unlock::@2 to rom_write_byte [phi:rom_unlock::@2->rom_write_byte] // [2701] phi rom_write_byte::value#10 = rom_write_byte::value#2 [phi:rom_unlock::@2->rom_write_byte#0] -- register_copy // [2701] 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 // } - // [2164] return + // [2168] return rts } // rom_read_byte @@ -14376,50 +13858,42 @@ rom_unlock: { * @param address The 22 bit ROM address. * @return unsigned char The byte read from the ROM. */ -// __zp($fb) char rom_read_byte(__zp($56) unsigned long address) +// __register(A) char rom_read_byte(__zp($45) unsigned long address) rom_read_byte: { - .label rom_bank1_rom_read_byte__0 = $66 - .label rom_bank1_rom_read_byte__2 = $ce - .label rom_ptr1_rom_read_byte__0 = $54 - .label rom_ptr1_rom_read_byte__2 = $54 - .label rom_bank1_bank_unshifted = $ce - .label rom_bank1_return = $e6 - .label rom_ptr1_return = $54 - .label return = $fb - .label address = $56 + .label rom_bank1_rom_read_byte__2 = $b1 + .label rom_ptr1_rom_read_byte__0 = $43 + .label rom_ptr1_rom_read_byte__2 = $43 + .label rom_bank1_bank_unshifted = $b1 + .label rom_ptr1_return = $43 + .label address = $45 // rom_read_byte::rom_bank1 // BYTE2(address) - // [2166] rom_read_byte::rom_bank1_$0 = byte2 rom_read_byte::address#2 -- vbuz1=_byte2_vduz2 + // [2170] rom_read_byte::rom_bank1_$0 = byte2 rom_read_byte::address#2 -- vbuaa=_byte2_vduz1 lda.z address+2 - sta.z rom_bank1_rom_read_byte__0 // BYTE1(address) - // [2167] rom_read_byte::rom_bank1_$1 = byte1 rom_read_byte::address#2 -- vbum1=_byte1_vduz2 - lda.z address+1 - sta rom_bank1_rom_read_byte__1 + // [2171] rom_read_byte::rom_bank1_$1 = byte1 rom_read_byte::address#2 -- vbuxx=_byte1_vduz1 + ldx.z address+1 // MAKEWORD(BYTE2(address),BYTE1(address)) - // [2168] rom_read_byte::rom_bank1_$2 = rom_read_byte::rom_bank1_$0 w= rom_read_byte::rom_bank1_$1 -- vwuz1=vbuz2_word_vbum3 - lda.z rom_bank1_rom_read_byte__0 + // [2172] rom_read_byte::rom_bank1_$2 = rom_read_byte::rom_bank1_$0 w= rom_read_byte::rom_bank1_$1 -- vwuz1=vbuaa_word_vbuxx sta.z rom_bank1_rom_read_byte__2+1 - lda rom_bank1_rom_read_byte__1 - sta.z rom_bank1_rom_read_byte__2 + stx.z rom_bank1_rom_read_byte__2 // unsigned int bank_unshifted = MAKEWORD(BYTE2(address),BYTE1(address)) << 2 - // [2169] rom_read_byte::rom_bank1_bank_unshifted#0 = rom_read_byte::rom_bank1_$2 << 2 -- vwuz1=vwuz1_rol_2 + // [2173] rom_read_byte::rom_bank1_bank_unshifted#0 = rom_read_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) - // [2170] rom_read_byte::rom_bank1_return#0 = byte1 rom_read_byte::rom_bank1_bank_unshifted#0 -- vbuz1=_byte1_vwuz2 - lda.z rom_bank1_bank_unshifted+1 - sta.z rom_bank1_return + // [2174] rom_read_byte::rom_bank1_return#0 = byte1 rom_read_byte::rom_bank1_bank_unshifted#0 -- vbuxx=_byte1_vwuz1 + ldx.z rom_bank1_bank_unshifted+1 // rom_read_byte::rom_ptr1 // (unsigned int)(address) & ROM_PTR_MASK - // [2171] rom_read_byte::rom_ptr1_$2 = (unsigned int)rom_read_byte::address#2 -- vwuz1=_word_vduz2 + // [2175] rom_read_byte::rom_ptr1_$2 = (unsigned int)rom_read_byte::address#2 -- vwuz1=_word_vduz2 lda.z address sta.z rom_ptr1_rom_read_byte__2 lda.z address+1 sta.z rom_ptr1_rom_read_byte__2+1 - // [2172] rom_read_byte::rom_ptr1_$0 = rom_read_byte::rom_ptr1_$2 & $3fff -- vwuz1=vwuz1_band_vwuc1 + // [2176] rom_read_byte::rom_ptr1_$0 = rom_read_byte::rom_ptr1_$2 & $3fff -- vwuz1=vwuz1_band_vwuc1 lda.z rom_ptr1_rom_read_byte__0 and #<$3fff sta.z rom_ptr1_rom_read_byte__0 @@ -14427,7 +13901,7 @@ rom_read_byte: { and #>$3fff sta.z rom_ptr1_rom_read_byte__0+1 // ((unsigned int)(address) & ROM_PTR_MASK) + ROM_BASE - // [2173] rom_read_byte::rom_ptr1_return#0 = rom_read_byte::rom_ptr1_$0 + $c000 -- vwuz1=vwuz1_plus_vwuc1 + // [2177] rom_read_byte::rom_ptr1_return#0 = rom_read_byte::rom_ptr1_$0 + $c000 -- vwuz1=vwuz1_plus_vwuc1 lda.z rom_ptr1_return clc adc #<$c000 @@ -14437,51 +13911,15 @@ rom_read_byte: { sta.z rom_ptr1_return+1 // rom_read_byte::bank_set_brom1 // BROM = bank - // [2174] BROM = rom_read_byte::rom_bank1_return#0 -- vbuz1=vbuz2 - lda.z rom_bank1_return - sta.z BROM + // [2178] BROM = rom_read_byte::rom_bank1_return#0 -- vbuz1=vbuxx + stx.z BROM // rom_read_byte::@1 // return *ptr_rom; - // [2175] rom_read_byte::return#0 = *((char *)rom_read_byte::rom_ptr1_return#0) -- vbuz1=_deref_pbuz2 + // [2179] rom_read_byte::return#0 = *((char *)rom_read_byte::rom_ptr1_return#0) -- vbuaa=_deref_pbuz1 ldy #0 lda (rom_ptr1_return),y - sta.z return // rom_read_byte::@return // } - // [2176] return - rts - .segment Data - .label rom_bank1_rom_read_byte__1 = fopen.sp -} -.segment Code - // display_progress_line -/** - * @brief Print one line of text in the progress frame at a line position. - * - * @param line The start line, counting from 0. - * @param text The text to be displayed. - */ -// void display_progress_line(__zp($36) char line, __zp($2e) char *text) -display_progress_line: { - .label line = $36 - .label text = $2e - // cputsxy(PROGRESS_X, PROGRESS_Y+line, text) - // [2177] cputsxy::y#0 = PROGRESS_Y + display_progress_line::line#0 -- vbuz1=vbuc1_plus_vbuz1 - lda #PROGRESS_Y - clc - adc.z cputsxy.y - sta.z cputsxy.y - // [2178] cputsxy::s#0 = display_progress_line::text#0 - // [2179] call cputsxy - // [838] phi from display_progress_line to cputsxy [phi:display_progress_line->cputsxy] - // [838] phi cputsxy::s#4 = cputsxy::s#0 [phi:display_progress_line->cputsxy#0] -- register_copy - // [838] phi cputsxy::y#4 = cputsxy::y#0 [phi:display_progress_line->cputsxy#1] -- register_copy - // [838] phi cputsxy::x#4 = PROGRESS_X [phi:display_progress_line->cputsxy#2] -- vbuz1=vbuc1 - lda #PROGRESS_X - sta.z cputsxy.x - jsr cputsxy - // display_progress_line::@return - // } // [2180] return rts } @@ -14497,22 +13935,20 @@ display_progress_line: { * - 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($ce) struct $2 * fopen(__zp($d2) const char *path, const char *mode) +// __zp($b1) struct $2 * fopen(__zp($b5) const char *path, const char *mode) fopen: { - .label fopen__4 = $cd - .label fopen__9 = $eb - .label fopen__15 = $b6 - .label fopen__26 = $5d - .label fopen__30 = $ce - .label cbm_k_setnam1_fopen__0 = $54 - .label stream = $ce - .label pathtoken = $d2 - .label pathpos = $e6 - .label pathcmp = $bb - .label path = $d2 - .label num = $f0 - .label cbm_k_readst1_return = $b6 - .label return = $ce + .label fopen__26 = $4b + .label fopen__28 = $f1 + .label fopen__30 = $b1 + .label cbm_k_setnam1_fopen__0 = $43 + .label stream = $b1 + .label pathtoken = $b5 + .label pathpos_1 = $e4 + .label pathtoken_1 = $f6 + .label path = $b5 + // Parse path + .label pathstep = $e7 + .label return = $b1 // unsigned char sp = __stdio_filecount // [2182] fopen::sp#0 = __stdio_filecount -- vbum1=vbum2 lda __stdio_filecount @@ -14530,10 +13966,10 @@ fopen: { ora #>$8000 sta.z stream+1 // char pathpos = sp * __STDIO_FILECOUNT - // [2185] fopen::pathpos#0 = fopen::sp#0 << 1 -- vbuz1=vbum2_rol_1 + // [2185] fopen::pathpos#0 = fopen::sp#0 << 1 -- vbum1=vbum2_rol_1 lda sp asl - sta.z pathpos + sta pathpos // __logical = 0 // [2186] ((char *)&__stdio_file+$40)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 lda #0 @@ -14545,22 +13981,22 @@ fopen: { // __channel = 0 // [2188] ((char *)&__stdio_file+$44)[fopen::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 sta __stdio_file+$44,y - // [2189] fopen::pathtoken#22 = fopen::pathtoken#0 -- pbum1=pbuz2 + // [2189] fopen::pathtoken#22 = fopen::pathtoken#0 -- pbuz1=pbuz2 lda.z pathtoken - sta pathtoken_1 + sta.z pathtoken_1 lda.z pathtoken+1 - sta pathtoken_1+1 - // [2190] fopen::pathpos#21 = fopen::pathpos#0 -- vbum1=vbuz2 - lda.z pathpos - sta pathpos_1 + sta.z pathtoken_1+1 + // [2190] fopen::pathpos#21 = fopen::pathpos#0 -- vbuz1=vbum2 + lda pathpos + sta.z pathpos_1 // [2191] phi from fopen to fopen::@8 [phi:fopen->fopen::@8] - // [2191] phi fopen::num#10 = 0 [phi:fopen->fopen::@8#0] -- vbuz1=vbuc1 - lda #0 - sta.z num + // [2191] phi fopen::num#10 = 0 [phi:fopen->fopen::@8#0] -- vbuxx=vbuc1 + ldx #0 // [2191] phi fopen::pathpos#10 = fopen::pathpos#21 [phi:fopen->fopen::@8#1] -- register_copy // [2191] phi fopen::path#10 = fopen::pathtoken#0 [phi:fopen->fopen::@8#2] -- register_copy - // [2191] phi fopen::pathstep#10 = 0 [phi:fopen->fopen::@8#3] -- vbum1=vbuc1 - sta pathstep + // [2191] phi fopen::pathstep#10 = 0 [phi:fopen->fopen::@8#3] -- vbuz1=vbuc1 + txa + sta.z pathstep // [2191] phi fopen::pathtoken#10 = fopen::pathtoken#22 [phi:fopen->fopen::@8#4] -- register_copy // Iterate while path is not \0. // [2191] phi from fopen::@22 to fopen::@8 [phi:fopen::@22->fopen::@8] @@ -14572,48 +14008,34 @@ fopen: { // fopen::@8 __b8: // if (*pathtoken == ',' || *pathtoken == '\0') - // [2192] if(*fopen::pathtoken#10==',') goto fopen::@9 -- _deref_pbum1_eq_vbuc1_then_la1 - ldy pathtoken_1 - sty.z $fe - ldy pathtoken_1+1 - sty.z $ff + // [2192] if(*fopen::pathtoken#10==',') goto fopen::@9 -- _deref_pbuz1_eq_vbuc1_then_la1 + lda #',' ldy #0 - lda ($fe),y - cmp #',' + cmp (pathtoken_1),y bne !__b9+ jmp __b9 !__b9: // fopen::@33 - // [2193] if(*fopen::pathtoken#10=='@') goto fopen::@9 -- _deref_pbum1_eq_vbuc1_then_la1 - ldy pathtoken_1 - sty.z $fe - ldy pathtoken_1+1 - sty.z $ff - ldy #0 - lda ($fe),y - cmp #'@' + // [2193] if(*fopen::pathtoken#10=='@') goto fopen::@9 -- _deref_pbuz1_eq_vbuc1_then_la1 + lda #'@' + cmp (pathtoken_1),y bne !__b9+ jmp __b9 !__b9: // fopen::@23 // if (pathstep == 0) - // [2194] if(fopen::pathstep#10!=0) goto fopen::@10 -- vbum1_neq_0_then_la1 - lda pathstep + // [2194] if(fopen::pathstep#10!=0) goto fopen::@10 -- vbuz1_neq_0_then_la1 + lda.z pathstep bne __b10 // fopen::@24 // __stdio_file.filename[pathpos] = *pathtoken - // [2195] ((char *)&__stdio_file)[fopen::pathpos#10] = *fopen::pathtoken#10 -- pbuc1_derefidx_vbum1=_deref_pbum2 - ldy pathtoken_1 - sty.z $fe - ldy pathtoken_1+1 - sty.z $ff - ldy #0 - lda ($fe),y - ldy pathpos_1 + // [2195] ((char *)&__stdio_file)[fopen::pathpos#10] = *fopen::pathtoken#10 -- pbuc1_derefidx_vbuz1=_deref_pbuz2 + lda (pathtoken_1),y + ldy.z pathpos_1 sta __stdio_file,y // pathpos++; - // [2196] fopen::pathpos#1 = ++ fopen::pathpos#10 -- vbum1=_inc_vbum1 - inc pathpos_1 + // [2196] fopen::pathpos#1 = ++ fopen::pathpos#10 -- vbuz1=_inc_vbuz1 + inc.z pathpos_1 // [2197] phi from fopen::@12 fopen::@23 fopen::@24 to fopen::@10 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10] // [2197] phi fopen::num#13 = fopen::num#15 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#0] -- register_copy // [2197] phi fopen::pathpos#7 = fopen::pathpos#10 [phi:fopen::@12/fopen::@23/fopen::@24->fopen::@10#1] -- register_copy @@ -14622,29 +14044,25 @@ fopen: { // fopen::@10 __b10: // pathtoken++; - // [2198] fopen::pathtoken#1 = ++ fopen::pathtoken#10 -- pbum1=_inc_pbum1 - inc pathtoken_1 + // [2198] fopen::pathtoken#1 = ++ fopen::pathtoken#10 -- pbuz1=_inc_pbuz1 + inc.z pathtoken_1 bne !+ - inc pathtoken_1+1 + inc.z pathtoken_1+1 !: // fopen::@22 // pathtoken - 1 - // [2199] fopen::$28 = fopen::pathtoken#1 - 1 -- pbum1=pbum2_minus_1 - lda pathtoken_1 + // [2199] fopen::$28 = fopen::pathtoken#1 - 1 -- pbuz1=pbuz2_minus_1 + lda.z pathtoken_1 sec sbc #1 - sta fopen__28 - lda pathtoken_1+1 + sta.z fopen__28 + lda.z pathtoken_1+1 sbc #0 - sta fopen__28+1 + sta.z fopen__28+1 // while (*(pathtoken - 1)) - // [2200] if(0!=*fopen::$28) goto fopen::@8 -- 0_neq__deref_pbum1_then_la1 - ldy fopen__28 - sty.z $fe - tay - sty.z $ff + // [2200] if(0!=*fopen::$28) goto fopen::@8 -- 0_neq__deref_pbuz1_then_la1 ldy #0 - lda ($fe),y + lda (fopen__28),y cmp #0 bne __b8 // fopen::@26 @@ -14660,12 +14078,11 @@ fopen: { bne __b1 // fopen::@27 // __stdio_filecount+1 - // [2203] fopen::$4 = __stdio_filecount + 1 -- vbuz1=vbum2_plus_1 + // [2203] fopen::$4 = __stdio_filecount + 1 -- vbuaa=vbum1_plus_1 lda __stdio_filecount inc - sta.z fopen__4 // __logical = __stdio_filecount+1 - // [2204] ((char *)&__stdio_file+$40)[fopen::sp#0] = fopen::$4 -- pbuc1_derefidx_vbum1=vbuz2 + // [2204] ((char *)&__stdio_file+$40)[fopen::sp#0] = fopen::$4 -- pbuc1_derefidx_vbum1=vbuaa sta __stdio_file+$40,y // fopen::@1 __b1: @@ -14690,19 +14107,18 @@ fopen: { bne __b3 // fopen::@6 // __stdio_filecount+2 - // [2208] fopen::$9 = __stdio_filecount + 2 -- vbuz1=vbum2_plus_2 + // [2208] fopen::$9 = __stdio_filecount + 2 -- vbuaa=vbum1_plus_2 lda __stdio_filecount clc adc #2 - sta.z fopen__9 // __channel = __stdio_filecount+2 - // [2209] ((char *)&__stdio_file+$44)[fopen::sp#0] = fopen::$9 -- pbuc1_derefidx_vbum1=vbuz2 + // [2209] ((char *)&__stdio_file+$44)[fopen::sp#0] = fopen::$9 -- pbuc1_derefidx_vbum1=vbuaa sta __stdio_file+$44,y // fopen::@3 __b3: // __filename - // [2210] fopen::$11 = (char *)&__stdio_file + fopen::pathpos#0 -- pbum1=pbuc1_plus_vbuz2 - lda.z pathpos + // [2210] fopen::$11 = (char *)&__stdio_file + fopen::pathpos#0 -- pbum1=pbuc1_plus_vbum2 + lda pathpos clc adc #<__stdio_file sta fopen__11 @@ -14767,8 +14183,7 @@ fopen: { jsr CBM_READST sta cbm_k_readst1_status // return status; - // [2225] fopen::cbm_k_readst1_return#0 = fopen::cbm_k_readst1_status -- vbuz1=vbum2 - sta.z cbm_k_readst1_return + // [2225] fopen::cbm_k_readst1_return#0 = fopen::cbm_k_readst1_status -- vbuaa=vbum1 // fopen::cbm_k_readst1_@return // } // [2226] fopen::cbm_k_readst1_return#1 = fopen::cbm_k_readst1_return#0 @@ -14776,8 +14191,7 @@ fopen: { // cbm_k_readst() // [2227] fopen::$15 = fopen::cbm_k_readst1_return#1 // __status = cbm_k_readst() - // [2228] ((char *)&__stdio_file+$46)[fopen::sp#0] = fopen::$15 -- pbuc1_derefidx_vbum1=vbuz2 - lda.z fopen__15 + // [2228] ((char *)&__stdio_file+$46)[fopen::sp#0] = fopen::$15 -- pbuc1_derefidx_vbum1=vbuaa ldy sp sta __stdio_file+$46,y // ferror(stream) @@ -14823,22 +14237,22 @@ fopen: { // fopen::@9 __b9: // if (pathstep > 0) - // [2240] if(fopen::pathstep#10>0) goto fopen::@11 -- vbum1_gt_0_then_la1 - lda pathstep + // [2240] if(fopen::pathstep#10>0) goto fopen::@11 -- vbuz1_gt_0_then_la1 + lda.z pathstep bne __b11 // fopen::@25 // __stdio_file.filename[pathpos] = '\0' - // [2241] ((char *)&__stdio_file)[fopen::pathpos#10] = '@' -- pbuc1_derefidx_vbum1=vbuc2 + // [2241] ((char *)&__stdio_file)[fopen::pathpos#10] = '@' -- pbuc1_derefidx_vbuz1=vbuc2 lda #'@' - ldy pathpos_1 + ldy.z pathpos_1 sta __stdio_file,y // path = pathtoken + 1 - // [2242] fopen::path#0 = fopen::pathtoken#10 + 1 -- pbuz1=pbum2_plus_1 + // [2242] fopen::path#0 = fopen::pathtoken#10 + 1 -- pbuz1=pbuz2_plus_1 clc - lda pathtoken_1 + lda.z pathtoken_1 adc #1 sta.z path - lda pathtoken_1+1 + lda.z pathtoken_1+1 adc #0 sta.z path+1 // [2243] 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] @@ -14847,34 +14261,34 @@ fopen: { // fopen::@12 __b12: // pathstep++; - // [2244] fopen::pathstep#1 = ++ fopen::pathstep#10 -- vbum1=_inc_vbum1 - inc pathstep + // [2244] fopen::pathstep#1 = ++ fopen::pathstep#10 -- vbuz1=_inc_vbuz1 + inc.z pathstep jmp __b10 // fopen::@11 __b11: // char pathcmp = *path - // [2245] fopen::pathcmp#0 = *fopen::path#10 -- vbuz1=_deref_pbuz2 + // [2245] fopen::pathcmp#0 = *fopen::path#10 -- vbum1=_deref_pbuz2 ldy #0 lda (path),y - sta.z pathcmp + sta pathcmp // case 'D': - // [2246] if(fopen::pathcmp#0=='D') goto fopen::@13 -- vbuz1_eq_vbuc1_then_la1 + // [2246] if(fopen::pathcmp#0=='D') goto fopen::@13 -- vbum1_eq_vbuc1_then_la1 lda #'D' - cmp.z pathcmp + cmp pathcmp beq __b13 // fopen::@20 // case 'L': - // [2247] if(fopen::pathcmp#0=='L') goto fopen::@13 -- vbuz1_eq_vbuc1_then_la1 + // [2247] if(fopen::pathcmp#0=='L') goto fopen::@13 -- vbum1_eq_vbuc1_then_la1 lda #'L' - cmp.z pathcmp + cmp pathcmp beq __b13 // fopen::@21 // case 'C': // num = (char)atoi(path + 1); // path = pathtoken + 1; - // [2248] if(fopen::pathcmp#0=='C') goto fopen::@13 -- vbuz1_eq_vbuc1_then_la1 + // [2248] if(fopen::pathcmp#0=='C') goto fopen::@13 -- vbum1_eq_vbuc1_then_la1 lda #'C' - cmp.z pathcmp + cmp pathcmp beq __b13 // [2249] phi from fopen::@21 fopen::@30 to fopen::@14 [phi:fopen::@21/fopen::@30->fopen::@14] // [2249] phi fopen::path#16 = fopen::path#10 [phi:fopen::@21/fopen::@30->fopen::@14#0] -- register_copy @@ -14884,47 +14298,47 @@ fopen: { // case 'L': // __logical = num; // break; - // [2250] if(fopen::pathcmp#0=='L') goto fopen::@17 -- vbuz1_eq_vbuc1_then_la1 + // [2250] if(fopen::pathcmp#0=='L') goto fopen::@17 -- vbum1_eq_vbuc1_then_la1 lda #'L' - cmp.z pathcmp + cmp pathcmp beq __b17 // fopen::@15 // case 'D': // __device = num; // break; - // [2251] if(fopen::pathcmp#0=='D') goto fopen::@18 -- vbuz1_eq_vbuc1_then_la1 + // [2251] if(fopen::pathcmp#0=='D') goto fopen::@18 -- vbum1_eq_vbuc1_then_la1 lda #'D' - cmp.z pathcmp + cmp pathcmp beq __b18 // fopen::@16 // case 'C': // __channel = num; // break; - // [2252] if(fopen::pathcmp#0!='C') goto fopen::@12 -- vbuz1_neq_vbuc1_then_la1 + // [2252] if(fopen::pathcmp#0!='C') goto fopen::@12 -- vbum1_neq_vbuc1_then_la1 lda #'C' - cmp.z pathcmp + cmp pathcmp bne __b12 // fopen::@19 // __channel = num - // [2253] ((char *)&__stdio_file+$44)[fopen::sp#0] = fopen::num#2 -- pbuc1_derefidx_vbum1=vbuz2 - lda.z num + // [2253] ((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 - // [2254] ((char *)&__stdio_file+$42)[fopen::sp#0] = fopen::num#2 -- pbuc1_derefidx_vbum1=vbuz2 - lda.z num + // [2254] ((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 - // [2255] ((char *)&__stdio_file+$40)[fopen::sp#0] = fopen::num#2 -- pbuc1_derefidx_vbum1=vbuz2 - lda.z num + // [2255] ((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 @@ -14944,32 +14358,29 @@ fopen: { // fopen::@30 // [2259] fopen::$26 = atoi::return#3 // num = (char)atoi(path + 1) - // [2260] fopen::num#1 = (char)fopen::$26 -- vbuz1=_byte_vwsz2 + // [2260] fopen::num#1 = (char)fopen::$26 -- vbuxx=_byte_vwsz1 lda.z fopen__26 - sta.z num + tax // path = pathtoken + 1 - // [2261] fopen::path#1 = fopen::pathtoken#10 + 1 -- pbuz1=pbum2_plus_1 + // [2261] fopen::path#1 = fopen::pathtoken#10 + 1 -- pbuz1=pbuz2_plus_1 clc - lda pathtoken_1 + lda.z pathtoken_1 adc #1 sta.z path - lda pathtoken_1+1 + lda.z pathtoken_1+1 adc #0 sta.z path+1 jmp __b14 .segment Data fopen__11: .word 0 .label fopen__16 = ferror.return - fopen__28: .word 0 cbm_k_setnam1_filename: .word 0 cbm_k_setnam1_filename_len: .byte 0 cbm_k_readst1_status: .byte 0 cbm_k_close1_channel: .byte 0 sp: .byte 0 - .label pathpos_1 = main.check_status_smc9_main__0 - pathtoken_1: .word 0 - // Parse path - .label pathstep = main.check_status_vera2_main__0 + pathpos: .byte 0 + pathcmp: .byte 0 } .segment Code // fgets @@ -14982,34 +14393,29 @@ fopen: { * @param filename Name of the file to be loaded. * @return ptr the pointer advanced to the point where the stream ends. */ -// __zp($b1) unsigned int fgets(__zp($b8) char *ptr, __zp($d0) unsigned int size, __zp($ee) struct $2 *stream) +// __zp($70) unsigned int fgets(__zp($77) char *ptr, __zp($b3) unsigned int size, __zp($c6) struct $2 *stream) fgets: { - .label fgets__1 = $eb - .label fgets__8 = $b6 - .label fgets__9 = $bb - .label fgets__13 = $ba - .label cbm_k_chkin1_status = $f7 - .label cbm_k_readst1_status = $f8 - .label cbm_k_readst2_status = $bd - .label sp = $cd - .label cbm_k_readst1_return = $eb - .label return = $b1 - .label bytes = $73 - .label cbm_k_readst2_return = $b6 - .label read = $b1 - .label ptr = $b8 - .label remaining = $c4 - .label stream = $ee - .label size = $d0 + .label cbm_k_chkin1_channel = $de + .label cbm_k_chkin1_status = $d8 + .label cbm_k_readst1_status = $d9 + .label cbm_k_readst2_status = $79 + .label sp = $b0 + .label return = $70 + .label bytes = $5d + .label read = $70 + .label ptr = $77 + .label remaining = $a9 + .label stream = $c6 + .label size = $b3 // unsigned char sp = (unsigned char)stream // [2263] fgets::sp#0 = (char)fgets::stream#3 -- vbuz1=_byte_pssz2 lda.z stream sta.z sp // cbm_k_chkin(__logical) - // [2264] fgets::cbm_k_chkin1_channel = ((char *)&__stdio_file+$40)[fgets::sp#0] -- vbum1=pbuc1_derefidx_vbuz2 + // [2264] fgets::cbm_k_chkin1_channel = ((char *)&__stdio_file+$40)[fgets::sp#0] -- vbuz1=pbuc1_derefidx_vbuz2 tay lda __stdio_file+$40,y - sta cbm_k_chkin1_channel + sta.z cbm_k_chkin1_channel // fgets::cbm_k_chkin1 // char status // [2265] fgets::cbm_k_chkin1_status = 0 -- vbuz1=vbuc1 @@ -15030,8 +14436,7 @@ fgets: { jsr CBM_READST sta cbm_k_readst1_status // return status; - // [2269] fgets::cbm_k_readst1_return#0 = fgets::cbm_k_readst1_status -- vbuz1=vbuz2 - sta.z cbm_k_readst1_return + // [2269] fgets::cbm_k_readst1_return#0 = fgets::cbm_k_readst1_status -- vbuaa=vbuz1 // fgets::cbm_k_readst1_@return // } // [2270] fgets::cbm_k_readst1_return#1 = fgets::cbm_k_readst1_return#0 @@ -15039,8 +14444,7 @@ fgets: { // cbm_k_readst() // [2271] fgets::$1 = fgets::cbm_k_readst1_return#1 // __status = cbm_k_readst() - // [2272] ((char *)&__stdio_file+$46)[fgets::sp#0] = fgets::$1 -- pbuc1_derefidx_vbuz1=vbuz2 - lda.z fgets__1 + // [2272] ((char *)&__stdio_file+$46)[fgets::sp#0] = fgets::$1 -- pbuc1_derefidx_vbuz1=vbuaa ldy.z sp sta __stdio_file+$46,y // if (__status) @@ -15129,8 +14533,7 @@ fgets: { jsr CBM_READST sta cbm_k_readst2_status // return status; - // [2288] fgets::cbm_k_readst2_return#0 = fgets::cbm_k_readst2_status -- vbuz1=vbuz2 - sta.z cbm_k_readst2_return + // [2288] fgets::cbm_k_readst2_return#0 = fgets::cbm_k_readst2_status -- vbuaa=vbuz1 // fgets::cbm_k_readst2_@return // } // [2289] fgets::cbm_k_readst2_return#1 = fgets::cbm_k_readst2_return#0 @@ -15138,17 +14541,16 @@ fgets: { // cbm_k_readst() // [2290] fgets::$8 = fgets::cbm_k_readst2_return#1 // __status = cbm_k_readst() - // [2291] ((char *)&__stdio_file+$46)[fgets::sp#0] = fgets::$8 -- pbuc1_derefidx_vbuz1=vbuz2 - lda.z fgets__8 + // [2291] ((char *)&__stdio_file+$46)[fgets::sp#0] = fgets::$8 -- pbuc1_derefidx_vbuz1=vbuaa ldy.z sp sta __stdio_file+$46,y // __status & 0xBF - // [2292] fgets::$9 = ((char *)&__stdio_file+$46)[fgets::sp#0] & $bf -- vbuz1=pbuc1_derefidx_vbuz2_band_vbuc2 + // [2292] fgets::$9 = ((char *)&__stdio_file+$46)[fgets::sp#0] & $bf -- vbuaa=pbuc1_derefidx_vbuz1_band_vbuc2 lda #$bf and __stdio_file+$46,y - sta.z fgets__9 // if (__status & 0xBF) - // [2293] if(0==fgets::$9) goto fgets::@5 -- 0_eq_vbuz1_then_la1 + // [2293] if(0==fgets::$9) goto fgets::@5 -- 0_eq_vbuaa_then_la1 + cmp #0 beq __b5 jmp __b8 // fgets::@5 @@ -15183,12 +14585,10 @@ fgets: { adc.z bytes+1 sta.z ptr+1 // BYTE1(ptr) - // [2297] fgets::$13 = byte1 fgets::ptr#0 -- vbuz1=_byte1_pbuz2 - sta.z fgets__13 + // [2297] fgets::$13 = byte1 fgets::ptr#0 -- vbuaa=_byte1_pbuz1 // if (BYTE1(ptr) == 0xC0) - // [2298] if(fgets::$13!=$c0) goto fgets::@7 -- vbuz1_neq_vbuc1_then_la1 - lda #$c0 - cmp.z fgets__13 + // [2298] if(fgets::$13!=$c0) goto fgets::@7 -- vbuaa_neq_vbuc1_then_la1 + cmp #$c0 bne __b7 // fgets::@10 // ptr -= 0x2000 @@ -15281,10 +14681,7 @@ fgets: { // bytes = cx16_k_macptr(0, ptr) // [2315] fgets::bytes#1 = cx16_k_macptr::return#2 jmp __b15 - .segment Data - cbm_k_chkin1_channel: .byte 0 } -.segment Code // fclose /** * @brief Close a file. @@ -15294,21 +14691,15 @@ fgets: { * - 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($5f) struct $2 *stream) +// int fclose(__zp($4d) struct $2 *stream) fclose: { - .label fclose__1 = $66 - .label fclose__4 = $3c - .label fclose__6 = $ba - .label sp = $ba - .label cbm_k_readst1_return = $66 - .label cbm_k_readst2_return = $3c - .label stream = $5f + .label stream = $4d // unsigned char sp = (unsigned char)stream - // [2317] fclose::sp#0 = (char)fclose::stream#2 -- vbuz1=_byte_pssz2 + // [2317] fclose::sp#0 = (char)fclose::stream#2 -- vbum1=_byte_pssz2 lda.z stream - sta.z sp + sta sp // cbm_k_chkin(__logical) - // [2318] fclose::cbm_k_chkin1_channel = ((char *)&__stdio_file+$40)[fclose::sp#0] -- vbum1=pbuc1_derefidx_vbuz2 + // [2318] 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 @@ -15332,8 +14723,7 @@ fclose: { jsr CBM_READST sta cbm_k_readst1_status // return status; - // [2323] fclose::cbm_k_readst1_return#0 = fclose::cbm_k_readst1_status -- vbuz1=vbum2 - sta.z cbm_k_readst1_return + // [2323] fclose::cbm_k_readst1_return#0 = fclose::cbm_k_readst1_status -- vbuaa=vbum1 // fclose::cbm_k_readst1_@return // } // [2324] fclose::cbm_k_readst1_return#1 = fclose::cbm_k_readst1_return#0 @@ -15341,12 +14731,11 @@ fclose: { // cbm_k_readst() // [2325] fclose::$1 = fclose::cbm_k_readst1_return#1 // __status = cbm_k_readst() - // [2326] ((char *)&__stdio_file+$46)[fclose::sp#0] = fclose::$1 -- pbuc1_derefidx_vbuz1=vbuz2 - lda.z fclose__1 - ldy.z sp + // [2326] ((char *)&__stdio_file+$46)[fclose::sp#0] = fclose::$1 -- pbuc1_derefidx_vbum1=vbuaa + ldy sp sta __stdio_file+$46,y // if (__status) - // [2327] if(0==((char *)&__stdio_file+$46)[fclose::sp#0]) goto fclose::@1 -- 0_eq_pbuc1_derefidx_vbuz1_then_la1 + // [2327] 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 @@ -15357,8 +14746,8 @@ fclose: { // fclose::@1 __b1: // cbm_k_close(__logical) - // [2329] fclose::cbm_k_close1_channel = ((char *)&__stdio_file+$40)[fclose::sp#0] -- vbum1=pbuc1_derefidx_vbuz2 - ldy.z sp + // [2329] 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 // fclose::cbm_k_close1 @@ -15375,8 +14764,7 @@ fclose: { jsr CBM_READST sta cbm_k_readst2_status // return status; - // [2333] fclose::cbm_k_readst2_return#0 = fclose::cbm_k_readst2_status -- vbuz1=vbum2 - sta.z cbm_k_readst2_return + // [2333] fclose::cbm_k_readst2_return#0 = fclose::cbm_k_readst2_status -- vbuaa=vbum1 // fclose::cbm_k_readst2_@return // } // [2334] fclose::cbm_k_readst2_return#1 = fclose::cbm_k_readst2_return#0 @@ -15384,12 +14772,11 @@ fclose: { // cbm_k_readst() // [2335] fclose::$4 = fclose::cbm_k_readst2_return#1 // __status = cbm_k_readst() - // [2336] ((char *)&__stdio_file+$46)[fclose::sp#0] = fclose::$4 -- pbuc1_derefidx_vbuz1=vbuz2 - lda.z fclose__4 - ldy.z sp + // [2336] ((char *)&__stdio_file+$46)[fclose::sp#0] = fclose::$4 -- pbuc1_derefidx_vbum1=vbuaa + ldy sp sta __stdio_file+$46,y // if (__status) - // [2337] if(0==((char *)&__stdio_file+$46)[fclose::sp#0]) goto fclose::@2 -- 0_eq_pbuc1_derefidx_vbuz1_then_la1 + // [2337] 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 @@ -15397,23 +14784,24 @@ fclose: { // fclose::@2 __b2: // __logical = 0 - // [2338] ((char *)&__stdio_file+$40)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [2338] ((char *)&__stdio_file+$40)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 lda #0 - ldy.z sp + ldy sp sta __stdio_file+$40,y // __device = 0 - // [2339] ((char *)&__stdio_file+$42)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [2339] ((char *)&__stdio_file+$42)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 sta __stdio_file+$42,y // __channel = 0 - // [2340] ((char *)&__stdio_file+$44)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbuz1=vbuc2 + // [2340] ((char *)&__stdio_file+$44)[fclose::sp#0] = 0 -- pbuc1_derefidx_vbum1=vbuc2 sta __stdio_file+$44,y // __filename - // [2341] fclose::$6 = fclose::sp#0 << 1 -- vbuz1=vbuz1_rol_1 - asl.z fclose__6 + // [2341] fclose::$6 = fclose::sp#0 << 1 -- vbuaa=vbum1_rol_1 + tya + asl // *__filename = '\0' - // [2342] ((char *)&__stdio_file)[fclose::$6] = '@' -- pbuc1_derefidx_vbuz1=vbuc2 + // [2342] ((char *)&__stdio_file)[fclose::$6] = '@' -- pbuc1_derefidx_vbuaa=vbuc2 + tay lda #'@' - ldy.z fclose__6 sta __stdio_file,y // __stdio_filecount--; // [2343] __stdio_filecount = -- __stdio_filecount -- vbum1=_dec_vbum1 @@ -15425,15 +14813,16 @@ fclose: { cbm_k_readst1_status: .byte 0 cbm_k_close1_channel: .byte 0 cbm_k_readst2_status: .byte 0 + sp: .byte 0 } .segment Code // strlen // Computes the length of the string str up to but not including the terminating null character. -// __zp($54) unsigned int strlen(__zp($50) char *str) +// __zp($43) unsigned int strlen(__zp($40) char *str) strlen: { - .label return = $54 - .label len = $54 - .label str = $50 + .label return = $43 + .label len = $43 + .label str = $40 // [2345] phi from strlen to strlen::@1 [phi:strlen->strlen::@1] // [2345] phi strlen::len#2 = 0 [phi:strlen->strlen::@1#0] -- vwuz1=vwuc1 lda #<0 @@ -15473,12 +14862,12 @@ strlen: { } // printf_padding // Print a padding char a number of times -// void printf_padding(__zp($ce) void (*putc)(char), __zp($68) char pad, __zp($3c) char length) +// void printf_padding(__zp($b1) void (*putc)(char), __zp($53) char pad, __zp($52) char length) printf_padding: { - .label i = $52 - .label putc = $ce - .label length = $3c - .label pad = $68 + .label i = $42 + .label putc = $b1 + .label length = $52 + .label pad = $53 // [2351] phi from printf_padding to printf_padding::@1 [phi:printf_padding->printf_padding::@1] // [2351] phi printf_padding::i#2 = 0 [phi:printf_padding->printf_padding::@1#0] -- vbuz1=vbuc1 lda #0 @@ -15521,39 +14910,31 @@ printf_padding: { // - 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(__zp($30) char value, __zp($54) char *buffer, __zp($61) char radix) +// void uctoa(__register(X) char value, __zp($43) char *buffer, __register(Y) char radix) uctoa: { - .label uctoa__4 = $66 - .label digit_value = $3c - .label buffer = $54 - .label digit = $62 - .label value = $30 - .label radix = $61 - .label started = $69 - .label max_digits = $b3 - .label digit_values = $b4 + .label buffer = $43 + .label digit = $4f + .label started = $54 + .label max_digits = $72 + .label digit_values = $73 // if(radix==DECIMAL) - // [2358] if(uctoa::radix#0==DECIMAL) goto uctoa::@1 -- vbuz1_eq_vbuc1_then_la1 - lda #DECIMAL - cmp.z radix + // [2358] if(uctoa::radix#0==DECIMAL) goto uctoa::@1 -- vbuyy_eq_vbuc1_then_la1 + cpy #DECIMAL beq __b2 // uctoa::@2 // if(radix==HEXADECIMAL) - // [2359] if(uctoa::radix#0==HEXADECIMAL) goto uctoa::@1 -- vbuz1_eq_vbuc1_then_la1 - lda #HEXADECIMAL - cmp.z radix + // [2359] if(uctoa::radix#0==HEXADECIMAL) goto uctoa::@1 -- vbuyy_eq_vbuc1_then_la1 + cpy #HEXADECIMAL beq __b3 // uctoa::@3 // if(radix==OCTAL) - // [2360] if(uctoa::radix#0==OCTAL) goto uctoa::@1 -- vbuz1_eq_vbuc1_then_la1 - lda #OCTAL - cmp.z radix + // [2360] if(uctoa::radix#0==OCTAL) goto uctoa::@1 -- vbuyy_eq_vbuc1_then_la1 + cpy #OCTAL beq __b4 // uctoa::@4 // if(radix==BINARY) - // [2361] if(uctoa::radix#0==BINARY) goto uctoa::@1 -- vbuz1_eq_vbuc1_then_la1 - lda #BINARY - cmp.z radix + // [2361] if(uctoa::radix#0==BINARY) goto uctoa::@1 -- vbuyy_eq_vbuc1_then_la1 + cpy #BINARY beq __b5 // uctoa::@5 // *buffer++ = 'e' @@ -15635,20 +15016,20 @@ uctoa: { // uctoa::@6 __b6: // max_digits-1 - // [2369] uctoa::$4 = uctoa::max_digits#7 - 1 -- vbuz1=vbuz2_minus_1 - ldx.z max_digits - dex - stx.z uctoa__4 + // [2369] uctoa::$4 = uctoa::max_digits#7 - 1 -- vbuaa=vbuz1_minus_1 + lda.z max_digits + sec + sbc #1 // for( char digit=0; digit= digit_value) // [2375] if(0!=uctoa::started#2) goto uctoa::@10 -- 0_neq_vbuz1_then_la1 lda.z started bne __b10 // uctoa::@12 - // [2376] if(uctoa::value#2>=uctoa::digit_value#0) goto uctoa::@10 -- vbuz1_ge_vbuz2_then_la1 - lda.z value - cmp.z digit_value + // [2376] if(uctoa::value#2>=uctoa::digit_value#0) goto uctoa::@10 -- vbuxx_ge_vbuyy_then_la1 + sty.z $ff + cpx.z $ff bcs __b10 // [2377] phi from uctoa::@12 to uctoa::@9 [phi:uctoa::@12->uctoa::@9] // [2377] phi uctoa::buffer#14 = uctoa::buffer#11 [phi:uctoa::@12->uctoa::@9#0] -- register_copy @@ -15703,7 +15084,8 @@ uctoa: { lda.z buffer+1 sta.z uctoa_append.buffer+1 // [2380] uctoa_append::value#0 = uctoa::value#2 - // [2381] uctoa_append::sub#0 = uctoa::digit_value#0 + // [2381] uctoa_append::sub#0 = uctoa::digit_value#0 -- vbuz1=vbuyy + sty.z uctoa_append.sub // [2382] call uctoa_append // [2788] phi from uctoa::@10 to uctoa_append [phi:uctoa::@10->uctoa_append] jsr uctoa_append @@ -15729,18 +15111,16 @@ uctoa: { // 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($5b) void (*putc)(char), __zp($cb) char buffer_sign, char *buffer_digits, __zp($36) char format_min_length, char format_justify_left, char format_sign_always, __zp($e2) char format_zero_padding, char format_upper_case, char format_radix) +// void printf_number_buffer(__zp($49) void (*putc)(char), __zp($c1) char buffer_sign, char *buffer_digits, __register(X) char format_min_length, char format_justify_left, char format_sign_always, __zp($be) char format_zero_padding, char format_upper_case, char format_radix) printf_number_buffer: { - .label printf_number_buffer__19 = $54 - .label buffer_sign = $cb - .label format_min_length = $36 - .label format_zero_padding = $e2 - .label putc = $5b - .label len = $da - .label padding = $da + .label printf_number_buffer__19 = $43 + .label buffer_sign = $c1 + .label format_zero_padding = $be + .label putc = $49 + .label padding = $bc // if(format.min_length) - // [2387] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- 0_eq_vbuz1_then_la1 - lda.z format_min_length + // [2387] if(0==printf_number_buffer::format_min_length#3) goto printf_number_buffer::@1 -- 0_eq_vbuxx_then_la1 + cpx #0 beq __b5 // [2388] phi from printf_number_buffer to printf_number_buffer::@5 [phi:printf_number_buffer->printf_number_buffer::@5] // printf_number_buffer::@5 @@ -15758,27 +15138,27 @@ printf_number_buffer: { // printf_number_buffer::@11 // [2391] printf_number_buffer::$19 = strlen::return#3 // signed char len = (signed char)strlen(buffer.digits) - // [2392] printf_number_buffer::len#0 = (signed char)printf_number_buffer::$19 -- vbsz1=_sbyte_vwuz2 + // [2392] 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.z len + ldy.z printf_number_buffer__19 // if(buffer.sign) // [2393] if(0==printf_number_buffer::buffer_sign#10) goto printf_number_buffer::@10 -- 0_eq_vbuz1_then_la1 lda.z buffer_sign beq __b10 // printf_number_buffer::@6 // len++; - // [2394] printf_number_buffer::len#1 = ++ printf_number_buffer::len#0 -- vbsz1=_inc_vbsz1 - inc.z len + // [2394] printf_number_buffer::len#1 = ++ printf_number_buffer::len#0 -- vbsyy=_inc_vbsyy + iny // [2395] 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] // [2395] 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 - // [2396] printf_number_buffer::padding#1 = (signed char)printf_number_buffer::format_min_length#3 - printf_number_buffer::len#2 -- vbsz1=vbsz2_minus_vbsz1 - lda.z format_min_length + // [2396] printf_number_buffer::padding#1 = (signed char)printf_number_buffer::format_min_length#3 - printf_number_buffer::len#2 -- vbsz1=vbsxx_minus_vbsyy + txa + sty.z $ff sec - sbc.z padding + sbc.z $ff sta.z padding // if(padding<0) // [2397] if(printf_number_buffer::padding#1>=0) goto printf_number_buffer::@15 -- vbsz1_ge_0_then_la1 @@ -15900,14 +15280,13 @@ printf_number_buffer: { * @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 rom_address_from_bank__1 = $56 - .label return = $56 - .label return_1 = $75 + .label rom_address_from_bank__1 = $45 + .label return = $45 + .label return_1 = $5f // ((unsigned long)(rom_bank)) << 14 - // [2418] rom_address_from_bank::$1 = (unsigned long)rom_address_from_bank::rom_bank#3 -- vduz1=_dword_vbum2 - lda rom_bank + // [2418] rom_address_from_bank::$1 = (unsigned long)rom_address_from_bank::rom_bank#3 -- vduz1=_dword_vbuaa sta.z rom_address_from_bank__1 lda #0 sta.z rom_address_from_bank__1+1 @@ -15930,52 +15309,40 @@ rom_address_from_bank: { // [2420] return rts .segment Data - .label rom_bank = main.check_status_rom1_main__0 .label return_2 = main.rom_file_modulo } .segment Code // rom_compare -// __zp($50) unsigned int rom_compare(__zp($e9) char bank_ram, __zp($7e) char *ptr_ram, __zp($56) unsigned long rom_compare_address, __zp($c8) unsigned int rom_compare_size) +// __zp($40) unsigned int rom_compare(__register(X) char bank_ram, __zp($66) char *ptr_ram, __zp($45) unsigned long rom_compare_address, __zp($ac) unsigned int rom_compare_size) rom_compare: { - .label rom_compare__5 = $53 - .label rom_bank1_rom_compare__0 = $65 - .label rom_bank1_rom_compare__1 = $dd - .label rom_bank1_rom_compare__2 = $e3 - .label rom_ptr1_rom_compare__0 = $6d - .label rom_ptr1_rom_compare__2 = $6d - .label bank_set_bram1_bank = $e9 - .label rom_bank1_bank_unshifted = $e3 - .label rom_bank1_return = $3c - .label rom_ptr1_return = $6d - .label ptr_rom = $6d - .label ptr_ram = $7e - .label compared_bytes = $79 + .label rom_bank1_rom_compare__2 = $bf + .label rom_ptr1_rom_compare__0 = $57 + .label rom_ptr1_rom_compare__2 = $57 + .label rom_bank1_bank_unshifted = $bf + .label rom_ptr1_return = $57 + .label ptr_rom = $57 + .label ptr_ram = $66 + .label compared_bytes = $63 /// Holds the amount of bytes actually verified between the ROM and the RAM. - .label equal_bytes = $50 - .label bank_ram = $e9 - .label rom_compare_address = $56 - .label return = $50 - .label rom_compare_size = $c8 + .label equal_bytes = $40 + .label rom_compare_address = $45 + .label return = $40 + .label rom_compare_size = $ac // rom_compare::bank_set_bram1 // BRAM = bank - // [2422] BRAM = rom_compare::bank_set_bram1_bank#0 -- vbuz1=vbuz2 - lda.z bank_set_bram1_bank - sta.z BRAM + // [2422] BRAM = rom_compare::bank_set_bram1_bank#0 -- vbuz1=vbuxx + stx.z BRAM // rom_compare::rom_bank1 // BYTE2(address) - // [2423] rom_compare::rom_bank1_$0 = byte2 rom_compare::rom_compare_address#3 -- vbuz1=_byte2_vduz2 + // [2423] rom_compare::rom_bank1_$0 = byte2 rom_compare::rom_compare_address#3 -- vbuaa=_byte2_vduz1 lda.z rom_compare_address+2 - sta.z rom_bank1_rom_compare__0 // BYTE1(address) - // [2424] rom_compare::rom_bank1_$1 = byte1 rom_compare::rom_compare_address#3 -- vbuz1=_byte1_vduz2 - lda.z rom_compare_address+1 - sta.z rom_bank1_rom_compare__1 + // [2424] rom_compare::rom_bank1_$1 = byte1 rom_compare::rom_compare_address#3 -- vbuxx=_byte1_vduz1 + ldx.z rom_compare_address+1 // MAKEWORD(BYTE2(address),BYTE1(address)) - // [2425] 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 + // [2425] rom_compare::rom_bank1_$2 = rom_compare::rom_bank1_$0 w= rom_compare::rom_bank1_$1 -- vwuz1=vbuaa_word_vbuxx sta.z rom_bank1_rom_compare__2+1 - lda.z rom_bank1_rom_compare__1 - sta.z rom_bank1_rom_compare__2 + stx.z rom_bank1_rom_compare__2 // unsigned int bank_unshifted = MAKEWORD(BYTE2(address),BYTE1(address)) << 2 // [2426] rom_compare::rom_bank1_bank_unshifted#0 = rom_compare::rom_bank1_$2 << 2 -- vwuz1=vwuz1_rol_2 asl.z rom_bank1_bank_unshifted @@ -15983,9 +15350,8 @@ rom_compare: { asl.z rom_bank1_bank_unshifted rol.z rom_bank1_bank_unshifted+1 // unsigned char bank = BYTE1(bank_unshifted) - // [2427] 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 + // [2427] 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 // [2428] rom_compare::rom_ptr1_$2 = (unsigned int)rom_compare::rom_compare_address#3 -- vwuz1=_word_vduz2 @@ -16011,9 +15377,8 @@ rom_compare: { sta.z rom_ptr1_return+1 // rom_compare::bank_set_brom1 // BROM = bank - // [2431] BROM = rom_compare::rom_bank1_return#0 -- vbuz1=vbuz2 - lda.z rom_bank1_return - sta.z BROM + // [2431] BROM = rom_compare::rom_bank1_return#0 -- vbuz1=vbuxx + stx.z BROM // [2432] rom_compare::ptr_rom#9 = (char *)rom_compare::rom_ptr1_return#0 // [2433] phi from rom_compare::bank_set_brom1 to rom_compare::@1 [phi:rom_compare::bank_set_brom1->rom_compare::@1] // [2433] phi rom_compare::equal_bytes#2 = 0 [phi:rom_compare::bank_set_brom1->rom_compare::@1#0] -- vwuz1=vwuc1 @@ -16045,18 +15410,17 @@ rom_compare: { __b2: // rom_byte_compare(ptr_rom, *ptr_ram) // [2436] rom_byte_compare::ptr_rom#0 = rom_compare::ptr_rom#2 - // [2437] rom_byte_compare::value#0 = *rom_compare::ptr_ram#4 -- vbuz1=_deref_pbuz2 + // [2437] rom_byte_compare::value#0 = *rom_compare::ptr_ram#4 -- vbuaa=_deref_pbuz1 ldy #0 lda (ptr_ram),y - sta.z rom_byte_compare.value // [2438] call rom_byte_compare jsr rom_byte_compare // [2439] rom_byte_compare::return#2 = rom_byte_compare::return#0 // rom_compare::@5 // [2440] rom_compare::$5 = rom_byte_compare::return#2 // if (rom_byte_compare(ptr_rom, *ptr_ram)) - // [2441] if(0==rom_compare::$5) goto rom_compare::@3 -- 0_eq_vbuz1_then_la1 - lda.z rom_compare__5 + // [2441] if(0==rom_compare::$5) goto rom_compare::@3 -- 0_eq_vbuaa_then_la1 + cmp #0 beq __b3 // rom_compare::@4 // equal_bytes++; @@ -16100,41 +15464,32 @@ rom_compare: { // - 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($31) unsigned long value, __zp($5f) char *buffer, __zp($e1) char radix) +// void ultoa(__zp($27) unsigned long value, __zp($4d) char *buffer, __register(X) char radix) ultoa: { - .label ultoa__4 = $65 - .label ultoa__10 = $3c - .label ultoa__11 = $dd - .label digit_value = $41 - .label buffer = $5f - .label digit = $63 - .label value = $31 - .label radix = $e1 - .label started = $6a - .label max_digits = $b7 - .label digit_values = $b1 + .label digit_value = $34 + .label buffer = $4d + .label digit = $50 + .label value = $27 + .label max_digits = $76 + .label digit_values = $70 // if(radix==DECIMAL) - // [2447] if(ultoa::radix#0==DECIMAL) goto ultoa::@1 -- vbuz1_eq_vbuc1_then_la1 - lda #DECIMAL - cmp.z radix + // [2447] if(ultoa::radix#0==DECIMAL) goto ultoa::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #DECIMAL beq __b2 // ultoa::@2 // if(radix==HEXADECIMAL) - // [2448] if(ultoa::radix#0==HEXADECIMAL) goto ultoa::@1 -- vbuz1_eq_vbuc1_then_la1 - lda #HEXADECIMAL - cmp.z radix + // [2448] if(ultoa::radix#0==HEXADECIMAL) goto ultoa::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #HEXADECIMAL beq __b3 // ultoa::@3 // if(radix==OCTAL) - // [2449] if(ultoa::radix#0==OCTAL) goto ultoa::@1 -- vbuz1_eq_vbuc1_then_la1 - lda #OCTAL - cmp.z radix + // [2449] if(ultoa::radix#0==OCTAL) goto ultoa::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #OCTAL beq __b4 // ultoa::@4 // if(radix==BINARY) - // [2450] if(ultoa::radix#0==BINARY) goto ultoa::@1 -- vbuz1_eq_vbuc1_then_la1 - lda #BINARY - cmp.z radix + // [2450] if(ultoa::radix#0==BINARY) goto ultoa::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #BINARY beq __b5 // ultoa::@5 // *buffer++ = 'e' @@ -16207,30 +15562,30 @@ ultoa: { sta.z buffer lda #>printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS sta.z buffer+1 - // [2457] phi ultoa::started#2 = 0 [phi:ultoa::@1->ultoa::@6#1] -- vbuz1=vbuc1 - lda #0 - sta.z started + // [2457] phi ultoa::started#2 = 0 [phi:ultoa::@1->ultoa::@6#1] -- vbuxx=vbuc1 + ldx #0 // [2457] phi ultoa::value#2 = ultoa::value#1 [phi:ultoa::@1->ultoa::@6#2] -- register_copy // [2457] phi ultoa::digit#2 = 0 [phi:ultoa::@1->ultoa::@6#3] -- vbuz1=vbuc1 + txa sta.z digit // ultoa::@6 __b6: // max_digits-1 - // [2458] ultoa::$4 = ultoa::max_digits#7 - 1 -- vbuz1=vbuz2_minus_1 - ldx.z max_digits - dex - stx.z ultoa__4 + // [2458] ultoa::$4 = ultoa::max_digits#7 - 1 -- vbuaa=vbuz1_minus_1 + lda.z max_digits + sec + sbc #1 // for( char digit=0; digit= digit_value) - // [2466] if(0!=ultoa::started#2) goto ultoa::@10 -- 0_neq_vbuz1_then_la1 - lda.z started + // [2466] if(0!=ultoa::started#2) goto ultoa::@10 -- 0_neq_vbuxx_then_la1 + cpx #0 bne __b10 // ultoa::@12 // [2467] if(ultoa::value#2>=ultoa::digit_value#0) goto ultoa::@10 -- vduz1_ge_vduz2_then_la1 @@ -16331,9 +15685,8 @@ ultoa: { !: // [2468] phi from ultoa::@11 to ultoa::@9 [phi:ultoa::@11->ultoa::@9] // [2468] phi ultoa::buffer#14 = ultoa::buffer#4 [phi:ultoa::@11->ultoa::@9#0] -- register_copy - // [2468] phi ultoa::started#4 = 1 [phi:ultoa::@11->ultoa::@9#1] -- vbuz1=vbuc1 - lda #1 - sta.z started + // [2468] phi ultoa::started#4 = 1 [phi:ultoa::@11->ultoa::@9#1] -- vbuxx=vbuc1 + ldx #1 // [2468] phi ultoa::value#6 = ultoa::value#0 [phi:ultoa::@11->ultoa::@9#2] -- register_copy jmp __b9 } @@ -16367,18 +15720,19 @@ ultoa: { * @param address The 22 bit ROM address. */ /* inline */ -// void rom_sector_erase(__mem() unsigned long address) +// void rom_sector_erase(__zp($e0) unsigned long address) rom_sector_erase: { - .label rom_ptr1_rom_sector_erase__0 = $3d - .label rom_ptr1_rom_sector_erase__2 = $3d - .label rom_ptr1_return = $3d - .label rom_chip_address = $6f + .label rom_ptr1_rom_sector_erase__0 = $30 + .label rom_ptr1_rom_sector_erase__2 = $30 + .label rom_ptr1_return = $30 + .label rom_chip_address = $59 + .label address = $e0 // rom_sector_erase::rom_ptr1 // (unsigned int)(address) & ROM_PTR_MASK - // [2478] rom_sector_erase::rom_ptr1_$2 = (unsigned int)rom_sector_erase::address#0 -- vwuz1=_word_vdum2 - lda address + // [2478] 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 address+1 + lda.z address+1 sta.z rom_ptr1_rom_sector_erase__2+1 // [2479] 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 @@ -16398,17 +15752,17 @@ rom_sector_erase: { sta.z rom_ptr1_return+1 // rom_sector_erase::@1 // unsigned long rom_chip_address = address & ROM_CHIP_MASK - // [2481] rom_sector_erase::rom_chip_address#0 = rom_sector_erase::address#0 & $380000 -- vduz1=vdum2_band_vduc1 - lda address + // [2481] 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 - lda address+1 + lda.z address+1 and #>$380000 sta.z rom_chip_address+1 - lda address+2 + lda.z address+2 and #<$380000>>$10 sta.z rom_chip_address+2 - lda address+3 + lda.z address+3 and #>$380000>>$10 sta.z rom_chip_address+3 // rom_unlock(rom_chip_address + 0x05555, 0x80) @@ -16427,29 +15781,29 @@ rom_sector_erase: { adc #0 sta.z rom_unlock.address+3 // [2483] call rom_unlock - // [2155] phi from rom_sector_erase::@1 to rom_unlock [phi:rom_sector_erase::@1->rom_unlock] - // [2155] phi rom_unlock::unlock_code#5 = $80 [phi:rom_sector_erase::@1->rom_unlock#0] -- vbuz1=vbuc1 + // [2159] phi from rom_sector_erase::@1 to rom_unlock [phi:rom_sector_erase::@1->rom_unlock] + // [2159] 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 - // [2155] phi rom_unlock::address#5 = rom_unlock::address#0 [phi:rom_sector_erase::@1->rom_unlock#1] -- register_copy + // [2159] 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) - // [2484] rom_unlock::address#1 = rom_sector_erase::address#0 -- vduz1=vdum2 - lda address + // [2484] rom_unlock::address#1 = rom_sector_erase::address#0 -- vduz1=vduz2 + lda.z address sta.z rom_unlock.address - lda address+1 + lda.z address+1 sta.z rom_unlock.address+1 - lda address+2 + lda.z address+2 sta.z rom_unlock.address+2 - lda address+3 + lda.z address+3 sta.z rom_unlock.address+3 // [2485] call rom_unlock - // [2155] phi from rom_sector_erase::@2 to rom_unlock [phi:rom_sector_erase::@2->rom_unlock] - // [2155] phi rom_unlock::unlock_code#5 = $30 [phi:rom_sector_erase::@2->rom_unlock#0] -- vbuz1=vbuc1 + // [2159] phi from rom_sector_erase::@2 to rom_unlock [phi:rom_sector_erase::@2->rom_unlock] + // [2159] 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 - // [2155] phi rom_unlock::address#5 = rom_unlock::address#1 [phi:rom_sector_erase::@2->rom_unlock#1] -- register_copy + // [2159] 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) @@ -16462,19 +15816,15 @@ rom_sector_erase: { // } // [2488] return rts - .segment Data - .label address = printf_ulong.uvalue_1 } -.segment Code // rom_write /* inline */ -// unsigned long rom_write(__zp($65) char flash_ram_bank, __zp($2e) char *flash_ram_address, __zp($a9) unsigned long flash_rom_address, unsigned int flash_rom_size) +// unsigned long rom_write(__register(X) char flash_ram_bank, __zp($25) char *flash_ram_address, __zp($68) unsigned long flash_rom_address, unsigned int flash_rom_size) rom_write: { - .label rom_chip_address = $be - .label flash_rom_address = $a9 - .label flash_ram_address = $2e - .label flashed_bytes = $75 - .label flash_ram_bank = $65 + .label rom_chip_address = $7a + .label flash_rom_address = $68 + .label flash_ram_address = $25 + .label flashed_bytes = $5f // unsigned long rom_chip_address = flash_rom_address & ROM_CHIP_MASK // [2489] 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. @@ -16492,9 +15842,8 @@ rom_write: { sta.z rom_chip_address+3 // rom_write::bank_set_bram1 // BRAM = bank - // [2490] BRAM = rom_write::flash_ram_bank#0 -- vbuz1=vbuz2 - lda.z flash_ram_bank - sta.z BRAM + // [2490] BRAM = rom_write::flash_ram_bank#0 -- vbuz1=vbuxx + stx.z BRAM // [2491] phi from rom_write::bank_set_bram1 to rom_write::@1 [phi:rom_write::bank_set_bram1->rom_write::@1] // [2491] 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 // [2491] 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 @@ -16548,11 +15897,11 @@ rom_write: { adc #0 sta.z rom_unlock.address+3 // [2495] call rom_unlock - // [2155] phi from rom_write::@2 to rom_unlock [phi:rom_write::@2->rom_unlock] - // [2155] phi rom_unlock::unlock_code#5 = $a0 [phi:rom_write::@2->rom_unlock#0] -- vbuz1=vbuc1 + // [2159] phi from rom_write::@2 to rom_unlock [phi:rom_write::@2->rom_unlock] + // [2159] phi rom_unlock::unlock_code#5 = $a0 [phi:rom_write::@2->rom_unlock#0] -- vbuz1=vbuc1 lda #$a0 sta.z rom_unlock.unlock_code - // [2155] phi rom_unlock::address#5 = rom_unlock::address#4 [phi:rom_write::@2->rom_unlock#1] -- register_copy + // [2159] 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) @@ -16565,10 +15914,10 @@ rom_write: { sta.z rom_byte_program.address+2 lda.z flash_rom_address+3 sta.z rom_byte_program.address+3 - // [2497] rom_byte_program::value#0 = *rom_write::flash_ram_address#2 -- vbuz1=_deref_pbuz2 + // [2497] 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 + tay // [2498] call rom_byte_program // [2813] phi from rom_write::@3 to rom_byte_program [phi:rom_write::@3->rom_byte_program] jsr rom_byte_program @@ -16612,7 +15961,6 @@ rom_write: { * @return char The character read. */ cbm_k_getin: { - .label return = $e7 // __mem unsigned char ch // [2502] cbm_k_getin::ch = 0 -- vbum1=vbuc1 lda #0 @@ -16622,8 +15970,7 @@ cbm_k_getin: { jsr CBM_GETIN sta ch // return ch; - // [2504] cbm_k_getin::return#0 = cbm_k_getin::ch -- vbuz1=vbum2 - sta.z return + // [2504] cbm_k_getin::return#0 = cbm_k_getin::ch -- vbuaa=vbum1 // cbm_k_getin::@return // } // [2505] cbm_k_getin::return#1 = cbm_k_getin::return#0 @@ -16640,13 +15987,12 @@ cbm_k_getin: { /// @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($d7) char *dst, __zp($4e) const char *src, __zp($2e) unsigned int n) +// char * strncpy(__zp($b9) char *dst, __zp($3e) const char *src, __zp($25) unsigned int n) strncpy: { - .label c = $61 - .label dst = $d7 - .label i = $af - .label src = $4e - .label n = $2e + .label dst = $b9 + .label i = $6e + .label src = $3e + .label n = $25 // [2508] phi from strncpy to strncpy::@1 [phi:strncpy->strncpy::@1] // [2508] phi strncpy::dst#3 = strncpy::dst#8 [phi:strncpy->strncpy::@1#0] -- register_copy // [2508] phi strncpy::src#3 = strncpy::src#6 [phi:strncpy->strncpy::@1#1] -- register_copy @@ -16673,12 +16019,12 @@ strncpy: { // strncpy::@2 __b2: // char c = *src - // [2511] strncpy::c#0 = *strncpy::src#3 -- vbuz1=_deref_pbuz2 + // [2511] strncpy::c#0 = *strncpy::src#3 -- vbuaa=_deref_pbuz1 ldy #0 lda (src),y - sta.z c // if(c) - // [2512] if(0==strncpy::c#0) goto strncpy::@3 -- 0_eq_vbuz1_then_la1 + // [2512] if(0==strncpy::c#0) goto strncpy::@3 -- 0_eq_vbuaa_then_la1 + cmp #0 beq __b3 // strncpy::@4 // src++; @@ -16692,8 +16038,7 @@ strncpy: { // strncpy::@3 __b3: // *dst++ = c - // [2515] *strncpy::dst#3 = strncpy::c#0 -- _deref_pbuz1=vbuz2 - lda.z c + // [2515] *strncpy::dst#3 = strncpy::c#0 -- _deref_pbuz1=vbuaa ldy #0 sta (dst),y // *dst++ = c; @@ -16720,41 +16065,32 @@ 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(__zp($2e) unsigned int value, __zp($5d) char *buffer, __zp($e0) char radix) +// void utoa(__zp($25) unsigned int value, __zp($4b) char *buffer, __register(X) char radix) utoa: { - .label utoa__4 = $61 - .label utoa__10 = $2c - .label utoa__11 = $53 - .label digit_value = $3f - .label buffer = $5d - .label digit = $64 - .label value = $2e - .label radix = $e0 - .label started = $3c - .label max_digits = $2d - .label digit_values = $af + .label digit_value = $32 + .label buffer = $4b + .label digit = $51 + .label value = $25 + .label max_digits = $75 + .label digit_values = $6e // if(radix==DECIMAL) - // [2518] if(utoa::radix#0==DECIMAL) goto utoa::@1 -- vbuz1_eq_vbuc1_then_la1 - lda #DECIMAL - cmp.z radix + // [2518] if(utoa::radix#0==DECIMAL) goto utoa::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #DECIMAL beq __b2 // utoa::@2 // if(radix==HEXADECIMAL) - // [2519] if(utoa::radix#0==HEXADECIMAL) goto utoa::@1 -- vbuz1_eq_vbuc1_then_la1 - lda #HEXADECIMAL - cmp.z radix + // [2519] if(utoa::radix#0==HEXADECIMAL) goto utoa::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #HEXADECIMAL beq __b3 // utoa::@3 // if(radix==OCTAL) - // [2520] if(utoa::radix#0==OCTAL) goto utoa::@1 -- vbuz1_eq_vbuc1_then_la1 - lda #OCTAL - cmp.z radix + // [2520] if(utoa::radix#0==OCTAL) goto utoa::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #OCTAL beq __b4 // utoa::@4 // if(radix==BINARY) - // [2521] if(utoa::radix#0==BINARY) goto utoa::@1 -- vbuz1_eq_vbuc1_then_la1 - lda #BINARY - cmp.z radix + // [2521] if(utoa::radix#0==BINARY) goto utoa::@1 -- vbuxx_eq_vbuc1_then_la1 + cpx #BINARY beq __b5 // utoa::@5 // *buffer++ = 'e' @@ -16827,32 +16163,31 @@ utoa: { sta.z buffer lda #>printf_buffer+OFFSET_STRUCT_PRINTF_BUFFER_NUMBER_DIGITS sta.z buffer+1 - // [2528] phi utoa::started#2 = 0 [phi:utoa::@1->utoa::@6#1] -- vbuz1=vbuc1 - lda #0 - sta.z started + // [2528] phi utoa::started#2 = 0 [phi:utoa::@1->utoa::@6#1] -- vbuxx=vbuc1 + ldx #0 // [2528] phi utoa::value#2 = utoa::value#1 [phi:utoa::@1->utoa::@6#2] -- register_copy // [2528] phi utoa::digit#2 = 0 [phi:utoa::@1->utoa::@6#3] -- vbuz1=vbuc1 + txa sta.z digit // utoa::@6 __b6: // max_digits-1 - // [2529] utoa::$4 = utoa::max_digits#7 - 1 -- vbuz1=vbuz2_minus_1 - ldx.z max_digits - dex - stx.z utoa__4 + // [2529] utoa::$4 = utoa::max_digits#7 - 1 -- vbuaa=vbuz1_minus_1 + lda.z max_digits + sec + sbc #1 // for( char digit=0; digit= digit_value) - // [2537] if(0!=utoa::started#2) goto utoa::@10 -- 0_neq_vbuz1_then_la1 - lda.z started + // [2537] if(0!=utoa::started#2) goto utoa::@10 -- 0_neq_vbuxx_then_la1 + cpx #0 bne __b10 // utoa::@12 // [2538] if(utoa::value#2>=utoa::digit_value#0) goto utoa::@10 -- vwuz1_ge_vwuz2_then_la1 - lda.z digit_value+1 cmp.z value+1 bne !+ lda.z digit_value @@ -16936,9 +16269,8 @@ utoa: { !: // [2539] phi from utoa::@11 to utoa::@9 [phi:utoa::@11->utoa::@9] // [2539] phi utoa::buffer#14 = utoa::buffer#4 [phi:utoa::@11->utoa::@9#0] -- register_copy - // [2539] phi utoa::started#4 = 1 [phi:utoa::@11->utoa::@9#1] -- vbuz1=vbuc1 - lda #1 - sta.z started + // [2539] phi utoa::started#4 = 1 [phi:utoa::@11->utoa::@9#1] -- vbuxx=vbuc1 + ldx #1 // [2539] phi utoa::value#6 = utoa::value#0 [phi:utoa::@11->utoa::@9#2] -- register_copy jmp __b9 } @@ -16946,21 +16278,17 @@ utoa: { // Insert a new line, and scroll the upper part of the screen up. // void insertup(char rows) insertup: { - .label insertup__0 = $45 - .label insertup__4 = $3a - .label insertup__6 = $3b - .label insertup__7 = $3a - .label width = $45 - .label y = $35 + .label width = $39 + .label y = $2b // __conio.width+1 - // [2548] insertup::$0 = *((char *)&__conio+6) + 1 -- vbuz1=_deref_pbuc1_plus_1 + // [2548] 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 - // [2549] insertup::width#0 = insertup::$0 << 1 -- vbuz1=vbuz1_rol_1 + // [2549] insertup::width#0 = insertup::$0 << 1 -- vbuz1=vbuaa_rol_1 // {asm{.byte $db}} - asl.z width + asl + sta.z width // [2550] phi from insertup to insertup::@1 [phi:insertup->insertup::@1] // [2550] phi insertup::y#2 = 0 [phi:insertup->insertup::@1#0] -- vbuz1=vbuc1 lda #0 @@ -16984,38 +16312,36 @@ insertup: { // insertup::@2 __b2: // y+1 - // [2555] insertup::$4 = insertup::y#2 + 1 -- vbuz1=vbuz2_plus_1 - lda.z y - inc - sta.z insertup__4 + // [2555] insertup::$4 = insertup::y#2 + 1 -- vbuxx=vbuz1_plus_1 + ldx.z y + inx // memcpy8_vram_vram(__conio.mapbase_bank, __conio.offsets[y], __conio.mapbase_bank, __conio.offsets[y+1], width) - // [2556] insertup::$6 = insertup::y#2 << 1 -- vbuz1=vbuz2_rol_1 + // [2556] insertup::$6 = insertup::y#2 << 1 -- vbuyy=vbuz1_rol_1 lda.z y asl - sta.z insertup__6 - // [2557] insertup::$7 = insertup::$4 << 1 -- vbuz1=vbuz1_rol_1 - asl.z insertup__7 + tay + // [2557] insertup::$7 = insertup::$4 << 1 -- vbuxx=vbuxx_rol_1 + txa + asl + tax // [2558] memcpy8_vram_vram::dbank_vram#0 = *((char *)&__conio+5) -- vbuz1=_deref_pbuc1 lda __conio+5 sta.z memcpy8_vram_vram.dbank_vram - // [2559] memcpy8_vram_vram::doffset_vram#0 = ((unsigned int *)&__conio+$15)[insertup::$6] -- vwuz1=pwuc1_derefidx_vbuz2 - ldy.z insertup__6 + // [2559] memcpy8_vram_vram::doffset_vram#0 = ((unsigned int *)&__conio+$15)[insertup::$6] -- vwuz1=pwuc1_derefidx_vbuyy lda __conio+$15,y sta.z memcpy8_vram_vram.doffset_vram lda __conio+$15+1,y sta.z memcpy8_vram_vram.doffset_vram+1 - // [2560] memcpy8_vram_vram::sbank_vram#0 = *((char *)&__conio+5) -- vbuz1=_deref_pbuc1 - lda __conio+5 - sta.z memcpy8_vram_vram.sbank_vram - // [2561] memcpy8_vram_vram::soffset_vram#0 = ((unsigned int *)&__conio+$15)[insertup::$7] -- vwuz1=pwuc1_derefidx_vbuz2 - ldy.z insertup__7 - lda __conio+$15,y + // [2560] memcpy8_vram_vram::sbank_vram#0 = *((char *)&__conio+5) -- vbuyy=_deref_pbuc1 + ldy __conio+5 + // [2561] memcpy8_vram_vram::soffset_vram#0 = ((unsigned int *)&__conio+$15)[insertup::$7] -- vwuz1=pwuc1_derefidx_vbuxx + lda __conio+$15,x sta.z memcpy8_vram_vram.soffset_vram - lda __conio+$15+1,y + lda __conio+$15+1,x sta.z memcpy8_vram_vram.soffset_vram+1 // [2562] memcpy8_vram_vram::num8#1 = insertup::width#0 -- vbuz1=vbuz2 lda.z width - sta.z memcpy8_vram_vram.num8_1 + sta.z memcpy8_vram_vram.num8 // [2563] call memcpy8_vram_vram jsr memcpy8_vram_vram // insertup::@4 @@ -17028,18 +16354,12 @@ insertup: { } // clearline clearline: { - .label clearline__0 = $24 - .label clearline__1 = $26 - .label clearline__2 = $27 - .label clearline__3 = $25 - .label addr = $38 - .label c = $22 + .label addr = $2c // unsigned int addr = __conio.offsets[__conio.cursor_y] - // [2565] clearline::$3 = *((char *)&__conio+1) << 1 -- vbuz1=_deref_pbuc1_rol_1 + // [2565] clearline::$3 = *((char *)&__conio+1) << 1 -- vbuaa=_deref_pbuc1_rol_1 lda __conio+1 asl - sta.z clearline__3 - // [2566] clearline::addr#0 = ((unsigned int *)&__conio+$15)[clearline::$3] -- vwuz1=pwuc1_derefidx_vbuz2 + // [2566] clearline::addr#0 = ((unsigned int *)&__conio+$15)[clearline::$3] -- vwuz1=pwuc1_derefidx_vbuaa tay lda __conio+$15,y sta.z addr @@ -17051,31 +16371,27 @@ clearline: { and VERA_CTRL sta VERA_CTRL // BYTE0(addr) - // [2568] clearline::$0 = byte0 clearline::addr#0 -- vbuz1=_byte0_vwuz2 + // [2568] clearline::$0 = byte0 clearline::addr#0 -- vbuaa=_byte0_vwuz1 lda.z addr - sta.z clearline__0 // *VERA_ADDRX_L = BYTE0(addr) - // [2569] *VERA_ADDRX_L = clearline::$0 -- _deref_pbuc1=vbuz1 + // [2569] *VERA_ADDRX_L = clearline::$0 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_L // BYTE1(addr) - // [2570] clearline::$1 = byte1 clearline::addr#0 -- vbuz1=_byte1_vwuz2 + // [2570] clearline::$1 = byte1 clearline::addr#0 -- vbuaa=_byte1_vwuz1 lda.z addr+1 - sta.z clearline__1 // *VERA_ADDRX_M = BYTE1(addr) - // [2571] *VERA_ADDRX_M = clearline::$1 -- _deref_pbuc1=vbuz1 + // [2571] *VERA_ADDRX_M = clearline::$1 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_M // __conio.mapbase_bank | VERA_INC_1 - // [2572] clearline::$2 = *((char *)&__conio+5) | VERA_INC_1 -- vbuz1=_deref_pbuc1_bor_vbuc2 + // [2572] 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 - // [2573] *VERA_ADDRX_H = clearline::$2 -- _deref_pbuc1=vbuz1 + // [2573] *VERA_ADDRX_H = clearline::$2 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_H // register unsigned char c=__conio.width - // [2574] clearline::c#0 = *((char *)&__conio+6) -- vbuz1=_deref_pbuc1 - lda __conio+6 - sta.z c + // [2574] clearline::c#0 = *((char *)&__conio+6) -- vbuxx=_deref_pbuc1 + ldx __conio+6 // [2575] phi from clearline clearline::@1 to clearline::@1 [phi:clearline/clearline::@1->clearline::@1] // [2575] phi clearline::c#2 = clearline::c#0 [phi:clearline/clearline::@1->clearline::@1#0] -- register_copy // clearline::@1 @@ -17089,11 +16405,11 @@ clearline: { lda __conio+$d sta VERA_DATA0 // c--; - // [2578] clearline::c#1 = -- clearline::c#2 -- vbuz1=_dec_vbuz1 - dec.z c + // [2578] clearline::c#1 = -- clearline::c#2 -- vbuxx=_dec_vbuxx + dex // while(c) - // [2579] if(0!=clearline::c#1) goto clearline::@1 -- 0_neq_vbuz1_then_la1 - lda.z c + // [2579] if(0!=clearline::c#1) goto clearline::@1 -- 0_neq_vbuxx_then_la1 + cpx #0 bne __b1 // clearline::@return // } @@ -17108,34 +16424,12 @@ clearline: { * @param y * @return unsigned char */ -// __zp($64) char display_frame_maskxy(__mem() char x, __zp($2d) char y) +// __register(A) char display_frame_maskxy(__register(X) char x, __register(Y) char y) display_frame_maskxy: { - .label cpeekcxy1_cpeekc1_display_frame_maskxy__0 = $61 - .label cpeekcxy1_cpeekc1_display_frame_maskxy__1 = $53 - .label cpeekcxy1_cpeekc1_display_frame_maskxy__2 = $2c - .label cpeekcxy1_y = $2d - .label c = $36 - // DR corner. - // DL corner. - // UR corner. - // UL corner. - // HL line. - // VL line. - // VR junction. - // VL junction. - // HD junction. - // HU junction. - // HV junction. - .label return = $64 - .label y = $2d // display_frame_maskxy::cpeekcxy1 // gotoxy(x,y) - // [2582] gotoxy::x#5 = display_frame_maskxy::cpeekcxy1_x#0 -- vbuz1=vbum2 - lda cpeekcxy1_x - sta.z gotoxy.x - // [2583] gotoxy::y#5 = display_frame_maskxy::cpeekcxy1_y#0 -- vbuz1=vbuz2 - lda.z cpeekcxy1_y - sta.z gotoxy.y + // [2582] gotoxy::x#5 = display_frame_maskxy::cpeekcxy1_x#0 + // [2583] gotoxy::y#5 = display_frame_maskxy::cpeekcxy1_y#0 // [2584] call gotoxy // [751] phi from display_frame_maskxy::cpeekcxy1 to gotoxy [phi:display_frame_maskxy::cpeekcxy1->gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#5 [phi:display_frame_maskxy::cpeekcxy1->gotoxy#0] -- register_copy @@ -17148,188 +16442,157 @@ display_frame_maskxy: { and VERA_CTRL sta VERA_CTRL // BYTE0(__conio.offset) - // [2586] display_frame_maskxy::cpeekcxy1_cpeekc1_$0 = byte0 *((unsigned int *)&__conio+$13) -- vbuz1=_byte0__deref_pwuc1 + // [2586] 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) - // [2587] *VERA_ADDRX_L = display_frame_maskxy::cpeekcxy1_cpeekc1_$0 -- _deref_pbuc1=vbuz1 + // [2587] *VERA_ADDRX_L = display_frame_maskxy::cpeekcxy1_cpeekc1_$0 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_L // BYTE1(__conio.offset) - // [2588] display_frame_maskxy::cpeekcxy1_cpeekc1_$1 = byte1 *((unsigned int *)&__conio+$13) -- vbuz1=_byte1__deref_pwuc1 + // [2588] 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) - // [2589] *VERA_ADDRX_M = display_frame_maskxy::cpeekcxy1_cpeekc1_$1 -- _deref_pbuc1=vbuz1 + // [2589] *VERA_ADDRX_M = display_frame_maskxy::cpeekcxy1_cpeekc1_$1 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_M // __conio.mapbase_bank | VERA_INC_0 - // [2590] display_frame_maskxy::cpeekcxy1_cpeekc1_$2 = *((char *)&__conio+5) -- vbuz1=_deref_pbuc1 + // [2590] 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 - // [2591] *VERA_ADDRX_H = display_frame_maskxy::cpeekcxy1_cpeekc1_$2 -- _deref_pbuc1=vbuz1 + // [2591] *VERA_ADDRX_H = display_frame_maskxy::cpeekcxy1_cpeekc1_$2 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_H // return *VERA_DATA0; - // [2592] display_frame_maskxy::c#0 = *VERA_DATA0 -- vbuz1=_deref_pbuc1 + // [2592] 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; - // [2593] if(display_frame_maskxy::c#0==$70) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$70 - cmp.z c + // [2593] 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; - // [2594] if(display_frame_maskxy::c#0==$6e) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$6e - cmp.z c + // [2594] 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; - // [2595] if(display_frame_maskxy::c#0==$6d) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$6d - cmp.z c + // [2595] 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; - // [2596] if(display_frame_maskxy::c#0==$7d) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$7d - cmp.z c + // [2596] 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; - // [2597] if(display_frame_maskxy::c#0==$40) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$40 - cmp.z c + // [2597] 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; - // [2598] if(display_frame_maskxy::c#0==$5d) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$5d - cmp.z c + // [2598] 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; - // [2599] if(display_frame_maskxy::c#0==$6b) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$6b - cmp.z c + // [2599] 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; - // [2600] if(display_frame_maskxy::c#0==$73) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$73 - cmp.z c + // [2600] 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; - // [2601] if(display_frame_maskxy::c#0==$72) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$72 - cmp.z c + // [2601] 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; - // [2602] if(display_frame_maskxy::c#0==$71) goto display_frame_maskxy::@return -- vbuz1_eq_vbuc1_then_la1 - lda #$71 - cmp.z c + // [2602] 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; - // [2603] if(display_frame_maskxy::c#0==$5b) goto display_frame_maskxy::@11 -- vbuz1_eq_vbuc1_then_la1 - lda #$5b - cmp.z c + // [2603] if(display_frame_maskxy::c#0==$5b) goto display_frame_maskxy::@11 -- vbuaa_eq_vbuc1_then_la1 + cmp #$5b beq __b11 // [2605] phi from display_frame_maskxy::@10 to display_frame_maskxy::@return [phi:display_frame_maskxy::@10->display_frame_maskxy::@return] - // [2605] phi display_frame_maskxy::return#12 = 0 [phi:display_frame_maskxy::@10->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [2605] 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 // [2604] 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: // [2605] phi from display_frame_maskxy::@11 to display_frame_maskxy::@return [phi:display_frame_maskxy::@11->display_frame_maskxy::@return] - // [2605] phi display_frame_maskxy::return#12 = $f [phi:display_frame_maskxy::@11->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [2605] 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 // [2605] phi from display_frame_maskxy::@1 to display_frame_maskxy::@return [phi:display_frame_maskxy::@1->display_frame_maskxy::@return] __b1: - // [2605] phi display_frame_maskxy::return#12 = 3 [phi:display_frame_maskxy::@1->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [2605] 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 // [2605] phi from display_frame_maskxy::@12 to display_frame_maskxy::@return [phi:display_frame_maskxy::@12->display_frame_maskxy::@return] __b2: - // [2605] phi display_frame_maskxy::return#12 = 6 [phi:display_frame_maskxy::@12->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [2605] 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 // [2605] phi from display_frame_maskxy::@2 to display_frame_maskxy::@return [phi:display_frame_maskxy::@2->display_frame_maskxy::@return] __b3: - // [2605] phi display_frame_maskxy::return#12 = $c [phi:display_frame_maskxy::@2->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [2605] 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 // [2605] phi from display_frame_maskxy::@3 to display_frame_maskxy::@return [phi:display_frame_maskxy::@3->display_frame_maskxy::@return] __b4: - // [2605] phi display_frame_maskxy::return#12 = 9 [phi:display_frame_maskxy::@3->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [2605] 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 // [2605] phi from display_frame_maskxy::@4 to display_frame_maskxy::@return [phi:display_frame_maskxy::@4->display_frame_maskxy::@return] __b5: - // [2605] phi display_frame_maskxy::return#12 = 5 [phi:display_frame_maskxy::@4->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [2605] 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 // [2605] phi from display_frame_maskxy::@5 to display_frame_maskxy::@return [phi:display_frame_maskxy::@5->display_frame_maskxy::@return] __b6: - // [2605] phi display_frame_maskxy::return#12 = $a [phi:display_frame_maskxy::@5->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [2605] 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 // [2605] phi from display_frame_maskxy::@6 to display_frame_maskxy::@return [phi:display_frame_maskxy::@6->display_frame_maskxy::@return] __b7: - // [2605] phi display_frame_maskxy::return#12 = $e [phi:display_frame_maskxy::@6->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [2605] 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 // [2605] phi from display_frame_maskxy::@7 to display_frame_maskxy::@return [phi:display_frame_maskxy::@7->display_frame_maskxy::@return] __b8: - // [2605] phi display_frame_maskxy::return#12 = $b [phi:display_frame_maskxy::@7->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [2605] 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 // [2605] phi from display_frame_maskxy::@8 to display_frame_maskxy::@return [phi:display_frame_maskxy::@8->display_frame_maskxy::@return] __b9: - // [2605] phi display_frame_maskxy::return#12 = 7 [phi:display_frame_maskxy::@8->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [2605] 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 // [2605] phi from display_frame_maskxy::@9 to display_frame_maskxy::@return [phi:display_frame_maskxy::@9->display_frame_maskxy::@return] __b10: - // [2605] phi display_frame_maskxy::return#12 = $d [phi:display_frame_maskxy::@9->display_frame_maskxy::@return#0] -- vbuz1=vbuc1 + // [2605] 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 // } // [2606] return rts - .segment Data - .label cpeekcxy1_x = main.check_status_rom1_main__0 - .label x = main.check_status_rom1_main__0 } -.segment Code // display_frame_char /** * @brief @@ -17337,168 +16600,143 @@ display_frame_maskxy: { * @param mask * @return unsigned char */ -// __zp($cb) char display_frame_char(__zp($64) char mask) +// __register(A) char display_frame_char(__register(A) char mask) display_frame_char: { - .label return = $cb - .label mask = $64 // case 0b0110: // return 0x70; - // [2608] if(display_frame_char::mask#10==6) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 - lda #6 - cmp.z mask + // [2608] 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; - // [2609] if(display_frame_char::mask#10==3) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [2609] 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; - // [2610] if(display_frame_char::mask#10==$c) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [2610] 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; - // [2611] if(display_frame_char::mask#10==9) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [2611] 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; - // [2612] if(display_frame_char::mask#10==5) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [2612] 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; - // [2613] if(display_frame_char::mask#10==$a) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [2613] 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; - // [2614] if(display_frame_char::mask#10==$e) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [2614] 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; - // [2615] if(display_frame_char::mask#10==$b) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [2615] 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; - // [2616] if(display_frame_char::mask#10==7) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [2616] 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; - // [2617] if(display_frame_char::mask#10==$d) goto display_frame_char::@return -- vbuz1_eq_vbuc1_then_la1 + // [2617] 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; - // [2618] if(display_frame_char::mask#10==$f) goto display_frame_char::@11 -- vbuz1_eq_vbuc1_then_la1 + // [2618] 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 // [2620] phi from display_frame_char::@10 to display_frame_char::@return [phi:display_frame_char::@10->display_frame_char::@return] - // [2620] phi display_frame_char::return#12 = $20 [phi:display_frame_char::@10->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [2620] 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 // [2619] 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: // [2620] phi from display_frame_char::@11 to display_frame_char::@return [phi:display_frame_char::@11->display_frame_char::@return] - // [2620] phi display_frame_char::return#12 = $5b [phi:display_frame_char::@11->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [2620] 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 // [2620] phi from display_frame_char to display_frame_char::@return [phi:display_frame_char->display_frame_char::@return] __b1: - // [2620] phi display_frame_char::return#12 = $70 [phi:display_frame_char->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [2620] phi display_frame_char::return#12 = $70 [phi:display_frame_char->display_frame_char::@return#0] -- vbuaa=vbuc1 lda #$70 - sta.z return rts // [2620] phi from display_frame_char::@1 to display_frame_char::@return [phi:display_frame_char::@1->display_frame_char::@return] __b2: - // [2620] phi display_frame_char::return#12 = $6e [phi:display_frame_char::@1->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [2620] 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 // [2620] phi from display_frame_char::@2 to display_frame_char::@return [phi:display_frame_char::@2->display_frame_char::@return] __b3: - // [2620] phi display_frame_char::return#12 = $6d [phi:display_frame_char::@2->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [2620] 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 // [2620] phi from display_frame_char::@3 to display_frame_char::@return [phi:display_frame_char::@3->display_frame_char::@return] __b4: - // [2620] phi display_frame_char::return#12 = $7d [phi:display_frame_char::@3->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [2620] 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 // [2620] phi from display_frame_char::@4 to display_frame_char::@return [phi:display_frame_char::@4->display_frame_char::@return] __b5: - // [2620] phi display_frame_char::return#12 = $40 [phi:display_frame_char::@4->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [2620] 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 // [2620] phi from display_frame_char::@5 to display_frame_char::@return [phi:display_frame_char::@5->display_frame_char::@return] __b6: - // [2620] phi display_frame_char::return#12 = $5d [phi:display_frame_char::@5->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [2620] 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 // [2620] phi from display_frame_char::@6 to display_frame_char::@return [phi:display_frame_char::@6->display_frame_char::@return] __b7: - // [2620] phi display_frame_char::return#12 = $6b [phi:display_frame_char::@6->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [2620] 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 // [2620] phi from display_frame_char::@7 to display_frame_char::@return [phi:display_frame_char::@7->display_frame_char::@return] __b8: - // [2620] phi display_frame_char::return#12 = $73 [phi:display_frame_char::@7->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [2620] 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 // [2620] phi from display_frame_char::@8 to display_frame_char::@return [phi:display_frame_char::@8->display_frame_char::@return] __b9: - // [2620] phi display_frame_char::return#12 = $72 [phi:display_frame_char::@8->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [2620] 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 // [2620] phi from display_frame_char::@9 to display_frame_char::@return [phi:display_frame_char::@9->display_frame_char::@return] __b10: - // [2620] phi display_frame_char::return#12 = $71 [phi:display_frame_char::@9->display_frame_char::@return#0] -- vbuz1=vbuc1 + // [2620] 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 // } // [2621] return @@ -17514,15 +16752,12 @@ display_frame_char: { * @param tc Fore color * @param bc Back color */ -// void display_chip_led(__zp($5a) char x, char y, __zp($cc) char w, __zp($3c) char tc, char bc) +// void display_chip_led(__zp($af) char x, char y, __zp($ae) char w, __register(X) char tc, char bc) display_chip_led: { - .label x = $5a - .label w = $cc - .label tc = $3c + .label x = $af + .label w = $ae // textcolor(tc) - // [2623] textcolor::color#11 = display_chip_led::tc#3 -- vbuz1=vbuz2 - lda.z tc - sta.z textcolor.color + // [2623] textcolor::color#11 = display_chip_led::tc#3 // [2624] call textcolor // [733] phi from display_chip_led to textcolor [phi:display_chip_led->textcolor] // [733] phi textcolor::color#18 = textcolor::color#11 [phi:display_chip_led->textcolor#0] -- register_copy @@ -17532,9 +16767,8 @@ display_chip_led: { // bgcolor(bc) // [2626] call bgcolor // [738] phi from display_chip_led::@3 to bgcolor [phi:display_chip_led::@3->bgcolor] - // [738] phi bgcolor::color#14 = BLUE [phi:display_chip_led::@3->bgcolor#0] -- vbuz1=vbuc1 - lda #BLUE - sta.z bgcolor.color + // [738] phi bgcolor::color#14 = BLUE [phi:display_chip_led::@3->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // [2627] 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] // [2627] 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 @@ -17542,32 +16776,28 @@ display_chip_led: { // display_chip_led::@1 __b1: // cputcxy(x, y, 0x6F) - // [2628] cputcxy::x#9 = display_chip_led::x#4 -- vbuz1=vbuz2 - lda.z x - sta.z cputcxy.x + // [2628] cputcxy::x#9 = display_chip_led::x#4 -- vbuxx=vbuz1 + ldx.z x // [2629] call cputcxy // [2068] phi from display_chip_led::@1 to cputcxy [phi:display_chip_led::@1->cputcxy] // [2068] phi cputcxy::c#15 = $6f [phi:display_chip_led::@1->cputcxy#0] -- vbuz1=vbuc1 lda #$6f sta.z cputcxy.c - // [2068] phi cputcxy::y#15 = 3 [phi:display_chip_led::@1->cputcxy#1] -- vbuz1=vbuc1 - lda #3 - sta.z cputcxy.y + // [2068] phi cputcxy::y#15 = 3 [phi:display_chip_led::@1->cputcxy#1] -- vbuyy=vbuc1 + ldy #3 // [2068] phi cputcxy::x#15 = cputcxy::x#9 [phi:display_chip_led::@1->cputcxy#2] -- register_copy jsr cputcxy // display_chip_led::@4 // cputcxy(x, y+1, 0x77) - // [2630] cputcxy::x#10 = display_chip_led::x#4 -- vbuz1=vbuz2 - lda.z x - sta.z cputcxy.x + // [2630] cputcxy::x#10 = display_chip_led::x#4 -- vbuxx=vbuz1 + ldx.z x // [2631] call cputcxy // [2068] phi from display_chip_led::@4 to cputcxy [phi:display_chip_led::@4->cputcxy] // [2068] phi cputcxy::c#15 = $77 [phi:display_chip_led::@4->cputcxy#0] -- vbuz1=vbuc1 lda #$77 sta.z cputcxy.c - // [2068] phi cputcxy::y#15 = 3+1 [phi:display_chip_led::@4->cputcxy#1] -- vbuz1=vbuc1 - lda #3+1 - sta.z cputcxy.y + // [2068] phi cputcxy::y#15 = 3+1 [phi:display_chip_led::@4->cputcxy#1] -- vbuyy=vbuc1 + ldy #3+1 // [2068] phi cputcxy::x#15 = cputcxy::x#10 [phi:display_chip_led::@4->cputcxy#2] -- register_copy jsr cputcxy // display_chip_led::@5 @@ -17585,18 +16815,16 @@ display_chip_led: { // textcolor(WHITE) // [2636] call textcolor // [733] phi from display_chip_led::@2 to textcolor [phi:display_chip_led::@2->textcolor] - // [733] phi textcolor::color#18 = WHITE [phi:display_chip_led::@2->textcolor#0] -- vbuz1=vbuc1 - lda #WHITE - sta.z textcolor.color + // [733] phi textcolor::color#18 = WHITE [phi:display_chip_led::@2->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor // [2637] 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) // [2638] call bgcolor // [738] phi from display_chip_led::@6 to bgcolor [phi:display_chip_led::@6->bgcolor] - // [738] phi bgcolor::color#14 = BLUE [phi:display_chip_led::@6->bgcolor#0] -- vbuz1=vbuc1 - lda #BLUE - sta.z bgcolor.color + // [738] phi bgcolor::color#14 = BLUE [phi:display_chip_led::@6->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // display_chip_led::@return // } @@ -17612,19 +16840,15 @@ display_chip_led: { * @param w Width * @param c Fore color */ -// void display_chip_line(__zp($ea) char x, __mem() char y, __zp($ca) char w, __zp($d4) char c) +// void display_chip_line(__mem() char x, __mem() char y, __zp($fa) char w, __mem() char c) display_chip_line: { - .label i = $37 - .label x = $ea - .label w = $ca - .label c = $d4 + .label i = $cb + .label w = $fa // gotoxy(x, y) - // [2641] gotoxy::x#7 = display_chip_line::x#16 -- vbuz1=vbuz2 - lda.z x - sta.z gotoxy.x - // [2642] gotoxy::y#7 = display_chip_line::y#16 -- vbuz1=vbum2 - lda y - sta.z gotoxy.y + // [2641] gotoxy::x#7 = display_chip_line::x#16 -- vbuxx=vbum1 + ldx x + // [2642] gotoxy::y#7 = display_chip_line::y#16 -- vbuyy=vbum1 + ldy y // [2643] call gotoxy // [751] phi from display_chip_line to gotoxy [phi:display_chip_line->gotoxy] // [751] phi gotoxy::y#30 = gotoxy::y#7 [phi:display_chip_line->gotoxy#0] -- register_copy @@ -17635,18 +16859,16 @@ display_chip_line: { // textcolor(GREY) // [2645] call textcolor // [733] phi from display_chip_line::@4 to textcolor [phi:display_chip_line::@4->textcolor] - // [733] phi textcolor::color#18 = GREY [phi:display_chip_line::@4->textcolor#0] -- vbuz1=vbuc1 - lda #GREY - sta.z textcolor.color + // [733] phi textcolor::color#18 = GREY [phi:display_chip_line::@4->textcolor#0] -- vbuxx=vbuc1 + ldx #GREY jsr textcolor // [2646] 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) // [2647] call bgcolor // [738] phi from display_chip_line::@5 to bgcolor [phi:display_chip_line::@5->bgcolor] - // [738] phi bgcolor::color#14 = BLUE [phi:display_chip_line::@5->bgcolor#0] -- vbuz1=vbuc1 - lda #BLUE - sta.z bgcolor.color + // [738] phi bgcolor::color#14 = BLUE [phi:display_chip_line::@5->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // display_chip_line::@6 // cputc(VERA_CHR_UR) @@ -17660,18 +16882,16 @@ display_chip_line: { // textcolor(WHITE) // [2651] call textcolor // [733] phi from display_chip_line::@6 to textcolor [phi:display_chip_line::@6->textcolor] - // [733] phi textcolor::color#18 = WHITE [phi:display_chip_line::@6->textcolor#0] -- vbuz1=vbuc1 - lda #WHITE - sta.z textcolor.color + // [733] phi textcolor::color#18 = WHITE [phi:display_chip_line::@6->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor // [2652] 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) // [2653] call bgcolor // [738] phi from display_chip_line::@7 to bgcolor [phi:display_chip_line::@7->bgcolor] - // [738] phi bgcolor::color#14 = BLACK [phi:display_chip_line::@7->bgcolor#0] -- vbuz1=vbuc1 - lda #BLACK - sta.z bgcolor.color + // [738] phi bgcolor::color#14 = BLACK [phi:display_chip_line::@7->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLACK jsr bgcolor // [2654] phi from display_chip_line::@7 to display_chip_line::@1 [phi:display_chip_line::@7->display_chip_line::@1] // [2654] phi display_chip_line::i#2 = 0 [phi:display_chip_line::@7->display_chip_line::@1#0] -- vbuz1=vbuc1 @@ -17689,18 +16909,16 @@ display_chip_line: { // textcolor(GREY) // [2657] call textcolor // [733] phi from display_chip_line::@3 to textcolor [phi:display_chip_line::@3->textcolor] - // [733] phi textcolor::color#18 = GREY [phi:display_chip_line::@3->textcolor#0] -- vbuz1=vbuc1 - lda #GREY - sta.z textcolor.color + // [733] phi textcolor::color#18 = GREY [phi:display_chip_line::@3->textcolor#0] -- vbuxx=vbuc1 + ldx #GREY jsr textcolor // [2658] 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) // [2659] call bgcolor // [738] phi from display_chip_line::@8 to bgcolor [phi:display_chip_line::@8->bgcolor] - // [738] phi bgcolor::color#14 = BLUE [phi:display_chip_line::@8->bgcolor#0] -- vbuz1=vbuc1 - lda #BLUE - sta.z bgcolor.color + // [738] phi bgcolor::color#14 = BLUE [phi:display_chip_line::@8->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // display_chip_line::@9 // cputc(VERA_CHR_UL) @@ -17714,31 +16932,27 @@ display_chip_line: { // textcolor(WHITE) // [2663] call textcolor // [733] phi from display_chip_line::@9 to textcolor [phi:display_chip_line::@9->textcolor] - // [733] phi textcolor::color#18 = WHITE [phi:display_chip_line::@9->textcolor#0] -- vbuz1=vbuc1 - lda #WHITE - sta.z textcolor.color + // [733] phi textcolor::color#18 = WHITE [phi:display_chip_line::@9->textcolor#0] -- vbuxx=vbuc1 + ldx #WHITE jsr textcolor // [2664] 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) // [2665] call bgcolor // [738] phi from display_chip_line::@10 to bgcolor [phi:display_chip_line::@10->bgcolor] - // [738] phi bgcolor::color#14 = BLACK [phi:display_chip_line::@10->bgcolor#0] -- vbuz1=vbuc1 - lda #BLACK - sta.z bgcolor.color + // [738] phi bgcolor::color#14 = BLACK [phi:display_chip_line::@10->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLACK jsr bgcolor // display_chip_line::@11 // cputcxy(x+2, y, c) - // [2666] cputcxy::x#8 = display_chip_line::x#16 + 2 -- vbuz1=vbuz2_plus_2 - lda.z x - clc - adc #2 - sta.z cputcxy.x - // [2667] cputcxy::y#8 = display_chip_line::y#16 -- vbuz1=vbum2 - lda y - sta.z cputcxy.y - // [2668] cputcxy::c#8 = display_chip_line::c#15 -- vbuz1=vbuz2 - lda.z c + // [2666] cputcxy::x#8 = display_chip_line::x#16 + 2 -- vbuxx=vbum1_plus_2 + ldx x + inx + inx + // [2667] cputcxy::y#8 = display_chip_line::y#16 -- vbuyy=vbum1 + ldy y + // [2668] cputcxy::c#8 = display_chip_line::c#15 -- vbuz1=vbum2 + lda c sta.z cputcxy.c // [2669] call cputcxy // [2068] phi from display_chip_line::@11 to cputcxy [phi:display_chip_line::@11->cputcxy] @@ -17767,7 +16981,9 @@ display_chip_line: { // [2654] 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.main__342 + .label x = main.check_status_smc16_return + .label c = main.main__121 + .label y = main.check_status_vera6_return } .segment Code // display_chip_end @@ -17778,20 +16994,15 @@ display_chip_line: { * @param y Start Y * @param w Width */ -// void display_chip_end(__zp($da) char x, char y, __zp($66) char w) +// void display_chip_end(__register(X) char x, char y, __mem() char w) display_chip_end: { - .label i = $53 - .label x = $da - .label w = $66 + .label i = $ca // gotoxy(x, y) - // [2675] gotoxy::x#8 = display_chip_end::x#0 -- vbuz1=vbuz2 - lda.z x - sta.z gotoxy.x + // [2675] gotoxy::x#8 = display_chip_end::x#0 // [2676] call gotoxy // [751] phi from display_chip_end to gotoxy [phi:display_chip_end->gotoxy] - // [751] phi gotoxy::y#30 = display_print_chip::y#21 [phi:display_chip_end->gotoxy#0] -- vbuz1=vbuc1 - lda #display_print_chip.y - sta.z gotoxy.y + // [751] phi gotoxy::y#30 = display_print_chip::y#21 [phi:display_chip_end->gotoxy#0] -- vbuyy=vbuc1 + ldy #display_print_chip.y // [751] phi gotoxy::x#30 = gotoxy::x#8 [phi:display_chip_end->gotoxy#1] -- register_copy jsr gotoxy // [2677] phi from display_chip_end to display_chip_end::@4 [phi:display_chip_end->display_chip_end::@4] @@ -17799,18 +17010,16 @@ display_chip_end: { // textcolor(GREY) // [2678] call textcolor // [733] phi from display_chip_end::@4 to textcolor [phi:display_chip_end::@4->textcolor] - // [733] phi textcolor::color#18 = GREY [phi:display_chip_end::@4->textcolor#0] -- vbuz1=vbuc1 - lda #GREY - sta.z textcolor.color + // [733] phi textcolor::color#18 = GREY [phi:display_chip_end::@4->textcolor#0] -- vbuxx=vbuc1 + ldx #GREY jsr textcolor // [2679] 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) // [2680] call bgcolor // [738] phi from display_chip_end::@5 to bgcolor [phi:display_chip_end::@5->bgcolor] - // [738] phi bgcolor::color#14 = BLUE [phi:display_chip_end::@5->bgcolor#0] -- vbuz1=vbuc1 - lda #BLUE - sta.z bgcolor.color + // [738] phi bgcolor::color#14 = BLUE [phi:display_chip_end::@5->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // display_chip_end::@6 // cputc(VERA_CHR_UR) @@ -17824,18 +17033,16 @@ display_chip_end: { // textcolor(BLUE) // [2684] call textcolor // [733] phi from display_chip_end::@6 to textcolor [phi:display_chip_end::@6->textcolor] - // [733] phi textcolor::color#18 = BLUE [phi:display_chip_end::@6->textcolor#0] -- vbuz1=vbuc1 - lda #BLUE - sta.z textcolor.color + // [733] phi textcolor::color#18 = BLUE [phi:display_chip_end::@6->textcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr textcolor // [2685] 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) // [2686] call bgcolor // [738] phi from display_chip_end::@7 to bgcolor [phi:display_chip_end::@7->bgcolor] - // [738] phi bgcolor::color#14 = BLACK [phi:display_chip_end::@7->bgcolor#0] -- vbuz1=vbuc1 - lda #BLACK - sta.z bgcolor.color + // [738] phi bgcolor::color#14 = BLACK [phi:display_chip_end::@7->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLACK jsr bgcolor // [2687] phi from display_chip_end::@7 to display_chip_end::@1 [phi:display_chip_end::@7->display_chip_end::@1] // [2687] phi display_chip_end::i#2 = 0 [phi:display_chip_end::@7->display_chip_end::@1#0] -- vbuz1=vbuc1 @@ -17844,27 +17051,25 @@ display_chip_end: { // display_chip_end::@1 __b1: // for(char i=0; idisplay_chip_end::@3] // display_chip_end::@3 // textcolor(GREY) // [2690] call textcolor // [733] phi from display_chip_end::@3 to textcolor [phi:display_chip_end::@3->textcolor] - // [733] phi textcolor::color#18 = GREY [phi:display_chip_end::@3->textcolor#0] -- vbuz1=vbuc1 - lda #GREY - sta.z textcolor.color + // [733] phi textcolor::color#18 = GREY [phi:display_chip_end::@3->textcolor#0] -- vbuxx=vbuc1 + ldx #GREY jsr textcolor // [2691] 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) // [2692] call bgcolor // [738] phi from display_chip_end::@8 to bgcolor [phi:display_chip_end::@8->bgcolor] - // [738] phi bgcolor::color#14 = BLUE [phi:display_chip_end::@8->bgcolor#0] -- vbuz1=vbuc1 - lda #BLUE - sta.z bgcolor.color + // [738] phi bgcolor::color#14 = BLUE [phi:display_chip_end::@8->bgcolor#0] -- vbuxx=vbuc1 + ldx #BLUE jsr bgcolor // display_chip_end::@9 // cputc(VERA_CHR_UL) @@ -17895,7 +17100,10 @@ display_chip_end: { // [2687] phi from display_chip_end::@2 to display_chip_end::@1 [phi:display_chip_end::@2->display_chip_end::@1] // [2687] 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 Data + w: .byte 0 } +.segment Code // rom_write_byte /** * @brief Write a byte to the ROM using the 22 bit address. @@ -17906,33 +17114,25 @@ display_chip_end: { * @param address The 22 bit ROM address. * @param value The byte value to be written. */ -// void rom_write_byte(__zp($56) unsigned long address, __zp($5a) char value) +// void rom_write_byte(__zp($45) unsigned long address, __register(Y) char value) rom_write_byte: { - .label rom_bank1_rom_write_byte__0 = $36 - .label rom_bank1_rom_write_byte__1 = $53 - .label rom_bank1_rom_write_byte__2 = $4e - .label rom_ptr1_rom_write_byte__0 = $4c - .label rom_ptr1_rom_write_byte__2 = $4c - .label rom_bank1_bank_unshifted = $4e - .label rom_bank1_return = $2c - .label rom_ptr1_return = $4c - .label address = $56 - .label value = $5a + .label rom_bank1_rom_write_byte__2 = $3e + .label rom_ptr1_rom_write_byte__0 = $3c + .label rom_ptr1_rom_write_byte__2 = $3c + .label rom_bank1_bank_unshifted = $3e + .label rom_ptr1_return = $3c + .label address = $45 // rom_write_byte::rom_bank1 // BYTE2(address) - // [2702] rom_write_byte::rom_bank1_$0 = byte2 rom_write_byte::address#4 -- vbuz1=_byte2_vduz2 + // [2702] 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) - // [2703] 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 + // [2703] rom_write_byte::rom_bank1_$1 = byte1 rom_write_byte::address#4 -- vbuxx=_byte1_vduz1 + ldx.z address+1 // MAKEWORD(BYTE2(address),BYTE1(address)) - // [2704] 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 + // [2704] 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 // [2705] 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 @@ -17940,9 +17140,8 @@ rom_write_byte: { asl.z rom_bank1_bank_unshifted rol.z rom_bank1_bank_unshifted+1 // unsigned char bank = BYTE1(bank_unshifted) - // [2706] 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 + // [2706] 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 // [2707] rom_write_byte::rom_ptr1_$2 = (unsigned int)rom_write_byte::address#4 -- vwuz1=_word_vduz2 @@ -17968,13 +17167,12 @@ rom_write_byte: { sta.z rom_ptr1_return+1 // rom_write_byte::bank_set_brom1 // BROM = bank - // [2710] BROM = rom_write_byte::rom_bank1_return#0 -- vbuz1=vbuz2 - lda.z rom_bank1_return - sta.z BROM + // [2710] BROM = rom_write_byte::rom_bank1_return#0 -- vbuz1=vbuxx + stx.z BROM // rom_write_byte::@1 // *ptr_rom = value - // [2711] *((char *)rom_write_byte::rom_ptr1_return#0) = rom_write_byte::value#10 -- _deref_pbuz1=vbuz2 - lda.z value + // [2711] *((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 @@ -18018,25 +17216,19 @@ cbm_k_setlfs: { * @param stream FILE* stream. * @return int Contains a non-zero value if there is an error. */ -// __mem() int ferror(__zp($ce) struct $2 *stream) +// __mem() int ferror(__zp($b1) struct $2 *stream) ferror: { - .label ferror__6 = $2c - .label ferror__15 = $ea - .label cbm_k_setnam1_ferror__0 = $54 - .label cbm_k_readst1_status = $f9 - .label cbm_k_chrin2_ch = $fa - .label stream = $ce - .label sp = $53 - .label cbm_k_chrin1_return = $ea - .label ch = $ea - .label cbm_k_readst1_return = $2c - .label st = $2c - .label cbm_k_chrin2_return = $ea - .label errno_parsed = $cc + .label cbm_k_setnam1_ferror__0 = $43 + .label cbm_k_readst1_status = $da + .label cbm_k_chrin2_ch = $db + .label stream = $b1 + .label ch = $cf + .label errno_len = $dc + .label errno_parsed = $d3 // unsigned char sp = (unsigned char)stream - // [2715] ferror::sp#0 = (char)ferror::stream#0 -- vbuz1=_byte_pssz2 + // [2715] ferror::sp#0 = (char)ferror::stream#0 -- vbum1=_byte_pssz2 lda.z stream - sta.z sp + sta sp // cbm_k_setlfs(15, 8, 15) // [2716] cbm_k_setlfs::channel = $f -- vbum1=vbuc1 lda #$f @@ -18108,19 +17300,19 @@ ferror: { jsr CBM_CHRIN sta cbm_k_chrin1_ch // return ch; - // [2733] ferror::cbm_k_chrin1_return#0 = ferror::cbm_k_chrin1_ch -- vbuz1=vbum2 - sta.z cbm_k_chrin1_return + // [2733] ferror::cbm_k_chrin1_return#0 = ferror::cbm_k_chrin1_ch -- vbuaa=vbum1 // ferror::cbm_k_chrin1_@return // } // [2734] ferror::cbm_k_chrin1_return#1 = ferror::cbm_k_chrin1_return#0 // ferror::@7 // char ch = cbm_k_chrin() - // [2735] ferror::ch#0 = ferror::cbm_k_chrin1_return#1 + // [2735] ferror::ch#0 = ferror::cbm_k_chrin1_return#1 -- vbuz1=vbuaa + sta.z ch // [2736] phi from ferror::@7 to ferror::cbm_k_readst1 [phi:ferror::@7->ferror::cbm_k_readst1] - // [2736] phi __errno#18 = __errno#302 [phi:ferror::@7->ferror::cbm_k_readst1#0] -- register_copy - // [2736] phi ferror::errno_len#10 = 0 [phi:ferror::@7->ferror::cbm_k_readst1#1] -- vbum1=vbuc1 + // [2736] phi __errno#18 = __errno#318 [phi:ferror::@7->ferror::cbm_k_readst1#0] -- register_copy + // [2736] phi ferror::errno_len#10 = 0 [phi:ferror::@7->ferror::cbm_k_readst1#1] -- vbuz1=vbuc1 lda #0 - sta errno_len + sta.z errno_len // [2736] phi ferror::ch#10 = ferror::ch#0 [phi:ferror::@7->ferror::cbm_k_readst1#2] -- register_copy // [2736] phi ferror::errno_parsed#2 = 0 [phi:ferror::@7->ferror::cbm_k_readst1#3] -- vbuz1=vbuc1 sta.z errno_parsed @@ -18135,8 +17327,7 @@ ferror: { jsr CBM_READST sta cbm_k_readst1_status // return status; - // [2739] ferror::cbm_k_readst1_return#0 = ferror::cbm_k_readst1_status -- vbuz1=vbuz2 - sta.z cbm_k_readst1_return + // [2739] ferror::cbm_k_readst1_return#0 = ferror::cbm_k_readst1_status -- vbuaa=vbuz1 // ferror::cbm_k_readst1_@return // } // [2740] ferror::cbm_k_readst1_return#1 = ferror::cbm_k_readst1_return#0 @@ -18146,13 +17337,13 @@ ferror: { // st = cbm_k_readst() // [2742] ferror::st#1 = ferror::$6 // while (!(st = cbm_k_readst())) - // [2743] if(0==ferror::st#1) goto ferror::@1 -- 0_eq_vbuz1_then_la1 - lda.z st + // [2743] if(0==ferror::st#1) goto ferror::@1 -- 0_eq_vbuaa_then_la1 + cmp #0 beq __b1 // ferror::@2 // __status = st - // [2744] ((char *)&__stdio_file+$46)[ferror::sp#0] = ferror::st#1 -- pbuc1_derefidx_vbuz1=vbuz2 - ldy.z sp + // [2744] ((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) // [2745] ferror::cbm_k_close1_channel = $f -- vbum1=vbuc1 @@ -18190,8 +17381,8 @@ ferror: { // [2751] ferror::errno_parsed#1 = ++ ferror::errno_parsed#2 -- vbuz1=_inc_vbuz1 inc.z errno_parsed // strncpy(temp, __errno_error, errno_len+1) - // [2752] strncpy::n#0 = ferror::errno_len#10 + 1 -- vwuz1=vbum2_plus_1 - lda errno_len + // [2752] strncpy::n#0 = ferror::errno_len#10 + 1 -- vwuz1=vbuz2_plus_1 + lda.z errno_len clc adc #1 sta.z strncpy.n @@ -18238,13 +17429,13 @@ ferror: { // ferror::@3 __b3: // __errno_error[errno_len] = ch - // [2759] __errno_error[ferror::errno_len#10] = ferror::ch#10 -- pbuc1_derefidx_vbum1=vbuz2 + // [2759] __errno_error[ferror::errno_len#10] = ferror::ch#10 -- pbuc1_derefidx_vbuz1=vbuz2 lda.z ch - ldy errno_len + ldy.z errno_len sta __errno_error,y // errno_len++; - // [2760] ferror::errno_len#1 = ++ ferror::errno_len#10 -- vbum1=_inc_vbum1 - inc errno_len + // [2760] ferror::errno_len#1 = ++ ferror::errno_len#10 -- vbuz1=_inc_vbuz1 + inc.z errno_len // ferror::cbm_k_chrin2 // char ch // [2761] ferror::cbm_k_chrin2_ch = 0 -- vbuz1=vbuc1 @@ -18255,8 +17446,7 @@ ferror: { jsr CBM_CHRIN sta cbm_k_chrin2_ch // return ch; - // [2763] ferror::cbm_k_chrin2_return#0 = ferror::cbm_k_chrin2_ch -- vbuz1=vbuz2 - sta.z cbm_k_chrin2_return + // [2763] ferror::cbm_k_chrin2_return#0 = ferror::cbm_k_chrin2_ch -- vbuaa=vbuz1 // ferror::cbm_k_chrin2_@return // } // [2764] ferror::cbm_k_chrin2_return#1 = ferror::cbm_k_chrin2_return#0 @@ -18264,7 +17454,8 @@ ferror: { // cbm_k_chrin() // [2765] ferror::$15 = ferror::cbm_k_chrin2_return#1 // ch = cbm_k_chrin() - // [2766] ferror::ch#1 = ferror::$15 + // [2766] ferror::ch#1 = ferror::$15 -- vbuz1=vbuaa + sta.z ch // [2736] phi from ferror::@10 to ferror::cbm_k_readst1 [phi:ferror::@10->ferror::cbm_k_readst1] // [2736] phi __errno#18 = __errno#107 [phi:ferror::@10->ferror::cbm_k_readst1#0] -- register_copy // [2736] phi ferror::errno_len#10 = ferror::errno_len#1 [phi:ferror::@10->ferror::cbm_k_readst1#1] -- register_copy @@ -18280,24 +17471,20 @@ ferror: { cbm_k_chrin1_ch: .byte 0 cbm_k_close1_channel: .byte 0 return: .word 0 - .label errno_len = main.main__342 + sp: .byte 0 } .segment Code // atoi // Converts the string argument str to an integer. -// __zp($5d) int atoi(__zp($d2) const char *str) +// __zp($4b) int atoi(__zp($b5) const char *str) atoi: { - .label atoi__6 = $5d - .label atoi__7 = $5d - .label res = $5d - // Initialize sign as positive - .label i = $ca - .label return = $5d - .label str = $d2 - // Initialize result - .label negative = $d4 - .label atoi__10 = $4c - .label atoi__11 = $5d + .label atoi__6 = $4b + .label atoi__7 = $4b + .label res = $4b + .label return = $4b + .label str = $b5 + .label atoi__10 = $3c + .label atoi__11 = $4b // if (str[i] == '-') // [2768] if(*atoi::str#2!='-') goto atoi::@3 -- _deref_pbuz1_neq_vbuc1_then_la1 ldy #0 @@ -18307,38 +17494,35 @@ atoi: { // [2769] phi from atoi to atoi::@2 [phi:atoi->atoi::@2] // atoi::@2 // [2770] phi from atoi::@2 to atoi::@3 [phi:atoi::@2->atoi::@3] - // [2770] phi atoi::negative#2 = 1 [phi:atoi::@2->atoi::@3#0] -- vbuz1=vbuc1 - lda #1 - sta.z negative + // [2770] phi atoi::negative#2 = 1 [phi:atoi::@2->atoi::@3#0] -- vbuxx=vbuc1 + ldx #1 // [2770] phi atoi::res#2 = 0 [phi:atoi::@2->atoi::@3#1] -- vwsz1=vwsc1 tya sta.z res sta.z res+1 - // [2770] phi atoi::i#4 = 1 [phi:atoi::@2->atoi::@3#2] -- vbuz1=vbuc1 - lda #1 - sta.z i + // [2770] 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 // [2770] phi from atoi to atoi::@3 [phi:atoi->atoi::@3] __b2: - // [2770] phi atoi::negative#2 = 0 [phi:atoi->atoi::@3#0] -- vbuz1=vbuc1 - lda #0 - sta.z negative + // [2770] phi atoi::negative#2 = 0 [phi:atoi->atoi::@3#0] -- vbuxx=vbuc1 + ldx #0 // [2770] phi atoi::res#2 = 0 [phi:atoi->atoi::@3#1] -- vwsz1=vwsc1 + txa sta.z res sta.z res+1 - // [2770] phi atoi::i#4 = 0 [phi:atoi->atoi::@3#2] -- vbuz1=vbuc1 - sta.z i + // [2770] phi atoi::i#4 = 0 [phi:atoi->atoi::@3#2] -- vbuyy=vbuc1 + tay // atoi::@3 __b3: // for (; str[i]>='0' && str[i]<='9'; ++i) - // [2771] if(atoi::str#2[atoi::i#4]<'0') goto atoi::@5 -- pbuz1_derefidx_vbuz2_lt_vbuc1_then_la1 - ldy.z i + // [2771] 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 - // [2772] if(atoi::str#2[atoi::i#4]<='9') goto atoi::@4 -- pbuz1_derefidx_vbuz2_le_vbuc1_then_la1 + // [2772] 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 @@ -18346,9 +17530,9 @@ atoi: { // atoi::@5 __b5: // if(negative) - // [2773] if(0!=atoi::negative#2) goto atoi::@1 -- 0_neq_vbuz1_then_la1 + // [2773] if(0!=atoi::negative#2) goto atoi::@1 -- 0_neq_vbuxx_then_la1 // Return result with sign - lda.z negative + cpx #0 bne __b1 // [2775] phi from atoi::@1 atoi::@5 to atoi::@return [phi:atoi::@1/atoi::@5->atoi::@return] // [2775] phi atoi::return#2 = atoi::return#0 [phi:atoi::@1/atoi::@5->atoi::@return#0] -- register_copy @@ -18392,8 +17576,7 @@ atoi: { asl.z atoi__6 rol.z atoi__6+1 // res * 10 + str[i] - // [2780] atoi::$7 = atoi::$6 + atoi::str#2[atoi::i#4] -- vwsz1=vwsz1_plus_pbuz2_derefidx_vbuz3 - ldy.z i + // [2780] atoi::$7 = atoi::$6 + atoi::str#2[atoi::i#4] -- vwsz1=vwsz1_plus_pbuz2_derefidx_vbuyy lda.z atoi__7 clc adc (str),y @@ -18411,8 +17594,8 @@ atoi: { dec.z res+1 !: // for (; str[i]>='0' && str[i]<='9'; ++i) - // [2782] atoi::i#2 = ++ atoi::i#4 -- vbuz1=_inc_vbuz1 - inc.z i + // [2782] atoi::i#2 = ++ atoi::i#4 -- vbuyy=_inc_vbuyy + iny // [2770] phi from atoi::@4 to atoi::@3 [phi:atoi::@4->atoi::@3] // [2770] phi atoi::negative#2 = atoi::negative#2 [phi:atoi::@4->atoi::@3#0] -- register_copy // [2770] phi atoi::res#2 = atoi::res#1 [phi:atoi::@4->atoi::@3#1] -- register_copy @@ -18428,12 +17611,12 @@ atoi: { * @return y the size of bytes read * @return if carry is set there is an error */ -// __zp($73) unsigned int cx16_k_macptr(__zp($c7) volatile char bytes, __zp($c2) void * volatile buffer) +// __zp($5d) unsigned int cx16_k_macptr(__zp($ab) volatile char bytes, __zp($7e) void * volatile buffer) cx16_k_macptr: { - .label bytes = $c7 - .label buffer = $c2 - .label bytes_read = $ad - .label return = $73 + .label bytes = $ab + .label buffer = $7e + .label bytes_read = $6c + .label return = $5d // unsigned int bytes_read // [2783] cx16_k_macptr::bytes_read = 0 -- vwuz1=vwuc1 lda #<0 @@ -18474,29 +17657,23 @@ cx16_k_macptr: { // - 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($30) char uctoa_append(__zp($6b) char *buffer, __zp($30) char value, __zp($3c) char sub) +// __register(X) char uctoa_append(__zp($55) char *buffer, __register(X) char value, __zp($38) char sub) uctoa_append: { - .label buffer = $6b - .label value = $30 - .label sub = $3c - .label return = $30 - .label digit = $37 + .label buffer = $55 + .label sub = $38 // [2789] phi from uctoa_append to uctoa_append::@1 [phi:uctoa_append->uctoa_append::@1] - // [2789] phi uctoa_append::digit#2 = 0 [phi:uctoa_append->uctoa_append::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z digit + // [2789] phi uctoa_append::digit#2 = 0 [phi:uctoa_append->uctoa_append::@1#0] -- vbuyy=vbuc1 + ldy #0 // [2789] 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) - // [2790] if(uctoa_append::value#2>=uctoa_append::sub#0) goto uctoa_append::@2 -- vbuz1_ge_vbuz2_then_la1 - lda.z value - cmp.z sub + // [2790] if(uctoa_append::value#2>=uctoa_append::sub#0) goto uctoa_append::@2 -- vbuxx_ge_vbuz1_then_la1 + cpx.z sub bcs __b2 // uctoa_append::@3 // *buffer = DIGITS[digit] - // [2791] *uctoa_append::buffer#0 = DIGITS[uctoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbuz2 - ldy.z digit + // [2791] *uctoa_append::buffer#0 = DIGITS[uctoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbuyy lda DIGITS,y ldy #0 sta (buffer),y @@ -18507,14 +17684,14 @@ uctoa_append: { // uctoa_append::@2 __b2: // digit++; - // [2793] uctoa_append::digit#1 = ++ uctoa_append::digit#2 -- vbuz1=_inc_vbuz1 - inc.z digit + // [2793] uctoa_append::digit#1 = ++ uctoa_append::digit#2 -- vbuyy=_inc_vbuyy + iny // value -= sub - // [2794] uctoa_append::value#1 = uctoa_append::value#2 - uctoa_append::sub#0 -- vbuz1=vbuz1_minus_vbuz2 - lda.z value + // [2794] uctoa_append::value#1 = uctoa_append::value#2 - uctoa_append::sub#0 -- vbuxx=vbuxx_minus_vbuz1 + txa sec sbc.z sub - sta.z value + tax // [2789] phi from uctoa_append::@2 to uctoa_append::@1 [phi:uctoa_append::@2->uctoa_append::@1] // [2789] phi uctoa_append::digit#2 = uctoa_append::digit#1 [phi:uctoa_append::@2->uctoa_append::@1#0] -- register_copy // [2789] phi uctoa_append::value#2 = uctoa_append::value#1 [phi:uctoa_append::@2->uctoa_append::@1#1] -- register_copy @@ -18530,29 +17707,24 @@ uctoa_append: { * @param address The 22 bit ROM address. * @param value The byte value to be written. */ -// __zp($53) char rom_byte_compare(__zp($6d) char *ptr_rom, __zp($61) char value) +// __register(A) char rom_byte_compare(__zp($57) char *ptr_rom, __register(A) char value) rom_byte_compare: { - .label return = $53 - .label ptr_rom = $6d - .label value = $61 + .label ptr_rom = $57 // if (*ptr_rom != value) - // [2795] 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 + // [2795] 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 // [2796] phi from rom_byte_compare to rom_byte_compare::@2 [phi:rom_byte_compare->rom_byte_compare::@2] // rom_byte_compare::@2 // [2797] phi from rom_byte_compare::@2 to rom_byte_compare::@1 [phi:rom_byte_compare::@2->rom_byte_compare::@1] - // [2797] phi rom_byte_compare::return#0 = 0 [phi:rom_byte_compare::@2->rom_byte_compare::@1#0] -- vbuz1=vbuc1 + // [2797] phi rom_byte_compare::return#0 = 0 [phi:rom_byte_compare::@2->rom_byte_compare::@1#0] -- vbuaa=vbuc1 tya - sta.z return rts // [2797] phi from rom_byte_compare to rom_byte_compare::@1 [phi:rom_byte_compare->rom_byte_compare::@1] __b2: - // [2797] phi rom_byte_compare::return#0 = 1 [phi:rom_byte_compare->rom_byte_compare::@1#0] -- vbuz1=vbuc1 + // [2797] 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 // } @@ -18568,17 +17740,15 @@ 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. -// __zp($31) unsigned long ultoa_append(__zp($3f) char *buffer, __zp($31) unsigned long value, __zp($41) unsigned long sub) +// __zp($27) unsigned long ultoa_append(__zp($32) char *buffer, __zp($27) unsigned long value, __zp($34) unsigned long sub) ultoa_append: { - .label buffer = $3f - .label value = $31 - .label sub = $41 - .label return = $31 - .label digit = $2c + .label buffer = $32 + .label value = $27 + .label sub = $34 + .label return = $27 // [2800] phi from ultoa_append to ultoa_append::@1 [phi:ultoa_append->ultoa_append::@1] - // [2800] phi ultoa_append::digit#2 = 0 [phi:ultoa_append->ultoa_append::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z digit + // [2800] phi ultoa_append::digit#2 = 0 [phi:ultoa_append->ultoa_append::@1#0] -- vbuxx=vbuc1 + ldx #0 // [2800] phi ultoa_append::value#2 = ultoa_append::value#0 [phi:ultoa_append->ultoa_append::@1#1] -- register_copy // ultoa_append::@1 __b1: @@ -18602,9 +17772,8 @@ ultoa_append: { !: // ultoa_append::@3 // *buffer = DIGITS[digit] - // [2802] *ultoa_append::buffer#0 = DIGITS[ultoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbuz2 - ldy.z digit - lda DIGITS,y + // [2802] *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 @@ -18614,8 +17783,8 @@ ultoa_append: { // ultoa_append::@2 __b2: // digit++; - // [2804] ultoa_append::digit#1 = ++ ultoa_append::digit#2 -- vbuz1=_inc_vbuz1 - inc.z digit + // [2804] ultoa_append::digit#1 = ++ ultoa_append::digit#2 -- vbuxx=_inc_vbuxx + inx // value -= sub // [2805] ultoa_append::value#1 = ultoa_append::value#2 - ultoa_append::sub#0 -- vduz1=vduz1_minus_vduz2 lda.z value @@ -18650,38 +17819,33 @@ 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($3d) char *ptr_rom) +// void rom_wait(__zp($30) char *ptr_rom) rom_wait: { - .label rom_wait__0 = $36 - .label rom_wait__1 = $2d - .label test1 = $36 - .label test2 = $2d - .label ptr_rom = $3d + .label rom_wait__0 = $2e + .label ptr_rom = $30 // rom_wait::@1 __b1: // test1 = *((brom_ptr_t)ptr_rom) - // [2807] rom_wait::test1#1 = *rom_wait::ptr_rom#3 -- vbuz1=_deref_pbuz2 + // [2807] 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) - // [2808] rom_wait::test2#1 = *rom_wait::ptr_rom#3 -- vbuz1=_deref_pbuz2 + // [2808] rom_wait::test2#1 = *rom_wait::ptr_rom#3 -- vbuyy=_deref_pbuz1 lda (ptr_rom),y - sta.z test2 + tay // test1 & 0x40 - // [2809] rom_wait::$0 = rom_wait::test1#1 & $40 -- vbuz1=vbuz1_band_vbuc1 - lda #$40 - and.z rom_wait__0 + // [2809] rom_wait::$0 = rom_wait::test1#1 & $40 -- vbuz1=vbuxx_band_vbuc1 + txa + and #$40 sta.z rom_wait__0 // test2 & 0x40 - // [2810] rom_wait::$1 = rom_wait::test2#1 & $40 -- vbuz1=vbuz1_band_vbuc1 - lda #$40 - and.z rom_wait__1 - sta.z rom_wait__1 + // [2810] rom_wait::$1 = rom_wait::test2#1 & $40 -- vbuaa=vbuyy_band_vbuc1 + tya + and #$40 // while ((test1 & 0x40) != (test2 & 0x40)) - // [2811] 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 + // [2811] 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 // } @@ -18696,13 +17860,12 @@ rom_wait: { * @param value The byte value to be written. */ /* inline */ -// void rom_byte_program(__zp($56) unsigned long address, __zp($5a) char value) +// void rom_byte_program(__zp($45) unsigned long address, __register(Y) char value) rom_byte_program: { - .label rom_ptr1_rom_byte_program__0 = $5b - .label rom_ptr1_rom_byte_program__2 = $5b - .label rom_ptr1_return = $5b - .label address = $56 - .label value = $5a + .label rom_ptr1_rom_byte_program__0 = $49 + .label rom_ptr1_rom_byte_program__2 = $49 + .label rom_ptr1_return = $49 + .label address = $45 // rom_byte_program::rom_ptr1 // (unsigned int)(address) & ROM_PTR_MASK // [2814] rom_byte_program::rom_ptr1_$2 = (unsigned int)rom_byte_program::address#0 -- vwuz1=_word_vduz2 @@ -18760,17 +17923,15 @@ 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. -// __zp($2e) unsigned int utoa_append(__zp($4e) char *buffer, __zp($2e) unsigned int value, __zp($3f) unsigned int sub) +// __zp($25) unsigned int utoa_append(__zp($3e) char *buffer, __zp($25) unsigned int value, __zp($32) unsigned int sub) utoa_append: { - .label buffer = $4e - .label value = $2e - .label sub = $3f - .label return = $2e - .label digit = $2c + .label buffer = $3e + .label value = $25 + .label sub = $32 + .label return = $25 // [2824] phi from utoa_append to utoa_append::@1 [phi:utoa_append->utoa_append::@1] - // [2824] phi utoa_append::digit#2 = 0 [phi:utoa_append->utoa_append::@1#0] -- vbuz1=vbuc1 - lda #0 - sta.z digit + // [2824] phi utoa_append::digit#2 = 0 [phi:utoa_append->utoa_append::@1#0] -- vbuxx=vbuc1 + ldx #0 // [2824] phi utoa_append::value#2 = utoa_append::value#0 [phi:utoa_append->utoa_append::@1#1] -- register_copy // utoa_append::@1 __b1: @@ -18786,9 +17947,8 @@ utoa_append: { bcc __b2 // utoa_append::@3 // *buffer = DIGITS[digit] - // [2826] *utoa_append::buffer#0 = DIGITS[utoa_append::digit#2] -- _deref_pbuz1=pbuc1_derefidx_vbuz2 - ldy.z digit - lda DIGITS,y + // [2826] *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 @@ -18798,8 +17958,8 @@ utoa_append: { // utoa_append::@2 __b2: // digit++; - // [2828] utoa_append::digit#1 = ++ utoa_append::digit#2 -- vbuz1=_inc_vbuz1 - inc.z digit + // [2828] utoa_append::digit#1 = ++ utoa_append::digit#2 -- vbuxx=_inc_vbuxx + inx // value -= sub // [2829] utoa_append::value#1 = utoa_append::value#2 - utoa_append::sub#0 -- vwuz1=vwuz1_minus_vwuz2 lda.z value @@ -18828,46 +17988,35 @@ 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(__zp($25) char dbank_vram, __zp($38) unsigned int doffset_vram, __zp($24) char sbank_vram, __zp($2a) unsigned int soffset_vram, __zp($23) char num8) +// void memcpy8_vram_vram(__zp($2f) char dbank_vram, __zp($2c) unsigned int doffset_vram, __register(Y) char sbank_vram, __zp($23) unsigned int soffset_vram, __register(X) 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 = $38 - .label sbank_vram = $24 - .label soffset_vram = $2a - .label num8_1 = $22 + .label dbank_vram = $2f + .label doffset_vram = $2c + .label soffset_vram = $23 + .label num8 = $22 // *VERA_CTRL &= ~VERA_ADDRSEL // [2830] *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) - // [2831] memcpy8_vram_vram::$0 = byte0 memcpy8_vram_vram::soffset_vram#0 -- vbuz1=_byte0_vwuz2 + // [2831] memcpy8_vram_vram::$0 = byte0 memcpy8_vram_vram::soffset_vram#0 -- vbuaa=_byte0_vwuz1 lda.z soffset_vram - sta.z memcpy8_vram_vram__0 // *VERA_ADDRX_L = BYTE0(soffset_vram) - // [2832] *VERA_ADDRX_L = memcpy8_vram_vram::$0 -- _deref_pbuc1=vbuz1 + // [2832] *VERA_ADDRX_L = memcpy8_vram_vram::$0 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_L // BYTE1(soffset_vram) - // [2833] memcpy8_vram_vram::$1 = byte1 memcpy8_vram_vram::soffset_vram#0 -- vbuz1=_byte1_vwuz2 + // [2833] memcpy8_vram_vram::$1 = byte1 memcpy8_vram_vram::soffset_vram#0 -- vbuaa=_byte1_vwuz1 lda.z soffset_vram+1 - sta.z memcpy8_vram_vram__1 // *VERA_ADDRX_M = BYTE1(soffset_vram) - // [2834] *VERA_ADDRX_M = memcpy8_vram_vram::$1 -- _deref_pbuc1=vbuz1 + // [2834] *VERA_ADDRX_M = memcpy8_vram_vram::$1 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_M // sbank_vram | VERA_INC_1 - // [2835] 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 + // [2835] memcpy8_vram_vram::$2 = memcpy8_vram_vram::sbank_vram#0 | VERA_INC_1 -- vbuaa=vbuyy_bor_vbuc1 + tya + ora #VERA_INC_1 // *VERA_ADDRX_H = sbank_vram | VERA_INC_1 - // [2836] *VERA_ADDRX_H = memcpy8_vram_vram::$2 -- _deref_pbuc1=vbuz1 + // [2836] *VERA_ADDRX_H = memcpy8_vram_vram::$2 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_H // *VERA_CTRL |= VERA_ADDRSEL // [2837] *VERA_CTRL = *VERA_CTRL | VERA_ADDRSEL -- _deref_pbuc1=_deref_pbuc1_bor_vbuc2 @@ -18875,26 +18024,23 @@ memcpy8_vram_vram: { ora VERA_CTRL sta VERA_CTRL // BYTE0(doffset_vram) - // [2838] memcpy8_vram_vram::$3 = byte0 memcpy8_vram_vram::doffset_vram#0 -- vbuz1=_byte0_vwuz2 + // [2838] memcpy8_vram_vram::$3 = byte0 memcpy8_vram_vram::doffset_vram#0 -- vbuaa=_byte0_vwuz1 lda.z doffset_vram - sta.z memcpy8_vram_vram__3 // *VERA_ADDRX_L = BYTE0(doffset_vram) - // [2839] *VERA_ADDRX_L = memcpy8_vram_vram::$3 -- _deref_pbuc1=vbuz1 + // [2839] *VERA_ADDRX_L = memcpy8_vram_vram::$3 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_L // BYTE1(doffset_vram) - // [2840] memcpy8_vram_vram::$4 = byte1 memcpy8_vram_vram::doffset_vram#0 -- vbuz1=_byte1_vwuz2 + // [2840] memcpy8_vram_vram::$4 = byte1 memcpy8_vram_vram::doffset_vram#0 -- vbuaa=_byte1_vwuz1 lda.z doffset_vram+1 - sta.z memcpy8_vram_vram__4 // *VERA_ADDRX_M = BYTE1(doffset_vram) - // [2841] *VERA_ADDRX_M = memcpy8_vram_vram::$4 -- _deref_pbuc1=vbuz1 + // [2841] *VERA_ADDRX_M = memcpy8_vram_vram::$4 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_M // dbank_vram | VERA_INC_1 - // [2842] memcpy8_vram_vram::$5 = memcpy8_vram_vram::dbank_vram#0 | VERA_INC_1 -- vbuz1=vbuz1_bor_vbuc1 + // [2842] memcpy8_vram_vram::$5 = memcpy8_vram_vram::dbank_vram#0 | VERA_INC_1 -- vbuaa=vbuz1_bor_vbuc1 lda #VERA_INC_1 - ora.z memcpy8_vram_vram__5 - sta.z memcpy8_vram_vram__5 + ora.z dbank_vram // *VERA_ADDRX_H = dbank_vram | VERA_INC_1 - // [2843] *VERA_ADDRX_H = memcpy8_vram_vram::$5 -- _deref_pbuc1=vbuz1 + // [2843] *VERA_ADDRX_H = memcpy8_vram_vram::$5 -- _deref_pbuc1=vbuaa sta VERA_ADDRX_H // [2844] 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: @@ -18902,12 +18048,11 @@ memcpy8_vram_vram: { // the size is only a byte, this is the fastest loop! // memcpy8_vram_vram::@1 // while (num8--) - // [2845] memcpy8_vram_vram::num8#0 = -- memcpy8_vram_vram::num8#2 -- vbuz1=_dec_vbuz2 - ldy.z num8_1 - dey - sty.z num8 + // [2845] memcpy8_vram_vram::num8#0 = -- memcpy8_vram_vram::num8#2 -- vbuxx=_dec_vbuz1 + ldx.z num8 + dex // [2846] if(0!=memcpy8_vram_vram::num8#2) goto memcpy8_vram_vram::@2 -- 0_neq_vbuz1_then_la1 - lda.z num8_1 + lda.z num8 bne __b2 // memcpy8_vram_vram::@return // } @@ -18919,9 +18064,8 @@ memcpy8_vram_vram: { // [2848] *VERA_DATA1 = *VERA_DATA0 -- _deref_pbuc1=_deref_pbuc2 lda VERA_DATA0 sta VERA_DATA1 - // [2849] memcpy8_vram_vram::num8#6 = memcpy8_vram_vram::num8#0 -- vbuz1=vbuz2 - lda.z num8 - sta.z num8_1 + // [2849] memcpy8_vram_vram::num8#6 = memcpy8_vram_vram::num8#0 -- vbuz1=vbuxx + stx.z num8 jmp __b1 } // File Data @@ -19064,15 +18208,15 @@ memcpy8_vram_vram: { .byte 0 __43: .text "Errors indicate your J1 jumpers are not properly set!" .byte 0 - __44: .text "The SMC chip in your CX16 system does not contain a valid bootloader." + __44: .text "The SMC chip in your CX16 doesn't have a valid bootloader." .byte 0 __46: .text "A valid bootloader is needed to update the SMC chip." .byte 0 __47: .text "Unfortunately, your SMC chip cannot be updated using this tool!" .byte 0 - __49: .text "You will either need to install or downgrade the bootloader onto" + __49: .text "You will either need to install or downgrade the bootloader" .byte 0 - __50: .text "the SMC chip on your CX16 using an arduino device," + __50: .text "onto the SMC chip on your CX16 using an arduino device," .byte 0 __51: .text "or alternatively to order a new SMC chip from TexElec or" .byte 0 @@ -19144,9 +18288,6 @@ memcpy8_vram_vram: { // The number of chars that would have been filled when printing without capacity. Grows even after size>capacity. /// Used to hold state while printing __snprintf_size: .word 0 - /// Current position in the buffer being filled ( initially *s passed to snprintf() - /// Used to hold state while printing - __snprintf_buffer: .word 0 __stdio_file: .fill SIZEOF_STRUCT___2, 0 __stdio_filecount: .byte 0 // Globals @@ -19157,7 +18298,7 @@ memcpy8_vram_vram: { 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 445da4b..d8a0956 100644 --- a/target/src/cx16-update.klog +++ b/target/src/cx16-update.klog @@ -15,10 +15,10 @@ Basic-segment: $0801-$080c Basic Code-segment: - $080d-$4f2f Code + $080d-$4979 Code Data-segment: - $4f30-$693a Data + $497a-$6351 Data Writing Vice symbol file: cx16-update.vs Writing Symbol file: cx16-update.sym diff --git a/target/src/cx16-update.prg b/target/src/cx16-update.prg index 5b45c4a..95536f6 100644 Binary files a/target/src/cx16-update.prg and b/target/src/cx16-update.prg differ